@haiilo/catalyst 1.2.0 → 1.2.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.
@@ -3053,7 +3053,7 @@ const firstTabbable = (container) => {
3053
3053
  return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
3054
3054
  };
3055
3055
 
3056
- const catMenuCss = ":host{display:contents}:host([hidden]){display:none}.content{padding-top:0.5rem;padding-bottom:0.5rem;position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-width:8rem;max-width:16rem;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}";
3056
+ const catMenuCss = ":host{display:contents}:host([hidden]){display:none}::slotted(nav){padding-top:0.5rem;padding-bottom:0.5rem;min-width:8rem;max-width:16rem}.content{position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}";
3057
3057
 
3058
3058
  let nextUniqueId$6 = 0;
3059
3059
  const CatMenu = class {
@@ -3068,13 +3068,19 @@ const CatMenu = class {
3068
3068
  this.placement = 'bottom-start';
3069
3069
  }
3070
3070
  clickHandler(event) {
3071
- var _a;
3072
3071
  // hide menu on button click
3073
3072
  if (this.content && event.composedPath().includes(this.content)) {
3074
- (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
3075
- this.hide();
3073
+ this.close();
3076
3074
  }
3077
3075
  }
3076
+ /**
3077
+ * Closes the menu.
3078
+ */
3079
+ async close() {
3080
+ var _a;
3081
+ (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
3082
+ this.hide();
3083
+ }
3078
3084
  componentDidLoad() {
3079
3085
  var _a, _b, _c, _d, _e;
3080
3086
  this.trigger = firstTabbable(this.triggerSlot);