@cbpds/web-components
Version:
Web components for the CBP Design System.
145 lines (144 loc) • 5.72 kB
JavaScript
/*!
* CPB Design System web components - built with Stencil
*/
import { Host, h } from "@stencil/core";
import { setCSSProps } from "../../utils/utils";
export class CbpStructuredList {
constructor() {
this.accessibilityText = undefined;
this.headerId = undefined;
this.striped = undefined;
this.selectable = undefined;
this.context = undefined;
this.sx = {};
}
componentWillLoad() {
if (typeof this.sx == 'string') {
this.sx = JSON.parse(this.sx) || {};
}
setCSSProps(this.host, Object.assign({}, this.sx));
}
render() {
return (h(Host, { key: '82ff077980627118b9d383e54cbbdf4152f4f3bb' }, h("slot", { key: 'afd2064f3e2d19f8af712ab9a995136560181285', name: "cbp-structured-list-header" }), h("div", { key: '2f3e0e1de346796a43438b1f37ce8074a8b192fa', role: "list", "aria-label": this.accessibilityText, "aria-describedby": this.headerId }, h("slot", { key: 'c32976dfc7b74adb2b693b73e969d28d15848302' })), h("slot", { key: '5e566754bf457c62929293d923585b7ddbb532fd', name: "cbp-structured-list-footer" })));
}
static get is() { return "cbp-structured-list"; }
static get originalStyleUrls() {
return {
"$": ["cbp-structured-list.scss"]
};
}
static get styleUrls() {
return {
"$": ["cbp-structured-list.css"]
};
}
static get properties() {
return {
"accessibilityText": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Specifies an accessible label for the list as an `aria-label`, similar to a table `caption`. \nSince the structured list contains significant amount of data, it is advised to always specify a label describing the list."
},
"attribute": "accessibility-text",
"reflect": false
},
"headerId": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "References an `id` placed on the element slotted into the `cbp-structured-list-header` named slot to provide additional accessible context to the list label."
},
"attribute": "header-id",
"reflect": false
},
"striped": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Specifies whether the list is \"striped,\"\" with even rows shaded."
},
"attribute": "striped",
"reflect": true
},
"selectable": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Specifies whether the list items are selectable (via checkbox - provided by the application)."
},
"attribute": "selectable",
"reflect": true
},
"context": {
"type": "string",
"mutable": false,
"complexType": {
"original": "\"light-inverts\" | \"light-always\" | \"dark-inverts\" | \"dark-always\"",
"resolved": "\"dark-always\" | \"dark-inverts\" | \"light-always\" | \"light-inverts\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Specifies the context of the component as it applies to the visual design and whether it inverts when light/dark mode is toggled. Default behavior is \"light-inverts\" and does not have to be specified."
},
"attribute": "context",
"reflect": true
},
"sx": {
"type": "any",
"mutable": false,
"complexType": {
"original": "any",
"resolved": "any",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Supports adding inline styles as an object"
},
"attribute": "sx",
"reflect": false,
"defaultValue": "{}"
}
};
}
static get elementRef() { return "host"; }
}
//# sourceMappingURL=cbp-structured-list.js.map