UNPKG

4 kBJavaScriptView Raw
1/*!
2 * Bulmil - MIT License
3 */
4'use strict';
5
6Object.defineProperty(exports, '__esModule', { value: true });
7
8const index = require('./index-481858d9.js');
9
10const tableCss = ".table-container:not(:last-child),.table:not(:last-child){margin-bottom:1.5rem}.table{background-color:white;color:#363636}.table td,.table th{border:1px solid #dbdbdb;border-width:0 0 1px;padding:0.5em 0.75em;vertical-align:top}.table td.is-white,.table th.is-white{background-color:white;border-color:white;color:#0a0a0a}.table td.is-black,.table th.is-black{background-color:#0a0a0a;border-color:#0a0a0a;color:white}.table td.is-light,.table th.is-light{background-color:whitesmoke;border-color:whitesmoke;color:rgba(0, 0, 0, 0.7)}.table td.is-dark,.table th.is-dark{background-color:#363636;border-color:#363636;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:#3e8ed0;border-color:#3e8ed0;color:#fff}.table td.is-success,.table th.is-success{background-color:#48c78e;border-color:#48c78e;color:#fff}.table td.is-warning,.table th.is-warning{background-color:#ffe08a;border-color:#ffe08a;color:rgba(0, 0, 0, 0.7)}.table td.is-danger,.table th.is-danger{background-color:#f14668;border-color:#f14668;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:#363636}.table th:not([align]){text-align:inherit}.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:#363636}.table tfoot{background-color:transparent}.table tfoot td,.table tfoot th{border-width:2px 0 0;color:#363636}.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:#fafafa}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover{background-color:#fafafa}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover:nth-child(even){background-color:whitesmoke}.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:#fafafa}.table-container{-webkit-overflow-scrolling:touch;overflow:auto;overflow-y:hidden;max-width:100%}";
11
12let Table = class {
13 constructor(hostRef) {
14 index.registerInstance(this, hostRef);
15 /**
16 * Bordered
17 */
18 this.isBordered = false;
19 /**
20 * Striped
21 */
22 this.isStriped = false;
23 /**
24 * Scrollable
25 */
26 this.isScrollable = false;
27 /**
28 * Narrow
29 */
30 this.isNarrow = false;
31 /**
32 * Hoverable
33 */
34 this.isHoverable = false;
35 /**
36 * Fullwidth
37 */
38 this.isFullwidth = false;
39 }
40 render() {
41 const table = (index.h("table", { class: {
42 table: true,
43 'is-bordered': this.isBordered,
44 'is-striped': this.isStriped,
45 'is-narrow': this.isNarrow,
46 'is-hoverable': this.isHoverable,
47 'is-fullwidth': this.isFullwidth,
48 } }, index.h("slot", null)));
49 return this.isScrollable ? index.h("div", { class: "table-container" }, table) : table;
50 }
51};
52Table.style = tableCss;
53
54exports.bm_table = Table;