started introduction of splitting into tabs

This commit is contained in:
Chris Kruining 2024-10-23 16:21:01 +02:00
parent 1472bd8116
commit b03f80f34f
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
10 changed files with 255 additions and 159 deletions

View file

@ -2,6 +2,7 @@ import { Accessor, children, createContext, createEffect, createMemo, createRend
import { createStore } from "solid-js/store";
import { isServer } from "solid-js/web";
import css from "./index.module.css";
import { isFocusable } from "~/utilities";
enum Modifier {
None = 0,
@ -68,6 +69,8 @@ export const SelectionProvider: ParentComponent<{ selection?: SelectionHandler,
mode = SelectionMode.Toggle;
}
console.log(selection, mode);
setState('selection', existing => {
switch (mode) {
case SelectionMode.Toggle: {
@ -230,7 +233,9 @@ export const selectable = (element: HTMLElement, options: Accessor<{ value: obje
element.dataset.selected = isSelected() ? 'true' : undefined;
});
const onPointerDown = (e: PointerEvent) => {
const onPointerDown = (e: Event) => {
// TODO :: find out if the cell clicked is editable and early exit after that
const [latest, setLatest] = internal.latest
const [modifier] = internal.modifier