@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
package/dist/source/index.jsx
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
+
callInOwnFrame,
|
|
2
3
|
closeMountGateOnSettled,
|
|
4
|
+
connectController,
|
|
3
5
|
createColumnVirtualizer,
|
|
6
|
+
createExternalStoreSignal,
|
|
4
7
|
createMountGate,
|
|
8
|
+
createUserCallbacks,
|
|
5
9
|
flushMountGate,
|
|
6
10
|
onGridMounted,
|
|
11
|
+
outsideGraphApply,
|
|
12
|
+
runHandleCall,
|
|
7
13
|
runInMountGate
|
|
8
|
-
} from "./chunks/chunk-
|
|
14
|
+
} from "./chunks/chunk-ZZTXTW4Z.jsx";
|
|
9
15
|
import {
|
|
10
16
|
GridLocaleTextContext,
|
|
11
17
|
GridPortalContext,
|
|
@@ -24,7 +30,7 @@ import {
|
|
|
24
30
|
import { merge } from "solid-js";
|
|
25
31
|
|
|
26
32
|
// src/SpreadsheetGrid.tsx
|
|
27
|
-
import { For as For5, Match, Show as Show11, Switch, createEffect as createEffect4, createMemo as
|
|
33
|
+
import { For as For5, Match, NoHydration, Show as Show11, Switch, createEffect as createEffect4, createMemo as createMemo10, createSignal as createSignal9, createUniqueId as createUniqueId3, isHydrating, latest as latest2, onCleanup as onCleanup8, runWithOwner as runWithOwner3, untrack as untrack13 } from "solid-js";
|
|
28
34
|
import { isServer } from "@solidjs/web";
|
|
29
35
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
30
36
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
@@ -54,7 +60,7 @@ import { resolveGridThemeClassName } from "@ishibashi0112/spreadsheet-grid-core/
|
|
|
54
60
|
import { MOTION_OFF_CLASS_NAME, resolveGridMotion } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/motion";
|
|
55
61
|
import { systemColorSchemeStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/systemColorSchemeStore";
|
|
56
62
|
import { reducedMotionStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/reducedMotionStore";
|
|
57
|
-
import { createLocaleTextResolver, formatLocaleText as
|
|
63
|
+
import { createLocaleTextResolver, formatLocaleText as formatLocaleText6 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
58
64
|
import { EMPTY_TOTAL_ROW_CELLS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
59
65
|
import {
|
|
60
66
|
resolveSlotFromSignature,
|
|
@@ -75,12 +81,14 @@ import {
|
|
|
75
81
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
76
82
|
import {
|
|
77
83
|
DEFAULT_DETAIL_ROW_HEIGHT,
|
|
84
|
+
DETAIL_TOGGLE_COLUMN_KEY as DETAIL_TOGGLE_COLUMN_KEY2,
|
|
78
85
|
isControlColumnKey,
|
|
79
86
|
isDetailRowExpandable,
|
|
80
87
|
isInsideDetailCardOf,
|
|
81
88
|
isSyntheticColumnKey as isSyntheticColumnKey2,
|
|
82
89
|
resolveFirstDataColIndex
|
|
83
90
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
91
|
+
import { resolveDataRowNumber as resolveDataRowNumber2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
84
92
|
import {
|
|
85
93
|
createSelectedRowsInOrderCounter,
|
|
86
94
|
getSelectAllState,
|
|
@@ -121,100 +129,140 @@ import {
|
|
|
121
129
|
isEscapeClaimedByGrid
|
|
122
130
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
|
|
123
131
|
|
|
124
|
-
// src/primitives/
|
|
125
|
-
import {
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
return fn();
|
|
134
|
-
} finally {
|
|
135
|
-
gridUpdateDepth--;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
function runHandleCall(fn) {
|
|
139
|
-
handleCallDepth++;
|
|
140
|
-
try {
|
|
141
|
-
return fn();
|
|
142
|
-
} finally {
|
|
143
|
-
handleCallDepth--;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function isIsolatingFlush() {
|
|
147
|
-
return isolatingDepth > 0;
|
|
148
|
-
}
|
|
149
|
-
function deferControllerUpdate(replay) {
|
|
150
|
-
pendingReplays.add(replay);
|
|
151
|
-
}
|
|
152
|
-
var flushQuietly = () => {
|
|
153
|
-
try {
|
|
154
|
-
flush();
|
|
155
|
-
} catch {
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var isolatedFlush = () => {
|
|
159
|
-
isolatingDepth++;
|
|
160
|
-
try {
|
|
161
|
-
flushQuietly();
|
|
162
|
-
} finally {
|
|
163
|
-
isolatingDepth--;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
var releaseReplays = () => {
|
|
167
|
-
if (pendingReplays.size === 0) {
|
|
168
|
-
return;
|
|
132
|
+
// src/primitives/storeRows.ts
|
|
133
|
+
import { $PROXY, $TRACK, createEffect, createMemo, createRoot, createSignal, deep, getOwner, latest, onCleanup, runWithOwner, snapshot, untrack } from "solid-js";
|
|
134
|
+
var isSolidStore = (value) => typeof value === "object" && value !== null && $PROXY in value;
|
|
135
|
+
var ROWS_PER_TRACKER = 300;
|
|
136
|
+
var LARGE_STORE_ROWS = 5e4;
|
|
137
|
+
var sameItems = (a, b) => {
|
|
138
|
+
if (a.length !== b.length) {
|
|
139
|
+
return false;
|
|
169
140
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
141
|
+
for (let index = 0; index < a.length; index += 1) {
|
|
142
|
+
if (a[index] !== b[index]) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
174
145
|
}
|
|
146
|
+
return true;
|
|
175
147
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const call = (fn, ...args) => {
|
|
191
|
-
if (handleCallDepth > 0 || gridUpdateDepth === 0 && getOwner() !== null) {
|
|
192
|
-
return fn(...args);
|
|
193
|
-
}
|
|
194
|
-
if (gridUpdateDepth > 0) {
|
|
195
|
-
queueMicrotask(() => {
|
|
196
|
-
if (owner && isDisposed(owner)) {
|
|
148
|
+
var createTracker = (owner, items, changed) => runWithOwner(
|
|
149
|
+
owner,
|
|
150
|
+
() => createRoot((dispose) => {
|
|
151
|
+
let first = true;
|
|
152
|
+
createEffect(
|
|
153
|
+
() => latest(() => {
|
|
154
|
+
for (const item of items) {
|
|
155
|
+
deep(item);
|
|
156
|
+
}
|
|
157
|
+
return {};
|
|
158
|
+
}),
|
|
159
|
+
outsideGraphApply(() => {
|
|
160
|
+
if (first) {
|
|
161
|
+
first = false;
|
|
197
162
|
return;
|
|
198
163
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
164
|
+
changed();
|
|
165
|
+
}),
|
|
166
|
+
{ name: "storeRowsTracker" }
|
|
167
|
+
);
|
|
168
|
+
return { items, dispose };
|
|
169
|
+
})
|
|
170
|
+
);
|
|
171
|
+
function createPlainRows(read) {
|
|
172
|
+
const owner = getOwner();
|
|
173
|
+
let trackers = [];
|
|
174
|
+
let warnedLarge = false;
|
|
175
|
+
let watched = null;
|
|
176
|
+
const [contents, setContents] = createSignal(0, { name: "storeRowsContents" });
|
|
177
|
+
const changed = () => {
|
|
178
|
+
setContents((count) => count + 1);
|
|
179
|
+
};
|
|
180
|
+
const disposeAll = () => {
|
|
181
|
+
for (const tracker of trackers) {
|
|
182
|
+
tracker.dispose();
|
|
204
183
|
}
|
|
205
|
-
|
|
184
|
+
trackers = [];
|
|
206
185
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
186
|
+
onCleanup(disposeAll);
|
|
187
|
+
const track = (rows) => {
|
|
188
|
+
const next = [];
|
|
189
|
+
const kept = /* @__PURE__ */ new Set();
|
|
190
|
+
untrack(
|
|
191
|
+
() => latest(() => {
|
|
192
|
+
const length = rows.length;
|
|
193
|
+
if (process.env.NODE_ENV !== "production" && !warnedLarge && length > LARGE_STORE_ROWS) {
|
|
194
|
+
warnedLarge = true;
|
|
195
|
+
console.warn(
|
|
196
|
+
`[SpreadsheetGrid] rows \u306B ${LARGE_STORE_ROWS.toLocaleString("en-US")} \u884C\u3092\u8D85\u3048\u308B Solid \u306E store(createStore)\u3092\u6E21\u3057\u3066\u3044\u307E\u3059\u3002store \u306E\u4E2D\u3092\u76F4\u63A5\u5909\u3048\u305F\u3053\u3068\u306B\u6C17\u3065\u304F\u305F\u3081\u884C\u3054\u3068\u306B\u8FFD\u3046\u306E\u3067\u3001\u884C\u304C\u591A\u3044\u3068\u7DE8\u96C6\u306E\u305F\u3073\u306B\u6642\u9593\u304C\u304B\u304B\u308A\u307E\u3059(10 \u4E07\u884C\u3067 1 \u56DE 0.1 \u79D2\u307B\u3069)\u3002\u591A\u3044\u884C\u306F createSignal \u3067\u6301\u3061\u3001\u53D7\u3051\u53D6\u3063\u305F\u914D\u5217\u3092\u305D\u306E\u307E\u307E set \u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
197
|
+
[SpreadsheetGrid] rows is a Solid store (createStore) with more than ${LARGE_STORE_ROWS.toLocaleString("en-US")} rows. The grid tracks each row to notice changes made inside the store, so every edit takes longer with many rows (about 0.1s per edit with 100,000 rows). Keep many rows in a createSignal and set the array you receive as is.`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
for (let start = 0, chunk = 0; start < length; start += ROWS_PER_TRACKER, chunk += 1) {
|
|
201
|
+
const items = [];
|
|
202
|
+
const end = Math.min(start + ROWS_PER_TRACKER, length);
|
|
203
|
+
for (let index = start; index < end; index += 1) {
|
|
204
|
+
items.push(rows[index]);
|
|
205
|
+
}
|
|
206
|
+
const previous = trackers[chunk];
|
|
207
|
+
if (previous !== void 0 && !kept.has(previous) && sameItems(previous.items, items)) {
|
|
208
|
+
kept.add(previous);
|
|
209
|
+
next.push(previous);
|
|
210
|
+
} else {
|
|
211
|
+
next.push(createTracker(owner, items, changed));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
);
|
|
216
|
+
for (const tracker of trackers) {
|
|
217
|
+
if (!kept.has(tracker)) {
|
|
218
|
+
tracker.dispose();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
trackers = next;
|
|
210
222
|
};
|
|
223
|
+
createEffect(
|
|
224
|
+
() => latest(() => {
|
|
225
|
+
const value = read();
|
|
226
|
+
if (!isSolidStore(value)) {
|
|
227
|
+
return { rows: null };
|
|
228
|
+
}
|
|
229
|
+
const rows = value;
|
|
230
|
+
void rows[$TRACK];
|
|
231
|
+
return { rows };
|
|
232
|
+
}),
|
|
233
|
+
outsideGraphApply(({ rows }) => {
|
|
234
|
+
if (rows === null) {
|
|
235
|
+
watched = null;
|
|
236
|
+
disposeAll();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const sameStore = rows === watched;
|
|
240
|
+
watched = rows;
|
|
241
|
+
track(rows);
|
|
242
|
+
if (sameStore) {
|
|
243
|
+
changed();
|
|
244
|
+
}
|
|
245
|
+
}),
|
|
246
|
+
{ name: "storeRowsStructure" }
|
|
247
|
+
);
|
|
248
|
+
return createMemo(
|
|
249
|
+
() => {
|
|
250
|
+
const value = read();
|
|
251
|
+
if (!isSolidStore(value)) {
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
254
|
+
contents();
|
|
255
|
+
return untrack(() => latest(() => snapshot(value)));
|
|
256
|
+
},
|
|
257
|
+
{ name: "storeRows" }
|
|
258
|
+
);
|
|
211
259
|
}
|
|
212
260
|
|
|
213
261
|
// src/primitives/gridStoreSignals.ts
|
|
214
|
-
import { createSignal } from "solid-js";
|
|
262
|
+
import { createSignal as createSignal2 } from "solid-js";
|
|
215
263
|
function createGridStoreSignals(store) {
|
|
216
|
-
const [state, setState] =
|
|
217
|
-
const [view, setView] =
|
|
264
|
+
const [state, setState] = createSignal2(store.getState());
|
|
265
|
+
const [view, setView] = createSignal2(store.getViewState());
|
|
218
266
|
onGridMounted(() => {
|
|
219
267
|
const sync = () => {
|
|
220
268
|
setState(() => store.getState());
|
|
@@ -226,18 +274,6 @@ function createGridStoreSignals(store) {
|
|
|
226
274
|
return { state, view };
|
|
227
275
|
}
|
|
228
276
|
|
|
229
|
-
// src/primitives/externalStore.ts
|
|
230
|
-
import { createSignal as createSignal2, isHydrating } from "solid-js";
|
|
231
|
-
function createExternalStoreSignal(store, name) {
|
|
232
|
-
const initial = isHydrating() && store.getServerSnapshot ? store.getServerSnapshot() : store.getSnapshot();
|
|
233
|
-
const [value, setValue] = createSignal2(initial, name === void 0 ? void 0 : { name });
|
|
234
|
-
onGridMounted(() => {
|
|
235
|
-
setValue(() => store.getSnapshot());
|
|
236
|
-
return store.subscribe(() => setValue(() => store.getSnapshot()));
|
|
237
|
-
});
|
|
238
|
-
return value;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
277
|
// src/primitives/viewSetters.ts
|
|
242
278
|
import {
|
|
243
279
|
resolveUpdater
|
|
@@ -262,54 +298,12 @@ function createGridViewSetters(store) {
|
|
|
262
298
|
};
|
|
263
299
|
}
|
|
264
300
|
|
|
265
|
-
// src/primitives/controller.ts
|
|
266
|
-
import { createEffect, createRenderEffect, createSignal as createSignal3, untrack } from "solid-js";
|
|
267
|
-
function connectController(controller, args, timing = "render", name) {
|
|
268
|
-
let mounted = false;
|
|
269
|
-
let latest2 = null;
|
|
270
|
-
const [replay, setReplay] = createSignal3(0, name === void 0 ? void 0 : { name: `${name}Replay` });
|
|
271
|
-
const requestReplay = () => {
|
|
272
|
-
setReplay((value) => value + 1);
|
|
273
|
-
};
|
|
274
|
-
const run = (value) => {
|
|
275
|
-
runGridUpdate(() => untrack(() => controller.update(value)));
|
|
276
|
-
};
|
|
277
|
-
const apply = (next) => {
|
|
278
|
-
latest2 = { value: next };
|
|
279
|
-
if (!mounted) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (isIsolatingFlush()) {
|
|
283
|
-
deferControllerUpdate(requestReplay);
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
run(next);
|
|
287
|
-
};
|
|
288
|
-
const compute = () => {
|
|
289
|
-
replay();
|
|
290
|
-
return args();
|
|
291
|
-
};
|
|
292
|
-
const options = name === void 0 ? void 0 : { name };
|
|
293
|
-
if (timing === "render") {
|
|
294
|
-
createRenderEffect(compute, apply, options);
|
|
295
|
-
} else {
|
|
296
|
-
createEffect(compute, apply, options);
|
|
297
|
-
}
|
|
298
|
-
onGridMounted(() => {
|
|
299
|
-
mounted = true;
|
|
300
|
-
if (latest2) {
|
|
301
|
-
run(latest2.value);
|
|
302
|
-
}
|
|
303
|
-
return () => controller.dispose?.();
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
301
|
// src/primitives/liveObject.ts
|
|
308
|
-
import { createMemo } from "solid-js";
|
|
302
|
+
import { createMemo as createMemo2 } from "solid-js";
|
|
309
303
|
function createLiveObject(keys, read) {
|
|
310
304
|
const live = {};
|
|
311
305
|
for (const key of keys) {
|
|
312
|
-
const value =
|
|
306
|
+
const value = createMemo2(() => read()[key], { lazy: true });
|
|
313
307
|
Object.defineProperty(live, key, {
|
|
314
308
|
enumerable: true,
|
|
315
309
|
get: value
|
|
@@ -318,8 +312,50 @@ function createLiveObject(keys, read) {
|
|
|
318
312
|
return live;
|
|
319
313
|
}
|
|
320
314
|
|
|
315
|
+
// src/primitives/serverSnapshot.ts
|
|
316
|
+
var SERVER_FRAME_ATTRIBUTE = "data-ssg-ssr";
|
|
317
|
+
var SERVER_SNAPSHOT_ATTRIBUTE = "data-ssg-ssr-snapshot";
|
|
318
|
+
var NOOP = () => {
|
|
319
|
+
};
|
|
320
|
+
var isCallbackKey = (key) => typeof key === "string" && /^on[A-Z]/.test(key);
|
|
321
|
+
function createSnapshotProps(props) {
|
|
322
|
+
const read = (key) => {
|
|
323
|
+
if (key === "ref") {
|
|
324
|
+
return void 0;
|
|
325
|
+
}
|
|
326
|
+
const value = Reflect.get(props, key);
|
|
327
|
+
return isCallbackKey(key) && typeof value === "function" ? NOOP : value;
|
|
328
|
+
};
|
|
329
|
+
return new Proxy({}, {
|
|
330
|
+
get: (_target, key) => read(key),
|
|
331
|
+
has: (_target, key) => Reflect.has(props, key),
|
|
332
|
+
ownKeys: () => Reflect.ownKeys(props),
|
|
333
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
334
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(props, key);
|
|
335
|
+
return descriptor ? { configurable: true, enumerable: descriptor.enumerable ?? true, writable: false, value: read(key) } : void 0;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function revealServerFrame(root, display) {
|
|
340
|
+
if (!root?.hasAttribute(SERVER_FRAME_ATTRIBUTE)) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const snapshot2 = root.nextElementSibling;
|
|
344
|
+
if (snapshot2?.hasAttribute(SERVER_SNAPSHOT_ATTRIBUTE)) {
|
|
345
|
+
snapshot2.remove();
|
|
346
|
+
}
|
|
347
|
+
root.removeAttribute(SERVER_FRAME_ATTRIBUTE);
|
|
348
|
+
root.removeAttribute("hidden");
|
|
349
|
+
const style = root.style;
|
|
350
|
+
if (display === void 0 || display === "") {
|
|
351
|
+
style.removeProperty("display");
|
|
352
|
+
} else {
|
|
353
|
+
style.setProperty("display", display);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
321
357
|
// src/view/GridHeaderRow.tsx
|
|
322
|
-
import { For, Show, createMemo as
|
|
358
|
+
import { For, Show, createMemo as createMemo3 } from "solid-js";
|
|
323
359
|
import { isActiveColumnFilterValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
324
360
|
import {
|
|
325
361
|
DETAIL_TOGGLE_COLUMN_KEY,
|
|
@@ -327,7 +363,7 @@ import {
|
|
|
327
363
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
328
364
|
import { ROW_DRAG_HANDLE_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowReorder";
|
|
329
365
|
import { formatLocaleText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
330
|
-
import { isFromRenderHeaderControl } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
366
|
+
import { isFromRenderHeaderControl, syncRenderHeaderControlHover } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
331
367
|
|
|
332
368
|
// src/view/RowSelectionCheckbox.tsx
|
|
333
369
|
function RowSelectionCheckbox(props) {
|
|
@@ -395,9 +431,9 @@ function GridHeaderRow(props) {
|
|
|
395
431
|
</Show>
|
|
396
432
|
<For each={props.entries} keyed={(entry) => entry.column.key}>
|
|
397
433
|
{(entry) => {
|
|
398
|
-
const column =
|
|
399
|
-
const colIndex =
|
|
400
|
-
const size =
|
|
434
|
+
const column = createMemo3(() => entry().column);
|
|
435
|
+
const colIndex = createMemo3(() => entry().logicalIndex);
|
|
436
|
+
const size = createMemo3(() => entry().paneLocalSize);
|
|
401
437
|
const isFiltered = () => isActiveColumnFilterValue(props.columnFilterValues[column().key]);
|
|
402
438
|
const isColumnSelected = () => props.selection.kind === "col" && colIndex() >= props.selection.startCol && colIndex() <= props.selection.endCol;
|
|
403
439
|
const sortIndex = () => props.sort.findIndex((item) => item.columnKey === column().key);
|
|
@@ -434,7 +470,13 @@ function GridHeaderRow(props) {
|
|
|
434
470
|
props.onColumnHeaderPointerDown(colIndex(), event);
|
|
435
471
|
}}
|
|
436
472
|
onPointerEnter={(event) => props.onColumnHeaderPointerEnter(colIndex(), event)}
|
|
437
|
-
|
|
473
|
+
onPointerMove={(event) => {
|
|
474
|
+
if (column().renderHeader) syncRenderHeaderControlHover(event.currentTarget, event);
|
|
475
|
+
}}
|
|
476
|
+
onPointerLeave={(event) => {
|
|
477
|
+
if (column().renderHeader) syncRenderHeaderControlHover(event.currentTarget, null);
|
|
478
|
+
props.onColumnHeaderPointerLeave(colIndex());
|
|
479
|
+
}}
|
|
438
480
|
onContextMenu={(event) => {
|
|
439
481
|
if (isSynthetic()) {
|
|
440
482
|
event.preventDefault();
|
|
@@ -468,7 +510,12 @@ function GridHeaderRow(props) {
|
|
|
468
510
|
]}
|
|
469
511
|
data-ssg-tooltip={column().renderHeader || isDetailToggleColumn() ? void 0 : column().title || column().key}
|
|
470
512
|
>
|
|
471
|
-
{column().renderHeader ? column().renderHeader?.(headerContext) : isDetailToggleColumn() ?
|
|
513
|
+
{column().renderHeader ? column().renderHeader?.(headerContext) : isDetailToggleColumn() ? (
|
|
514
|
+
// 見た目は空のまま、読み上げの名前だけ置く(下部バーの番地と同じ「詳細」/「移動」。1.3.0 / S6-03)。
|
|
515
|
+
<span class="ssg-visually-hidden">
|
|
516
|
+
{column().key === DETAIL_TOGGLE_COLUMN_KEY ? texts().detailColumnName : texts().rowDragColumnName}
|
|
517
|
+
</span>
|
|
518
|
+
) : column().title || column().key}
|
|
472
519
|
</div>
|
|
473
520
|
<div class="ssg-header-status">
|
|
474
521
|
<Show when={sortEntry()}>
|
|
@@ -549,7 +596,7 @@ function GridHeaderRow(props) {
|
|
|
549
596
|
}
|
|
550
597
|
|
|
551
598
|
// src/view/GridBodyLayer.tsx
|
|
552
|
-
import { For as For2, Show as Show2, createMemo as
|
|
599
|
+
import { For as For2, Show as Show2, createMemo as createMemo5, untrack as untrack3 } from "solid-js";
|
|
553
600
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
554
601
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
555
602
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -560,11 +607,11 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
560
607
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
561
608
|
|
|
562
609
|
// src/primitives/memoWhen.ts
|
|
563
|
-
import { createMemo as
|
|
610
|
+
import { createMemo as createMemo4, getOwner as getOwner2, isDisposed, runWithOwner as runWithOwner2, untrack as untrack2 } from "solid-js";
|
|
564
611
|
function createMemoWhen(needed, compute, empty) {
|
|
565
612
|
const guarded = () => needed() ? compute() : empty;
|
|
566
613
|
if (untrack2(needed)) {
|
|
567
|
-
return
|
|
614
|
+
return createMemo4(guarded);
|
|
568
615
|
}
|
|
569
616
|
const owner = getOwner2();
|
|
570
617
|
let memo;
|
|
@@ -575,10 +622,10 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
575
622
|
if (!needed()) {
|
|
576
623
|
return empty;
|
|
577
624
|
}
|
|
578
|
-
if (!owner ||
|
|
625
|
+
if (!owner || isDisposed(owner)) {
|
|
579
626
|
return compute();
|
|
580
627
|
}
|
|
581
|
-
memo =
|
|
628
|
+
memo = runWithOwner2(owner, () => createMemo4(guarded));
|
|
582
629
|
return memo();
|
|
583
630
|
};
|
|
584
631
|
}
|
|
@@ -592,12 +639,24 @@ var markClickTarget = (element) => {
|
|
|
592
639
|
|
|
593
640
|
// src/view/GridBodyLayer.tsx
|
|
594
641
|
var NO_SELECTED_COLUMNS = [-1, -1];
|
|
642
|
+
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
643
|
+
var joinClasses = (...parts) => {
|
|
644
|
+
let out = "";
|
|
645
|
+
for (const part of parts) {
|
|
646
|
+
if (part) {
|
|
647
|
+
out = out ? `${out} ${part}` : part;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return out;
|
|
651
|
+
};
|
|
652
|
+
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
653
|
+
var cellKey = (entry) => isPlainCellColumn(entry.column) ? entry.column.key : `${entry.column.key}\0decorated`;
|
|
595
654
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
596
655
|
function GridBodyLayer(props) {
|
|
597
656
|
const texts = useGridLocaleText();
|
|
598
657
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
599
658
|
{(item) => {
|
|
600
|
-
const rowIndex =
|
|
659
|
+
const rowIndex = createMemo5(() => item().index);
|
|
601
660
|
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
602
661
|
if (SkeletonRow) {
|
|
603
662
|
return <SkeletonRow
|
|
@@ -621,8 +680,8 @@ function GridBodyLayer(props) {
|
|
|
621
680
|
/>;
|
|
622
681
|
}
|
|
623
682
|
const row = () => props.rowModel.getRow(rowIndex());
|
|
624
|
-
const groupRow =
|
|
625
|
-
const labelRow =
|
|
683
|
+
const groupRow = createMemo5(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
684
|
+
const labelRow = createMemo5(
|
|
626
685
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
627
686
|
);
|
|
628
687
|
return <>
|
|
@@ -656,8 +715,8 @@ function GridBodyLayer(props) {
|
|
|
656
715
|
{(label) => {
|
|
657
716
|
const layer = () => props.labelRowLayer;
|
|
658
717
|
const LabelRow = untrack3(layer)?.Row;
|
|
659
|
-
const labelSlot =
|
|
660
|
-
const labelRowKey =
|
|
718
|
+
const labelSlot = createMemo5(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
719
|
+
const labelRowKey = createMemo5(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
661
720
|
return LabelRow ? <LabelRow
|
|
662
721
|
pane={props.pane}
|
|
663
722
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -681,14 +740,14 @@ function GridBodyLayer(props) {
|
|
|
681
740
|
{(currentRow) => {
|
|
682
741
|
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
683
742
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
684
|
-
const rowSize =
|
|
685
|
-
const isRowChecked =
|
|
743
|
+
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
744
|
+
const isRowChecked = createMemo5(
|
|
686
745
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
687
746
|
);
|
|
688
|
-
const isRowSelected =
|
|
747
|
+
const isRowSelected = createMemo5(
|
|
689
748
|
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
690
749
|
);
|
|
691
|
-
const selectedColRange =
|
|
750
|
+
const selectedColRange = createMemo5(() => {
|
|
692
751
|
const selection = props.selection;
|
|
693
752
|
if (selection.kind === "col") {
|
|
694
753
|
return [selection.startCol, selection.endCol];
|
|
@@ -700,9 +759,9 @@ function GridBodyLayer(props) {
|
|
|
700
759
|
});
|
|
701
760
|
const selectedColStart = () => selectedColRange()[0];
|
|
702
761
|
const selectedColEnd = () => selectedColRange()[1];
|
|
703
|
-
const activeCol =
|
|
704
|
-
const rowFindHits =
|
|
705
|
-
const rowFindCurrent =
|
|
762
|
+
const activeCol = createMemo5(() => props.activeCell?.row === rowIndex() ? props.activeCell.col : -1);
|
|
763
|
+
const rowFindHits = createMemo5(() => props.findIndex.get(rowIndex()));
|
|
764
|
+
const rowFindCurrent = createMemo5(() => {
|
|
706
765
|
const hits = rowFindHits();
|
|
707
766
|
const current = hits ? props.findCurrentIndex : null;
|
|
708
767
|
if (!hits || current === null) {
|
|
@@ -715,10 +774,10 @@ function GridBodyLayer(props) {
|
|
|
715
774
|
}
|
|
716
775
|
return null;
|
|
717
776
|
});
|
|
718
|
-
const editingCol =
|
|
719
|
-
const rowAutoHeight =
|
|
720
|
-
const isHovered =
|
|
721
|
-
const rowSlot =
|
|
777
|
+
const editingCol = createMemo5(() => props.editingCell?.row === rowIndex() ? props.editingCell.col : -1);
|
|
778
|
+
const rowAutoHeight = createMemo5(() => !!props.autoHeight);
|
|
779
|
+
const isHovered = createMemo5(() => props.hoveredRowIndex === rowIndex());
|
|
780
|
+
const rowSlot = createMemo5(
|
|
722
781
|
() => resolveSlotProps(
|
|
723
782
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
724
783
|
row: currentRow(),
|
|
@@ -737,12 +796,12 @@ function GridBodyLayer(props) {
|
|
|
737
796
|
aria-rowindex={rowIndex() + 2 + props.ariaRowOffset}
|
|
738
797
|
aria-selected={props.enableRowSelection ? isRowChecked() ? "true" : "false" : void 0}
|
|
739
798
|
data-row-key={String(rowKey())}
|
|
740
|
-
class={
|
|
799
|
+
class={joinClasses(
|
|
741
800
|
"ssg-body-row",
|
|
742
801
|
rowSlot().className,
|
|
743
802
|
props.slots.bodyRow?.className,
|
|
744
|
-
|
|
745
|
-
|
|
803
|
+
isRowChecked() && "ssg-body-row--checked"
|
|
804
|
+
)}
|
|
746
805
|
style={{
|
|
747
806
|
...props.slots.bodyRow?.style,
|
|
748
807
|
...rowSlot().style,
|
|
@@ -757,17 +816,14 @@ function GridBodyLayer(props) {
|
|
|
757
816
|
onPointerDown={(event) => props.onRowHeaderPointerDown(rowIndex(), event)}
|
|
758
817
|
onPointerEnter={(event) => props.onRowHeaderPointerEnter(rowIndex(), event)}
|
|
759
818
|
onPointerLeave={() => props.onRowHeaderPointerLeave(rowIndex())}
|
|
760
|
-
class={
|
|
761
|
-
"ssg-header-cell",
|
|
762
|
-
"ssg-row-header-cell",
|
|
819
|
+
class={joinClasses(
|
|
820
|
+
"ssg-header-cell ssg-row-header-cell",
|
|
763
821
|
rowSlot().className,
|
|
764
822
|
props.slots.rowHeaderCell?.className,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
]}
|
|
823
|
+
props.enableRowSelection && "ssg-row-header-cell--checkbox",
|
|
824
|
+
(props.isWholeGridSelected || isRowSelected()) && "ssg-header-cell--selected",
|
|
825
|
+
isHovered() && "ssg-header-cell--hovered"
|
|
826
|
+
)}
|
|
771
827
|
style={{
|
|
772
828
|
...props.slots.rowHeaderCell?.style,
|
|
773
829
|
...rowSlot().style,
|
|
@@ -785,24 +841,23 @@ function GridBodyLayer(props) {
|
|
|
785
841
|
</Show2>
|
|
786
842
|
</div>
|
|
787
843
|
</Show2>
|
|
788
|
-
<For2 each={props.entries} keyed={
|
|
844
|
+
<For2 each={props.entries} keyed={cellKey}>
|
|
789
845
|
{(entry) => {
|
|
790
|
-
const
|
|
846
|
+
const plain = untrack3(() => isPlainCellColumn(entry().column));
|
|
847
|
+
const unbound = createMemo5(() => entry().column);
|
|
791
848
|
const column = () => unbound();
|
|
792
|
-
const colIndex =
|
|
849
|
+
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
793
850
|
const size = () => entry().paneLocalSize;
|
|
794
851
|
const isActive = () => activeCol() === colIndex();
|
|
795
852
|
const isEditing = () => editingCol() === colIndex();
|
|
796
853
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
797
|
-
const readOnlyCell =
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
props.canEditCell ? { sourceRowIndex: sourceRowIndex(), rowKey: rowKey() } : void 0
|
|
805
|
-
)
|
|
854
|
+
const readOnlyCell = () => !isCellEditable(
|
|
855
|
+
{ readOnly: props.readOnly, canEditCell: props.canEditCell },
|
|
856
|
+
rowIndex(),
|
|
857
|
+
colIndex(),
|
|
858
|
+
currentRow(),
|
|
859
|
+
unbound(),
|
|
860
|
+
props.canEditCell ? { sourceRowIndex: sourceRowIndex(), rowKey: rowKey() } : void 0
|
|
806
861
|
);
|
|
807
862
|
const value = () => getCellValue(currentRow(), unbound());
|
|
808
863
|
const findRanges = createMemoWhen(
|
|
@@ -842,7 +897,7 @@ function GridBodyLayer(props) {
|
|
|
842
897
|
}
|
|
843
898
|
};
|
|
844
899
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
845
|
-
const styleContext = createMemoWhen(
|
|
900
|
+
const styleContext = plain ? () => null : createMemoWhen(
|
|
846
901
|
needsStyleContext,
|
|
847
902
|
() => ({
|
|
848
903
|
row: currentRow(),
|
|
@@ -859,7 +914,7 @@ function GridBodyLayer(props) {
|
|
|
859
914
|
}),
|
|
860
915
|
null
|
|
861
916
|
);
|
|
862
|
-
const conditionalCell = createMemoWhen(
|
|
917
|
+
const conditionalCell = plain ? () => EMPTY_SLOT : createMemoWhen(
|
|
863
918
|
() => column().cellClassName !== void 0,
|
|
864
919
|
() => {
|
|
865
920
|
const cellClassName = column().cellClassName;
|
|
@@ -871,7 +926,7 @@ function GridBodyLayer(props) {
|
|
|
871
926
|
resolveSlotProps(void 0)
|
|
872
927
|
);
|
|
873
928
|
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
874
|
-
const dataBar = createMemoWhen(
|
|
929
|
+
const dataBar = plain ? () => null : createMemoWhen(
|
|
875
930
|
() => formatRules()?.dataBar !== void 0,
|
|
876
931
|
() => {
|
|
877
932
|
const feature = props.conditionalFormat;
|
|
@@ -880,7 +935,7 @@ function GridBodyLayer(props) {
|
|
|
880
935
|
},
|
|
881
936
|
null
|
|
882
937
|
);
|
|
883
|
-
const scaleBackground = createMemoWhen(
|
|
938
|
+
const scaleBackground = plain ? () => null : createMemoWhen(
|
|
884
939
|
() => formatRules()?.colorScale !== void 0,
|
|
885
940
|
() => {
|
|
886
941
|
const feature = props.conditionalFormat;
|
|
@@ -898,12 +953,12 @@ function GridBodyLayer(props) {
|
|
|
898
953
|
const rules = formatRules()?.dataBar;
|
|
899
954
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
900
955
|
};
|
|
901
|
-
const invalidMessage = createMemoWhen(
|
|
956
|
+
const invalidMessage = plain ? () => null : createMemoWhen(
|
|
902
957
|
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
903
958
|
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
904
959
|
null
|
|
905
960
|
);
|
|
906
|
-
const cellNote = createMemoWhen(
|
|
961
|
+
const cellNote = plain ? () => null : createMemoWhen(
|
|
907
962
|
() => !!column().cellNote,
|
|
908
963
|
() => {
|
|
909
964
|
const note = column().cellNote;
|
|
@@ -930,6 +985,27 @@ function GridBodyLayer(props) {
|
|
|
930
985
|
hasRenderCell: column().renderCell !== void 0
|
|
931
986
|
});
|
|
932
987
|
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
988
|
+
const cellChildren = plain ? () => props.renderCellContent(currentRow, column(), cellState) : () => <>
|
|
989
|
+
<Show2 when={dataBar()}>
|
|
990
|
+
{(bar) => <span
|
|
991
|
+
class={["ssg-cf-bar", { "ssg-cf-bar--negative": bar().negative }]}
|
|
992
|
+
style={{
|
|
993
|
+
left: `${bar().start}%`,
|
|
994
|
+
width: `${bar().end - bar().start}%`,
|
|
995
|
+
...dataBarColor() ? { "background-color": dataBarColor() } : null
|
|
996
|
+
}}
|
|
997
|
+
aria-hidden="true"
|
|
998
|
+
/>}
|
|
999
|
+
</Show2>
|
|
1000
|
+
<Show2
|
|
1001
|
+
when={isAutoHeightCell()}
|
|
1002
|
+
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
1003
|
+
>
|
|
1004
|
+
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
1005
|
+
{props.renderCellContent(currentRow, column(), cellState)}
|
|
1006
|
+
</div>
|
|
1007
|
+
</Show2>
|
|
1008
|
+
</>;
|
|
933
1009
|
return <div
|
|
934
1010
|
role="gridcell"
|
|
935
1011
|
aria-colindex={colIndex() + 2}
|
|
@@ -943,25 +1019,23 @@ function GridBodyLayer(props) {
|
|
|
943
1019
|
data-autoheight-cell={isAutoHeightCell() ? "" : void 0}
|
|
944
1020
|
data-ssg-tooltip={tooltipText() ?? void 0}
|
|
945
1021
|
data-ssg-tooltip-overflow={markOverflowTooltip() ? "" : void 0}
|
|
946
|
-
class={
|
|
1022
|
+
class={joinClasses(
|
|
947
1023
|
"ssg-body-cell",
|
|
948
1024
|
rowSlot().className,
|
|
949
1025
|
conditionalCell().className,
|
|
950
1026
|
props.slots.bodyCell?.className,
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
]}
|
|
1027
|
+
column().align === "center" && "ssg-body-cell--align-center",
|
|
1028
|
+
column().align === "right" && "ssg-body-cell--align-right",
|
|
1029
|
+
dataBar() !== null && "ssg-body-cell--cf-bar",
|
|
1030
|
+
scaleBackground() !== null && "ssg-body-cell--cf-scale",
|
|
1031
|
+
formatRules()?.chips !== void 0 && size() < CHIP_COMPACT_MAX_WIDTH && "ssg-body-cell--chip-compact",
|
|
1032
|
+
isAutoHeightCell() && "ssg-body-cell--autoheight",
|
|
1033
|
+
alignTop() && "ssg-body-cell--valign-top",
|
|
1034
|
+
readOnlyCell() && !isSelected() && "ssg-body-cell--readonly",
|
|
1035
|
+
invalidMessage() !== null && "ssg-body-cell--invalid",
|
|
1036
|
+
cellNote() !== null && "ssg-body-cell--has-note",
|
|
1037
|
+
isHovered() && "ssg-body-cell--row-hovered"
|
|
1038
|
+
)}
|
|
965
1039
|
onPointerDown={(event) => {
|
|
966
1040
|
if (event.target instanceof Element && event.target.closest(".ssg-detail-toggle")) {
|
|
967
1041
|
return;
|
|
@@ -986,25 +1060,7 @@ function GridBodyLayer(props) {
|
|
|
986
1060
|
"z-index": isActive() ? 3 : 1
|
|
987
1061
|
}}
|
|
988
1062
|
>
|
|
989
|
-
|
|
990
|
-
{(bar) => <span
|
|
991
|
-
class={["ssg-cf-bar", { "ssg-cf-bar--negative": bar().negative }]}
|
|
992
|
-
style={{
|
|
993
|
-
left: `${bar().start}%`,
|
|
994
|
-
width: `${bar().end - bar().start}%`,
|
|
995
|
-
...dataBarColor() ? { "background-color": dataBarColor() } : null
|
|
996
|
-
}}
|
|
997
|
-
aria-hidden="true"
|
|
998
|
-
/>}
|
|
999
|
-
</Show2>
|
|
1000
|
-
<Show2
|
|
1001
|
-
when={isAutoHeightCell()}
|
|
1002
|
-
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
1003
|
-
>
|
|
1004
|
-
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
1005
|
-
{props.renderCellContent(currentRow, column(), cellState)}
|
|
1006
|
-
</div>
|
|
1007
|
-
</Show2>
|
|
1063
|
+
{cellChildren()}
|
|
1008
1064
|
</div>;
|
|
1009
1065
|
}}
|
|
1010
1066
|
</For2>
|
|
@@ -1035,7 +1091,7 @@ function Overlay(props) {
|
|
|
1035
1091
|
}
|
|
1036
1092
|
|
|
1037
1093
|
// src/view/GridDetailLayer.tsx
|
|
1038
|
-
import { For as For3, Show as Show4, createMemo as
|
|
1094
|
+
import { For as For3, Show as Show4, createMemo as createMemo6, onCleanup as onCleanup2, untrack as untrack4 } from "solid-js";
|
|
1039
1095
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
1040
1096
|
var stopPropagation = (event) => {
|
|
1041
1097
|
event.stopPropagation();
|
|
@@ -1047,7 +1103,7 @@ var mergeSlotStyles = (...styles) => {
|
|
|
1047
1103
|
function GridDetailLayer(props) {
|
|
1048
1104
|
return <For3 each={props.entries} keyed={(entry) => entry.rowKey}>
|
|
1049
1105
|
{(entry) => {
|
|
1050
|
-
const index =
|
|
1106
|
+
const index = createMemo6(() => entry().virtualRow.index);
|
|
1051
1107
|
const detailSize = () => entry().virtualRow.detailSize ?? 0;
|
|
1052
1108
|
return <Show4 when={detailSize() > 0}>
|
|
1053
1109
|
<div
|
|
@@ -1075,8 +1131,8 @@ function GridDetailLayer(props) {
|
|
|
1075
1131
|
function DetailCard(props) {
|
|
1076
1132
|
const layer = props.layer;
|
|
1077
1133
|
const rowKey = untrack4(() => props.entry().rowKey);
|
|
1078
|
-
const row =
|
|
1079
|
-
const sourceRowIndex =
|
|
1134
|
+
const row = createMemo6(() => layer.rowModel.getRow(props.index()));
|
|
1135
|
+
const sourceRowIndex = createMemo6(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
1080
1136
|
const ctx = {
|
|
1081
1137
|
get row() {
|
|
1082
1138
|
return row();
|
|
@@ -1091,7 +1147,7 @@ function DetailCard(props) {
|
|
|
1091
1147
|
collapse: () => layer.onCollapse?.(rowKey, untrack4(props.index))
|
|
1092
1148
|
};
|
|
1093
1149
|
let card;
|
|
1094
|
-
|
|
1150
|
+
onCleanup2(() => notifyDetailCardFocusLost(card ?? null, layer.onCardFocusLost));
|
|
1095
1151
|
return <div
|
|
1096
1152
|
role="gridcell"
|
|
1097
1153
|
class="ssg-detail-card-holder"
|
|
@@ -1122,6 +1178,7 @@ function DetailCard(props) {
|
|
|
1122
1178
|
}
|
|
1123
1179
|
|
|
1124
1180
|
// src/view/DetailToggleButton.tsx
|
|
1181
|
+
import { formatLocaleText as formatLocaleText3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1125
1182
|
function DetailToggleButton(props) {
|
|
1126
1183
|
const texts = useGridLocaleText();
|
|
1127
1184
|
return <button
|
|
@@ -1129,7 +1186,9 @@ function DetailToggleButton(props) {
|
|
|
1129
1186
|
tabindex={-1}
|
|
1130
1187
|
class="ssg-detail-toggle"
|
|
1131
1188
|
aria-expanded={props.detail.expanded ? "true" : "false"}
|
|
1132
|
-
aria-label={props.detail.expanded ? texts().hideDetails : texts().showDetails
|
|
1189
|
+
aria-label={formatLocaleText3(props.detail.expanded ? texts().hideDetails : texts().showDetails, {
|
|
1190
|
+
row: props.rowNumber
|
|
1191
|
+
})}
|
|
1133
1192
|
onClick={() => props.detail.toggle()}
|
|
1134
1193
|
onPointerDown={(event) => {
|
|
1135
1194
|
if (event.button !== 0) {
|
|
@@ -1164,13 +1223,13 @@ function CheckboxCell(props) {
|
|
|
1164
1223
|
}
|
|
1165
1224
|
|
|
1166
1225
|
// src/editors/CellEditorLayer.tsx
|
|
1167
|
-
import { Show as Show8, createMemo as
|
|
1226
|
+
import { Show as Show8, createMemo as createMemo7, untrack as untrack11 } from "solid-js";
|
|
1168
1227
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1169
1228
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1170
|
-
import { formatLocaleText as
|
|
1229
|
+
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1171
1230
|
|
|
1172
1231
|
// src/editors/TextCellEditor.tsx
|
|
1173
|
-
import { Show as Show6, createRenderEffect as
|
|
1232
|
+
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1174
1233
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1175
1234
|
import {
|
|
1176
1235
|
fitMultilineEditor,
|
|
@@ -1180,7 +1239,7 @@ import {
|
|
|
1180
1239
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1181
1240
|
|
|
1182
1241
|
// src/primitives/topAlignedInput.ts
|
|
1183
|
-
import { createRenderEffect
|
|
1242
|
+
import { createRenderEffect, onSettled, untrack as untrack5 } from "solid-js";
|
|
1184
1243
|
import {
|
|
1185
1244
|
alignInputTextToTop,
|
|
1186
1245
|
resolveHiddenTopOf
|
|
@@ -1192,12 +1251,12 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1192
1251
|
}
|
|
1193
1252
|
};
|
|
1194
1253
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1195
|
-
|
|
1254
|
+
createRenderEffect(read, apply, { name: "topAlignedInput" });
|
|
1196
1255
|
onSettled(() => apply(untrack5(read)));
|
|
1197
1256
|
}
|
|
1198
1257
|
|
|
1199
1258
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1200
|
-
import { Show as Show5, createSignal as
|
|
1259
|
+
import { Show as Show5, createSignal as createSignal3, onSettled as onSettled2 } from "solid-js";
|
|
1201
1260
|
import {
|
|
1202
1261
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1203
1262
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1210,7 +1269,7 @@ function CellEditorError(props) {
|
|
|
1210
1269
|
}
|
|
1211
1270
|
function CellEditorErrorBubble(props) {
|
|
1212
1271
|
let element;
|
|
1213
|
-
const [placement2, setPlacement] =
|
|
1272
|
+
const [placement2, setPlacement] = createSignal3(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1214
1273
|
onSettled2(() => {
|
|
1215
1274
|
if (element) {
|
|
1216
1275
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1234,11 +1293,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1234
1293
|
|
|
1235
1294
|
// src/editors/TextCellEditor.tsx
|
|
1236
1295
|
function TextCellEditor(props) {
|
|
1237
|
-
const [input, setInput] =
|
|
1238
|
-
const [textarea, setTextarea] =
|
|
1239
|
-
const [error, setError] =
|
|
1296
|
+
const [input, setInput] = createSignal4();
|
|
1297
|
+
const [textarea, setTextarea] = createSignal4();
|
|
1298
|
+
const [error, setError] = createSignal4(null);
|
|
1240
1299
|
const initialValue = untrack6(() => props.initialValue);
|
|
1241
|
-
const [draft, setDraft] =
|
|
1300
|
+
const [draft, setDraft] = createSignal4(initialValue);
|
|
1242
1301
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1243
1302
|
const alignTop = () => props.alignTop ?? false;
|
|
1244
1303
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1259,7 +1318,7 @@ function TextCellEditor(props) {
|
|
|
1259
1318
|
element.setSelectionRange(caret, caret);
|
|
1260
1319
|
}
|
|
1261
1320
|
};
|
|
1262
|
-
|
|
1321
|
+
createRenderEffect2(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1263
1322
|
onSettled3(() => {
|
|
1264
1323
|
const element = untrack6(() => input() ?? textarea());
|
|
1265
1324
|
if (!element) {
|
|
@@ -1270,9 +1329,17 @@ function TextCellEditor(props) {
|
|
|
1270
1329
|
element.setSelectionRange(end, end);
|
|
1271
1330
|
});
|
|
1272
1331
|
let disposed = false;
|
|
1273
|
-
|
|
1332
|
+
onCleanup3(() => {
|
|
1274
1333
|
disposed = true;
|
|
1275
1334
|
});
|
|
1335
|
+
props.onRegisterFlush?.(() => {
|
|
1336
|
+
untrack6(() => {
|
|
1337
|
+
const element = input() ?? textarea();
|
|
1338
|
+
if (element) {
|
|
1339
|
+
props.onCommit(element.value);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1276
1343
|
const commitOnBlur = (value) => {
|
|
1277
1344
|
if (disposed) {
|
|
1278
1345
|
return;
|
|
@@ -1359,23 +1426,31 @@ function TextCellEditor(props) {
|
|
|
1359
1426
|
}
|
|
1360
1427
|
|
|
1361
1428
|
// src/editors/NumberCellEditor.tsx
|
|
1362
|
-
import { createSignal as
|
|
1429
|
+
import { createSignal as createSignal5, onCleanup as onCleanup4, onSettled as onSettled4, untrack as untrack7 } from "solid-js";
|
|
1363
1430
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1364
1431
|
import {
|
|
1365
1432
|
resolveNumberEditorCommitValue,
|
|
1366
1433
|
resolveNumberEditorStart
|
|
1367
1434
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1368
1435
|
function NumberCellEditor(props) {
|
|
1369
|
-
const [input, setInput] =
|
|
1370
|
-
const [error, setError] =
|
|
1436
|
+
const [input, setInput] = createSignal5();
|
|
1437
|
+
const [error, setError] = createSignal5(null);
|
|
1371
1438
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1372
1439
|
const start = resolveNumberEditorStart(untrack7(() => props.initialValue));
|
|
1373
1440
|
const textMode = start.textMode;
|
|
1374
1441
|
const startText = start.text;
|
|
1375
1442
|
let disposed = false;
|
|
1376
|
-
|
|
1443
|
+
onCleanup4(() => {
|
|
1377
1444
|
disposed = true;
|
|
1378
1445
|
});
|
|
1446
|
+
props.onRegisterFlush?.(() => {
|
|
1447
|
+
untrack7(() => {
|
|
1448
|
+
const element = input();
|
|
1449
|
+
if (element) {
|
|
1450
|
+
props.onCommit(resolveNumberEditorCommitValue(element.value, textMode));
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
});
|
|
1379
1454
|
onSettled4(() => {
|
|
1380
1455
|
const element = untrack7(input);
|
|
1381
1456
|
if (!element) {
|
|
@@ -1427,10 +1502,10 @@ import {
|
|
|
1427
1502
|
For as For4,
|
|
1428
1503
|
Show as Show7,
|
|
1429
1504
|
createEffect as createEffect2,
|
|
1430
|
-
createRenderEffect as
|
|
1431
|
-
createSignal as
|
|
1505
|
+
createRenderEffect as createRenderEffect3,
|
|
1506
|
+
createSignal as createSignal6,
|
|
1432
1507
|
createUniqueId,
|
|
1433
|
-
onCleanup as
|
|
1508
|
+
onCleanup as onCleanup5,
|
|
1434
1509
|
onSettled as onSettled5,
|
|
1435
1510
|
untrack as untrack8
|
|
1436
1511
|
} from "solid-js";
|
|
@@ -1448,22 +1523,22 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1448
1523
|
function SelectCellEditor(props) {
|
|
1449
1524
|
const texts = useGridLocaleText();
|
|
1450
1525
|
const portal = useGridPortal();
|
|
1451
|
-
const [input, setInput] =
|
|
1452
|
-
const [list, setList] =
|
|
1526
|
+
const [input, setInput] = createSignal6();
|
|
1527
|
+
const [list, setList] = createSignal6();
|
|
1453
1528
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1454
1529
|
const listId = createUniqueId();
|
|
1455
1530
|
const start = untrack8(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1456
1531
|
let typeahead = start.typeahead;
|
|
1457
|
-
const [highlight, setHighlight] =
|
|
1532
|
+
const [highlight, setHighlight] = createSignal6(start.highlight);
|
|
1458
1533
|
let currentHighlight = start.highlight;
|
|
1459
1534
|
const updateHighlight = (next) => {
|
|
1460
1535
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1461
1536
|
setHighlight(currentHighlight);
|
|
1462
1537
|
};
|
|
1463
|
-
const [placement2, setPlacement] =
|
|
1538
|
+
const [placement2, setPlacement] = createSignal6(null);
|
|
1464
1539
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1465
|
-
const [error, setError] =
|
|
1466
|
-
const [composing, setComposing] =
|
|
1540
|
+
const [error, setError] = createSignal6(null);
|
|
1541
|
+
const [composing, setComposing] = createSignal6(null);
|
|
1467
1542
|
let composingNow = null;
|
|
1468
1543
|
const updateComposing = (next) => {
|
|
1469
1544
|
composingNow = next;
|
|
@@ -1504,6 +1579,15 @@ function SelectCellEditor(props) {
|
|
|
1504
1579
|
},
|
|
1505
1580
|
{ name: "selectEditorOptionsRefocus" }
|
|
1506
1581
|
);
|
|
1582
|
+
createEffect2(
|
|
1583
|
+
() => `${props.cellTop ?? 0}:${props.cellLeft ?? 0}`,
|
|
1584
|
+
(position, previous) => {
|
|
1585
|
+
if (previous !== void 0 && previous !== position) {
|
|
1586
|
+
measure();
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
{ name: "selectEditorFollowCell" }
|
|
1590
|
+
);
|
|
1507
1591
|
const mount = () => placement2() !== null ? portal.container() : null;
|
|
1508
1592
|
createEffect2(
|
|
1509
1593
|
() => [highlight(), list()],
|
|
@@ -1557,7 +1641,7 @@ function SelectCellEditor(props) {
|
|
|
1557
1641
|
const shownText = () => highlightedOption()?.label ?? String(props.value ?? "");
|
|
1558
1642
|
const initialShownText = untrack8(shownText);
|
|
1559
1643
|
let disposed = false;
|
|
1560
|
-
|
|
1644
|
+
onCleanup5(() => {
|
|
1561
1645
|
disposed = true;
|
|
1562
1646
|
});
|
|
1563
1647
|
const view = <>
|
|
@@ -1649,7 +1733,7 @@ function SelectCellEditor(props) {
|
|
|
1649
1733
|
</Show7>
|
|
1650
1734
|
</>;
|
|
1651
1735
|
createPortalTokens(list, () => props.themeClassName, placement2);
|
|
1652
|
-
|
|
1736
|
+
createRenderEffect3(
|
|
1653
1737
|
() => [input(), composing() ?? shownText()],
|
|
1654
1738
|
([element, text]) => {
|
|
1655
1739
|
if (element && element.value !== text) {
|
|
@@ -1658,7 +1742,7 @@ function SelectCellEditor(props) {
|
|
|
1658
1742
|
},
|
|
1659
1743
|
{ name: "selectEditorInputText" }
|
|
1660
1744
|
);
|
|
1661
|
-
|
|
1745
|
+
createRenderEffect3(
|
|
1662
1746
|
() => [input(), shownText(), composing()],
|
|
1663
1747
|
([element, , composingText]) => {
|
|
1664
1748
|
if (!element || composingText !== null) {
|
|
@@ -1673,21 +1757,21 @@ function SelectCellEditor(props) {
|
|
|
1673
1757
|
}
|
|
1674
1758
|
|
|
1675
1759
|
// src/editors/DateCellEditor.tsx
|
|
1676
|
-
import { createSignal as
|
|
1760
|
+
import { createSignal as createSignal7, onCleanup as onCleanup6, onSettled as onSettled6, untrack as untrack9 } from "solid-js";
|
|
1677
1761
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1678
1762
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1679
1763
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1680
1764
|
function DateCellEditor(props) {
|
|
1681
1765
|
const texts = useGridLocaleText();
|
|
1682
|
-
const [input, setInput] =
|
|
1683
|
-
const [error, setError] =
|
|
1684
|
-
const [shift, setShift] =
|
|
1766
|
+
const [input, setInput] = createSignal7();
|
|
1767
|
+
const [error, setError] = createSignal7(null);
|
|
1768
|
+
const [shift, setShift] = createSignal7(0);
|
|
1685
1769
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1686
1770
|
const initialText = untrack9(() => props.initialText);
|
|
1687
1771
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
1688
1772
|
const startValue = textMode ? initialText ?? "" : untrack9(() => props.initialValue);
|
|
1689
1773
|
let disposed = false;
|
|
1690
|
-
|
|
1774
|
+
onCleanup6(() => {
|
|
1691
1775
|
disposed = true;
|
|
1692
1776
|
});
|
|
1693
1777
|
onSettled6(() => {
|
|
@@ -1709,6 +1793,14 @@ function DateCellEditor(props) {
|
|
|
1709
1793
|
const normalized = readTypedDateCommitValue(value);
|
|
1710
1794
|
return normalized === null ? { status: "rejected", message: texts().enterDate } : props.onCommit(normalized, direction);
|
|
1711
1795
|
};
|
|
1796
|
+
props.onRegisterFlush?.(() => {
|
|
1797
|
+
untrack9(() => {
|
|
1798
|
+
const element = input();
|
|
1799
|
+
if (element) {
|
|
1800
|
+
commitDraft(element.value);
|
|
1801
|
+
}
|
|
1802
|
+
});
|
|
1803
|
+
});
|
|
1712
1804
|
return <>
|
|
1713
1805
|
<input
|
|
1714
1806
|
ref={setInput}
|
|
@@ -1746,10 +1838,10 @@ function DateCellEditor(props) {
|
|
|
1746
1838
|
}
|
|
1747
1839
|
|
|
1748
1840
|
// src/editors/CustomCellEditor.tsx
|
|
1749
|
-
import { onCleanup as
|
|
1841
|
+
import { onCleanup as onCleanup7, untrack as untrack10 } from "solid-js";
|
|
1750
1842
|
function CustomCellEditor(props) {
|
|
1751
1843
|
let alive = true;
|
|
1752
|
-
|
|
1844
|
+
onCleanup7(() => {
|
|
1753
1845
|
alive = false;
|
|
1754
1846
|
});
|
|
1755
1847
|
const context = untrack10(() => props.context);
|
|
@@ -1767,16 +1859,16 @@ function CustomCellEditor(props) {
|
|
|
1767
1859
|
function CellEditorLayer(props) {
|
|
1768
1860
|
const texts = useGridLocaleText();
|
|
1769
1861
|
const editor = () => props.editor;
|
|
1770
|
-
const kind =
|
|
1862
|
+
const kind = createMemo7(() => {
|
|
1771
1863
|
const type = editor()?.type;
|
|
1772
1864
|
return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
|
|
1773
1865
|
});
|
|
1774
1866
|
const editLabel = () => {
|
|
1775
1867
|
const session = props.session;
|
|
1776
|
-
return session ?
|
|
1868
|
+
return session ? formatLocaleText4(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1777
1869
|
};
|
|
1778
1870
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1779
|
-
const selectOptions =
|
|
1871
|
+
const selectOptions = createMemo7(() => {
|
|
1780
1872
|
const current = editor();
|
|
1781
1873
|
if (current?.type !== "select") {
|
|
1782
1874
|
return [];
|
|
@@ -1788,8 +1880,8 @@ function CellEditorLayer(props) {
|
|
|
1788
1880
|
return row !== void 0 ? current.options(row) : [];
|
|
1789
1881
|
});
|
|
1790
1882
|
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1791
|
-
const session =
|
|
1792
|
-
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session : previous
|
|
1883
|
+
const session = createMemo7(
|
|
1884
|
+
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session ?? previous ?? null : previous
|
|
1793
1885
|
);
|
|
1794
1886
|
const context = {
|
|
1795
1887
|
get row() {
|
|
@@ -1821,7 +1913,9 @@ function CellEditorLayer(props) {
|
|
|
1821
1913
|
commit: (value, direction) => props.onCommit(value, direction) ?? { status: "noop" },
|
|
1822
1914
|
cancel: () => props.onCancel()
|
|
1823
1915
|
};
|
|
1824
|
-
return <
|
|
1916
|
+
return <Show8 when={session() !== null}>
|
|
1917
|
+
<CustomCellEditor render={render} context={context} />
|
|
1918
|
+
</Show8>;
|
|
1825
1919
|
};
|
|
1826
1920
|
const renderEditor = (type, sessionId) => {
|
|
1827
1921
|
const common = {
|
|
@@ -1841,9 +1935,13 @@ function CellEditorLayer(props) {
|
|
|
1841
1935
|
return props.alignTop;
|
|
1842
1936
|
},
|
|
1843
1937
|
onCommit: (value, direction) => props.onCommit(value, direction),
|
|
1844
|
-
onCancel: () => props.onCancel()
|
|
1938
|
+
onCancel: () => props.onCancel(),
|
|
1939
|
+
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
1845
1940
|
};
|
|
1846
1941
|
const initialValue = untrack11(props.initialValue);
|
|
1942
|
+
if (type === "select" || type === "custom") {
|
|
1943
|
+
props.onRegisterFlush?.(null);
|
|
1944
|
+
}
|
|
1847
1945
|
switch (type) {
|
|
1848
1946
|
case "number": {
|
|
1849
1947
|
const numberEditor = () => {
|
|
@@ -1874,6 +1972,8 @@ function CellEditorLayer(props) {
|
|
|
1874
1972
|
themeClassName={props.themeClassName}
|
|
1875
1973
|
options={selectOptions()}
|
|
1876
1974
|
value={props.session?.value}
|
|
1975
|
+
cellTop={props.rect?.top ?? 0}
|
|
1976
|
+
cellLeft={props.rect?.left ?? 0}
|
|
1877
1977
|
initialText={session ? resolveTypedStartText(initialValue, session.value) : void 0}
|
|
1878
1978
|
/>;
|
|
1879
1979
|
}
|
|
@@ -1882,7 +1982,7 @@ function CellEditorLayer(props) {
|
|
|
1882
1982
|
if (current?.type !== "custom") {
|
|
1883
1983
|
return null;
|
|
1884
1984
|
}
|
|
1885
|
-
return
|
|
1985
|
+
return renderCustomEditor(current.render, sessionId, initialValue);
|
|
1886
1986
|
}
|
|
1887
1987
|
default: {
|
|
1888
1988
|
const textEditor = () => {
|
|
@@ -1923,7 +2023,7 @@ function CellEditorLayer(props) {
|
|
|
1923
2023
|
}
|
|
1924
2024
|
|
|
1925
2025
|
// src/view/DefaultGridTopBar.tsx
|
|
1926
|
-
import { Show as Show9, createMemo as
|
|
2026
|
+
import { Show as Show9, createMemo as createMemo8, createRenderEffect as createRenderEffect4, createSignal as createSignal8, createUniqueId as createUniqueId2, untrack as untrack12 } from "solid-js";
|
|
1927
2027
|
var DefaultFilterIcon = () => <svg
|
|
1928
2028
|
width="14"
|
|
1929
2029
|
height="14"
|
|
@@ -1955,9 +2055,9 @@ function DefaultGridTopBar(props) {
|
|
|
1955
2055
|
const texts = useGridLocaleText();
|
|
1956
2056
|
const filterSummaryId = createUniqueId2();
|
|
1957
2057
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1958
|
-
const [input, setInput] =
|
|
2058
|
+
const [input, setInput] = createSignal8();
|
|
1959
2059
|
const initialText = untrack12(() => props.globalFilterText);
|
|
1960
|
-
|
|
2060
|
+
createRenderEffect4(
|
|
1961
2061
|
() => [input(), props.globalFilterText],
|
|
1962
2062
|
([element, text]) => {
|
|
1963
2063
|
if (element && element.value !== text) {
|
|
@@ -1967,7 +2067,7 @@ function DefaultGridTopBar(props) {
|
|
|
1967
2067
|
{ name: "globalFilterInput" }
|
|
1968
2068
|
);
|
|
1969
2069
|
const hasFilterText = () => props.globalFilterText.trim().length > 0;
|
|
1970
|
-
const filterIcon =
|
|
2070
|
+
const filterIcon = createMemo8(() => {
|
|
1971
2071
|
const icon = props.globalFilterIcon;
|
|
1972
2072
|
return icon === void 0 ? <DefaultFilterIcon /> : icon;
|
|
1973
2073
|
});
|
|
@@ -2043,7 +2143,7 @@ function DefaultGridTopBar(props) {
|
|
|
2043
2143
|
|
|
2044
2144
|
// src/view/DefaultGridBottomBar.tsx
|
|
2045
2145
|
import { Show as Show10 } from "solid-js";
|
|
2046
|
-
import { formatLocaleText as
|
|
2146
|
+
import { formatLocaleText as formatLocaleText5 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
2047
2147
|
function DefaultGridBottomBar(props) {
|
|
2048
2148
|
const texts = useGridLocaleText();
|
|
2049
2149
|
const aggregates = (trailing) => {
|
|
@@ -2061,10 +2161,10 @@ function DefaultGridBottomBar(props) {
|
|
|
2061
2161
|
</Show10>
|
|
2062
2162
|
<div class="ssg-bar-group">
|
|
2063
2163
|
<span class="ssg-bar-chip">
|
|
2064
|
-
{
|
|
2164
|
+
{formatLocaleText5(texts().activeCell, { cell: props.derivedSummary.activeCellLabel })}
|
|
2065
2165
|
</span>
|
|
2066
2166
|
<span class="ssg-bar-chip">
|
|
2067
|
-
{
|
|
2167
|
+
{formatLocaleText5(texts().selection, { range: props.derivedSummary.selectionLabel })}
|
|
2068
2168
|
</span>
|
|
2069
2169
|
<span class="ssg-bar-chip">{props.derivedSummary.selectionStatsText}</span>
|
|
2070
2170
|
<span class="ssg-bar-chip">{props.derivedSummary.selectedColumnsText}</span>
|
|
@@ -2075,7 +2175,7 @@ function DefaultGridBottomBar(props) {
|
|
|
2075
2175
|
}
|
|
2076
2176
|
|
|
2077
2177
|
// src/devWarnings.ts
|
|
2078
|
-
import {
|
|
2178
|
+
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
2079
2179
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
2080
2180
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2081
2181
|
import {
|
|
@@ -2086,7 +2186,7 @@ import {
|
|
|
2086
2186
|
var noop2 = () => {
|
|
2087
2187
|
};
|
|
2088
2188
|
var createChangeEffect = (compute, effect) => {
|
|
2089
|
-
createEffect3(
|
|
2189
|
+
createEffect3(createMemo9(compute), effect, { name: "devWarning" });
|
|
2090
2190
|
};
|
|
2091
2191
|
var FEATURE_PROPS = {
|
|
2092
2192
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2228,7 +2328,6 @@ var warnOncePerGrid = (warned, id, message) => {
|
|
|
2228
2328
|
warned.add(id);
|
|
2229
2329
|
console.warn(message);
|
|
2230
2330
|
};
|
|
2231
|
-
var isSolidStore = (value) => typeof value === "object" && value !== null && $PROXY in value;
|
|
2232
2331
|
function createShellDevWarningsInDev(args) {
|
|
2233
2332
|
createChangeEffect(
|
|
2234
2333
|
() => args.isServerSide() ? args.groupColumnCount() : 0,
|
|
@@ -2283,18 +2382,6 @@ function createShellDevWarningsInDev(args) {
|
|
|
2283
2382
|
}
|
|
2284
2383
|
}
|
|
2285
2384
|
);
|
|
2286
|
-
createChangeEffect(
|
|
2287
|
-
() => isSolidStore(args.rows()),
|
|
2288
|
-
(fromStore) => {
|
|
2289
|
-
if (fromStore) {
|
|
2290
|
-
warnOncePerGrid(
|
|
2291
|
-
warned,
|
|
2292
|
-
"rowsFromStore",
|
|
2293
|
-
"[SpreadsheetGrid] rows \u306B Solid \u306E store(createStore)\u3092\u6E21\u3057\u3066\u3044\u307E\u3059\u3002\u30B0\u30EA\u30C3\u30C9\u306F onRowsChange \u3067\u65B0\u3057\u3044\u914D\u5217\u3092\u8FD4\u3059\u306E\u3067\u3001store \u306B\u5165\u308C\u308B\u3068\u5143\u306B\u623B\u3059 / \u3084\u308A\u76F4\u3057\u306E\u5C65\u6B74\u304C\u6D88\u3048\u3001\u958B\u767A\u6642\u306B Solid \u306E\u77E5\u3089\u305B\u304C\u591A\u304F\u51FA\u307E\u3059\u3002\u884C\u306F createSignal \u3067\u6301\u3061\u3001\u53D7\u3051\u53D6\u3063\u305F\u914D\u5217\u3092\u305D\u306E\u307E\u307E set \u3057\u3066\u304F\u3060\u3055\u3044\u3002\n[SpreadsheetGrid] rows is a Solid store (createStore). The grid returns a new array from onRowsChange, so keeping it in a store loses the undo / redo history and makes Solid print many development diagnostics. Keep rows in a createSignal and set the array you receive as is."
|
|
2294
|
-
);
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
);
|
|
2298
2385
|
if (!args.filteringAvailable) {
|
|
2299
2386
|
createChangeEffect(
|
|
2300
2387
|
() => args.globalFilterText().trim() !== "" || args.columnFilterCount() > 0,
|
|
@@ -2337,14 +2424,12 @@ var EMPTY_ROWS = [];
|
|
|
2337
2424
|
var NEVER_EDITABLE = () => false;
|
|
2338
2425
|
var NO_COLUMNS = [];
|
|
2339
2426
|
var NO_COLUMN_FILTERS = {};
|
|
2340
|
-
var renderDetailToggleCell = (
|
|
2341
|
-
<DetailToggleButton detail={ctx.detail} />
|
|
2342
|
-
</Show11>;
|
|
2427
|
+
var renderDetailToggleCell = () => null;
|
|
2343
2428
|
var noop3 = () => {
|
|
2344
2429
|
};
|
|
2345
2430
|
var applyHandleRef = (ref, handle) => {
|
|
2346
2431
|
if (typeof ref === "function") {
|
|
2347
|
-
ref(handle);
|
|
2432
|
+
runWithOwner3(null, () => untrack13(() => ref(handle)));
|
|
2348
2433
|
} else if (Array.isArray(ref)) {
|
|
2349
2434
|
for (const item of ref) applyHandleRef(item, handle);
|
|
2350
2435
|
}
|
|
@@ -2375,23 +2460,49 @@ var SLOT_CONTEXT_KEYS = Object.keys({
|
|
|
2375
2460
|
globalFilterProgress: true,
|
|
2376
2461
|
selectionAggregates: true
|
|
2377
2462
|
});
|
|
2463
|
+
var DERIVED_SUMMARY_KEYS = Object.keys({
|
|
2464
|
+
rowSummaryText: true,
|
|
2465
|
+
columnSummaryText: true,
|
|
2466
|
+
filterSummaryText: true,
|
|
2467
|
+
sortSummaryText: true,
|
|
2468
|
+
activeCellLabel: true,
|
|
2469
|
+
selectionLabel: true,
|
|
2470
|
+
selectionStatsText: true,
|
|
2471
|
+
selectedColumnsText: true,
|
|
2472
|
+
selectionStats: true,
|
|
2473
|
+
hasGlobalFilter: true,
|
|
2474
|
+
globalFilterPreview: true,
|
|
2475
|
+
activeColumnFilterCount: true,
|
|
2476
|
+
hasAnyFilter: true,
|
|
2477
|
+
hasSorting: true,
|
|
2478
|
+
sortedColumnLabel: true
|
|
2479
|
+
});
|
|
2378
2480
|
function GridShell(props, features) {
|
|
2481
|
+
const serverSnapshot = isServer && untrack13(() => props.dataSource == null);
|
|
2379
2482
|
const mountGate = createMountGate();
|
|
2380
|
-
|
|
2483
|
+
const frame = runInMountGate(mountGate, () => GridShellBody(props, features, mountGate, serverSnapshot ? "hiddenFrame" : "normal"));
|
|
2484
|
+
const snapshot2 = <NoHydration>
|
|
2485
|
+
{serverSnapshot ? (() => {
|
|
2486
|
+
const snapshotGate = createMountGate();
|
|
2487
|
+
return runInMountGate(snapshotGate, () => GridShellBody(createSnapshotProps(props), features, snapshotGate, "snapshot"));
|
|
2488
|
+
})() : null}
|
|
2489
|
+
</NoHydration>;
|
|
2490
|
+
return [frame, snapshot2];
|
|
2381
2491
|
}
|
|
2382
|
-
function GridShellBody(props, features, mountGate) {
|
|
2492
|
+
function GridShellBody(props, features, mountGate, mode) {
|
|
2383
2493
|
const serverSideFeature2 = features.serverSide;
|
|
2384
|
-
const isServerSide =
|
|
2494
|
+
const isServerSide = createMemo10(() => props.dataSource != null);
|
|
2385
2495
|
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2386
|
-
const [hydrated, setHydrated] =
|
|
2496
|
+
const [hydrated, setHydrated] = createSignal9(mode === "snapshot" || !isServer && !isHydrating(), { name: "hydrated" });
|
|
2387
2497
|
if (!untrack13(hydrated)) {
|
|
2388
2498
|
onGridMounted(() => {
|
|
2499
|
+
revealServerFrame(gridRootRef.current?.parentElement, untrack13(() => rootStyle().display));
|
|
2389
2500
|
setHydrated(true);
|
|
2390
2501
|
});
|
|
2391
2502
|
}
|
|
2392
|
-
const [relayedRows, setRelayedRows] =
|
|
2503
|
+
const [relayedRows, setRelayedRows] = createSignal9(null);
|
|
2393
2504
|
createEffect4(
|
|
2394
|
-
() =>
|
|
2505
|
+
() => latest2(() => props.rows),
|
|
2395
2506
|
{
|
|
2396
2507
|
effect: (value) => {
|
|
2397
2508
|
setRelayedRows({ value });
|
|
@@ -2404,14 +2515,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2404
2515
|
},
|
|
2405
2516
|
{ name: "relayRows" }
|
|
2406
2517
|
);
|
|
2407
|
-
const
|
|
2518
|
+
const plainRows = createPlainRows(() => {
|
|
2519
|
+
const relayed = relayedRows();
|
|
2520
|
+
return relayed ? relayed.value : props.rows;
|
|
2521
|
+
});
|
|
2522
|
+
const rows = createMemo10(() => {
|
|
2408
2523
|
if (props.dataSource != null || !hydrated()) {
|
|
2409
2524
|
return EMPTY_ROWS;
|
|
2410
2525
|
}
|
|
2411
|
-
|
|
2412
|
-
return (relayed ? relayed.value : props.rows) ?? EMPTY_ROWS;
|
|
2526
|
+
return plainRows() ?? EMPTY_ROWS;
|
|
2413
2527
|
});
|
|
2414
|
-
const columns =
|
|
2528
|
+
const columns = createMemo10(() => props.columns);
|
|
2415
2529
|
const density = () => props.density ?? "standard";
|
|
2416
2530
|
const rowHeight = () => props.rowHeight ?? GRID_DENSITY_DIMENSIONS[density()].rowHeight;
|
|
2417
2531
|
const columnHeaderHeight = () => props.headerHeight ?? GRID_DENSITY_DIMENSIONS[density()].headerHeight;
|
|
@@ -2429,7 +2543,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2429
2543
|
const enableRowSelection = () => props.enableRowSelection ?? false;
|
|
2430
2544
|
const rowSelectionMode = () => props.rowSelectionMode ?? "multiple";
|
|
2431
2545
|
const enableSelectAllRows = () => props.enableSelectAllRows ?? (enableRowSelection() && rowSelectionMode() === "multiple");
|
|
2432
|
-
const detailRowEnabled =
|
|
2546
|
+
const detailRowEnabled = createMemo10(() => props.detailRow != null);
|
|
2433
2547
|
const detailToggleColumnActive = () => props.detailRow != null && props.detailRow.showToggleColumn !== false;
|
|
2434
2548
|
const columnInputs = () => ({
|
|
2435
2549
|
columns: columns(),
|
|
@@ -2441,29 +2555,29 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2441
2555
|
renderDetailToggleCell
|
|
2442
2556
|
});
|
|
2443
2557
|
const resolveLocaleText = createLocaleTextResolver(mergeFeatureLocaleDefaults(features));
|
|
2444
|
-
const localeTexts =
|
|
2558
|
+
const localeTexts = createMemo10(() => resolveLocaleText(props.localeText));
|
|
2445
2559
|
const totalRowFeature2 = features.totalRow;
|
|
2446
2560
|
const TotalRow = totalRowFeature2?.TotalRow;
|
|
2447
2561
|
const PinnedRows = features.pinnedRows?.PinnedRows;
|
|
2448
|
-
const totalRowOptions =
|
|
2562
|
+
const totalRowOptions = createMemo10(
|
|
2449
2563
|
() => typeof props.totalRow === "object" && props.totalRow !== null ? props.totalRow : null
|
|
2450
2564
|
);
|
|
2451
|
-
const totalRowEnabled =
|
|
2565
|
+
const totalRowEnabled = createMemo10(
|
|
2452
2566
|
() => (props.totalRow === true || totalRowOptions() !== null) && totalRowFeature2 !== void 0
|
|
2453
2567
|
);
|
|
2454
2568
|
const totalRowLabel = () => totalRowOptions()?.label ?? localeTexts().totalRowLabel;
|
|
2455
|
-
const totalRowHeight =
|
|
2456
|
-
const pinnedTop =
|
|
2569
|
+
const totalRowHeight = createMemo10(() => totalRowEnabled() ? Math.max(0, totalRowOptions()?.height ?? rowHeight()) : 0);
|
|
2570
|
+
const pinnedTop = createMemo10(
|
|
2457
2571
|
() => PinnedRows && props.pinnedTopRows && props.pinnedTopRows.length > 0 ? props.pinnedTopRows : null
|
|
2458
2572
|
);
|
|
2459
|
-
const pinnedBottom =
|
|
2573
|
+
const pinnedBottom = createMemo10(
|
|
2460
2574
|
() => PinnedRows && props.pinnedBottomRows && props.pinnedBottomRows.length > 0 ? props.pinnedBottomRows : null
|
|
2461
2575
|
);
|
|
2462
2576
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2463
2577
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2464
|
-
const headerHeight =
|
|
2465
|
-
const footerHeight =
|
|
2466
|
-
const pinnedBelowTotal =
|
|
2578
|
+
const headerHeight = createMemo10(() => columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2579
|
+
const footerHeight = createMemo10(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2580
|
+
const pinnedBelowTotal = createMemo10(
|
|
2467
2581
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2468
2582
|
);
|
|
2469
2583
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
@@ -2478,13 +2592,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2478
2592
|
enableSorting: untrack13(enableSorting)
|
|
2479
2593
|
}
|
|
2480
2594
|
});
|
|
2481
|
-
|
|
2595
|
+
onCleanup8(() => engine.dispose());
|
|
2482
2596
|
const store = engine.store;
|
|
2483
2597
|
const dispatch = store.dispatch;
|
|
2484
2598
|
const { state: ui, view } = createGridStoreSignals(store);
|
|
2485
|
-
const viewportWidth =
|
|
2486
|
-
const viewportHeight =
|
|
2487
|
-
const viewScrollTop =
|
|
2599
|
+
const viewportWidth = createMemo10(() => view().viewportWidth);
|
|
2600
|
+
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2601
|
+
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2488
2602
|
const viewSetters = createGridViewSetters(store);
|
|
2489
2603
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2490
2604
|
const gridRootRef = { current: null };
|
|
@@ -2506,16 +2620,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2506
2620
|
const shell = gridRootRef.current;
|
|
2507
2621
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2508
2622
|
});
|
|
2509
|
-
const columnResolution =
|
|
2623
|
+
const columnResolution = createMemo10(() => engine.resolveColumns(columnInputs()));
|
|
2510
2624
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2511
2625
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2512
2626
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
2513
2627
|
const groupColumns = () => columnResolution().groupColumns;
|
|
2514
2628
|
const aggColumns = () => columnResolution().aggColumns;
|
|
2515
|
-
const activeGroupColumns =
|
|
2516
|
-
const resolvedRowKeyGetter =
|
|
2517
|
-
const selectionSnapshot =
|
|
2518
|
-
const paneResolution =
|
|
2629
|
+
const activeGroupColumns = createMemo10(() => rowGroupingActive() ? groupColumns() : NO_COLUMNS);
|
|
2630
|
+
const resolvedRowKeyGetter = createMemo10(() => props.rowKeyGetter ?? ((_row, index) => index));
|
|
2631
|
+
const selectionSnapshot = createMemo10(() => buildSelectionSnapshot(ui().selection));
|
|
2632
|
+
const paneResolution = createMemo10(
|
|
2519
2633
|
() => engine.resolvePaneLayout({
|
|
2520
2634
|
orderedColumns: orderedColumns(),
|
|
2521
2635
|
columnWidths: ui().columnWidths,
|
|
@@ -2527,30 +2641,30 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2527
2641
|
let previousColumnsForWidths = null;
|
|
2528
2642
|
createEffect4(
|
|
2529
2643
|
columns,
|
|
2530
|
-
(next) => {
|
|
2644
|
+
outsideGraphApply((next) => {
|
|
2531
2645
|
dispatch(gridActions.reconcileColumnWidths(previousColumnsForWidths, next));
|
|
2532
2646
|
previousColumnsForWidths = next;
|
|
2533
|
-
},
|
|
2647
|
+
}),
|
|
2534
2648
|
{ name: "reconcileColumnWidths" }
|
|
2535
2649
|
);
|
|
2536
2650
|
const labelRowFeature2 = features.labelRow;
|
|
2537
|
-
const labelIsLabelRow =
|
|
2538
|
-
const labelGetLabel =
|
|
2539
|
-
const labelRender =
|
|
2540
|
-
const labelRowClassName =
|
|
2541
|
-
const labelRowHeightOption =
|
|
2542
|
-
const labelSortMode =
|
|
2543
|
-
const labelSticky =
|
|
2544
|
-
const labelExportText =
|
|
2545
|
-
const labelKeepEmptySections =
|
|
2546
|
-
const labelRowEnabled =
|
|
2651
|
+
const labelIsLabelRow = createMemo10(() => props.labelRow?.isLabelRow);
|
|
2652
|
+
const labelGetLabel = createMemo10(() => props.labelRow?.getLabel);
|
|
2653
|
+
const labelRender = createMemo10(() => props.labelRow?.render);
|
|
2654
|
+
const labelRowClassName = createMemo10(() => props.labelRow?.className);
|
|
2655
|
+
const labelRowHeightOption = createMemo10(() => props.labelRow?.height);
|
|
2656
|
+
const labelSortMode = createMemo10(() => props.labelRow?.sortMode ?? "section");
|
|
2657
|
+
const labelSticky = createMemo10(() => props.labelRow?.sticky === true);
|
|
2658
|
+
const labelExportText = createMemo10(() => props.labelRow?.exportText);
|
|
2659
|
+
const labelKeepEmptySections = createMemo10(() => props.labelRow?.keepEmptySections ?? false);
|
|
2660
|
+
const labelRowEnabled = createMemo10(
|
|
2547
2661
|
() => labelIsLabelRow() != null && labelGetLabel() != null && labelRowFeature2 !== void 0
|
|
2548
2662
|
);
|
|
2549
2663
|
const StickyLabelLayer = labelRowFeature2?.StickyLabelLayer;
|
|
2550
|
-
const labelLayout =
|
|
2664
|
+
const labelLayout = createMemo10(
|
|
2551
2665
|
() => engine.rowPipeline.resolveLabelRowLayout(rows(), isServerSide() ? void 0 : labelIsLabelRow())
|
|
2552
2666
|
);
|
|
2553
|
-
const filterCandidateRows =
|
|
2667
|
+
const filterCandidateRows = createMemo10(() => {
|
|
2554
2668
|
const layout = labelLayout();
|
|
2555
2669
|
const currentRows = rows();
|
|
2556
2670
|
if (!layout) {
|
|
@@ -2568,11 +2682,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2568
2682
|
}
|
|
2569
2683
|
return dataRows;
|
|
2570
2684
|
});
|
|
2571
|
-
const baseOrder =
|
|
2572
|
-
const globalFilterText =
|
|
2573
|
-
const columnFilters =
|
|
2574
|
-
const filterSortColumns =
|
|
2575
|
-
const globalFilterColumns =
|
|
2685
|
+
const baseOrder = createMemo10(() => engine.rowPipeline.resolveBaseOrder(rows().length, labelLayout()));
|
|
2686
|
+
const globalFilterText = createMemo10(() => selectGlobalFilter(ui()));
|
|
2687
|
+
const columnFilters = createMemo10(() => ui().filters.columnFilters);
|
|
2688
|
+
const filterSortColumns = createMemo10(() => columnResolution().filterSortColumns);
|
|
2689
|
+
const globalFilterColumns = createMemo10(() => {
|
|
2576
2690
|
const groups = activeGroupColumns();
|
|
2577
2691
|
return groups.length > 0 ? [...visibleColumns(), ...groups] : visibleColumns();
|
|
2578
2692
|
});
|
|
@@ -2596,7 +2710,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2596
2710
|
const globalFilterStatus = filterOrder ? filterOrder.globalFilterStatus : () => "idle";
|
|
2597
2711
|
const globalFilterProgress = filterOrder ? filterOrder.globalFilterProgress : () => 1;
|
|
2598
2712
|
const relativeDateKey = filterOrder ? filterOrder.relativeDateKey : () => "";
|
|
2599
|
-
const orderResolution =
|
|
2713
|
+
const orderResolution = createMemo10(
|
|
2600
2714
|
() => engine.rowPipeline.resolveOrder({
|
|
2601
2715
|
rows: rows(),
|
|
2602
2716
|
labelLayout: labelLayout(),
|
|
@@ -2614,7 +2728,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2614
2728
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
2615
2729
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
2616
2730
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
2617
|
-
const clientRowModel =
|
|
2731
|
+
const clientRowModel = createMemo10(
|
|
2618
2732
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
2619
2733
|
rows: rows(),
|
|
2620
2734
|
order: orderResolution().order,
|
|
@@ -2633,7 +2747,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2633
2747
|
manualSorting: manualSorting()
|
|
2634
2748
|
})
|
|
2635
2749
|
);
|
|
2636
|
-
const liveServerSideQuery =
|
|
2750
|
+
const liveServerSideQuery = createMemo10(
|
|
2637
2751
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
2638
2752
|
isServerSide: isServerSide(),
|
|
2639
2753
|
globalFilterEnabled: globalFilterEnabled(),
|
|
@@ -2652,7 +2766,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2652
2766
|
"serverSideQueryStore"
|
|
2653
2767
|
);
|
|
2654
2768
|
const serverSideQuerySnapshot = createExternalStoreSignal(engine.serverSideQueryStore, "serverSideQueryStore");
|
|
2655
|
-
const serverSideQueryKey =
|
|
2769
|
+
const serverSideQueryKey = createMemo10(() => serverSideQuerySnapshot().queryKey);
|
|
2656
2770
|
const serverSide = serverSideFeature2?.createServerSide(() => ({
|
|
2657
2771
|
dataSource: props.dataSource,
|
|
2658
2772
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
@@ -2664,7 +2778,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2664
2778
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2665
2779
|
onWriteStateChange: engine.saveStatus.handle
|
|
2666
2780
|
}));
|
|
2667
|
-
const rowModel =
|
|
2781
|
+
const rowModel = createMemo10(() => {
|
|
2668
2782
|
if (!isServerSide() || !serverSide) {
|
|
2669
2783
|
return clientRowModel().rowModel;
|
|
2670
2784
|
}
|
|
@@ -2673,38 +2787,39 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2673
2787
|
const getLabel = labelGetLabel();
|
|
2674
2788
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
2675
2789
|
});
|
|
2676
|
-
const canEditCell =
|
|
2790
|
+
const canEditCell = createMemo10(
|
|
2677
2791
|
() => isServerSide() && !(serverSide?.canUpdateRows() ?? false) ? NEVER_EDITABLE : props.canEditCell
|
|
2678
2792
|
);
|
|
2679
|
-
const applyServerSideCellEdits =
|
|
2793
|
+
const applyServerSideCellEdits = createMemo10(
|
|
2680
2794
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
2681
2795
|
);
|
|
2682
|
-
const viewRowCount =
|
|
2796
|
+
const viewRowCount = createMemo10(() => rowModel().getRowCount());
|
|
2683
2797
|
const viewColCount = () => orderedColumns().length;
|
|
2684
2798
|
const order = () => orderResolution().order;
|
|
2685
2799
|
const groupTree = () => clientRowModel().groupTree;
|
|
2686
2800
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
2687
|
-
const labelViewIndexes =
|
|
2688
|
-
const leafRowCount =
|
|
2801
|
+
const labelViewIndexes = createMemo10(() => labelDisplay()?.labelViewIndexes);
|
|
2802
|
+
const leafRowCount = createMemo10(
|
|
2689
2803
|
() => clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : viewRowCount()
|
|
2690
2804
|
);
|
|
2691
2805
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
2692
2806
|
const groupingFeature2 = features.grouping;
|
|
2693
|
-
const
|
|
2694
|
-
|
|
2807
|
+
const orderArray = createMemo10(() => order());
|
|
2808
|
+
const getFilteredRows = createMemo10(() => {
|
|
2809
|
+
const currentOrder = orderArray();
|
|
2695
2810
|
const currentRows = rows();
|
|
2696
2811
|
let cache = null;
|
|
2697
2812
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
2698
2813
|
});
|
|
2699
2814
|
createEffect4(
|
|
2700
2815
|
() => [viewRowCount(), viewColCount()],
|
|
2701
|
-
([rowCount, colCount]) => {
|
|
2816
|
+
outsideGraphApply(([rowCount, colCount]) => {
|
|
2702
2817
|
dispatch(gridActions.clampSelectionToRowCount(rowCount, colCount));
|
|
2703
|
-
},
|
|
2818
|
+
}),
|
|
2704
2819
|
{ name: "clampSelectionToRowCount" }
|
|
2705
2820
|
);
|
|
2706
2821
|
const autoHeightSnapshot = createExternalStoreSignal(engine.autoHeightMeasurer, "autoHeightStore");
|
|
2707
|
-
const vertical =
|
|
2822
|
+
const vertical = createMemo10(
|
|
2708
2823
|
() => engine.resolveVerticalLayout({
|
|
2709
2824
|
isServerSide: isServerSide(),
|
|
2710
2825
|
autoHeight: props.autoHeight ?? false,
|
|
@@ -2740,18 +2855,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2740
2855
|
detailExtraCount: () => vertical().detailExtras.length,
|
|
2741
2856
|
detailActive: () => vertical().detailActive,
|
|
2742
2857
|
globalFilterText,
|
|
2743
|
-
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2744
|
-
// 写した rows を読みます(取り直しの失敗を、写しの effect だけが <Errored> へ渡すように。S7-02)。写す前は props.rows。
|
|
2745
|
-
rows: () => {
|
|
2746
|
-
const relayed = relayedRows();
|
|
2747
|
-
return relayed ? relayed.value : props.rows;
|
|
2748
|
-
}
|
|
2858
|
+
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2749
2859
|
});
|
|
2750
|
-
const stickyLabelIndexes =
|
|
2860
|
+
const stickyLabelIndexes = createMemo10(() => {
|
|
2751
2861
|
const indexes = labelViewIndexes();
|
|
2752
2862
|
return labelSticky() && labelRowFeature2 && indexes && indexes.length > 0 ? indexes : null;
|
|
2753
2863
|
});
|
|
2754
|
-
const stickyLabelEntry =
|
|
2864
|
+
const stickyLabelEntry = createMemo10(() => {
|
|
2755
2865
|
const indexes = stickyLabelIndexes();
|
|
2756
2866
|
if (!indexes || !labelRowFeature2) {
|
|
2757
2867
|
return null;
|
|
@@ -2777,7 +2887,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2777
2887
|
pushOffset: resolution.pushOffset
|
|
2778
2888
|
};
|
|
2779
2889
|
});
|
|
2780
|
-
const stickyTopInset =
|
|
2890
|
+
const stickyTopInset = createMemo10(() => {
|
|
2781
2891
|
const indexes = stickyLabelIndexes();
|
|
2782
2892
|
const feature = labelRowFeature2;
|
|
2783
2893
|
if (!indexes || !feature) {
|
|
@@ -2794,8 +2904,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2794
2904
|
};
|
|
2795
2905
|
});
|
|
2796
2906
|
const conditionalFormatFeature2 = features.conditionalFormat;
|
|
2797
|
-
const conditionalFormatStats =
|
|
2798
|
-
const totalRowCells =
|
|
2907
|
+
const conditionalFormatStats = createMemo10(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
|
|
2908
|
+
const totalRowCells = createMemo10(
|
|
2799
2909
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
2800
2910
|
rows: rows(),
|
|
2801
2911
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
@@ -2804,11 +2914,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2804
2914
|
values: totalRowOptions()?.values
|
|
2805
2915
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
2806
2916
|
);
|
|
2807
|
-
const totalRowLabelColumnKey =
|
|
2917
|
+
const totalRowLabelColumnKey = createMemo10(
|
|
2808
2918
|
() => totalRowFeature2 ? totalRowFeature2.resolveTotalRowLabelColumnKey(orderedColumns(), totalRowCells()) : null
|
|
2809
2919
|
);
|
|
2810
2920
|
const columnAutosizeFeature2 = features.columnAutosize;
|
|
2811
|
-
const totalRowAutosizeTexts =
|
|
2921
|
+
const totalRowAutosizeTexts = createMemo10(() => {
|
|
2812
2922
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
2813
2923
|
return void 0;
|
|
2814
2924
|
}
|
|
@@ -2827,10 +2937,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2827
2937
|
}
|
|
2828
2938
|
return texts;
|
|
2829
2939
|
});
|
|
2830
|
-
const pinnedAutosizeRows =
|
|
2940
|
+
const pinnedAutosizeRows = createMemo10(
|
|
2831
2941
|
() => pinnedTop() || pinnedBottom() ? [...pinnedTop() ?? [], ...pinnedBottom() ?? []] : void 0
|
|
2832
2942
|
);
|
|
2833
|
-
const autosizeChipOf =
|
|
2943
|
+
const autosizeChipOf = createMemo10(() => {
|
|
2834
2944
|
const chipFeature = conditionalFormatFeature2;
|
|
2835
2945
|
if (!chipFeature) {
|
|
2836
2946
|
return void 0;
|
|
@@ -2905,27 +3015,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2905
3015
|
"effect",
|
|
2906
3016
|
"autoSizeOnData"
|
|
2907
3017
|
);
|
|
2908
|
-
const totalRowSlotSignature =
|
|
2909
|
-
const totalRowSlot =
|
|
2910
|
-
const totalRowExport =
|
|
3018
|
+
const totalRowSlotSignature = createMemo10(() => serializeSlotValue(totalRowOptions()?.className));
|
|
3019
|
+
const totalRowSlot = createMemo10(() => resolveSlotFromSignature(totalRowSlotSignature()));
|
|
3020
|
+
const totalRowExport = createMemo10(
|
|
2911
3021
|
() => totalRowEnabled() ? { cells: totalRowCells(), label: totalRowLabel() } : void 0
|
|
2912
3022
|
);
|
|
2913
|
-
const pinnedRowsExport =
|
|
3023
|
+
const pinnedRowsExport = createMemo10(
|
|
2914
3024
|
() => pinnedTop() || pinnedBottom() ? { top: pinnedTop() ?? [], bottom: pinnedBottom() ?? [], bottomAfterTotal: pinnedBelowTotal() } : void 0
|
|
2915
3025
|
);
|
|
2916
3026
|
const scrollHintFeature2 = features.scrollHint;
|
|
2917
3027
|
const findFeature2 = features.find;
|
|
2918
3028
|
const imeFeature = features.imeDirectInput;
|
|
2919
|
-
const resolvedScrollHint =
|
|
3029
|
+
const resolvedScrollHint = createMemo10(
|
|
2920
3030
|
() => scrollHintFeature2 ? scrollHintFeature2.resolveScrollHintOptions(props.scrollHint) : null
|
|
2921
3031
|
);
|
|
2922
|
-
const activeScrollHint =
|
|
3032
|
+
const activeScrollHint = createMemo10(() => {
|
|
2923
3033
|
const resolved = resolvedScrollHint();
|
|
2924
3034
|
return resolved !== null && viewRowCount() >= resolved.minRows ? resolved : null;
|
|
2925
3035
|
});
|
|
2926
|
-
const customScrollbar =
|
|
2927
|
-
const autoHeightActive =
|
|
2928
|
-
const bodyRows =
|
|
3036
|
+
const customScrollbar = createMemo10(() => activeScrollHint()?.scrollbar === true);
|
|
3037
|
+
const autoHeightActive = createMemo10(() => vertical().autoHeightActive);
|
|
3038
|
+
const bodyRows = createMemo10(() => {
|
|
2929
3039
|
const { virtualRows, virtualRowIndexes } = vertical();
|
|
2930
3040
|
const model = rowModel();
|
|
2931
3041
|
const serverSideActive = isServerSide();
|
|
@@ -3008,8 +3118,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3008
3118
|
},
|
|
3009
3119
|
{ name: "detailRowsQueryReset" }
|
|
3010
3120
|
);
|
|
3011
|
-
const windowFirstRow =
|
|
3012
|
-
const windowLastRow =
|
|
3121
|
+
const windowFirstRow = createMemo10(() => vertical().windowFirstRow);
|
|
3122
|
+
const windowLastRow = createMemo10(() => vertical().windowLastRow);
|
|
3013
3123
|
createEffect4(
|
|
3014
3124
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
3015
3125
|
([serverSideActive, firstRow, lastRow]) => {
|
|
@@ -3020,7 +3130,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3020
3130
|
},
|
|
3021
3131
|
{ name: "serverSideRequestRange" }
|
|
3022
3132
|
);
|
|
3023
|
-
const columnMeasurements =
|
|
3133
|
+
const columnMeasurements = createMemo10(
|
|
3024
3134
|
() => buildColumnMeasurements(visibleColumns(), paneResolution().effectiveColumnWidths)
|
|
3025
3135
|
);
|
|
3026
3136
|
const measuredByColumnVirtualizer = { measure: () => {
|
|
@@ -3039,11 +3149,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3039
3149
|
measureKey: columnMeasurements()
|
|
3040
3150
|
};
|
|
3041
3151
|
});
|
|
3042
|
-
const centerRenderEntries =
|
|
3152
|
+
const centerRenderEntries = createMemo10(() => {
|
|
3043
3153
|
const entries = centerEntries();
|
|
3044
3154
|
return columnVirtualizer.items().map((item) => entries[item.index]).filter((entry) => Boolean(entry));
|
|
3045
3155
|
});
|
|
3046
|
-
const activeCellRendered =
|
|
3156
|
+
const activeCellRendered = createMemo10(
|
|
3047
3157
|
() => isActiveCellRendered(ui().activeCell, vertical().virtualRowIndexes, rowModel(), [
|
|
3048
3158
|
paneLayout().left.entries,
|
|
3049
3159
|
centerRenderEntries(),
|
|
@@ -3078,28 +3188,28 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3078
3188
|
}), "render", "saveStatus");
|
|
3079
3189
|
const systemPrefersDark = createExternalStoreSignal(systemColorSchemeStore, "systemColorSchemeStore");
|
|
3080
3190
|
const themeClassName = () => resolveGridThemeClassName(props.theme ?? "light", systemPrefersDark());
|
|
3081
|
-
const heightLayout =
|
|
3082
|
-
const slotSignature =
|
|
3083
|
-
const slots =
|
|
3191
|
+
const heightLayout = createMemo10(() => resolveGridHeightLayout(props.height, props.maxHeight));
|
|
3192
|
+
const slotSignature = createMemo10(() => serializeSlotValue(props.classNames));
|
|
3193
|
+
const slots = createMemo10(
|
|
3084
3194
|
() => resolveSlotMapFromSignature(slotSignature())
|
|
3085
3195
|
);
|
|
3086
|
-
const activeCellPlacement =
|
|
3196
|
+
const activeCellPlacement = createMemo10(
|
|
3087
3197
|
() => resolveCellPlacement(ui().activeCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3088
3198
|
);
|
|
3089
|
-
const editingCellPlacement =
|
|
3199
|
+
const editingCellPlacement = createMemo10(
|
|
3090
3200
|
() => resolveCellPlacement(ui().editingCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3091
3201
|
);
|
|
3092
|
-
const editorAlignTop =
|
|
3202
|
+
const editorAlignTop = createMemo10(() => {
|
|
3093
3203
|
const editing = ui().editingCell;
|
|
3094
3204
|
const column = editing ? orderedColumns()[editing.col] : void 0;
|
|
3095
3205
|
const placement2 = editingCellPlacement();
|
|
3096
3206
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
3097
3207
|
});
|
|
3098
|
-
const selectionExtents =
|
|
3099
|
-
const selectionBand =
|
|
3208
|
+
const selectionExtents = createMemo10(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3209
|
+
const selectionBand = createMemo10(
|
|
3100
3210
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3101
3211
|
);
|
|
3102
|
-
const selectionBandSegments =
|
|
3212
|
+
const selectionBandSegments = createMemo10(
|
|
3103
3213
|
() => resolveSelectionBandSegments(
|
|
3104
3214
|
vertical().detailActive,
|
|
3105
3215
|
selectionExtents(),
|
|
@@ -3113,7 +3223,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3113
3223
|
resolvePaneBandRect(selectionExtents(), selectionBand(), pane)
|
|
3114
3224
|
];
|
|
3115
3225
|
const motionExtrasFeature2 = features.motionExtras;
|
|
3116
|
-
const copiedSelection =
|
|
3226
|
+
const copiedSelection = createMemo10(() => {
|
|
3117
3227
|
const copied = view().copiedRange;
|
|
3118
3228
|
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true) || !copied) {
|
|
3119
3229
|
return null;
|
|
@@ -3121,11 +3231,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3121
3231
|
const state = ui();
|
|
3122
3232
|
return copied.view.sort === state.sort && copied.view.filters === state.filters && copied.view.collapsedGroupKeys === state.collapsedGroupKeys && copied.view.viewRowCount === viewRowCount() && copied.view.columns === orderedColumnKeys() ? copied.selection : null;
|
|
3123
3233
|
});
|
|
3124
|
-
const copiedExtents =
|
|
3125
|
-
const copiedBand =
|
|
3234
|
+
const copiedExtents = createMemo10(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3235
|
+
const copiedBand = createMemo10(
|
|
3126
3236
|
() => resolveSelectionBand(copiedExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3127
3237
|
);
|
|
3128
|
-
const copiedBandSegments =
|
|
3238
|
+
const copiedBandSegments = createMemo10(
|
|
3129
3239
|
() => resolveSelectionBandSegments(
|
|
3130
3240
|
vertical().detailActive,
|
|
3131
3241
|
copiedExtents(),
|
|
@@ -3156,7 +3266,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3156
3266
|
const cellEditorDomId = `${gridDomId}-cell-editor`;
|
|
3157
3267
|
let tooltipController = null;
|
|
3158
3268
|
onGridMounted(() => {
|
|
3159
|
-
const controller = acquireTooltipController();
|
|
3269
|
+
const controller = acquireTooltipController(void 0, gridRootRef.current);
|
|
3160
3270
|
tooltipController = controller;
|
|
3161
3271
|
controller.setSlot(untrack13(slots).tooltip);
|
|
3162
3272
|
return () => {
|
|
@@ -3171,7 +3281,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3171
3281
|
},
|
|
3172
3282
|
{ name: "tooltipSlot" }
|
|
3173
3283
|
);
|
|
3174
|
-
const activeCellTooltipKey =
|
|
3284
|
+
const activeCellTooltipKey = createMemo10(() => {
|
|
3175
3285
|
const active = ui().activeCell;
|
|
3176
3286
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3177
3287
|
});
|
|
@@ -3232,7 +3342,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3232
3342
|
"effect",
|
|
3233
3343
|
"viewportSync"
|
|
3234
3344
|
);
|
|
3235
|
-
const controlledRowSelectionModel =
|
|
3345
|
+
const controlledRowSelectionModel = createMemo10(() => {
|
|
3236
3346
|
if (props.rowSelection !== void 0) {
|
|
3237
3347
|
return props.rowSelection;
|
|
3238
3348
|
}
|
|
@@ -3241,11 +3351,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3241
3351
|
}
|
|
3242
3352
|
return void 0;
|
|
3243
3353
|
});
|
|
3244
|
-
const filteredDataRows =
|
|
3354
|
+
const filteredDataRows = createMemo10(
|
|
3245
3355
|
() => !isServerSide() && order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null
|
|
3246
3356
|
);
|
|
3247
3357
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3248
|
-
const selectAllRowsState =
|
|
3358
|
+
const selectAllRowsState = createMemo10(() => {
|
|
3249
3359
|
const filtered = filteredDataRows();
|
|
3250
3360
|
return filtered && enableRowSelection() ? resolveSelectAllState(
|
|
3251
3361
|
countSelectedRowsInOrder(ui().rowSelection, filtered.rows, filtered.order, filtered.rowKeyGetter),
|
|
@@ -3261,6 +3371,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3261
3371
|
controlledRowSelectionModel: controlledRowSelectionModel(),
|
|
3262
3372
|
leafRowCount: leafRowCount(),
|
|
3263
3373
|
filteredDataRows: filteredDataRows(),
|
|
3374
|
+
// 追加(Solid 版 0.1.2 / S4-09): 選んだ行が rows から消えたら選択から外す(clientSide。React 版と同じ)。
|
|
3375
|
+
sourceRows: isServerSide() ? void 0 : { rows: rows(), rowKeyGetter: resolvedRowKeyGetter() },
|
|
3264
3376
|
dispatch
|
|
3265
3377
|
}), "render", "rowSelectionCommands");
|
|
3266
3378
|
connectController(
|
|
@@ -3277,8 +3389,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3277
3389
|
keyOf: resolvedRowKeyGetter(),
|
|
3278
3390
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3279
3391
|
}), "render", "detailKeysPruner");
|
|
3280
|
-
const detailDrawable =
|
|
3281
|
-
const hasDetailCards =
|
|
3392
|
+
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <= MAX_BODY_PX2);
|
|
3393
|
+
const hasDetailCards = createMemo10(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3282
3394
|
const detailRows = createDetailRowController();
|
|
3283
3395
|
connectController(detailRows, () => ({
|
|
3284
3396
|
rowModel: rowModel(),
|
|
@@ -3304,11 +3416,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3304
3416
|
),
|
|
3305
3417
|
0
|
|
3306
3418
|
);
|
|
3307
|
-
const detailRender =
|
|
3308
|
-
const detailCardSlotSignature =
|
|
3309
|
-
const detailCardSlot =
|
|
3419
|
+
const detailRender = createMemo10(() => props.detailRow?.render);
|
|
3420
|
+
const detailCardSlotSignature = createMemo10(() => serializeSlotValue(props.detailRow?.className));
|
|
3421
|
+
const detailCardSlot = createMemo10(() => resolveSlotFromSignature(detailCardSlotSignature()));
|
|
3310
3422
|
const collapseDetailRow = (rowKey, viewIndex) => detailRows.setExpandedAt(rowKey, viewIndex, false);
|
|
3311
|
-
const renderLabelRowContent =
|
|
3423
|
+
const renderLabelRowContent = createMemo10(() => {
|
|
3312
3424
|
const render = labelRender();
|
|
3313
3425
|
return render ? (ctx) => render(ctx) : (ctx) => <span class="ssg-label-row-content--default ssg-label-row-default">
|
|
3314
3426
|
<span class="ssg-label-row-text">{ctx.label}</span>
|
|
@@ -3318,7 +3430,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3318
3430
|
const className = labelRowClassName();
|
|
3319
3431
|
return typeof className === "function" ? className(labelRow.row) : className;
|
|
3320
3432
|
};
|
|
3321
|
-
const labelRowLayerCenter =
|
|
3433
|
+
const labelRowLayerCenter = createMemo10(
|
|
3322
3434
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3323
3435
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3324
3436
|
renderContent: renderLabelRowContent(),
|
|
@@ -3327,7 +3439,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3327
3439
|
resolveRowSlot: resolveLabelRowSlot
|
|
3328
3440
|
} : void 0
|
|
3329
3441
|
);
|
|
3330
|
-
const labelRowLayerBand =
|
|
3442
|
+
const labelRowLayerBand = createMemo10(
|
|
3331
3443
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3332
3444
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3333
3445
|
renderContent: null,
|
|
@@ -3336,11 +3448,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3336
3448
|
resolveRowSlot: resolveLabelRowSlot
|
|
3337
3449
|
} : void 0
|
|
3338
3450
|
);
|
|
3339
|
-
const stickyLabelSlot =
|
|
3451
|
+
const stickyLabelSlot = createMemo10(() => {
|
|
3340
3452
|
const entry = stickyLabelEntry();
|
|
3341
3453
|
return resolveSlotProps2(entry ? resolveLabelRowSlot(entry.labelRow) : void 0);
|
|
3342
3454
|
});
|
|
3343
|
-
const labelRowExport =
|
|
3455
|
+
const labelRowExport = createMemo10(() => {
|
|
3344
3456
|
const isLabelRow = labelIsLabelRow();
|
|
3345
3457
|
const getLabel = labelGetLabel();
|
|
3346
3458
|
return labelRowEnabled() && isLabelRow && getLabel ? { isLabelRow, getLabel, exportText: labelExportText() } : void 0;
|
|
@@ -3437,7 +3549,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3437
3549
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
3438
3550
|
const cells = createCellCommands();
|
|
3439
3551
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
3440
|
-
const orderedColumnKeys =
|
|
3552
|
+
const orderedColumnKeys = createMemo10(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
3441
3553
|
const clipboard = createClipboardController();
|
|
3442
3554
|
connectController(clipboard, () => ({
|
|
3443
3555
|
rows: rows(),
|
|
@@ -3476,7 +3588,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3476
3588
|
isRowExportable: props.isRowExportable,
|
|
3477
3589
|
dispatch
|
|
3478
3590
|
}), "render", "clipboard");
|
|
3479
|
-
const isWholeGridSelected =
|
|
3591
|
+
const isWholeGridSelected = createMemo10(
|
|
3480
3592
|
() => computeIsWholeGridSelected(ui().selection, viewRowCount(), visibleColumns().length)
|
|
3481
3593
|
);
|
|
3482
3594
|
const fillHandleFeature2 = features.fillHandle;
|
|
@@ -3511,13 +3623,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3511
3623
|
const pageHeight = Math.max(viewportHeight() - headerHeight(), rowHeight());
|
|
3512
3624
|
return resolvePageTargetRow(vertical().rowMetrics, fromRow, direction, pageHeight);
|
|
3513
3625
|
};
|
|
3514
|
-
const findEnabled =
|
|
3515
|
-
const findOptions =
|
|
3516
|
-
const findShortcut =
|
|
3626
|
+
const findEnabled = createMemo10(() => props.find !== false && props.find !== void 0 && findFeature2 !== void 0);
|
|
3627
|
+
const findOptions = createMemo10(() => typeof props.find === "object" ? props.find : null);
|
|
3628
|
+
const findShortcut = createMemo10(() => findEnabled() && (findOptions()?.shortcut ?? true));
|
|
3517
3629
|
const findSnapshot = createExternalStoreSignal(engine.find, "findStore");
|
|
3518
3630
|
const FindBar = findFeature2?.FindBar;
|
|
3519
|
-
const findIndex =
|
|
3520
|
-
const findCurrentIndex =
|
|
3631
|
+
const findIndex = createMemo10(() => findSnapshot().index);
|
|
3632
|
+
const findCurrentIndex = createMemo10(() => findSnapshot().currentIndex);
|
|
3521
3633
|
connectController(engine.find, () => ({
|
|
3522
3634
|
enabled: findEnabled(),
|
|
3523
3635
|
rowModel: rowModel(),
|
|
@@ -3714,21 +3826,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3714
3826
|
}
|
|
3715
3827
|
contextMenu.open(params, items);
|
|
3716
3828
|
};
|
|
3717
|
-
const contextMenuView =
|
|
3718
|
-
const
|
|
3719
|
-
if (!
|
|
3829
|
+
const contextMenuView = createMemo10(() => {
|
|
3830
|
+
const snapshot2 = contextMenu?.snapshot();
|
|
3831
|
+
if (!snapshot2?.state || !snapshot2.layout) {
|
|
3720
3832
|
return null;
|
|
3721
3833
|
}
|
|
3722
3834
|
const texts = localeTexts();
|
|
3723
3835
|
return {
|
|
3724
|
-
items:
|
|
3725
|
-
layout:
|
|
3726
|
-
ariaLabel:
|
|
3836
|
+
items: snapshot2.state.items,
|
|
3837
|
+
layout: snapshot2.layout,
|
|
3838
|
+
ariaLabel: snapshot2.state.params.target.type === "rowHeader" ? texts.contextMenuRow : texts.contextMenuCell
|
|
3727
3839
|
};
|
|
3728
3840
|
});
|
|
3729
3841
|
const keyboard = createKeyboardController();
|
|
3730
3842
|
connectController(keyboard, () => ({
|
|
3731
3843
|
uiState: ui(),
|
|
3844
|
+
// 端の固定列へ移ったときに中央の横のスクロールを端へ戻す(S12-05。React 版と同じ)。
|
|
3845
|
+
scrollContainerRef,
|
|
3732
3846
|
// イベントの時点の状態は store から読む(core controllers/liveUiState)。
|
|
3733
3847
|
getUiState: store.getState,
|
|
3734
3848
|
rowModel: rowModel(),
|
|
@@ -3770,7 +3884,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3770
3884
|
readOnly: readOnly(),
|
|
3771
3885
|
canEditCell: canEditCell(),
|
|
3772
3886
|
localeTexts: localeTexts(),
|
|
3773
|
-
followsRow: activeRowFollowEnabled()
|
|
3887
|
+
followsRow: activeRowFollowEnabled(),
|
|
3888
|
+
getUiState: store.getState,
|
|
3889
|
+
rowKeyGetter: resolvedRowKeyGetter()
|
|
3774
3890
|
}), "render", "edit");
|
|
3775
3891
|
connectController(cells, () => ({
|
|
3776
3892
|
rows: rows(),
|
|
@@ -3785,7 +3901,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3785
3901
|
startEditWithValue: edit.startEditWithValue,
|
|
3786
3902
|
dispatch
|
|
3787
3903
|
}), "render", "cells");
|
|
3788
|
-
const imeDirectInputEnabled =
|
|
3904
|
+
const imeDirectInputEnabled = createMemo10(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
3789
3905
|
connectController(
|
|
3790
3906
|
engine.imeInput,
|
|
3791
3907
|
() => {
|
|
@@ -3878,6 +3994,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3878
3994
|
columnWidths: paneResolution().effectiveColumnWidths,
|
|
3879
3995
|
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3880
3996
|
dispatch,
|
|
3997
|
+
// 列を変えた後、アクティブセルを列のキーに付いていかせる(S12-01。React 版と同じ)。
|
|
3998
|
+
getUiState: store.getState,
|
|
3881
3999
|
enableSorting: enableSorting(),
|
|
3882
4000
|
sort: ui().sort,
|
|
3883
4001
|
globalFilterText: selectGlobalFilter(ui()),
|
|
@@ -3901,7 +4019,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3901
4019
|
groupColumns: activeGroupColumns,
|
|
3902
4020
|
localeTexts
|
|
3903
4021
|
});
|
|
3904
|
-
const columnChooserItems =
|
|
4022
|
+
const columnChooserItems = createMemo10(
|
|
3905
4023
|
() => columns().map((column) => ({
|
|
3906
4024
|
key: column.key,
|
|
3907
4025
|
title: column.title || column.key,
|
|
@@ -3911,11 +4029,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3911
4029
|
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
3912
4030
|
}))
|
|
3913
4031
|
);
|
|
3914
|
-
const sortManagerColumns =
|
|
4032
|
+
const sortManagerColumns = createMemo10(
|
|
3915
4033
|
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
3916
4034
|
);
|
|
3917
4035
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
3918
|
-
const toolPanelTabs =
|
|
4036
|
+
const toolPanelTabs = createMemo10(
|
|
3919
4037
|
() => (toolPanel?.availableTabs() ?? []).map((tab) => {
|
|
3920
4038
|
const texts = localeTexts();
|
|
3921
4039
|
if (tab === "filter") {
|
|
@@ -3931,7 +4049,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3931
4049
|
return { tab, label: texts.toolPanelColumns };
|
|
3932
4050
|
})
|
|
3933
4051
|
);
|
|
3934
|
-
const columnMenuGroupingAvailable =
|
|
4052
|
+
const columnMenuGroupingAvailable = createMemo10(
|
|
3935
4053
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
3936
4054
|
);
|
|
3937
4055
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
@@ -3949,7 +4067,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3949
4067
|
ghostSlot: slots().dragGhost,
|
|
3950
4068
|
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
3951
4069
|
}));
|
|
3952
|
-
const columnDragHandler =
|
|
4070
|
+
const columnDragHandler = createMemo10(
|
|
3953
4071
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
3954
4072
|
);
|
|
3955
4073
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
@@ -4225,14 +4343,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4225
4343
|
element.removeEventListener("keydown", onKey, { capture: true });
|
|
4226
4344
|
};
|
|
4227
4345
|
});
|
|
4228
|
-
const columnNamer =
|
|
4346
|
+
const columnNamer = createMemo10(
|
|
4229
4347
|
() => createDataColumnNamer(orderedColumns(), {
|
|
4230
4348
|
detail: localeTexts().detailColumnName,
|
|
4231
4349
|
rowDrag: localeTexts().rowDragColumnName
|
|
4232
4350
|
})
|
|
4233
4351
|
);
|
|
4234
|
-
const rowNumberer =
|
|
4235
|
-
const slotContextBase =
|
|
4352
|
+
const rowNumberer = createMemo10(() => createDataRowNumberer(labelViewIndexes()));
|
|
4353
|
+
const slotContextBase = createMemo10(() => ({
|
|
4236
4354
|
rows: rows(),
|
|
4237
4355
|
columns: props.columns,
|
|
4238
4356
|
visibleColumns: visibleColumns(),
|
|
@@ -4242,7 +4360,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4242
4360
|
activeCell: ui().activeCell,
|
|
4243
4361
|
selection: ui().selection
|
|
4244
4362
|
}));
|
|
4245
|
-
const derivedSummary =
|
|
4363
|
+
const derivedSummary = createMemo10(() => {
|
|
4246
4364
|
const summary = buildGridDerivedSummary(
|
|
4247
4365
|
filteringAvailable ? slotContextBase() : { ...slotContextBase(), globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4248
4366
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
@@ -4264,7 +4382,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4264
4382
|
orderedColumns: orderedColumns(),
|
|
4265
4383
|
rowModel: rowModel()
|
|
4266
4384
|
})) : () => null;
|
|
4267
|
-
const
|
|
4385
|
+
const liveDerivedSummary = createLiveObject(DERIVED_SUMMARY_KEYS, derivedSummary);
|
|
4386
|
+
const slotContext = createMemo10(() => {
|
|
4268
4387
|
const filteredRows = getFilteredRows();
|
|
4269
4388
|
return {
|
|
4270
4389
|
...slotContextBase(),
|
|
@@ -4272,20 +4391,20 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4272
4391
|
return filteredRows();
|
|
4273
4392
|
},
|
|
4274
4393
|
setGlobalFilterText,
|
|
4275
|
-
derivedSummary:
|
|
4394
|
+
derivedSummary: liveDerivedSummary,
|
|
4276
4395
|
globalFilterStatus: globalFilterStatus(),
|
|
4277
4396
|
globalFilterProgress: globalFilterProgress(),
|
|
4278
4397
|
selectionAggregates: selectionAggregates()
|
|
4279
4398
|
};
|
|
4280
4399
|
});
|
|
4281
4400
|
const liveSlotContext = createLiveObject(SLOT_CONTEXT_KEYS, slotContext);
|
|
4282
|
-
const renderTopBarFn =
|
|
4283
|
-
const renderBottomBarFn =
|
|
4284
|
-
const customTopBar =
|
|
4401
|
+
const renderTopBarFn = createMemo10(() => props.renderTopBar);
|
|
4402
|
+
const renderBottomBarFn = createMemo10(() => props.renderBottomBar);
|
|
4403
|
+
const customTopBar = createMemo10(() => {
|
|
4285
4404
|
const render = renderTopBarFn();
|
|
4286
4405
|
return render ? render(liveSlotContext) : void 0;
|
|
4287
4406
|
});
|
|
4288
|
-
const customBottomBar =
|
|
4407
|
+
const customBottomBar = createMemo10(() => {
|
|
4289
4408
|
const render = renderBottomBarFn();
|
|
4290
4409
|
return render ? render(liveSlotContext) : void 0;
|
|
4291
4410
|
});
|
|
@@ -4327,7 +4446,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4327
4446
|
{customBottomBar()}
|
|
4328
4447
|
</Show11>
|
|
4329
4448
|
</Show11>;
|
|
4330
|
-
const editorSession =
|
|
4449
|
+
const editorSession = createMemo10((previous) => {
|
|
4331
4450
|
const cell = ui().editingCell;
|
|
4332
4451
|
if (cell === null) {
|
|
4333
4452
|
return null;
|
|
@@ -4355,12 +4474,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4355
4474
|
const rekeyed = !Object.is(identity.rowKey, previous.identity.rowKey) || identity.columnKey !== previous.identity.columnKey;
|
|
4356
4475
|
return { id: rekeyed ? previous.id + 1 : previous.id, identity };
|
|
4357
4476
|
});
|
|
4358
|
-
const editorSessionId =
|
|
4359
|
-
const editingColumn =
|
|
4477
|
+
const editorSessionId = createMemo10(() => editorSession()?.id ?? null);
|
|
4478
|
+
const editingColumn = createMemo10(() => {
|
|
4360
4479
|
const cell = ui().editingCell;
|
|
4361
4480
|
return cell === null ? void 0 : orderedColumns()[cell.col];
|
|
4362
4481
|
});
|
|
4363
|
-
const editingSessionInfo =
|
|
4482
|
+
const editingSessionInfo = createMemo10(() => {
|
|
4364
4483
|
const cell = ui().editingCell;
|
|
4365
4484
|
if (cell === null) {
|
|
4366
4485
|
return null;
|
|
@@ -4406,7 +4525,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4406
4525
|
if (!RowDragHandle2 || !rowDrag) {
|
|
4407
4526
|
return null;
|
|
4408
4527
|
}
|
|
4409
|
-
const draggable =
|
|
4528
|
+
const draggable = createMemo10(() => {
|
|
4410
4529
|
const isRowDraggable = props.isRowDraggable;
|
|
4411
4530
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
4412
4531
|
});
|
|
@@ -4433,12 +4552,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4433
4552
|
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4434
4553
|
/>;
|
|
4435
4554
|
}
|
|
4436
|
-
const row = currentRow();
|
|
4437
|
-
const value = getCellValue2(row, unbound);
|
|
4438
4555
|
if (column.renderCell) {
|
|
4439
|
-
const
|
|
4440
|
-
const
|
|
4441
|
-
|
|
4556
|
+
const cellValue = createMemo10(() => getCellValue2(currentRow(), unbound));
|
|
4557
|
+
const expanded = createMemo10(() => ui().expandedDetailRowKeys.has(cell.rowKey));
|
|
4558
|
+
const expandable = createMemo10(
|
|
4559
|
+
() => isDetailRowExpandable(detailDrawable(), props.detailRow?.isExpandable, currentRow(), cell.rowKey, cell.sourceRowIndex)
|
|
4442
4560
|
);
|
|
4443
4561
|
const detail = {
|
|
4444
4562
|
get expanded() {
|
|
@@ -4450,8 +4568,19 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4450
4568
|
toggle: () => detailRows.toggleAt(cell.rowKey, untrack13(() => cell.rowIndex)),
|
|
4451
4569
|
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey, untrack13(() => cell.rowIndex), expanded2)
|
|
4452
4570
|
};
|
|
4571
|
+
if (column.key === DETAIL_TOGGLE_COLUMN_KEY2) {
|
|
4572
|
+
const rowNumber = () => {
|
|
4573
|
+
const indexes = labelViewIndexes();
|
|
4574
|
+
return indexes ? resolveDataRowNumber2(indexes, cell.rowIndex) : cell.rowIndex + 1;
|
|
4575
|
+
};
|
|
4576
|
+
return <Show11 when={expandable()}>
|
|
4577
|
+
<DetailToggleButton detail={detail} rowNumber={rowNumber()} />
|
|
4578
|
+
</Show11>;
|
|
4579
|
+
}
|
|
4453
4580
|
return column.renderCell({
|
|
4454
|
-
row
|
|
4581
|
+
get row() {
|
|
4582
|
+
return currentRow();
|
|
4583
|
+
},
|
|
4455
4584
|
get rowIndex() {
|
|
4456
4585
|
return cell.rowIndex;
|
|
4457
4586
|
},
|
|
@@ -4465,7 +4594,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4465
4594
|
get detail() {
|
|
4466
4595
|
return detailRowEnabled() ? detail : void 0;
|
|
4467
4596
|
},
|
|
4468
|
-
value
|
|
4597
|
+
get value() {
|
|
4598
|
+
return cellValue();
|
|
4599
|
+
},
|
|
4469
4600
|
column,
|
|
4470
4601
|
get isActive() {
|
|
4471
4602
|
return cell.isActive;
|
|
@@ -4482,6 +4613,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4482
4613
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4483
4614
|
});
|
|
4484
4615
|
}
|
|
4616
|
+
const row = currentRow();
|
|
4617
|
+
const value = getCellValue2(row, unbound);
|
|
4485
4618
|
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4486
4619
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4487
4620
|
const highlightFind = (content) => {
|
|
@@ -4503,7 +4636,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4503
4636
|
const chips = formatRules?.chips;
|
|
4504
4637
|
if (conditionalFormatFeature2 && chips) {
|
|
4505
4638
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4506
|
-
const chip =
|
|
4639
|
+
const chip = createMemo10(
|
|
4507
4640
|
() => resolveChipSpec2(chips, {
|
|
4508
4641
|
row,
|
|
4509
4642
|
get rowIndex() {
|
|
@@ -4730,6 +4863,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4730
4863
|
slots={slots()}
|
|
4731
4864
|
onCommit={(value, direction) => edit.commitEdit(value, direction)}
|
|
4732
4865
|
onCancel={edit.cancelEdit}
|
|
4866
|
+
onRegisterFlush={edit.registerDraftFlush}
|
|
4733
4867
|
align={editingColumn()?.align}
|
|
4734
4868
|
enterMove={props.editorEnterMove}
|
|
4735
4869
|
domId={cellEditorDomId}
|
|
@@ -4815,6 +4949,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4815
4949
|
};
|
|
4816
4950
|
const activeDescendantId = () => activeCellRendered() ? activeCellDomId : void 0;
|
|
4817
4951
|
const emptyStateText = () => (isServerSide() ? !filterConditionsActive() : rows().length === 0 && !manualFilterActive()) ? props.noRowsText ?? localeTexts().noRows : props.noMatchingRowsText ?? localeTexts().noMatchingRows;
|
|
4952
|
+
const rootStyle = () => ({
|
|
4953
|
+
...toSolidStyle(heightLayout().rootStyle),
|
|
4954
|
+
...slots().root?.style,
|
|
4955
|
+
...props.style
|
|
4956
|
+
});
|
|
4818
4957
|
const shellView = <GridLocaleTextContext value={localeTexts}>
|
|
4819
4958
|
<GridPortalContext value={portalContext}>
|
|
4820
4959
|
<div
|
|
@@ -4835,7 +4974,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4835
4974
|
"ssg-root--hover-cross": hoverCross()
|
|
4836
4975
|
}
|
|
4837
4976
|
]}
|
|
4838
|
-
style={{
|
|
4977
|
+
style={{
|
|
4978
|
+
...rootStyle(),
|
|
4979
|
+
...mode === "hiddenFrame" ? { display: "none" } : void 0
|
|
4980
|
+
}}
|
|
4981
|
+
hidden={mode === "hiddenFrame" ? true : void 0}
|
|
4982
|
+
data-ssg-ssr={mode === "hiddenFrame" ? "" : void 0}
|
|
4983
|
+
data-ssg-ssr-snapshot={mode === "snapshot" ? "" : void 0}
|
|
4839
4984
|
>
|
|
4840
4985
|
{topBar()}
|
|
4841
4986
|
{
|
|
@@ -4986,7 +5131,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4986
5131
|
}}
|
|
4987
5132
|
class="ssg-tab-exit"
|
|
4988
5133
|
tabindex={hasDetailCards() ? 0 : -1}
|
|
4989
|
-
aria-hidden="true"
|
|
5134
|
+
aria-hidden={hasDetailCards() ? void 0 : "true"}
|
|
4990
5135
|
onFocus={(event) => detailRows.handleTableExitFocus(event.relatedTarget)}
|
|
4991
5136
|
/>
|
|
4992
5137
|
<Show11 when={scrollHintFeature2 !== void 0 && activeScrollHint()}>
|
|
@@ -5023,7 +5168,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
5023
5168
|
<span class="ssg-filter-overlay-chip" role="status" aria-live="polite">
|
|
5024
5169
|
<span class="ssg-filter-spinner" aria-hidden="true" />
|
|
5025
5170
|
<span class="ssg-filter-overlay-text">
|
|
5026
|
-
{
|
|
5171
|
+
{formatLocaleText6(localeTexts().applyingFilter, { percent: Math.round(globalFilterProgress() * 100) })}
|
|
5027
5172
|
</span>
|
|
5028
5173
|
</span>
|
|
5029
5174
|
</div>
|
|
@@ -5288,7 +5433,7 @@ var columnAutosizeFeature = {
|
|
|
5288
5433
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5289
5434
|
|
|
5290
5435
|
// src/primitives/columnMenu.ts
|
|
5291
|
-
import { createMemo as
|
|
5436
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
5292
5437
|
import {
|
|
5293
5438
|
createColumnMenuController
|
|
5294
5439
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5299,17 +5444,17 @@ function createColumnMenu(inputs) {
|
|
|
5299
5444
|
enableColumnMenu: inputs.enableColumnMenu(),
|
|
5300
5445
|
gridRootRef: inputs.gridRootRef
|
|
5301
5446
|
}), "render", "columnMenu");
|
|
5302
|
-
const
|
|
5303
|
-
const openedColumnKey =
|
|
5304
|
-
const openedColumn =
|
|
5447
|
+
const snapshot2 = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5448
|
+
const openedColumnKey = createMemo11(() => snapshot2().columnKey);
|
|
5449
|
+
const openedColumn = createMemo11(() => {
|
|
5305
5450
|
const key = openedColumnKey();
|
|
5306
5451
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5307
5452
|
});
|
|
5308
5453
|
return {
|
|
5309
5454
|
openedColumnKey,
|
|
5310
5455
|
openedColumn,
|
|
5311
|
-
layout:
|
|
5312
|
-
isOpen:
|
|
5456
|
+
layout: createMemo11(() => snapshot2().layout),
|
|
5457
|
+
isOpen: createMemo11(() => openedColumnKey() !== null),
|
|
5313
5458
|
panelRef: controller.panelRef,
|
|
5314
5459
|
openFromButton: controller.openFromButton,
|
|
5315
5460
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5320,7 +5465,7 @@ function createColumnMenu(inputs) {
|
|
|
5320
5465
|
}
|
|
5321
5466
|
|
|
5322
5467
|
// src/view/ColumnMenuPopover.tsx
|
|
5323
|
-
import { For as For6, Show as Show12, createEffect as createEffect5, createMemo as
|
|
5468
|
+
import { For as For6, Show as Show12, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal10, createUniqueId as createUniqueId4, onCleanup as onCleanup9 } from "solid-js";
|
|
5324
5469
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5325
5470
|
var PINNED_ITEMS = [
|
|
5326
5471
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5338,17 +5483,17 @@ function ColumnMenuPopover(props) {
|
|
|
5338
5483
|
const texts = useFeatureLocaleText();
|
|
5339
5484
|
const portal = useGridPortal();
|
|
5340
5485
|
const container = portal.container();
|
|
5341
|
-
const [panel, setPanel] =
|
|
5486
|
+
const [panel, setPanel] = createSignal10();
|
|
5342
5487
|
let panelElement;
|
|
5343
|
-
|
|
5488
|
+
onCleanup9(() => {
|
|
5344
5489
|
if (props.panelRef.current === panelElement) {
|
|
5345
5490
|
props.panelRef.current = null;
|
|
5346
5491
|
}
|
|
5347
5492
|
});
|
|
5348
|
-
const layout =
|
|
5349
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5493
|
+
const layout = createMemo12(() => props.layout);
|
|
5494
|
+
const [openSubmenu, setOpenSubmenu] = createSignal10(null);
|
|
5350
5495
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5351
|
-
const isPinSubmenuOpen =
|
|
5496
|
+
const isPinSubmenuOpen = createMemo12(() => {
|
|
5352
5497
|
const current = openSubmenu();
|
|
5353
5498
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5354
5499
|
});
|
|
@@ -5363,8 +5508,8 @@ function ColumnMenuPopover(props) {
|
|
|
5363
5508
|
{ name: "columnMenuScrollReset" }
|
|
5364
5509
|
);
|
|
5365
5510
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5366
|
-
const submenuInline =
|
|
5367
|
-
const [pinSubmenu, setPinSubmenu] =
|
|
5511
|
+
const submenuInline = createMemo12(() => layout().maxHeight !== void 0);
|
|
5512
|
+
const [pinSubmenu, setPinSubmenu] = createSignal10();
|
|
5368
5513
|
let pinSubmenuElement;
|
|
5369
5514
|
createPortalTokens(
|
|
5370
5515
|
() => isPinSubmenuOpen() && !submenuInline() ? pinSubmenu() : void 0,
|
|
@@ -5864,25 +6009,23 @@ var conditionalFormatFeature = {
|
|
|
5864
6009
|
|
|
5865
6010
|
// src/features/contextMenu.ts
|
|
5866
6011
|
import {
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
resolveContextMenuColIndex
|
|
6012
|
+
buildBodyContextMenuParams,
|
|
6013
|
+
buildCellContextMenuParams
|
|
5870
6014
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/contextMenuTarget";
|
|
5871
6015
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5872
|
-
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
5873
6016
|
|
|
5874
6017
|
// src/primitives/contextMenu.ts
|
|
5875
|
-
import { createMemo as
|
|
6018
|
+
import { createMemo as createMemo13 } from "solid-js";
|
|
5876
6019
|
import {
|
|
5877
6020
|
createContextMenuController
|
|
5878
6021
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
5879
6022
|
function createCellContextMenu(inputs) {
|
|
5880
6023
|
const controller = createContextMenuController();
|
|
5881
6024
|
connectController(controller, () => ({ gridRootRef: inputs.gridRootRef }), "render", "contextMenu");
|
|
5882
|
-
const
|
|
6025
|
+
const snapshot2 = createExternalStoreSignal(controller, "contextMenuStore");
|
|
5883
6026
|
return {
|
|
5884
|
-
snapshot,
|
|
5885
|
-
isOpen:
|
|
6027
|
+
snapshot: snapshot2,
|
|
6028
|
+
isOpen: createMemo13(() => snapshot2().state !== null),
|
|
5886
6029
|
open: controller.open,
|
|
5887
6030
|
close: controller.close,
|
|
5888
6031
|
panelRef: controller.panelRef
|
|
@@ -5890,19 +6033,19 @@ function createCellContextMenu(inputs) {
|
|
|
5890
6033
|
}
|
|
5891
6034
|
|
|
5892
6035
|
// src/view/CellContextMenuPopover.tsx
|
|
5893
|
-
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as
|
|
6036
|
+
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as createMemo14, createSignal as createSignal11, onCleanup as onCleanup10 } from "solid-js";
|
|
5894
6037
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5895
6038
|
function CellContextMenuPopover(props) {
|
|
5896
6039
|
const portal = useGridPortal();
|
|
5897
6040
|
const container = portal.container();
|
|
5898
|
-
const [panel, setPanel] =
|
|
6041
|
+
const [panel, setPanel] = createSignal11();
|
|
5899
6042
|
let panelElement;
|
|
5900
|
-
|
|
6043
|
+
onCleanup10(() => {
|
|
5901
6044
|
if (props.panelRef.current === panelElement) {
|
|
5902
6045
|
props.panelRef.current = null;
|
|
5903
6046
|
}
|
|
5904
6047
|
});
|
|
5905
|
-
const layout =
|
|
6048
|
+
const layout = createMemo14(() => props.layout);
|
|
5906
6049
|
const element = <Show14 when={container}>
|
|
5907
6050
|
{(mount) => <Portal3 mount={mount()}>
|
|
5908
6051
|
<div
|
|
@@ -5996,95 +6139,6 @@ function ActionItem(props) {
|
|
|
5996
6139
|
}
|
|
5997
6140
|
|
|
5998
6141
|
// src/features/contextMenu.ts
|
|
5999
|
-
var buildCellContextMenuParams = ({
|
|
6000
|
-
cell,
|
|
6001
|
-
clientX,
|
|
6002
|
-
clientY,
|
|
6003
|
-
rowModel,
|
|
6004
|
-
orderedColumns,
|
|
6005
|
-
selection,
|
|
6006
|
-
activeCell
|
|
6007
|
-
}) => {
|
|
6008
|
-
const rowIndex = cell.row;
|
|
6009
|
-
const colIndex = cell.col;
|
|
6010
|
-
const row = rowModel.getRow(rowIndex);
|
|
6011
|
-
const column = orderedColumns[colIndex];
|
|
6012
|
-
if (!row || !column) {
|
|
6013
|
-
return null;
|
|
6014
|
-
}
|
|
6015
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
6016
|
-
return {
|
|
6017
|
-
target: {
|
|
6018
|
-
type: "cell",
|
|
6019
|
-
rowIndex,
|
|
6020
|
-
colIndex,
|
|
6021
|
-
rowKey,
|
|
6022
|
-
row,
|
|
6023
|
-
column,
|
|
6024
|
-
value: getCellValue3(row, column)
|
|
6025
|
-
},
|
|
6026
|
-
clientX,
|
|
6027
|
-
clientY,
|
|
6028
|
-
selection,
|
|
6029
|
-
activeCell,
|
|
6030
|
-
isTargetSelected: isContextMenuCellSelected(selection, rowIndex, colIndex)
|
|
6031
|
-
};
|
|
6032
|
-
};
|
|
6033
|
-
var buildBodyContextMenuParams = ({
|
|
6034
|
-
event,
|
|
6035
|
-
rowModel,
|
|
6036
|
-
orderedColumns,
|
|
6037
|
-
selection,
|
|
6038
|
-
activeCell
|
|
6039
|
-
}) => {
|
|
6040
|
-
const targetEl = event.target;
|
|
6041
|
-
if (!targetEl) {
|
|
6042
|
-
return null;
|
|
6043
|
-
}
|
|
6044
|
-
const rowEl = targetEl.closest("[data-row-index]");
|
|
6045
|
-
if (!rowEl) {
|
|
6046
|
-
return null;
|
|
6047
|
-
}
|
|
6048
|
-
const rowIndexRaw = rowEl.dataset.rowIndex;
|
|
6049
|
-
if (rowIndexRaw === void 0) {
|
|
6050
|
-
return null;
|
|
6051
|
-
}
|
|
6052
|
-
const rowIndex = Number(rowIndexRaw);
|
|
6053
|
-
if (!Number.isInteger(rowIndex)) {
|
|
6054
|
-
return null;
|
|
6055
|
-
}
|
|
6056
|
-
const row = rowModel.getRow(rowIndex);
|
|
6057
|
-
if (!row) {
|
|
6058
|
-
return null;
|
|
6059
|
-
}
|
|
6060
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
6061
|
-
const cellEl = targetEl.closest("[data-ssg-col-key]");
|
|
6062
|
-
const colKey = cellEl?.dataset.ssgColKey;
|
|
6063
|
-
if (cellEl && colKey !== void 0) {
|
|
6064
|
-
const colIndex = resolveContextMenuColIndex(orderedColumns, colKey);
|
|
6065
|
-
if (colIndex < 0) {
|
|
6066
|
-
return null;
|
|
6067
|
-
}
|
|
6068
|
-
return buildCellContextMenuParams({
|
|
6069
|
-
cell: { row: rowIndex, col: colIndex },
|
|
6070
|
-
clientX: event.clientX,
|
|
6071
|
-
clientY: event.clientY,
|
|
6072
|
-
rowModel,
|
|
6073
|
-
orderedColumns,
|
|
6074
|
-
selection,
|
|
6075
|
-
activeCell
|
|
6076
|
-
});
|
|
6077
|
-
}
|
|
6078
|
-
const target = { type: "rowHeader", rowIndex, rowKey, row };
|
|
6079
|
-
return {
|
|
6080
|
-
target,
|
|
6081
|
-
clientX: event.clientX,
|
|
6082
|
-
clientY: event.clientY,
|
|
6083
|
-
selection,
|
|
6084
|
-
activeCell,
|
|
6085
|
-
isTargetSelected: isContextMenuRowSelected(selection, rowIndex)
|
|
6086
|
-
};
|
|
6087
|
-
};
|
|
6088
6142
|
var contextMenuFeature = {
|
|
6089
6143
|
// メニューの読み上げの名前の既定(シェルが本体の既定に重ねる)。
|
|
6090
6144
|
localeText: DEFAULT_CONTEXT_MENU_LOCALE_TEXT,
|
|
@@ -6104,7 +6158,7 @@ var exportFeature = {
|
|
|
6104
6158
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6105
6159
|
|
|
6106
6160
|
// src/primitives/fillHandle.ts
|
|
6107
|
-
import { createMemo as
|
|
6161
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
6108
6162
|
import {
|
|
6109
6163
|
createFillHandleController
|
|
6110
6164
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -6122,11 +6176,11 @@ import {
|
|
|
6122
6176
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
6123
6177
|
function createFillHandle(inputs) {
|
|
6124
6178
|
const controller = createFillHandleController();
|
|
6125
|
-
const options =
|
|
6179
|
+
const options = createMemo15(() => {
|
|
6126
6180
|
const fillHandle = inputs.fillHandle();
|
|
6127
6181
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
6128
6182
|
});
|
|
6129
|
-
const enabled =
|
|
6183
|
+
const enabled = createMemo15(
|
|
6130
6184
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
6131
6185
|
);
|
|
6132
6186
|
connectController(controller, () => {
|
|
@@ -6163,18 +6217,18 @@ function createFillHandle(inputs) {
|
|
|
6163
6217
|
applyServerSideCellEdits: inputs.applyServerSideCellEdits()
|
|
6164
6218
|
};
|
|
6165
6219
|
}, "render", "fillHandle");
|
|
6166
|
-
const
|
|
6167
|
-
const rowMetrics =
|
|
6168
|
-
const windowFirstRow =
|
|
6169
|
-
const windowLastRow =
|
|
6170
|
-
const detailActive =
|
|
6171
|
-
const detailExtras =
|
|
6172
|
-
const verticalScaleFactor =
|
|
6173
|
-
const paneLayout =
|
|
6174
|
-
const viewportHeight =
|
|
6175
|
-
const scrollTop =
|
|
6176
|
-
const headerHeight =
|
|
6177
|
-
const corner =
|
|
6220
|
+
const snapshot2 = createExternalStoreSignal(controller, "fillHandleStore");
|
|
6221
|
+
const rowMetrics = createMemo15(() => inputs.vertical().rowMetrics);
|
|
6222
|
+
const windowFirstRow = createMemo15(() => inputs.vertical().windowFirstRow);
|
|
6223
|
+
const windowLastRow = createMemo15(() => inputs.vertical().windowLastRow);
|
|
6224
|
+
const detailActive = createMemo15(() => inputs.vertical().detailActive);
|
|
6225
|
+
const detailExtras = createMemo15(() => inputs.vertical().detailExtras);
|
|
6226
|
+
const verticalScaleFactor = createMemo15(() => inputs.vertical().verticalScaleFactor);
|
|
6227
|
+
const paneLayout = createMemo15(inputs.paneLayout);
|
|
6228
|
+
const viewportHeight = createMemo15(inputs.viewportHeight);
|
|
6229
|
+
const scrollTop = createMemo15(inputs.scrollTop);
|
|
6230
|
+
const headerHeight = createMemo15(inputs.headerHeight);
|
|
6231
|
+
const corner = createMemo15(() => {
|
|
6178
6232
|
const ui = inputs.uiState();
|
|
6179
6233
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6180
6234
|
return null;
|
|
@@ -6187,8 +6241,8 @@ function createFillHandle(inputs) {
|
|
|
6187
6241
|
}
|
|
6188
6242
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6189
6243
|
});
|
|
6190
|
-
const previewSelection =
|
|
6191
|
-
const current =
|
|
6244
|
+
const previewSelection = createMemo15(() => {
|
|
6245
|
+
const current = snapshot2();
|
|
6192
6246
|
if (current.status !== "dragging" || current.target === null) {
|
|
6193
6247
|
return null;
|
|
6194
6248
|
}
|
|
@@ -6207,7 +6261,7 @@ function createFillHandle(inputs) {
|
|
|
6207
6261
|
}
|
|
6208
6262
|
};
|
|
6209
6263
|
});
|
|
6210
|
-
const previewGeometry =
|
|
6264
|
+
const previewGeometry = createMemo15(() => {
|
|
6211
6265
|
const selection = previewSelection();
|
|
6212
6266
|
if (selection === null) {
|
|
6213
6267
|
return null;
|
|
@@ -6240,8 +6294,8 @@ function createFillHandle(inputs) {
|
|
|
6240
6294
|
}
|
|
6241
6295
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6242
6296
|
};
|
|
6243
|
-
const chip =
|
|
6244
|
-
const current =
|
|
6297
|
+
const chip = createMemo15(() => {
|
|
6298
|
+
const current = snapshot2();
|
|
6245
6299
|
if (current.status !== "filled") {
|
|
6246
6300
|
return null;
|
|
6247
6301
|
}
|
|
@@ -6261,9 +6315,9 @@ function createFillHandle(inputs) {
|
|
|
6261
6315
|
});
|
|
6262
6316
|
return {
|
|
6263
6317
|
controller,
|
|
6264
|
-
snapshot,
|
|
6318
|
+
snapshot: snapshot2,
|
|
6265
6319
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6266
|
-
filling:
|
|
6320
|
+
filling: createMemo15(() => snapshot2().status === "dragging"),
|
|
6267
6321
|
corner,
|
|
6268
6322
|
previewRects,
|
|
6269
6323
|
chip
|
|
@@ -6271,9 +6325,10 @@ function createFillHandle(inputs) {
|
|
|
6271
6325
|
}
|
|
6272
6326
|
|
|
6273
6327
|
// src/view/FillHandleLayer.tsx
|
|
6274
|
-
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as
|
|
6328
|
+
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as createMemo16, createSignal as createSignal12, onCleanup as onCleanup11 } from "solid-js";
|
|
6275
6329
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6276
|
-
import { formatLocaleText as
|
|
6330
|
+
import { formatLocaleText as formatLocaleText7 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6331
|
+
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
6277
6332
|
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
6278
6333
|
function FillHandleLayer(props) {
|
|
6279
6334
|
const corner = () => {
|
|
@@ -6284,9 +6339,9 @@ function FillHandleLayer(props) {
|
|
|
6284
6339
|
const current = props.fill.chip();
|
|
6285
6340
|
return current?.pane === props.pane ? current.position : null;
|
|
6286
6341
|
};
|
|
6287
|
-
const filled =
|
|
6288
|
-
const
|
|
6289
|
-
return
|
|
6342
|
+
const filled = createMemo16(() => {
|
|
6343
|
+
const snapshot2 = props.fill.snapshot();
|
|
6344
|
+
return snapshot2.status === "filled" ? snapshot2 : null;
|
|
6290
6345
|
});
|
|
6291
6346
|
return <>
|
|
6292
6347
|
{
|
|
@@ -6325,13 +6380,13 @@ function FillHandleLayer(props) {
|
|
|
6325
6380
|
/* 埋めたあとのボタン(左上の位置)。 */
|
|
6326
6381
|
}
|
|
6327
6382
|
<Show15 when={filled()}>
|
|
6328
|
-
{(
|
|
6383
|
+
{(snapshot2) => <Show15 when={chip()}>
|
|
6329
6384
|
{(position) => <FillOptionsChip
|
|
6330
6385
|
fill={props.fill}
|
|
6331
6386
|
x={props.leadingWidth + position().x}
|
|
6332
6387
|
y={props.headerHeight + position().y - props.baseOffset}
|
|
6333
|
-
kind={
|
|
6334
|
-
menuOpen={
|
|
6388
|
+
kind={snapshot2().kind}
|
|
6389
|
+
menuOpen={snapshot2().menu !== null}
|
|
6335
6390
|
/>}
|
|
6336
6391
|
</Show15>}
|
|
6337
6392
|
</Show15>
|
|
@@ -6341,7 +6396,7 @@ function FillOptionsChip(props) {
|
|
|
6341
6396
|
const texts = useFeatureLocaleText();
|
|
6342
6397
|
const { chipElement } = props.fill.controller;
|
|
6343
6398
|
let element;
|
|
6344
|
-
|
|
6399
|
+
onCleanup11(() => {
|
|
6345
6400
|
if (chipElement.current === element) {
|
|
6346
6401
|
chipElement.current = null;
|
|
6347
6402
|
}
|
|
@@ -6355,7 +6410,7 @@ function FillOptionsChip(props) {
|
|
|
6355
6410
|
class={["ssg-fill-options", { "ssg-fill-options--open": props.menuOpen }]}
|
|
6356
6411
|
style={{ position: "absolute", left: px(props.x), top: px(props.y) }}
|
|
6357
6412
|
data-ssg-fill-options=""
|
|
6358
|
-
aria-label={
|
|
6413
|
+
aria-label={formatLocaleText7(texts().fillOptionsCurrent, {
|
|
6359
6414
|
kind: props.kind === "series" ? texts().fillSeries : texts().fillCopy
|
|
6360
6415
|
})}
|
|
6361
6416
|
aria-haspopup="menu"
|
|
@@ -6395,10 +6450,10 @@ function FillOptionsMenu(props) {
|
|
|
6395
6450
|
const texts = useFeatureLocaleText();
|
|
6396
6451
|
const portal = useGridPortal();
|
|
6397
6452
|
const container = portal.container();
|
|
6398
|
-
const [panel, setPanel] =
|
|
6453
|
+
const [panel, setPanel] = createSignal12();
|
|
6399
6454
|
const { menuPanel } = props.fill.controller;
|
|
6400
6455
|
let panelElement;
|
|
6401
|
-
|
|
6456
|
+
onCleanup11(() => {
|
|
6402
6457
|
if (menuPanel.current === panelElement) {
|
|
6403
6458
|
menuPanel.current = null;
|
|
6404
6459
|
}
|
|
@@ -6412,7 +6467,7 @@ function FillOptionsMenu(props) {
|
|
|
6412
6467
|
const items = Array.from(
|
|
6413
6468
|
panel()?.querySelectorAll('[role="menuitemradio"]:not(:disabled)') ?? []
|
|
6414
6469
|
);
|
|
6415
|
-
const index = items.findIndex((item) => item ===
|
|
6470
|
+
const index = items.findIndex((item) => item === getActiveElement(item));
|
|
6416
6471
|
const next = items[(index + (event.key === "ArrowDown" ? 1 : items.length - 1)) % items.length];
|
|
6417
6472
|
next?.focus({ preventScroll: true });
|
|
6418
6473
|
} else if (readEventKey(event) === "Tab") {
|
|
@@ -6471,9 +6526,9 @@ function FillTooltip(props) {
|
|
|
6471
6526
|
subscribe: props.fill.controller.subscribePointer,
|
|
6472
6527
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6473
6528
|
}, "fillPointerStore");
|
|
6474
|
-
const visible =
|
|
6475
|
-
const container =
|
|
6476
|
-
const [tooltip, setTooltip] =
|
|
6529
|
+
const visible = createMemo16(() => pointer() !== null);
|
|
6530
|
+
const container = createMemo16(() => visible() ? portal.container() : null);
|
|
6531
|
+
const [tooltip, setTooltip] = createSignal12();
|
|
6477
6532
|
const element = <Show15 when={container()}>
|
|
6478
6533
|
{(mount) => <Portal4 mount={mount()}>
|
|
6479
6534
|
<div
|
|
@@ -6494,22 +6549,22 @@ function FillTooltip(props) {
|
|
|
6494
6549
|
return element;
|
|
6495
6550
|
}
|
|
6496
6551
|
function FillHandlePortals(props) {
|
|
6497
|
-
const menu =
|
|
6498
|
-
const
|
|
6499
|
-
return
|
|
6552
|
+
const menu = createMemo16(() => {
|
|
6553
|
+
const snapshot2 = props.fill.snapshot();
|
|
6554
|
+
return snapshot2.status === "filled" && snapshot2.menu !== null ? snapshot2 : null;
|
|
6500
6555
|
});
|
|
6501
|
-
const tooltipText =
|
|
6502
|
-
const
|
|
6503
|
-
return
|
|
6556
|
+
const tooltipText = createMemo16(() => {
|
|
6557
|
+
const snapshot2 = props.fill.snapshot();
|
|
6558
|
+
return snapshot2.status === "dragging" ? snapshot2.previewText : null;
|
|
6504
6559
|
});
|
|
6505
6560
|
return <>
|
|
6506
6561
|
<Show15 when={menu()}>
|
|
6507
|
-
{(
|
|
6562
|
+
{(snapshot2) => <Show15 when={snapshot2().menu}>
|
|
6508
6563
|
{(layout) => <FillOptionsMenu
|
|
6509
6564
|
fill={props.fill}
|
|
6510
6565
|
layout={layout()}
|
|
6511
|
-
kind={
|
|
6512
|
-
seriesAvailable={
|
|
6566
|
+
kind={snapshot2().kind}
|
|
6567
|
+
seriesAvailable={snapshot2().seriesAvailable}
|
|
6513
6568
|
themeClassName={props.themeClassName}
|
|
6514
6569
|
/>}
|
|
6515
6570
|
</Show15>}
|
|
@@ -6536,7 +6591,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6536
6591
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6537
6592
|
|
|
6538
6593
|
// src/primitives/filterOrder.ts
|
|
6539
|
-
import { createMemo as
|
|
6594
|
+
import { createMemo as createMemo17 } from "solid-js";
|
|
6540
6595
|
import {
|
|
6541
6596
|
createGlobalFilteredOrderRunner,
|
|
6542
6597
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6549,11 +6604,11 @@ import {
|
|
|
6549
6604
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6550
6605
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6551
6606
|
function createFilterOrder(inputs) {
|
|
6552
|
-
const visibleColumns =
|
|
6553
|
-
const globalFilterColumns =
|
|
6554
|
-
const text =
|
|
6555
|
-
const needle =
|
|
6556
|
-
const key =
|
|
6607
|
+
const visibleColumns = createMemo17(() => inputs.visibleColumns());
|
|
6608
|
+
const globalFilterColumns = createMemo17(() => toGlobalFilterColumns(visibleColumns(), inputs.globalFilterMatch()));
|
|
6609
|
+
const text = createMemo17(() => inputs.globalFilterText());
|
|
6610
|
+
const needle = createMemo17(() => text().trim().toLowerCase());
|
|
6611
|
+
const key = createMemo17(
|
|
6557
6612
|
() => ({
|
|
6558
6613
|
rows: inputs.rows(),
|
|
6559
6614
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6563,36 +6618,36 @@ function createFilterOrder(inputs) {
|
|
|
6563
6618
|
{ equals: sameGlobalFilterKey }
|
|
6564
6619
|
);
|
|
6565
6620
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6566
|
-
const syncResult =
|
|
6621
|
+
const syncResult = createMemo17(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6567
6622
|
const runner = createGlobalFilteredOrderRunner();
|
|
6568
6623
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6569
|
-
const
|
|
6570
|
-
const result =
|
|
6571
|
-
const columnFilters =
|
|
6572
|
-
const relativeDateFilterActive =
|
|
6624
|
+
const snapshot2 = createExternalStoreSignal(runner, "globalFilterStore");
|
|
6625
|
+
const result = createMemo17(() => selectGlobalFilteredOrderResult(syncResult(), snapshot2(), key()));
|
|
6626
|
+
const columnFilters = createMemo17(() => inputs.columnFilters());
|
|
6627
|
+
const relativeDateFilterActive = createMemo17(
|
|
6573
6628
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6574
6629
|
);
|
|
6575
6630
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6576
6631
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6577
|
-
const relativeDateKey =
|
|
6632
|
+
const relativeDateKey = createMemo17(
|
|
6578
6633
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6579
6634
|
);
|
|
6580
6635
|
return {
|
|
6581
|
-
globalFilteredOrder:
|
|
6582
|
-
globalFilterStatus:
|
|
6583
|
-
globalFilterProgress:
|
|
6636
|
+
globalFilteredOrder: createMemo17(() => result().order),
|
|
6637
|
+
globalFilterStatus: createMemo17(() => result().status),
|
|
6638
|
+
globalFilterProgress: createMemo17(() => result().progress),
|
|
6584
6639
|
relativeDateKey
|
|
6585
6640
|
};
|
|
6586
6641
|
}
|
|
6587
6642
|
|
|
6588
6643
|
// src/primitives/filterPopover.ts
|
|
6589
|
-
import { createMemo as
|
|
6644
|
+
import { createMemo as createMemo18, createSignal as createSignal13, untrack as untrack14 } from "solid-js";
|
|
6590
6645
|
import {
|
|
6591
6646
|
createFilterPopoverController,
|
|
6592
6647
|
resolveOpenedFilterColumn
|
|
6593
6648
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/filterPopoverController";
|
|
6594
6649
|
import { inferColumnFilterType } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/inferFilterType";
|
|
6595
|
-
import { getCellValue as
|
|
6650
|
+
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
6596
6651
|
import { GROUP_AUTO_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
6597
6652
|
var NO_GROUP_COLUMNS = [];
|
|
6598
6653
|
function createFilterPopover(inputs) {
|
|
@@ -6616,7 +6671,7 @@ function createFilterPopover(inputs) {
|
|
|
6616
6671
|
// ラベル行は空として数えます(見出しの文字で数値の列が文字の列に推定されないように)。
|
|
6617
6672
|
getRawValueAt: (index) => {
|
|
6618
6673
|
const row = rows[index];
|
|
6619
|
-
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 :
|
|
6674
|
+
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 : getCellValue3(row, column);
|
|
6620
6675
|
}
|
|
6621
6676
|
});
|
|
6622
6677
|
if (result.conclusive) {
|
|
@@ -6624,16 +6679,16 @@ function createFilterPopover(inputs) {
|
|
|
6624
6679
|
}
|
|
6625
6680
|
return result.filterType;
|
|
6626
6681
|
});
|
|
6627
|
-
const groupColumns =
|
|
6628
|
-
const popoverColumns =
|
|
6682
|
+
const groupColumns = createMemo18(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
6683
|
+
const popoverColumns = createMemo18(() => {
|
|
6629
6684
|
const groups = groupColumns();
|
|
6630
6685
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6631
6686
|
});
|
|
6632
6687
|
const resolveAnchorColumnKey = (columnKey) => untrack14(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6633
|
-
const
|
|
6634
|
-
const state =
|
|
6635
|
-
const layout =
|
|
6636
|
-
const [panel, setPanel] =
|
|
6688
|
+
const snapshot2 = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6689
|
+
const state = createMemo18(() => snapshot2().state);
|
|
6690
|
+
const layout = createMemo18(() => snapshot2().layout);
|
|
6691
|
+
const [panel, setPanel] = createSignal13(null);
|
|
6637
6692
|
connectController(
|
|
6638
6693
|
controller,
|
|
6639
6694
|
() => {
|
|
@@ -6652,9 +6707,9 @@ function createFilterPopover(inputs) {
|
|
|
6652
6707
|
"effect",
|
|
6653
6708
|
"filterPopover"
|
|
6654
6709
|
);
|
|
6655
|
-
const openedColumnKey =
|
|
6656
|
-
const openedFilterType =
|
|
6657
|
-
const openedColumn =
|
|
6710
|
+
const openedColumnKey = createMemo18(() => state()?.columnKey ?? null);
|
|
6711
|
+
const openedFilterType = createMemo18(() => state()?.filterType ?? null);
|
|
6712
|
+
const openedColumn = createMemo18(() => {
|
|
6658
6713
|
openedColumnKey();
|
|
6659
6714
|
openedFilterType();
|
|
6660
6715
|
return resolveOpenedFilterColumn(popoverColumns(), untrack14(state));
|
|
@@ -6664,7 +6719,7 @@ function createFilterPopover(inputs) {
|
|
|
6664
6719
|
layout,
|
|
6665
6720
|
openedColumn,
|
|
6666
6721
|
openedFilterType,
|
|
6667
|
-
isOpen:
|
|
6722
|
+
isOpen: createMemo18(() => state() !== null),
|
|
6668
6723
|
setPanel: (element) => {
|
|
6669
6724
|
controller.panelRef.current = element;
|
|
6670
6725
|
setPanel(element);
|
|
@@ -6682,13 +6737,13 @@ function createFilterPopover(inputs) {
|
|
|
6682
6737
|
}
|
|
6683
6738
|
|
|
6684
6739
|
// src/primitives/filterManagement.ts
|
|
6685
|
-
import { createMemo as
|
|
6740
|
+
import { createMemo as createMemo19, onCleanup as onCleanup12, untrack as untrack15 } from "solid-js";
|
|
6686
6741
|
import {
|
|
6687
6742
|
createColumnFilterDescribeOptions,
|
|
6688
6743
|
describeColumnFilterValue
|
|
6689
6744
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6690
6745
|
import { isActiveColumnFilterValue as isActiveColumnFilterValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6691
|
-
import { formatLocaleText as
|
|
6746
|
+
import { formatLocaleText as formatLocaleText8 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6692
6747
|
import {
|
|
6693
6748
|
computeSinglePaneColumnExtent as computeSinglePaneColumnExtent2
|
|
6694
6749
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry";
|
|
@@ -6698,9 +6753,9 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6698
6753
|
var NO_COLUMNS2 = [];
|
|
6699
6754
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6700
6755
|
function createFilterManagement(inputs) {
|
|
6701
|
-
const groupColumns =
|
|
6702
|
-
const groupColumnKeys =
|
|
6703
|
-
const entries =
|
|
6756
|
+
const groupColumns = createMemo19(() => inputs.groupColumns?.() ?? NO_COLUMNS2);
|
|
6757
|
+
const groupColumnKeys = createMemo19(() => new Set(groupColumns().map((column) => column.key)));
|
|
6758
|
+
const entries = createMemo19(() => {
|
|
6704
6759
|
const columnFilters = inputs.columnFilters();
|
|
6705
6760
|
const texts = inputs.localeTexts();
|
|
6706
6761
|
const result = [];
|
|
@@ -6732,18 +6787,18 @@ function createFilterManagement(inputs) {
|
|
|
6732
6787
|
}
|
|
6733
6788
|
return result;
|
|
6734
6789
|
});
|
|
6735
|
-
const addableColumns =
|
|
6790
|
+
const addableColumns = createMemo19(() => {
|
|
6736
6791
|
const columnFilters = inputs.columnFilters();
|
|
6737
6792
|
const texts = inputs.localeTexts();
|
|
6738
6793
|
const grouped = groupColumnKeys();
|
|
6739
6794
|
return [...inputs.visibleColumns(), ...groupColumns()].filter((column) => Boolean(column.filterType) && !isActiveColumnFilterValue2(columnFilters[column.key])).map((column) => ({
|
|
6740
6795
|
key: column.key,
|
|
6741
|
-
title: grouped.has(column.key) ?
|
|
6796
|
+
title: grouped.has(column.key) ? formatLocaleText8(texts.groupedColumnTitle, { column: column.title || column.key }) : column.title || column.key
|
|
6742
6797
|
}));
|
|
6743
6798
|
});
|
|
6744
6799
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
6745
6800
|
let disposed = false;
|
|
6746
|
-
|
|
6801
|
+
onCleanup12(() => {
|
|
6747
6802
|
disposed = true;
|
|
6748
6803
|
for (const frame of pendingFrames) {
|
|
6749
6804
|
cancelAnimationFrame(frame);
|
|
@@ -6822,7 +6877,7 @@ function createFilterManagement(inputs) {
|
|
|
6822
6877
|
}
|
|
6823
6878
|
|
|
6824
6879
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6825
|
-
import { Show as Show16, createMemo as
|
|
6880
|
+
import { Show as Show16, createMemo as createMemo20, untrack as untrack16 } from "solid-js";
|
|
6826
6881
|
import {
|
|
6827
6882
|
createFilterPopoverCommands,
|
|
6828
6883
|
createFilterPopoverDerivedResolver
|
|
@@ -6849,17 +6904,17 @@ import {
|
|
|
6849
6904
|
describeColumnFilterValue as describeColumnFilterValue2
|
|
6850
6905
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6851
6906
|
import { normalizeDateFilterPresets } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
|
|
6852
|
-
import { formatLocaleText as
|
|
6853
|
-
import { getCellValue as
|
|
6907
|
+
import { formatLocaleText as formatLocaleText9 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6908
|
+
import { getCellValue as getCellValue4 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
6854
6909
|
function ColumnFilterPopoverHost(props) {
|
|
6855
6910
|
const filterPopover = props.filterPopover;
|
|
6856
6911
|
const openedColumn = filterPopover.openedColumn;
|
|
6857
6912
|
const openedType = filterPopover.openedFilterType;
|
|
6858
|
-
const openedOptionsKey =
|
|
6913
|
+
const openedOptionsKey = createMemo20(() => {
|
|
6859
6914
|
const column = openedColumn();
|
|
6860
6915
|
return column ? String(column.key) : null;
|
|
6861
6916
|
});
|
|
6862
|
-
const optionRowsHold =
|
|
6917
|
+
const optionRowsHold = createMemo20((prev) => {
|
|
6863
6918
|
const key = openedOptionsKey();
|
|
6864
6919
|
const rows = props.rows;
|
|
6865
6920
|
if (key === null) {
|
|
@@ -6870,9 +6925,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6870
6925
|
}
|
|
6871
6926
|
return prev;
|
|
6872
6927
|
});
|
|
6873
|
-
const optionRows =
|
|
6874
|
-
const openedIsDateSet =
|
|
6875
|
-
const getOpenedColumnRawValueAt =
|
|
6928
|
+
const optionRows = createMemo20(() => optionRowsHold().rows);
|
|
6929
|
+
const openedIsDateSet = createMemo20(() => openedType() === "dateSet");
|
|
6930
|
+
const getOpenedColumnRawValueAt = createMemo20(() => {
|
|
6876
6931
|
const rows = optionRows();
|
|
6877
6932
|
const column = openedColumn();
|
|
6878
6933
|
const isDateSet = openedIsDateSet();
|
|
@@ -6880,11 +6935,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6880
6935
|
if (!column) {
|
|
6881
6936
|
return void 0;
|
|
6882
6937
|
}
|
|
6883
|
-
const value =
|
|
6938
|
+
const value = getCellValue4(rows[index], column);
|
|
6884
6939
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6885
6940
|
};
|
|
6886
6941
|
});
|
|
6887
|
-
const usesAsyncOptions =
|
|
6942
|
+
const usesAsyncOptions = createMemo20(() => {
|
|
6888
6943
|
const column = openedColumn();
|
|
6889
6944
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
6890
6945
|
});
|
|
@@ -6901,12 +6956,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6901
6956
|
};
|
|
6902
6957
|
}, "render", "filterOptionsSource");
|
|
6903
6958
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
6904
|
-
const collectColumn =
|
|
6905
|
-
const numeric =
|
|
6906
|
-
const syncResult =
|
|
6959
|
+
const collectColumn = createMemo20(() => usesAsyncOptions() ? null : openedColumn());
|
|
6960
|
+
const numeric = createMemo20(() => openedType() === "numberSet");
|
|
6961
|
+
const syncResult = createMemo20(
|
|
6907
6962
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
6908
6963
|
);
|
|
6909
|
-
const sourceKey =
|
|
6964
|
+
const sourceKey = createMemo20(() => {
|
|
6910
6965
|
const column = collectColumn();
|
|
6911
6966
|
return column === null ? void 0 : String(column.key);
|
|
6912
6967
|
});
|
|
@@ -6919,14 +6974,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6919
6974
|
sourceKey: sourceKey()
|
|
6920
6975
|
}), "render", "filterValueCollector");
|
|
6921
6976
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
6922
|
-
const optionsResult =
|
|
6977
|
+
const optionsResult = createMemo20(() => {
|
|
6923
6978
|
if (usesAsyncOptions()) {
|
|
6924
6979
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
6925
6980
|
}
|
|
6926
6981
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
6927
6982
|
});
|
|
6928
6983
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
6929
|
-
const derived =
|
|
6984
|
+
const derived = createMemo20(
|
|
6930
6985
|
() => resolveDerived({
|
|
6931
6986
|
openedFilterColumn: openedColumn(),
|
|
6932
6987
|
openedFilterType: openedType(),
|
|
@@ -6950,14 +7005,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6950
7005
|
filterTexts: props.localeTexts
|
|
6951
7006
|
}), "render", "filterPopoverCommands");
|
|
6952
7007
|
const texts = () => props.localeTexts;
|
|
6953
|
-
const currentValueText =
|
|
7008
|
+
const currentValueText = createMemo20(() => {
|
|
6954
7009
|
const column = openedColumn();
|
|
6955
7010
|
if (!column) {
|
|
6956
7011
|
return texts().filterCurrentNone;
|
|
6957
7012
|
}
|
|
6958
7013
|
const rawValue = props.columnFilters[column.key];
|
|
6959
7014
|
if (isSetColumnFilterValue(rawValue)) {
|
|
6960
|
-
return
|
|
7015
|
+
return formatLocaleText9(rawValue.mode === "exclude" ? texts().filterCurrentExcluded : texts().filterCurrentSelected, {
|
|
6961
7016
|
count: rawValue.values.length
|
|
6962
7017
|
});
|
|
6963
7018
|
}
|
|
@@ -6967,16 +7022,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6967
7022
|
const text = columnFilterValueToDraftText(rawValue);
|
|
6968
7023
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
6969
7024
|
});
|
|
6970
|
-
const datePresets =
|
|
7025
|
+
const datePresets = createMemo20(() => {
|
|
6971
7026
|
const column = openedColumn();
|
|
6972
7027
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
6973
7028
|
});
|
|
6974
|
-
const comboSummaryText =
|
|
7029
|
+
const comboSummaryText = createMemo20(() => {
|
|
6975
7030
|
const column = openedColumn();
|
|
6976
7031
|
const value = derived().openedSetFilterValue;
|
|
6977
7032
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
6978
7033
|
});
|
|
6979
|
-
const renderDateInput =
|
|
7034
|
+
const renderDateInput = createMemo20(() => {
|
|
6980
7035
|
const render = props.renderFilterDateInput;
|
|
6981
7036
|
const column = openedColumn();
|
|
6982
7037
|
if (!render || !column) {
|
|
@@ -7000,10 +7055,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7000
7055
|
{(layout) => <Show16 when={props.views()}>
|
|
7001
7056
|
{(views) => {
|
|
7002
7057
|
const ColumnFilterPopover = untrack16(views).ColumnFilterPopover;
|
|
7003
|
-
return <
|
|
7058
|
+
return <Show16 when={column().key} keyed>
|
|
7059
|
+
{(columnKey) => <ColumnFilterPopover
|
|
7004
7060
|
popoverSlot={props.popoverSlot}
|
|
7005
7061
|
themeClassName={props.themeClassName}
|
|
7006
|
-
title={column().title ||
|
|
7062
|
+
title={column().title || columnKey}
|
|
7007
7063
|
filterType={openedType() ?? "text"}
|
|
7008
7064
|
isServerSide={props.isServerSide && !usesAsyncOptions()}
|
|
7009
7065
|
draftValue={filterPopover.state()?.draftValue ?? ""}
|
|
@@ -7039,7 +7095,8 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7039
7095
|
onSetSelectAllChange={commands.handleSetFilterSelectAllChange}
|
|
7040
7096
|
onSetClear={commands.clearSetFilterPopoverValue}
|
|
7041
7097
|
onSetReplaceSelection={commands.handleSetFilterReplaceSelection}
|
|
7042
|
-
|
|
7098
|
+
/>}
|
|
7099
|
+
</Show16>;
|
|
7043
7100
|
}}
|
|
7044
7101
|
</Show16>}
|
|
7045
7102
|
</Show16>}
|
|
@@ -7048,7 +7105,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7048
7105
|
|
|
7049
7106
|
// src/view/GridFilterChipBar.tsx
|
|
7050
7107
|
import { For as For9, Show as Show17, createUniqueId as createUniqueId5 } from "solid-js";
|
|
7051
|
-
import { formatLocaleText as
|
|
7108
|
+
import { formatLocaleText as formatLocaleText10 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7052
7109
|
function GridFilterChipBar(props) {
|
|
7053
7110
|
const texts = useFeatureLocaleText();
|
|
7054
7111
|
const chipIdBase = createUniqueId5();
|
|
@@ -7077,7 +7134,7 @@ function GridFilterChipBar(props) {
|
|
|
7077
7134
|
class="ssg-filter-chip-clear"
|
|
7078
7135
|
disabled={!props.canFilter}
|
|
7079
7136
|
data-ssg-tooltip={texts().filterClear}
|
|
7080
|
-
aria-label={
|
|
7137
|
+
aria-label={formatLocaleText10(texts().filterClearFor, { column: entry().title })}
|
|
7081
7138
|
onClick={() => props.onClearFilter(entry().columnKey)}
|
|
7082
7139
|
>
|
|
7083
7140
|
×
|
|
@@ -7086,7 +7143,7 @@ function GridFilterChipBar(props) {
|
|
|
7086
7143
|
/* 名前の後半(操作の説明)。ボタンの中に置くと文字に混ざるので外に置きます。 */
|
|
7087
7144
|
}
|
|
7088
7145
|
<span id={`${chipIdBase}-${index()}-action`} hidden>
|
|
7089
|
-
{
|
|
7146
|
+
{formatLocaleText10(texts().filterEditFor, { column: entry().title })}
|
|
7090
7147
|
</span>
|
|
7091
7148
|
</div>}
|
|
7092
7149
|
</For9>
|
|
@@ -7103,11 +7160,11 @@ function GridFilterChipBar(props) {
|
|
|
7103
7160
|
}
|
|
7104
7161
|
|
|
7105
7162
|
// src/view/lazyPopups.ts
|
|
7106
|
-
import { createEffect as createEffect8, createMemo as
|
|
7163
|
+
import { createEffect as createEffect8, createMemo as createMemo21 } from "solid-js";
|
|
7107
7164
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
7108
7165
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
7109
|
-
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-
|
|
7110
|
-
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-
|
|
7166
|
+
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-D7INPNVB.jsx"));
|
|
7167
|
+
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-HIQGRX3N.jsx"));
|
|
7111
7168
|
var preloadGridPopups = async () => {
|
|
7112
7169
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
7113
7170
|
};
|
|
@@ -7117,7 +7174,7 @@ var reportLoadError = (error) => {
|
|
|
7117
7174
|
function createLazyModuleSignal(module, options, name) {
|
|
7118
7175
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
7119
7176
|
createEffect8(
|
|
7120
|
-
|
|
7177
|
+
createMemo21(() => options.needed() && loaded() === null),
|
|
7121
7178
|
(shouldLoad) => {
|
|
7122
7179
|
if (!shouldLoad) {
|
|
7123
7180
|
return;
|
|
@@ -7136,7 +7193,7 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
7136
7193
|
{ name: `${name}Load` }
|
|
7137
7194
|
);
|
|
7138
7195
|
createEffect8(
|
|
7139
|
-
|
|
7196
|
+
createMemo21(() => options.prefetch() && module.getSnapshot() === null),
|
|
7140
7197
|
(shouldPrefetch) => {
|
|
7141
7198
|
if (!shouldPrefetch) {
|
|
7142
7199
|
return;
|
|
@@ -7171,18 +7228,18 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7171
7228
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7172
7229
|
|
|
7173
7230
|
// src/view/GridFindBar.tsx
|
|
7174
|
-
import { createRenderEffect as
|
|
7231
|
+
import { createRenderEffect as createRenderEffect5, createSignal as createSignal14, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
7175
7232
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7176
7233
|
function GridFindBar(props) {
|
|
7177
7234
|
const texts = useFeatureLocaleText();
|
|
7178
|
-
const [input, setInput] =
|
|
7235
|
+
const [input, setInput] = createSignal14();
|
|
7179
7236
|
const initialQuery = untrack17(() => props.snapshot.query);
|
|
7180
7237
|
onSettled7(() => {
|
|
7181
7238
|
const element = untrack17(input);
|
|
7182
7239
|
element?.focus();
|
|
7183
7240
|
element?.select();
|
|
7184
7241
|
});
|
|
7185
|
-
|
|
7242
|
+
createRenderEffect5(
|
|
7186
7243
|
() => [input(), props.snapshot.query],
|
|
7187
7244
|
([element, query]) => {
|
|
7188
7245
|
if (element && element.value !== query) {
|
|
@@ -7193,18 +7250,18 @@ function GridFindBar(props) {
|
|
|
7193
7250
|
);
|
|
7194
7251
|
const count = () => props.snapshot.matches.length;
|
|
7195
7252
|
const countLabel = () => {
|
|
7196
|
-
const
|
|
7253
|
+
const snapshot2 = props.snapshot;
|
|
7197
7254
|
const localeTexts = texts();
|
|
7198
|
-
if (
|
|
7255
|
+
if (snapshot2.query.length === 0) {
|
|
7199
7256
|
return "";
|
|
7200
7257
|
}
|
|
7201
|
-
if (
|
|
7258
|
+
if (snapshot2.scanning) {
|
|
7202
7259
|
return localeTexts.findSearching;
|
|
7203
7260
|
}
|
|
7204
7261
|
if (count() === 0) {
|
|
7205
7262
|
return localeTexts.findNoResults;
|
|
7206
7263
|
}
|
|
7207
|
-
return `${(
|
|
7264
|
+
return `${(snapshot2.currentIndex ?? 0) + 1} / ${count()}${snapshot2.truncated ? "+" : ""}`;
|
|
7208
7265
|
};
|
|
7209
7266
|
const handleKeyDown = (event) => {
|
|
7210
7267
|
if (isImeComposingKeyEvent3(event)) {
|
|
@@ -7307,14 +7364,14 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7307
7364
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7308
7365
|
|
|
7309
7366
|
// src/view/GridBodyGroupRow.tsx
|
|
7310
|
-
import { For as For10, Show as Show18, createMemo as
|
|
7367
|
+
import { For as For10, Show as Show18, createMemo as createMemo22 } from "solid-js";
|
|
7311
7368
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7312
7369
|
import {
|
|
7313
7370
|
formatTotalRowCellText,
|
|
7314
7371
|
formatTotalRowNumber,
|
|
7315
7372
|
resolveTotalRowCaption
|
|
7316
7373
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
7317
|
-
import { formatLocaleText as
|
|
7374
|
+
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7318
7375
|
var GROUP_INDENT_PX = 16;
|
|
7319
7376
|
function GridBodyGroupRow(props) {
|
|
7320
7377
|
const texts = useFeatureLocaleText();
|
|
@@ -7365,10 +7422,10 @@ function GridBodyGroupRow(props) {
|
|
|
7365
7422
|
</Show18>
|
|
7366
7423
|
<For10 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7367
7424
|
{(entry) => {
|
|
7368
|
-
const unbound =
|
|
7425
|
+
const unbound = createMemo22(() => entry().column);
|
|
7369
7426
|
const column = () => unbound();
|
|
7370
7427
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7371
|
-
const aggregate =
|
|
7428
|
+
const aggregate = createMemo22(() => {
|
|
7372
7429
|
const current = column();
|
|
7373
7430
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7374
7431
|
return null;
|
|
@@ -7429,7 +7486,7 @@ function GridBodyGroupRow(props) {
|
|
|
7429
7486
|
tabindex={-1}
|
|
7430
7487
|
class="ssg-group-toggle"
|
|
7431
7488
|
aria-expanded={props.isCollapsed ? "false" : "true"}
|
|
7432
|
-
aria-label={
|
|
7489
|
+
aria-label={formatLocaleText11(props.isCollapsed ? texts().expandGroup : texts().collapseGroup, {
|
|
7433
7490
|
group: groupLabel()
|
|
7434
7491
|
})}
|
|
7435
7492
|
onClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
@@ -7439,7 +7496,7 @@ function GridBodyGroupRow(props) {
|
|
|
7439
7496
|
</button>
|
|
7440
7497
|
<span class="ssg-group-label">{groupLabel()}</span>
|
|
7441
7498
|
<span class="ssg-group-count">
|
|
7442
|
-
{
|
|
7499
|
+
{formatLocaleText11(texts().groupRowCount, { count: formatTotalRowNumber(props.groupRow.leafCount) })}
|
|
7443
7500
|
</span>
|
|
7444
7501
|
</Show18>
|
|
7445
7502
|
</div>;
|
|
@@ -7477,12 +7534,12 @@ import {
|
|
|
7477
7534
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7478
7535
|
|
|
7479
7536
|
// src/view/GridBodyLabelRow.tsx
|
|
7480
|
-
import { Show as Show19, createMemo as
|
|
7537
|
+
import { Show as Show19, createMemo as createMemo23 } from "solid-js";
|
|
7481
7538
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7482
|
-
const row =
|
|
7483
|
-
const sourceRowIndex =
|
|
7484
|
-
const label =
|
|
7485
|
-
const sectionRowCount =
|
|
7539
|
+
const row = createMemo23(() => labelRow().row);
|
|
7540
|
+
const sourceRowIndex = createMemo23(() => labelRow().sourceIndex);
|
|
7541
|
+
const label = createMemo23(() => labelRow().label);
|
|
7542
|
+
const sectionRowCount = createMemo23(() => labelRow().sectionRowCount);
|
|
7486
7543
|
return {
|
|
7487
7544
|
get row() {
|
|
7488
7545
|
return row();
|
|
@@ -7558,7 +7615,7 @@ function GridBodyLabelRow(props) {
|
|
|
7558
7615
|
}
|
|
7559
7616
|
|
|
7560
7617
|
// src/view/GridStickyLabelLayer.tsx
|
|
7561
|
-
import { Show as Show20, createMemo as
|
|
7618
|
+
import { Show as Show20, createMemo as createMemo24, onSettled as onSettled8 } from "solid-js";
|
|
7562
7619
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7563
7620
|
function GridStickyLabelLayer(props) {
|
|
7564
7621
|
return <Show20 when={props.entry}>
|
|
@@ -7567,10 +7624,10 @@ function GridStickyLabelLayer(props) {
|
|
|
7567
7624
|
}
|
|
7568
7625
|
function StickyLabel(props) {
|
|
7569
7626
|
const layer = props.layer;
|
|
7570
|
-
const labelRow =
|
|
7571
|
-
const rowIndex =
|
|
7572
|
-
const rowKey =
|
|
7573
|
-
const height =
|
|
7627
|
+
const labelRow = createMemo24(() => props.entry().labelRow);
|
|
7628
|
+
const rowIndex = createMemo24(() => props.entry().rowIndex);
|
|
7629
|
+
const rowKey = createMemo24(() => props.entry().rowKey);
|
|
7630
|
+
const height = createMemo24(() => props.entry().height);
|
|
7574
7631
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7575
7632
|
let element;
|
|
7576
7633
|
onSettled8(() => {
|
|
@@ -7673,7 +7730,7 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7673
7730
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7674
7731
|
|
|
7675
7732
|
// src/primitives/serverSide.ts
|
|
7676
|
-
import { createMemo as
|
|
7733
|
+
import { createMemo as createMemo25, untrack as untrack18 } from "solid-js";
|
|
7677
7734
|
import {
|
|
7678
7735
|
createServerSideRowModel
|
|
7679
7736
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
@@ -7708,28 +7765,28 @@ function createServerSide(args) {
|
|
|
7708
7765
|
}
|
|
7709
7766
|
controller.requestRange(startIndex, endIndex);
|
|
7710
7767
|
};
|
|
7711
|
-
const
|
|
7768
|
+
const snapshot2 = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7712
7769
|
return {
|
|
7713
|
-
rowModel:
|
|
7714
|
-
rowCount: () =>
|
|
7715
|
-
loadError:
|
|
7716
|
-
writeError:
|
|
7770
|
+
rowModel: createMemo25(() => snapshot2().rowModel),
|
|
7771
|
+
rowCount: () => snapshot2().rowCount,
|
|
7772
|
+
loadError: createMemo25(() => snapshot2().loadError),
|
|
7773
|
+
writeError: createMemo25(() => snapshot2().writeError),
|
|
7717
7774
|
isRowLoaded: controller.isRowLoaded,
|
|
7718
7775
|
requestRange,
|
|
7719
7776
|
refresh: controller.refresh,
|
|
7720
7777
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7721
7778
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7722
|
-
canUpdateRows:
|
|
7779
|
+
canUpdateRows: createMemo25(() => args().dataSource?.updateRows !== void 0),
|
|
7723
7780
|
applyCellEdits: controller.applyCellEdits
|
|
7724
7781
|
};
|
|
7725
7782
|
}
|
|
7726
7783
|
|
|
7727
7784
|
// src/view/GridServerSideErrorBars.tsx
|
|
7728
|
-
import { Show as Show21, createSignal as
|
|
7729
|
-
import { formatLocaleText as
|
|
7785
|
+
import { Show as Show21, createSignal as createSignal15 } from "solid-js";
|
|
7786
|
+
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7730
7787
|
function GridServerSideErrorBars(props) {
|
|
7731
|
-
const [dismissedLoadError, setDismissedLoadError] =
|
|
7732
|
-
const [dismissedWriteError, setDismissedWriteError] =
|
|
7788
|
+
const [dismissedLoadError, setDismissedLoadError] = createSignal15(null);
|
|
7789
|
+
const [dismissedWriteError, setDismissedWriteError] = createSignal15(null);
|
|
7733
7790
|
const texts = () => props.localeTexts;
|
|
7734
7791
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7735
7792
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
@@ -7739,7 +7796,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7739
7796
|
{(loadError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7740
7797
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7741
7798
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7742
|
-
{
|
|
7799
|
+
{formatLocaleText12(texts().loadFailed, { count: loadError().failedBlockCount })}
|
|
7743
7800
|
</span>
|
|
7744
7801
|
<button type="button" class="ssg-ssrm-error-bar-retry" onClick={() => props.onRetry()}>
|
|
7745
7802
|
{texts().retry}
|
|
@@ -7758,7 +7815,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7758
7815
|
{(writeError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7759
7816
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7760
7817
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7761
|
-
{
|
|
7818
|
+
{formatLocaleText12(texts().saveFailed, { count: writeError().failedRowCount })}
|
|
7762
7819
|
</span>
|
|
7763
7820
|
<button
|
|
7764
7821
|
type="button"
|
|
@@ -7901,12 +7958,12 @@ var motionExtrasFeature = {
|
|
|
7901
7958
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7902
7959
|
|
|
7903
7960
|
// src/view/GridPinnedRows.tsx
|
|
7904
|
-
import { For as For12, Show as Show24, createMemo as
|
|
7961
|
+
import { For as For12, Show as Show24, createMemo as createMemo26 } from "solid-js";
|
|
7905
7962
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7906
7963
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7907
7964
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
7908
|
-
import { formatLocaleText as
|
|
7909
|
-
import { getCellValue as
|
|
7965
|
+
import { formatLocaleText as formatLocaleText13 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7966
|
+
import { getCellValue as getCellValue5 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
7910
7967
|
var noop4 = () => {
|
|
7911
7968
|
};
|
|
7912
7969
|
var PIN_ICON_PATH = "M9.8 1.5 14.5 6.2l-1.4 1.4-1-.9-2.6 2.6.3 3.2-1.4 1.4-2.6-2.6-3.3 3.3-.7-.7 3.3-3.3L2.5 8l1.4-1.4 3.2.3 2.6-2.6-.9-1z";
|
|
@@ -7925,7 +7982,7 @@ function GridPinnedRows(props) {
|
|
|
7925
7982
|
<For12 each={props.rows} keyed={false}>
|
|
7926
7983
|
{(row, index) => {
|
|
7927
7984
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
7928
|
-
const rowSlot =
|
|
7985
|
+
const rowSlot = createMemo26(
|
|
7929
7986
|
() => resolveSlotProps3(
|
|
7930
7987
|
props.getRowClassName?.(row(), index, {
|
|
7931
7988
|
row: row(),
|
|
@@ -7969,7 +8026,7 @@ function GridPinnedRows(props) {
|
|
|
7969
8026
|
class="ssg-pinned-row-icon"
|
|
7970
8027
|
viewBox="0 0 16 16"
|
|
7971
8028
|
role="img"
|
|
7972
|
-
aria-label={
|
|
8029
|
+
aria-label={formatLocaleText13(
|
|
7973
8030
|
props.position === "top" ? texts().pinnedTopRow : texts().pinnedBottomRow,
|
|
7974
8031
|
{ row: index + 1 }
|
|
7975
8032
|
)}
|
|
@@ -7980,11 +8037,11 @@ function GridPinnedRows(props) {
|
|
|
7980
8037
|
</Show24>
|
|
7981
8038
|
<For12 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7982
8039
|
{(entry) => {
|
|
7983
|
-
const unbound =
|
|
8040
|
+
const unbound = createMemo26(() => entry().column);
|
|
7984
8041
|
const column = () => unbound();
|
|
7985
|
-
const value =
|
|
7986
|
-
const colIndex =
|
|
7987
|
-
const ctx =
|
|
8042
|
+
const value = createMemo26(() => getCellValue5(row(), unbound()));
|
|
8043
|
+
const colIndex = createMemo26(() => entry().logicalIndex);
|
|
8044
|
+
const ctx = createMemo26(
|
|
7988
8045
|
() => ({
|
|
7989
8046
|
row: row(),
|
|
7990
8047
|
rowIndex: index,
|
|
@@ -8000,19 +8057,19 @@ function GridPinnedRows(props) {
|
|
|
8000
8057
|
pinned: props.position
|
|
8001
8058
|
})
|
|
8002
8059
|
);
|
|
8003
|
-
const cellSlot =
|
|
8060
|
+
const cellSlot = createMemo26(() => {
|
|
8004
8061
|
const cellClassName = column().cellClassName;
|
|
8005
8062
|
return resolveSlotProps3(
|
|
8006
8063
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
8007
8064
|
);
|
|
8008
8065
|
});
|
|
8009
8066
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
8010
|
-
const dataBar =
|
|
8067
|
+
const dataBar = createMemo26(() => {
|
|
8011
8068
|
const feature = props.conditionalFormat;
|
|
8012
8069
|
const format = rules()?.dataBar;
|
|
8013
8070
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
8014
8071
|
});
|
|
8015
|
-
const scaleBackground =
|
|
8072
|
+
const scaleBackground = createMemo26(() => {
|
|
8016
8073
|
const feature = props.conditionalFormat;
|
|
8017
8074
|
const format = rules()?.colorScale;
|
|
8018
8075
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -8022,7 +8079,7 @@ function GridPinnedRows(props) {
|
|
|
8022
8079
|
const format = rules()?.dataBar;
|
|
8023
8080
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
8024
8081
|
};
|
|
8025
|
-
const content =
|
|
8082
|
+
const content = createMemo26(() => {
|
|
8026
8083
|
const current = column();
|
|
8027
8084
|
if (isSyntheticColumnKey3(current.key)) {
|
|
8028
8085
|
return null;
|
|
@@ -8116,81 +8173,28 @@ var pinnedRowsFeature = {
|
|
|
8116
8173
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8117
8174
|
|
|
8118
8175
|
// src/primitives/rowDrag.ts
|
|
8119
|
-
import { createEffect as createEffect9, createMemo as
|
|
8176
|
+
import { createEffect as createEffect9, createMemo as createMemo27, untrack as untrack19 } from "solid-js";
|
|
8120
8177
|
import {
|
|
8121
8178
|
createRowDragController
|
|
8122
8179
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
8123
|
-
import {
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8180
|
+
import {
|
|
8181
|
+
createRowDropCheck,
|
|
8182
|
+
getDragRowToken,
|
|
8183
|
+
locateDragRowToken,
|
|
8184
|
+
resolveRowDragLabel
|
|
8185
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowDragTarget";
|
|
8127
8186
|
function createRowDrag(inputs) {
|
|
8128
8187
|
const controller = createRowDragController();
|
|
8129
8188
|
const leftIndicatorRef = { current: null };
|
|
8130
8189
|
const centerIndicatorRef = { current: null };
|
|
8131
8190
|
const rightIndicatorRef = { current: null };
|
|
8132
|
-
const canDropAt =
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
}
|
|
8137
|
-
const rows = inputs.rows();
|
|
8138
|
-
const resolveRowKey = inputs.resolveRowKey();
|
|
8139
|
-
return (fromIndex, slot) => {
|
|
8140
|
-
const toIndex = resolveMoveTargetIndex(fromIndex, slot);
|
|
8141
|
-
const row = rows[fromIndex];
|
|
8142
|
-
if (toIndex === null || row === void 0) return false;
|
|
8143
|
-
return canDropRow({
|
|
8144
|
-
row,
|
|
8145
|
-
rowKey: resolveRowKey(row, fromIndex),
|
|
8146
|
-
fromIndex,
|
|
8147
|
-
toIndex,
|
|
8148
|
-
rowAbove: slot > 0 ? rows[slot - 1] : void 0,
|
|
8149
|
-
rowBelow: slot < rows.length ? rows[slot] : void 0,
|
|
8150
|
-
rows
|
|
8151
|
-
});
|
|
8152
|
-
};
|
|
8153
|
-
});
|
|
8154
|
-
const getRowDragLabel = (viewIndex) => {
|
|
8155
|
-
const fallback = formatLocaleText13(untrack19(inputs.dragRowLabel), { row: viewIndex + 1 });
|
|
8156
|
-
const row = untrack19(inputs.rowModel).getRow(viewIndex);
|
|
8157
|
-
if (!row) {
|
|
8158
|
-
return fallback;
|
|
8159
|
-
}
|
|
8160
|
-
const column = untrack19(inputs.visibleColumns).find(
|
|
8161
|
-
(candidate) => !isSyntheticColumnKey4(candidate.key) && (candidate.renderCell === void 0 || candidate.valueFormatter !== void 0) && candidate.editor?.type !== "checkbox" && candidate.conditionalFormat?.dataBar?.showValue !== false
|
|
8162
|
-
);
|
|
8163
|
-
if (!column) {
|
|
8164
|
-
return fallback;
|
|
8165
|
-
}
|
|
8166
|
-
const value = getCellValue7(row, column);
|
|
8167
|
-
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
8168
|
-
return text.trim().length > 0 ? text : fallback;
|
|
8169
|
-
};
|
|
8170
|
-
const getDragRow = (viewIndex) => {
|
|
8171
|
-
const rowModel = untrack19(inputs.rowModel);
|
|
8172
|
-
const row = rowModel.getRow(viewIndex);
|
|
8173
|
-
if (row === void 0) return null;
|
|
8174
|
-
return { row, rowKey: rowModel.getRowKey(viewIndex), rowCount: rowModel.getRowCount() };
|
|
8175
|
-
};
|
|
8176
|
-
const locateDragRow = createMemo26(() => {
|
|
8191
|
+
const canDropAt = createMemo27(() => createRowDropCheck(inputs.canDropRow(), inputs.rows(), inputs.resolveRowKey()));
|
|
8192
|
+
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(untrack19(inputs.rowModel), untrack19(inputs.visibleColumns), viewIndex, untrack19(inputs.dragRowLabel));
|
|
8193
|
+
const getDragRow = (viewIndex) => getDragRowToken(untrack19(inputs.rowModel), viewIndex);
|
|
8194
|
+
const locateDragRow = createMemo27(() => {
|
|
8177
8195
|
const rowModel = inputs.rowModel();
|
|
8178
8196
|
const hasRowKeys = inputs.hasRowKeys();
|
|
8179
|
-
return (token, hint) =>
|
|
8180
|
-
const { row, rowKey, rowCount } = token;
|
|
8181
|
-
if (rowModel.getRow(hint) === row) return hint;
|
|
8182
|
-
const count = rowModel.getRowCount();
|
|
8183
|
-
for (let index = 0; index < count; index += 1) {
|
|
8184
|
-
if (rowModel.getRow(index) === row) return index;
|
|
8185
|
-
}
|
|
8186
|
-
if (hasRowKeys) {
|
|
8187
|
-
for (let index = 0; index < count; index += 1) {
|
|
8188
|
-
if (Object.is(rowModel.getRowKey(index), rowKey)) return index;
|
|
8189
|
-
}
|
|
8190
|
-
return null;
|
|
8191
|
-
}
|
|
8192
|
-
return count === rowCount && hint < rowCount ? hint : null;
|
|
8193
|
-
};
|
|
8197
|
+
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
8194
8198
|
});
|
|
8195
8199
|
connectController(
|
|
8196
8200
|
controller,
|
|
@@ -8261,9 +8265,9 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8261
8265
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8262
8266
|
|
|
8263
8267
|
// src/view/GridScrollHint.tsx
|
|
8264
|
-
import { For as For13, Show as Show25, createMemo as
|
|
8268
|
+
import { For as For13, Show as Show25, createMemo as createMemo28, createSignal as createSignal16, createEffect as createEffect10 } from "solid-js";
|
|
8265
8269
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8266
|
-
import { resolveDataRowNumber as
|
|
8270
|
+
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8267
8271
|
import {
|
|
8268
8272
|
computeScrollHintRulerTicks,
|
|
8269
8273
|
computeScrollHintTrack,
|
|
@@ -8279,18 +8283,18 @@ var SCROLL_HINT_OVERLAY_TRACK_ZONE_PX = 8;
|
|
|
8279
8283
|
var SCROLL_HINT_JUMP_LABEL_FLIP_PX = 28;
|
|
8280
8284
|
function GridScrollHint(props) {
|
|
8281
8285
|
const texts = useFeatureLocaleText();
|
|
8282
|
-
const [scrollActive, setScrollActive] =
|
|
8283
|
-
const [hovered, setHovered] =
|
|
8284
|
-
const [scrollbarWidth, setScrollbarWidth] =
|
|
8285
|
-
const [trackPointerY, setTrackPointerY] =
|
|
8286
|
-
const [dragging, setDragging] =
|
|
8286
|
+
const [scrollActive, setScrollActive] = createSignal16(false);
|
|
8287
|
+
const [hovered, setHovered] = createSignal16(false);
|
|
8288
|
+
const [scrollbarWidth, setScrollbarWidth] = createSignal16(0);
|
|
8289
|
+
const [trackPointerY, setTrackPointerY] = createSignal16(null);
|
|
8290
|
+
const [dragging, setDragging] = createSignal16(false);
|
|
8287
8291
|
let lingerTimer = null;
|
|
8288
8292
|
let dragGrab = null;
|
|
8289
8293
|
let gutter;
|
|
8290
|
-
const scrollbar =
|
|
8294
|
+
const scrollbar = createMemo28(() => props.options.scrollbar);
|
|
8291
8295
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8292
8296
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8293
|
-
const track =
|
|
8297
|
+
const track = createMemo28(
|
|
8294
8298
|
() => computeScrollHintTrack({
|
|
8295
8299
|
scrollTop: props.scrollTop,
|
|
8296
8300
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8298,7 +8302,7 @@ function GridScrollHint(props) {
|
|
|
8298
8302
|
trackHeight: trackHeight()
|
|
8299
8303
|
})
|
|
8300
8304
|
);
|
|
8301
|
-
const shown =
|
|
8305
|
+
const shown = createMemo28(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8302
8306
|
createEffect10(scrollbar, (customScrollbar) => {
|
|
8303
8307
|
const element = props.scrollContainerRef.current;
|
|
8304
8308
|
if (!element) {
|
|
@@ -8367,12 +8371,12 @@ function GridScrollHint(props) {
|
|
|
8367
8371
|
);
|
|
8368
8372
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8369
8373
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8370
|
-
const dataRowCount =
|
|
8374
|
+
const dataRowCount = createMemo28(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8371
8375
|
const rowNumberOf = (viewIndex) => {
|
|
8372
8376
|
const labels = props.labelViewIndexes;
|
|
8373
|
-
return labels && labels.length > 0 ?
|
|
8377
|
+
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8374
8378
|
};
|
|
8375
|
-
const rulerTicks =
|
|
8379
|
+
const rulerTicks = createMemo28(
|
|
8376
8380
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8377
8381
|
rowCount: dataRowCount(),
|
|
8378
8382
|
rulerHeight: rulerHeight(),
|
|
@@ -8382,7 +8386,7 @@ function GridScrollHint(props) {
|
|
|
8382
8386
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8383
8387
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8384
8388
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8385
|
-
const topRowIndex =
|
|
8389
|
+
const topRowIndex = createMemo28(() => {
|
|
8386
8390
|
const current = track();
|
|
8387
8391
|
if (current === null) {
|
|
8388
8392
|
return 0;
|
|
@@ -8397,8 +8401,8 @@ function GridScrollHint(props) {
|
|
|
8397
8401
|
rowIndex,
|
|
8398
8402
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8399
8403
|
});
|
|
8400
|
-
const detail =
|
|
8401
|
-
const jumpPreview =
|
|
8404
|
+
const detail = createMemo28(() => detailOf(topRowIndex()));
|
|
8405
|
+
const jumpPreview = createMemo28(() => {
|
|
8402
8406
|
const pointerY = trackPointerY();
|
|
8403
8407
|
const current = track();
|
|
8404
8408
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8561,7 +8565,7 @@ var scrollHintFeature = {
|
|
|
8561
8565
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8562
8566
|
|
|
8563
8567
|
// src/primitives/selectionAggregates.ts
|
|
8564
|
-
import { createMemo as
|
|
8568
|
+
import { createMemo as createMemo29 } from "solid-js";
|
|
8565
8569
|
import {
|
|
8566
8570
|
createSelectionAggregatesRunner,
|
|
8567
8571
|
resolveSyncSelectionAggregates,
|
|
@@ -8573,15 +8577,15 @@ import {
|
|
|
8573
8577
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8574
8578
|
function createSelectionAggregates(args) {
|
|
8575
8579
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8576
|
-
const target =
|
|
8580
|
+
const target = createMemo29(() => {
|
|
8577
8581
|
const current = args();
|
|
8578
8582
|
return stabilizeTarget(
|
|
8579
8583
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8580
8584
|
);
|
|
8581
8585
|
});
|
|
8582
|
-
const rowModel =
|
|
8583
|
-
const key =
|
|
8584
|
-
const syncResult =
|
|
8586
|
+
const rowModel = createMemo29(() => args().rowModel);
|
|
8587
|
+
const key = createMemo29(() => ({ rowModel: rowModel(), target: target() }));
|
|
8588
|
+
const syncResult = createMemo29(() => resolveSyncSelectionAggregates(key()));
|
|
8585
8589
|
const runner = createSelectionAggregatesRunner();
|
|
8586
8590
|
connectController(
|
|
8587
8591
|
runner,
|
|
@@ -8589,17 +8593,17 @@ function createSelectionAggregates(args) {
|
|
|
8589
8593
|
"render",
|
|
8590
8594
|
"selectionAggregates"
|
|
8591
8595
|
);
|
|
8592
|
-
const
|
|
8593
|
-
return
|
|
8596
|
+
const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8597
|
+
return createMemo29(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
|
|
8594
8598
|
}
|
|
8595
8599
|
|
|
8596
8600
|
// src/view/GridSelectionAggregates.tsx
|
|
8597
|
-
import { For as For14, Show as Show26, createMemo as
|
|
8601
|
+
import { For as For14, Show as Show26, createMemo as createMemo30 } from "solid-js";
|
|
8598
8602
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8599
8603
|
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8600
8604
|
function GridSelectionAggregates(props) {
|
|
8601
8605
|
const texts = useFeatureLocaleText();
|
|
8602
|
-
const chips =
|
|
8606
|
+
const chips = createMemo30(() => {
|
|
8603
8607
|
const aggregates = props.aggregates;
|
|
8604
8608
|
if (!aggregates) {
|
|
8605
8609
|
return null;
|
|
@@ -8668,7 +8672,7 @@ var selectionAggregatesFeature = {
|
|
|
8668
8672
|
};
|
|
8669
8673
|
|
|
8670
8674
|
// src/primitives/toolPanel.ts
|
|
8671
|
-
import { createMemo as
|
|
8675
|
+
import { createMemo as createMemo31 } from "solid-js";
|
|
8672
8676
|
import {
|
|
8673
8677
|
createToolPanelController,
|
|
8674
8678
|
resolveActiveToolPanelTab,
|
|
@@ -8686,8 +8690,8 @@ function createToolPanel(inputs) {
|
|
|
8686
8690
|
suppressEscape: inputs.suppressEscape(),
|
|
8687
8691
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8688
8692
|
}), "render", "toolPanel");
|
|
8689
|
-
const
|
|
8690
|
-
const availableTabs =
|
|
8693
|
+
const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8694
|
+
const availableTabs = createMemo31(
|
|
8691
8695
|
() => resolveAvailableToolPanelTabs({
|
|
8692
8696
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8693
8697
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8696,10 +8700,10 @@ function createToolPanel(inputs) {
|
|
|
8696
8700
|
{ equals: sameTabs }
|
|
8697
8701
|
);
|
|
8698
8702
|
return {
|
|
8699
|
-
activeTab:
|
|
8703
|
+
activeTab: createMemo31(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
|
|
8700
8704
|
availableTabs,
|
|
8701
|
-
layout:
|
|
8702
|
-
flashTick:
|
|
8705
|
+
layout: createMemo31(() => snapshot2().layout),
|
|
8706
|
+
flashTick: createMemo31(() => snapshot2().flashTick),
|
|
8703
8707
|
panelRef: controller.panelRef,
|
|
8704
8708
|
open: controller.open,
|
|
8705
8709
|
close: controller.close,
|
|
@@ -8723,7 +8727,7 @@ import {
|
|
|
8723
8727
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8724
8728
|
|
|
8725
8729
|
// src/view/GridTotalRow.tsx
|
|
8726
|
-
import { For as For15, Show as Show27, createMemo as
|
|
8730
|
+
import { For as For15, Show as Show27, createMemo as createMemo32 } from "solid-js";
|
|
8727
8731
|
import {
|
|
8728
8732
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8729
8733
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8768,10 +8772,10 @@ function GridTotalRow(props) {
|
|
|
8768
8772
|
</Show27>
|
|
8769
8773
|
<For15 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8770
8774
|
{(entry) => {
|
|
8771
|
-
const unbound =
|
|
8775
|
+
const unbound = createMemo32(() => entry().column);
|
|
8772
8776
|
const cell = () => props.cells.get(unbound().key);
|
|
8773
8777
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8774
|
-
const content =
|
|
8778
|
+
const content = createMemo32(() => {
|
|
8775
8779
|
const total = cell();
|
|
8776
8780
|
if (total) {
|
|
8777
8781
|
const column = unbound();
|