@getflip/swirl-components 0.87.0 → 0.87.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.
@@ -13,7 +13,9 @@
13
13
  .autocomplete__listbox-container {
14
14
  position: fixed;
15
15
  z-index: var(--s-z-40);
16
- overflow: hidden;
16
+ overflow-x: hidden;
17
+ overflow-y: auto;
18
+ max-height: 18rem;
17
19
  padding-top: var(--s-space-8);
18
20
  padding-bottom: var(--s-space-8);
19
21
  border-radius: var(--s-border-radius-sm);
@@ -34,8 +36,8 @@
34
36
  }
35
37
 
36
38
  .autocomplete__multi-select-tags {
37
- margin-bottom: var(--s-space-4);
38
39
  margin-top: var(--swirl-autocomplete-tags-margin-top);
40
+ margin-bottom: var(--s-space-4);
39
41
  }
40
42
 
41
43
  @keyframes autocomplete-enter {
@@ -31,11 +31,15 @@ export class SwirlButton {
31
31
  }
32
32
  componentDidLoad() {
33
33
  this.forceIconProps(this.desktopMediaQuery.matches);
34
+ this.updateFormAttribute();
34
35
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
35
36
  }
36
37
  componentDidRender() {
37
38
  this.forceIconProps(this.desktopMediaQuery.matches);
38
39
  }
40
+ watchFormProp() {
41
+ this.updateFormAttribute();
42
+ }
39
43
  disconnectedCallback() {
40
44
  this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
41
45
  }
@@ -55,6 +59,17 @@ export class SwirlButton {
55
59
  }
56
60
  return undefined;
57
61
  }
62
+ updateFormAttribute() {
63
+ // Workaround: form attribute cannot be set via Stencil JSX
64
+ // https://github.com/ionic-team/stencil/issues/2703
65
+ const isLink = Boolean(this.href);
66
+ if (isLink || !Boolean(this.form)) {
67
+ this.buttonEl?.removeAttribute("form");
68
+ }
69
+ else {
70
+ this.buttonEl?.setAttribute("form", this.form);
71
+ }
72
+ }
58
73
  render() {
59
74
  const hideLabel = (this.hideLabel && Boolean(this.icon)) ||
60
75
  (this.variant === "floating" && this.intent === "default");
@@ -65,7 +80,7 @@ export class SwirlButton {
65
80
  "button--pill": this.pill,
66
81
  });
67
82
  const Tag = isLink ? "a" : "button";
68
- return (h(Host, { style: { pointerEvents: this.disabled ? "none" : "" } }, h(Tag, { "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled && !isLink ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-haspopup": this.swirlAriaHaspopup, "aria-label": ariaLabel, class: className, disabled: isLink ? undefined : this.disabled, download: isLink ? undefined : this.download, form: isLink ? undefined : this.form, href: this.href, name: isLink ? undefined : this.name, target: isLink ? this.target : undefined, type: isLink ? undefined : this.type, value: isLink ? undefined : this.value }, this.icon && (h("span", { class: "button__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), !hideLabel && h("span", { class: "button__label" }, this.label))));
83
+ return (h(Host, { style: { pointerEvents: this.disabled ? "none" : "" } }, h(Tag, { "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled && !isLink ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-haspopup": this.swirlAriaHaspopup, "aria-label": ariaLabel, class: className, disabled: isLink ? undefined : this.disabled, download: isLink ? undefined : this.download, form: isLink ? undefined : this.form, href: this.href, name: isLink ? undefined : this.name, ref: (el) => (this.buttonEl = el), target: isLink ? this.target : undefined, type: isLink ? undefined : this.type, value: isLink ? undefined : this.value }, this.icon && (h("span", { class: "button__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), !hideLabel && h("span", { class: "button__label" }, this.label))));
69
84
  }
70
85
  static get is() { return "swirl-button"; }
71
86
  static get encapsulation() { return "scoped"; }
@@ -470,4 +485,11 @@ export class SwirlButton {
470
485
  }
471
486
  };
472
487
  }
488
+ static get elementRef() { return "el"; }
489
+ static get watchers() {
490
+ return [{
491
+ "propName": "form",
492
+ "methodName": "watchFormProp"
493
+ }];
494
+ }
473
495
  }