UNPKG

fonteva-design-guide

Version:

## Dev, Build and Test

60 lines (48 loc) 1.51 kB
import { LightningElement, track, api } from 'lwc'; import PFM_Base from 'c/pfmBase'; export default class Tile extends PFM_Base { @api type; @track classes; @track background; @track hasFooter = true; @api fullHeight; @api // danger, success, brand, shade, shade-dark, blue-dark get theme() { return this.background; } set theme(value) { this.background = value; } @api get padding() { return super.paddingStr; } set padding(value) { super.paddingStr = value; } @api get margin() { return super.marginStr; } set margin(value) { super.marginStr = value; } connectedCallback() { super.connectedCallback('pfm-tile'); let valType = this.type, valHeight = this.fullHeight, valBackground = this.background; let type, height, background; type = valType ? ' ' + valType : ''; height = valHeight ? ' pfm-tile_height-full' : ''; background = valBackground ? ' pfm-tile-theme_' + valBackground : ''; // brand, danger, success, shade, shade-dark this.classes = this.classStr + type + background + height; } renderedCallback() { const footer = this.querySelectorAll('span[slot="footer"]'); if (footer.length === 0) { this.hasFooter = false; } super.renderedCallback('pfm-tile'); } }