@aurodesignsystem/auro-formkit 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -4
- package/README.md +4 -4
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +2 -2
- package/components/bibtemplate/dist/registered.js +2 -2
- package/components/checkbox/README.md +62 -62
- package/components/checkbox/demo/api.js +1 -1
- package/components/checkbox/demo/api.md +127 -84
- package/components/checkbox/demo/api.min.js +125 -42
- package/components/checkbox/demo/index.md +9 -281
- package/components/checkbox/demo/index.min.js +125 -42
- package/components/checkbox/demo/readme.html +3 -4
- package/components/checkbox/demo/readme.md +62 -62
- package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
- package/components/checkbox/dist/index.js +125 -42
- package/components/checkbox/dist/registered.js +125 -42
- package/components/combobox/README.md +76 -74
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +11 -12
- package/components/combobox/demo/api.md +1302 -875
- package/components/combobox/demo/api.min.js +416 -492
- package/components/combobox/demo/index.html +1 -7
- package/components/combobox/demo/index.js +0 -19
- package/components/combobox/demo/index.md +43 -723
- package/components/combobox/demo/index.min.js +369 -302
- package/components/combobox/demo/readme.html +3 -4
- package/components/combobox/demo/readme.md +76 -74
- package/components/combobox/dist/auro-combobox.d.ts +42 -42
- package/components/combobox/dist/index.js +204 -210
- package/components/combobox/dist/registered.js +204 -210
- package/components/counter/README.md +81 -66
- package/components/counter/demo/api.html +1 -2
- package/components/counter/demo/api.js +2 -2
- package/components/counter/demo/api.md +777 -259
- package/components/counter/demo/api.min.js +119 -171
- package/components/counter/demo/index.html +0 -2
- package/components/counter/demo/index.md +20 -329
- package/components/counter/demo/index.min.js +117 -152
- package/components/counter/demo/readme.html +3 -4
- package/components/counter/demo/readme.md +81 -66
- package/components/counter/dist/auro-counter-group.d.ts +21 -36
- package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
- package/components/counter/dist/auro-counter.d.ts +5 -8
- package/components/counter/dist/index.js +117 -152
- package/components/counter/dist/registered.js +117 -152
- package/components/datepicker/README.md +57 -61
- package/components/datepicker/demo/api.js +8 -8
- package/components/datepicker/demo/api.md +720 -561
- package/components/datepicker/demo/api.min.js +678 -2769
- package/components/datepicker/demo/index.md +65 -117
- package/components/datepicker/demo/index.min.js +678 -2769
- package/components/datepicker/demo/readme.html +3 -4
- package/components/datepicker/demo/readme.md +57 -61
- package/components/datepicker/dist/auro-calendar.d.ts +60 -34
- package/components/datepicker/dist/auro-datepicker.d.ts +32 -32
- package/components/datepicker/dist/iconVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +505 -2596
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +505 -2596
- package/components/dropdown/README.md +78 -62
- package/components/dropdown/demo/api.js +4 -4
- package/components/dropdown/demo/api.md +520 -478
- package/components/dropdown/demo/api.min.js +80 -95
- package/components/dropdown/demo/index.md +65 -119
- package/components/dropdown/demo/index.min.js +70 -85
- package/components/dropdown/demo/readme.html +3 -4
- package/components/dropdown/demo/readme.md +78 -62
- package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
- package/components/dropdown/dist/iconVersion.d.ts +1 -1
- package/components/dropdown/dist/index.js +70 -85
- package/components/dropdown/dist/registered.js +70 -85
- package/components/form/README.md +16 -58
- package/components/form/demo/api.md +16 -21
- package/components/form/demo/api.min.js +13 -8
- package/components/form/demo/index.md +38 -39
- package/components/form/demo/index.min.js +13 -8
- package/components/form/demo/readme.md +16 -58
- package/components/form/demo/working.html +1 -1
- package/components/form/dist/auro-form.d.ts +15 -3
- package/components/form/dist/index.js +13 -8
- package/components/form/dist/registered.js +13 -8
- package/components/input/README.md +55 -60
- package/components/input/demo/api.js +3 -5
- package/components/input/demo/api.md +558 -537
- package/components/input/demo/api.min.js +102 -115
- package/components/input/demo/index.js +0 -1
- package/components/input/demo/index.md +90 -203
- package/components/input/demo/index.min.js +87 -99
- package/components/input/demo/readme.html +3 -4
- package/components/input/demo/readme.md +55 -60
- package/components/input/dist/auro-input.d.ts +6 -5
- package/components/input/dist/base-input.d.ts +68 -69
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +87 -82
- package/components/input/dist/registered.js +87 -82
- package/components/menu/README.md +61 -61
- package/components/menu/demo/api.js +6 -8
- package/components/menu/demo/api.md +520 -577
- package/components/menu/demo/api.min.js +199 -97
- package/components/menu/demo/index.js +0 -5
- package/components/menu/demo/index.md +36 -119
- package/components/menu/demo/index.min.js +164 -101
- package/components/menu/demo/readme.html +3 -4
- package/components/menu/demo/readme.md +61 -61
- package/components/menu/dist/auro-menu.context.d.ts +5 -0
- package/components/menu/dist/auro-menu.d.ts +75 -37
- package/components/menu/dist/auro-menuoption.d.ts +38 -13
- package/components/menu/dist/index.js +164 -50
- package/components/menu/dist/registered.js +164 -50
- package/components/radio/README.md +61 -57
- package/components/radio/demo/api.js +2 -2
- package/components/radio/demo/api.md +241 -170
- package/components/radio/demo/api.min.js +154 -77
- package/components/radio/demo/index.md +22 -99
- package/components/radio/demo/index.min.js +145 -68
- package/components/radio/demo/readme.html +3 -4
- package/components/radio/demo/readme.md +61 -57
- package/components/radio/dist/auro-radio-group.d.ts +67 -35
- package/components/radio/dist/auro-radio.d.ts +56 -33
- package/components/radio/dist/index.js +145 -68
- package/components/radio/dist/registered.js +145 -68
- package/components/select/README.md +68 -65
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +7 -7
- package/components/select/demo/api.md +1305 -625
- package/components/select/demo/api.min.js +357 -262
- package/components/select/demo/index.html +0 -2
- package/components/select/demo/index.md +25 -833
- package/components/select/demo/index.min.js +356 -230
- package/components/select/demo/readme.html +3 -4
- package/components/select/demo/readme.md +68 -65
- package/components/select/dist/auro-select.d.ts +99 -90
- package/components/select/dist/index.js +192 -180
- package/components/select/dist/registered.js +192 -180
- package/package.json +9 -4
|
@@ -3,29 +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
|
|
11
|
-
|
|
12
|
-
| [allowDeselect](#allowDeselect) | `allowDeselect` | | `boolean`
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [loading](#loading) | `loading` | | `boolean`
|
|
19
|
-
| [matchWord](#matchWord) | `matchword` | | `string`
|
|
20
|
-
| [multiSelect](#multiSelect) | `multiselect` | | `boolean`
|
|
21
|
-
| [noCheckmark](#noCheckmark) | `nocheckmark` | | `boolean`
|
|
22
|
-
| [optionActive](#optionActive) | `optionactive` | | `object`
|
|
23
|
-
| [optionSelected](#optionSelected) | `optionSelected` | | `
|
|
24
|
-
| [options](#options) | | readonly | `array`
|
|
25
|
-
| [selectAllMatchingOptions](#selectAllMatchingOptions) | `selectAllMatchingOptions` | | `boolean`
|
|
26
|
-
| [selectedOption](#selectedOption) | | readonly | `HTMLElement \| null`
|
|
27
|
-
| [selectedOptions](#selectedOptions) | | readonly | `HTMLElement[]`
|
|
28
|
-
| [value](#value) | `value` | | `string`
|
|
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
29
|
|
|
30
30
|
## Methods
|
|
31
31
|
|
|
@@ -56,31 +56,20 @@ The auro-menu element provides users a way to select from a list of options.
|
|
|
56
56
|
|
|
57
57
|
# auro-menuoption
|
|
58
58
|
|
|
59
|
-
The auro-
|
|
59
|
+
The `auro-menuoption` element provides users a way to define a menu option.
|
|
60
60
|
|
|
61
|
-
## Attributes
|
|
62
|
-
|
|
63
|
-
| Attribute | Type | Description |
|
|
64
|
-
|---------------|----------|--------------------------------------------------|
|
|
65
|
-
| [noCheckmark](#noCheckmark) | `String` | When true, selected option will not show the checkmark. |
|
|
66
|
-
|
|
67
61
|
## Properties
|
|
68
62
|
|
|
69
|
-
| Property | Attribute
|
|
70
|
-
|
|
71
|
-
| [disabled](#disabled) | `disabled`
|
|
72
|
-
| [
|
|
73
|
-
| [
|
|
74
|
-
| [
|
|
75
|
-
| [
|
|
76
|
-
| [
|
|
77
|
-
| [
|
|
78
|
-
| [
|
|
79
|
-
| [nocheckmark](#nocheckmark) | `nocheckmark` | | `boolean` | false | |
|
|
80
|
-
| [selected](#selected) | `selected` | | `Boolean` | false | Specifies that an option is selected. |
|
|
81
|
-
| [tabIndex](#tabIndex) | `tabIndex` | | `number` | | |
|
|
82
|
-
| [unsubscribe](#unsubscribe) | | | | null | |
|
|
83
|
-
| [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. |
|
|
84
73
|
|
|
85
74
|
## Methods
|
|
86
75
|
|
|
@@ -107,9 +96,7 @@ The auro-menu element provides users a way to define a menu option.
|
|
|
107
96
|
| | Specifies text for an option, but is not the value. |
|
|
108
97
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
109
98
|
|
|
110
|
-
##
|
|
111
|
-
|
|
112
|
-
### Basic
|
|
99
|
+
## Basic
|
|
113
100
|
|
|
114
101
|
<div class="exampleWrapper">
|
|
115
102
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
@@ -140,7 +127,138 @@ The auro-menu element provides users a way to define a menu option.
|
|
|
140
127
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
141
128
|
</auro-accordion>
|
|
142
129
|
|
|
143
|
-
|
|
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
|
|
144
262
|
|
|
145
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.
|
|
146
264
|
|
|
@@ -150,25 +268,25 @@ In the below example, setting the value of the menu `'stops'` will select the bo
|
|
|
150
268
|
|
|
151
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.
|
|
152
270
|
|
|
153
|
-
_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._
|
|
154
|
-
|
|
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
|
+
|
|
155
273
|
<div class="exampleWrapper">
|
|
156
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/keys.html) -->
|
|
157
|
-
<!-- The below content is automatically added from ./../apiExamples/keys.html -->
|
|
158
|
-
<auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
|
|
159
|
-
<auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
|
|
160
|
-
<auro-menu id="keys-menu">
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
</auro-menu>
|
|
170
|
-
<p id="output" class="body-sm"></p>
|
|
171
|
-
<!-- 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 -->
|
|
172
290
|
</div>
|
|
173
291
|
<auro-accordion alignRight>
|
|
174
292
|
<span slot="trigger">See code</span>
|
|
@@ -212,41 +330,248 @@ export function initKeysExample() {
|
|
|
212
330
|
output.innerHTML = '';
|
|
213
331
|
};
|
|
214
332
|
|
|
215
|
-
const updateMenuValue = (value) => {
|
|
216
|
-
resetConsole();
|
|
217
|
-
createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
|
|
218
|
-
menu.value = '';
|
|
219
|
-
menu.value = value;
|
|
220
|
-
createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
|
|
221
|
-
setTimeout(() => {
|
|
222
|
-
createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
|
|
223
|
-
});
|
|
224
|
-
};
|
|
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
|
+
}
|
|
225
548
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
});
|
|
549
|
+
export function auroMenuMatchWordExample() {
|
|
550
|
+
let matchWordInput = document.querySelector('#matchWordInput');
|
|
229
551
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
233
|
-
};
|
|
552
|
+
matchWordInput.addEventListener('keyup', updateMatch);
|
|
553
|
+
}
|
|
234
554
|
```
|
|
235
555
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
236
556
|
</auro-accordion>
|
|
237
557
|
|
|
238
|
-
###
|
|
239
|
-
|
|
240
|
-
#### allowDeselect
|
|
558
|
+
### Multi-Select
|
|
241
559
|
|
|
242
|
-
|
|
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.
|
|
243
561
|
|
|
244
|
-
|
|
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._
|
|
245
570
|
|
|
246
571
|
<div class="exampleWrapper">
|
|
247
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
248
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
249
|
-
<auro-menu
|
|
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>
|
|
250
575
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
251
576
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
252
577
|
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
@@ -257,11 +582,11 @@ When the menu is in multi-select mode, this attribute has no effect and the user
|
|
|
257
582
|
</div>
|
|
258
583
|
<auro-accordion alignRight>
|
|
259
584
|
<span slot="trigger">See code</span>
|
|
260
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
261
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
585
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multi-select.html) -->
|
|
586
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/multi-select.html -->
|
|
262
587
|
|
|
263
588
|
```html
|
|
264
|
-
<auro-menu
|
|
589
|
+
<auro-menu multiselect>
|
|
265
590
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
266
591
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
267
592
|
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
@@ -272,7 +597,8 @@ When the menu is in multi-select mode, this attribute has no effect and the user
|
|
|
272
597
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
273
598
|
</auro-accordion>
|
|
274
599
|
|
|
275
|
-
|
|
600
|
+
### No Checkmark
|
|
601
|
+
|
|
276
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.
|
|
277
603
|
|
|
278
604
|
<div class="exampleWrapper">
|
|
@@ -354,169 +680,15 @@ Applying the `noCheckmark` attribute will prevent the check icon from being show
|
|
|
354
680
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
355
681
|
</auro-accordion>
|
|
356
682
|
|
|
357
|
-
|
|
358
|
-
The `auro-menu` element with `disabled` will mark all `auro-menuoption` elements as disabled.
|
|
359
|
-
|
|
360
|
-
<div class="exampleWrapper">
|
|
361
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabledMenu.html) -->
|
|
362
|
-
<!-- The below content is automatically added from ./../apiExamples/disabledMenu.html -->
|
|
363
|
-
<auro-menu disabled>
|
|
364
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
365
|
-
<auro-menuoption value="new window">New window</auro-menuoption>
|
|
366
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
367
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
368
|
-
<hr>
|
|
369
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
370
|
-
<auro-menuoption value="close tab">Close tab</auro-menuoption>
|
|
371
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
372
|
-
<hr>
|
|
373
|
-
<auro-menuoption value="share">Share</auro-menuoption>
|
|
374
|
-
<hr>
|
|
375
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
376
|
-
</auro-menu>
|
|
377
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
378
|
-
</div>
|
|
379
|
-
<auro-accordion alignRight>
|
|
380
|
-
<span slot="trigger">See code</span>
|
|
381
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabledMenu.html) -->
|
|
382
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/disabledMenu.html -->
|
|
383
|
-
|
|
384
|
-
```html
|
|
385
|
-
<auro-menu disabled>
|
|
386
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
387
|
-
<auro-menuoption value="new window">New window</auro-menuoption>
|
|
388
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
389
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
390
|
-
<hr>
|
|
391
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
392
|
-
<auro-menuoption value="close tab">Close tab</auro-menuoption>
|
|
393
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
394
|
-
<hr>
|
|
395
|
-
<auro-menuoption value="share">Share</auro-menuoption>
|
|
396
|
-
<hr>
|
|
397
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
398
|
-
</auro-menu>
|
|
399
|
-
```
|
|
400
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
401
|
-
</auro-accordion>
|
|
402
|
-
|
|
403
|
-
#### matchWord<a name="matchWord"></a>
|
|
404
|
-
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`).
|
|
405
|
-
|
|
406
|
-
<div class="exampleWrapper">
|
|
407
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/matchWord.html) -->
|
|
408
|
-
<!-- The below content is automatically added from ./../apiExamples/matchWord.html -->
|
|
409
|
-
<auro-input id="matchWordInput" required>
|
|
410
|
-
<span slot="label">Enter a value to match in the menu</span>
|
|
411
|
-
</auro-input>
|
|
412
|
-
<br />
|
|
413
|
-
<auro-menu id="matchWordMenu">
|
|
414
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
415
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
416
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
417
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
418
|
-
<auro-menu>
|
|
419
|
-
<auro-menuoption value="apples">Apples</auro-menuoption>
|
|
420
|
-
<auro-menuoption value="oranges">Oranges</auro-menuoption>
|
|
421
|
-
<auro-menuoption value="peaches">Peaches</auro-menuoption>
|
|
422
|
-
</auro-menu>
|
|
423
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
424
|
-
</auro-menu>
|
|
425
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
426
|
-
</div>
|
|
427
|
-
<auro-accordion alignRight>
|
|
428
|
-
<span slot="trigger">See code</span>
|
|
429
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/matchWord.js) -->
|
|
430
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/matchWord.js -->
|
|
431
|
-
|
|
432
|
-
```js
|
|
433
|
-
function updateMatch() {
|
|
434
|
-
let matchWordMenu = document.querySelector('#matchWordMenu');
|
|
435
|
-
|
|
436
|
-
matchWordMenu.matchWord = matchWordInput.value;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
export function auroMenuMatchWordExample() {
|
|
440
|
-
let matchWordInput = document.querySelector('#matchWordInput');
|
|
441
|
-
|
|
442
|
-
matchWordInput.addEventListener('keyup', updateMatch);
|
|
443
|
-
}
|
|
444
|
-
```
|
|
445
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
446
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/matchWord.html) -->
|
|
447
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/matchWord.html -->
|
|
448
|
-
|
|
449
|
-
```html
|
|
450
|
-
<auro-input id="matchWordInput" required>
|
|
451
|
-
<span slot="label">Enter a value to match in the menu</span>
|
|
452
|
-
</auro-input>
|
|
453
|
-
<br />
|
|
454
|
-
<auro-menu id="matchWordMenu">
|
|
455
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
456
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
457
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
458
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
459
|
-
<auro-menu>
|
|
460
|
-
<auro-menuoption value="apples">Apples</auro-menuoption>
|
|
461
|
-
<auro-menuoption value="oranges">Oranges</auro-menuoption>
|
|
462
|
-
<auro-menuoption value="peaches">Peaches</auro-menuoption>
|
|
463
|
-
</auro-menu>
|
|
464
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
465
|
-
</auro-menu>
|
|
466
|
-
```
|
|
467
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
468
|
-
</auro-accordion>
|
|
469
|
-
|
|
470
|
-
### Multi-Select<a name="multiSelect"></a>
|
|
471
|
-
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.
|
|
472
|
-
|
|
473
|
-
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.
|
|
474
|
-
|
|
475
|
-
The value of the menu may be set via multiple methods when in multi-select mode:
|
|
476
|
-
- Programmatically or via attribute by passing a valid JSON string that can be parsed using `JSON.parse`.
|
|
477
|
-
- Programmatically or via attribute by passing a single matching value in a string, e.g. `"stops"`.
|
|
478
|
-
- Programmatically by passing an array of string values, e.g. `["stops","duration","arrival"]`.
|
|
479
|
-
|
|
480
|
-
_Note: Other methods of setting the value may work but are not officially supported and may stop working unexpectedly._
|
|
481
|
-
|
|
482
|
-
<div class="exampleWrapper">
|
|
483
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/multiSelect.html) -->
|
|
484
|
-
<!-- The below content is automatically added from ./../apiExamples/multiSelect.html -->
|
|
485
|
-
<auro-menu multiselect>
|
|
486
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
487
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
488
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
489
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
490
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
491
|
-
</auro-menu>
|
|
492
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
493
|
-
</div>
|
|
494
|
-
<auro-accordion alignRight>
|
|
495
|
-
<span slot="trigger">See code</span>
|
|
496
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multiSelect.html) -->
|
|
497
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/multiSelect.html -->
|
|
498
|
-
|
|
499
|
-
```html
|
|
500
|
-
<auro-menu multiselect>
|
|
501
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
502
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
503
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
504
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
505
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
506
|
-
</auro-menu>
|
|
507
|
-
```
|
|
508
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
509
|
-
</auro-accordion>
|
|
510
|
-
|
|
511
|
-
#### Optional Flag - `selectAllMatchingOptions`
|
|
683
|
+
### Select All Matching Options
|
|
512
684
|
|
|
513
|
-
|
|
685
|
+
Use the `selectAllMatchingOptions` attribute to enable selecting all options with matching keys when `value` is set programmatically.
|
|
514
686
|
|
|
515
687
|
If not set, only the first matching option will be selected.
|
|
516
688
|
|
|
517
689
|
<div class="exampleWrapper">
|
|
518
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
519
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
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 -->
|
|
520
692
|
<p>With <code>selectAllMatchingOptions</code> enabled:</p>
|
|
521
693
|
<auro-button id="selectAllBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
|
|
522
694
|
<auro-button id="resetAllBtn">Reset Menu</auro-button>
|
|
@@ -550,8 +722,8 @@ If not set, only the first matching option will be selected.
|
|
|
550
722
|
</div>
|
|
551
723
|
<auro-accordion alignRight>
|
|
552
724
|
<span slot="trigger">See code</span>
|
|
553
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
554
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
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 -->
|
|
555
727
|
|
|
556
728
|
```html
|
|
557
729
|
<p>With <code>selectAllMatchingOptions</code> enabled:</p>
|
|
@@ -585,148 +757,89 @@ If not set, only the first matching option will be selected.
|
|
|
585
757
|
</auro-menu>
|
|
586
758
|
```
|
|
587
759
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
#### Loading<a name="loading"></a>
|
|
591
|
-
While content is loading, the menu can either remain empty or display a loading placeholder
|
|
592
|
-
|
|
593
|
-
<div class="exampleWrapper">
|
|
594
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/loading.html) -->
|
|
595
|
-
<!-- The below content is automatically added from ./../apiExamples/loading.html -->
|
|
596
|
-
<script>
|
|
597
|
-
</script>
|
|
598
|
-
<auro-button common id="loadingExampleToggleButton">Toggle Loading</auro-button>
|
|
599
|
-
<table id="loadingExampleTable">
|
|
600
|
-
<thead>
|
|
601
|
-
<tr>
|
|
602
|
-
<td width="25%">Spinner + Text</td>
|
|
603
|
-
<td width="25%">Text Only</td>
|
|
604
|
-
<td width="25%">Spinner Only</td>
|
|
605
|
-
<td width="25%">None</td>
|
|
606
|
-
</tr>
|
|
607
|
-
</thead>
|
|
608
|
-
<tr>
|
|
609
|
-
<td>
|
|
610
|
-
<auro-menu>
|
|
611
|
-
<auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
|
|
612
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
613
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
614
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
615
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
616
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
617
|
-
</auro-menu>
|
|
618
|
-
</td>
|
|
619
|
-
<td>
|
|
620
|
-
<auro-menu>
|
|
621
|
-
<span slot="loadingText">Loading...</span>
|
|
622
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
623
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
624
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
625
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
626
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
627
|
-
</auro-menu>
|
|
628
|
-
</td>
|
|
629
|
-
<td>
|
|
630
|
-
<auro-menu>
|
|
631
|
-
<auro-loader slot="loadingIcon" orbit xs></auro-loader>
|
|
632
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
633
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
634
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
635
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
636
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
637
|
-
</auro-menu>
|
|
638
|
-
</td>
|
|
639
|
-
<td>
|
|
640
|
-
<auro-menu>
|
|
641
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
642
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
643
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
644
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
645
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
646
|
-
</auro-menu>
|
|
647
|
-
</td>
|
|
648
|
-
</tr>
|
|
649
|
-
</table>
|
|
650
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
651
|
-
</div>
|
|
652
|
-
<auro-accordion alignRight>
|
|
653
|
-
<span slot="trigger">See code</span>
|
|
654
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/loading.js) -->
|
|
655
|
-
<!-- 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 -->
|
|
656
762
|
|
|
657
763
|
```js
|
|
658
|
-
export
|
|
659
|
-
|
|
660
|
-
|
|
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';
|
|
661
775
|
});
|
|
662
|
-
|
|
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
|
+
};
|
|
663
789
|
```
|
|
664
790
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
665
|
-
|
|
666
|
-
|
|
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 -->
|
|
667
820
|
|
|
668
821
|
```html
|
|
669
|
-
<
|
|
670
|
-
</
|
|
671
|
-
<auro-
|
|
672
|
-
<
|
|
673
|
-
<
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
<
|
|
682
|
-
|
|
683
|
-
<auro-menu>
|
|
684
|
-
<auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
|
|
685
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
686
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
687
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
688
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
689
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
690
|
-
</auro-menu>
|
|
691
|
-
</td>
|
|
692
|
-
<td>
|
|
693
|
-
<auro-menu>
|
|
694
|
-
<span slot="loadingText">Loading...</span>
|
|
695
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
696
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
697
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
698
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
699
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
700
|
-
</auro-menu>
|
|
701
|
-
</td>
|
|
702
|
-
<td>
|
|
703
|
-
<auro-menu>
|
|
704
|
-
<auro-loader slot="loadingIcon" orbit xs></auro-loader>
|
|
705
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
706
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
707
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
708
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
709
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
710
|
-
</auro-menu>
|
|
711
|
-
</td>
|
|
712
|
-
<td>
|
|
713
|
-
<auro-menu>
|
|
714
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
715
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
716
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
717
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
718
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
719
|
-
</auro-menu>
|
|
720
|
-
</td>
|
|
721
|
-
</tr>
|
|
722
|
-
</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>
|
|
723
836
|
```
|
|
724
837
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
725
838
|
</auro-accordion>
|
|
726
839
|
|
|
727
|
-
|
|
840
|
+
## Common Usage Patterns & Functional Examples
|
|
728
841
|
|
|
729
|
-
|
|
842
|
+
### Scroll
|
|
730
843
|
|
|
731
844
|
When setting the `max-height` of `auro-menu`, all of the overflowing content can be accessed via a scrollbar.
|
|
732
845
|
|
|
@@ -809,7 +922,7 @@ When setting the `max-height` of `auro-menu`, all of the overflowing content can
|
|
|
809
922
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
810
923
|
</auro-accordion>
|
|
811
924
|
|
|
812
|
-
|
|
925
|
+
### Options with Horizontal Separator
|
|
813
926
|
|
|
814
927
|
To create a natural separation between options, simply use a `<hr>` element.
|
|
815
928
|
|
|
@@ -856,13 +969,13 @@ To create a natural separation between options, simply use a `<hr>` element.
|
|
|
856
969
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
857
970
|
</auro-accordion>
|
|
858
971
|
|
|
859
|
-
|
|
972
|
+
### Submenu / Nested Menu
|
|
860
973
|
|
|
861
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.
|
|
862
975
|
|
|
863
976
|
<div class="exampleWrapper">
|
|
864
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
865
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
977
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested-menu.html) -->
|
|
978
|
+
<!-- The below content is automatically added from ./../apiExamples/nested-menu.html -->
|
|
866
979
|
<auro-menu id="alpha">
|
|
867
980
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
868
981
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -899,8 +1012,8 @@ The `auro-menu` element supports the placement of an `auro-menu` inside of anoth
|
|
|
899
1012
|
</div>
|
|
900
1013
|
<auro-accordion alignRight>
|
|
901
1014
|
<span slot="trigger">See code</span>
|
|
902
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
903
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1015
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested-menu.html) -->
|
|
1016
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/nested-menu.html -->
|
|
904
1017
|
|
|
905
1018
|
```html
|
|
906
1019
|
<auro-menu id="alpha">
|
|
@@ -939,107 +1052,13 @@ The `auro-menu` element supports the placement of an `auro-menu` inside of anoth
|
|
|
939
1052
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
940
1053
|
</auro-accordion>
|
|
941
1054
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
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.
|
|
945
|
-
|
|
946
|
-
<div class="exampleWrapper">
|
|
947
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
948
|
-
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
949
|
-
<auro-menu>
|
|
950
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
951
|
-
<auro-menuoption value="new window">New window</auro-menuoption>
|
|
952
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
953
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
954
|
-
<hr>
|
|
955
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
956
|
-
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
957
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
958
|
-
<hr>
|
|
959
|
-
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
960
|
-
<hr>
|
|
961
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
962
|
-
</auro-menu>
|
|
963
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
964
|
-
</div>
|
|
965
|
-
<auro-accordion alignRight>
|
|
966
|
-
<span slot="trigger">See code</span>
|
|
967
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
968
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
969
|
-
|
|
970
|
-
```html
|
|
971
|
-
<auro-menu>
|
|
972
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
973
|
-
<auro-menuoption value="new window">New window</auro-menuoption>
|
|
974
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
975
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
976
|
-
<hr>
|
|
977
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
978
|
-
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
979
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
980
|
-
<hr>
|
|
981
|
-
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
982
|
-
<hr>
|
|
983
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
984
|
-
</auro-menu>
|
|
985
|
-
```
|
|
986
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
987
|
-
</auro-accordion>
|
|
988
|
-
|
|
989
|
-
#### Menu with pre-selected menu option
|
|
990
|
-
|
|
991
|
-
The `auro-menu` element supports a pre-selected option via the `selected` attribute on the `auro-menuoption` element.
|
|
992
|
-
|
|
993
|
-
<div class="exampleWrapper">
|
|
994
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
|
|
995
|
-
<!-- The below content is automatically added from ./../apiExamples/preselect.html -->
|
|
996
|
-
<auro-menu>
|
|
997
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
998
|
-
<auro-menuoption value="new window" selected>New window</auro-menuoption>
|
|
999
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
1000
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
1001
|
-
<hr>
|
|
1002
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
1003
|
-
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
1004
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
1005
|
-
<hr>
|
|
1006
|
-
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
1007
|
-
<hr>
|
|
1008
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
1009
|
-
</auro-menu>
|
|
1010
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1011
|
-
</div>
|
|
1012
|
-
<auro-accordion alignRight>
|
|
1013
|
-
<span slot="trigger">See code</span>
|
|
1014
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
|
|
1015
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
|
|
1016
|
-
|
|
1017
|
-
```html
|
|
1018
|
-
<auro-menu>
|
|
1019
|
-
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
1020
|
-
<auro-menuoption value="new window" selected>New window</auro-menuoption>
|
|
1021
|
-
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
1022
|
-
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
1023
|
-
<hr>
|
|
1024
|
-
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
1025
|
-
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
1026
|
-
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
1027
|
-
<hr>
|
|
1028
|
-
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
1029
|
-
<hr>
|
|
1030
|
-
<auro-menuoption value="print">Print</auro-menuoption>
|
|
1031
|
-
</auro-menu>
|
|
1032
|
-
```
|
|
1033
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1034
|
-
</auro-accordion>
|
|
1035
|
-
|
|
1036
|
-
#### Menu with restricted width and long option
|
|
1055
|
+
### Restricted Width and Long Option
|
|
1037
1056
|
|
|
1038
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.
|
|
1039
1058
|
|
|
1040
1059
|
<div class="exampleWrapper">
|
|
1041
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1042
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1060
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/restricted-width.html) -->
|
|
1061
|
+
<!-- The below content is automatically added from ./../apiExamples/restricted-width.html -->
|
|
1043
1062
|
<auro-menu style="width: 300px">
|
|
1044
1063
|
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
1045
1064
|
<auro-menuoption value="new window">New window</auro-menuoption>
|
|
@@ -1058,8 +1077,8 @@ The `auro-menu` element supports scenarios where the outer parent element of the
|
|
|
1058
1077
|
</div>
|
|
1059
1078
|
<auro-accordion alignRight>
|
|
1060
1079
|
<span slot="trigger">See code</span>
|
|
1061
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1062
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1080
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/restricted-width.html) -->
|
|
1081
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/restricted-width.html -->
|
|
1063
1082
|
|
|
1064
1083
|
```html
|
|
1065
1084
|
<auro-menu style="width: 300px">
|
|
@@ -1080,7 +1099,7 @@ The `auro-menu` element supports scenarios where the outer parent element of the
|
|
|
1080
1099
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1081
1100
|
</auro-accordion>
|
|
1082
1101
|
|
|
1083
|
-
####
|
|
1102
|
+
#### Hidden Options
|
|
1084
1103
|
|
|
1085
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`.
|
|
1086
1105
|
|
|
@@ -1127,7 +1146,7 @@ The `auro-menuoption` element supports scenarios where the menu option needs to
|
|
|
1127
1146
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1128
1147
|
</auro-accordion>
|
|
1129
1148
|
|
|
1130
|
-
|
|
1149
|
+
### Reset Menu Selection State
|
|
1131
1150
|
|
|
1132
1151
|
The `auro-menu` may be reset to a state with no menuoption selected by setting the `value` to `undefined`.
|
|
1133
1152
|
|
|
@@ -1147,22 +1166,6 @@ The `auro-menu` may be reset to a state with no menuoption selected by setting t
|
|
|
1147
1166
|
</div>
|
|
1148
1167
|
<auro-accordion alignRight>
|
|
1149
1168
|
<span slot="trigger">See code</span>
|
|
1150
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.js) -->
|
|
1151
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/reset.js -->
|
|
1152
|
-
|
|
1153
|
-
```js
|
|
1154
|
-
export function auroMenuResetExample() {
|
|
1155
|
-
const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
|
|
1156
|
-
const resetExampleElem = document.querySelector('#resetExample');
|
|
1157
|
-
|
|
1158
|
-
if (resetExampleElem && resetExampleBtnElem) {
|
|
1159
|
-
resetExampleBtnElem.addEventListener('click', () => {
|
|
1160
|
-
resetExampleElem.reset();
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
```
|
|
1165
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1166
1169
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.html) -->
|
|
1167
1170
|
<!-- The below code snippet is automatically added from ./../apiExamples/reset.html -->
|
|
1168
1171
|
|
|
@@ -1178,80 +1181,20 @@ export function auroMenuResetExample() {
|
|
|
1178
1181
|
<auro-button id="resetExampleBtn">RESET</auro-button>
|
|
1179
1182
|
```
|
|
1180
1183
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1181
|
-
|
|
1184
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.js) -->
|
|
1185
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reset.js -->
|
|
1182
1186
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/default/tokens.scss) -->
|
|
1188
|
-
<!-- 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');
|
|
1189
1191
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
|
|
1196
|
-
--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1197
|
-
--ds-auro-menuoption-container-color: transparent;
|
|
1198
|
-
--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);
|
|
1199
|
-
--ds-auro-menuoption-icon-color: transparent;
|
|
1200
|
-
--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
|
+
}
|
|
1201
1197
|
}
|
|
1202
1198
|
```
|
|
1203
1199
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1204
|
-
<div class="exampleWrapper">
|
|
1205
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/customColor.html) -->
|
|
1206
|
-
<!-- The below content is automatically added from ./../apiExamples/customColor.html -->
|
|
1207
|
-
<style>
|
|
1208
|
-
#customColorMenu auro-menuoption[selected] {
|
|
1209
|
-
--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle);
|
|
1210
|
-
--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default);
|
|
1211
|
-
}
|
|
1212
|
-
#customColorMenu auro-menuoption:hover {
|
|
1213
|
-
--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted);
|
|
1214
|
-
}
|
|
1215
|
-
#customColorMenu auro-menuoption:focus {
|
|
1216
|
-
--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand);
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
</style>
|
|
1220
|
-
<auro-menu id="customColorMenu">
|
|
1221
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
1222
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
1223
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
1224
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
1225
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
1226
|
-
</auro-menu>
|
|
1227
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1228
|
-
</div>
|
|
1229
|
-
<auro-accordion alignRight>
|
|
1230
|
-
<span slot="trigger">See code</span>
|
|
1231
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/customColor.html) -->
|
|
1232
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/customColor.html -->
|
|
1233
|
-
|
|
1234
|
-
```html
|
|
1235
|
-
<style>
|
|
1236
|
-
#customColorMenu auro-menuoption[selected] {
|
|
1237
|
-
--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle);
|
|
1238
|
-
--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default);
|
|
1239
|
-
}
|
|
1240
|
-
#customColorMenu auro-menuoption:hover {
|
|
1241
|
-
--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted);
|
|
1242
|
-
}
|
|
1243
|
-
#customColorMenu auro-menuoption:focus {
|
|
1244
|
-
--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
</style>
|
|
1248
|
-
<auro-menu id="customColorMenu">
|
|
1249
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
1250
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
1251
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
1252
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
1253
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
1254
|
-
</auro-menu>
|
|
1255
|
-
```
|
|
1256
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1257
1200
|
</auro-accordion>
|