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