MD - Datatable - stopped using setContext
This commit is contained in:
parent
0cb9312e75
commit
e9ccf25eb8
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { onMount, setContext } from "svelte"
|
||||
import { onMount } from "svelte"
|
||||
import { MDCDataTable } from "@material/data-table"
|
||||
import Row from "./DatatableRow.svelte"
|
||||
import Cell from "./DatatableCell.svelte"
|
||||
|
@ -10,13 +10,14 @@
|
|||
export let onLoad
|
||||
|
||||
const cb = new ClassBuilder("data-table")
|
||||
setContext("BBMD:data-table:cb", cb)
|
||||
|
||||
let datatable = null
|
||||
let instance = null
|
||||
let tableElement
|
||||
let initialied = false
|
||||
|
||||
|
||||
|
||||
$: {
|
||||
if(tableElement && datatable && !initialied) {
|
||||
const children = _bb.attachChildren(tableElement)
|
||||
|
|
|
@ -4,7 +4,7 @@ import ClassBuilder from "../ClassBuilder.js"
|
|||
|
||||
export let _bb
|
||||
|
||||
const cb = getContext("BBMD:data-table:cb")
|
||||
const cb = new ClassBuilder("data-table")
|
||||
|
||||
let tbody
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<script>
|
||||
import { getContext } from "svelte"
|
||||
import ClassBuilder from "../ClassBuilder.js"
|
||||
|
||||
export let isHeader = false
|
||||
export let numeric = false
|
||||
export let _bb
|
||||
|
||||
const cb = getContext("BBMD:data-table:cb")
|
||||
const cb = new ClassBuilder("data-table")
|
||||
|
||||
let elementName = isHeader ? "header-cell" : "cell"
|
||||
let modifiers = { numeric }
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<script>
|
||||
|
||||
import ClassBuilder from "../ClassBuilder.js"
|
||||
|
||||
export let _bb
|
||||
|
||||
const cb = new ClassBuilder("data-table")
|
||||
|
||||
let thead
|
||||
|
||||
$: thead && _bb.attachChildren(thead)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script>
|
||||
import { getContext } from "svelte";
|
||||
import ClassBuilder from "../ClassBuilder.js"
|
||||
|
||||
export let onSelect = () => {};
|
||||
export let isHeader = false;
|
||||
|
@ -9,7 +10,7 @@
|
|||
let row = null;
|
||||
let selected = false;
|
||||
|
||||
const cb = getContext("BBMD:data-table:cb");
|
||||
const cb = new ClassBuilder("data-table")
|
||||
|
||||
let elementName = isHeader ? "header-row" : "row";
|
||||
let modifiers = {};
|
||||
|
|
Loading…
Reference in New Issue