@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.1 → 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.
- package/components/checkbox/demo/api.min.js +16 -5
- package/components/checkbox/demo/index.min.js +16 -5
- package/components/checkbox/dist/index.js +16 -5
- package/components/checkbox/dist/registered.js +16 -5
- package/components/combobox/demo/api.md +1 -0
- package/components/combobox/demo/api.min.js +69 -48
- package/components/combobox/demo/index.min.js +69 -48
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +69 -48
- package/components/combobox/dist/registered.js +69 -48
- package/components/counter/demo/api.min.js +32 -39
- package/components/counter/demo/index.min.js +32 -39
- package/components/counter/dist/index.js +32 -39
- package/components/counter/dist/registered.js +32 -39
- package/components/datepicker/demo/api.md +2 -0
- package/components/datepicker/demo/api.min.js +69 -107
- package/components/datepicker/demo/index.min.js +69 -107
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -19
- package/components/datepicker/dist/index.js +69 -107
- package/components/datepicker/dist/registered.js +69 -107
- package/components/dropdown/demo/api.min.js +16 -33
- package/components/dropdown/demo/index.min.js +16 -33
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -6
- package/components/dropdown/dist/index.js +16 -33
- package/components/dropdown/dist/registered.js +16 -33
- package/components/input/demo/api.md +2 -1
- package/components/input/demo/api.min.js +25 -7
- package/components/input/demo/index.min.js +25 -7
- package/components/input/dist/base-input.d.ts +5 -1
- package/components/input/dist/index.js +25 -7
- package/components/input/dist/registered.js +25 -7
- package/components/radio/demo/api.min.js +16 -5
- package/components/radio/demo/index.min.js +16 -5
- package/components/radio/dist/index.js +16 -5
- package/components/radio/dist/registered.js +16 -5
- package/components/select/demo/api.min.js +32 -38
- package/components/select/demo/index.min.js +32 -38
- package/components/select/dist/index.js +32 -38
- package/components/select/dist/registered.js +32 -38
- package/package.json +2 -2
|
@@ -808,13 +808,24 @@ class AuroFormValidation {
|
|
|
808
808
|
this.getInputElements(elem);
|
|
809
809
|
this.getAuroInputs(elem);
|
|
810
810
|
|
|
811
|
-
//
|
|
811
|
+
// Check if validation should run
|
|
812
812
|
let validationShouldRun =
|
|
813
|
+
|
|
814
|
+
// If the validation was forced
|
|
813
815
|
force ||
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
|
|
817
|
+
// If the validation should run on input
|
|
818
|
+
elem.validateOnInput ||
|
|
819
|
+
|
|
820
|
+
// State-based checks
|
|
821
|
+
(
|
|
822
|
+
// Element is not currently focused
|
|
823
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
824
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
825
|
+
|
|
826
|
+
// And element has been touched or is untouched but has a value
|
|
827
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
828
|
+
);
|
|
818
829
|
|
|
819
830
|
if (elem.hasAttribute('error')) {
|
|
820
831
|
elem.validity = 'customError';
|
|
@@ -2676,7 +2687,7 @@ class AuroFloatingUI {
|
|
|
2676
2687
|
*/
|
|
2677
2688
|
mirrorSize() {
|
|
2678
2689
|
// mirror the boxsize from bibSizer
|
|
2679
|
-
if (this.element.bibSizer
|
|
2690
|
+
if (this.element.bibSizer) {
|
|
2680
2691
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2681
2692
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2682
2693
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2888,13 +2899,13 @@ class AuroFloatingUI {
|
|
|
2888
2899
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2889
2900
|
return;
|
|
2890
2901
|
}
|
|
2891
|
-
|
|
2902
|
+
|
|
2892
2903
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2893
2904
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2894
2905
|
return;
|
|
2895
2906
|
}
|
|
2896
2907
|
|
|
2897
|
-
this.hideBib(
|
|
2908
|
+
this.hideBib();
|
|
2898
2909
|
}
|
|
2899
2910
|
|
|
2900
2911
|
setupHideHandlers() {
|
|
@@ -2919,7 +2930,7 @@ class AuroFloatingUI {
|
|
|
2919
2930
|
document.expandedAuroFormkitDropdown = null;
|
|
2920
2931
|
document.expandedAuroFloater = this;
|
|
2921
2932
|
} else {
|
|
2922
|
-
this.hideBib(
|
|
2933
|
+
this.hideBib();
|
|
2923
2934
|
}
|
|
2924
2935
|
}
|
|
2925
2936
|
};
|
|
@@ -2932,7 +2943,7 @@ class AuroFloatingUI {
|
|
|
2932
2943
|
// if something else is open, let it handle itself
|
|
2933
2944
|
return;
|
|
2934
2945
|
}
|
|
2935
|
-
this.hideBib(
|
|
2946
|
+
this.hideBib();
|
|
2936
2947
|
}
|
|
2937
2948
|
};
|
|
2938
2949
|
|
|
@@ -3015,11 +3026,7 @@ class AuroFloatingUI {
|
|
|
3015
3026
|
}
|
|
3016
3027
|
}
|
|
3017
3028
|
|
|
3018
|
-
|
|
3019
|
-
* Hides the floating UI element.
|
|
3020
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3021
|
-
*/
|
|
3022
|
-
hideBib(eventType = "unknown") {
|
|
3029
|
+
hideBib() {
|
|
3023
3030
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3024
3031
|
this.lockScroll(false);
|
|
3025
3032
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3030,7 +3037,7 @@ class AuroFloatingUI {
|
|
|
3030
3037
|
if (this.showing) {
|
|
3031
3038
|
this.cleanupHideHandlers();
|
|
3032
3039
|
this.showing = false;
|
|
3033
|
-
this.dispatchEventDropdownToggle(
|
|
3040
|
+
this.dispatchEventDropdownToggle();
|
|
3034
3041
|
}
|
|
3035
3042
|
}
|
|
3036
3043
|
document.expandedAuroFloater = null;
|
|
@@ -3039,13 +3046,11 @@ class AuroFloatingUI {
|
|
|
3039
3046
|
/**
|
|
3040
3047
|
* @private
|
|
3041
3048
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3042
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3043
3049
|
*/
|
|
3044
|
-
dispatchEventDropdownToggle(
|
|
3050
|
+
dispatchEventDropdownToggle() {
|
|
3045
3051
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3046
3052
|
detail: {
|
|
3047
3053
|
expanded: this.showing,
|
|
3048
|
-
eventType: eventType || "unknown",
|
|
3049
3054
|
},
|
|
3050
3055
|
composed: true
|
|
3051
3056
|
});
|
|
@@ -3055,7 +3060,7 @@ class AuroFloatingUI {
|
|
|
3055
3060
|
|
|
3056
3061
|
handleClick() {
|
|
3057
3062
|
if (this.element.isPopoverVisible) {
|
|
3058
|
-
this.hideBib(
|
|
3063
|
+
this.hideBib();
|
|
3059
3064
|
} else {
|
|
3060
3065
|
this.showBib();
|
|
3061
3066
|
}
|
|
@@ -3082,7 +3087,7 @@ class AuroFloatingUI {
|
|
|
3082
3087
|
|
|
3083
3088
|
event.preventDefault();
|
|
3084
3089
|
this.handleClick();
|
|
3085
|
-
}
|
|
3090
|
+
}
|
|
3086
3091
|
break;
|
|
3087
3092
|
case 'mouseenter':
|
|
3088
3093
|
if (this.element.hoverToggle) {
|
|
@@ -3091,7 +3096,7 @@ class AuroFloatingUI {
|
|
|
3091
3096
|
break;
|
|
3092
3097
|
case 'mouseleave':
|
|
3093
3098
|
if (this.element.hoverToggle) {
|
|
3094
|
-
this.hideBib(
|
|
3099
|
+
this.hideBib();
|
|
3095
3100
|
}
|
|
3096
3101
|
break;
|
|
3097
3102
|
case 'focus':
|
|
@@ -4479,9 +4484,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4479
4484
|
|
|
4480
4485
|
this.parentBorder = false;
|
|
4481
4486
|
|
|
4482
|
-
/** @private */
|
|
4483
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4484
|
-
|
|
4485
4487
|
this.privateDefaults();
|
|
4486
4488
|
}
|
|
4487
4489
|
|
|
@@ -4915,19 +4917,12 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4915
4917
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4916
4918
|
this.handleTriggerContentSlotChange();
|
|
4917
4919
|
}
|
|
4918
|
-
}
|
|
4919
4920
|
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
handleDropdownToggle(event) {
|
|
4926
|
-
this.updateFocusTrap();
|
|
4927
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4928
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4929
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4930
|
-
this.trigger.focus();
|
|
4921
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4922
|
+
this.updateFocusTrap();
|
|
4923
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4924
|
+
this.trigger.focus();
|
|
4925
|
+
}
|
|
4931
4926
|
}
|
|
4932
4927
|
}
|
|
4933
4928
|
|
|
@@ -4935,7 +4930,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4935
4930
|
|
|
4936
4931
|
// Configure the floater to, this will generate the ID for the bib
|
|
4937
4932
|
this.floater.configure(this, 'auroDropdown');
|
|
4938
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4939
4933
|
|
|
4940
4934
|
/**
|
|
4941
4935
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurodesignsystem-dev/auro-formkit",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-pr784.0",
|
|
4
4
|
"description": "A collection of web components used to build forms.",
|
|
5
5
|
"homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"local-demo": "npm run build && sh ./local-demo.sh --zip"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@aurodesignsystem/auro-library": "^5.
|
|
56
|
+
"@aurodesignsystem/auro-library": "^5.2.2",
|
|
57
57
|
"@lit/reactive-element": "^2.1.0",
|
|
58
58
|
"lit": "^3.2.1"
|
|
59
59
|
},
|