UNPKG

4.14 kBJavaScriptView Raw
1import { r as registerInstance, h } from './core-98b1cff0.js';
2var Table = /** @class */ (function () {
3 function Table(hostRef) {
4 registerInstance(this, hostRef);
5 /**
6 * Bordered
7 */
8 this.isBordered = false;
9 /**
10 * Striped
11 */
12 this.isStriped = false;
13 /**
14 * Scrollable
15 */
16 this.isScrollable = false;
17 /**
18 * Narrow
19 */
20 this.isNarrow = false;
21 /**
22 * Hoverable
23 */
24 this.isHoverable = false;
25 /**
26 * Fullwidth
27 */
28 this.isFullwidth = false;
29 }
30 Table.prototype.render = function () {
31 var _a;
32 var table = (h("table", { class: (_a = {
33 table: true
34 },
35 _a[this.class] = Boolean(this.class),
36 _a['is-bordered'] = this.isBordered,
37 _a['is-striped'] = this.isStriped,
38 _a['is-narrow'] = this.isNarrow,
39 _a['is-hoverable'] = this.isHoverable,
40 _a['is-fullwidth'] = this.isFullwidth,
41 _a) }, h("slot", null)));
42 return this.isScrollable ? h("div", { class: "table-container" }, table) : table;
43 };
44 Object.defineProperty(Table, "style", {
45 get: function () { return ".table-container:not(:last-child),.table:not(:last-child){margin-bottom:1.5rem}.table{background-color:#fff;color:#363636}.table td,.table th{border:1px solid #dbdbdb;border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.table td.is-white,.table th.is-white{background-color:#fff;border-color:#fff;color:#0a0a0a}.table td.is-black,.table th.is-black{background-color:#0a0a0a;border-color:#0a0a0a;color:#fff}.table td.is-light,.table th.is-light{background-color:#f5f5f5;border-color:#f5f5f5;color:rgba(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-info,.table th.is-info{background-color:#3298dc;border-color:#3298dc;color:#fff}.table td.is-success,.table th.is-success{background-color:#48c774;border-color:#48c774;color:#fff}.table td.is-warning,.table th.is-warning{background-color:#ffdd57;border-color:#ffdd57;color:rgba(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 th{color:#363636}.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:rgba(0,0,0,0)}.table thead td,.table thead th{border-width:0 0 2px;color:#363636}.table tfoot{background-color:rgba(0,0,0,0)}.table tfoot td,.table tfoot th{border-width:2px 0 0;color:#363636}.table tbody{background-color:rgba(0,0,0,0)}.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.is-striped tbody tr:not(.is-selected):hover,.table.is-hoverable tbody tr:not(.is-selected):hover{background-color:#fafafa}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover:nth-child(2n){background-color:#f5f5f5}.table.is-narrow td,.table.is-narrow th{padding:.25em .5em}.table.is-striped tbody tr:not(.is-selected):nth-child(2n){background-color:#fafafa}.table-container{-webkit-overflow-scrolling:touch;overflow:auto;overflow-y:hidden;max-width:100%}"; },
46 enumerable: true,
47 configurable: true
48 });
49 return Table;
50}());
51export { Table as bm_table };