@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
THIS PAGE'S CONTENT SHOULD BE KEPT MINIMAL.
|
|
3
|
+
ONLY ADD EXAMPLES THAT ARE TRULY NECESSARY FOR THE INDEX PAGE — THE BASIC EXAMPLE IS USUALLY ENOUGH.
|
|
4
|
+
ALL OTHER EXAMPLES SHOULD GO IN THE API DOCUMENTATION.
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
|
-
# Menu
|
|
8
|
-
|
|
7
|
+
# Menu
|
|
8
|
+
|
|
9
9
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
|
|
10
10
|
<!-- The below content is automatically added from ./../docs/partials/description.md -->
|
|
11
11
|
The `<auro-menu>` element provides a list of options for a user to select from.
|
|
@@ -15,8 +15,8 @@ A list of options is created within the `<slot>` of the `<auro-menu>` element by
|
|
|
15
15
|
The `<auro-menu>` element is designed for contextual menus, e.g. a dropdown menus. They are not intended to be used for navigation menus which have a different semantic meaning. The `<auro-menu>` element does not support hide/show functionality within its scope. This functionality will be managed by a wrapping element such as a drop-down menu composite element.
|
|
16
16
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
18
|
+
## Use Cases
|
|
19
|
+
|
|
20
20
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
|
|
21
21
|
<!-- The below content is automatically added from ./../docs/partials/useCases.md -->
|
|
22
22
|
The `<auro-menu>` element should be used in situations where users may:
|
|
@@ -26,130 +26,47 @@ The `<auro-menu>` element should be used in situations where users may:
|
|
|
26
26
|
|
|
27
27
|
## Example(s)
|
|
28
28
|
|
|
29
|
-
###
|
|
30
|
-
|
|
31
|
-
A basic `auro-menu` element with nested `auro-menuoption` elements to generate a list.
|
|
32
|
-
|
|
29
|
+
### Basic
|
|
30
|
+
|
|
33
31
|
<div class="exampleWrapper">
|
|
34
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
35
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
32
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
|
|
33
|
+
<!-- The below content is automatically added from ./../apiExamples/preselect.html -->
|
|
36
34
|
<auro-menu>
|
|
37
|
-
<auro-menuoption value="
|
|
38
|
-
<auro-menuoption value="
|
|
39
|
-
<auro-menuoption value="
|
|
40
|
-
<auro-menuoption value="
|
|
41
|
-
<
|
|
35
|
+
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
36
|
+
<auro-menuoption value="new window" selected>New window</auro-menuoption>
|
|
37
|
+
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
38
|
+
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
39
|
+
<hr>
|
|
40
|
+
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
41
|
+
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
42
|
+
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
43
|
+
<hr>
|
|
44
|
+
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
45
|
+
<hr>
|
|
46
|
+
<auro-menuoption value="print">Print</auro-menuoption>
|
|
42
47
|
</auro-menu>
|
|
43
48
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
44
49
|
</div>
|
|
45
50
|
<auro-accordion alignRight>
|
|
46
51
|
<span slot="trigger">See code</span>
|
|
47
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
48
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
52
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
|
|
53
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
|
|
49
54
|
|
|
50
55
|
```html
|
|
51
56
|
<auro-menu>
|
|
52
|
-
<auro-menuoption value="
|
|
53
|
-
<auro-menuoption value="
|
|
54
|
-
<auro-menuoption value="
|
|
55
|
-
<auro-menuoption value="
|
|
56
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
57
|
-
</auro-menu>
|
|
58
|
-
```
|
|
59
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
60
|
-
</auro-accordion>
|
|
61
|
-
|
|
62
|
-
### Using Keys
|
|
63
|
-
|
|
64
|
-
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.
|
|
65
|
-
|
|
66
|
-
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.
|
|
67
|
-
|
|
68
|
-
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.
|
|
69
|
-
|
|
70
|
-
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.
|
|
71
|
-
|
|
72
|
-
_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._
|
|
73
|
-
|
|
74
|
-
<div class="exampleWrapper">
|
|
75
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/keys.html) -->
|
|
76
|
-
<!-- The below content is automatically added from ./../apiExamples/keys.html -->
|
|
77
|
-
<auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
|
|
78
|
-
<auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
|
|
79
|
-
<auro-menu id="keys-menu">
|
|
80
|
-
<auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
|
|
81
|
-
<auro-menuoption value="price" key="price-top">Price</auro-menuoption>
|
|
57
|
+
<auro-menuoption value="new tab">New tab</auro-menuoption>
|
|
58
|
+
<auro-menuoption value="new window" selected>New window</auro-menuoption>
|
|
59
|
+
<auro-menuoption value="open file">Open file</auro-menuoption>
|
|
60
|
+
<auro-menuoption value="open location">Open location</auro-menuoption>
|
|
82
61
|
<hr>
|
|
83
|
-
<auro-menuoption value="
|
|
84
|
-
<auro-menuoption value="
|
|
85
|
-
<auro-menuoption value="
|
|
86
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
87
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
88
|
-
</auro-menu>
|
|
89
|
-
<p id="output" class="body-sm"></p>
|
|
90
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
91
|
-
</div>
|
|
92
|
-
<auro-accordion alignRight>
|
|
93
|
-
<span slot="trigger">See code</span>
|
|
94
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/keys.html) -->
|
|
95
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/keys.html -->
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
|
|
99
|
-
<auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
|
|
100
|
-
<auro-menu id="keys-menu">
|
|
101
|
-
<auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
|
|
102
|
-
<auro-menuoption value="price" key="price-top">Price</auro-menuoption>
|
|
62
|
+
<auro-menuoption value="close window">Close window</auro-menuoption>
|
|
63
|
+
<auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
|
|
64
|
+
<auro-menuoption value="save page as...">Save page as...</auro-menuoption>
|
|
103
65
|
<hr>
|
|
104
|
-
<auro-menuoption value="
|
|
105
|
-
<
|
|
106
|
-
<auro-menuoption value="
|
|
107
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
108
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
66
|
+
<auro-menuoption value="share" disabled>Share</auro-menuoption>
|
|
67
|
+
<hr>
|
|
68
|
+
<auro-menuoption value="print">Print</auro-menuoption>
|
|
109
69
|
</auro-menu>
|
|
110
|
-
<p id="output" class="body-sm"></p>
|
|
111
70
|
```
|
|
112
71
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
|
-
|
|
114
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/keys.js -->
|
|
115
|
-
|
|
116
|
-
```js
|
|
117
|
-
export function initKeysExample() {
|
|
118
|
-
const menu = document.getElementById('keys-menu');
|
|
119
|
-
const stopsButton = document.getElementById('stopsButton');
|
|
120
|
-
const stopsTopButton = document.getElementById('stopsTopButton');
|
|
121
|
-
const output = document.getElementById('output');
|
|
122
|
-
|
|
123
|
-
const createConsoleEntry = (message) => {
|
|
124
|
-
const node = document.createElement('span');
|
|
125
|
-
node.innerHTML = message;
|
|
126
|
-
output.appendChild(node);
|
|
127
|
-
output.appendChild(document.createElement('br'));
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const resetConsole = () => {
|
|
131
|
-
output.innerHTML = '';
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const updateMenuValue = (value) => {
|
|
135
|
-
resetConsole();
|
|
136
|
-
createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
|
|
137
|
-
menu.value = '';
|
|
138
|
-
menu.value = value;
|
|
139
|
-
createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
|
|
140
|
-
setTimeout(() => {
|
|
141
|
-
createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
stopsButton.addEventListener('click', () => {
|
|
146
|
-
updateMenuValue('stops');
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
stopsTopButton.addEventListener('click', () => {
|
|
150
|
-
updateMenuValue('stops-top');
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
```
|
|
154
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
155
|
-
</auro-accordion>
|
|
72
|
+
</auro-accordion>
|
|
@@ -320,7 +320,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{cons
|
|
|
320
320
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
321
321
|
*/const o=o=>o??E;
|
|
322
322
|
|
|
323
|
-
class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i$3{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$6`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;
|
|
323
|
+
class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i$3{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$6`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
|
|
324
324
|
`;class z extends m{constructor(){super(),this.onDark=false,this.appearance="default";}static get properties(){return {...m.properties,onDark:{type:Boolean,reflect:true},appearance:{type:String,reflect:true},svg:{attribute:false,reflect:true}}}static get styles(){return w}async fetchIcon(t,a){let e="";e="logos"===t?await f(`${this.uri}/${t}/${a}.svg`):await f(`${this.uri}/icons/${t}/${a}.svg`);return (new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString(u,"text/html");this.svg=t.body.firstChild;}}}catch(t){this.svg=void 0;}}}i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
|
|
325
325
|
`;var y=i$6`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
|
|
326
326
|
`;var k=i$6`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
|
|
@@ -377,12 +377,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
377
377
|
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
|
-
* The auro-
|
|
380
|
+
* The `auro-menuoption` element provides users a way to define a menu option.
|
|
381
|
+
* @customElement auro-menuoption
|
|
381
382
|
*
|
|
382
|
-
* @attr {String} value - Specifies the value to be sent to a server.
|
|
383
|
-
* @attr {String} noCheckmark - When true, selected option will not show the checkmark.
|
|
384
|
-
* @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
|
|
385
|
-
* @attr {Boolean} selected - Specifies that an option is selected.
|
|
386
383
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
387
384
|
* @slot - Specifies text for an option, but is not the value.
|
|
388
385
|
*/
|
|
@@ -390,7 +387,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
390
387
|
|
|
391
388
|
/**
|
|
392
389
|
* This will register this element with the browser.
|
|
393
|
-
* @param {string} [name="auro-menuoption"] - The name of element that you want to register
|
|
390
|
+
* @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
|
|
394
391
|
*
|
|
395
392
|
* @example
|
|
396
393
|
* AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
|
|
@@ -433,7 +430,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
433
430
|
this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
|
|
434
431
|
|
|
435
432
|
this.selected = false;
|
|
436
|
-
this.
|
|
433
|
+
this.noCheckmark = false;
|
|
437
434
|
this.disabled = false;
|
|
438
435
|
|
|
439
436
|
/**
|
|
@@ -454,38 +451,81 @@ class AuroMenuOption extends AuroElement {
|
|
|
454
451
|
static get properties() {
|
|
455
452
|
return {
|
|
456
453
|
...super.properties,
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* When true, disables the menu option.
|
|
457
|
+
*/
|
|
457
458
|
disabled: {
|
|
458
459
|
type: Boolean,
|
|
459
460
|
reflect: true
|
|
460
461
|
},
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
461
466
|
event: {
|
|
462
467
|
type: String,
|
|
463
468
|
reflect: true
|
|
464
469
|
},
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @private
|
|
473
|
+
*/
|
|
474
|
+
layout: {
|
|
475
|
+
type: String
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* 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.
|
|
480
|
+
*/
|
|
465
481
|
key: {
|
|
466
482
|
type: String,
|
|
467
483
|
reflect: true
|
|
468
484
|
},
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* @private
|
|
488
|
+
*/
|
|
469
489
|
menuService: {
|
|
470
490
|
type: Object,
|
|
471
491
|
state: true
|
|
472
492
|
},
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @private
|
|
496
|
+
*/
|
|
473
497
|
matchWord: {
|
|
474
498
|
type: String,
|
|
475
499
|
state: true
|
|
476
500
|
},
|
|
477
|
-
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @private
|
|
504
|
+
*/
|
|
505
|
+
noCheckmark: {
|
|
478
506
|
type: Boolean,
|
|
479
507
|
reflect: true
|
|
480
508
|
},
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Specifies that an option is selected.
|
|
512
|
+
*/
|
|
481
513
|
selected: {
|
|
482
514
|
type: Boolean,
|
|
483
515
|
reflect: true
|
|
484
516
|
},
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Specifies the tab index of the menu option.
|
|
520
|
+
*/
|
|
485
521
|
tabIndex: {
|
|
486
522
|
type: Number,
|
|
487
523
|
reflect: true
|
|
488
524
|
},
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Specifies the value to be sent to a server.
|
|
528
|
+
*/
|
|
489
529
|
value: {
|
|
490
530
|
type: String,
|
|
491
531
|
reflect: true
|
|
@@ -809,7 +849,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
809
849
|
|
|
810
850
|
return u$1`
|
|
811
851
|
<div class="${classes}">
|
|
812
|
-
${this.selected && !this.
|
|
852
|
+
${this.selected && !this.noCheckmark
|
|
813
853
|
? this.generateIconHtml(checkmarkIcon.svg)
|
|
814
854
|
: undefined}
|
|
815
855
|
<slot></slot>
|
|
@@ -851,6 +891,15 @@ class MenuService {
|
|
|
851
891
|
return this.multiSelect ? values : values[0];
|
|
852
892
|
}
|
|
853
893
|
|
|
894
|
+
/**
|
|
895
|
+
* Gets the label(s) of the currently selected option(s).
|
|
896
|
+
* @returns {string}
|
|
897
|
+
*/
|
|
898
|
+
get currentLabel() {
|
|
899
|
+
const labels = (this.selectedOptions || []).map(option => option.textContent);
|
|
900
|
+
return this.multiSelect ? labels.join(", ") : labels[0] || '';
|
|
901
|
+
}
|
|
902
|
+
|
|
854
903
|
/**
|
|
855
904
|
* Gets the string representation of the current value(s).
|
|
856
905
|
* For multi-select, this is a JSON stringified array.
|
|
@@ -1282,7 +1331,8 @@ class MenuService {
|
|
|
1282
1331
|
value: this.currentValue,
|
|
1283
1332
|
stringValue: this.stringValue,
|
|
1284
1333
|
keys: this.currentKeys,
|
|
1285
|
-
options: this.selectedOptions
|
|
1334
|
+
options: this.selectedOptions,
|
|
1335
|
+
label: this.currentLabel
|
|
1286
1336
|
};
|
|
1287
1337
|
|
|
1288
1338
|
// If only one option is selected, include its index
|
|
@@ -1426,19 +1476,9 @@ const MenuContext = n$1('menu-context');
|
|
|
1426
1476
|
|
|
1427
1477
|
|
|
1428
1478
|
/**
|
|
1429
|
-
* The auro-menu element provides users a way to select from a list of options.
|
|
1430
|
-
* @
|
|
1431
|
-
*
|
|
1432
|
-
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
1433
|
-
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
1434
|
-
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
1435
|
-
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
1436
|
-
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
1437
|
-
* @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
|
|
1438
|
-
* @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
1439
|
-
* @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
|
|
1440
|
-
* @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
|
|
1441
|
-
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
1479
|
+
* The `auro-menu` element provides users a way to select from a list of options.
|
|
1480
|
+
* @customElement auro-menu
|
|
1481
|
+
*
|
|
1442
1482
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
1443
1483
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
1444
1484
|
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
@@ -1529,58 +1569,87 @@ class AuroMenu extends AuroElement {
|
|
|
1529
1569
|
type: Boolean,
|
|
1530
1570
|
reflect: true,
|
|
1531
1571
|
},
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
},
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* When true, the entire menu and all options are disabled.
|
|
1575
|
+
*/
|
|
1537
1576
|
disabled: {
|
|
1538
1577
|
type: Boolean,
|
|
1539
1578
|
reflect: true
|
|
1540
1579
|
},
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
1583
|
+
*/
|
|
1584
|
+
hasLoadingPlaceholder: {
|
|
1585
|
+
type: Boolean
|
|
1586
|
+
},
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* @private
|
|
1590
|
+
*/
|
|
1591
|
+
layout: {
|
|
1592
|
+
type: String
|
|
1593
|
+
},
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Indent level for submenus.
|
|
1597
|
+
* @private
|
|
1598
|
+
*/
|
|
1599
|
+
level: {
|
|
1600
|
+
type: Number,
|
|
1601
|
+
reflect: false,
|
|
1602
|
+
attribute: false
|
|
1603
|
+
},
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
1607
|
+
*/
|
|
1541
1608
|
loading: {
|
|
1542
1609
|
type: Boolean,
|
|
1543
1610
|
reflect: true
|
|
1544
1611
|
},
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
optionActive: {
|
|
1550
|
-
type: Object,
|
|
1551
|
-
attribute: 'optionactive'
|
|
1552
|
-
},
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Specifies a string used to highlight matched string parts in options.
|
|
1615
|
+
*/
|
|
1553
1616
|
matchWord: {
|
|
1554
1617
|
type: String,
|
|
1555
1618
|
attribute: 'matchword'
|
|
1556
1619
|
},
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* When true, the selected option can be multiple options.
|
|
1623
|
+
*/
|
|
1557
1624
|
multiSelect: {
|
|
1558
1625
|
type: Boolean,
|
|
1559
1626
|
reflect: true,
|
|
1560
1627
|
attribute: 'multiselect'
|
|
1561
1628
|
},
|
|
1562
|
-
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* When true, selected option will not show the checkmark.
|
|
1632
|
+
*/
|
|
1633
|
+
noCheckmark: {
|
|
1563
1634
|
type: Boolean,
|
|
1564
1635
|
reflect: true,
|
|
1636
|
+
attribute: 'nocheckmark'
|
|
1565
1637
|
},
|
|
1566
1638
|
|
|
1567
1639
|
/**
|
|
1568
|
-
*
|
|
1640
|
+
* Specifies the current active menuOption.
|
|
1569
1641
|
*/
|
|
1570
|
-
|
|
1571
|
-
type:
|
|
1572
|
-
|
|
1573
|
-
attribute: 'value'
|
|
1642
|
+
optionActive: {
|
|
1643
|
+
type: Object,
|
|
1644
|
+
attribute: 'optionactive'
|
|
1574
1645
|
},
|
|
1575
1646
|
|
|
1576
1647
|
/**
|
|
1577
|
-
*
|
|
1578
|
-
* @private
|
|
1648
|
+
* An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
1579
1649
|
*/
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
attribute: false
|
|
1650
|
+
optionSelected: {
|
|
1651
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
1652
|
+
type: Object
|
|
1584
1653
|
},
|
|
1585
1654
|
|
|
1586
1655
|
/**
|
|
@@ -1591,6 +1660,43 @@ class AuroMenu extends AuroElement {
|
|
|
1591
1660
|
type: Array,
|
|
1592
1661
|
reflect: false,
|
|
1593
1662
|
attribute: false
|
|
1663
|
+
},
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Sets the size of the menu.
|
|
1667
|
+
* @type {'sm' | 'md'}
|
|
1668
|
+
* @default 'sm'
|
|
1669
|
+
*/
|
|
1670
|
+
size: {
|
|
1671
|
+
type: String,
|
|
1672
|
+
reflect: true
|
|
1673
|
+
},
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
|
|
1677
|
+
*/
|
|
1678
|
+
selectAllMatchingOptions: {
|
|
1679
|
+
type: Boolean,
|
|
1680
|
+
reflect: true,
|
|
1681
|
+
},
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Sets the shape of the menu.
|
|
1685
|
+
* @type {'box' | 'round'}
|
|
1686
|
+
* @default 'box'
|
|
1687
|
+
*/
|
|
1688
|
+
shape: {
|
|
1689
|
+
type: String,
|
|
1690
|
+
reflect: true
|
|
1691
|
+
},
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
1695
|
+
*/
|
|
1696
|
+
value: {
|
|
1697
|
+
type: String,
|
|
1698
|
+
reflect: true,
|
|
1699
|
+
attribute: 'value'
|
|
1594
1700
|
}
|
|
1595
1701
|
};
|
|
1596
1702
|
}
|
|
@@ -1603,6 +1709,14 @@ class AuroMenu extends AuroElement {
|
|
|
1603
1709
|
];
|
|
1604
1710
|
}
|
|
1605
1711
|
|
|
1712
|
+
/**
|
|
1713
|
+
* @readonly
|
|
1714
|
+
* @returns {string} - Returns the label of the currently selected option(s).
|
|
1715
|
+
*/
|
|
1716
|
+
get currentLabel() {
|
|
1717
|
+
return this.menuService.currentLabel;
|
|
1718
|
+
};
|
|
1719
|
+
|
|
1606
1720
|
/**
|
|
1607
1721
|
* @readonly
|
|
1608
1722
|
* @returns {Array<HTMLElement>} - Returns the array of available menu options.
|
|
@@ -1628,7 +1742,7 @@ class AuroMenu extends AuroElement {
|
|
|
1628
1742
|
|
|
1629
1743
|
/**
|
|
1630
1744
|
* This will register this element with the browser.
|
|
1631
|
-
* @param {string} [name="auro-menu"] - The name of element that you want to register
|
|
1745
|
+
* @param {string} [name="auro-menu"] - The name of the element that you want to register.
|
|
1632
1746
|
*
|
|
1633
1747
|
* @example
|
|
1634
1748
|
* AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
|
|
@@ -2035,43 +2149,6 @@ class AuroMenu extends AuroElement {
|
|
|
2035
2149
|
}
|
|
2036
2150
|
}
|
|
2037
2151
|
|
|
2038
|
-
function initKeysExample() {
|
|
2039
|
-
const menu = document.getElementById('keys-menu');
|
|
2040
|
-
const stopsButton = document.getElementById('stopsButton');
|
|
2041
|
-
const stopsTopButton = document.getElementById('stopsTopButton');
|
|
2042
|
-
const output = document.getElementById('output');
|
|
2043
|
-
|
|
2044
|
-
const createConsoleEntry = (message) => {
|
|
2045
|
-
const node = document.createElement('span');
|
|
2046
|
-
node.innerHTML = message;
|
|
2047
|
-
output.appendChild(node);
|
|
2048
|
-
output.appendChild(document.createElement('br'));
|
|
2049
|
-
};
|
|
2050
|
-
|
|
2051
|
-
const resetConsole = () => {
|
|
2052
|
-
output.innerHTML = '';
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
const updateMenuValue = (value) => {
|
|
2056
|
-
resetConsole();
|
|
2057
|
-
createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
|
|
2058
|
-
menu.value = '';
|
|
2059
|
-
menu.value = value;
|
|
2060
|
-
createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
|
|
2061
|
-
setTimeout(() => {
|
|
2062
|
-
createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
|
|
2063
|
-
});
|
|
2064
|
-
};
|
|
2065
|
-
|
|
2066
|
-
stopsButton.addEventListener('click', () => {
|
|
2067
|
-
updateMenuValue('stops');
|
|
2068
|
-
});
|
|
2069
|
-
|
|
2070
|
-
stopsTopButton.addEventListener('click', () => {
|
|
2071
|
-
updateMenuValue('stops-top');
|
|
2072
|
-
});
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
2152
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
2076
2153
|
|
|
2077
2154
|
|
|
@@ -2081,20 +2158,6 @@ AuroMenu.register('custom-menu');
|
|
|
2081
2158
|
AuroMenuOption.register('custom-menuoption');
|
|
2082
2159
|
|
|
2083
2160
|
function initExamples(initCount) {
|
|
2084
|
-
initCount = initCount || 0;
|
|
2085
|
-
|
|
2086
|
-
try {
|
|
2087
|
-
// javascript example function calls to be added here upon creation to test examples
|
|
2088
|
-
// auroMenuResetExample();
|
|
2089
|
-
initKeysExample();
|
|
2090
|
-
} catch (err) {
|
|
2091
|
-
if (initCount <= 20) {
|
|
2092
|
-
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
2093
|
-
setTimeout(() => {
|
|
2094
|
-
initExamples(initCount + 1);
|
|
2095
|
-
}, 100);
|
|
2096
|
-
}
|
|
2097
|
-
}
|
|
2098
2161
|
}
|
|
2099
2162
|
|
|
2100
2163
|
export { initExamples };
|
|
@@ -48,10 +48,9 @@
|
|
|
48
48
|
Prism.highlightAll();
|
|
49
49
|
})
|
|
50
50
|
</script>
|
|
51
|
-
<script type="module">
|
|
52
|
-
import { initExamples } from "./index.min.js";
|
|
51
|
+
<script src="./index.min.js" data-demo-script="true" type="module"></script>
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
56
55
|
</body>
|
|
57
56
|
</html>
|