@aurodesignsystem-dev/auro-formkit 0.0.0-pr784.0 → 0.0.0-pr785.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 +5 -16
- package/components/checkbox/demo/index.min.js +5 -16
- package/components/checkbox/dist/index.js +5 -16
- package/components/checkbox/dist/registered.js +5 -16
- package/components/combobox/demo/api.md +0 -1
- package/components/combobox/demo/api.min.js +29 -61
- package/components/combobox/demo/index.min.js +29 -61
- package/components/combobox/dist/auro-combobox.d.ts +0 -5
- package/components/combobox/dist/index.js +29 -61
- package/components/combobox/dist/registered.js +29 -61
- package/components/counter/demo/api.min.js +19 -24
- package/components/counter/demo/index.min.js +19 -24
- package/components/counter/dist/index.js +19 -24
- package/components/counter/dist/registered.js +19 -24
- package/components/datepicker/demo/api.md +1 -2
- package/components/datepicker/demo/api.min.js +87 -61
- package/components/datepicker/demo/index.min.js +87 -61
- package/components/datepicker/dist/auro-datepicker.d.ts +18 -6
- package/components/datepicker/dist/index.js +87 -61
- package/components/datepicker/dist/registered.js +87 -61
- package/components/dropdown/demo/api.md +7 -6
- package/components/dropdown/demo/api.min.js +14 -8
- package/components/dropdown/demo/index.min.js +14 -8
- package/components/dropdown/dist/auro-dropdown.d.ts +1 -0
- package/components/dropdown/dist/index.js +14 -8
- package/components/dropdown/dist/registered.js +14 -8
- package/components/input/demo/api.md +1 -2
- package/components/input/demo/api.min.js +7 -25
- package/components/input/demo/index.min.js +7 -25
- package/components/input/dist/base-input.d.ts +1 -5
- package/components/input/dist/index.js +7 -25
- package/components/input/dist/registered.js +7 -25
- package/components/radio/demo/api.min.js +5 -16
- package/components/radio/demo/index.min.js +5 -16
- package/components/radio/dist/index.js +5 -16
- package/components/radio/dist/registered.js +5 -16
- package/components/select/demo/api.min.js +19 -24
- package/components/select/demo/index.min.js +19 -24
- package/components/select/dist/index.js +19 -24
- package/components/select/dist/registered.js +19 -24
- package/package.json +2 -2
|
@@ -749,24 +749,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
749
749
|
this.getInputElements(elem);
|
|
750
750
|
this.getAuroInputs(elem);
|
|
751
751
|
|
|
752
|
-
//
|
|
752
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
753
753
|
let validationShouldRun =
|
|
754
|
-
|
|
755
|
-
// If the validation was forced
|
|
756
754
|
force ||
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
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
|
-
);
|
|
755
|
+
(!elem.contains(document.activeElement) &&
|
|
756
|
+
(elem.touched ||
|
|
757
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
758
|
+
elem.validateOnInput;
|
|
770
759
|
|
|
771
760
|
if (elem.hasAttribute('error')) {
|
|
772
761
|
elem.validity = 'customError';
|
|
@@ -2588,7 +2577,7 @@ class AuroFloatingUI {
|
|
|
2588
2577
|
*/
|
|
2589
2578
|
mirrorSize() {
|
|
2590
2579
|
// mirror the boxsize from bibSizer
|
|
2591
|
-
if (this.element.bibSizer) {
|
|
2580
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2592
2581
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2593
2582
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2594
2583
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2800,7 +2789,7 @@ class AuroFloatingUI {
|
|
|
2800
2789
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2801
2790
|
return;
|
|
2802
2791
|
}
|
|
2803
|
-
|
|
2792
|
+
|
|
2804
2793
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2805
2794
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2806
2795
|
return;
|
|
@@ -2988,7 +2977,7 @@ class AuroFloatingUI {
|
|
|
2988
2977
|
|
|
2989
2978
|
event.preventDefault();
|
|
2990
2979
|
this.handleClick();
|
|
2991
|
-
}
|
|
2980
|
+
}
|
|
2992
2981
|
break;
|
|
2993
2982
|
case 'mouseenter':
|
|
2994
2983
|
if (this.element.hoverToggle) {
|
|
@@ -4385,6 +4374,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4385
4374
|
|
|
4386
4375
|
this.parentBorder = false;
|
|
4387
4376
|
|
|
4377
|
+
/** @private */
|
|
4378
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4379
|
+
|
|
4388
4380
|
this.privateDefaults();
|
|
4389
4381
|
}
|
|
4390
4382
|
|
|
@@ -4818,12 +4810,14 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4818
4810
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4819
4811
|
this.handleTriggerContentSlotChange();
|
|
4820
4812
|
}
|
|
4813
|
+
}
|
|
4821
4814
|
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4815
|
+
handleDropdownToggle(event) {
|
|
4816
|
+
this.updateFocusTrap();
|
|
4817
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
4818
|
+
const eventType = event.detail.eventType || "unknown";
|
|
4819
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4820
|
+
this.trigger.focus();
|
|
4827
4821
|
}
|
|
4828
4822
|
}
|
|
4829
4823
|
|
|
@@ -4831,6 +4825,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4831
4825
|
|
|
4832
4826
|
// Configure the floater to, this will generate the ID for the bib
|
|
4833
4827
|
this.floater.configure(this, 'auroDropdown');
|
|
4828
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4834
4829
|
|
|
4835
4830
|
/**
|
|
4836
4831
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -9977,24 +9972,13 @@ class AuroFormValidation {
|
|
|
9977
9972
|
this.getInputElements(elem);
|
|
9978
9973
|
this.getAuroInputs(elem);
|
|
9979
9974
|
|
|
9980
|
-
//
|
|
9975
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
9981
9976
|
let validationShouldRun =
|
|
9982
|
-
|
|
9983
|
-
// If the validation was forced
|
|
9984
9977
|
force ||
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
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
|
-
);
|
|
9978
|
+
(!elem.contains(document.activeElement) &&
|
|
9979
|
+
(elem.touched ||
|
|
9980
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
9981
|
+
elem.validateOnInput;
|
|
9998
9982
|
|
|
9999
9983
|
if (elem.hasAttribute('error')) {
|
|
10000
9984
|
elem.validity = 'customError';
|
|
@@ -10945,9 +10929,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10945
10929
|
this.inputElement.value = "";
|
|
10946
10930
|
this.value = "";
|
|
10947
10931
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
10948
|
-
this.notifyValueChanged();
|
|
10949
10932
|
this.focus();
|
|
10950
10933
|
this.validation.validate(this);
|
|
10934
|
+
this.notifyValueChanged();
|
|
10951
10935
|
}
|
|
10952
10936
|
|
|
10953
10937
|
/**
|
|
@@ -11042,20 +11026,13 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11042
11026
|
}
|
|
11043
11027
|
|
|
11044
11028
|
/**
|
|
11045
|
-
* Resets component to initial state
|
|
11029
|
+
* Resets component to initial state.
|
|
11046
11030
|
* @returns {void}
|
|
11047
11031
|
*/
|
|
11048
11032
|
reset() {
|
|
11049
11033
|
this.validation.reset(this);
|
|
11050
11034
|
}
|
|
11051
11035
|
|
|
11052
|
-
/**
|
|
11053
|
-
* Clears the input value
|
|
11054
|
-
*/
|
|
11055
|
-
clear() {
|
|
11056
|
-
this.value = undefined;
|
|
11057
|
-
}
|
|
11058
|
-
|
|
11059
11036
|
/**
|
|
11060
11037
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
11061
11038
|
* @private
|
|
@@ -16399,7 +16376,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16399
16376
|
});
|
|
16400
16377
|
|
|
16401
16378
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
16402
|
-
this.
|
|
16379
|
+
this.reset();
|
|
16403
16380
|
});
|
|
16404
16381
|
}
|
|
16405
16382
|
|
|
@@ -16419,7 +16396,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16419
16396
|
});
|
|
16420
16397
|
|
|
16421
16398
|
/**
|
|
16422
|
-
* Validate every time we remove focus from the
|
|
16399
|
+
* Validate every time we remove focus from the datepicker.
|
|
16423
16400
|
*/
|
|
16424
16401
|
this.addEventListener('focusout', () => {
|
|
16425
16402
|
if (document.activeElement !== this) {
|
|
@@ -16624,16 +16601,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16624
16601
|
*/
|
|
16625
16602
|
reset() {
|
|
16626
16603
|
this.input.reset();
|
|
16627
|
-
this.menu.value = undefined;
|
|
16628
16604
|
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();
|
|
16637
16605
|
this.menu.value = undefined;
|
|
16638
16606
|
}
|
|
16639
16607
|
|
|
@@ -16659,7 +16627,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16659
16627
|
this.hideBib();
|
|
16660
16628
|
}
|
|
16661
16629
|
} else {
|
|
16662
|
-
this.
|
|
16630
|
+
this.reset();
|
|
16663
16631
|
}
|
|
16664
16632
|
}
|
|
16665
16633
|
|
|
@@ -749,24 +749,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
749
749
|
this.getInputElements(elem);
|
|
750
750
|
this.getAuroInputs(elem);
|
|
751
751
|
|
|
752
|
-
//
|
|
752
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
753
753
|
let validationShouldRun =
|
|
754
|
-
|
|
755
|
-
// If the validation was forced
|
|
756
754
|
force ||
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
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
|
-
);
|
|
755
|
+
(!elem.contains(document.activeElement) &&
|
|
756
|
+
(elem.touched ||
|
|
757
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
758
|
+
elem.validateOnInput;
|
|
770
759
|
|
|
771
760
|
if (elem.hasAttribute('error')) {
|
|
772
761
|
elem.validity = 'customError';
|
|
@@ -2588,7 +2577,7 @@ class AuroFloatingUI {
|
|
|
2588
2577
|
*/
|
|
2589
2578
|
mirrorSize() {
|
|
2590
2579
|
// mirror the boxsize from bibSizer
|
|
2591
|
-
if (this.element.bibSizer) {
|
|
2580
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2592
2581
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2593
2582
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2594
2583
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2800,7 +2789,7 @@ class AuroFloatingUI {
|
|
|
2800
2789
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2801
2790
|
return;
|
|
2802
2791
|
}
|
|
2803
|
-
|
|
2792
|
+
|
|
2804
2793
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2805
2794
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2806
2795
|
return;
|
|
@@ -2988,7 +2977,7 @@ class AuroFloatingUI {
|
|
|
2988
2977
|
|
|
2989
2978
|
event.preventDefault();
|
|
2990
2979
|
this.handleClick();
|
|
2991
|
-
}
|
|
2980
|
+
}
|
|
2992
2981
|
break;
|
|
2993
2982
|
case 'mouseenter':
|
|
2994
2983
|
if (this.element.hoverToggle) {
|
|
@@ -4385,6 +4374,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4385
4374
|
|
|
4386
4375
|
this.parentBorder = false;
|
|
4387
4376
|
|
|
4377
|
+
/** @private */
|
|
4378
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4379
|
+
|
|
4388
4380
|
this.privateDefaults();
|
|
4389
4381
|
}
|
|
4390
4382
|
|
|
@@ -4818,12 +4810,14 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4818
4810
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4819
4811
|
this.handleTriggerContentSlotChange();
|
|
4820
4812
|
}
|
|
4813
|
+
}
|
|
4821
4814
|
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4815
|
+
handleDropdownToggle(event) {
|
|
4816
|
+
this.updateFocusTrap();
|
|
4817
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
4818
|
+
const eventType = event.detail.eventType || "unknown";
|
|
4819
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4820
|
+
this.trigger.focus();
|
|
4827
4821
|
}
|
|
4828
4822
|
}
|
|
4829
4823
|
|
|
@@ -4831,6 +4825,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4831
4825
|
|
|
4832
4826
|
// Configure the floater to, this will generate the ID for the bib
|
|
4833
4827
|
this.floater.configure(this, 'auroDropdown');
|
|
4828
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4834
4829
|
|
|
4835
4830
|
/**
|
|
4836
4831
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -9977,24 +9972,13 @@ class AuroFormValidation {
|
|
|
9977
9972
|
this.getInputElements(elem);
|
|
9978
9973
|
this.getAuroInputs(elem);
|
|
9979
9974
|
|
|
9980
|
-
//
|
|
9975
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
9981
9976
|
let validationShouldRun =
|
|
9982
|
-
|
|
9983
|
-
// If the validation was forced
|
|
9984
9977
|
force ||
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
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
|
-
);
|
|
9978
|
+
(!elem.contains(document.activeElement) &&
|
|
9979
|
+
(elem.touched ||
|
|
9980
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
9981
|
+
elem.validateOnInput;
|
|
9998
9982
|
|
|
9999
9983
|
if (elem.hasAttribute('error')) {
|
|
10000
9984
|
elem.validity = 'customError';
|
|
@@ -10945,9 +10929,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10945
10929
|
this.inputElement.value = "";
|
|
10946
10930
|
this.value = "";
|
|
10947
10931
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
10948
|
-
this.notifyValueChanged();
|
|
10949
10932
|
this.focus();
|
|
10950
10933
|
this.validation.validate(this);
|
|
10934
|
+
this.notifyValueChanged();
|
|
10951
10935
|
}
|
|
10952
10936
|
|
|
10953
10937
|
/**
|
|
@@ -11042,20 +11026,13 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11042
11026
|
}
|
|
11043
11027
|
|
|
11044
11028
|
/**
|
|
11045
|
-
* Resets component to initial state
|
|
11029
|
+
* Resets component to initial state.
|
|
11046
11030
|
* @returns {void}
|
|
11047
11031
|
*/
|
|
11048
11032
|
reset() {
|
|
11049
11033
|
this.validation.reset(this);
|
|
11050
11034
|
}
|
|
11051
11035
|
|
|
11052
|
-
/**
|
|
11053
|
-
* Clears the input value
|
|
11054
|
-
*/
|
|
11055
|
-
clear() {
|
|
11056
|
-
this.value = undefined;
|
|
11057
|
-
}
|
|
11058
|
-
|
|
11059
11036
|
/**
|
|
11060
11037
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
11061
11038
|
* @private
|
|
@@ -16399,7 +16376,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16399
16376
|
});
|
|
16400
16377
|
|
|
16401
16378
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
16402
|
-
this.
|
|
16379
|
+
this.reset();
|
|
16403
16380
|
});
|
|
16404
16381
|
}
|
|
16405
16382
|
|
|
@@ -16419,7 +16396,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16419
16396
|
});
|
|
16420
16397
|
|
|
16421
16398
|
/**
|
|
16422
|
-
* Validate every time we remove focus from the
|
|
16399
|
+
* Validate every time we remove focus from the datepicker.
|
|
16423
16400
|
*/
|
|
16424
16401
|
this.addEventListener('focusout', () => {
|
|
16425
16402
|
if (document.activeElement !== this) {
|
|
@@ -16624,16 +16601,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16624
16601
|
*/
|
|
16625
16602
|
reset() {
|
|
16626
16603
|
this.input.reset();
|
|
16627
|
-
this.menu.value = undefined;
|
|
16628
16604
|
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();
|
|
16637
16605
|
this.menu.value = undefined;
|
|
16638
16606
|
}
|
|
16639
16607
|
|
|
@@ -16659,7 +16627,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16659
16627
|
this.hideBib();
|
|
16660
16628
|
}
|
|
16661
16629
|
} else {
|
|
16662
|
-
this.
|
|
16630
|
+
this.reset();
|
|
16663
16631
|
}
|
|
16664
16632
|
}
|
|
16665
16633
|
|
|
@@ -2281,24 +2281,13 @@ class AuroFormValidation {
|
|
|
2281
2281
|
this.getInputElements(elem);
|
|
2282
2282
|
this.getAuroInputs(elem);
|
|
2283
2283
|
|
|
2284
|
-
//
|
|
2284
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
2285
2285
|
let validationShouldRun =
|
|
2286
|
-
|
|
2287
|
-
// If the validation was forced
|
|
2288
2286
|
force ||
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
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
|
-
);
|
|
2287
|
+
(!elem.contains(document.activeElement) &&
|
|
2288
|
+
(elem.touched ||
|
|
2289
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
2290
|
+
elem.validateOnInput;
|
|
2302
2291
|
|
|
2303
2292
|
if (elem.hasAttribute('error')) {
|
|
2304
2293
|
elem.validity = 'customError';
|
|
@@ -4759,7 +4748,7 @@ class AuroFloatingUI {
|
|
|
4759
4748
|
*/
|
|
4760
4749
|
mirrorSize() {
|
|
4761
4750
|
// mirror the boxsize from bibSizer
|
|
4762
|
-
if (this.element.bibSizer) {
|
|
4751
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
4763
4752
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
4764
4753
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
4765
4754
|
if (sizerStyle.width !== '0px') {
|
|
@@ -4971,7 +4960,7 @@ class AuroFloatingUI {
|
|
|
4971
4960
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
4972
4961
|
return;
|
|
4973
4962
|
}
|
|
4974
|
-
|
|
4963
|
+
|
|
4975
4964
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4976
4965
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
4977
4966
|
return;
|
|
@@ -5159,7 +5148,7 @@ class AuroFloatingUI {
|
|
|
5159
5148
|
|
|
5160
5149
|
event.preventDefault();
|
|
5161
5150
|
this.handleClick();
|
|
5162
|
-
}
|
|
5151
|
+
}
|
|
5163
5152
|
break;
|
|
5164
5153
|
case 'mouseenter':
|
|
5165
5154
|
if (this.element.hoverToggle) {
|
|
@@ -6556,6 +6545,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6556
6545
|
|
|
6557
6546
|
this.parentBorder = false;
|
|
6558
6547
|
|
|
6548
|
+
/** @private */
|
|
6549
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
6550
|
+
|
|
6559
6551
|
this.privateDefaults();
|
|
6560
6552
|
}
|
|
6561
6553
|
|
|
@@ -6989,12 +6981,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6989
6981
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
6990
6982
|
this.handleTriggerContentSlotChange();
|
|
6991
6983
|
}
|
|
6984
|
+
}
|
|
6992
6985
|
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6986
|
+
handleDropdownToggle(event) {
|
|
6987
|
+
this.updateFocusTrap();
|
|
6988
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
6989
|
+
const eventType = event.detail.eventType || "unknown";
|
|
6990
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
6991
|
+
this.trigger.focus();
|
|
6998
6992
|
}
|
|
6999
6993
|
}
|
|
7000
6994
|
|
|
@@ -7002,6 +6996,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7002
6996
|
|
|
7003
6997
|
// Configure the floater to, this will generate the ID for the bib
|
|
7004
6998
|
this.floater.configure(this, 'auroDropdown');
|
|
6999
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
7005
7000
|
|
|
7006
7001
|
/**
|
|
7007
7002
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -2281,24 +2281,13 @@ class AuroFormValidation {
|
|
|
2281
2281
|
this.getInputElements(elem);
|
|
2282
2282
|
this.getAuroInputs(elem);
|
|
2283
2283
|
|
|
2284
|
-
//
|
|
2284
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
2285
2285
|
let validationShouldRun =
|
|
2286
|
-
|
|
2287
|
-
// If the validation was forced
|
|
2288
2286
|
force ||
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
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
|
-
);
|
|
2287
|
+
(!elem.contains(document.activeElement) &&
|
|
2288
|
+
(elem.touched ||
|
|
2289
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
2290
|
+
elem.validateOnInput;
|
|
2302
2291
|
|
|
2303
2292
|
if (elem.hasAttribute('error')) {
|
|
2304
2293
|
elem.validity = 'customError';
|
|
@@ -4759,7 +4748,7 @@ class AuroFloatingUI {
|
|
|
4759
4748
|
*/
|
|
4760
4749
|
mirrorSize() {
|
|
4761
4750
|
// mirror the boxsize from bibSizer
|
|
4762
|
-
if (this.element.bibSizer) {
|
|
4751
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
4763
4752
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
4764
4753
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
4765
4754
|
if (sizerStyle.width !== '0px') {
|
|
@@ -4971,7 +4960,7 @@ class AuroFloatingUI {
|
|
|
4971
4960
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
4972
4961
|
return;
|
|
4973
4962
|
}
|
|
4974
|
-
|
|
4963
|
+
|
|
4975
4964
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4976
4965
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
4977
4966
|
return;
|
|
@@ -5159,7 +5148,7 @@ class AuroFloatingUI {
|
|
|
5159
5148
|
|
|
5160
5149
|
event.preventDefault();
|
|
5161
5150
|
this.handleClick();
|
|
5162
|
-
}
|
|
5151
|
+
}
|
|
5163
5152
|
break;
|
|
5164
5153
|
case 'mouseenter':
|
|
5165
5154
|
if (this.element.hoverToggle) {
|
|
@@ -6556,6 +6545,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6556
6545
|
|
|
6557
6546
|
this.parentBorder = false;
|
|
6558
6547
|
|
|
6548
|
+
/** @private */
|
|
6549
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
6550
|
+
|
|
6559
6551
|
this.privateDefaults();
|
|
6560
6552
|
}
|
|
6561
6553
|
|
|
@@ -6989,12 +6981,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6989
6981
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
6990
6982
|
this.handleTriggerContentSlotChange();
|
|
6991
6983
|
}
|
|
6984
|
+
}
|
|
6992
6985
|
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6986
|
+
handleDropdownToggle(event) {
|
|
6987
|
+
this.updateFocusTrap();
|
|
6988
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
6989
|
+
const eventType = event.detail.eventType || "unknown";
|
|
6990
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
6991
|
+
this.trigger.focus();
|
|
6998
6992
|
}
|
|
6999
6993
|
}
|
|
7000
6994
|
|
|
@@ -7002,6 +6996,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7002
6996
|
|
|
7003
6997
|
// Configure the floater to, this will generate the ID for the bib
|
|
7004
6998
|
this.floater.configure(this, 'auroDropdown');
|
|
6999
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
7005
7000
|
|
|
7006
7001
|
/**
|
|
7007
7002
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -2234,24 +2234,13 @@ class AuroFormValidation {
|
|
|
2234
2234
|
this.getInputElements(elem);
|
|
2235
2235
|
this.getAuroInputs(elem);
|
|
2236
2236
|
|
|
2237
|
-
//
|
|
2237
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
2238
2238
|
let validationShouldRun =
|
|
2239
|
-
|
|
2240
|
-
// If the validation was forced
|
|
2241
2239
|
force ||
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
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
|
-
);
|
|
2240
|
+
(!elem.contains(document.activeElement) &&
|
|
2241
|
+
(elem.touched ||
|
|
2242
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
2243
|
+
elem.validateOnInput;
|
|
2255
2244
|
|
|
2256
2245
|
if (elem.hasAttribute('error')) {
|
|
2257
2246
|
elem.validity = 'customError';
|
|
@@ -4712,7 +4701,7 @@ class AuroFloatingUI {
|
|
|
4712
4701
|
*/
|
|
4713
4702
|
mirrorSize() {
|
|
4714
4703
|
// mirror the boxsize from bibSizer
|
|
4715
|
-
if (this.element.bibSizer) {
|
|
4704
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
4716
4705
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
4717
4706
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
4718
4707
|
if (sizerStyle.width !== '0px') {
|
|
@@ -4924,7 +4913,7 @@ class AuroFloatingUI {
|
|
|
4924
4913
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
4925
4914
|
return;
|
|
4926
4915
|
}
|
|
4927
|
-
|
|
4916
|
+
|
|
4928
4917
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4929
4918
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
4930
4919
|
return;
|
|
@@ -5112,7 +5101,7 @@ class AuroFloatingUI {
|
|
|
5112
5101
|
|
|
5113
5102
|
event.preventDefault();
|
|
5114
5103
|
this.handleClick();
|
|
5115
|
-
}
|
|
5104
|
+
}
|
|
5116
5105
|
break;
|
|
5117
5106
|
case 'mouseenter':
|
|
5118
5107
|
if (this.element.hoverToggle) {
|
|
@@ -6509,6 +6498,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6509
6498
|
|
|
6510
6499
|
this.parentBorder = false;
|
|
6511
6500
|
|
|
6501
|
+
/** @private */
|
|
6502
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
6503
|
+
|
|
6512
6504
|
this.privateDefaults();
|
|
6513
6505
|
}
|
|
6514
6506
|
|
|
@@ -6942,12 +6934,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6942
6934
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
6943
6935
|
this.handleTriggerContentSlotChange();
|
|
6944
6936
|
}
|
|
6937
|
+
}
|
|
6945
6938
|
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6939
|
+
handleDropdownToggle(event) {
|
|
6940
|
+
this.updateFocusTrap();
|
|
6941
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
6942
|
+
const eventType = event.detail.eventType || "unknown";
|
|
6943
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
6944
|
+
this.trigger.focus();
|
|
6951
6945
|
}
|
|
6952
6946
|
}
|
|
6953
6947
|
|
|
@@ -6955,6 +6949,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6955
6949
|
|
|
6956
6950
|
// Configure the floater to, this will generate the ID for the bib
|
|
6957
6951
|
this.floater.configure(this, 'auroDropdown');
|
|
6952
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
6958
6953
|
|
|
6959
6954
|
/**
|
|
6960
6955
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|