@aurodesignsystem-dev/auro-formkit 0.0.0-pr1101.1 → 0.0.0-pr1104.1
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/components/checkbox/demo/api.min.js +14 -3
- package/components/checkbox/demo/index.min.js +14 -3
- package/components/checkbox/dist/index.js +14 -3
- package/components/checkbox/dist/registered.js +14 -3
- package/components/combobox/demo/api.js +2 -0
- package/components/combobox/demo/api.md +61 -0
- package/components/combobox/demo/api.min.js +129 -84
- package/components/combobox/demo/index.min.js +32 -6
- package/components/combobox/dist/index.js +29 -6
- package/components/combobox/dist/registered.js +29 -6
- package/components/counter/demo/api.min.js +14 -3
- package/components/counter/demo/index.min.js +14 -3
- package/components/counter/dist/index.js +14 -3
- package/components/counter/dist/registered.js +14 -3
- package/components/datepicker/demo/api.min.js +28 -6
- package/components/datepicker/demo/index.min.js +28 -6
- package/components/datepicker/dist/index.js +28 -6
- package/components/datepicker/dist/registered.js +28 -6
- package/components/input/demo/api.min.js +14 -3
- package/components/input/demo/index.min.js +14 -3
- package/components/input/dist/index.js +14 -3
- package/components/input/dist/registered.js +14 -3
- package/components/menu/demo/api.min.js +3 -0
- package/components/menu/demo/index.min.js +3 -0
- package/components/menu/dist/index.js +3 -0
- package/components/menu/dist/registered.js +3 -0
- package/components/radio/demo/api.min.js +14 -3
- package/components/radio/demo/index.min.js +14 -3
- package/components/radio/dist/index.js +14 -3
- package/components/radio/dist/registered.js +14 -3
- package/components/select/demo/api.min.js +17 -3
- package/components/select/demo/index.min.js +17 -3
- package/components/select/dist/index.js +14 -3
- package/components/select/dist/registered.js +14 -3
- package/package.json +1 -1
|
@@ -1142,12 +1142,23 @@ class AuroFormValidation {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
1144
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
1145
|
-
|
|
1146
|
-
|
|
1145
|
+
|
|
1146
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1147
|
+
|
|
1148
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1149
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1150
|
+
|
|
1151
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1152
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
1153
|
+
|
|
1154
|
+
// Reset element validity to the validity of the input
|
|
1155
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
1156
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1157
|
+
}
|
|
1147
1158
|
|
|
1148
1159
|
// multiple input in one components (datepicker)
|
|
1149
1160
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1150
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
1161
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
1151
1162
|
elem.validity = this.auroInputElements[1].validity;
|
|
1152
1163
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1153
1164
|
}
|
|
@@ -1134,12 +1134,23 @@ class AuroFormValidation {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
|
|
1136
1136
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
1137
|
-
|
|
1138
|
-
|
|
1137
|
+
|
|
1138
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1139
|
+
|
|
1140
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1141
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1142
|
+
|
|
1143
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1144
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
1145
|
+
|
|
1146
|
+
// Reset element validity to the validity of the input
|
|
1147
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
1148
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1149
|
+
}
|
|
1139
1150
|
|
|
1140
1151
|
// multiple input in one components (datepicker)
|
|
1141
1152
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1142
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
1153
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
1143
1154
|
elem.validity = this.auroInputElements[1].validity;
|
|
1144
1155
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1145
1156
|
}
|
|
@@ -1087,12 +1087,23 @@ class AuroFormValidation {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
1089
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
|
|
1091
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1092
|
+
|
|
1093
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1094
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1095
|
+
|
|
1096
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1097
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
1098
|
+
|
|
1099
|
+
// Reset element validity to the validity of the input
|
|
1100
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
1101
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1102
|
+
}
|
|
1092
1103
|
|
|
1093
1104
|
// multiple input in one components (datepicker)
|
|
1094
1105
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1095
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
1106
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
1096
1107
|
elem.validity = this.auroInputElements[1].validity;
|
|
1097
1108
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1098
1109
|
}
|
|
@@ -1087,12 +1087,23 @@ class AuroFormValidation {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
1089
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
|
|
1091
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1092
|
+
|
|
1093
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1094
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1095
|
+
|
|
1096
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1097
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
1098
|
+
|
|
1099
|
+
// Reset element validity to the validity of the input
|
|
1100
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
1101
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1102
|
+
}
|
|
1092
1103
|
|
|
1093
1104
|
// multiple input in one components (datepicker)
|
|
1094
1105
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1095
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
1106
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
1096
1107
|
elem.validity = this.auroInputElements[1].validity;
|
|
1097
1108
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1098
1109
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
2
2
|
|
|
3
3
|
import { dynamicMenuExample } from '../apiExamples/dynamicMenu';
|
|
4
|
+
import { setupExternalSelectionExample } from '../apiExamples/externalSelection.js';
|
|
4
5
|
import { valueExample } from '../apiExamples/value';
|
|
5
6
|
import { focusExample } from '../apiExamples/focus';
|
|
6
7
|
import { inDialogExample } from '../apiExamples/inDialog';
|
|
@@ -24,6 +25,7 @@ export function initExamples(initCount) {
|
|
|
24
25
|
inDialogExample();
|
|
25
26
|
resetStateExample();
|
|
26
27
|
auroMenuLoadingExample();
|
|
28
|
+
setupExternalSelectionExample();
|
|
27
29
|
} catch (err) {
|
|
28
30
|
if (initCount <= 20) {
|
|
29
31
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
@@ -381,6 +381,67 @@ export async function dynamicMenuExample() {
|
|
|
381
381
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
382
382
|
</auro-accordion>
|
|
383
383
|
|
|
384
|
+
### Updating Externally
|
|
385
|
+
|
|
386
|
+
This example demonstrates using the <code>updateActiveOption</code> method to set a specific menu option as "active."
|
|
387
|
+
|
|
388
|
+
This is useful for situations like matching IATA codes (sea -> SeaTac airport)
|
|
389
|
+
|
|
390
|
+
<div class="exampleWrapper--ondark">
|
|
391
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/externalSelection.html) -->
|
|
392
|
+
<!-- The below content is automatically added from ./../apiExamples/externalSelection.html -->
|
|
393
|
+
<p style="color: white;">
|
|
394
|
+
Type 'a' in the combobox for best testing results :)
|
|
395
|
+
</p>
|
|
396
|
+
<auro-combobox id="externalSelectionExample" layout="classic" shape="classic" size="lg" placeholder="Placeholder content" required style="width: 249px;">
|
|
397
|
+
<span slot="ariaLabel.bib.close">Close combobox</span>
|
|
398
|
+
<span slot="ariaLabel.input.clear">Clear All</span>
|
|
399
|
+
<span slot="bib.fullscreen.headline">Bib Header</span>
|
|
400
|
+
<span slot="label">Name</span>
|
|
401
|
+
<auro-menu>
|
|
402
|
+
<auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
|
|
403
|
+
<auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
|
|
404
|
+
<auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
|
|
405
|
+
<auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
|
|
406
|
+
<auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
|
|
407
|
+
<auro-menuoption static nomatch>No matching option</auro-menuoption>
|
|
408
|
+
</auro-menu>
|
|
409
|
+
<span slot="helpText">
|
|
410
|
+
Help text - Lorem ipsum solar lorem ipsum solar
|
|
411
|
+
</span>
|
|
412
|
+
</auro-combobox>
|
|
413
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
414
|
+
</div>
|
|
415
|
+
<auro-accordion alignRight>
|
|
416
|
+
<span slot="trigger">See code</span>
|
|
417
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/externalSelection.html) -->
|
|
418
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/externalSelection.html -->
|
|
419
|
+
|
|
420
|
+
```html
|
|
421
|
+
<p style="color: white;">
|
|
422
|
+
Type 'a' in the combobox for best testing results :)
|
|
423
|
+
</p>
|
|
424
|
+
<auro-combobox id="externalSelectionExample" layout="classic" shape="classic" size="lg" placeholder="Placeholder content" required style="width: 249px;">
|
|
425
|
+
<span slot="ariaLabel.bib.close">Close combobox</span>
|
|
426
|
+
<span slot="ariaLabel.input.clear">Clear All</span>
|
|
427
|
+
<span slot="bib.fullscreen.headline">Bib Header</span>
|
|
428
|
+
<span slot="label">Name</span>
|
|
429
|
+
<auro-menu>
|
|
430
|
+
<auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
|
|
431
|
+
<auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
|
|
432
|
+
<auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
|
|
433
|
+
<auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
|
|
434
|
+
<auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
|
|
435
|
+
<auro-menuoption static nomatch>No matching option</auro-menuoption>
|
|
436
|
+
</auro-menu>
|
|
437
|
+
<span slot="helpText">
|
|
438
|
+
Help text - Lorem ipsum solar lorem ipsum solar
|
|
439
|
+
</span>
|
|
440
|
+
</auro-combobox>
|
|
441
|
+
```
|
|
442
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
443
|
+
</auro-accordion>
|
|
444
|
+
|
|
384
445
|
### Property Examples
|
|
385
446
|
|
|
386
447
|
#### disabled
|
|
@@ -141,84 +141,6 @@ async function dynamicMenuExample() {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function valueExample() {
|
|
145
|
-
const valueExample = document.querySelector('#valueExample');
|
|
146
|
-
|
|
147
|
-
document.querySelector('#valueValidExampleBtn').addEventListener('click', () => {
|
|
148
|
-
valueExample.value = 'Oranges';
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
document.querySelector('#valueInvalidExampleBtn').addEventListener('click', () => {
|
|
152
|
-
valueExample.value = 'Dragon Fruit';
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
document.querySelector('#valueUndefinedExampleBtn').addEventListener('click', () => {
|
|
156
|
-
valueExample.value = undefined;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function focusExample() {
|
|
161
|
-
const focusExample = document.querySelector('#focusExample');
|
|
162
|
-
const focusExampleBtnElem = document.querySelector('#focusExampleBtn');
|
|
163
|
-
|
|
164
|
-
focusExampleBtnElem.addEventListener('click', () => {
|
|
165
|
-
focusExample.focus();
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function inDialogExample() {
|
|
170
|
-
document.querySelector("#combobox-dialog-opener").addEventListener("click", () => {
|
|
171
|
-
const dialog = document.querySelector("#combobox-dialog");
|
|
172
|
-
dialog.open = true;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function resetStateExample() {
|
|
177
|
-
const elem = document.querySelector('#resetStateExample');
|
|
178
|
-
|
|
179
|
-
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
180
|
-
elem.reset();
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function auroMenuLoadingExample() {
|
|
185
|
-
const combobox = document.querySelector("#loadingExample");
|
|
186
|
-
const menu = document.querySelector("#loadingExampleComboboxMenu");
|
|
187
|
-
|
|
188
|
-
const emptyMenu = () => {
|
|
189
|
-
const menuoptions = menu.querySelectorAll('auro-menuoption');
|
|
190
|
-
menuoptions.forEach(mo => menu.removeChild(mo));
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const fillMenu = () => {
|
|
194
|
-
menu.innerHTML += `
|
|
195
|
-
<auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
|
|
196
|
-
<auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
|
|
197
|
-
<auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
|
|
198
|
-
<auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
|
|
199
|
-
<auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
|
|
200
|
-
<auro-menuoption static nomatch>No matching option</auro-menuoption>
|
|
201
|
-
`;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const load = () => {
|
|
205
|
-
clearTimeout(load.id);
|
|
206
|
-
emptyMenu();
|
|
207
|
-
menu.setAttribute('loading', 'loading');
|
|
208
|
-
load.id = setTimeout(() => {
|
|
209
|
-
menu.removeAttribute('loading');
|
|
210
|
-
fillMenu();
|
|
211
|
-
}, 1000);
|
|
212
|
-
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
combobox.addEventListener("inputValue", (e) => {
|
|
216
|
-
if (e.target.inputValue && e.target.value !== e.target.inputValue) {
|
|
217
|
-
load();
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
144
|
/**
|
|
223
145
|
* @license
|
|
224
146
|
* Copyright 2019 Google LLC
|
|
@@ -1078,12 +1000,23 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
1078
1000
|
}
|
|
1079
1001
|
|
|
1080
1002
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
1081
|
-
|
|
1082
|
-
|
|
1003
|
+
|
|
1004
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1005
|
+
|
|
1006
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1007
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1008
|
+
|
|
1009
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1010
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
1011
|
+
|
|
1012
|
+
// Reset element validity to the validity of the input
|
|
1013
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
1014
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1015
|
+
}
|
|
1083
1016
|
|
|
1084
1017
|
// multiple input in one components (datepicker)
|
|
1085
1018
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1086
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
1019
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
1087
1020
|
elem.validity = this.auroInputElements[1].validity;
|
|
1088
1021
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1089
1022
|
}
|
|
@@ -10344,12 +10277,23 @@ class AuroFormValidation {
|
|
|
10344
10277
|
}
|
|
10345
10278
|
|
|
10346
10279
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
10347
|
-
|
|
10348
|
-
|
|
10280
|
+
|
|
10281
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
10282
|
+
|
|
10283
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
10284
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
10285
|
+
|
|
10286
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
10287
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
10288
|
+
|
|
10289
|
+
// Reset element validity to the validity of the input
|
|
10290
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
10291
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
10292
|
+
}
|
|
10349
10293
|
|
|
10350
10294
|
// multiple input in one components (datepicker)
|
|
10351
10295
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
10352
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
10296
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
10353
10297
|
elem.validity = this.auroInputElements[1].validity;
|
|
10354
10298
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
10355
10299
|
}
|
|
@@ -16990,6 +16934,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16990
16934
|
// current focus is on a menuoption, after clicking on it.
|
|
16991
16935
|
if (this.persistInput && focusedEl && (focusedEl.tagName.toLowerCase() === 'auro-menuoption' || focusedEl.hasAttribute('auro-menuoption'))) {
|
|
16992
16936
|
this.setClearBtnFocus();
|
|
16937
|
+
this.validate(true);
|
|
16993
16938
|
}
|
|
16994
16939
|
}
|
|
16995
16940
|
}
|
|
@@ -17612,6 +17557,102 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17612
17557
|
}
|
|
17613
17558
|
}
|
|
17614
17559
|
|
|
17560
|
+
/**
|
|
17561
|
+
* Sets up demo external selection in the combobox.
|
|
17562
|
+
*/
|
|
17563
|
+
function setupExternalSelectionExample() {
|
|
17564
|
+
|
|
17565
|
+
/** @type {AuroCombobox} */
|
|
17566
|
+
const combobox = document.getElementById('externalSelectionExample');
|
|
17567
|
+
|
|
17568
|
+
combobox.addEventListener('input', () => {
|
|
17569
|
+
// Perform whatever matching logic you need here
|
|
17570
|
+
|
|
17571
|
+
// This comes from your custom code, for example matching SEA to SeaTac IATA code.
|
|
17572
|
+
// This matches "peaches" as configured.
|
|
17573
|
+
const matchingMenuOption = 2;
|
|
17574
|
+
combobox.updateActiveOption(matchingMenuOption);
|
|
17575
|
+
});
|
|
17576
|
+
}
|
|
17577
|
+
|
|
17578
|
+
function valueExample() {
|
|
17579
|
+
const valueExample = document.querySelector('#valueExample');
|
|
17580
|
+
|
|
17581
|
+
document.querySelector('#valueValidExampleBtn').addEventListener('click', () => {
|
|
17582
|
+
valueExample.value = 'Oranges';
|
|
17583
|
+
});
|
|
17584
|
+
|
|
17585
|
+
document.querySelector('#valueInvalidExampleBtn').addEventListener('click', () => {
|
|
17586
|
+
valueExample.value = 'Dragon Fruit';
|
|
17587
|
+
});
|
|
17588
|
+
|
|
17589
|
+
document.querySelector('#valueUndefinedExampleBtn').addEventListener('click', () => {
|
|
17590
|
+
valueExample.value = undefined;
|
|
17591
|
+
});
|
|
17592
|
+
}
|
|
17593
|
+
|
|
17594
|
+
function focusExample() {
|
|
17595
|
+
const focusExample = document.querySelector('#focusExample');
|
|
17596
|
+
const focusExampleBtnElem = document.querySelector('#focusExampleBtn');
|
|
17597
|
+
|
|
17598
|
+
focusExampleBtnElem.addEventListener('click', () => {
|
|
17599
|
+
focusExample.focus();
|
|
17600
|
+
});
|
|
17601
|
+
}
|
|
17602
|
+
|
|
17603
|
+
function inDialogExample() {
|
|
17604
|
+
document.querySelector("#combobox-dialog-opener").addEventListener("click", () => {
|
|
17605
|
+
const dialog = document.querySelector("#combobox-dialog");
|
|
17606
|
+
dialog.open = true;
|
|
17607
|
+
});
|
|
17608
|
+
}
|
|
17609
|
+
|
|
17610
|
+
function resetStateExample() {
|
|
17611
|
+
const elem = document.querySelector('#resetStateExample');
|
|
17612
|
+
|
|
17613
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
17614
|
+
elem.reset();
|
|
17615
|
+
});
|
|
17616
|
+
}
|
|
17617
|
+
|
|
17618
|
+
function auroMenuLoadingExample() {
|
|
17619
|
+
const combobox = document.querySelector("#loadingExample");
|
|
17620
|
+
const menu = document.querySelector("#loadingExampleComboboxMenu");
|
|
17621
|
+
|
|
17622
|
+
const emptyMenu = () => {
|
|
17623
|
+
const menuoptions = menu.querySelectorAll('auro-menuoption');
|
|
17624
|
+
menuoptions.forEach(mo => menu.removeChild(mo));
|
|
17625
|
+
};
|
|
17626
|
+
|
|
17627
|
+
const fillMenu = () => {
|
|
17628
|
+
menu.innerHTML += `
|
|
17629
|
+
<auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
|
|
17630
|
+
<auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
|
|
17631
|
+
<auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
|
|
17632
|
+
<auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
|
|
17633
|
+
<auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
|
|
17634
|
+
<auro-menuoption static nomatch>No matching option</auro-menuoption>
|
|
17635
|
+
`;
|
|
17636
|
+
};
|
|
17637
|
+
|
|
17638
|
+
const load = () => {
|
|
17639
|
+
clearTimeout(load.id);
|
|
17640
|
+
emptyMenu();
|
|
17641
|
+
menu.setAttribute('loading', 'loading');
|
|
17642
|
+
load.id = setTimeout(() => {
|
|
17643
|
+
menu.removeAttribute('loading');
|
|
17644
|
+
fillMenu();
|
|
17645
|
+
}, 1000);
|
|
17646
|
+
|
|
17647
|
+
};
|
|
17648
|
+
|
|
17649
|
+
combobox.addEventListener("inputValue", (e) => {
|
|
17650
|
+
if (e.target.inputValue && e.target.value !== e.target.inputValue) {
|
|
17651
|
+
load();
|
|
17652
|
+
}
|
|
17653
|
+
});
|
|
17654
|
+
}
|
|
17655
|
+
|
|
17615
17656
|
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.body-default{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{display:block;vertical-align:middle;line-height:0}:host .menuWrapper{box-sizing:border-box;display:flex;flex-direction:column;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;display:inline-block;margin-bottom:var(--ds-size-25, 0.125rem)}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .menuWrapper.lg{padding:var(--ds-size-150, 0.75rem);gap:var(--ds-size-50, 0.25rem)}:host([root]) .menuWrapper.xl{padding:var(--ds-size-200, 1rem);gap:var(--ds-size-100, 0.5rem)}`;
|
|
17616
17657
|
|
|
17617
17658
|
var colorCss$2 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
@@ -18228,6 +18269,9 @@ class AuroMenu extends AuroElement$1 {
|
|
|
18228
18269
|
case "ArrowUp":
|
|
18229
18270
|
this.navigateOptions('up');
|
|
18230
18271
|
break;
|
|
18272
|
+
case "Tab":
|
|
18273
|
+
this.makeSelection();
|
|
18274
|
+
break;
|
|
18231
18275
|
case "Enter":
|
|
18232
18276
|
this.makeSelection();
|
|
18233
18277
|
break;
|
|
@@ -19105,6 +19149,7 @@ function initExamples(initCount) {
|
|
|
19105
19149
|
inDialogExample();
|
|
19106
19150
|
resetStateExample();
|
|
19107
19151
|
auroMenuLoadingExample();
|
|
19152
|
+
setupExternalSelectionExample();
|
|
19108
19153
|
} catch (err) {
|
|
19109
19154
|
if (initCount <= 20) {
|
|
19110
19155
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
@@ -880,12 +880,23 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
883
|
-
|
|
884
|
-
|
|
883
|
+
|
|
884
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
885
|
+
|
|
886
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
887
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
888
|
+
|
|
889
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
890
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
891
|
+
|
|
892
|
+
// Reset element validity to the validity of the input
|
|
893
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
894
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
895
|
+
}
|
|
885
896
|
|
|
886
897
|
// multiple input in one components (datepicker)
|
|
887
898
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
888
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
899
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
889
900
|
elem.validity = this.auroInputElements[1].validity;
|
|
890
901
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
891
902
|
}
|
|
@@ -10146,12 +10157,23 @@ class AuroFormValidation {
|
|
|
10146
10157
|
}
|
|
10147
10158
|
|
|
10148
10159
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
10149
|
-
|
|
10150
|
-
|
|
10160
|
+
|
|
10161
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
10162
|
+
|
|
10163
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
10164
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
10165
|
+
|
|
10166
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
10167
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
10168
|
+
|
|
10169
|
+
// Reset element validity to the validity of the input
|
|
10170
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
10171
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
10172
|
+
}
|
|
10151
10173
|
|
|
10152
10174
|
// multiple input in one components (datepicker)
|
|
10153
10175
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
10154
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
10176
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
10155
10177
|
elem.validity = this.auroInputElements[1].validity;
|
|
10156
10178
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
10157
10179
|
}
|
|
@@ -16792,6 +16814,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16792
16814
|
// current focus is on a menuoption, after clicking on it.
|
|
16793
16815
|
if (this.persistInput && focusedEl && (focusedEl.tagName.toLowerCase() === 'auro-menuoption' || focusedEl.hasAttribute('auro-menuoption'))) {
|
|
16794
16816
|
this.setClearBtnFocus();
|
|
16817
|
+
this.validate(true);
|
|
16795
16818
|
}
|
|
16796
16819
|
}
|
|
16797
16820
|
}
|
|
@@ -18030,6 +18053,9 @@ class AuroMenu extends AuroElement$1 {
|
|
|
18030
18053
|
case "ArrowUp":
|
|
18031
18054
|
this.navigateOptions('up');
|
|
18032
18055
|
break;
|
|
18056
|
+
case "Tab":
|
|
18057
|
+
this.makeSelection();
|
|
18058
|
+
break;
|
|
18033
18059
|
case "Enter":
|
|
18034
18060
|
this.makeSelection();
|
|
18035
18061
|
break;
|
|
@@ -818,12 +818,23 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
818
818
|
}
|
|
819
819
|
|
|
820
820
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
|
|
822
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
823
|
+
|
|
824
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
825
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
826
|
+
|
|
827
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
828
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
829
|
+
|
|
830
|
+
// Reset element validity to the validity of the input
|
|
831
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
832
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
833
|
+
}
|
|
823
834
|
|
|
824
835
|
// multiple input in one components (datepicker)
|
|
825
836
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
826
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
837
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
827
838
|
elem.validity = this.auroInputElements[1].validity;
|
|
828
839
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
829
840
|
}
|
|
@@ -10053,12 +10064,23 @@ class AuroFormValidation {
|
|
|
10053
10064
|
}
|
|
10054
10065
|
|
|
10055
10066
|
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
10056
|
-
|
|
10057
|
-
|
|
10067
|
+
|
|
10068
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
10069
|
+
|
|
10070
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
10071
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
10072
|
+
|
|
10073
|
+
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
10074
|
+
this.auroInputElements.forEach(input => input.validate());
|
|
10075
|
+
|
|
10076
|
+
// Reset element validity to the validity of the input
|
|
10077
|
+
elem.validity = this.auroInputElements[0].validity;
|
|
10078
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
10079
|
+
}
|
|
10058
10080
|
|
|
10059
10081
|
// multiple input in one components (datepicker)
|
|
10060
10082
|
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
10061
|
-
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !
|
|
10083
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
|
|
10062
10084
|
elem.validity = this.auroInputElements[1].validity;
|
|
10063
10085
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
10064
10086
|
}
|
|
@@ -16699,6 +16721,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16699
16721
|
// current focus is on a menuoption, after clicking on it.
|
|
16700
16722
|
if (this.persistInput && focusedEl && (focusedEl.tagName.toLowerCase() === 'auro-menuoption' || focusedEl.hasAttribute('auro-menuoption'))) {
|
|
16701
16723
|
this.setClearBtnFocus();
|
|
16724
|
+
this.validate(true);
|
|
16702
16725
|
}
|
|
16703
16726
|
}
|
|
16704
16727
|
}
|