@ishibashi0112/spreadsheet-grid-solid 0.1.1 → 1.4.0
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 +2865 -0
- package/README.md +43 -25
- package/dist/ColumnFilterPopover-mENgY4gl.js +1426 -0
- package/dist/ai/GridAskBar.d.ts +20 -0
- package/dist/ai/createGridAsk.d.ts +94 -0
- package/dist/ai.d.ts +7 -0
- package/dist/ai.js +412 -0
- package/dist/columnVirtualizer-DdL7-ijS.js +193 -0
- package/dist/createSpreadsheetGrid.d.ts +14 -0
- package/dist/devWarnings.d.ts +0 -1
- package/dist/editors/CellEditorLayer.d.ts +1 -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 +3069 -3123
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/en.js +2 -2
- package/dist/primitives/effectApply.d.ts +1 -0
- package/dist/primitives/serverSnapshot.d.ts +5 -0
- package/dist/primitives/storeRows.d.ts +2 -0
- package/dist/source/ai.jsx +619 -0
- package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-D7INPNVB.jsx} +29 -10
- package/dist/source/chunks/chunk-ZZTXTW4Z.jsx +301 -0
- package/dist/source/chunks/{toolPanelViews-W6KROURU.jsx → toolPanelViews-HIQGRX3N.jsx} +4 -2
- package/dist/source/index.jsx +857 -853
- 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/package.json +12 -5
- package/skills/spreadsheet-grid-solid/SKILL.md +108 -0
- package/dist/ColumnFilterPopover-BmxumbB7.js +0 -1418
- package/dist/columnVirtualizer-CGHyzbwH.js +0 -95
- package/dist/source/chunks/chunk-5KX4SR2S.jsx +0 -143
|
@@ -4,45 +4,46 @@ import { For as o, Show as s, createEffect as c, createMemo as l, createSignal a
|
|
|
4
4
|
import { Portal as h, className as g, createComponent as _, delegateEvents as v, effect as y, insert as b, memo as x, readShallow as S, ref as C, setAttribute as w, setStyleProperty as T, spread as E, style as D, template as O } from "@solidjs/web";
|
|
5
5
|
import { formatLocaleText as k } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6
6
|
import { isImeComposingKeyEvent as A } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { getActiveElement as j, getDeepActiveElement as M } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
8
|
+
import { resolveFocusWrapTarget as N } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
|
|
9
|
+
import { createPanelHeaderDragController as P } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/panelHeaderDragController";
|
|
9
10
|
//#region src/view/ToolPanel.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let v = e(), x = r().container(), E = d(), O =
|
|
11
|
+
var F = /* @__PURE__ */ O("<div role=dialog tabindex=-1><div class=\"ssg-toolpanel-header ssg-popover-header--draggable\"><div class=ssg-toolpanel-seg role=tablist><span class=ssg-toolpanel-seg-indicator aria-hidden=true></span></div><button type=button class=ssg-popover-close>×</button></div><div class=ssg-toolpanel-body role=tabpanel>"), I = /* @__PURE__ */ O("<button type=button role=tab class=ssg-toolpanel-seg-btn><!><!>"), L = /* @__PURE__ */ O("<span class=ssg-toolpanel-seg-badge>"), R = "ssg-toolpanel--flash";
|
|
12
|
+
function z(a) {
|
|
13
|
+
let v = e(), x = r().container(), E = d(), O = P(), [k, M] = u(), z;
|
|
13
14
|
f(() => {
|
|
14
|
-
O.dispose(),
|
|
15
|
+
O.dispose(), z?.removeEventListener("keydown", W, !0), a.panelRef.current === z && (a.panelRef.current = null);
|
|
15
16
|
});
|
|
16
|
-
let
|
|
17
|
-
i(k, () => a.themeClassName,
|
|
18
|
-
let e =
|
|
19
|
-
!e || e.contains(e
|
|
17
|
+
let B = l(() => a.layout);
|
|
18
|
+
i(k, () => a.themeClassName, B), p(() => {
|
|
19
|
+
let e = z;
|
|
20
|
+
!e || e.contains(j(e)) || (e.querySelector("[role=\"tab\"][aria-selected=\"true\"]") ?? e).focus({ preventScroll: !0 });
|
|
20
21
|
});
|
|
21
|
-
let
|
|
22
|
+
let V = m(() => a.flashTick);
|
|
22
23
|
c(() => a.flashTick, (e) => {
|
|
23
|
-
let t =
|
|
24
|
-
if (!t || e === 0 || e ===
|
|
25
|
-
t.classList.remove(
|
|
26
|
-
let n = () => t.classList.remove(
|
|
24
|
+
let t = z;
|
|
25
|
+
if (!t || e === 0 || e === V) return;
|
|
26
|
+
t.classList.remove(R), t.offsetWidth, t.classList.add(R);
|
|
27
|
+
let n = () => t.classList.remove(R);
|
|
27
28
|
return t.addEventListener("animationend", n), () => t.removeEventListener("animationend", n);
|
|
28
29
|
}, { name: "toolPanelFlash" });
|
|
29
|
-
let
|
|
30
|
+
let H = l(() => Math.max(0, a.tabs.findIndex((e) => e.tab === a.activeTab))), U = l(() => ({
|
|
30
31
|
...a.popoverSlot?.style,
|
|
31
|
-
top: n(
|
|
32
|
-
left: n(
|
|
33
|
-
width: n(
|
|
34
|
-
"--ssg-toolpanel-max-height": n(
|
|
35
|
-
})),
|
|
32
|
+
top: n(B().top),
|
|
33
|
+
left: n(B().left),
|
|
34
|
+
width: n(B().width),
|
|
35
|
+
"--ssg-toolpanel-max-height": n(B().maxHeight)
|
|
36
|
+
})), W = (e) => {
|
|
36
37
|
if (t(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || A(e)) return;
|
|
37
|
-
let n =
|
|
38
|
+
let n = N(e.currentTarget, e.target instanceof Element ? e.target : null, e.shiftKey);
|
|
38
39
|
n !== null && (e.preventDefault(), n.focus());
|
|
39
40
|
};
|
|
40
41
|
return x ? _(h, {
|
|
41
42
|
mount: x,
|
|
42
43
|
get children() {
|
|
43
|
-
var e =
|
|
44
|
+
var e = F(), t = e.firstChild, n = t.firstChild, r = n.nextSibling, i = t.nextSibling;
|
|
44
45
|
return e._$$contextmenu = (e) => e.preventDefault(), e._$$keydown = (e) => e.stopPropagation(), e._$$pointerdown = (e) => e.stopPropagation(), C(() => (e) => {
|
|
45
|
-
|
|
46
|
+
z = e, a.panelRef.current = e, M(e), e.addEventListener("keydown", W, !0);
|
|
46
47
|
}, e), t._$$pointerdown = (e) => O.startFromPointerDown(e, {
|
|
47
48
|
layout: a.layout,
|
|
48
49
|
onMove: a.onPanelMove
|
|
@@ -53,7 +54,7 @@ function L(a) {
|
|
|
53
54
|
keyed: (e) => e.tab,
|
|
54
55
|
children: (e) => {
|
|
55
56
|
let t = () => e().tab === a.activeTab;
|
|
56
|
-
var n =
|
|
57
|
+
var n = I(), r = n.firstChild, i = r.nextSibling;
|
|
57
58
|
return n._$$click = () => {
|
|
58
59
|
t() || a.onSelectTab(e().tab);
|
|
59
60
|
}, b(n, () => e().label, r), b(n, _(s, {
|
|
@@ -61,7 +62,7 @@ function L(a) {
|
|
|
61
62
|
return e().badge;
|
|
62
63
|
},
|
|
63
64
|
children: (e) => (() => {
|
|
64
|
-
var t =
|
|
65
|
+
var t = L();
|
|
65
66
|
return b(t, e), t;
|
|
66
67
|
})()
|
|
67
68
|
}), i), y(() => ({
|
|
@@ -81,9 +82,9 @@ function L(a) {
|
|
|
81
82
|
a.themeClassName,
|
|
82
83
|
a.popoverSlot?.className
|
|
83
84
|
]),
|
|
84
|
-
a: S(
|
|
85
|
+
a: S(U()),
|
|
85
86
|
o: String(a.tabs.length),
|
|
86
|
-
i: String(
|
|
87
|
+
i: String(H()),
|
|
87
88
|
n: v().close,
|
|
88
89
|
s: `${E}-tab-${a.activeTab}`
|
|
89
90
|
}), ({ e: t, t: a, a: o, o: s, i: c, n: l, s: u }, d) => {
|
|
@@ -100,19 +101,19 @@ v([
|
|
|
100
101
|
]);
|
|
101
102
|
//#endregion
|
|
102
103
|
//#region src/view/FilterManagementPanel.tsx
|
|
103
|
-
var
|
|
104
|
-
function
|
|
105
|
-
var e =
|
|
104
|
+
var B = /* @__PURE__ */ O("<svg><path d=\"M2 4 L14 4 L9.2 9.2 L9.2 13 L6.8 13 L6.8 9.2 Z\">"), V = /* @__PURE__ */ O("<svg><circle cx=11 cy=11 r=7></circle><path d=\"m20 20-3.5-3.5\">"), H = /* @__PURE__ */ O("<div class=ssg-filter-manage-list>"), U = /* @__PURE__ */ O("<div class=ssg-popover-footer><select class=ssg-filter-manage-add><option value></option></select><button type=button class=ssg-filter-manage-clear-all>"), W = /* @__PURE__ */ O("<div class=\"ssg-filter-manage-row ssg-filter-manage-row--global\"><span class=\"ssg-filter-manage-glyph ssg-filter-manage-glyph--global\"aria-hidden=true></span><span class=ssg-filter-manage-main><span class=ssg-filter-manage-name></span><span class=ssg-filter-manage-summary></span></span><span class=ssg-filter-manage-actions><button type=button class=\"ssg-filter-manage-icon-btn ssg-filter-manage-icon-btn--danger\">×"), G = /* @__PURE__ */ O("<div class=ssg-filter-manage-empty>"), K = /* @__PURE__ */ O("<div class=ssg-filter-manage-row><span class=ssg-filter-manage-glyph aria-hidden=true></span><span class=ssg-filter-manage-main><span class=ssg-filter-manage-name><!><!><!></span><span class=ssg-filter-manage-summary></span></span><span class=ssg-filter-manage-actions><button type=button class=ssg-filter-manage-icon-btn>✎</button><button type=button class=\"ssg-filter-manage-icon-btn ssg-filter-manage-icon-btn--danger\">×"), q = /* @__PURE__ */ O("<span class=ssg-filter-manage-hidden-note>"), J = /* @__PURE__ */ O("<option>"), Y = { focusable: "false" };
|
|
105
|
+
function X() {
|
|
106
|
+
var e = B();
|
|
106
107
|
return E(e, [{
|
|
107
108
|
width: "11",
|
|
108
109
|
height: "11",
|
|
109
110
|
viewBox: "0 0 16 16",
|
|
110
111
|
fill: "currentColor",
|
|
111
112
|
"aria-hidden": "true"
|
|
112
|
-
},
|
|
113
|
+
}, Y], !0), e;
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
var e =
|
|
115
|
+
function ee() {
|
|
116
|
+
var e = V();
|
|
116
117
|
return E(e, [{
|
|
117
118
|
width: "11",
|
|
118
119
|
height: "11",
|
|
@@ -121,14 +122,14 @@ function Y() {
|
|
|
121
122
|
stroke: "currentColor",
|
|
122
123
|
"stroke-width": "2.4",
|
|
123
124
|
"aria-hidden": "true"
|
|
124
|
-
},
|
|
125
|
+
}, Y], !0), e;
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function te(t) {
|
|
127
128
|
let n = e(), r = () => t.canFilter && t.entries.length > 0, i = () => t.canFilter && t.addableColumns.length > 0;
|
|
128
129
|
return [
|
|
129
130
|
x(() => x(() => !!t.showGlobalFilterRow)() ? (() => {
|
|
130
|
-
var e =
|
|
131
|
-
return b(r, _(
|
|
131
|
+
var e = W(), r = e.firstChild, i = r.nextSibling, a = i.firstChild, o = a.nextSibling, s = i.nextSibling.firstChild;
|
|
132
|
+
return b(r, _(ee, {})), b(a, () => n().globalFilterTitle), b(o, () => k(n().globalFilterRows, { text: t.globalFilterText })), s._$$click = () => t.onClearGlobalFilter(), y(() => ({
|
|
132
133
|
e: t.globalFilterText,
|
|
133
134
|
t: !t.canFilter,
|
|
134
135
|
a: n().clearGlobalFilterTitle,
|
|
@@ -138,7 +139,7 @@ function ee(t) {
|
|
|
138
139
|
}), e;
|
|
139
140
|
})() : void 0),
|
|
140
141
|
(() => {
|
|
141
|
-
var e =
|
|
142
|
+
var e = H();
|
|
142
143
|
return b(e, (() => {
|
|
143
144
|
var e = x(() => t.entries.length > 0);
|
|
144
145
|
return () => e() ? _(o, {
|
|
@@ -147,17 +148,17 @@ function ee(t) {
|
|
|
147
148
|
},
|
|
148
149
|
keyed: (e) => e.columnKey,
|
|
149
150
|
children: (e) => (() => {
|
|
150
|
-
var r =
|
|
151
|
-
return b(i, _(
|
|
151
|
+
var r = K(), i = r.firstChild, a = i.nextSibling, o = a.firstChild, s = o.firstChild, c = s.nextSibling, l = c.nextSibling, u = o.nextSibling, d = a.nextSibling.firstChild, f = d.nextSibling;
|
|
152
|
+
return b(i, _(X, {})), b(o, () => e().title, s), b(o, (() => {
|
|
152
153
|
var t = x(() => !!e().isHidden);
|
|
153
154
|
return () => t() ? (() => {
|
|
154
|
-
var e =
|
|
155
|
+
var e = q();
|
|
155
156
|
return b(e, () => n().filterHiddenColumn), e;
|
|
156
157
|
})() : void 0;
|
|
157
158
|
})(), c), b(o, (() => {
|
|
158
159
|
var t = x(() => !!e().isGrouped);
|
|
159
160
|
return () => t() ? (() => {
|
|
160
|
-
var e =
|
|
161
|
+
var e = q();
|
|
161
162
|
return b(e, () => n().filterGroupedColumn), e;
|
|
162
163
|
})() : void 0;
|
|
163
164
|
})(), l), b(u, () => e().summaryText), d._$$click = () => t.onEditFilter(e().columnKey), f._$$click = () => t.onClearFilter(e().columnKey), y(() => ({
|
|
@@ -173,13 +174,13 @@ function ee(t) {
|
|
|
173
174
|
}), r;
|
|
174
175
|
})()
|
|
175
176
|
}) : (() => {
|
|
176
|
-
var e =
|
|
177
|
+
var e = G();
|
|
177
178
|
return b(e, () => n().noColumnFilters), e;
|
|
178
179
|
})();
|
|
179
180
|
})()), e;
|
|
180
181
|
})(),
|
|
181
182
|
(() => {
|
|
182
|
-
var e =
|
|
183
|
+
var e = U(), a = e.firstChild, s = a.firstChild, c = a.nextSibling;
|
|
183
184
|
return a.addEventListener("change", (e) => {
|
|
184
185
|
let n = e.currentTarget, r = n.value;
|
|
185
186
|
n.value = "", r && t.onAddFilter(r);
|
|
@@ -192,7 +193,7 @@ function ee(t) {
|
|
|
192
193
|
},
|
|
193
194
|
keyed: (e) => e.key,
|
|
194
195
|
children: (e) => (() => {
|
|
195
|
-
var t =
|
|
196
|
+
var t = J();
|
|
196
197
|
return b(t, () => e().title), y(() => e().key, (e) => {
|
|
197
198
|
t.value = e;
|
|
198
199
|
}), t;
|
|
@@ -210,7 +211,7 @@ function ee(t) {
|
|
|
210
211
|
v(["click"]);
|
|
211
212
|
//#endregion
|
|
212
213
|
//#region src/view/DragHandleGlyph.tsx
|
|
213
|
-
var
|
|
214
|
+
var ne = /* @__PURE__ */ O("<svg width=10 height=16 viewBox=\"0 0 10 16\"aria-hidden=true>"), re = /* @__PURE__ */ O("<svg><circle r=1.2></svg>", 2), ie = [
|
|
214
215
|
3,
|
|
215
216
|
8,
|
|
216
217
|
13
|
|
@@ -218,12 +219,12 @@ var te = /* @__PURE__ */ O("<svg width=10 height=16 viewBox=\"0 0 10 16\"aria-hi
|
|
|
218
219
|
cx: t,
|
|
219
220
|
cy: e
|
|
220
221
|
})));
|
|
221
|
-
function
|
|
222
|
-
var t =
|
|
222
|
+
function Z(e) {
|
|
223
|
+
var t = ne();
|
|
223
224
|
return b(t, _(o, {
|
|
224
|
-
each:
|
|
225
|
+
each: ie,
|
|
225
226
|
children: (e) => (() => {
|
|
226
|
-
var t =
|
|
227
|
+
var t = re();
|
|
227
228
|
return y(() => ({
|
|
228
229
|
e: e.cx,
|
|
229
230
|
t: e.cy
|
|
@@ -237,16 +238,16 @@ function X(e) {
|
|
|
237
238
|
}
|
|
238
239
|
//#endregion
|
|
239
240
|
//#region src/view/ColumnChooserPanel.tsx
|
|
240
|
-
var
|
|
241
|
+
var ae = /* @__PURE__ */ O("<span class=ssg-checkbox aria-hidden=true><!><!>"), oe = /* @__PURE__ */ O("<svg width=11 height=11 viewBox=\"0 0 12 12\"fill=none><path d=\"M2.5 6.2 4.7 8.4 9.5 3.6\"stroke-width=1.8 stroke-linecap=round stroke-linejoin=round>"), se = /* @__PURE__ */ O("<span class=ssg-checkbox-dash>"), ce = /* @__PURE__ */ O("<div data-chooser-row class=ssg-chooser-row><span role=button class=ssg-chooser-handle></span><button type=button class=ssg-chooser-toggle><span class=ssg-chooser-label>"), le = /* @__PURE__ */ O("<div class=ssg-chooser-search-row><button type=button class=ssg-chooser-master-btn></button><div class=ssg-chooser-search-field><span aria-hidden=true class=ssg-chooser-search-icon>⌕</span><input type=text class=ssg-chooser-search-input>"), ue = /* @__PURE__ */ O("<div class=ssg-chooser-list>"), de = /* @__PURE__ */ O("<div class=ssg-chooser-footer><button type=button class=ssg-chooser-reset-btn>"), fe = /* @__PURE__ */ O("<div class=ssg-chooser-empty>"), pe = /* @__PURE__ */ O("<div><!><!><!>"), me = /* @__PURE__ */ O("<div class=ssg-chooser-section-heading>"), he = /* @__PURE__ */ O("<div class=ssg-chooser-drop-end>"), ge = /* @__PURE__ */ O("<div class=ssg-chooser-note>"), Q = 28, _e = 12, ve = [
|
|
241
242
|
"left",
|
|
242
243
|
"center",
|
|
243
244
|
"right"
|
|
244
|
-
],
|
|
245
|
+
], ye = {
|
|
245
246
|
left: "columnsPinnedLeft",
|
|
246
247
|
center: "columnsUnpinned",
|
|
247
248
|
right: "columnsPinnedRight"
|
|
248
249
|
};
|
|
249
|
-
function
|
|
250
|
+
function be(e, t, n) {
|
|
250
251
|
let r = e.find((e) => e.key === t);
|
|
251
252
|
if (!r) return null;
|
|
252
253
|
let i = {
|
|
@@ -266,19 +267,19 @@ function ye(e, t, n) {
|
|
|
266
267
|
...i.right
|
|
267
268
|
];
|
|
268
269
|
}
|
|
269
|
-
function
|
|
270
|
-
var t =
|
|
270
|
+
function $(e) {
|
|
271
|
+
var t = ae(), n = t.firstChild, r = n.nextSibling;
|
|
271
272
|
return b(t, (() => {
|
|
272
273
|
var t = x(() => e.state === "checked");
|
|
273
274
|
return () => t() ? (() => {
|
|
274
|
-
var t =
|
|
275
|
+
var t = oe(), n = t.firstChild;
|
|
275
276
|
return y(() => e.disabled ? "var(--ssg-panel-text-muted)" : "var(--ssg-panel-accent-contrast)", (e) => {
|
|
276
277
|
T(n, "stroke", e);
|
|
277
278
|
}), t;
|
|
278
279
|
})() : void 0;
|
|
279
280
|
})(), n), b(t, (() => {
|
|
280
281
|
var t = x(() => e.state === "indeterminate");
|
|
281
|
-
return () => t() ?
|
|
282
|
+
return () => t() ? se() : void 0;
|
|
282
283
|
})(), r), y(() => ({
|
|
283
284
|
e: e.state === "checked" || e.state === "indeterminate",
|
|
284
285
|
t: !!e.disabled
|
|
@@ -286,8 +287,8 @@ function Q(e) {
|
|
|
286
287
|
e !== r?.e && t.classList.toggle("ssg-checkbox--filled", e), n !== r?.t && t.classList.toggle("ssg-checkbox--disabled", n);
|
|
287
288
|
}), t;
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
-
let n = e(), [r, i] = u(""), s, c = a(r), d = typeof document < "u" &&
|
|
290
|
+
function xe(t) {
|
|
291
|
+
let n = e(), [r, i] = u(""), s, c = a(r), d = typeof document < "u" && M()?.closest(".ssg-toolpanel") != null, m = null;
|
|
291
292
|
p(() => {
|
|
292
293
|
if (!s || !d || typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches) return;
|
|
293
294
|
let e = s;
|
|
@@ -305,67 +306,67 @@ function be(t) {
|
|
|
305
306
|
right: []
|
|
306
307
|
};
|
|
307
308
|
for (let t of E()) e[t.pane].push(t);
|
|
308
|
-
return
|
|
309
|
+
return ve.map((t) => ({
|
|
309
310
|
pane: t,
|
|
310
311
|
items: e[t]
|
|
311
312
|
})).filter((e) => e.items.length > 0);
|
|
312
|
-
}), O = () => D().length >= 2, A = () => t.canToggle && r().trim() === "", j, [
|
|
313
|
+
}), O = () => D().length >= 2, A = () => t.canToggle && r().trim() === "", j, [N, P] = u(null), F = !1, I = null, [L, R] = u(null), z = 0, B = null;
|
|
313
314
|
f(() => {
|
|
314
|
-
m !== null && cancelAnimationFrame(m),
|
|
315
|
+
m !== null && cancelAnimationFrame(m), B !== null && (cancelAnimationFrame(B), B = null);
|
|
315
316
|
});
|
|
316
|
-
let
|
|
317
|
-
if (!j || !
|
|
318
|
-
let e = j.querySelectorAll(`[data-chooser-row][data-chooser-pane="${
|
|
317
|
+
let V = () => {
|
|
318
|
+
if (!j || !I) return;
|
|
319
|
+
let e = j.querySelectorAll(`[data-chooser-row][data-chooser-pane="${I}"]`), t = e.length;
|
|
319
320
|
for (let n = 0; n < e.length; n += 1) {
|
|
320
321
|
let r = e[n].getBoundingClientRect();
|
|
321
|
-
if (
|
|
322
|
+
if (z < r.top + r.height / 2) {
|
|
322
323
|
t = n;
|
|
323
324
|
break;
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
if (!j || !
|
|
329
|
-
|
|
327
|
+
R(t);
|
|
328
|
+
}, H = () => {
|
|
329
|
+
if (!j || !F) {
|
|
330
|
+
B = null;
|
|
330
331
|
return;
|
|
331
332
|
}
|
|
332
|
-
let e = j.getBoundingClientRect(), t =
|
|
333
|
+
let e = j.getBoundingClientRect(), t = z < e.top + Q ? -12 : z > e.bottom - Q ? _e : 0;
|
|
333
334
|
if (t !== 0) {
|
|
334
335
|
let e = j.scrollTop;
|
|
335
|
-
j.scrollTop += t, j.scrollTop !== e &&
|
|
336
|
+
j.scrollTop += t, j.scrollTop !== e && V();
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
let n =
|
|
341
|
-
if (
|
|
342
|
-
let e =
|
|
338
|
+
B = requestAnimationFrame(H);
|
|
339
|
+
}, U = (e) => {
|
|
340
|
+
B !== null && (cancelAnimationFrame(B), B = null);
|
|
341
|
+
let n = N(), r = L();
|
|
342
|
+
if (F = !1, I = null, P(null), R(null), e && n !== null && r !== null) {
|
|
343
|
+
let e = be(t.items, n, r);
|
|
343
344
|
e && t.onReorderColumns(e);
|
|
344
345
|
}
|
|
345
|
-
},
|
|
346
|
-
A() && (n.preventDefault(), n.stopPropagation(), n.currentTarget.setPointerCapture(n.pointerId),
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
}, G = () => {
|
|
350
|
-
P && H(!0);
|
|
346
|
+
}, W = (e, t, n) => {
|
|
347
|
+
A() && (n.preventDefault(), n.stopPropagation(), n.currentTarget.setPointerCapture(n.pointerId), F = !0, I = t, z = n.clientY, P(e), V(), B === null && (B = requestAnimationFrame(H)));
|
|
348
|
+
}, G = (e) => {
|
|
349
|
+
F && (z = e.clientY, V());
|
|
351
350
|
}, K = () => {
|
|
352
|
-
|
|
351
|
+
F && U(!0);
|
|
353
352
|
}, q = () => {
|
|
353
|
+
F && U(!1);
|
|
354
|
+
}, J = () => {
|
|
354
355
|
t.canToggle && (v() ? t.onHideAllColumns() : t.onShowAllColumns());
|
|
355
|
-
},
|
|
356
|
-
let e =
|
|
356
|
+
}, Y = l(() => {
|
|
357
|
+
let e = N();
|
|
357
358
|
return e === null ? null : t.items.find((t) => t.key === e)?.pane ?? null;
|
|
358
|
-
}),
|
|
359
|
+
}), X = (e, i) => {
|
|
359
360
|
let a = () => {
|
|
360
361
|
let n = e(), r = n.visible && g() === 1;
|
|
361
362
|
return !t.canToggle || r || n.grouped === !0;
|
|
362
|
-
}, o = () =>
|
|
363
|
-
var l =
|
|
364
|
-
return u.addEventListener("pointercancel",
|
|
363
|
+
}, o = () => N() === e().key, s = () => N() !== null && Y() === e().pane && L() === i(), c = () => e().visible && e().grouped !== !0;
|
|
364
|
+
var l = ce(), u = l.firstChild, d = u.nextSibling, f = d.firstChild;
|
|
365
|
+
return u.addEventListener("pointercancel", q), u._$$pointerup = K, u._$$pointermove = G, u._$$pointerdown = (t) => W(e().key, e().pane, t), b(u, _(Z, { get disabled() {
|
|
365
366
|
return !A();
|
|
366
367
|
} })), d._$$click = () => {
|
|
367
368
|
a() || t.onToggleColumnVisibility(e().key, !e().visible);
|
|
368
|
-
}, b(d, _(
|
|
369
|
+
}, b(d, _($, {
|
|
369
370
|
get state() {
|
|
370
371
|
return c() ? "checked" : "unchecked";
|
|
371
372
|
},
|
|
@@ -393,8 +394,8 @@ function be(t) {
|
|
|
393
394
|
};
|
|
394
395
|
return [
|
|
395
396
|
(() => {
|
|
396
|
-
var e =
|
|
397
|
-
return r._$$click =
|
|
397
|
+
var e = le(), r = e.firstChild, a = r.nextSibling.firstChild.nextSibling;
|
|
398
|
+
return r._$$click = J, b(r, _($, {
|
|
398
399
|
get state() {
|
|
399
400
|
return S();
|
|
400
401
|
},
|
|
@@ -414,7 +415,7 @@ function be(t) {
|
|
|
414
415
|
}), e;
|
|
415
416
|
})(),
|
|
416
417
|
(() => {
|
|
417
|
-
var e =
|
|
418
|
+
var e = ue();
|
|
418
419
|
return C(() => (e) => {
|
|
419
420
|
j = e;
|
|
420
421
|
}, e), b(e, (() => {
|
|
@@ -425,28 +426,28 @@ function be(t) {
|
|
|
425
426
|
},
|
|
426
427
|
keyed: (e) => e.pane,
|
|
427
428
|
children: (e) => (() => {
|
|
428
|
-
var t =
|
|
429
|
+
var t = pe(), r = t.firstChild, i = r.nextSibling, a = i.nextSibling;
|
|
429
430
|
return b(t, (() => {
|
|
430
431
|
var t = x(() => !!O());
|
|
431
432
|
return () => t() ? (() => {
|
|
432
|
-
var t =
|
|
433
|
-
return b(t, () => n()[
|
|
433
|
+
var t = me();
|
|
434
|
+
return b(t, () => n()[ye[e().pane]]), t;
|
|
434
435
|
})() : void 0;
|
|
435
436
|
})(), r), b(t, _(o, {
|
|
436
437
|
get each() {
|
|
437
438
|
return e().items;
|
|
438
439
|
},
|
|
439
440
|
keyed: (e) => e.key,
|
|
440
|
-
children: (e, t) =>
|
|
441
|
+
children: (e, t) => X(e, t)
|
|
441
442
|
}), i), b(t, (() => {
|
|
442
|
-
var t = x(() =>
|
|
443
|
-
return () => t() ?
|
|
443
|
+
var t = x(() => N() !== null && Y() === e().pane && L() === e().items.length);
|
|
444
|
+
return () => t() ? he() : void 0;
|
|
444
445
|
})(), a), y(() => e().pane, (e) => {
|
|
445
446
|
w(t, "data-chooser-section", e);
|
|
446
447
|
}), t;
|
|
447
448
|
})()
|
|
448
449
|
}) : (() => {
|
|
449
|
-
var e =
|
|
450
|
+
var e = fe();
|
|
450
451
|
return b(e, () => n().columnsNoMatches), e;
|
|
451
452
|
})();
|
|
452
453
|
})()), y(() => t.canToggle ? void 0 : 0, (t) => {
|
|
@@ -454,13 +455,13 @@ function be(t) {
|
|
|
454
455
|
}), e;
|
|
455
456
|
})(),
|
|
456
457
|
(() => {
|
|
457
|
-
var e =
|
|
458
|
+
var e = de(), r = e.firstChild;
|
|
458
459
|
return r._$$click = () => {
|
|
459
460
|
t.canToggle && t.onResetColumns();
|
|
460
461
|
}, b(r, () => n().columnsReset), b(e, (() => {
|
|
461
462
|
var e = x(() => !t.canToggle);
|
|
462
463
|
return () => e() ? (() => {
|
|
463
|
-
var e =
|
|
464
|
+
var e = ge();
|
|
464
465
|
return b(e, () => n().columnsUnavailable), e;
|
|
465
466
|
})() : void 0;
|
|
466
467
|
})(), null), y(() => ({
|
|
@@ -481,17 +482,17 @@ v([
|
|
|
481
482
|
]);
|
|
482
483
|
//#endregion
|
|
483
484
|
//#region src/view/SortManagementPanel.tsx
|
|
484
|
-
var
|
|
485
|
-
function
|
|
485
|
+
var Se = /* @__PURE__ */ O("<select class=ssg-sort-select>"), Ce = /* @__PURE__ */ O("<option>"), we = /* @__PURE__ */ O("<div class=ssg-sort-list><!><!>"), Te = /* @__PURE__ */ O("<div class=ssg-popover-footer><button type=button class=\"ssg-sort-footer-btn ssg-sort-footer-btn--add\"></button><button type=button class=\"ssg-sort-footer-btn ssg-sort-footer-btn--clear\">"), Ee = /* @__PURE__ */ O("<div class=ssg-sort-empty>"), De = /* @__PURE__ */ O("<div data-sort-level class=ssg-sort-level><span role=button class=ssg-sort-handle></span><span aria-hidden=true class=ssg-sort-badge></span><div class=ssg-sort-dir-group><button type=button class=ssg-sort-dir-btn>↑ </button><button type=button class=ssg-sort-dir-btn>↓ </button></div><button type=button class=ssg-sort-delete>×"), Oe = /* @__PURE__ */ O("<div class=ssg-sort-drop-end>"), ke = /* @__PURE__ */ O("<div class=ssg-sort-note>");
|
|
486
|
+
function Ae(e) {
|
|
486
487
|
let t = a(() => e.value);
|
|
487
|
-
var n =
|
|
488
|
+
var n = Se();
|
|
488
489
|
return n.addEventListener("change", (t) => e.onChange(t.currentTarget.value)), C(() => t, n), b(n, _(o, {
|
|
489
490
|
get each() {
|
|
490
491
|
return e.options;
|
|
491
492
|
},
|
|
492
493
|
keyed: (e) => e.key,
|
|
493
494
|
children: (e) => (() => {
|
|
494
|
-
var t =
|
|
495
|
+
var t = Ce();
|
|
495
496
|
return b(t, () => e().title), y(() => e().key, (e) => {
|
|
496
497
|
t.value = e;
|
|
497
498
|
}), t;
|
|
@@ -500,7 +501,7 @@ function Oe(e) {
|
|
|
500
501
|
w(n, "disabled", e);
|
|
501
502
|
}), n;
|
|
502
503
|
}
|
|
503
|
-
function
|
|
504
|
+
function je(t) {
|
|
504
505
|
let n = e(), r = l(() => new Set(t.entries.map((e) => e.columnKey))), i = l(() => t.columns.find((e) => !r().has(e.key)) ?? null), a = (e) => t.columns.find((t) => t.key === e)?.title || e, s = () => t.canSort && t.entries.length >= 2, c, [d, f] = u(null), p = !1, [m, h] = u(null), g = 0, v = () => {
|
|
505
506
|
if (!c) return;
|
|
506
507
|
let e = c.querySelectorAll("[data-sort-level]"), t = e.length;
|
|
@@ -526,7 +527,7 @@ function ke(t) {
|
|
|
526
527
|
}, k = () => t.canSort && i() !== null;
|
|
527
528
|
return [
|
|
528
529
|
(() => {
|
|
529
|
-
var e =
|
|
530
|
+
var e = we(), i = e.firstChild, u = i.nextSibling;
|
|
530
531
|
return C(() => (e) => {
|
|
531
532
|
c = e;
|
|
532
533
|
}, e), b(e, (() => {
|
|
@@ -544,10 +545,10 @@ function ke(t) {
|
|
|
544
545
|
title: a(n)
|
|
545
546
|
}, ...i];
|
|
546
547
|
}), c = () => d() === i(), u = () => d() !== null && m() === i();
|
|
547
|
-
var f =
|
|
548
|
-
return p.addEventListener("pointercancel", O), p._$$pointerup = D, p._$$pointermove = E, p._$$pointerdown = (e) => T(i(), e), b(p, _(
|
|
548
|
+
var f = De(), p = f.firstChild, h = p.nextSibling, g = h.nextSibling, v = g.firstChild, x = v.nextSibling, S = g.nextSibling;
|
|
549
|
+
return p.addEventListener("pointercancel", O), p._$$pointerup = D, p._$$pointermove = E, p._$$pointerdown = (e) => T(i(), e), b(p, _(Z, { get disabled() {
|
|
549
550
|
return !s();
|
|
550
|
-
} })), b(h, () => i() + 1), b(f, _(
|
|
551
|
+
} })), b(h, () => i() + 1), b(f, _(Ae, {
|
|
551
552
|
get value() {
|
|
552
553
|
return e().columnKey;
|
|
553
554
|
},
|
|
@@ -581,16 +582,16 @@ function ke(t) {
|
|
|
581
582
|
}), f;
|
|
582
583
|
}
|
|
583
584
|
}) : (() => {
|
|
584
|
-
var e =
|
|
585
|
+
var e = Ee();
|
|
585
586
|
return b(e, () => n().sortPanelEmpty), e;
|
|
586
587
|
})();
|
|
587
588
|
})(), i), b(e, (() => {
|
|
588
589
|
var e = x(() => d() !== null && m() === t.entries.length);
|
|
589
|
-
return () => e() ?
|
|
590
|
+
return () => e() ? Oe() : void 0;
|
|
590
591
|
})(), u), e;
|
|
591
592
|
})(),
|
|
592
593
|
(() => {
|
|
593
|
-
var e =
|
|
594
|
+
var e = Te(), r = e.firstChild, a = r.nextSibling;
|
|
594
595
|
return r._$$click = () => {
|
|
595
596
|
let e = i();
|
|
596
597
|
k() && e && t.onAddLevel(e.key, "asc");
|
|
@@ -606,7 +607,7 @@ function ke(t) {
|
|
|
606
607
|
}), e;
|
|
607
608
|
})(),
|
|
608
609
|
x(() => x(() => !t.canSort)() ? (() => {
|
|
609
|
-
var e =
|
|
610
|
+
var e = ke();
|
|
610
611
|
return b(e, () => n().sortPanelReadOnly), e;
|
|
611
612
|
})() : void 0)
|
|
612
613
|
];
|
|
@@ -618,4 +619,4 @@ v([
|
|
|
618
619
|
"pointerup"
|
|
619
620
|
]);
|
|
620
621
|
//#endregion
|
|
621
|
-
export {
|
|
622
|
+
export { xe as ColumnChooserPanel, te as FilterManagementPanel, je as SortManagementPanel, z as ToolPanel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ishibashi0112/spreadsheet-grid-solid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Solid 2.0 向けの仮想化データグリッド。React 版(@ishibashi0112/spreadsheet-grid)と同じ props・同じ見た目で、SSRM(書き戻し付き)/ 行グルーピング + 集計 / Master/Detail / 範囲選択 + クリップボードを MIT で。IME に強い編集、100 万行の仮想化。コアは @ishibashi0112/spreadsheet-grid-core。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"solid",
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"**/*.css"
|
|
41
41
|
],
|
|
42
42
|
"files": [
|
|
43
|
-
"dist"
|
|
43
|
+
"dist",
|
|
44
|
+
"API_REFERENCE.md",
|
|
45
|
+
"skills"
|
|
44
46
|
],
|
|
45
47
|
"exports": {
|
|
46
48
|
".": {
|
|
@@ -48,6 +50,11 @@
|
|
|
48
50
|
"solid": "./dist/source/index.jsx",
|
|
49
51
|
"import": "./dist/index.js"
|
|
50
52
|
},
|
|
53
|
+
"./ai": {
|
|
54
|
+
"types": "./dist/ai.d.ts",
|
|
55
|
+
"solid": "./dist/source/ai.jsx",
|
|
56
|
+
"import": "./dist/ai.js"
|
|
57
|
+
},
|
|
51
58
|
"./locales/en": {
|
|
52
59
|
"types": "./dist/locales/en.d.ts",
|
|
53
60
|
"import": "./dist/locales/en.js"
|
|
@@ -94,7 +101,7 @@
|
|
|
94
101
|
},
|
|
95
102
|
"dependencies": {
|
|
96
103
|
"@tanstack/virtual-core": "^3.19.11",
|
|
97
|
-
"@ishibashi0112/spreadsheet-grid-core": "1.
|
|
104
|
+
"@ishibashi0112/spreadsheet-grid-core": "1.4.0"
|
|
98
105
|
},
|
|
99
106
|
"devDependencies": {
|
|
100
107
|
"@babel/core": "^7.28.0",
|
|
@@ -108,12 +115,12 @@
|
|
|
108
115
|
"react": "^19.3.0",
|
|
109
116
|
"react-dom": "^19.3.0",
|
|
110
117
|
"solid-js": "2.0.0",
|
|
111
|
-
"@ishibashi0112/spreadsheet-grid": "1.
|
|
118
|
+
"@ishibashi0112/spreadsheet-grid": "1.4.0"
|
|
112
119
|
},
|
|
113
120
|
"scripts": {
|
|
114
121
|
"dev": "vp dev --config vite.config.ts",
|
|
115
122
|
"build:demo": "vp build --config vite.config.ts",
|
|
116
|
-
"build:lib": "vp build --config vite.lib.config.ts && node scripts/build-source.mjs && tsc -p tsconfig.lib.json && node ../../scripts/fix-dts-extensions.mjs dist && node scripts/emit-css.mjs",
|
|
123
|
+
"build:lib": "vp build --config vite.lib.config.ts && node scripts/build-source.mjs && tsc -p tsconfig.lib.json && node ../../scripts/fix-dts-extensions.mjs dist && node scripts/emit-css.mjs && node scripts/emit-docs.mjs",
|
|
117
124
|
"test": "vitest run --config vitest.config.ts",
|
|
118
125
|
"test:ssr": "vitest run --config ssr/vitest.config.ts",
|
|
119
126
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|