UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

98 lines (97 loc) 2.63 kB
import { h } from '@stencil/core'; /** * @slot - Allows structured list main content */ export class ClaSortableList { constructor() { this.inverted = undefined; this.rtl = undefined; this.sortable = undefined; } /** * Get the map of CSS classes for the structured list. * * @return CssClassMap */ getClassMap() { const inverted = this.inverted; const rtl = this.rtl; const sortable = this.sortable; return { 'cla-structured-list': true, [`cla-structured-list-inverted`]: inverted, [`cla-structured-list-rtl-mode`]: rtl, [`cla-structured-list-sortable`]: sortable }; } render() { return (h("div", { class: this.getClassMap() }, h("div", { class: "content" }, h("slot", null)), this.sortable ? h("div", { class: "structured-list-icon" }, h("span", { class: "bar" }), h("span", { class: "bar" })) : "")); } static get is() { return "cla-structured-list"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["cla-structured-list.scss"] }; } static get styleUrls() { return { "$": ["cla-structured-list.css"] }; } static get properties() { return { "inverted": { "type": "boolean", "mutable": false, "complexType": { "original": "false", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Whether to use the inverted variant of the structured list." }, "attribute": "inverted", "reflect": false }, "rtl": { "type": "boolean", "mutable": false, "complexType": { "original": "false", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Whether to use the left to right or right to left mode in text structured list" }, "attribute": "rtl", "reflect": false }, "sortable": { "type": "boolean", "mutable": false, "complexType": { "original": "false", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Whether to use the sortable variant of the structured list - adds a dragging icon on the side." }, "attribute": "sortable", "reflect": false } }; } }