@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.0 → 0.0.0-pr784.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/components/checkbox/demo/api.min.js +16 -5
  2. package/components/checkbox/demo/index.min.js +16 -5
  3. package/components/checkbox/dist/index.js +16 -5
  4. package/components/checkbox/dist/registered.js +16 -5
  5. package/components/combobox/demo/api.md +1 -0
  6. package/components/combobox/demo/api.min.js +53 -15
  7. package/components/combobox/demo/index.min.js +53 -15
  8. package/components/combobox/dist/auro-combobox.d.ts +5 -0
  9. package/components/combobox/dist/index.js +53 -15
  10. package/components/combobox/dist/registered.js +53 -15
  11. package/components/counter/demo/api.min.js +16 -6
  12. package/components/counter/demo/index.min.js +16 -6
  13. package/components/counter/dist/index.js +16 -6
  14. package/components/counter/dist/registered.js +16 -6
  15. package/components/datepicker/demo/api.md +1 -0
  16. package/components/datepicker/demo/api.min.js +50 -14
  17. package/components/datepicker/demo/index.min.js +50 -14
  18. package/components/datepicker/dist/auro-datepicker.d.ts +5 -0
  19. package/components/datepicker/dist/index.js +50 -14
  20. package/components/datepicker/dist/registered.js +50 -14
  21. package/components/input/demo/api.md +2 -1
  22. package/components/input/demo/api.min.js +25 -7
  23. package/components/input/demo/index.min.js +25 -7
  24. package/components/input/dist/base-input.d.ts +5 -1
  25. package/components/input/dist/index.js +25 -7
  26. package/components/input/dist/registered.js +25 -7
  27. package/components/radio/demo/api.min.js +16 -5
  28. package/components/radio/demo/index.min.js +16 -5
  29. package/components/radio/dist/index.js +16 -5
  30. package/components/radio/dist/registered.js +16 -5
  31. package/components/select/demo/api.min.js +16 -5
  32. package/components/select/demo/index.min.js +16 -5
  33. package/components/select/dist/index.js +16 -5
  34. package/components/select/dist/registered.js +16 -5
  35. package/package.json +1 -1
@@ -749,13 +749,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
749
749
  this.getInputElements(elem);
750
750
  this.getAuroInputs(elem);
751
751
 
752
- // Validate only if noValidate is not true and the input does not have focus
752
+ // Check if validation should run
753
753
  let validationShouldRun =
754
+
755
+ // If the validation was forced
754
756
  force ||
755
- (!elem.contains(document.activeElement) &&
756
- (elem.touched ||
757
- (!elem.touched && typeof elem.value !== "undefined"))) ||
758
- elem.validateOnInput;
757
+
758
+ // If the validation should run on input
759
+ elem.validateOnInput ||
760
+
761
+ // State-based checks
762
+ (
763
+ // Element is not currently focused
764
+ !elem.contains(document.activeElement) && // native input is not focused directly
765
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
766
+
767
+ // And element has been touched or is untouched but has a value
768
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
769
+ );
759
770
 
760
771
  if (elem.hasAttribute('error')) {
761
772
  elem.validity = 'customError';
@@ -9966,13 +9977,24 @@ class AuroFormValidation {
9966
9977
  this.getInputElements(elem);
9967
9978
  this.getAuroInputs(elem);
9968
9979
 
9969
- // Validate only if noValidate is not true and the input does not have focus
9980
+ // Check if validation should run
9970
9981
  let validationShouldRun =
9982
+
9983
+ // If the validation was forced
9971
9984
  force ||
9972
- (!elem.contains(document.activeElement) &&
9973
- (elem.touched ||
9974
- (!elem.touched && typeof elem.value !== "undefined"))) ||
9975
- elem.validateOnInput;
9985
+
9986
+ // If the validation should run on input
9987
+ elem.validateOnInput ||
9988
+
9989
+ // State-based checks
9990
+ (
9991
+ // Element is not currently focused
9992
+ !elem.contains(document.activeElement) && // native input is not focused directly
9993
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
9994
+
9995
+ // And element has been touched or is untouched but has a value
9996
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
9997
+ );
9976
9998
 
9977
9999
  if (elem.hasAttribute('error')) {
9978
10000
  elem.validity = 'customError';
@@ -10923,9 +10945,9 @@ class BaseInput extends AuroElement$2$1 {
10923
10945
  this.inputElement.value = "";
10924
10946
  this.value = "";
10925
10947
  this.labelElement.classList.remove('inputElement-label--sticky');
10948
+ this.notifyValueChanged();
10926
10949
  this.focus();
10927
10950
  this.validation.validate(this);
10928
- this.notifyValueChanged();
10929
10951
  }
10930
10952
 
10931
10953
  /**
@@ -11020,13 +11042,20 @@ class BaseInput extends AuroElement$2$1 {
11020
11042
  }
11021
11043
 
11022
11044
  /**
11023
- * Resets component to initial state.
11045
+ * Resets component to initial state, including resetting the touched state and validity.
11024
11046
  * @returns {void}
11025
11047
  */
11026
11048
  reset() {
11027
11049
  this.validation.reset(this);
11028
11050
  }
11029
11051
 
11052
+ /**
11053
+ * Clears the input value
11054
+ */
11055
+ clear() {
11056
+ this.value = undefined;
11057
+ }
11058
+
11030
11059
  /**
11031
11060
  * Sets configuration data used elsewhere based on the `type` attribute.
11032
11061
  * @private
@@ -16370,7 +16399,7 @@ class AuroCombobox extends AuroElement {
16370
16399
  });
16371
16400
 
16372
16401
  this.menu.addEventListener('auroMenu-selectValueReset', () => {
16373
- this.reset();
16402
+ this.clear();
16374
16403
  });
16375
16404
  }
16376
16405
 
@@ -16390,7 +16419,7 @@ class AuroCombobox extends AuroElement {
16390
16419
  });
16391
16420
 
16392
16421
  /**
16393
- * Validate every time we remove focus from the datepicker.
16422
+ * Validate every time we remove focus from the combo box.
16394
16423
  */
16395
16424
  this.addEventListener('focusout', () => {
16396
16425
  if (document.activeElement !== this) {
@@ -16595,7 +16624,16 @@ class AuroCombobox extends AuroElement {
16595
16624
  */
16596
16625
  reset() {
16597
16626
  this.input.reset();
16627
+ this.menu.value = undefined;
16598
16628
  this.validation.reset(this);
16629
+ }
16630
+
16631
+ /**
16632
+ * Clears the current value of the combobox.
16633
+ * @returns {void}
16634
+ */
16635
+ clear() {
16636
+ this.input.clear();
16599
16637
  this.menu.value = undefined;
16600
16638
  }
16601
16639
 
@@ -16621,7 +16659,7 @@ class AuroCombobox extends AuroElement {
16621
16659
  this.hideBib();
16622
16660
  }
16623
16661
  } else {
16624
- this.reset();
16662
+ this.clear();
16625
16663
  }
16626
16664
  }
16627
16665
 
@@ -2281,13 +2281,24 @@ class AuroFormValidation {
2281
2281
  this.getInputElements(elem);
2282
2282
  this.getAuroInputs(elem);
2283
2283
 
2284
- // Validate only if noValidate is not true and the input does not have focus
2284
+ // Check if validation should run
2285
2285
  let validationShouldRun =
2286
+
2287
+ // If the validation was forced
2286
2288
  force ||
2287
- (!elem.contains(document.activeElement) &&
2288
- (elem.touched ||
2289
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2290
- elem.validateOnInput;
2289
+
2290
+ // If the validation should run on input
2291
+ elem.validateOnInput ||
2292
+
2293
+ // State-based checks
2294
+ (
2295
+ // Element is not currently focused
2296
+ !elem.contains(document.activeElement) && // native input is not focused directly
2297
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
2298
+
2299
+ // And element has been touched or is untouched but has a value
2300
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
2301
+ );
2291
2302
 
2292
2303
  if (elem.hasAttribute('error')) {
2293
2304
  elem.validity = 'customError';
@@ -3020,7 +3031,6 @@ class AuroCounter extends i$2 {
3020
3031
  aria-describedby="counter-description"
3021
3032
  tabindex="${this.disabled ? '-1' : '0'}"
3022
3033
  role="spinbutton"
3023
- aria-disabled="${this.disabled ? 'true' : 'false'}"
3024
3034
  aria-valuemin="${this.min}"
3025
3035
  aria-valuemax="${this.max}"
3026
3036
  aria-valuenow="${this.value}"
@@ -2281,13 +2281,24 @@ class AuroFormValidation {
2281
2281
  this.getInputElements(elem);
2282
2282
  this.getAuroInputs(elem);
2283
2283
 
2284
- // Validate only if noValidate is not true and the input does not have focus
2284
+ // Check if validation should run
2285
2285
  let validationShouldRun =
2286
+
2287
+ // If the validation was forced
2286
2288
  force ||
2287
- (!elem.contains(document.activeElement) &&
2288
- (elem.touched ||
2289
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2290
- elem.validateOnInput;
2289
+
2290
+ // If the validation should run on input
2291
+ elem.validateOnInput ||
2292
+
2293
+ // State-based checks
2294
+ (
2295
+ // Element is not currently focused
2296
+ !elem.contains(document.activeElement) && // native input is not focused directly
2297
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
2298
+
2299
+ // And element has been touched or is untouched but has a value
2300
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
2301
+ );
2291
2302
 
2292
2303
  if (elem.hasAttribute('error')) {
2293
2304
  elem.validity = 'customError';
@@ -3020,7 +3031,6 @@ class AuroCounter extends i$2 {
3020
3031
  aria-describedby="counter-description"
3021
3032
  tabindex="${this.disabled ? '-1' : '0'}"
3022
3033
  role="spinbutton"
3023
- aria-disabled="${this.disabled ? 'true' : 'false'}"
3024
3034
  aria-valuemin="${this.min}"
3025
3035
  aria-valuemax="${this.max}"
3026
3036
  aria-valuenow="${this.value}"
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
2234
2234
  this.getInputElements(elem);
2235
2235
  this.getAuroInputs(elem);
2236
2236
 
2237
- // Validate only if noValidate is not true and the input does not have focus
2237
+ // Check if validation should run
2238
2238
  let validationShouldRun =
2239
+
2240
+ // If the validation was forced
2239
2241
  force ||
2240
- (!elem.contains(document.activeElement) &&
2241
- (elem.touched ||
2242
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2243
- elem.validateOnInput;
2242
+
2243
+ // If the validation should run on input
2244
+ elem.validateOnInput ||
2245
+
2246
+ // State-based checks
2247
+ (
2248
+ // Element is not currently focused
2249
+ !elem.contains(document.activeElement) && // native input is not focused directly
2250
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
2251
+
2252
+ // And element has been touched or is untouched but has a value
2253
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
2254
+ );
2244
2255
 
2245
2256
  if (elem.hasAttribute('error')) {
2246
2257
  elem.validity = 'customError';
@@ -2973,7 +2984,6 @@ class AuroCounter extends LitElement {
2973
2984
  aria-describedby="counter-description"
2974
2985
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2986
  role="spinbutton"
2976
- aria-disabled="${this.disabled ? 'true' : 'false'}"
2977
2987
  aria-valuemin="${this.min}"
2978
2988
  aria-valuemax="${this.max}"
2979
2989
  aria-valuenow="${this.value}"
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
2234
2234
  this.getInputElements(elem);
2235
2235
  this.getAuroInputs(elem);
2236
2236
 
2237
- // Validate only if noValidate is not true and the input does not have focus
2237
+ // Check if validation should run
2238
2238
  let validationShouldRun =
2239
+
2240
+ // If the validation was forced
2239
2241
  force ||
2240
- (!elem.contains(document.activeElement) &&
2241
- (elem.touched ||
2242
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2243
- elem.validateOnInput;
2242
+
2243
+ // If the validation should run on input
2244
+ elem.validateOnInput ||
2245
+
2246
+ // State-based checks
2247
+ (
2248
+ // Element is not currently focused
2249
+ !elem.contains(document.activeElement) && // native input is not focused directly
2250
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
2251
+
2252
+ // And element has been touched or is untouched but has a value
2253
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
2254
+ );
2244
2255
 
2245
2256
  if (elem.hasAttribute('error')) {
2246
2257
  elem.validity = 'customError';
@@ -2973,7 +2984,6 @@ class AuroCounter extends LitElement {
2973
2984
  aria-describedby="counter-description"
2974
2985
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2986
  role="spinbutton"
2976
- aria-disabled="${this.disabled ? 'true' : 'false'}"
2977
2987
  aria-valuemin="${this.min}"
2978
2988
  aria-valuemax="${this.max}"
2979
2989
  aria-valuenow="${this.value}"
@@ -50,6 +50,7 @@
50
50
 
51
51
  | Method | Type | Description |
52
52
  |-------------------------------|----------------------------------------|--------------------------------------------------|
53
+ | [clear](#clear) | `(): void` | Clears the current value(s) of the datepicker. |
53
54
  | [focus](#focus) | `(focusInput: string): void` | Focuses the datepicker trigger input.<br /><br />**focusInput**: Pass in `endDate` to focus on the return input. No parameter is needed to focus on the depart input. |
54
55
  | [renderHtmlActionClear](#renderHtmlActionClear) | `(): TemplateResult` | |
55
56
  | [renderHtmlIconCalendar](#renderHtmlIconCalendar) | `(): TemplateResult` | |
@@ -989,13 +989,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
989
989
  this.getInputElements(elem);
990
990
  this.getAuroInputs(elem);
991
991
 
992
- // Validate only if noValidate is not true and the input does not have focus
992
+ // Check if validation should run
993
993
  let validationShouldRun =
994
+
995
+ // If the validation was forced
994
996
  force ||
995
- (!elem.contains(document.activeElement) &&
996
- (elem.touched ||
997
- (!elem.touched && typeof elem.value !== "undefined"))) ||
998
- elem.validateOnInput;
997
+
998
+ // If the validation should run on input
999
+ elem.validateOnInput ||
1000
+
1001
+ // State-based checks
1002
+ (
1003
+ // Element is not currently focused
1004
+ !elem.contains(document.activeElement) && // native input is not focused directly
1005
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
1006
+
1007
+ // And element has been touched or is untouched but has a value
1008
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
1009
+ );
999
1010
 
1000
1011
  if (elem.hasAttribute('error')) {
1001
1012
  elem.validity = 'customError';
@@ -23507,13 +23518,24 @@ class AuroFormValidation {
23507
23518
  this.getInputElements(elem);
23508
23519
  this.getAuroInputs(elem);
23509
23520
 
23510
- // Validate only if noValidate is not true and the input does not have focus
23521
+ // Check if validation should run
23511
23522
  let validationShouldRun =
23523
+
23524
+ // If the validation was forced
23512
23525
  force ||
23513
- (!elem.contains(document.activeElement) &&
23514
- (elem.touched ||
23515
- (!elem.touched && typeof elem.value !== "undefined"))) ||
23516
- elem.validateOnInput;
23526
+
23527
+ // If the validation should run on input
23528
+ elem.validateOnInput ||
23529
+
23530
+ // State-based checks
23531
+ (
23532
+ // Element is not currently focused
23533
+ !elem.contains(document.activeElement) && // native input is not focused directly
23534
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
23535
+
23536
+ // And element has been touched or is untouched but has a value
23537
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
23538
+ );
23517
23539
 
23518
23540
  if (elem.hasAttribute('error')) {
23519
23541
  elem.validity = 'customError';
@@ -24464,9 +24486,9 @@ class BaseInput extends AuroElement$2 {
24464
24486
  this.inputElement.value = "";
24465
24487
  this.value = "";
24466
24488
  this.labelElement.classList.remove('inputElement-label--sticky');
24489
+ this.notifyValueChanged();
24467
24490
  this.focus();
24468
24491
  this.validation.validate(this);
24469
- this.notifyValueChanged();
24470
24492
  }
24471
24493
 
24472
24494
  /**
@@ -24561,13 +24583,20 @@ class BaseInput extends AuroElement$2 {
24561
24583
  }
24562
24584
 
24563
24585
  /**
24564
- * Resets component to initial state.
24586
+ * Resets component to initial state, including resetting the touched state and validity.
24565
24587
  * @returns {void}
24566
24588
  */
24567
24589
  reset() {
24568
24590
  this.validation.reset(this);
24569
24591
  }
24570
24592
 
24593
+ /**
24594
+ * Clears the input value
24595
+ */
24596
+ clear() {
24597
+ this.value = undefined;
24598
+ }
24599
+
24571
24600
  /**
24572
24601
  * Sets configuration data used elsewhere based on the `type` attribute.
24573
24602
  * @private
@@ -28682,7 +28711,7 @@ class AuroDatePicker extends AuroElement$1 {
28682
28711
  */
28683
28712
  resetValues() {
28684
28713
  this.inputList.forEach((input) => {
28685
- input.reset();
28714
+ input.clear();
28686
28715
  });
28687
28716
  }
28688
28717
 
@@ -28692,10 +28721,17 @@ class AuroDatePicker extends AuroElement$1 {
28692
28721
  */
28693
28722
  reset() {
28694
28723
  this.resetValues();
28695
-
28696
28724
  this.validation.reset(this);
28697
28725
  }
28698
28726
 
28727
+ /**
28728
+ * Clears the current value(s) of the datepicker.
28729
+ * @returns {void}
28730
+ */
28731
+ clear() {
28732
+ this.resetValues();
28733
+ }
28734
+
28699
28735
  /**
28700
28736
  * Validates value.
28701
28737
  * @param {boolean} [force=false] - Whether to force validation.
@@ -730,13 +730,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
730
730
  this.getInputElements(elem);
731
731
  this.getAuroInputs(elem);
732
732
 
733
- // Validate only if noValidate is not true and the input does not have focus
733
+ // Check if validation should run
734
734
  let validationShouldRun =
735
+
736
+ // If the validation was forced
735
737
  force ||
736
- (!elem.contains(document.activeElement) &&
737
- (elem.touched ||
738
- (!elem.touched && typeof elem.value !== "undefined"))) ||
739
- elem.validateOnInput;
738
+
739
+ // If the validation should run on input
740
+ elem.validateOnInput ||
741
+
742
+ // State-based checks
743
+ (
744
+ // Element is not currently focused
745
+ !elem.contains(document.activeElement) && // native input is not focused directly
746
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
747
+
748
+ // And element has been touched or is untouched but has a value
749
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
750
+ );
740
751
 
741
752
  if (elem.hasAttribute('error')) {
742
753
  elem.validity = 'customError';
@@ -23248,13 +23259,24 @@ class AuroFormValidation {
23248
23259
  this.getInputElements(elem);
23249
23260
  this.getAuroInputs(elem);
23250
23261
 
23251
- // Validate only if noValidate is not true and the input does not have focus
23262
+ // Check if validation should run
23252
23263
  let validationShouldRun =
23264
+
23265
+ // If the validation was forced
23253
23266
  force ||
23254
- (!elem.contains(document.activeElement) &&
23255
- (elem.touched ||
23256
- (!elem.touched && typeof elem.value !== "undefined"))) ||
23257
- elem.validateOnInput;
23267
+
23268
+ // If the validation should run on input
23269
+ elem.validateOnInput ||
23270
+
23271
+ // State-based checks
23272
+ (
23273
+ // Element is not currently focused
23274
+ !elem.contains(document.activeElement) && // native input is not focused directly
23275
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
23276
+
23277
+ // And element has been touched or is untouched but has a value
23278
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
23279
+ );
23258
23280
 
23259
23281
  if (elem.hasAttribute('error')) {
23260
23282
  elem.validity = 'customError';
@@ -24205,9 +24227,9 @@ class BaseInput extends AuroElement$2 {
24205
24227
  this.inputElement.value = "";
24206
24228
  this.value = "";
24207
24229
  this.labelElement.classList.remove('inputElement-label--sticky');
24230
+ this.notifyValueChanged();
24208
24231
  this.focus();
24209
24232
  this.validation.validate(this);
24210
- this.notifyValueChanged();
24211
24233
  }
24212
24234
 
24213
24235
  /**
@@ -24302,13 +24324,20 @@ class BaseInput extends AuroElement$2 {
24302
24324
  }
24303
24325
 
24304
24326
  /**
24305
- * Resets component to initial state.
24327
+ * Resets component to initial state, including resetting the touched state and validity.
24306
24328
  * @returns {void}
24307
24329
  */
24308
24330
  reset() {
24309
24331
  this.validation.reset(this);
24310
24332
  }
24311
24333
 
24334
+ /**
24335
+ * Clears the input value
24336
+ */
24337
+ clear() {
24338
+ this.value = undefined;
24339
+ }
24340
+
24312
24341
  /**
24313
24342
  * Sets configuration data used elsewhere based on the `type` attribute.
24314
24343
  * @private
@@ -28423,7 +28452,7 @@ class AuroDatePicker extends AuroElement$1 {
28423
28452
  */
28424
28453
  resetValues() {
28425
28454
  this.inputList.forEach((input) => {
28426
- input.reset();
28455
+ input.clear();
28427
28456
  });
28428
28457
  }
28429
28458
 
@@ -28433,10 +28462,17 @@ class AuroDatePicker extends AuroElement$1 {
28433
28462
  */
28434
28463
  reset() {
28435
28464
  this.resetValues();
28436
-
28437
28465
  this.validation.reset(this);
28438
28466
  }
28439
28467
 
28468
+ /**
28469
+ * Clears the current value(s) of the datepicker.
28470
+ * @returns {void}
28471
+ */
28472
+ clear() {
28473
+ this.resetValues();
28474
+ }
28475
+
28440
28476
  /**
28441
28477
  * Validates value.
28442
28478
  * @param {boolean} [force=false] - Whether to force validation.
@@ -490,6 +490,11 @@ export class AuroDatePicker extends AuroElement {
490
490
  * @returns {void}
491
491
  */
492
492
  reset(): void;
493
+ /**
494
+ * Clears the current value(s) of the datepicker.
495
+ * @returns {void}
496
+ */
497
+ clear(): void;
493
498
  /**
494
499
  * Validates value.
495
500
  * @param {boolean} [force=false] - Whether to force validation.
@@ -710,13 +710,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
710
710
  this.getInputElements(elem);
711
711
  this.getAuroInputs(elem);
712
712
 
713
- // Validate only if noValidate is not true and the input does not have focus
713
+ // Check if validation should run
714
714
  let validationShouldRun =
715
+
716
+ // If the validation was forced
715
717
  force ||
716
- (!elem.contains(document.activeElement) &&
717
- (elem.touched ||
718
- (!elem.touched && typeof elem.value !== "undefined"))) ||
719
- elem.validateOnInput;
718
+
719
+ // If the validation should run on input
720
+ elem.validateOnInput ||
721
+
722
+ // State-based checks
723
+ (
724
+ // Element is not currently focused
725
+ !elem.contains(document.activeElement) && // native input is not focused directly
726
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
727
+
728
+ // And element has been touched or is untouched but has a value
729
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
730
+ );
720
731
 
721
732
  if (elem.hasAttribute('error')) {
722
733
  elem.validity = 'customError';
@@ -23184,13 +23195,24 @@ class AuroFormValidation {
23184
23195
  this.getInputElements(elem);
23185
23196
  this.getAuroInputs(elem);
23186
23197
 
23187
- // Validate only if noValidate is not true and the input does not have focus
23198
+ // Check if validation should run
23188
23199
  let validationShouldRun =
23200
+
23201
+ // If the validation was forced
23189
23202
  force ||
23190
- (!elem.contains(document.activeElement) &&
23191
- (elem.touched ||
23192
- (!elem.touched && typeof elem.value !== "undefined"))) ||
23193
- elem.validateOnInput;
23203
+
23204
+ // If the validation should run on input
23205
+ elem.validateOnInput ||
23206
+
23207
+ // State-based checks
23208
+ (
23209
+ // Element is not currently focused
23210
+ !elem.contains(document.activeElement) && // native input is not focused directly
23211
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
23212
+
23213
+ // And element has been touched or is untouched but has a value
23214
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
23215
+ );
23194
23216
 
23195
23217
  if (elem.hasAttribute('error')) {
23196
23218
  elem.validity = 'customError';
@@ -24141,9 +24163,9 @@ class BaseInput extends AuroElement$2 {
24141
24163
  this.inputElement.value = "";
24142
24164
  this.value = "";
24143
24165
  this.labelElement.classList.remove('inputElement-label--sticky');
24166
+ this.notifyValueChanged();
24144
24167
  this.focus();
24145
24168
  this.validation.validate(this);
24146
- this.notifyValueChanged();
24147
24169
  }
24148
24170
 
24149
24171
  /**
@@ -24238,13 +24260,20 @@ class BaseInput extends AuroElement$2 {
24238
24260
  }
24239
24261
 
24240
24262
  /**
24241
- * Resets component to initial state.
24263
+ * Resets component to initial state, including resetting the touched state and validity.
24242
24264
  * @returns {void}
24243
24265
  */
24244
24266
  reset() {
24245
24267
  this.validation.reset(this);
24246
24268
  }
24247
24269
 
24270
+ /**
24271
+ * Clears the input value
24272
+ */
24273
+ clear() {
24274
+ this.value = undefined;
24275
+ }
24276
+
24248
24277
  /**
24249
24278
  * Sets configuration data used elsewhere based on the `type` attribute.
24250
24279
  * @private
@@ -28359,7 +28388,7 @@ class AuroDatePicker extends AuroElement$1 {
28359
28388
  */
28360
28389
  resetValues() {
28361
28390
  this.inputList.forEach((input) => {
28362
- input.reset();
28391
+ input.clear();
28363
28392
  });
28364
28393
  }
28365
28394
 
@@ -28369,10 +28398,17 @@ class AuroDatePicker extends AuroElement$1 {
28369
28398
  */
28370
28399
  reset() {
28371
28400
  this.resetValues();
28372
-
28373
28401
  this.validation.reset(this);
28374
28402
  }
28375
28403
 
28404
+ /**
28405
+ * Clears the current value(s) of the datepicker.
28406
+ * @returns {void}
28407
+ */
28408
+ clear() {
28409
+ this.resetValues();
28410
+ }
28411
+
28376
28412
  /**
28377
28413
  * Validates value.
28378
28414
  * @param {boolean} [force=false] - Whether to force validation.