[issue #9] refactor2022/imports #12
27
index.html
27
index.html
@ -2,6 +2,18 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports":
|
||||
{
|
||||
"react": "https://esm.sh/react@18",
|
||||
"react-dom/client": "https://esm.sh/react-dom/client",
|
||||
"@emotion": "https://esm.sh/@emotion",
|
||||
"@emotion/": "https://esm.sh/@emotion/",
|
||||
"htm": "https://esm.sh/htm/react"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="./data/csv.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@ -9,11 +21,10 @@
|
||||
<!-- initialize table -->
|
||||
<script type="module">
|
||||
|
||||
import { h, render, createContext, Fragment } from 'https://cdn.skypack.dev/preact';
|
||||
import { useReducer, useState } from 'https://cdn.skypack.dev/preact/hooks';
|
||||
import { css, cx } from 'https://cdn.skypack.dev/@emotion/css';
|
||||
import htm from 'https://unpkg.com/htm?module';
|
||||
const html = htm.bind(h);
|
||||
import { createElement as h, createContext, Fragment, useReducer, useState } from 'react';
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { css, cx } from '@emotion/css';
|
||||
import { html } from 'htm';
|
||||
|
||||
import N from "./src/n.js";
|
||||
import Pivot from "./src/pivot.js";
|
||||
@ -381,7 +392,8 @@
|
||||
let labelsSum = (N.Step(Pivot.Schema, "sum")||[]).map(column => column.Meta.Index);
|
||||
let labelsPivot = (N.Step(Pivot.Schema, "label")||[]).map(column => column.Meta.Index);
|
||||
let labelsAll = (N.Step(Pivot.Schema, "all")||[]).map(column => column.Meta.Label);
|
||||
let labelsAllState = useState(labelsAll.map(column=>true));
|
||||
|
||||
let labelsAllState = useState(labelsAll.map(column=>true))
|
||||
|
||||
let headersDisplay = [];
|
||||
labelsAllState[0].forEach((visible, index)=>
|
||||
@ -484,7 +496,8 @@
|
||||
])
|
||||
};
|
||||
|
||||
const Render = () => render(h(ElRoot), document.querySelector("#app"));
|
||||
const Root = createRoot(document.querySelector("#app"));
|
||||
const Render = () => Root.render(h(ElRoot));
|
||||
Render();
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user