@ishibashi0112/spreadsheet-grid-solid 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +2864 -0
- package/README.md +41 -17
- package/dist/ColumnFilterPopover-CzSRfcDF.js +1426 -0
- package/dist/columnVirtualizer-Bv79_vW1.js +186 -0
- package/dist/createSpreadsheetGrid.d.ts +14 -0
- package/dist/devWarnings.d.ts +3 -0
- package/dist/editors/CellEditorLayer.d.ts +2 -0
- package/dist/editors/DateCellEditor.d.ts +1 -0
- package/dist/editors/NumberCellEditor.d.ts +1 -0
- package/dist/editors/SelectCellEditor.d.ts +3 -1
- package/dist/editors/TextCellEditor.d.ts +1 -0
- package/dist/features/contextMenu.d.ts +0 -14
- package/dist/features/types.d.ts +1 -1
- package/dist/index.js +2656 -2670
- package/dist/primitives/externalStore.d.ts +1 -0
- package/dist/primitives/userCallback.d.ts +10 -0
- package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-2DW5SZT3.jsx} +29 -10
- package/dist/source/chunks/chunk-FTQFOPXC.jsx +293 -0
- package/dist/source/chunks/{toolPanelViews-W6KROURU.jsx → toolPanelViews-HIQGRX3N.jsx} +4 -2
- package/dist/source/index.jsx +745 -775
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BE4gv_L0.js → toolPanelViews-BISN9iaG.js} +120 -119
- package/dist/view/DetailToggleButton.d.ts +1 -0
- package/dist/view/GridBodyLayer.d.ts +1 -1
- package/package.json +8 -5
- package/skills/spreadsheet-grid-solid/SKILL.md +106 -0
- package/dist/ColumnFilterPopover-BmxumbB7.js +0 -1418
- package/dist/columnVirtualizer-CGHyzbwH.js +0 -95
- package/dist/source/chunks/chunk-5KX4SR2S.jsx +0 -143
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { createMemo as e, createRenderEffect as t, createSignal as n, onSettled as r, untrack as i } from "solid-js";
|
|
2
|
-
import { Virtualizer as a, elementScroll as o, observeElementOffset as s, observeElementRect as c } from "@tanstack/virtual-core";
|
|
3
|
-
//#region src/primitives/mountGate.ts
|
|
4
|
-
var l = null;
|
|
5
|
-
function u() {
|
|
6
|
-
return {
|
|
7
|
-
queue: [],
|
|
8
|
-
done: !1
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function d(e, t) {
|
|
12
|
-
let n = l;
|
|
13
|
-
l = e;
|
|
14
|
-
try {
|
|
15
|
-
return t();
|
|
16
|
-
} finally {
|
|
17
|
-
l = n;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function f(e) {
|
|
21
|
-
if (e.done) return;
|
|
22
|
-
e.done = !0;
|
|
23
|
-
let t = e.queue;
|
|
24
|
-
e.queue = [];
|
|
25
|
-
for (let e of t) e();
|
|
26
|
-
}
|
|
27
|
-
function p(e) {
|
|
28
|
-
r(() => {
|
|
29
|
-
e.done = !0, e.queue = [];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function m(e) {
|
|
33
|
-
let t = l, n = !1, a, o = () => {
|
|
34
|
-
n || (n = !0, a = i(e));
|
|
35
|
-
};
|
|
36
|
-
t?.queue.push(o), r(() => (o(), () => {
|
|
37
|
-
typeof a == "function" && a();
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/primitives/columnVirtualizer.ts
|
|
42
|
-
var h = (e, t) => c(e, (e) => {
|
|
43
|
-
e.width && t(e);
|
|
44
|
-
});
|
|
45
|
-
function g(r) {
|
|
46
|
-
let [c, l] = n(0), u = !1, d = !1, f = (e) => {
|
|
47
|
-
let t = { ...e };
|
|
48
|
-
return delete t.measureKey, {
|
|
49
|
-
observeElementRect: h,
|
|
50
|
-
observeElementOffset: s,
|
|
51
|
-
scrollToFn: o,
|
|
52
|
-
...t,
|
|
53
|
-
onChange: (e, n) => {
|
|
54
|
-
u && !d && l((e) => e + 1), t.onChange?.(e, n);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}, p = new a(f(i(r))), g, _ = e(() => {
|
|
58
|
-
c();
|
|
59
|
-
let e = r();
|
|
60
|
-
d = !0;
|
|
61
|
-
try {
|
|
62
|
-
p.setOptions(f(e)), e.measureKey !== g && (g = e.measureKey, p.measure());
|
|
63
|
-
} finally {
|
|
64
|
-
d = !1;
|
|
65
|
-
}
|
|
66
|
-
return p.getVirtualItems();
|
|
67
|
-
});
|
|
68
|
-
return t(r, () => {
|
|
69
|
-
if (u) {
|
|
70
|
-
d = !0;
|
|
71
|
-
try {
|
|
72
|
-
p._willUpdate();
|
|
73
|
-
} finally {
|
|
74
|
-
d = !1;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}, { name: "columnVirtualizerElement" }), m(() => {
|
|
78
|
-
u = !0;
|
|
79
|
-
let e = p._didMount();
|
|
80
|
-
d = !0;
|
|
81
|
-
try {
|
|
82
|
-
p._willUpdate();
|
|
83
|
-
} finally {
|
|
84
|
-
d = !1;
|
|
85
|
-
}
|
|
86
|
-
return l((e) => e + 1), () => {
|
|
87
|
-
u = !1, e();
|
|
88
|
-
};
|
|
89
|
-
}), {
|
|
90
|
-
instance: p,
|
|
91
|
-
items: _
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
//#endregion
|
|
95
|
-
export { m as a, f as i, p as n, d as o, u as r, g as t };
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// src/primitives/columnVirtualizer.ts
|
|
2
|
-
import { createMemo, createRenderEffect, createSignal, untrack as untrack2 } from "solid-js";
|
|
3
|
-
|
|
4
|
-
// src/primitives/mountGate.ts
|
|
5
|
-
import { onSettled, untrack } from "solid-js";
|
|
6
|
-
var current = null;
|
|
7
|
-
function createMountGate() {
|
|
8
|
-
return { queue: [], done: false };
|
|
9
|
-
}
|
|
10
|
-
function runInMountGate(gate, fn) {
|
|
11
|
-
const previous = current;
|
|
12
|
-
current = gate;
|
|
13
|
-
try {
|
|
14
|
-
return fn();
|
|
15
|
-
} finally {
|
|
16
|
-
current = previous;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function flushMountGate(gate) {
|
|
20
|
-
if (gate.done) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
gate.done = true;
|
|
24
|
-
const queue = gate.queue;
|
|
25
|
-
gate.queue = [];
|
|
26
|
-
for (const run of queue) {
|
|
27
|
-
run();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function closeMountGateOnSettled(gate) {
|
|
31
|
-
onSettled(() => {
|
|
32
|
-
gate.done = true;
|
|
33
|
-
gate.queue = [];
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function onGridMounted(fn) {
|
|
37
|
-
const gate = current;
|
|
38
|
-
let ran = false;
|
|
39
|
-
let cleanup;
|
|
40
|
-
const run = () => {
|
|
41
|
-
if (ran) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
ran = true;
|
|
45
|
-
cleanup = untrack(fn);
|
|
46
|
-
};
|
|
47
|
-
gate?.queue.push(run);
|
|
48
|
-
onSettled(() => {
|
|
49
|
-
run();
|
|
50
|
-
return () => {
|
|
51
|
-
if (typeof cleanup === "function") {
|
|
52
|
-
cleanup();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// src/primitives/columnVirtualizer.ts
|
|
59
|
-
import {
|
|
60
|
-
Virtualizer,
|
|
61
|
-
elementScroll,
|
|
62
|
-
observeElementOffset,
|
|
63
|
-
observeElementRect
|
|
64
|
-
} from "@tanstack/virtual-core";
|
|
65
|
-
var observeShownElementRect = (instance, cb) => observeElementRect(instance, (rect) => {
|
|
66
|
-
if (rect.width) {
|
|
67
|
-
cb(rect);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
function createColumnVirtualizer(options) {
|
|
71
|
-
const [version, setVersion] = createSignal(0);
|
|
72
|
-
let mounted = false;
|
|
73
|
-
let syncing = false;
|
|
74
|
-
const resolve = (next) => {
|
|
75
|
-
const rest = { ...next };
|
|
76
|
-
delete rest.measureKey;
|
|
77
|
-
return {
|
|
78
|
-
observeElementRect: observeShownElementRect,
|
|
79
|
-
observeElementOffset,
|
|
80
|
-
scrollToFn: elementScroll,
|
|
81
|
-
...rest,
|
|
82
|
-
onChange: (instance2, sync) => {
|
|
83
|
-
if (mounted && !syncing) {
|
|
84
|
-
setVersion((value) => value + 1);
|
|
85
|
-
}
|
|
86
|
-
rest.onChange?.(instance2, sync);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
const instance = new Virtualizer(resolve(untrack2(options)));
|
|
91
|
-
let measuredKey;
|
|
92
|
-
const items = createMemo(() => {
|
|
93
|
-
version();
|
|
94
|
-
const next = options();
|
|
95
|
-
syncing = true;
|
|
96
|
-
try {
|
|
97
|
-
instance.setOptions(resolve(next));
|
|
98
|
-
if (next.measureKey !== measuredKey) {
|
|
99
|
-
measuredKey = next.measureKey;
|
|
100
|
-
instance.measure();
|
|
101
|
-
}
|
|
102
|
-
} finally {
|
|
103
|
-
syncing = false;
|
|
104
|
-
}
|
|
105
|
-
return instance.getVirtualItems();
|
|
106
|
-
});
|
|
107
|
-
createRenderEffect(options, () => {
|
|
108
|
-
if (!mounted) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
syncing = true;
|
|
112
|
-
try {
|
|
113
|
-
instance._willUpdate();
|
|
114
|
-
} finally {
|
|
115
|
-
syncing = false;
|
|
116
|
-
}
|
|
117
|
-
}, { name: "columnVirtualizerElement" });
|
|
118
|
-
onGridMounted(() => {
|
|
119
|
-
mounted = true;
|
|
120
|
-
const cleanup = instance._didMount();
|
|
121
|
-
syncing = true;
|
|
122
|
-
try {
|
|
123
|
-
instance._willUpdate();
|
|
124
|
-
} finally {
|
|
125
|
-
syncing = false;
|
|
126
|
-
}
|
|
127
|
-
setVersion((value) => value + 1);
|
|
128
|
-
return () => {
|
|
129
|
-
mounted = false;
|
|
130
|
-
cleanup();
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
return { instance, items };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export {
|
|
137
|
-
createMountGate,
|
|
138
|
-
runInMountGate,
|
|
139
|
-
flushMountGate,
|
|
140
|
-
closeMountGateOnSettled,
|
|
141
|
-
onGridMounted,
|
|
142
|
-
createColumnVirtualizer
|
|
143
|
-
};
|