@aurodesignsystem-dev/auro-formkit 0.0.0-pr1413.2 → 0.0.0-pr1419.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/package.json +32 -31
  2. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -66
  3. package/components/bibtemplate/dist/buttonVersion.d.ts +0 -2
  4. package/components/bibtemplate/dist/headerVersion.d.ts +0 -2
  5. package/components/bibtemplate/dist/iconVersion.d.ts +0 -2
  6. package/components/bibtemplate/dist/index.d.ts +0 -2
  7. package/components/bibtemplate/dist/index.js +0 -395
  8. package/components/bibtemplate/dist/registered.js +0 -395
  9. package/components/bibtemplate/dist/styles/color-css.d.ts +0 -2
  10. package/components/bibtemplate/dist/styles/style-css.d.ts +0 -2
  11. package/components/bibtemplate/dist/styles/tokens-css.d.ts +0 -2
  12. package/components/checkbox/demo/api.md +0 -489
  13. package/components/checkbox/demo/api.min.js +0 -2133
  14. package/components/checkbox/demo/index.md +0 -55
  15. package/components/checkbox/demo/index.min.js +0 -2108
  16. package/components/checkbox/demo/keyboardBehavior.md +0 -0
  17. package/components/checkbox/demo/readme.md +0 -142
  18. package/components/checkbox/dist/auro-checkbox-group.d.ts +0 -176
  19. package/components/checkbox/dist/auro-checkbox.d.ts +0 -209
  20. package/components/checkbox/dist/index.d.ts +0 -3
  21. package/components/checkbox/dist/index.js +0 -2057
  22. package/components/checkbox/dist/registered.js +0 -2058
  23. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +0 -2
  24. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +0 -2
  25. package/components/checkbox/dist/styles/color-css.d.ts +0 -2
  26. package/components/checkbox/dist/styles/colorGroup-css.d.ts +0 -2
  27. package/components/checkbox/dist/styles/tokens-css.d.ts +0 -2
  28. package/components/combobox/demo/api.md +0 -2287
  29. package/components/combobox/demo/api.min.js +0 -17800
  30. package/components/combobox/demo/index.md +0 -196
  31. package/components/combobox/demo/index.min.js +0 -17705
  32. package/components/combobox/demo/keyboardBehavior.md +0 -281
  33. package/components/combobox/demo/readme.md +0 -158
  34. package/components/combobox/dist/auro-combobox.d.ts +0 -566
  35. package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +0 -8
  36. package/components/combobox/dist/index.d.ts +0 -2
  37. package/components/combobox/dist/index.js +0 -15604
  38. package/components/combobox/dist/registered.js +0 -15606
  39. package/components/combobox/dist/styles/emphasized/style-css.d.ts +0 -2
  40. package/components/combobox/dist/styles/snowflake/style-css.d.ts +0 -2
  41. package/components/combobox/dist/styles/style-css.d.ts +0 -2
  42. package/components/counter/demo/api.md +0 -1285
  43. package/components/counter/demo/api.min.js +0 -8112
  44. package/components/counter/demo/index.md +0 -92
  45. package/components/counter/demo/index.min.js +0 -8093
  46. package/components/counter/demo/keyboardBehavior.md +0 -127
  47. package/components/counter/demo/readme.md +0 -161
  48. package/components/counter/dist/auro-counter-button.d.ts +0 -14
  49. package/components/counter/dist/auro-counter-group.d.ts +0 -390
  50. package/components/counter/dist/auro-counter-wrapper.d.ts +0 -17
  51. package/components/counter/dist/auro-counter.d.ts +0 -136
  52. package/components/counter/dist/buttonVersion.d.ts +0 -2
  53. package/components/counter/dist/iconVersion.d.ts +0 -2
  54. package/components/counter/dist/index.d.ts +0 -3
  55. package/components/counter/dist/index.js +0 -8015
  56. package/components/counter/dist/keyboardStrategy.d.ts +0 -4
  57. package/components/counter/dist/registered.js +0 -8016
  58. package/components/counter/dist/styles/color-css.d.ts +0 -2
  59. package/components/counter/dist/styles/counter-button-color-css.d.ts +0 -2
  60. package/components/counter/dist/styles/counter-button-css.d.ts +0 -2
  61. package/components/counter/dist/styles/counter-group-css.d.ts +0 -2
  62. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +0 -2
  63. package/components/counter/dist/styles/counter-wrapper-css.d.ts +0 -2
  64. package/components/counter/dist/styles/shapeSize-css.d.ts +0 -2
  65. package/components/counter/dist/styles/style-css.d.ts +0 -2
  66. package/components/counter/dist/styles/tokens-css.d.ts +0 -2
  67. package/components/datepicker/demo/api.md +0 -1824
  68. package/components/datepicker/demo/api.min.js +0 -24510
  69. package/components/datepicker/demo/index.md +0 -158
  70. package/components/datepicker/demo/index.min.js +0 -24231
  71. package/components/datepicker/demo/keyboardBehavior.md +0 -24
  72. package/components/datepicker/demo/readme.md +0 -137
  73. package/components/datepicker/dist/auro-calendar-cell.d.ts +0 -169
  74. package/components/datepicker/dist/auro-calendar-month.d.ts +0 -20
  75. package/components/datepicker/dist/auro-calendar.d.ts +0 -173
  76. package/components/datepicker/dist/auro-datepicker.d.ts +0 -715
  77. package/components/datepicker/dist/buttonVersion.d.ts +0 -2
  78. package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +0 -1
  79. package/components/datepicker/dist/iconVersion.d.ts +0 -2
  80. package/components/datepicker/dist/index.d.ts +0 -2
  81. package/components/datepicker/dist/index.js +0 -24146
  82. package/components/datepicker/dist/popoverVersion.d.ts +0 -2
  83. package/components/datepicker/dist/registered.js +0 -24146
  84. package/components/datepicker/dist/styles/classic/color-css.d.ts +0 -2
  85. package/components/datepicker/dist/styles/classic/style-css.d.ts +0 -2
  86. package/components/datepicker/dist/styles/color-calendar-css.d.ts +0 -2
  87. package/components/datepicker/dist/styles/color-cell-css.d.ts +0 -2
  88. package/components/datepicker/dist/styles/color-css.d.ts +0 -2
  89. package/components/datepicker/dist/styles/color-month-css.d.ts +0 -2
  90. package/components/datepicker/dist/styles/shapeSize-css.d.ts +0 -2
  91. package/components/datepicker/dist/styles/snowflake/color-css.d.ts +0 -2
  92. package/components/datepicker/dist/styles/snowflake/style-css.d.ts +0 -2
  93. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +0 -2
  94. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +0 -2
  95. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +0 -2
  96. package/components/datepicker/dist/styles/style-css.d.ts +0 -2
  97. package/components/datepicker/dist/styles/tokens-css.d.ts +0 -2
  98. package/components/datepicker/dist/utilities.d.ts +0 -78
  99. package/components/datepicker/dist/utilitiesCalendar.d.ts +0 -38
  100. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +0 -50
  101. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +0 -5
  102. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -60
  103. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +0 -1
  104. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +0 -57
  105. package/components/dropdown/demo/api.md +0 -1358
  106. package/components/dropdown/demo/api.min.js +0 -4894
  107. package/components/dropdown/demo/index.md +0 -283
  108. package/components/dropdown/demo/index.min.js +0 -4829
  109. package/components/dropdown/demo/keyboardBehavior.md +0 -77
  110. package/components/dropdown/demo/readme.md +0 -160
  111. package/components/dropdown/dist/auro-dropdown.d.ts +0 -482
  112. package/components/dropdown/dist/auro-dropdownBib.d.ts +0 -128
  113. package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +0 -7
  114. package/components/dropdown/dist/iconVersion.d.ts +0 -2
  115. package/components/dropdown/dist/index.d.ts +0 -2
  116. package/components/dropdown/dist/index.js +0 -4722
  117. package/components/dropdown/dist/registered.js +0 -4722
  118. package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +0 -2
  119. package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +0 -2
  120. package/components/dropdown/dist/styles/classic/color-css.d.ts +0 -2
  121. package/components/dropdown/dist/styles/classic/style-css.d.ts +0 -2
  122. package/components/dropdown/dist/styles/color-css.d.ts +0 -2
  123. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +0 -2
  124. package/components/dropdown/dist/styles/shapeSize-css.d.ts +0 -2
  125. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +0 -2
  126. package/components/dropdown/dist/styles/style-css.d.ts +0 -2
  127. package/components/dropdown/dist/styles/tokens-css.d.ts +0 -2
  128. package/components/form/demo/api.md +0 -319
  129. package/components/form/demo/api.min.js +0 -70505
  130. package/components/form/demo/index.md +0 -128
  131. package/components/form/demo/index.min.js +0 -70505
  132. package/components/form/demo/keyboardBehavior.md +0 -0
  133. package/components/form/demo/readme.md +0 -145
  134. package/components/form/dist/auro-form.d.ts +0 -280
  135. package/components/form/dist/index.d.ts +0 -2
  136. package/components/form/dist/index.js +0 -718
  137. package/components/form/dist/registered.d.ts +0 -1
  138. package/components/form/dist/registered.js +0 -718
  139. package/components/form/dist/styles/style-css.d.ts +0 -2
  140. package/components/helptext/dist/auro-helptext.d.ts +0 -69
  141. package/components/helptext/dist/index.d.ts +0 -2
  142. package/components/helptext/dist/index.js +0 -231
  143. package/components/helptext/dist/registered.js +0 -231
  144. package/components/helptext/dist/styles/color-css.d.ts +0 -2
  145. package/components/helptext/dist/styles/style-css.d.ts +0 -2
  146. package/components/helptext/dist/styles/tokens-css.d.ts +0 -2
  147. package/components/input/demo/api.md +0 -1397
  148. package/components/input/demo/api.min.js +0 -7460
  149. package/components/input/demo/index.md +0 -161
  150. package/components/input/demo/index.min.js +0 -7380
  151. package/components/input/demo/keyboardBehavior.md +0 -0
  152. package/components/input/demo/readme.md +0 -134
  153. package/components/input/dist/auro-input.d.ts +0 -206
  154. package/components/input/dist/base-input.d.ts +0 -629
  155. package/components/input/dist/buttonVersion.d.ts +0 -2
  156. package/components/input/dist/i18n.d.ts +0 -18
  157. package/components/input/dist/iconVersion.d.ts +0 -2
  158. package/components/input/dist/index.d.ts +0 -2
  159. package/components/input/dist/index.js +0 -7292
  160. package/components/input/dist/registered.js +0 -7292
  161. package/components/input/dist/styles/classic/color-css.d.ts +0 -2
  162. package/components/input/dist/styles/classic/style-css.d.ts +0 -2
  163. package/components/input/dist/styles/color-css.d.ts +0 -2
  164. package/components/input/dist/styles/default/borders-css.d.ts +0 -2
  165. package/components/input/dist/styles/default/color-css.d.ts +0 -2
  166. package/components/input/dist/styles/default/mixins-css.d.ts +0 -2
  167. package/components/input/dist/styles/default/notificationIcons-css.d.ts +0 -2
  168. package/components/input/dist/styles/default/style-css.d.ts +0 -2
  169. package/components/input/dist/styles/emphasized/color-css.d.ts +0 -2
  170. package/components/input/dist/styles/emphasized/style-css.d.ts +0 -2
  171. package/components/input/dist/styles/mixins-css.d.ts +0 -2
  172. package/components/input/dist/styles/shapeSize-css.d.ts +0 -2
  173. package/components/input/dist/styles/snowflake/style-css.d.ts +0 -2
  174. package/components/input/dist/styles/style-css.d.ts +0 -2
  175. package/components/input/dist/styles/tokens-css.d.ts +0 -2
  176. package/components/input/dist/utilities.d.ts +0 -25
  177. package/components/layoutElement/dist/auroElement.d.ts +0 -40
  178. package/components/layoutElement/dist/index.d.ts +0 -2
  179. package/components/layoutElement/dist/index.js +0 -107
  180. package/components/layoutElement/dist/registered.js +0 -107
  181. package/components/menu/demo/api.md +0 -1200
  182. package/components/menu/demo/api.min.js +0 -2413
  183. package/components/menu/demo/index.md +0 -72
  184. package/components/menu/demo/index.min.js +0 -2306
  185. package/components/menu/demo/keyboardBehavior.md +0 -0
  186. package/components/menu/demo/readme.md +0 -145
  187. package/components/menu/dist/auro-menu-utils.d.ts +0 -34
  188. package/components/menu/dist/auro-menu.context.d.ts +0 -239
  189. package/components/menu/dist/auro-menu.d.ts +0 -316
  190. package/components/menu/dist/auro-menuoption.d.ts +0 -210
  191. package/components/menu/dist/iconVersion.d.ts +0 -2
  192. package/components/menu/dist/index.d.ts +0 -4
  193. package/components/menu/dist/index.js +0 -2269
  194. package/components/menu/dist/registered.js +0 -2217
  195. package/components/menu/dist/styles/default/color-menu-css.d.ts +0 -2
  196. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +0 -2
  197. package/components/menu/dist/styles/default/style-menu-css.d.ts +0 -2
  198. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +0 -2
  199. package/components/menu/dist/styles/default/tokens-css.d.ts +0 -2
  200. package/components/radio/demo/api.md +0 -675
  201. package/components/radio/demo/api.min.js +0 -2210
  202. package/components/radio/demo/index.md +0 -73
  203. package/components/radio/demo/index.min.js +0 -2167
  204. package/components/radio/demo/keyboardBehavior.md +0 -0
  205. package/components/radio/demo/readme.md +0 -141
  206. package/components/radio/dist/auro-radio-group.d.ts +0 -250
  207. package/components/radio/dist/auro-radio.d.ts +0 -180
  208. package/components/radio/dist/index.d.ts +0 -3
  209. package/components/radio/dist/index.js +0 -2116
  210. package/components/radio/dist/registered.js +0 -2117
  211. package/components/radio/dist/styles/auro-radio-group-css.d.ts +0 -2
  212. package/components/radio/dist/styles/color-css.d.ts +0 -2
  213. package/components/radio/dist/styles/groupColor-css.d.ts +0 -2
  214. package/components/radio/dist/styles/style-css.d.ts +0 -2
  215. package/components/radio/dist/styles/tokens-css.d.ts +0 -2
  216. package/components/select/demo/api.md +0 -2378
  217. package/components/select/demo/api.min.js +0 -10400
  218. package/components/select/demo/index.md +0 -355
  219. package/components/select/demo/index.min.js +0 -10307
  220. package/components/select/demo/keyboardBehavior.md +0 -246
  221. package/components/select/demo/readme.md +0 -148
  222. package/components/select/dist/auro-select.d.ts +0 -545
  223. package/components/select/dist/index.d.ts +0 -2
  224. package/components/select/dist/index.js +0 -8218
  225. package/components/select/dist/registered.js +0 -8218
  226. package/components/select/dist/selectKeyboardStrategy.d.ts +0 -11
  227. package/components/select/dist/styles/emphasized/color-css.d.ts +0 -2
  228. package/components/select/dist/styles/shapeSize-css.d.ts +0 -2
  229. package/components/select/dist/styles/style-css.d.ts +0 -2
  230. package/components/select/dist/styles/tokens-css.d.ts +0 -2
  231. package/custom-elements.json +0 -18768
@@ -1,1200 +0,0 @@
1
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/api.md) -->
2
- <!-- The below content is automatically added from ./../docs/api.md -->
3
-
4
- # auro-menu
5
-
6
- The `auro-menu` element provides users a way to select from a list of options.
7
-
8
- ## Properties
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) | `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. |
29
-
30
- ## Methods
31
-
32
- | Method | Type | Description |
33
- |----------------------|-------------------------------|--------------------------------------------------|
34
- | [reset](#reset) | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
35
- | [updateActiveOption](#updateActiveOption) | `(option: HTMLElement): void` | Updates the currently active option in the menu.<br /><br />**option**: The option to set as active. |
36
-
37
- ## Events
38
-
39
- | Event | Type | Description |
40
- |-------------------------------|--------------------------------------------------|--------------------------------------------------|
41
- | `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
42
- | `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
43
- | `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
44
- | `auroMenu-optionsChange` | `CustomEvent<{ options: any; }>` | |
45
- | `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
46
- | `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
47
- | `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
48
-
49
- ## Slots
50
-
51
- | Name | Description |
52
- |---------------|---------------------------------------------|
53
- | | Slot for insertion of menu options. |
54
- | [loadingIcon](#loadingIcon) | Icon to show while loading attribute is set |
55
- | [loadingText](#loadingText) | Text to show while loading attribute is set |
56
-
57
- # auro-menuoption
58
-
59
- The `auro-menuoption` element provides users a way to define a menu option.
60
-
61
- ## Properties
62
-
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. |
73
-
74
- ## Methods
75
-
76
- | Method | Type | Description |
77
- |-----------------------|-------------------------------|--------------------------------------------------|
78
- | [attachTo](#attachTo) | `(service: Object): void` | Attaches this menu option to a menu service and subscribes to its events.<br />This method enables the option to participate in menu selection and highlighting logic.<br /><br />**service**: The menu service instance to attach to. |
79
- | [bindEvents](#bindEvents) | `(): void` | Sets up event listeners for user interaction with the menu option.<br />This function enables click and mouse enter events to trigger selection and highlighting logic. |
80
- | [handleMenuChange](#handleMenuChange) | `(event: Object): void` | Handles changes from the menu service and updates the option's state.<br />This function synchronizes the option's properties and selection/highlight state with menu events.<br /><br />**event**: The event object from the menu service. |
81
- | [setInternalSelected](#setInternalSelected) | `(isSelected: boolean): void` | Updates the internal selected state of the menu option bypassing 'updated' and triggers custom events if selected.<br />This function ensures the option's selection state is synchronized with menu logic and notifies listeners.<br /><br />**isSelected**: Whether the option should be marked as selected. |
82
- | [setSelected](#setSelected) | `(isSelected: boolean): void` | Sets the selected state of the menu option.<br />This function updates whether the option is currently selected.<br /><br />**isSelected**: Whether the option should be marked as selected. |
83
- | [updateActive](#updateActive) | `(isActive: boolean): void` | Updates the active state and visual highlighting of the menu option.<br />This function toggles the option's active status and applies or removes the active CSS class.<br /><br />**isActive**: Whether the option should be marked as active. |
84
-
85
- ## Events
86
-
87
- | Event | Type | Description |
88
- |----------------------------|---------------------|--------------------------------------------------|
89
- | `auroMenuOption-click` | `CustomEvent<this>` | |
90
- | `auroMenuOption-mouseover` | `CustomEvent<this>` | Notifies that this option has been hovered over. |
91
-
92
- ## Slots
93
-
94
- | Name | Description |
95
- |-----------|--------------------------------------------|
96
- | [default](#default) | The default slot for the menu option text. |
97
- <!-- AURO-GENERATED-CONTENT:END -->
98
-
99
- ## Basic
100
-
101
- <div class="exampleWrapper">
102
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
103
- <!-- The below content is automatically added from ./../apiExamples/basic.html -->
104
- <auro-menu>
105
- <auro-menuoption value="stops">Stops</auro-menuoption>
106
- <auro-menuoption value="price">Price</auro-menuoption>
107
- <auro-menuoption value="duration">Duration</auro-menuoption>
108
- <auro-menuoption value="departure">Departure</auro-menuoption>
109
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
110
- </auro-menu>
111
- <!-- AURO-GENERATED-CONTENT:END -->
112
- </div>
113
- <auro-accordion alignRight>
114
- <span slot="trigger">See code</span>
115
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
116
- <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
117
-
118
- ```html
119
- <auro-menu>
120
- <auro-menuoption value="stops">Stops</auro-menuoption>
121
- <auro-menuoption value="price">Price</auro-menuoption>
122
- <auro-menuoption value="duration">Duration</auro-menuoption>
123
- <auro-menuoption value="departure">Departure</auro-menuoption>
124
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
125
- </auro-menu>
126
- ```
127
- <!-- AURO-GENERATED-CONTENT:END -->
128
- </auro-accordion>
129
-
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
262
-
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.
264
-
265
- In the below example, there is a list of "popular" options at the top, with the same values repeated underneath. To allow more specific selections, we can add a `key` attribute to the top options to allow them to be more specifically selected, or to prevent them from interfering with matches on the lower options.
266
-
267
- In the below example, setting the value of the menu `'stops'` will select the bottom-most option with the value `'stops'`, and setting the value of menu to `'stops-top'` will select the top-most option with the value `'stops'` since the key now differs from the value. In either case, the resulting value of the menu will be `'stops'` because the resulting value of the menu is based on the `value` property and not the `key` property.
268
-
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.
270
-
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
-
273
- <div class="exampleWrapper">
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 -->
290
- </div>
291
- <auro-accordion alignRight>
292
- <span slot="trigger">See code</span>
293
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/keys.html) -->
294
- <!-- The below code snippet is automatically added from ./../apiExamples/keys.html -->
295
-
296
- ```html
297
- <auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
298
- <auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
299
- <auro-menu id="keys-menu">
300
- <auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
301
- <auro-menuoption value="price" key="price-top">Price</auro-menuoption>
302
- <hr>
303
- <auro-menuoption value="duration">Duration</auro-menuoption>
304
- <auro-menuoption value="departure">Departure</auro-menuoption>
305
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
306
- <auro-menuoption value="stops">Stops</auro-menuoption>
307
- <auro-menuoption value="price">Price</auro-menuoption>
308
- </auro-menu>
309
- <p id="output" class="body-sm"></p>
310
- ```
311
- <!-- AURO-GENERATED-CONTENT:END -->
312
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/keys.js) -->
313
- <!-- The below code snippet is automatically added from ./../apiExamples/keys.js -->
314
-
315
- ```js
316
- export function initKeysExample() {
317
- const menu = document.getElementById('keys-menu');
318
- const stopsButton = document.getElementById('stopsButton');
319
- const stopsTopButton = document.getElementById('stopsTopButton');
320
- const output = document.getElementById('output');
321
-
322
- const createConsoleEntry = (message) => {
323
- const node = document.createElement('span');
324
- node.innerHTML = message;
325
- output.appendChild(node);
326
- output.appendChild(document.createElement('br'));
327
- };
328
-
329
- const resetConsole = () => {
330
- output.innerHTML = '';
331
- };
332
-
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
- }
548
-
549
- export function auroMenuMatchWordExample() {
550
- let matchWordInput = document.querySelector('#matchWordInput');
551
-
552
- matchWordInput.addEventListener('keyup', updateMatch);
553
- }
554
- ```
555
- <!-- AURO-GENERATED-CONTENT:END -->
556
- </auro-accordion>
557
-
558
- ### Multi-Select
559
-
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.
561
-
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._
570
-
571
- <div class="exampleWrapper">
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>
575
- <auro-menuoption value="stops">Stops</auro-menuoption>
576
- <auro-menuoption value="price">Price</auro-menuoption>
577
- <auro-menuoption value="duration">Duration</auro-menuoption>
578
- <auro-menuoption value="departure">Departure</auro-menuoption>
579
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
580
- </auro-menu>
581
- <!-- AURO-GENERATED-CONTENT:END -->
582
- </div>
583
- <auro-accordion alignRight>
584
- <span slot="trigger">See code</span>
585
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multi-select.html) -->
586
- <!-- The below code snippet is automatically added from ./../apiExamples/multi-select.html -->
587
-
588
- ```html
589
- <auro-menu multiselect>
590
- <auro-menuoption value="stops">Stops</auro-menuoption>
591
- <auro-menuoption value="price">Price</auro-menuoption>
592
- <auro-menuoption value="duration">Duration</auro-menuoption>
593
- <auro-menuoption value="departure">Departure</auro-menuoption>
594
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
595
- </auro-menu>
596
- ```
597
- <!-- AURO-GENERATED-CONTENT:END -->
598
- </auro-accordion>
599
-
600
- ### No Checkmark
601
-
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.
603
-
604
- <div class="exampleWrapper">
605
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nocheckmark.html) -->
606
- <!-- The below content is automatically added from ./../apiExamples/nocheckmark.html -->
607
- <auro-menu nocheckmark>
608
- <auro-menuoption value="stops">Stops</auro-menuoption>
609
- <auro-menuoption value="price">Price</auro-menuoption>
610
- <auro-menuoption value="duration">Duration</auro-menuoption>
611
- <hr>
612
- <auro-menu>
613
- <auro-menuoption value="apples">Apples</auro-menuoption>
614
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
615
- <auro-menuoption value="pears">Pears</auro-menuoption>
616
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
617
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
618
- <hr>
619
- <auro-menu>
620
- <auro-menuoption value="person">Person</auro-menuoption>
621
- <auro-menuoption value="woman">Woman</auro-menuoption>
622
- <auro-menuoption value="man">Man</auro-menuoption>
623
- <auro-menuoption value="camera">Camera</auro-menuoption>
624
- <auro-menuoption value="tv">TV</auro-menuoption>
625
- </auro-menu>
626
- </auro-menu>
627
- <hr>
628
- <auro-menuoption value="departure">Departure</auro-menuoption>
629
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
630
- <hr>
631
- <auro-menu>
632
- <auro-menuoption value="cars">Cars</auro-menuoption>
633
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
634
- <auro-menuoption value="boats">Boats</auro-menuoption>
635
- <auro-menuoption value="planes">Planes</auro-menuoption>
636
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
637
- </auro-menu>
638
- </auro-menu>
639
- <!-- AURO-GENERATED-CONTENT:END -->
640
- </div>
641
- <auro-accordion alignRight>
642
- <span slot="trigger">See code</span>
643
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nocheckmark.html) -->
644
- <!-- The below code snippet is automatically added from ./../apiExamples/nocheckmark.html -->
645
-
646
- ```html
647
- <auro-menu nocheckmark>
648
- <auro-menuoption value="stops">Stops</auro-menuoption>
649
- <auro-menuoption value="price">Price</auro-menuoption>
650
- <auro-menuoption value="duration">Duration</auro-menuoption>
651
- <hr>
652
- <auro-menu>
653
- <auro-menuoption value="apples">Apples</auro-menuoption>
654
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
655
- <auro-menuoption value="pears">Pears</auro-menuoption>
656
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
657
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
658
- <hr>
659
- <auro-menu>
660
- <auro-menuoption value="person">Person</auro-menuoption>
661
- <auro-menuoption value="woman">Woman</auro-menuoption>
662
- <auro-menuoption value="man">Man</auro-menuoption>
663
- <auro-menuoption value="camera">Camera</auro-menuoption>
664
- <auro-menuoption value="tv">TV</auro-menuoption>
665
- </auro-menu>
666
- </auro-menu>
667
- <hr>
668
- <auro-menuoption value="departure">Departure</auro-menuoption>
669
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
670
- <hr>
671
- <auro-menu>
672
- <auro-menuoption value="cars">Cars</auro-menuoption>
673
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
674
- <auro-menuoption value="boats">Boats</auro-menuoption>
675
- <auro-menuoption value="planes">Planes</auro-menuoption>
676
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
677
- </auro-menu>
678
- </auro-menu>
679
- ```
680
- <!-- AURO-GENERATED-CONTENT:END -->
681
- </auro-accordion>
682
-
683
- ### Select All Matching Options
684
-
685
- Use the `selectAllMatchingOptions` attribute to enable selecting all options with matching keys when `value` is set programmatically.
686
-
687
- If not set, only the first matching option will be selected.
688
-
689
- <div class="exampleWrapper">
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 -->
692
- <p>With <code>selectAllMatchingOptions</code> enabled:</p>
693
- <auro-button id="selectAllBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
694
- <auro-button id="resetAllBtn">Reset Menu</auro-button>
695
- <auro-menu multiselect selectAllMatchingOptions id="selectAllMenu">
696
- <auro-menuoption value="stops">Stops</auro-menuoption>
697
- <auro-menuoption value="price">Price</auro-menuoption>
698
- <hr>
699
- <auro-menuoption value="duration">Duration</auro-menuoption>
700
- <auro-menuoption value="departure">Departure</auro-menuoption>
701
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
702
- <auro-menuoption value="stops">Stops</auro-menuoption>
703
- <auro-menuoption value="price">Price</auro-menuoption>
704
- </auro-menu>
705
- <br/>
706
- <br/>
707
- <br/>
708
- <p>Without <code>selectAllMatchingOptions</code> enabled:</p>
709
- <auro-button id="selectFirstBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
710
- <auro-button id="resetFirstBtn">Reset Menu</auro-button>
711
- <auro-menu multiselect id="selectFirstMenu">
712
- <auro-menuoption value="stops">Stops</auro-menuoption>
713
- <auro-menuoption value="price">Price</auro-menuoption>
714
- <hr>
715
- <auro-menuoption value="duration">Duration</auro-menuoption>
716
- <auro-menuoption value="departure">Departure</auro-menuoption>
717
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
718
- <auro-menuoption value="stops">Stops</auro-menuoption>
719
- <auro-menuoption value="price">Price</auro-menuoption>
720
- </auro-menu>
721
- <!-- AURO-GENERATED-CONTENT:END -->
722
- </div>
723
- <auro-accordion alignRight>
724
- <span slot="trigger">See code</span>
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 -->
727
-
728
- ```html
729
- <p>With <code>selectAllMatchingOptions</code> enabled:</p>
730
- <auro-button id="selectAllBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
731
- <auro-button id="resetAllBtn">Reset Menu</auro-button>
732
- <auro-menu multiselect selectAllMatchingOptions id="selectAllMenu">
733
- <auro-menuoption value="stops">Stops</auro-menuoption>
734
- <auro-menuoption value="price">Price</auro-menuoption>
735
- <hr>
736
- <auro-menuoption value="duration">Duration</auro-menuoption>
737
- <auro-menuoption value="departure">Departure</auro-menuoption>
738
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
739
- <auro-menuoption value="stops">Stops</auro-menuoption>
740
- <auro-menuoption value="price">Price</auro-menuoption>
741
- </auro-menu>
742
- <br/>
743
- <br/>
744
- <br/>
745
- <p>Without <code>selectAllMatchingOptions</code> enabled:</p>
746
- <auro-button id="selectFirstBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
747
- <auro-button id="resetFirstBtn">Reset Menu</auro-button>
748
- <auro-menu multiselect id="selectFirstMenu">
749
- <auro-menuoption value="stops">Stops</auro-menuoption>
750
- <auro-menuoption value="price">Price</auro-menuoption>
751
- <hr>
752
- <auro-menuoption value="duration">Duration</auro-menuoption>
753
- <auro-menuoption value="departure">Departure</auro-menuoption>
754
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
755
- <auro-menuoption value="stops">Stops</auro-menuoption>
756
- <auro-menuoption value="price">Price</auro-menuoption>
757
- </auro-menu>
758
- ```
759
- <!-- AURO-GENERATED-CONTENT:END -->
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 -->
762
-
763
- ```js
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';
775
- });
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
- };
789
- ```
790
- <!-- AURO-GENERATED-CONTENT:END -->
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 -->
820
-
821
- ```html
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>
836
- ```
837
- <!-- AURO-GENERATED-CONTENT:END -->
838
- </auro-accordion>
839
-
840
- ## Common Usage Patterns & Functional Examples
841
-
842
- ### Scroll
843
-
844
- When setting the `max-height` of `auro-menu`, all of the overflowing content can be accessed via a scrollbar.
845
-
846
- <div class="exampleWrapper">
847
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/scroll.html) -->
848
- <!-- The below content is automatically added from ./../apiExamples/scroll.html -->
849
- <auro-menu id="alpha" style="max-height: 200px">
850
- <auro-menuoption value="stops">Stops</auro-menuoption>
851
- <auro-menuoption value="price">Price</auro-menuoption>
852
- <auro-menuoption value="duration">Duration</auro-menuoption>
853
- <hr>
854
- <auro-menu id="beta">
855
- <auro-menuoption value="apples">Apples</auro-menuoption>
856
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
857
- <auro-menuoption value="pears">Pears</auro-menuoption>
858
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
859
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
860
- <hr>
861
- <auro-menu id="charlie">
862
- <auro-menuoption value="person">Person</auro-menuoption>
863
- <auro-menuoption value="woman">Woman</auro-menuoption>
864
- <auro-menuoption value="man">Man</auro-menuoption>
865
- <auro-menuoption value="camera">Camera</auro-menuoption>
866
- <auro-menuoption value="tv">TV</auro-menuoption>
867
- </auro-menu>
868
- </auro-menu>
869
- <hr>
870
- <auro-menuoption value="departure">Departure</auro-menuoption>
871
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
872
- <hr>
873
- <auro-menu id="delta">
874
- <auro-menuoption value="cars">Cars</auro-menuoption>
875
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
876
- <auro-menuoption value="boats">Boats</auro-menuoption>
877
- <auro-menuoption value="planes">Planes</auro-menuoption>
878
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
879
- </auro-menu>
880
- </auro-menu>
881
- <!-- AURO-GENERATED-CONTENT:END -->
882
- </div>
883
- <auro-accordion alignRight>
884
- <span slot="trigger">See code</span>
885
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/scroll.html) -->
886
- <!-- The below code snippet is automatically added from ./../apiExamples/scroll.html -->
887
-
888
- ```html
889
- <auro-menu id="alpha" style="max-height: 200px">
890
- <auro-menuoption value="stops">Stops</auro-menuoption>
891
- <auro-menuoption value="price">Price</auro-menuoption>
892
- <auro-menuoption value="duration">Duration</auro-menuoption>
893
- <hr>
894
- <auro-menu id="beta">
895
- <auro-menuoption value="apples">Apples</auro-menuoption>
896
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
897
- <auro-menuoption value="pears">Pears</auro-menuoption>
898
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
899
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
900
- <hr>
901
- <auro-menu id="charlie">
902
- <auro-menuoption value="person">Person</auro-menuoption>
903
- <auro-menuoption value="woman">Woman</auro-menuoption>
904
- <auro-menuoption value="man">Man</auro-menuoption>
905
- <auro-menuoption value="camera">Camera</auro-menuoption>
906
- <auro-menuoption value="tv">TV</auro-menuoption>
907
- </auro-menu>
908
- </auro-menu>
909
- <hr>
910
- <auro-menuoption value="departure">Departure</auro-menuoption>
911
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
912
- <hr>
913
- <auro-menu id="delta">
914
- <auro-menuoption value="cars">Cars</auro-menuoption>
915
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
916
- <auro-menuoption value="boats">Boats</auro-menuoption>
917
- <auro-menuoption value="planes">Planes</auro-menuoption>
918
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
919
- </auro-menu>
920
- </auro-menu>
921
- ```
922
- <!-- AURO-GENERATED-CONTENT:END -->
923
- </auro-accordion>
924
-
925
- ### Options with Horizontal Separator
926
-
927
- To create a natural separation between options, simply use a `<hr>` element.
928
-
929
- <div class="exampleWrapper">
930
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hr.html) -->
931
- <!-- The below content is automatically added from ./../apiExamples/hr.html -->
932
- <auro-menu>
933
- <auro-menuoption value="new tab">New tab</auro-menuoption>
934
- <auro-menuoption value="new window">New window</auro-menuoption>
935
- <auro-menuoption value="open file">Open file</auro-menuoption>
936
- <auro-menuoption value="open location">Open location</auro-menuoption>
937
- <hr>
938
- <auro-menuoption value="close window">Close window</auro-menuoption>
939
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
940
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
941
- <hr>
942
- <auro-menuoption value="share">Share</auro-menuoption>
943
- <hr>
944
- <auro-menuoption value="print">Print</auro-menuoption>
945
- </auro-menu>
946
- <!-- AURO-GENERATED-CONTENT:END -->
947
- </div>
948
- <auro-accordion alignRight>
949
- <span slot="trigger">See code</span>
950
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hr.html) -->
951
- <!-- The below code snippet is automatically added from ./../apiExamples/hr.html -->
952
-
953
- ```html
954
- <auro-menu>
955
- <auro-menuoption value="new tab">New tab</auro-menuoption>
956
- <auro-menuoption value="new window">New window</auro-menuoption>
957
- <auro-menuoption value="open file">Open file</auro-menuoption>
958
- <auro-menuoption value="open location">Open location</auro-menuoption>
959
- <hr>
960
- <auro-menuoption value="close window">Close window</auro-menuoption>
961
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
962
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
963
- <hr>
964
- <auro-menuoption value="share">Share</auro-menuoption>
965
- <hr>
966
- <auro-menuoption value="print">Print</auro-menuoption>
967
- </auro-menu>
968
- ```
969
- <!-- AURO-GENERATED-CONTENT:END -->
970
- </auro-accordion>
971
-
972
- ### Submenu / Nested Menu
973
-
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.
975
-
976
- <div class="exampleWrapper">
977
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested-menu.html) -->
978
- <!-- The below content is automatically added from ./../apiExamples/nested-menu.html -->
979
- <auro-menu id="alpha">
980
- <auro-menuoption value="stops">Stops</auro-menuoption>
981
- <auro-menuoption value="price">Price</auro-menuoption>
982
- <auro-menuoption value="duration">Duration</auro-menuoption>
983
- <hr>
984
- <auro-menu id="beta">
985
- <auro-menuoption value="apples">Apples</auro-menuoption>
986
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
987
- <auro-menuoption value="pears">Pears</auro-menuoption>
988
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
989
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
990
- <hr>
991
- <auro-menu id="charlie">
992
- <auro-menuoption value="person">Person</auro-menuoption>
993
- <auro-menuoption value="woman">Woman</auro-menuoption>
994
- <auro-menuoption value="man">Man</auro-menuoption>
995
- <auro-menuoption value="camera">Camera</auro-menuoption>
996
- <auro-menuoption value="tv">TV</auro-menuoption>
997
- </auro-menu>
998
- </auro-menu>
999
- <hr>
1000
- <auro-menuoption value="departure">Departure</auro-menuoption>
1001
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1002
- <hr>
1003
- <auro-menu id="delta">
1004
- <auro-menuoption value="cars">Cars</auro-menuoption>
1005
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
1006
- <auro-menuoption value="boats">Boats</auro-menuoption>
1007
- <auro-menuoption value="planes">Planes</auro-menuoption>
1008
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
1009
- </auro-menu>
1010
- </auro-menu>
1011
- <!-- AURO-GENERATED-CONTENT:END -->
1012
- </div>
1013
- <auro-accordion alignRight>
1014
- <span slot="trigger">See code</span>
1015
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested-menu.html) -->
1016
- <!-- The below code snippet is automatically added from ./../apiExamples/nested-menu.html -->
1017
-
1018
- ```html
1019
- <auro-menu id="alpha">
1020
- <auro-menuoption value="stops">Stops</auro-menuoption>
1021
- <auro-menuoption value="price">Price</auro-menuoption>
1022
- <auro-menuoption value="duration">Duration</auro-menuoption>
1023
- <hr>
1024
- <auro-menu id="beta">
1025
- <auro-menuoption value="apples">Apples</auro-menuoption>
1026
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
1027
- <auro-menuoption value="pears">Pears</auro-menuoption>
1028
- <auro-menuoption value="grapes">Grapes</auro-menuoption>
1029
- <auro-menuoption value="kiwi">Kiwi</auro-menuoption>
1030
- <hr>
1031
- <auro-menu id="charlie">
1032
- <auro-menuoption value="person">Person</auro-menuoption>
1033
- <auro-menuoption value="woman">Woman</auro-menuoption>
1034
- <auro-menuoption value="man">Man</auro-menuoption>
1035
- <auro-menuoption value="camera">Camera</auro-menuoption>
1036
- <auro-menuoption value="tv">TV</auro-menuoption>
1037
- </auro-menu>
1038
- </auro-menu>
1039
- <hr>
1040
- <auro-menuoption value="departure">Departure</auro-menuoption>
1041
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1042
- <hr>
1043
- <auro-menu id="delta">
1044
- <auro-menuoption value="cars">Cars</auro-menuoption>
1045
- <auro-menuoption value="trucks">Trucks</auro-menuoption>
1046
- <auro-menuoption value="boats">Boats</auro-menuoption>
1047
- <auro-menuoption value="planes">Planes</auro-menuoption>
1048
- <auro-menuoption value="motorcycles">Motorcycles</auro-menuoption>
1049
- </auro-menu>
1050
- </auro-menu>
1051
- ```
1052
- <!-- AURO-GENERATED-CONTENT:END -->
1053
- </auro-accordion>
1054
-
1055
- ### Restricted Width and Long Option
1056
-
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.
1058
-
1059
- <div class="exampleWrapper">
1060
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/restricted-width.html) -->
1061
- <!-- The below content is automatically added from ./../apiExamples/restricted-width.html -->
1062
- <auro-menu style="width: 300px">
1063
- <auro-menuoption value="new tab">New tab</auro-menuoption>
1064
- <auro-menuoption value="new window">New window</auro-menuoption>
1065
- <auro-menuoption value="open file">Open file</auro-menuoption>
1066
- <auro-menuoption value="open location">Open location</auro-menuoption>
1067
- <hr>
1068
- <auro-menuoption value="close window">Close window</auro-menuoption>
1069
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
1070
- <auro-menuoption value="save page as...">Save page as 'option_10_redevelopment_hover_scenario.png'</auro-menuoption>
1071
- <hr>
1072
- <auro-menuoption value="share">Share</auro-menuoption>
1073
- <hr>
1074
- <auro-menuoption value="print">Print</auro-menuoption>
1075
- </auro-menu>
1076
- <!-- AURO-GENERATED-CONTENT:END -->
1077
- </div>
1078
- <auro-accordion alignRight>
1079
- <span slot="trigger">See code</span>
1080
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/restricted-width.html) -->
1081
- <!-- The below code snippet is automatically added from ./../apiExamples/restricted-width.html -->
1082
-
1083
- ```html
1084
- <auro-menu style="width: 300px">
1085
- <auro-menuoption value="new tab">New tab</auro-menuoption>
1086
- <auro-menuoption value="new window">New window</auro-menuoption>
1087
- <auro-menuoption value="open file">Open file</auro-menuoption>
1088
- <auro-menuoption value="open location">Open location</auro-menuoption>
1089
- <hr>
1090
- <auro-menuoption value="close window">Close window</auro-menuoption>
1091
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
1092
- <auro-menuoption value="save page as...">Save page as 'option_10_redevelopment_hover_scenario.png'</auro-menuoption>
1093
- <hr>
1094
- <auro-menuoption value="share">Share</auro-menuoption>
1095
- <hr>
1096
- <auro-menuoption value="print">Print</auro-menuoption>
1097
- </auro-menu>
1098
- ```
1099
- <!-- AURO-GENERATED-CONTENT:END -->
1100
- </auro-accordion>
1101
-
1102
- #### Hidden Options
1103
-
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`.
1105
-
1106
- <div class="exampleWrapper">
1107
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/hidden.html) -->
1108
- <!-- The below content is automatically added from ./../apiExamples/hidden.html -->
1109
- <auro-menu>
1110
- <auro-menuoption value="new tab">New tab</auro-menuoption>
1111
- <auro-menuoption value="new window">New window</auro-menuoption>
1112
- <auro-menuoption value="open file">Open file</auro-menuoption>
1113
- <auro-menuoption value="open location">Open location</auro-menuoption>
1114
- <hr>
1115
- <auro-menuoption value="close window">Close window</auro-menuoption>
1116
- <auro-menuoption value="close tab" hidden>Close tab</auro-menuoption>
1117
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
1118
- <hr>
1119
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
1120
- <hr>
1121
- <auro-menuoption value="print">Print</auro-menuoption>
1122
- </auro-menu>
1123
- <!-- AURO-GENERATED-CONTENT:END -->
1124
- </div>
1125
- <auro-accordion alignRight>
1126
- <span slot="trigger">See code</span>
1127
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/hidden.html) -->
1128
- <!-- The below code snippet is automatically added from ./../apiExamples/hidden.html -->
1129
-
1130
- ```html
1131
- <auro-menu>
1132
- <auro-menuoption value="new tab">New tab</auro-menuoption>
1133
- <auro-menuoption value="new window">New window</auro-menuoption>
1134
- <auro-menuoption value="open file">Open file</auro-menuoption>
1135
- <auro-menuoption value="open location">Open location</auro-menuoption>
1136
- <hr>
1137
- <auro-menuoption value="close window">Close window</auro-menuoption>
1138
- <auro-menuoption value="close tab" hidden>Close tab</auro-menuoption>
1139
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
1140
- <hr>
1141
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
1142
- <hr>
1143
- <auro-menuoption value="print">Print</auro-menuoption>
1144
- </auro-menu>
1145
- ```
1146
- <!-- AURO-GENERATED-CONTENT:END -->
1147
- </auro-accordion>
1148
-
1149
- ### Reset Menu Selection State
1150
-
1151
- The `auro-menu` may be reset to a state with no menuoption selected by setting the `value` to `undefined`.
1152
-
1153
- <div class="exampleWrapper">
1154
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reset.html) -->
1155
- <!-- The below content is automatically added from ./../apiExamples/reset.html -->
1156
- <auro-menu id="resetExample">
1157
- <auro-menuoption value="stops">Stops</auro-menuoption>
1158
- <auro-menuoption value="price">Price</auro-menuoption>
1159
- <auro-menuoption value="duration" selected>Duration</auro-menuoption>
1160
- <auro-menuoption value="departure">Departure</auro-menuoption>
1161
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1162
- </auro-menu>
1163
- <br/><br/>
1164
- <auro-button id="resetExampleBtn">RESET</auro-button>
1165
- <!-- AURO-GENERATED-CONTENT:END -->
1166
- </div>
1167
- <auro-accordion alignRight>
1168
- <span slot="trigger">See code</span>
1169
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.html) -->
1170
- <!-- The below code snippet is automatically added from ./../apiExamples/reset.html -->
1171
-
1172
- ```html
1173
- <auro-menu id="resetExample">
1174
- <auro-menuoption value="stops">Stops</auro-menuoption>
1175
- <auro-menuoption value="price">Price</auro-menuoption>
1176
- <auro-menuoption value="duration" selected>Duration</auro-menuoption>
1177
- <auro-menuoption value="departure">Departure</auro-menuoption>
1178
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1179
- </auro-menu>
1180
- <br/><br/>
1181
- <auro-button id="resetExampleBtn">RESET</auro-button>
1182
- ```
1183
- <!-- AURO-GENERATED-CONTENT:END -->
1184
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.js) -->
1185
- <!-- The below code snippet is automatically added from ./../apiExamples/reset.js -->
1186
-
1187
- ```js
1188
- export function auroMenuResetExample() {
1189
- const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
1190
- const resetExampleElem = document.querySelector('#resetExample');
1191
-
1192
- if (resetExampleElem && resetExampleBtnElem) {
1193
- resetExampleBtnElem.addEventListener('click', () => {
1194
- resetExampleElem.reset();
1195
- });
1196
- }
1197
- }
1198
- ```
1199
- <!-- AURO-GENERATED-CONTENT:END -->
1200
- </auro-accordion>