diff options
Diffstat (limited to 'web/src/components/toolbar')
| -rw-r--r-- | web/src/components/toolbar/index.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/web/src/components/toolbar/index.ts b/web/src/components/toolbar/index.ts index 1400174..84f6a65 100644 --- a/web/src/components/toolbar/index.ts +++ b/web/src/components/toolbar/index.ts @@ -1,6 +1,6 @@ +import NotiveElement, { customElement } from "../../element"; import h, { CreateElement } from "../../html"; import { ActiveCellSelection, RangeSelection } from "../../selection"; -import { RenderedGrid } from "../grid/renderGrid"; import "./index.css"; function getSelectedSubdivisionsCount(): number | undefined { @@ -23,7 +23,8 @@ function getSelectedSubdivisionsCount(): number | undefined { return Math.min(...selectedCells.map((cells) => cells.length)); } -class NotiveToolbarElement extends HTMLElement { +@customElement("ntv-toolbar") +class NotiveToolbarElement extends NotiveElement { #subdivisionsInputEl: HTMLInputElement = h.input({ title: "Subdivisions", placeholder: "-", @@ -127,7 +128,4 @@ class NotiveToolbarElement extends HTMLElement { } } -customElements.define("ntv-toolbar", NotiveToolbarElement); - -export default ((...args: any[]): NotiveToolbarElement => - (h as any)["ntv-toolbar"](...args)) as CreateElement<NotiveToolbarElement>; +export default NotiveToolbarElement.makeFactory(); |
