@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.
- package/components.json +18 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-app-layout_6.cjs.entry.js +2 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-modal.cjs.entry.js +1 -1
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-modal/swirl-modal.css +1 -5
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +24 -5
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.spec.js +13 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-modal.js +1 -1
- package/dist/components/swirl-resource-list-item2.js +3 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-app-layout_6.entry.js +2 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-modal.entry.js +1 -1
- package/dist/swirl-components/{p-e20e1364.entry.js → p-178aa1bb.entry.js} +1 -1
- package/dist/swirl-components/{p-9e705cb8.entry.js → p-8bca3280.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.css +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-resource-list-item/swirl-resource-list-item.d.ts +2 -1
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/vscode-data.json +4 -0
|
@@ -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
|
-
|
|
401
|
+
height: 100%;
|
|
406
402
|
}
|
|
407
403
|
|
|
408
404
|
.modal__content ::slotted(*) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { getDesktopMediaQuery } from
|
|
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,
|
package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.spec.js
CHANGED
|
@@ -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
|
});
|