@getflip/swirl-components 0.181.0 → 0.183.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.
@@ -143,10 +143,6 @@
143
143
  }
144
144
  }
145
145
 
146
- .modal--variant-drawer .modal__content {
147
- height: 100%;
148
- }
149
-
150
146
  @media (min-width: 768px) {
151
147
 
152
148
  .modal--variant-drawer.modal--padded .modal__content {
@@ -402,7 +398,7 @@
402
398
  .modal__content {
403
399
  overflow-x: hidden;
404
400
  overflow-y: auto;
405
- min-height: 100%;
401
+ height: 100%;
406
402
  }
407
403
 
408
404
  .modal__content ::slotted(*) {
@@ -1,7 +1,7 @@
1
- import { h, Host, } from "@stencil/core";
2
- import classnames from "classnames";
3
- import { v4 as uuid } from "uuid";
4
- import { getDesktopMediaQuery } from "../../utils";
1
+ import classnames from 'classnames';
2
+ import { v4 as uuid } from 'uuid';
3
+ import { h, Host } from '@stencil/core';
4
+ import { getDesktopMediaQuery } from '../../utils';
5
5
  /**
6
6
  * @slot control - Used to add a menu button to the item
7
7
  * @slot badges - Badges displayed inside the item
@@ -44,6 +44,7 @@ export class SwirlResourceListItem {
44
44
  };
45
45
  this.active = undefined;
46
46
  this.allowDrag = undefined;
47
+ this.allowHtml = true;
47
48
  this.checked = false;
48
49
  this.compact = undefined;
49
50
  this.description = undefined;
@@ -149,7 +150,7 @@ export class SwirlResourceListItem {
149
150
  "resource-list-item--wrap-description": this.descriptionWrap,
150
151
  "resource-list-item--wrap-label": this.labelWrap,
151
152
  });
152
- return (h(Host, { role: "row" }, h("div", { class: className, role: "gridcell" }, h(Tag, { "aria-checked": ariaChecked, "aria-disabled": disabled ? "true" : undefined, "aria-labelledby": this.id, class: "resource-list-item__content", href: href, disabled: disabled, onClick: this.onClick, onBlur: this.onBlur, onFocus: this.onFocus, part: "resource-list-item__content", role: role, tabIndex: 0, type: Tag === "button" ? "button" : undefined }, this.hasMedia && (h("span", { class: "resource-list-item__media" }, h("slot", { name: "media" }))), h("span", { class: "resource-list-item__label-container", style: labelContainerStyles }, h("span", { class: "resource-list-item__label", id: this.id, innerHTML: this.label }), this.description && (h("span", { class: "resource-list-item__description", innerHTML: this.description }))), showMeta && (h("span", { class: "resource-list-item__meta" }, h("span", { class: "resource-list-item__meta-text" }, this.meta), h("span", { class: "resource-list-item__badges" }, h("slot", { name: "badges" }))))), this.selectable && (h("span", { "aria-hidden": "true", class: "resource-list-item__checkbox" }, h("span", { class: "resource-list-item__checkbox-icon" }, this.checked && (h("swirl-icon-check-strong", null))))), h("span", { class: "resource-list-item__control", onClick: this.onControlClick, ref: (el) => (this.controlContainer = el) }, h("slot", { name: "control" })), showMenu && (h("swirl-popover-trigger", { popover: this.menuTriggerId }, h("swirl-button", { "aria-disabled": disabled ? "true" : undefined, class: "resource-list-item__menu-trigger", disabled: disabled, hideLabel: true, icon: "<swirl-icon-more-horizontal></swirl-icon-more-horizontal>", intent: "primary", label: this.menuTriggerLabel, onClick: this.onMenuTriggerClick })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "resource-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
153
+ return (h(Host, { role: "row" }, h("div", { class: className, role: "gridcell" }, h(Tag, { "aria-checked": ariaChecked, "aria-disabled": disabled ? "true" : undefined, "aria-labelledby": this.id, class: "resource-list-item__content", href: href, disabled: disabled, onClick: this.onClick, onBlur: this.onBlur, onFocus: this.onFocus, part: "resource-list-item__content", role: role, tabIndex: 0, type: Tag === "button" ? "button" : undefined }, this.hasMedia && (h("span", { class: "resource-list-item__media" }, h("slot", { name: "media" }))), h("span", { class: "resource-list-item__label-container", style: labelContainerStyles }, h("span", { class: "resource-list-item__label", id: this.id, innerHTML: this.allowHtml ? this.label : undefined }, !this.allowHtml && this.label), this.description && (h("span", { class: "resource-list-item__description", innerHTML: this.allowHtml ? this.description : undefined }, !this.allowHtml && this.description))), showMeta && (h("span", { class: "resource-list-item__meta" }, h("span", { class: "resource-list-item__meta-text" }, this.meta), h("span", { class: "resource-list-item__badges" }, h("slot", { name: "badges" }))))), this.selectable && (h("span", { "aria-hidden": "true", class: "resource-list-item__checkbox" }, h("span", { class: "resource-list-item__checkbox-icon" }, this.checked && (h("swirl-icon-check-strong", null))))), h("span", { class: "resource-list-item__control", onClick: this.onControlClick, ref: (el) => (this.controlContainer = el) }, h("slot", { name: "control" })), showMenu && (h("swirl-popover-trigger", { popover: this.menuTriggerId }, h("swirl-button", { "aria-disabled": disabled ? "true" : undefined, class: "resource-list-item__menu-trigger", disabled: disabled, hideLabel: true, icon: "<swirl-icon-more-horizontal></swirl-icon-more-horizontal>", intent: "primary", label: this.menuTriggerLabel, onClick: this.onMenuTriggerClick })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "resource-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
153
154
  }
154
155
  static get is() { return "swirl-resource-list-item"; }
155
156
  static get encapsulation() { return "scoped"; }
@@ -199,6 +200,24 @@ export class SwirlResourceListItem {
199
200
  "attribute": "allow-drag",
200
201
  "reflect": false
201
202
  },
203
+ "allowHtml": {
204
+ "type": "boolean",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "boolean",
208
+ "resolved": "boolean",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": true,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": ""
216
+ },
217
+ "attribute": "allow-html",
218
+ "reflect": false,
219
+ "defaultValue": "true"
220
+ },
202
221
  "checked": {
203
222
  "type": "boolean",
204
223
  "mutable": true,
@@ -101,4 +101,17 @@ describe("swirl-resource-list-item", () => {
101
101
  .getAttribute("aria-label")).toBe('Move item "Resource List Item"');
102
102
  expect(spy).toHaveBeenCalled();
103
103
  });
104
+ it("renders a plain text", async () => {
105
+ const page = await newSpecPage({
106
+ components: [SwirlResourceListItem],
107
+ html: `
108
+ <swirl-resource-list-item label="<button>Button</button>" allow-html="false" description="<button>Description</button>">
109
+ </swirl-resource-list-item>
110
+ `,
111
+ });
112
+ expect(page.root.querySelector(".resource-list-item__label")
113
+ .innerText).toBe("<button>Button</button>");
114
+ expect(page.root.querySelector(".resource-list-item__description")
115
+ .innerText).toBe("<button>Description</button>");
116
+ });
104
117
  });