@aurodesignsystem-dev/auro-formkit 0.0.0-pr785.1 → 0.0.0-pr785.2

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.
@@ -3032,7 +3032,7 @@ class AuroFloatingUI {
3032
3032
  return;
3033
3033
  }
3034
3034
 
3035
- this.hideBib();
3035
+ this.hideBib("keydown");
3036
3036
  }
3037
3037
 
3038
3038
  setupHideHandlers() {
@@ -3057,7 +3057,7 @@ class AuroFloatingUI {
3057
3057
  document.expandedAuroFormkitDropdown = null;
3058
3058
  document.expandedAuroFloater = this;
3059
3059
  } else {
3060
- this.hideBib();
3060
+ this.hideBib("click");
3061
3061
  }
3062
3062
  }
3063
3063
  };
@@ -3070,7 +3070,7 @@ class AuroFloatingUI {
3070
3070
  // if something else is open, let it handle itself
3071
3071
  return;
3072
3072
  }
3073
- this.hideBib();
3073
+ this.hideBib("keydown");
3074
3074
  }
3075
3075
  };
3076
3076
 
@@ -3153,7 +3153,11 @@ class AuroFloatingUI {
3153
3153
  }
3154
3154
  }
3155
3155
 
3156
- hideBib() {
3156
+ /**
3157
+ * Hides the floating UI element.
3158
+ * @param {String} eventType - The event type that triggered the hiding action.
3159
+ */
3160
+ hideBib(eventType = "unknown") {
3157
3161
  if (!this.element.disabled && !this.element.noToggle) {
3158
3162
  this.lockScroll(false);
3159
3163
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3164,7 +3168,7 @@ class AuroFloatingUI {
3164
3168
  if (this.showing) {
3165
3169
  this.cleanupHideHandlers();
3166
3170
  this.showing = false;
3167
- this.dispatchEventDropdownToggle();
3171
+ this.dispatchEventDropdownToggle(eventType);
3168
3172
  }
3169
3173
  }
3170
3174
  document.expandedAuroFloater = null;
@@ -3173,11 +3177,13 @@ class AuroFloatingUI {
3173
3177
  /**
3174
3178
  * @private
3175
3179
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3180
+ * @param {String} eventType - The event type that triggered the toggle action.
3176
3181
  */
3177
- dispatchEventDropdownToggle() {
3182
+ dispatchEventDropdownToggle(eventType) {
3178
3183
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3179
3184
  detail: {
3180
3185
  expanded: this.showing,
3186
+ eventType: eventType || "unknown",
3181
3187
  },
3182
3188
  composed: true
3183
3189
  });
@@ -3187,7 +3193,7 @@ class AuroFloatingUI {
3187
3193
 
3188
3194
  handleClick() {
3189
3195
  if (this.element.isPopoverVisible) {
3190
- this.hideBib();
3196
+ this.hideBib("click");
3191
3197
  } else {
3192
3198
  this.showBib();
3193
3199
  }
@@ -3223,7 +3229,7 @@ class AuroFloatingUI {
3223
3229
  break;
3224
3230
  case 'mouseleave':
3225
3231
  if (this.element.hoverToggle) {
3226
- this.hideBib();
3232
+ this.hideBib("mouseleave");
3227
3233
  }
3228
3234
  break;
3229
3235
  case 'focus':
@@ -2940,7 +2940,7 @@ class AuroFloatingUI {
2940
2940
  return;
2941
2941
  }
2942
2942
 
2943
- this.hideBib();
2943
+ this.hideBib("keydown");
2944
2944
  }
2945
2945
 
2946
2946
  setupHideHandlers() {
@@ -2965,7 +2965,7 @@ class AuroFloatingUI {
2965
2965
  document.expandedAuroFormkitDropdown = null;
2966
2966
  document.expandedAuroFloater = this;
2967
2967
  } else {
2968
- this.hideBib();
2968
+ this.hideBib("click");
2969
2969
  }
2970
2970
  }
2971
2971
  };
@@ -2978,7 +2978,7 @@ class AuroFloatingUI {
2978
2978
  // if something else is open, let it handle itself
2979
2979
  return;
2980
2980
  }
2981
- this.hideBib();
2981
+ this.hideBib("keydown");
2982
2982
  }
2983
2983
  };
2984
2984
 
@@ -3061,7 +3061,11 @@ class AuroFloatingUI {
3061
3061
  }
3062
3062
  }
3063
3063
 
3064
- hideBib() {
3064
+ /**
3065
+ * Hides the floating UI element.
3066
+ * @param {String} eventType - The event type that triggered the hiding action.
3067
+ */
3068
+ hideBib(eventType = "unknown") {
3065
3069
  if (!this.element.disabled && !this.element.noToggle) {
3066
3070
  this.lockScroll(false);
3067
3071
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3072,7 +3076,7 @@ class AuroFloatingUI {
3072
3076
  if (this.showing) {
3073
3077
  this.cleanupHideHandlers();
3074
3078
  this.showing = false;
3075
- this.dispatchEventDropdownToggle();
3079
+ this.dispatchEventDropdownToggle(eventType);
3076
3080
  }
3077
3081
  }
3078
3082
  document.expandedAuroFloater = null;
@@ -3081,11 +3085,13 @@ class AuroFloatingUI {
3081
3085
  /**
3082
3086
  * @private
3083
3087
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3088
+ * @param {String} eventType - The event type that triggered the toggle action.
3084
3089
  */
3085
- dispatchEventDropdownToggle() {
3090
+ dispatchEventDropdownToggle(eventType) {
3086
3091
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3087
3092
  detail: {
3088
3093
  expanded: this.showing,
3094
+ eventType: eventType || "unknown",
3089
3095
  },
3090
3096
  composed: true
3091
3097
  });
@@ -3095,7 +3101,7 @@ class AuroFloatingUI {
3095
3101
 
3096
3102
  handleClick() {
3097
3103
  if (this.element.isPopoverVisible) {
3098
- this.hideBib();
3104
+ this.hideBib("click");
3099
3105
  } else {
3100
3106
  this.showBib();
3101
3107
  }
@@ -3131,7 +3137,7 @@ class AuroFloatingUI {
3131
3137
  break;
3132
3138
  case 'mouseleave':
3133
3139
  if (this.element.hoverToggle) {
3134
- this.hideBib();
3140
+ this.hideBib("mouseleave");
3135
3141
  }
3136
3142
  break;
3137
3143
  case 'focus':
@@ -2894,7 +2894,7 @@ class AuroFloatingUI {
2894
2894
  return;
2895
2895
  }
2896
2896
 
2897
- this.hideBib();
2897
+ this.hideBib("keydown");
2898
2898
  }
2899
2899
 
2900
2900
  setupHideHandlers() {
@@ -2919,7 +2919,7 @@ class AuroFloatingUI {
2919
2919
  document.expandedAuroFormkitDropdown = null;
2920
2920
  document.expandedAuroFloater = this;
2921
2921
  } else {
2922
- this.hideBib();
2922
+ this.hideBib("click");
2923
2923
  }
2924
2924
  }
2925
2925
  };
@@ -2932,7 +2932,7 @@ class AuroFloatingUI {
2932
2932
  // if something else is open, let it handle itself
2933
2933
  return;
2934
2934
  }
2935
- this.hideBib();
2935
+ this.hideBib("keydown");
2936
2936
  }
2937
2937
  };
2938
2938
 
@@ -3015,7 +3015,11 @@ class AuroFloatingUI {
3015
3015
  }
3016
3016
  }
3017
3017
 
3018
- hideBib() {
3018
+ /**
3019
+ * Hides the floating UI element.
3020
+ * @param {String} eventType - The event type that triggered the hiding action.
3021
+ */
3022
+ hideBib(eventType = "unknown") {
3019
3023
  if (!this.element.disabled && !this.element.noToggle) {
3020
3024
  this.lockScroll(false);
3021
3025
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3026,7 +3030,7 @@ class AuroFloatingUI {
3026
3030
  if (this.showing) {
3027
3031
  this.cleanupHideHandlers();
3028
3032
  this.showing = false;
3029
- this.dispatchEventDropdownToggle();
3033
+ this.dispatchEventDropdownToggle(eventType);
3030
3034
  }
3031
3035
  }
3032
3036
  document.expandedAuroFloater = null;
@@ -3035,11 +3039,13 @@ class AuroFloatingUI {
3035
3039
  /**
3036
3040
  * @private
3037
3041
  * @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.
3038
3043
  */
3039
- dispatchEventDropdownToggle() {
3044
+ dispatchEventDropdownToggle(eventType) {
3040
3045
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3041
3046
  detail: {
3042
3047
  expanded: this.showing,
3048
+ eventType: eventType || "unknown",
3043
3049
  },
3044
3050
  composed: true
3045
3051
  });
@@ -3049,7 +3055,7 @@ class AuroFloatingUI {
3049
3055
 
3050
3056
  handleClick() {
3051
3057
  if (this.element.isPopoverVisible) {
3052
- this.hideBib();
3058
+ this.hideBib("click");
3053
3059
  } else {
3054
3060
  this.showBib();
3055
3061
  }
@@ -3085,7 +3091,7 @@ class AuroFloatingUI {
3085
3091
  break;
3086
3092
  case 'mouseleave':
3087
3093
  if (this.element.hoverToggle) {
3088
- this.hideBib();
3094
+ this.hideBib("mouseleave");
3089
3095
  }
3090
3096
  break;
3091
3097
  case 'focus':
@@ -2894,7 +2894,7 @@ class AuroFloatingUI {
2894
2894
  return;
2895
2895
  }
2896
2896
 
2897
- this.hideBib();
2897
+ this.hideBib("keydown");
2898
2898
  }
2899
2899
 
2900
2900
  setupHideHandlers() {
@@ -2919,7 +2919,7 @@ class AuroFloatingUI {
2919
2919
  document.expandedAuroFormkitDropdown = null;
2920
2920
  document.expandedAuroFloater = this;
2921
2921
  } else {
2922
- this.hideBib();
2922
+ this.hideBib("click");
2923
2923
  }
2924
2924
  }
2925
2925
  };
@@ -2932,7 +2932,7 @@ class AuroFloatingUI {
2932
2932
  // if something else is open, let it handle itself
2933
2933
  return;
2934
2934
  }
2935
- this.hideBib();
2935
+ this.hideBib("keydown");
2936
2936
  }
2937
2937
  };
2938
2938
 
@@ -3015,7 +3015,11 @@ class AuroFloatingUI {
3015
3015
  }
3016
3016
  }
3017
3017
 
3018
- hideBib() {
3018
+ /**
3019
+ * Hides the floating UI element.
3020
+ * @param {String} eventType - The event type that triggered the hiding action.
3021
+ */
3022
+ hideBib(eventType = "unknown") {
3019
3023
  if (!this.element.disabled && !this.element.noToggle) {
3020
3024
  this.lockScroll(false);
3021
3025
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3026,7 +3030,7 @@ class AuroFloatingUI {
3026
3030
  if (this.showing) {
3027
3031
  this.cleanupHideHandlers();
3028
3032
  this.showing = false;
3029
- this.dispatchEventDropdownToggle();
3033
+ this.dispatchEventDropdownToggle(eventType);
3030
3034
  }
3031
3035
  }
3032
3036
  document.expandedAuroFloater = null;
@@ -3035,11 +3039,13 @@ class AuroFloatingUI {
3035
3039
  /**
3036
3040
  * @private
3037
3041
  * @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.
3038
3043
  */
3039
- dispatchEventDropdownToggle() {
3044
+ dispatchEventDropdownToggle(eventType) {
3040
3045
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3041
3046
  detail: {
3042
3047
  expanded: this.showing,
3048
+ eventType: eventType || "unknown",
3043
3049
  },
3044
3050
  composed: true
3045
3051
  });
@@ -3049,7 +3055,7 @@ class AuroFloatingUI {
3049
3055
 
3050
3056
  handleClick() {
3051
3057
  if (this.element.isPopoverVisible) {
3052
- this.hideBib();
3058
+ this.hideBib("click");
3053
3059
  } else {
3054
3060
  this.showBib();
3055
3061
  }
@@ -3085,7 +3091,7 @@ class AuroFloatingUI {
3085
3091
  break;
3086
3092
  case 'mouseleave':
3087
3093
  if (this.element.hoverToggle) {
3088
- this.hideBib();
3094
+ this.hideBib("mouseleave");
3089
3095
  }
3090
3096
  break;
3091
3097
  case 'focus':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr785.1",
3
+ "version": "0.0.0-pr785.2",
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.2.3",
56
+ "@aurodesignsystem/auro-library": "^5.3.0",
57
57
  "@lit/reactive-element": "^2.1.0",
58
58
  "lit": "^3.2.1"
59
59
  },