@aurodesignsystem/auro-formkit 5.1.0-rc-1102.1 → 5.1.0-rc-1115.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +1 -1
  3. package/components/bibtemplate/dist/index.js +44 -88
  4. package/components/bibtemplate/dist/registered.js +44 -88
  5. package/components/checkbox/demo/api.min.js +14 -3
  6. package/components/checkbox/demo/index.min.js +14 -3
  7. package/components/checkbox/dist/index.js +14 -3
  8. package/components/checkbox/dist/registered.js +14 -3
  9. package/components/combobox/demo/api.js +2 -0
  10. package/components/combobox/demo/api.md +115 -1
  11. package/components/combobox/demo/api.min.js +350 -282
  12. package/components/combobox/demo/index.min.js +253 -204
  13. package/components/combobox/dist/auro-combobox.d.ts +9 -0
  14. package/components/combobox/dist/index.js +246 -200
  15. package/components/combobox/dist/registered.js +246 -200
  16. package/components/counter/demo/api.md +29 -1
  17. package/components/counter/demo/api.min.js +219 -185
  18. package/components/counter/demo/index.min.js +219 -185
  19. package/components/counter/dist/auro-counter-group.d.ts +9 -0
  20. package/components/counter/dist/index.js +219 -185
  21. package/components/counter/dist/registered.js +219 -185
  22. package/components/datepicker/demo/api.md +23 -1
  23. package/components/datepicker/demo/api.min.js +304 -294
  24. package/components/datepicker/demo/index.md +6 -6
  25. package/components/datepicker/demo/index.min.js +304 -294
  26. package/components/datepicker/dist/auro-datepicker.d.ts +9 -0
  27. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  28. package/components/datepicker/dist/index.js +304 -294
  29. package/components/datepicker/dist/registered.js +304 -294
  30. package/components/dropdown/demo/api.md +46 -2
  31. package/components/dropdown/demo/api.min.js +101 -1
  32. package/components/dropdown/demo/index.min.js +101 -1
  33. package/components/dropdown/dist/auro-dropdown.d.ts +10 -0
  34. package/components/dropdown/dist/index.js +101 -1
  35. package/components/dropdown/dist/registered.js +101 -1
  36. package/components/input/demo/api.min.js +62 -95
  37. package/components/input/demo/index.min.js +62 -95
  38. package/components/input/dist/buttonVersion.d.ts +1 -1
  39. package/components/input/dist/index.js +62 -95
  40. package/components/input/dist/registered.js +62 -95
  41. package/components/menu/demo/api.min.js +3 -0
  42. package/components/menu/demo/index.min.js +3 -0
  43. package/components/menu/dist/index.js +3 -0
  44. package/components/menu/dist/registered.js +3 -0
  45. package/components/radio/demo/api.min.js +14 -3
  46. package/components/radio/demo/index.min.js +14 -3
  47. package/components/radio/dist/index.js +14 -3
  48. package/components/radio/dist/registered.js +14 -3
  49. package/components/select/demo/api.md +29 -1
  50. package/components/select/demo/api.min.js +188 -107
  51. package/components/select/demo/index.min.js +188 -107
  52. package/components/select/dist/auro-select.d.ts +9 -0
  53. package/components/select/dist/index.js +181 -103
  54. package/components/select/dist/registered.js +181 -103
  55. package/package.json +5 -5
@@ -1142,12 +1142,23 @@ class AuroFormValidation {
1142
1142
  }
1143
1143
 
1144
1144
  if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
1145
- elem.validity = this.auroInputElements[0].validity;
1146
- elem.errorMessage = this.auroInputElements[0].errorMessage;
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 && !this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
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
- elem.validity = this.auroInputElements[0].validity;
1138
- elem.errorMessage = this.auroInputElements[0].errorMessage;
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 && !this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
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
- elem.validity = this.auroInputElements[0].validity;
1091
- elem.errorMessage = this.auroInputElements[0].errorMessage;
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 && !this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
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
- elem.validity = this.auroInputElements[0].validity;
1091
- elem.errorMessage = this.auroInputElements[0].errorMessage;
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 && !this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
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
@@ -35,6 +35,7 @@
35
35
  | [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
36
36
  | [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
37
37
  | [shape](#shape) | | | `string` | "classic" | |
38
+ | [shift](#shift) | `shift` | | `boolean` | "false" | If declared, the dropdown will shift its position to avoid being cut off by the viewport. |
38
39
  | [size](#size) | | | `string` | "xl" | |
39
40
  | [triggerIcon](#triggerIcon) | `triggerIcon` | | `boolean` | false | If set, the `icon` attribute will be applied to the trigger `auro-input` element. |
40
41
  | [type](#type) | `type` | | `string` | | Applies the defined value as the type attribute on auro-input. |
@@ -381,6 +382,92 @@ export async function dynamicMenuExample() {
381
382
  <!-- AURO-GENERATED-CONTENT:END -->
382
383
  </auro-accordion>
383
384
 
385
+ ### Updating Externally
386
+
387
+ This example demonstrates using the <code>updateActiveOption</code> method to set a specific menu option as "active."
388
+
389
+ This is useful for situations like matching IATA codes (sea -> SeaTac airport)
390
+
391
+ <div class="exampleWrapper--ondark">
392
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/externalSelection.html) -->
393
+ <!-- The below content is automatically added from ./../apiExamples/externalSelection.html -->
394
+ <p style="color: white;">
395
+ Type 'a' in the combobox for best testing results :)
396
+ </p>
397
+ <auro-combobox ondark id="externalSelectionExample" layout="classic" shape="classic" size="lg" placeholder="Placeholder content" required style="width: 249px;">
398
+ <span slot="ariaLabel.bib.close">Close combobox</span>
399
+ <span slot="ariaLabel.input.clear">Clear All</span>
400
+ <span slot="bib.fullscreen.headline">Bib Header</span>
401
+ <span slot="label">Name</span>
402
+ <auro-menu>
403
+ <auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
404
+ <auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
405
+ <auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
406
+ <auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
407
+ <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
408
+ <auro-menuoption static nomatch>No matching option</auro-menuoption>
409
+ </auro-menu>
410
+ <span slot="helpText">
411
+ Help text - Lorem ipsum solar lorem ipsum solar
412
+ </span>
413
+ </auro-combobox>
414
+ <!-- AURO-GENERATED-CONTENT:END -->
415
+ </div>
416
+ <auro-accordion alignRight>
417
+ <span slot="trigger">See code</span>
418
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/externalSelection.html) -->
419
+ <!-- The below code snippet is automatically added from ./../apiExamples/externalSelection.html -->
420
+
421
+ ```html
422
+ <p style="color: white;">
423
+ Type 'a' in the combobox for best testing results :)
424
+ </p>
425
+ <auro-combobox ondark id="externalSelectionExample" layout="classic" shape="classic" size="lg" placeholder="Placeholder content" required style="width: 249px;">
426
+ <span slot="ariaLabel.bib.close">Close combobox</span>
427
+ <span slot="ariaLabel.input.clear">Clear All</span>
428
+ <span slot="bib.fullscreen.headline">Bib Header</span>
429
+ <span slot="label">Name</span>
430
+ <auro-menu>
431
+ <auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
432
+ <auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
433
+ <auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
434
+ <auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
435
+ <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
436
+ <auro-menuoption static nomatch>No matching option</auro-menuoption>
437
+ </auro-menu>
438
+ <span slot="helpText">
439
+ Help text - Lorem ipsum solar lorem ipsum solar
440
+ </span>
441
+ </auro-combobox>
442
+ ```
443
+ <!-- AURO-GENERATED-CONTENT:END -->
444
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/externalSelection.js) -->
445
+ <!-- The below code snippet is automatically added from ./../apiExamples/externalSelection.js -->
446
+
447
+ ```js
448
+ import { AuroCombobox } from "../src/auro-combobox";
449
+
450
+ /**
451
+ * Demonstrates how to make external selection in the combobox.
452
+ */
453
+ export function setupExternalSelectionExample() {
454
+
455
+ /** @type {AuroCombobox} */
456
+ const combobox = document.getElementById('externalSelectionExample');
457
+
458
+ combobox.addEventListener('input', () => {
459
+ // Perform whatever matching logic you need here
460
+
461
+ // This comes from your custom code, for example matching SEA to SeaTac IATA code.
462
+ // This matches "peaches" as configured.
463
+ const matchingMenuOption = 2;
464
+ combobox.updateActiveOption(matchingMenuOption);
465
+ });
466
+ }
467
+ ```
468
+ <!-- AURO-GENERATED-CONTENT:END -->
469
+ </auro-accordion>
470
+
384
471
  ### Property Examples
385
472
 
386
473
  #### disabled
@@ -1178,12 +1265,13 @@ export function auroMenuLoadingExample() {
1178
1265
  </auro-accordion>
1179
1266
 
1180
1267
  ### Customized bib position
1181
- The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement` attributes.
1268
+ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
1182
1269
 
1183
1270
  - `placement` specifies the preferred position where the bib should appear relative to the trigger.
1184
1271
  - `offset` sets the distance between the trigger and the bib.
1185
1272
  - When `autoPlacement` is enabled, smart positioning logic is applied to determine the best placement for the bib. If all sides have sufficient space, the bib will appear in the position specified by `placement`.
1186
1273
  - Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
1274
+ - `shift` when enabled, adjusts the bib position when it would overflow the viewport boundaries, ensuring it remains visible.
1187
1275
 
1188
1276
  <div class="exampleWrapper">
1189
1277
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floaterConfig.html) -->
@@ -1227,6 +1315,19 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1227
1315
  <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
1228
1316
  <auro-menuoption static nomatch>No matching option</auro-menuoption>
1229
1317
  </auro-menu>
1318
+ </auro-combobox>
1319
+ <auro-combobox width="350px" offset="20" noFlip placement="bottom-start" shift>
1320
+ <span slot="bib.fullscreen.headline">Bib Header</span>
1321
+ <span slot="label">Label</span>
1322
+ <span slot="helpText">bottom-start bib with 20px offset, noFlip and shift</span>
1323
+ <auro-menu>
1324
+ <auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
1325
+ <auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
1326
+ <auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
1327
+ <auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
1328
+ <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
1329
+ <auro-menuoption static nomatch>No matching option</auro-menuoption>
1330
+ </auro-menu>
1230
1331
  </auro-combobox>
1231
1332
  </div>
1232
1333
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -1276,6 +1377,19 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1276
1377
  <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
1277
1378
  <auro-menuoption static nomatch>No matching option</auro-menuoption>
1278
1379
  </auro-menu>
1380
+ </auro-combobox>
1381
+ <auro-combobox width="350px" offset="20" noFlip placement="bottom-start" shift>
1382
+ <span slot="bib.fullscreen.headline">Bib Header</span>
1383
+ <span slot="label">Label</span>
1384
+ <span slot="helpText">bottom-start bib with 20px offset, noFlip and shift</span>
1385
+ <auro-menu>
1386
+ <auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
1387
+ <auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
1388
+ <auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
1389
+ <auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
1390
+ <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
1391
+ <auro-menuoption static nomatch>No matching option</auro-menuoption>
1392
+ </auro-menu>
1279
1393
  </auro-combobox>
1280
1394
  </div>
1281
1395
  ```