@ishibashi0112/spreadsheet-grid 0.61.0 → 0.62.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 +121 -57
- package/README.md +8 -3
- package/dist/{ColumnFilterPopover-F20TkD0c.js → ColumnFilterPopover-BA-7nDsj.js} +114 -119
- package/dist/ColumnFilterPopover-DxqheJXu.cjs +1 -0
- package/dist/ai/useGridAsk.d.ts +10 -4
- package/dist/ai.cjs +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +124 -96
- package/dist/common.d.ts +1 -1
- package/dist/editors/editorKeyBindings.d.ts +3 -1
- package/dist/features/types.d.ts +3 -0
- package/dist/hooks/useColumnMenuController.d.ts +1 -0
- package/dist/hooks/useGlobalFilteredOrder.d.ts +2 -1
- package/dist/hooks/useGridBarContext.d.ts +3 -1
- package/dist/hooks/useGridStore.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2078 -1947
- package/dist/lite/ColumnFilterPopover-BJ850WSB.cjs +1 -0
- package/dist/lite/{ColumnFilterPopover-CLTZ_4W5.js → ColumnFilterPopover-u9jUtyeA.js} +114 -119
- package/dist/lite/{columnMenu-Bljdw8BI.js → columnMenu-De-Pe1zW.js} +1 -0
- package/dist/lite/columnMenu-c7LUVw5e.cjs +1 -0
- package/dist/lite/createSpreadsheetGrid--UUIzl_-.cjs +1 -0
- package/dist/lite/createSpreadsheetGrid-CLXKPyht.js +3993 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite/features/columnMenu.cjs +1 -1
- package/dist/lite/features/columnMenu.js +1 -1
- package/dist/lite/features/filtering.cjs +1 -1
- package/dist/lite/features/filtering.js +1 -1
- package/dist/lite/features/grouping.cjs +1 -1
- package/dist/lite/features/grouping.js +1 -1
- package/dist/lite/features/scrollHint.cjs +1 -1
- package/dist/lite/features/scrollHint.js +1 -1
- package/dist/lite/features/standard.cjs +1 -1
- package/dist/lite/features/standard.js +3 -3
- package/dist/lite/features/toolPanel.cjs +1 -1
- package/dist/lite/features/toolPanel.js +1 -1
- package/dist/lite/{filtering-vBqqBYAG.js → filtering--G2a3C52.js} +128 -123
- package/dist/lite/filtering-BiBzpwOt.cjs +1 -0
- package/dist/lite/{grouping-DpzyuoPc.js → grouping-DmEsb0fK.js} +26 -17
- package/dist/lite/grouping-DrzDODsr.cjs +1 -0
- package/dist/lite/{lazyPopups-OkLDimTH.cjs → lazyPopups-Bv7socba.cjs} +1 -1
- package/dist/lite/{lazyPopups-BXNfrY9S.js → lazyPopups-Iz7RhJT2.js} +1 -1
- package/dist/lite/{scrollHint-DNBSef2V.cjs → scrollHint-C9zWN8Is.cjs} +1 -1
- package/dist/lite/{scrollHint-DgNH5I5X.js → scrollHint-DrbQbfHq.js} +5 -5
- package/dist/lite/{toolPanel-ArCSqFon.cjs → toolPanel-CDUbIRGC.cjs} +1 -1
- package/dist/lite/{toolPanel-PNltNyJU.js → toolPanel-Co2Oa1Hn.js} +1 -1
- package/dist/{toolPanelViews-icRtdlYb.js → lite/toolPanelViews-B4z-zxN0.js} +58 -57
- package/dist/lite/toolPanelViews-lXyeaMNX.cjs +1 -0
- package/dist/lite.cjs +1 -1
- package/dist/lite.js +7 -7
- package/dist/style.css +1 -1
- package/dist/style.layer.css +4 -1
- package/dist/{lite/toolPanelViews-icRtdlYb.js → toolPanelViews-B4z-zxN0.js} +58 -57
- package/dist/toolPanelViews-lXyeaMNX.cjs +1 -0
- package/dist/view/ColumnChooserPanel.d.ts +1 -0
- package/dist/view/GridBodyGroupRow.d.ts +4 -2
- package/dist/view/gridBarHelpers.d.ts +11 -5
- package/package.json +2 -2
- package/skills/spreadsheet-grid/SKILL.md +4 -3
- package/dist/ColumnFilterPopover-I_O_eSLR.cjs +0 -1
- package/dist/lite/ColumnFilterPopover-yp9Xbs_1.cjs +0 -1
- package/dist/lite/columnMenu-DIcUt0iz.cjs +0 -1
- package/dist/lite/createSpreadsheetGrid-Cy_owplJ.cjs +0 -1
- package/dist/lite/createSpreadsheetGrid-D70ggVFk.js +0 -3875
- package/dist/lite/filtering-DCZvidEf.cjs +0 -1
- package/dist/lite/grouping-Bw4RGsGm.cjs +0 -1
- package/dist/lite/toolPanelViews-BZIU6pNY.cjs +0 -1
- package/dist/toolPanelViews-BZIU6pNY.cjs +0 -1
package/dist/ai.js
CHANGED
|
@@ -2,19 +2,25 @@ import { useEffect as e, useRef as t, useState as n, useSyncExternalStore as r }
|
|
|
2
2
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
3
|
import { systemColorSchemeStore as s } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/systemColorSchemeStore";
|
|
4
4
|
import { resolveGridTheme as c } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/theme";
|
|
5
|
-
import { createGridAskRequest as l, createGridAskRequest as u, describeGridAskView as d, describeGridAskView as f, gridAskSystemPrompt as p, isGridAskColumnsChanged as m,
|
|
5
|
+
import { createGridAskRequest as l, createGridAskRequest as u, describeGridAskView as d, describeGridAskView as f, gridAskSystemPrompt as p, isGridAskColumnsChanged as m, isGridAskColumnsChanged as h, isSameGridAskView as g, isSameGridAskView as _, readGridAskAnswer as v, readGridAskAnswer as y, removeGridAskItem as b, removeGridAskItem as x } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAsk";
|
|
6
6
|
//#region src/ai/useGridAsk.ts
|
|
7
|
-
var
|
|
7
|
+
var S = "AI に聞けませんでした。もう一度試してください。", C = "表が見つかりませんでした。表が出てから、もう一度試してください。", w = "表の条件が変わったので、ここからは変えられません。表のフィルターや並びで直してください。", T = 1e3, E = 400, D = (e, t, n) => n ? _(e, t) : _({
|
|
8
|
+
...e,
|
|
9
|
+
columns: void 0
|
|
10
|
+
}, {
|
|
11
|
+
...t,
|
|
12
|
+
columns: void 0
|
|
13
|
+
}), O = (e) => ({
|
|
8
14
|
columns: e.columns,
|
|
9
15
|
columnHints: e.columnHints,
|
|
10
16
|
allowFilter: e.allowFilter,
|
|
11
17
|
allowSort: e.allowSort,
|
|
12
18
|
allowSearch: e.allowSearch,
|
|
13
19
|
allowColumnVisibility: e.allowColumnVisibility
|
|
14
|
-
}),
|
|
20
|
+
}), k = (e, t) => h(e, t) ? t : {
|
|
15
21
|
...t,
|
|
16
22
|
columns: void 0
|
|
17
|
-
},
|
|
23
|
+
}, A = (e, t, n) => {
|
|
18
24
|
if (!n) return {
|
|
19
25
|
...e,
|
|
20
26
|
filters: t.filters,
|
|
@@ -35,106 +41,117 @@ var b = "AI に聞けませんでした。もう一度試してください。",
|
|
|
35
41
|
})
|
|
36
42
|
};
|
|
37
43
|
};
|
|
38
|
-
function
|
|
39
|
-
let [i, a] = n("idle"), [o, s] = n(null), [c, l] = n(null), [d, p] = n(null), m = t(null),
|
|
44
|
+
function j(r) {
|
|
45
|
+
let [i, a] = n("idle"), [o, s] = n(null), [c, l] = n(null), [d, p] = n(null), m = t(null), h = t(r);
|
|
40
46
|
e(() => {
|
|
41
|
-
|
|
47
|
+
h.current = r;
|
|
42
48
|
}), e(() => () => {
|
|
43
49
|
let e = m.current;
|
|
44
50
|
e !== null && (m.current = null, e.abort(), a("idle"));
|
|
45
51
|
}, []);
|
|
46
|
-
let
|
|
52
|
+
let g = O(r), _ = (e) => f(e, g), v = r.allowColumnVisibility ?? !1, b = process.env.NODE_ENV === "production" || !r.columnHints ? "" : Object.keys(r.columnHints).filter((e) => !r.columns.some((t) => t.key === e)).join(", ");
|
|
53
|
+
e(() => {
|
|
54
|
+
b !== "" && console.warn(`[spreadsheet-grid] GridAskBar / useGridAsk の columnHints に列に無いキーがあります: ${b}。列の key と同じ名前にしてください(この補足や \`false\` は効いていません)。`);
|
|
55
|
+
}, [b]);
|
|
56
|
+
let j = d !== null && d.view.phase === "applied" ? d : null;
|
|
57
|
+
e(() => {
|
|
58
|
+
if (j === null) return;
|
|
59
|
+
let e = null, t = () => {
|
|
60
|
+
if (m.current !== null) return;
|
|
61
|
+
let e = h.current.grid.current;
|
|
62
|
+
e === null || D(e.getState(), j.applied, v) || (p((e) => e === j ? {
|
|
63
|
+
...e,
|
|
64
|
+
view: {
|
|
65
|
+
...e.view,
|
|
66
|
+
phase: "changed"
|
|
67
|
+
}
|
|
68
|
+
} : e), l(w));
|
|
69
|
+
}, n = () => {
|
|
70
|
+
e === null && (e = setTimeout(() => {
|
|
71
|
+
e = null, t();
|
|
72
|
+
}, E));
|
|
73
|
+
}, r = setInterval(t, T);
|
|
74
|
+
return document.addEventListener("click", n, !0), document.addEventListener("keyup", n, !0), () => {
|
|
75
|
+
clearInterval(r), e !== null && clearTimeout(e), document.removeEventListener("click", n, !0), document.removeEventListener("keyup", n, !0);
|
|
76
|
+
};
|
|
77
|
+
}, [j, v]);
|
|
78
|
+
let M = async (e) => {
|
|
47
79
|
let t = e.trim();
|
|
48
|
-
if (t === "" || m.current !== null) return;
|
|
80
|
+
if (t === "" || m.current !== null) return !1;
|
|
49
81
|
let n = r.grid.current;
|
|
50
|
-
if (n === null)
|
|
51
|
-
s(x);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
82
|
+
if (n === null) return s(C), !1;
|
|
54
83
|
let i = new AbortController();
|
|
55
84
|
m.current = i, a("asking"), s(null), l(null);
|
|
56
85
|
let o;
|
|
57
86
|
try {
|
|
58
|
-
o = await r.ask(u(t, n.getState(),
|
|
87
|
+
o = await r.ask(u(t, n.getState(), g), { signal: i.signal });
|
|
59
88
|
} catch (e) {
|
|
60
|
-
|
|
61
|
-
m.current = null, a("idle"), g.current.onError?.(e), s(b);
|
|
62
|
-
return;
|
|
89
|
+
return i.signal.aborted ? !1 : (m.current = null, a("idle"), h.current.onError?.(e), s(S), !1);
|
|
63
90
|
}
|
|
64
|
-
if (i.signal.aborted) return;
|
|
91
|
+
if (i.signal.aborted) return !1;
|
|
65
92
|
m.current = null, a("idle");
|
|
66
|
-
let c =
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
let y = h.getState(), S = _(o, y, d);
|
|
72
|
-
if (!S.ok) {
|
|
73
|
-
s(S.message);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
let T = {
|
|
93
|
+
let c = h.current, d = O(c), _ = c.grid.current;
|
|
94
|
+
if (_ === null) return s(C), !1;
|
|
95
|
+
let v = _.getState(), b = y(o, v, d);
|
|
96
|
+
if (!b.ok) return s(b.message), !1;
|
|
97
|
+
let x = {
|
|
77
98
|
text: t,
|
|
78
|
-
dropped:
|
|
79
|
-
unsupported:
|
|
99
|
+
dropped: b.dropped,
|
|
100
|
+
unsupported: b.unsupported
|
|
80
101
|
};
|
|
81
|
-
|
|
82
|
-
p({
|
|
83
|
-
view: {
|
|
84
|
-
...T,
|
|
85
|
-
phase: "unchanged",
|
|
86
|
-
items: f(y, d)
|
|
87
|
-
},
|
|
88
|
-
before: y,
|
|
89
|
-
applied: y
|
|
90
|
-
});
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
h.applyState(w(y, S.state)), p({
|
|
102
|
+
return l(null), b.changed ? (_.applyState(k(v, b.state)), p({
|
|
94
103
|
view: {
|
|
95
|
-
...
|
|
104
|
+
...x,
|
|
96
105
|
phase: "applied",
|
|
97
|
-
items: f(
|
|
106
|
+
items: f(b.state, d)
|
|
98
107
|
},
|
|
99
|
-
before:
|
|
100
|
-
applied:
|
|
108
|
+
before: v,
|
|
109
|
+
applied: b.state
|
|
101
110
|
}), c.onApply?.({
|
|
102
111
|
text: t,
|
|
103
|
-
state:
|
|
104
|
-
dropped:
|
|
105
|
-
unsupported:
|
|
106
|
-
})
|
|
107
|
-
|
|
112
|
+
state: b.state,
|
|
113
|
+
dropped: b.dropped,
|
|
114
|
+
unsupported: b.unsupported
|
|
115
|
+
}), !0) : (p({
|
|
116
|
+
view: {
|
|
117
|
+
...x,
|
|
118
|
+
phase: "unchanged",
|
|
119
|
+
items: f(v, d)
|
|
120
|
+
},
|
|
121
|
+
before: v,
|
|
122
|
+
applied: v
|
|
123
|
+
}), !0);
|
|
124
|
+
}, N = () => {
|
|
108
125
|
let e = m.current;
|
|
109
126
|
e !== null && (m.current = null, e.abort(), a("idle"));
|
|
110
|
-
},
|
|
127
|
+
}, P = (e) => {
|
|
111
128
|
let t = r.grid.current;
|
|
112
129
|
if (t === null || e.view.phase !== "applied") return null;
|
|
113
130
|
let n = t.getState();
|
|
114
|
-
return (
|
|
115
|
-
...n,
|
|
116
|
-
columns: void 0
|
|
117
|
-
}, {
|
|
118
|
-
...e.applied,
|
|
119
|
-
columns: void 0
|
|
120
|
-
})) ? {
|
|
131
|
+
return D(n, e.applied, v) ? {
|
|
121
132
|
target: t,
|
|
122
133
|
now: n
|
|
123
|
-
} : (l(
|
|
134
|
+
} : (l(w), p({
|
|
135
|
+
...e,
|
|
136
|
+
view: {
|
|
137
|
+
...e.view,
|
|
138
|
+
phase: "changed"
|
|
139
|
+
}
|
|
140
|
+
}), null);
|
|
124
141
|
};
|
|
125
142
|
return {
|
|
126
143
|
status: i,
|
|
127
144
|
error: o,
|
|
128
145
|
notice: c,
|
|
129
146
|
session: d?.view ?? null,
|
|
130
|
-
submit:
|
|
131
|
-
cancel:
|
|
147
|
+
submit: M,
|
|
148
|
+
cancel: N,
|
|
132
149
|
undo: () => {
|
|
133
150
|
if (d === null) return;
|
|
134
|
-
let e =
|
|
151
|
+
let e = P(d);
|
|
135
152
|
if (e === null) return;
|
|
136
|
-
let t =
|
|
137
|
-
e.target.applyState(
|
|
153
|
+
let t = A(e.now, d.before, v);
|
|
154
|
+
e.target.applyState(k(e.now, t)), l(null), p({
|
|
138
155
|
...d,
|
|
139
156
|
view: {
|
|
140
157
|
...d.view,
|
|
@@ -144,15 +161,15 @@ function E(r) {
|
|
|
144
161
|
},
|
|
145
162
|
remove: (e) => {
|
|
146
163
|
if (d === null) return;
|
|
147
|
-
let t =
|
|
164
|
+
let t = P(d);
|
|
148
165
|
if (t === null) return;
|
|
149
|
-
let n =
|
|
150
|
-
t.target.applyState(
|
|
166
|
+
let n = x(t.now, e);
|
|
167
|
+
t.target.applyState(k(t.now, n)), p({
|
|
151
168
|
...d,
|
|
152
169
|
applied: n,
|
|
153
170
|
view: {
|
|
154
171
|
...d.view,
|
|
155
|
-
items:
|
|
172
|
+
items: _(n)
|
|
156
173
|
}
|
|
157
174
|
});
|
|
158
175
|
},
|
|
@@ -163,15 +180,15 @@ function E(r) {
|
|
|
163
180
|
}
|
|
164
181
|
//#endregion
|
|
165
182
|
//#region src/ai/GridAskBar.tsx
|
|
166
|
-
var
|
|
167
|
-
function
|
|
168
|
-
let h =
|
|
183
|
+
var M = (...e) => e.filter(Boolean).join(" ");
|
|
184
|
+
function N({ examples: l, placeholder: u = "ことばで絞り込み・並べ替え(例: 今月の分を金額の高い順に)", label: d = "ことばで絞り込み", className: f, theme: p = "light", ...m }) {
|
|
185
|
+
let h = j(m), [g, _] = n(""), v = c(p, r(s.subscribe, s.getSnapshot, s.getServerSnapshot)) === "dark", y = h.status === "asking", b = h.session, x = h.cancel, [S, C] = n(""), w = t(null), T = t(null), E = t(null), D = t(null);
|
|
169
186
|
e(() => {
|
|
170
|
-
let e =
|
|
171
|
-
if (
|
|
187
|
+
let e = D.current;
|
|
188
|
+
if (D.current = null, e === null || performance.now() - e.at > 1e3) return;
|
|
172
189
|
let t = document.activeElement;
|
|
173
190
|
if (t !== null && t !== document.body) return;
|
|
174
|
-
let n =
|
|
191
|
+
let n = E.current?.querySelectorAll(".ssg-ask-chip-remove");
|
|
175
192
|
(e.chip !== null && n && n.length > 0 ? n[Math.min(e.chip, n.length - 1)] : T.current)?.focus();
|
|
176
193
|
}), e(() => {
|
|
177
194
|
if (!y) return;
|
|
@@ -182,23 +199,27 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
182
199
|
};
|
|
183
200
|
return t.addEventListener("keydown", n), () => t.removeEventListener("keydown", n);
|
|
184
201
|
}, [y, x]);
|
|
185
|
-
let
|
|
186
|
-
|
|
202
|
+
let O = (e = null) => {
|
|
203
|
+
D.current = {
|
|
187
204
|
chip: e,
|
|
188
205
|
at: performance.now()
|
|
189
206
|
};
|
|
190
|
-
},
|
|
191
|
-
y || e.trim() === ""
|
|
207
|
+
}, k = (e) => {
|
|
208
|
+
if (y || e.trim() === "") return;
|
|
209
|
+
let t = e.trim();
|
|
210
|
+
C(t), h.submit(e).then((e) => {
|
|
211
|
+
e && _((e) => e.trim() === t ? "" : e);
|
|
212
|
+
});
|
|
192
213
|
};
|
|
193
214
|
return /* @__PURE__ */ o("div", {
|
|
194
215
|
ref: w,
|
|
195
|
-
className:
|
|
216
|
+
className: M("ssg-ask", v && "ssg-theme-dark", f),
|
|
196
217
|
"data-ssg-ask": "",
|
|
197
218
|
children: [
|
|
198
219
|
/* @__PURE__ */ o("form", {
|
|
199
220
|
className: "ssg-ask-form",
|
|
200
221
|
onSubmit: (e) => {
|
|
201
|
-
e.preventDefault(),
|
|
222
|
+
e.preventDefault(), k(g);
|
|
202
223
|
},
|
|
203
224
|
children: [
|
|
204
225
|
/* @__PURE__ */ a("svg", {
|
|
@@ -254,7 +275,7 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
254
275
|
"aria-disabled": y || void 0,
|
|
255
276
|
title: e,
|
|
256
277
|
onClick: () => {
|
|
257
|
-
y || (_(e),
|
|
278
|
+
y || (_(e), k(e));
|
|
258
279
|
},
|
|
259
280
|
children: e
|
|
260
281
|
}, t))]
|
|
@@ -283,7 +304,7 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
283
304
|
type: "button",
|
|
284
305
|
className: "ssg-ask-link",
|
|
285
306
|
onClick: () => {
|
|
286
|
-
|
|
307
|
+
O(), k(S);
|
|
287
308
|
},
|
|
288
309
|
children: "もう一度"
|
|
289
310
|
})]
|
|
@@ -302,20 +323,20 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
302
323
|
type: "button",
|
|
303
324
|
className: "ssg-ask-link",
|
|
304
325
|
onClick: () => {
|
|
305
|
-
|
|
326
|
+
O(), h.undo();
|
|
306
327
|
},
|
|
307
328
|
children: "元に戻す"
|
|
308
329
|
}), /* @__PURE__ */ a("button", {
|
|
309
330
|
type: "button",
|
|
310
331
|
className: "ssg-ask-link",
|
|
311
332
|
onClick: () => {
|
|
312
|
-
|
|
333
|
+
O(), h.dismiss();
|
|
313
334
|
},
|
|
314
335
|
children: "閉じる"
|
|
315
336
|
})]
|
|
316
337
|
})]
|
|
317
338
|
}), b.items.length > 0 ? /* @__PURE__ */ a("ul", {
|
|
318
|
-
ref:
|
|
339
|
+
ref: E,
|
|
319
340
|
className: "ssg-ask-chips",
|
|
320
341
|
children: b.items.map((e, t) => /* @__PURE__ */ o("li", {
|
|
321
342
|
className: "ssg-ask-chip",
|
|
@@ -334,7 +355,7 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
334
355
|
className: "ssg-ask-chip-remove",
|
|
335
356
|
"aria-label": `${e.label} ${e.text} を外す`,
|
|
336
357
|
onClick: () => {
|
|
337
|
-
|
|
358
|
+
O(t), h.remove(e.id);
|
|
338
359
|
},
|
|
339
360
|
children: "×"
|
|
340
361
|
})
|
|
@@ -351,7 +372,7 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
351
372
|
type: "button",
|
|
352
373
|
className: "ssg-ask-link",
|
|
353
374
|
onClick: () => {
|
|
354
|
-
|
|
375
|
+
O(), h.dismiss();
|
|
355
376
|
},
|
|
356
377
|
children: "閉じる"
|
|
357
378
|
})]
|
|
@@ -362,12 +383,12 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
362
383
|
type: "button",
|
|
363
384
|
className: "ssg-ask-link",
|
|
364
385
|
onClick: () => {
|
|
365
|
-
|
|
386
|
+
O(), h.dismiss();
|
|
366
387
|
},
|
|
367
388
|
children: "閉じる"
|
|
368
389
|
})]
|
|
369
390
|
}),
|
|
370
|
-
b.phase !== "undone" && b.dropped.length > 0 && /* @__PURE__ */ o("div", {
|
|
391
|
+
b.phase !== "undone" && b.phase !== "changed" && b.dropped.length > 0 && /* @__PURE__ */ o("div", {
|
|
371
392
|
className: "ssg-ask-note ssg-ask-note--warn",
|
|
372
393
|
children: [/* @__PURE__ */ a("span", {
|
|
373
394
|
className: "ssg-ask-note-title",
|
|
@@ -377,14 +398,21 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
377
398
|
children: b.dropped.map((e, t) => /* @__PURE__ */ a("li", { children: e }, t))
|
|
378
399
|
})]
|
|
379
400
|
}),
|
|
380
|
-
b.phase !== "undone" && b.unsupported !== null && /* @__PURE__ */ a("div", {
|
|
401
|
+
b.phase !== "undone" && b.phase !== "changed" && b.unsupported !== null && /* @__PURE__ */ a("div", {
|
|
381
402
|
className: "ssg-ask-note",
|
|
382
403
|
children: /* @__PURE__ */ o("span", { children: ["AI から: ", b.unsupported] })
|
|
383
404
|
})
|
|
384
405
|
] }),
|
|
385
|
-
h.notice !== null && /* @__PURE__ */
|
|
406
|
+
h.notice !== null && /* @__PURE__ */ o("div", {
|
|
386
407
|
className: "ssg-ask-note ssg-ask-note--warn",
|
|
387
|
-
children: /* @__PURE__ */ a("span", { children: h.notice })
|
|
408
|
+
children: [/* @__PURE__ */ a("span", { children: h.notice }), b?.phase === "changed" && /* @__PURE__ */ a("button", {
|
|
409
|
+
type: "button",
|
|
410
|
+
className: "ssg-ask-link",
|
|
411
|
+
onClick: () => {
|
|
412
|
+
O(), h.dismiss();
|
|
413
|
+
},
|
|
414
|
+
children: "閉じる"
|
|
415
|
+
})]
|
|
388
416
|
})
|
|
389
417
|
]
|
|
390
418
|
})
|
|
@@ -392,4 +420,4 @@ function O({ examples: l, placeholder: u = "ことばで絞り込み・並べ替
|
|
|
392
420
|
});
|
|
393
421
|
}
|
|
394
422
|
//#endregion
|
|
395
|
-
export {
|
|
423
|
+
export { N as GridAskBar, l as createGridAskRequest, d as describeGridAskView, p as gridAskSystemPrompt, m as isGridAskColumnsChanged, g as isSameGridAskView, v as readGridAskAnswer, b as removeGridAskItem, j as useGridAsk };
|
package/dist/common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { numberFormatter } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueFormatters';
|
|
2
2
|
export { preloadGridPopups } from './view/lazyPopups.js';
|
|
3
|
-
export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, DeprecatedCsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, FindOptions, FindChangeParams, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
|
|
3
|
+
export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, DeprecatedCsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridStatePatch, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, FindOptions, FindChangeParams, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
|
|
4
4
|
export type { NumberFormatterOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueFormatters';
|
|
@@ -7,6 +7,8 @@ type CreateEditorKeyDownHandlerArgs = {
|
|
|
7
7
|
onCancel: () => void;
|
|
8
8
|
onRejected?: (message: string) => void;
|
|
9
9
|
enterMove?: EditorEnterMove;
|
|
10
|
+
blockHomeEnd?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const
|
|
12
|
+
export declare const isEditorScrollKey: (key: string, blockHomeEnd: boolean) => boolean;
|
|
13
|
+
export declare const createEditorKeyDownHandler: ({ value, onCommit, onCancel, onRejected, enterMove, blockHomeEnd, }: CreateEditorKeyDownHandlerArgs) => (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
12
14
|
export {};
|
package/dist/features/types.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export type FilterOrderFeatureArgs<T> = {
|
|
|
78
78
|
visibleColumns: GridColumn<T>[];
|
|
79
79
|
effectiveColumns: GridColumn<T>[];
|
|
80
80
|
globalFilterText: string;
|
|
81
|
+
globalFilterUrgent?: boolean;
|
|
81
82
|
globalFilterEnabled: boolean;
|
|
82
83
|
columnFilterEnabled: boolean;
|
|
83
84
|
columnFilters: Record<string, ColumnFilterValue>;
|
|
@@ -91,6 +92,7 @@ export type FilterOrderFeatureResult = {
|
|
|
91
92
|
globalFilterStatus: GlobalFilterStatus;
|
|
92
93
|
globalFilterProgress: number;
|
|
93
94
|
relativeDateKey: string;
|
|
95
|
+
available?: boolean;
|
|
94
96
|
};
|
|
95
97
|
export type FilterPopoverFeatureArgs<T> = {
|
|
96
98
|
visibleColumns: GridColumn<T>[];
|
|
@@ -99,6 +101,7 @@ export type FilterPopoverFeatureArgs<T> = {
|
|
|
99
101
|
gridRootRef: RefObject<HTMLDivElement | null>;
|
|
100
102
|
isServerSide: boolean;
|
|
101
103
|
rows: T[];
|
|
104
|
+
isLabelRow?: (row: T, sourceIndex: number) => boolean;
|
|
102
105
|
};
|
|
103
106
|
export type FilterPopoverFeatureResult<T> = ReturnType<typeof useFilterPopoverController<T>>;
|
|
104
107
|
export type FilterPopoverContentFeatureArgs<T> = {
|
|
@@ -18,6 +18,7 @@ export declare const useColumnMenuController: <T>(args: UseColumnMenuControllerA
|
|
|
18
18
|
openColumnMenuFromButton: (column: import("@ishibashi0112/spreadsheet-grid-core/internal/model/gridTypes.unbound").GridColumn<T>, event: import("@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController").MenuButtonPointerEvent) => void;
|
|
19
19
|
openColumnMenuFromButtonClick: (column: import("@ishibashi0112/spreadsheet-grid-core/internal/model/gridTypes.unbound").GridColumn<T>, event: import("@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController").MenuButtonClickEvent) => void;
|
|
20
20
|
openColumnMenuFromContextMenu: (column: import("@ishibashi0112/spreadsheet-grid-core/internal/model/gridTypes.unbound").GridColumn<T>, event: import("@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController").MenuContextEvent) => void;
|
|
21
|
+
openColumnMenuFromKeyboard: (column: import("@ishibashi0112/spreadsheet-grid-core/internal/model/gridTypes.unbound").GridColumn<T>, anchor: HTMLElement) => void;
|
|
21
22
|
closeColumnMenu: () => void;
|
|
22
23
|
};
|
|
23
24
|
export type UseColumnMenuControllerResult<T> = ReturnType<typeof useColumnMenuController<T>>;
|
|
@@ -7,7 +7,8 @@ type UseGlobalFilteredOrderArgs<T> = {
|
|
|
7
7
|
baseOrder: RowOrder;
|
|
8
8
|
columns: GridColumn<T>[];
|
|
9
9
|
globalText: string;
|
|
10
|
+
urgent?: boolean;
|
|
10
11
|
enabled: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const useGlobalFilteredOrder: <T>({ rows, baseOrder, columns, globalText, enabled, }: UseGlobalFilteredOrderArgs<T>) => GlobalFilteredOrderResult;
|
|
13
|
+
export declare const useGlobalFilteredOrder: <T>({ rows, baseOrder, columns, globalText, urgent, enabled, }: UseGlobalFilteredOrderArgs<T>) => GlobalFilteredOrderResult;
|
|
13
14
|
export default useGlobalFilteredOrder;
|
|
@@ -8,13 +8,15 @@ type UseGridBarContextArgs<T> = {
|
|
|
8
8
|
columns: GridColumn<T>[];
|
|
9
9
|
visibleColumns: GridColumn<T>[];
|
|
10
10
|
orderedColumns?: GridColumn<T>[];
|
|
11
|
+
labelViewIndexes?: ArrayLike<number>;
|
|
11
12
|
uiState: GridUiState;
|
|
12
13
|
setGlobalFilterText: (value: string) => void;
|
|
13
14
|
globalFilterStatus: GlobalFilterStatus;
|
|
14
15
|
globalFilterProgress: number;
|
|
15
16
|
selectionAggregates?: GridSelectionAggregates | null;
|
|
17
|
+
filtersApplied?: boolean;
|
|
16
18
|
};
|
|
17
|
-
export declare const useGridBarContext: <T>({ rows, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, }: UseGridBarContextArgs<T>) => {
|
|
19
|
+
export declare const useGridBarContext: <T>({ rows, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, filtersApplied, }: UseGridBarContextArgs<T>) => {
|
|
18
20
|
slotContextBase: GridSlotContextBase<T>;
|
|
19
21
|
derivedSummary: import("@ishibashi0112/spreadsheet-grid-core/internal/model/gridTypes.core").SpreadsheetGridDerivedSummary;
|
|
20
22
|
slotContext: SpreadsheetGridSlotContext<T>;
|
|
@@ -2,6 +2,6 @@ import { type GridStore, type GridViewState, type Updater } from '@ishibashi0112
|
|
|
2
2
|
import type { GridUiState } from '../model/gridTypes.js';
|
|
3
3
|
export declare function useGridStore(store: GridStore): [GridUiState, GridStore['dispatch']];
|
|
4
4
|
export type GridViewStateSetters = {
|
|
5
|
-
[K in keyof GridViewState as `set${Capitalize<K>}`]
|
|
5
|
+
[K in keyof GridViewState as `set${Capitalize<K>}`]-?: (next: Updater<Exclude<GridViewState[K], undefined>>) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare function useGridViewState(store: GridStore): [GridViewState, GridViewStateSetters];
|