UNPKG

@bulmil/core

Version:

![bulmil](https://user-images.githubusercontent.com/2362138/65766959-c721a080-e16f-11e9-9fb9-45a5a2ad0391.jpg)

58 lines (53 loc) 5.04 kB
/*! * Bulmil - MIT License */ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client'; const tableCss = ".table-container:not(:last-child),.table:not(:last-child){margin-bottom:1.5rem}.table{background-color:hsl(0, 0%, 100%);color:hsl(0, 0%, 21%)}.table td,.table th{border:1px solid hsl(0, 0%, 86%);border-width:0 0 1px;padding:0.5em 0.75em;vertical-align:top}.table td.is-white,.table th.is-white{background-color:hsl(0, 0%, 100%);border-color:hsl(0, 0%, 100%);color:hsl(0, 0%, 4%)}.table td.is-black,.table th.is-black{background-color:hsl(0, 0%, 4%);border-color:hsl(0, 0%, 4%);color:hsl(0, 0%, 100%)}.table td.is-light,.table th.is-light{background-color:hsl(0, 0%, 96%);border-color:hsl(0, 0%, 96%);color:rgba(0, 0, 0, 0.7)}.table td.is-dark,.table th.is-dark{background-color:hsl(0, 0%, 21%);border-color:hsl(0, 0%, 21%);color:#fff}.table td.is-primary,.table th.is-primary{background-color:#5851ff;border-color:#5851ff;color:#fff}.table td.is-link,.table th.is-link{background-color:#5851ff;border-color:#5851ff;color:#fff}.table td.is-info,.table th.is-info{background-color:hsl(207, 61%, 53%);border-color:hsl(207, 61%, 53%);color:#fff}.table td.is-success,.table th.is-success{background-color:hsl(153, 53%, 53%);border-color:hsl(153, 53%, 53%);color:#fff}.table td.is-warning,.table th.is-warning{background-color:hsl(44, 100%, 77%);border-color:hsl(44, 100%, 77%);color:rgba(0, 0, 0, 0.7)}.table td.is-danger,.table th.is-danger{background-color:hsl(348, 86%, 61%);border-color:hsl(348, 86%, 61%);color:#fff}.table td.is-narrow,.table th.is-narrow{white-space:nowrap;width:1%}.table td.is-selected,.table th.is-selected{background-color:#5851ff;color:#fff}.table td.is-selected a,.table td.is-selected strong,.table th.is-selected a,.table th.is-selected strong{color:currentColor}.table td.is-vcentered,.table th.is-vcentered{vertical-align:middle}.table th{color:hsl(0, 0%, 21%)}.table th:not([align]){text-align:left}.table tr.is-selected{background-color:#5851ff;color:#fff}.table tr.is-selected a,.table tr.is-selected strong{color:currentColor}.table tr.is-selected td,.table tr.is-selected th{border-color:#fff;color:currentColor}.table thead{background-color:transparent}.table thead td,.table thead th{border-width:0 0 2px;color:hsl(0, 0%, 21%)}.table tfoot{background-color:transparent}.table tfoot td,.table tfoot th{border-width:2px 0 0;color:hsl(0, 0%, 21%)}.table tbody{background-color:transparent}.table tbody tr:last-child td,.table tbody tr:last-child th{border-bottom-width:0}.table.is-bordered td,.table.is-bordered th{border-width:1px}.table.is-bordered tr:last-child td,.table.is-bordered tr:last-child th{border-bottom-width:1px}.table.is-fullwidth{width:100%}.table.is-hoverable tbody tr:not(.is-selected):hover{background-color:hsl(0, 0%, 98%)}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover{background-color:hsl(0, 0%, 98%)}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover:nth-child(even){background-color:hsl(0, 0%, 96%)}.table.is-narrow td,.table.is-narrow th{padding:0.25em 0.5em}.table.is-striped tbody tr:not(.is-selected):nth-child(even){background-color:hsl(0, 0%, 98%)}.table-container{-webkit-overflow-scrolling:touch;overflow:auto;overflow-y:hidden;max-width:100%}"; const BmTableStyle0 = tableCss; const Table = /*@__PURE__*/ proxyCustomElement(class Table extends HTMLElement { constructor() { super(); this.__registerHost(); this.isBordered = false; this.isStriped = false; this.isScrollable = false; this.isNarrow = false; this.isHoverable = false; this.isFullwidth = false; } render() { const table = (h("table", { key: '4c8264248f8630539d9371839d03f593042388b7', class: { table: true, 'is-bordered': this.isBordered, 'is-striped': this.isStriped, 'is-narrow': this.isNarrow, 'is-hoverable': this.isHoverable, 'is-fullwidth': this.isFullwidth, } }, h("slot", { key: '2cdf1beca69fd27cbaba1acf48e4af72fcae2a55' }))); return this.isScrollable ? h("div", { class: "table-container" }, table) : table; } static get style() { return BmTableStyle0; } }, [4, "bm-table", { "isBordered": [4, "is-bordered"], "isStriped": [4, "is-striped"], "isScrollable": [4, "is-scrollable"], "isNarrow": [4, "is-narrow"], "isHoverable": [4, "is-hoverable"], "isFullwidth": [4, "is-fullwidth"] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["bm-table"]; components.forEach(tagName => { switch (tagName) { case "bm-table": if (!customElements.get(tagName)) { customElements.define(tagName, Table); } break; } }); } const BmTable = Table; const defineCustomElement = defineCustomElement$1; export { BmTable, defineCustomElement };