@ishibashi0112/spreadsheet-grid-solid 0.1.2 → 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 +8 -7
- package/README.md +20 -18
- package/dist/{ColumnFilterPopover-CzSRfcDF.js → ColumnFilterPopover-mENgY4gl.js} +47 -47
- 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-Bv79_vW1.js → columnVirtualizer-DdL7-ijS.js} +26 -19
- package/dist/devWarnings.d.ts +0 -1
- package/dist/index.js +2648 -2567
- 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-2DW5SZT3.jsx → ColumnFilterPopover-D7INPNVB.jsx} +1 -1
- package/dist/source/chunks/{chunk-FTQFOPXC.jsx → chunk-ZZTXTW4Z.jsx} +10 -2
- package/dist/source/index.jsx +826 -616
- package/package.json +8 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +6 -4
package/dist/source/index.jsx
CHANGED
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
createUserCallbacks,
|
|
9
9
|
flushMountGate,
|
|
10
10
|
onGridMounted,
|
|
11
|
+
outsideGraphApply,
|
|
11
12
|
runHandleCall,
|
|
12
13
|
runInMountGate
|
|
13
|
-
} from "./chunks/chunk-
|
|
14
|
+
} from "./chunks/chunk-ZZTXTW4Z.jsx";
|
|
14
15
|
import {
|
|
15
16
|
GridLocaleTextContext,
|
|
16
17
|
GridPortalContext,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
import { merge } from "solid-js";
|
|
30
31
|
|
|
31
32
|
// src/SpreadsheetGrid.tsx
|
|
32
|
-
import { For as For5, Match, Show as Show11, Switch, createEffect 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";
|
|
33
34
|
import { isServer } from "@solidjs/web";
|
|
34
35
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
35
36
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
@@ -128,11 +129,140 @@ import {
|
|
|
128
129
|
isEscapeClaimedByGrid
|
|
129
130
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
|
|
130
131
|
|
|
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;
|
|
140
|
+
}
|
|
141
|
+
for (let index = 0; index < a.length; index += 1) {
|
|
142
|
+
if (a[index] !== b[index]) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return true;
|
|
147
|
+
};
|
|
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;
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
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();
|
|
183
|
+
}
|
|
184
|
+
trackers = [];
|
|
185
|
+
};
|
|
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;
|
|
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
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
131
261
|
// src/primitives/gridStoreSignals.ts
|
|
132
|
-
import { createSignal } from "solid-js";
|
|
262
|
+
import { createSignal as createSignal2 } from "solid-js";
|
|
133
263
|
function createGridStoreSignals(store) {
|
|
134
|
-
const [state, setState] =
|
|
135
|
-
const [view, setView] =
|
|
264
|
+
const [state, setState] = createSignal2(store.getState());
|
|
265
|
+
const [view, setView] = createSignal2(store.getViewState());
|
|
136
266
|
onGridMounted(() => {
|
|
137
267
|
const sync = () => {
|
|
138
268
|
setState(() => store.getState());
|
|
@@ -169,11 +299,11 @@ function createGridViewSetters(store) {
|
|
|
169
299
|
}
|
|
170
300
|
|
|
171
301
|
// src/primitives/liveObject.ts
|
|
172
|
-
import { createMemo } from "solid-js";
|
|
302
|
+
import { createMemo as createMemo2 } from "solid-js";
|
|
173
303
|
function createLiveObject(keys, read) {
|
|
174
304
|
const live = {};
|
|
175
305
|
for (const key of keys) {
|
|
176
|
-
const value =
|
|
306
|
+
const value = createMemo2(() => read()[key], { lazy: true });
|
|
177
307
|
Object.defineProperty(live, key, {
|
|
178
308
|
enumerable: true,
|
|
179
309
|
get: value
|
|
@@ -182,8 +312,50 @@ function createLiveObject(keys, read) {
|
|
|
182
312
|
return live;
|
|
183
313
|
}
|
|
184
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
|
+
|
|
185
357
|
// src/view/GridHeaderRow.tsx
|
|
186
|
-
import { For, Show, createMemo as
|
|
358
|
+
import { For, Show, createMemo as createMemo3 } from "solid-js";
|
|
187
359
|
import { isActiveColumnFilterValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
188
360
|
import {
|
|
189
361
|
DETAIL_TOGGLE_COLUMN_KEY,
|
|
@@ -259,9 +431,9 @@ function GridHeaderRow(props) {
|
|
|
259
431
|
</Show>
|
|
260
432
|
<For each={props.entries} keyed={(entry) => entry.column.key}>
|
|
261
433
|
{(entry) => {
|
|
262
|
-
const column =
|
|
263
|
-
const colIndex =
|
|
264
|
-
const size =
|
|
434
|
+
const column = createMemo3(() => entry().column);
|
|
435
|
+
const colIndex = createMemo3(() => entry().logicalIndex);
|
|
436
|
+
const size = createMemo3(() => entry().paneLocalSize);
|
|
265
437
|
const isFiltered = () => isActiveColumnFilterValue(props.columnFilterValues[column().key]);
|
|
266
438
|
const isColumnSelected = () => props.selection.kind === "col" && colIndex() >= props.selection.startCol && colIndex() <= props.selection.endCol;
|
|
267
439
|
const sortIndex = () => props.sort.findIndex((item) => item.columnKey === column().key);
|
|
@@ -424,7 +596,7 @@ function GridHeaderRow(props) {
|
|
|
424
596
|
}
|
|
425
597
|
|
|
426
598
|
// src/view/GridBodyLayer.tsx
|
|
427
|
-
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";
|
|
428
600
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
429
601
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
430
602
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -435,13 +607,13 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
435
607
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
436
608
|
|
|
437
609
|
// src/primitives/memoWhen.ts
|
|
438
|
-
import { createMemo as
|
|
610
|
+
import { createMemo as createMemo4, getOwner as getOwner2, isDisposed, runWithOwner as runWithOwner2, untrack as untrack2 } from "solid-js";
|
|
439
611
|
function createMemoWhen(needed, compute, empty) {
|
|
440
612
|
const guarded = () => needed() ? compute() : empty;
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
613
|
+
if (untrack2(needed)) {
|
|
614
|
+
return createMemo4(guarded);
|
|
443
615
|
}
|
|
444
|
-
const owner =
|
|
616
|
+
const owner = getOwner2();
|
|
445
617
|
let memo;
|
|
446
618
|
return () => {
|
|
447
619
|
if (memo) {
|
|
@@ -453,7 +625,7 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
453
625
|
if (!owner || isDisposed(owner)) {
|
|
454
626
|
return compute();
|
|
455
627
|
}
|
|
456
|
-
memo =
|
|
628
|
+
memo = runWithOwner2(owner, () => createMemo4(guarded));
|
|
457
629
|
return memo();
|
|
458
630
|
};
|
|
459
631
|
}
|
|
@@ -467,13 +639,25 @@ var markClickTarget = (element) => {
|
|
|
467
639
|
|
|
468
640
|
// src/view/GridBodyLayer.tsx
|
|
469
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`;
|
|
470
654
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
471
655
|
function GridBodyLayer(props) {
|
|
472
656
|
const texts = useGridLocaleText();
|
|
473
657
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
474
658
|
{(item) => {
|
|
475
|
-
const rowIndex =
|
|
476
|
-
const SkeletonRow =
|
|
659
|
+
const rowIndex = createMemo5(() => item().index);
|
|
660
|
+
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
477
661
|
if (SkeletonRow) {
|
|
478
662
|
return <SkeletonRow
|
|
479
663
|
pane={props.pane}
|
|
@@ -496,14 +680,14 @@ function GridBodyLayer(props) {
|
|
|
496
680
|
/>;
|
|
497
681
|
}
|
|
498
682
|
const row = () => props.rowModel.getRow(rowIndex());
|
|
499
|
-
const groupRow =
|
|
500
|
-
const labelRow =
|
|
683
|
+
const groupRow = createMemo5(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
684
|
+
const labelRow = createMemo5(
|
|
501
685
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
502
686
|
);
|
|
503
687
|
return <>
|
|
504
688
|
<Show2 when={groupRow()}>
|
|
505
689
|
{(group) => {
|
|
506
|
-
const GroupRow =
|
|
690
|
+
const GroupRow = untrack3(() => props.grouping)?.BodyGroupRow;
|
|
507
691
|
return GroupRow ? <GroupRow
|
|
508
692
|
pane={props.pane}
|
|
509
693
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -530,9 +714,9 @@ function GridBodyLayer(props) {
|
|
|
530
714
|
<Show2 when={labelRow()}>
|
|
531
715
|
{(label) => {
|
|
532
716
|
const layer = () => props.labelRowLayer;
|
|
533
|
-
const LabelRow =
|
|
534
|
-
const labelSlot =
|
|
535
|
-
const labelRowKey =
|
|
717
|
+
const LabelRow = untrack3(layer)?.Row;
|
|
718
|
+
const labelSlot = createMemo5(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
719
|
+
const labelRowKey = createMemo5(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
536
720
|
return LabelRow ? <LabelRow
|
|
537
721
|
pane={props.pane}
|
|
538
722
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -556,14 +740,14 @@ function GridBodyLayer(props) {
|
|
|
556
740
|
{(currentRow) => {
|
|
557
741
|
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
558
742
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
559
|
-
const rowSize =
|
|
560
|
-
const isRowChecked =
|
|
743
|
+
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
744
|
+
const isRowChecked = createMemo5(
|
|
561
745
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
562
746
|
);
|
|
563
|
-
const isRowSelected =
|
|
747
|
+
const isRowSelected = createMemo5(
|
|
564
748
|
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
565
749
|
);
|
|
566
|
-
const selectedColRange =
|
|
750
|
+
const selectedColRange = createMemo5(() => {
|
|
567
751
|
const selection = props.selection;
|
|
568
752
|
if (selection.kind === "col") {
|
|
569
753
|
return [selection.startCol, selection.endCol];
|
|
@@ -575,9 +759,9 @@ function GridBodyLayer(props) {
|
|
|
575
759
|
});
|
|
576
760
|
const selectedColStart = () => selectedColRange()[0];
|
|
577
761
|
const selectedColEnd = () => selectedColRange()[1];
|
|
578
|
-
const activeCol =
|
|
579
|
-
const rowFindHits =
|
|
580
|
-
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(() => {
|
|
581
765
|
const hits = rowFindHits();
|
|
582
766
|
const current = hits ? props.findCurrentIndex : null;
|
|
583
767
|
if (!hits || current === null) {
|
|
@@ -590,10 +774,10 @@ function GridBodyLayer(props) {
|
|
|
590
774
|
}
|
|
591
775
|
return null;
|
|
592
776
|
});
|
|
593
|
-
const editingCol =
|
|
594
|
-
const rowAutoHeight =
|
|
595
|
-
const isHovered =
|
|
596
|
-
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(
|
|
597
781
|
() => resolveSlotProps(
|
|
598
782
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
599
783
|
row: currentRow(),
|
|
@@ -612,12 +796,12 @@ function GridBodyLayer(props) {
|
|
|
612
796
|
aria-rowindex={rowIndex() + 2 + props.ariaRowOffset}
|
|
613
797
|
aria-selected={props.enableRowSelection ? isRowChecked() ? "true" : "false" : void 0}
|
|
614
798
|
data-row-key={String(rowKey())}
|
|
615
|
-
class={
|
|
799
|
+
class={joinClasses(
|
|
616
800
|
"ssg-body-row",
|
|
617
801
|
rowSlot().className,
|
|
618
802
|
props.slots.bodyRow?.className,
|
|
619
|
-
|
|
620
|
-
|
|
803
|
+
isRowChecked() && "ssg-body-row--checked"
|
|
804
|
+
)}
|
|
621
805
|
style={{
|
|
622
806
|
...props.slots.bodyRow?.style,
|
|
623
807
|
...rowSlot().style,
|
|
@@ -632,17 +816,14 @@ function GridBodyLayer(props) {
|
|
|
632
816
|
onPointerDown={(event) => props.onRowHeaderPointerDown(rowIndex(), event)}
|
|
633
817
|
onPointerEnter={(event) => props.onRowHeaderPointerEnter(rowIndex(), event)}
|
|
634
818
|
onPointerLeave={() => props.onRowHeaderPointerLeave(rowIndex())}
|
|
635
|
-
class={
|
|
636
|
-
"ssg-header-cell",
|
|
637
|
-
"ssg-row-header-cell",
|
|
819
|
+
class={joinClasses(
|
|
820
|
+
"ssg-header-cell ssg-row-header-cell",
|
|
638
821
|
rowSlot().className,
|
|
639
822
|
props.slots.rowHeaderCell?.className,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
]}
|
|
823
|
+
props.enableRowSelection && "ssg-row-header-cell--checkbox",
|
|
824
|
+
(props.isWholeGridSelected || isRowSelected()) && "ssg-header-cell--selected",
|
|
825
|
+
isHovered() && "ssg-header-cell--hovered"
|
|
826
|
+
)}
|
|
646
827
|
style={{
|
|
647
828
|
...props.slots.rowHeaderCell?.style,
|
|
648
829
|
...rowSlot().style,
|
|
@@ -660,24 +841,23 @@ function GridBodyLayer(props) {
|
|
|
660
841
|
</Show2>
|
|
661
842
|
</div>
|
|
662
843
|
</Show2>
|
|
663
|
-
<For2 each={props.entries} keyed={
|
|
844
|
+
<For2 each={props.entries} keyed={cellKey}>
|
|
664
845
|
{(entry) => {
|
|
665
|
-
const
|
|
846
|
+
const plain = untrack3(() => isPlainCellColumn(entry().column));
|
|
847
|
+
const unbound = createMemo5(() => entry().column);
|
|
666
848
|
const column = () => unbound();
|
|
667
|
-
const colIndex =
|
|
849
|
+
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
668
850
|
const size = () => entry().paneLocalSize;
|
|
669
851
|
const isActive = () => activeCol() === colIndex();
|
|
670
852
|
const isEditing = () => editingCol() === colIndex();
|
|
671
853
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
672
|
-
const readOnlyCell =
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
props.canEditCell ? { sourceRowIndex: sourceRowIndex(), rowKey: rowKey() } : void 0
|
|
680
|
-
)
|
|
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
|
|
681
861
|
);
|
|
682
862
|
const value = () => getCellValue(currentRow(), unbound());
|
|
683
863
|
const findRanges = createMemoWhen(
|
|
@@ -685,7 +865,7 @@ function GridBodyLayer(props) {
|
|
|
685
865
|
() => rowFindHits()?.get(colIndex()),
|
|
686
866
|
void 0
|
|
687
867
|
);
|
|
688
|
-
const cellRowKey =
|
|
868
|
+
const cellRowKey = untrack3(rowKey);
|
|
689
869
|
const cellState = {
|
|
690
870
|
get rowIndex() {
|
|
691
871
|
return rowIndex();
|
|
@@ -717,7 +897,7 @@ function GridBodyLayer(props) {
|
|
|
717
897
|
}
|
|
718
898
|
};
|
|
719
899
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
720
|
-
const styleContext = createMemoWhen(
|
|
900
|
+
const styleContext = plain ? () => null : createMemoWhen(
|
|
721
901
|
needsStyleContext,
|
|
722
902
|
() => ({
|
|
723
903
|
row: currentRow(),
|
|
@@ -734,7 +914,7 @@ function GridBodyLayer(props) {
|
|
|
734
914
|
}),
|
|
735
915
|
null
|
|
736
916
|
);
|
|
737
|
-
const conditionalCell = createMemoWhen(
|
|
917
|
+
const conditionalCell = plain ? () => EMPTY_SLOT : createMemoWhen(
|
|
738
918
|
() => column().cellClassName !== void 0,
|
|
739
919
|
() => {
|
|
740
920
|
const cellClassName = column().cellClassName;
|
|
@@ -746,7 +926,7 @@ function GridBodyLayer(props) {
|
|
|
746
926
|
resolveSlotProps(void 0)
|
|
747
927
|
);
|
|
748
928
|
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
749
|
-
const dataBar = createMemoWhen(
|
|
929
|
+
const dataBar = plain ? () => null : createMemoWhen(
|
|
750
930
|
() => formatRules()?.dataBar !== void 0,
|
|
751
931
|
() => {
|
|
752
932
|
const feature = props.conditionalFormat;
|
|
@@ -755,7 +935,7 @@ function GridBodyLayer(props) {
|
|
|
755
935
|
},
|
|
756
936
|
null
|
|
757
937
|
);
|
|
758
|
-
const scaleBackground = createMemoWhen(
|
|
938
|
+
const scaleBackground = plain ? () => null : createMemoWhen(
|
|
759
939
|
() => formatRules()?.colorScale !== void 0,
|
|
760
940
|
() => {
|
|
761
941
|
const feature = props.conditionalFormat;
|
|
@@ -773,12 +953,12 @@ function GridBodyLayer(props) {
|
|
|
773
953
|
const rules = formatRules()?.dataBar;
|
|
774
954
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
775
955
|
};
|
|
776
|
-
const invalidMessage = createMemoWhen(
|
|
956
|
+
const invalidMessage = plain ? () => null : createMemoWhen(
|
|
777
957
|
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
778
958
|
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
779
959
|
null
|
|
780
960
|
);
|
|
781
|
-
const cellNote = createMemoWhen(
|
|
961
|
+
const cellNote = plain ? () => null : createMemoWhen(
|
|
782
962
|
() => !!column().cellNote,
|
|
783
963
|
() => {
|
|
784
964
|
const note = column().cellNote;
|
|
@@ -805,6 +985,27 @@ function GridBodyLayer(props) {
|
|
|
805
985
|
hasRenderCell: column().renderCell !== void 0
|
|
806
986
|
});
|
|
807
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
|
+
</>;
|
|
808
1009
|
return <div
|
|
809
1010
|
role="gridcell"
|
|
810
1011
|
aria-colindex={colIndex() + 2}
|
|
@@ -818,25 +1019,23 @@ function GridBodyLayer(props) {
|
|
|
818
1019
|
data-autoheight-cell={isAutoHeightCell() ? "" : void 0}
|
|
819
1020
|
data-ssg-tooltip={tooltipText() ?? void 0}
|
|
820
1021
|
data-ssg-tooltip-overflow={markOverflowTooltip() ? "" : void 0}
|
|
821
|
-
class={
|
|
1022
|
+
class={joinClasses(
|
|
822
1023
|
"ssg-body-cell",
|
|
823
1024
|
rowSlot().className,
|
|
824
1025
|
conditionalCell().className,
|
|
825
1026
|
props.slots.bodyCell?.className,
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
]}
|
|
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
|
+
)}
|
|
840
1039
|
onPointerDown={(event) => {
|
|
841
1040
|
if (event.target instanceof Element && event.target.closest(".ssg-detail-toggle")) {
|
|
842
1041
|
return;
|
|
@@ -861,25 +1060,7 @@ function GridBodyLayer(props) {
|
|
|
861
1060
|
"z-index": isActive() ? 3 : 1
|
|
862
1061
|
}}
|
|
863
1062
|
>
|
|
864
|
-
|
|
865
|
-
{(bar) => <span
|
|
866
|
-
class={["ssg-cf-bar", { "ssg-cf-bar--negative": bar().negative }]}
|
|
867
|
-
style={{
|
|
868
|
-
left: `${bar().start}%`,
|
|
869
|
-
width: `${bar().end - bar().start}%`,
|
|
870
|
-
...dataBarColor() ? { "background-color": dataBarColor() } : null
|
|
871
|
-
}}
|
|
872
|
-
aria-hidden="true"
|
|
873
|
-
/>}
|
|
874
|
-
</Show2>
|
|
875
|
-
<Show2
|
|
876
|
-
when={isAutoHeightCell()}
|
|
877
|
-
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
878
|
-
>
|
|
879
|
-
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
880
|
-
{props.renderCellContent(currentRow, column(), cellState)}
|
|
881
|
-
</div>
|
|
882
|
-
</Show2>
|
|
1063
|
+
{cellChildren()}
|
|
883
1064
|
</div>;
|
|
884
1065
|
}}
|
|
885
1066
|
</For2>
|
|
@@ -910,7 +1091,7 @@ function Overlay(props) {
|
|
|
910
1091
|
}
|
|
911
1092
|
|
|
912
1093
|
// src/view/GridDetailLayer.tsx
|
|
913
|
-
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";
|
|
914
1095
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
915
1096
|
var stopPropagation = (event) => {
|
|
916
1097
|
event.stopPropagation();
|
|
@@ -922,7 +1103,7 @@ var mergeSlotStyles = (...styles) => {
|
|
|
922
1103
|
function GridDetailLayer(props) {
|
|
923
1104
|
return <For3 each={props.entries} keyed={(entry) => entry.rowKey}>
|
|
924
1105
|
{(entry) => {
|
|
925
|
-
const index =
|
|
1106
|
+
const index = createMemo6(() => entry().virtualRow.index);
|
|
926
1107
|
const detailSize = () => entry().virtualRow.detailSize ?? 0;
|
|
927
1108
|
return <Show4 when={detailSize() > 0}>
|
|
928
1109
|
<div
|
|
@@ -949,9 +1130,9 @@ function GridDetailLayer(props) {
|
|
|
949
1130
|
}
|
|
950
1131
|
function DetailCard(props) {
|
|
951
1132
|
const layer = props.layer;
|
|
952
|
-
const rowKey =
|
|
953
|
-
const row =
|
|
954
|
-
const sourceRowIndex =
|
|
1133
|
+
const rowKey = untrack4(() => props.entry().rowKey);
|
|
1134
|
+
const row = createMemo6(() => layer.rowModel.getRow(props.index()));
|
|
1135
|
+
const sourceRowIndex = createMemo6(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
955
1136
|
const ctx = {
|
|
956
1137
|
get row() {
|
|
957
1138
|
return row();
|
|
@@ -963,10 +1144,10 @@ function DetailCard(props) {
|
|
|
963
1144
|
get sourceRowIndex() {
|
|
964
1145
|
return sourceRowIndex();
|
|
965
1146
|
},
|
|
966
|
-
collapse: () => layer.onCollapse?.(rowKey,
|
|
1147
|
+
collapse: () => layer.onCollapse?.(rowKey, untrack4(props.index))
|
|
967
1148
|
};
|
|
968
1149
|
let card;
|
|
969
|
-
|
|
1150
|
+
onCleanup2(() => notifyDetailCardFocusLost(card ?? null, layer.onCardFocusLost));
|
|
970
1151
|
return <div
|
|
971
1152
|
role="gridcell"
|
|
972
1153
|
class="ssg-detail-card-holder"
|
|
@@ -980,7 +1161,7 @@ function DetailCard(props) {
|
|
|
980
1161
|
style={mergeSlotStyles(layer.slots.detailCard?.style, layer.cardSlot?.style)}
|
|
981
1162
|
data-ssg-detail=""
|
|
982
1163
|
onKeyDown={(event) => {
|
|
983
|
-
layer.onCardKeyDown?.(event, event.currentTarget,
|
|
1164
|
+
layer.onCardKeyDown?.(event, event.currentTarget, untrack4(props.index));
|
|
984
1165
|
event.stopPropagation();
|
|
985
1166
|
}}
|
|
986
1167
|
onKeyUp={stopPropagation}
|
|
@@ -1042,13 +1223,13 @@ function CheckboxCell(props) {
|
|
|
1042
1223
|
}
|
|
1043
1224
|
|
|
1044
1225
|
// src/editors/CellEditorLayer.tsx
|
|
1045
|
-
import { Show as Show8, createMemo as
|
|
1226
|
+
import { Show as Show8, createMemo as createMemo7, untrack as untrack11 } from "solid-js";
|
|
1046
1227
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1047
1228
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1048
1229
|
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1049
1230
|
|
|
1050
1231
|
// src/editors/TextCellEditor.tsx
|
|
1051
|
-
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as
|
|
1232
|
+
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1052
1233
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1053
1234
|
import {
|
|
1054
1235
|
fitMultilineEditor,
|
|
@@ -1058,7 +1239,7 @@ import {
|
|
|
1058
1239
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1059
1240
|
|
|
1060
1241
|
// src/primitives/topAlignedInput.ts
|
|
1061
|
-
import { createRenderEffect, onSettled, untrack as
|
|
1242
|
+
import { createRenderEffect, onSettled, untrack as untrack5 } from "solid-js";
|
|
1062
1243
|
import {
|
|
1063
1244
|
alignInputTextToTop,
|
|
1064
1245
|
resolveHiddenTopOf
|
|
@@ -1071,11 +1252,11 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1071
1252
|
};
|
|
1072
1253
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1073
1254
|
createRenderEffect(read, apply, { name: "topAlignedInput" });
|
|
1074
|
-
onSettled(() => apply(
|
|
1255
|
+
onSettled(() => apply(untrack5(read)));
|
|
1075
1256
|
}
|
|
1076
1257
|
|
|
1077
1258
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1078
|
-
import { Show as Show5, createSignal as
|
|
1259
|
+
import { Show as Show5, createSignal as createSignal3, onSettled as onSettled2 } from "solid-js";
|
|
1079
1260
|
import {
|
|
1080
1261
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1081
1262
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1088,7 +1269,7 @@ function CellEditorError(props) {
|
|
|
1088
1269
|
}
|
|
1089
1270
|
function CellEditorErrorBubble(props) {
|
|
1090
1271
|
let element;
|
|
1091
|
-
const [placement2, setPlacement] =
|
|
1272
|
+
const [placement2, setPlacement] = createSignal3(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1092
1273
|
onSettled2(() => {
|
|
1093
1274
|
if (element) {
|
|
1094
1275
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1112,11 +1293,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1112
1293
|
|
|
1113
1294
|
// src/editors/TextCellEditor.tsx
|
|
1114
1295
|
function TextCellEditor(props) {
|
|
1115
|
-
const [input, setInput] =
|
|
1116
|
-
const [textarea, setTextarea] =
|
|
1117
|
-
const [error, setError] =
|
|
1118
|
-
const initialValue =
|
|
1119
|
-
const [draft, setDraft] =
|
|
1296
|
+
const [input, setInput] = createSignal4();
|
|
1297
|
+
const [textarea, setTextarea] = createSignal4();
|
|
1298
|
+
const [error, setError] = createSignal4(null);
|
|
1299
|
+
const initialValue = untrack6(() => props.initialValue);
|
|
1300
|
+
const [draft, setDraft] = createSignal4(initialValue);
|
|
1120
1301
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1121
1302
|
const alignTop = () => props.alignTop ?? false;
|
|
1122
1303
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1139,7 +1320,7 @@ function TextCellEditor(props) {
|
|
|
1139
1320
|
};
|
|
1140
1321
|
createRenderEffect2(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1141
1322
|
onSettled3(() => {
|
|
1142
|
-
const element =
|
|
1323
|
+
const element = untrack6(() => input() ?? textarea());
|
|
1143
1324
|
if (!element) {
|
|
1144
1325
|
return;
|
|
1145
1326
|
}
|
|
@@ -1148,11 +1329,11 @@ function TextCellEditor(props) {
|
|
|
1148
1329
|
element.setSelectionRange(end, end);
|
|
1149
1330
|
});
|
|
1150
1331
|
let disposed = false;
|
|
1151
|
-
|
|
1332
|
+
onCleanup3(() => {
|
|
1152
1333
|
disposed = true;
|
|
1153
1334
|
});
|
|
1154
1335
|
props.onRegisterFlush?.(() => {
|
|
1155
|
-
|
|
1336
|
+
untrack6(() => {
|
|
1156
1337
|
const element = input() ?? textarea();
|
|
1157
1338
|
if (element) {
|
|
1158
1339
|
props.onCommit(element.value);
|
|
@@ -1182,7 +1363,7 @@ function TextCellEditor(props) {
|
|
|
1182
1363
|
handleInput(next.value);
|
|
1183
1364
|
};
|
|
1184
1365
|
const renderInput = () => {
|
|
1185
|
-
const startValue =
|
|
1366
|
+
const startValue = untrack6(draft);
|
|
1186
1367
|
return <>
|
|
1187
1368
|
<input
|
|
1188
1369
|
ref={setInput}
|
|
@@ -1206,7 +1387,7 @@ function TextCellEditor(props) {
|
|
|
1206
1387
|
</>;
|
|
1207
1388
|
};
|
|
1208
1389
|
const renderTextarea = () => {
|
|
1209
|
-
const startValue =
|
|
1390
|
+
const startValue = untrack6(draft);
|
|
1210
1391
|
return <div class="ssg-cell-editor-multiline">
|
|
1211
1392
|
<textarea
|
|
1212
1393
|
ref={setTextarea}
|
|
@@ -1245,25 +1426,25 @@ function TextCellEditor(props) {
|
|
|
1245
1426
|
}
|
|
1246
1427
|
|
|
1247
1428
|
// src/editors/NumberCellEditor.tsx
|
|
1248
|
-
import { createSignal as
|
|
1429
|
+
import { createSignal as createSignal5, onCleanup as onCleanup4, onSettled as onSettled4, untrack as untrack7 } from "solid-js";
|
|
1249
1430
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1250
1431
|
import {
|
|
1251
1432
|
resolveNumberEditorCommitValue,
|
|
1252
1433
|
resolveNumberEditorStart
|
|
1253
1434
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1254
1435
|
function NumberCellEditor(props) {
|
|
1255
|
-
const [input, setInput] =
|
|
1256
|
-
const [error, setError] =
|
|
1436
|
+
const [input, setInput] = createSignal5();
|
|
1437
|
+
const [error, setError] = createSignal5(null);
|
|
1257
1438
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1258
|
-
const start = resolveNumberEditorStart(
|
|
1439
|
+
const start = resolveNumberEditorStart(untrack7(() => props.initialValue));
|
|
1259
1440
|
const textMode = start.textMode;
|
|
1260
1441
|
const startText = start.text;
|
|
1261
1442
|
let disposed = false;
|
|
1262
|
-
|
|
1443
|
+
onCleanup4(() => {
|
|
1263
1444
|
disposed = true;
|
|
1264
1445
|
});
|
|
1265
1446
|
props.onRegisterFlush?.(() => {
|
|
1266
|
-
|
|
1447
|
+
untrack7(() => {
|
|
1267
1448
|
const element = input();
|
|
1268
1449
|
if (element) {
|
|
1269
1450
|
props.onCommit(resolveNumberEditorCommitValue(element.value, textMode));
|
|
@@ -1271,7 +1452,7 @@ function NumberCellEditor(props) {
|
|
|
1271
1452
|
});
|
|
1272
1453
|
});
|
|
1273
1454
|
onSettled4(() => {
|
|
1274
|
-
const element =
|
|
1455
|
+
const element = untrack7(input);
|
|
1275
1456
|
if (!element) {
|
|
1276
1457
|
return;
|
|
1277
1458
|
}
|
|
@@ -1320,13 +1501,13 @@ function NumberCellEditor(props) {
|
|
|
1320
1501
|
import {
|
|
1321
1502
|
For as For4,
|
|
1322
1503
|
Show as Show7,
|
|
1323
|
-
createEffect,
|
|
1504
|
+
createEffect as createEffect2,
|
|
1324
1505
|
createRenderEffect as createRenderEffect3,
|
|
1325
|
-
createSignal as
|
|
1506
|
+
createSignal as createSignal6,
|
|
1326
1507
|
createUniqueId,
|
|
1327
|
-
onCleanup as
|
|
1508
|
+
onCleanup as onCleanup5,
|
|
1328
1509
|
onSettled as onSettled5,
|
|
1329
|
-
untrack as
|
|
1510
|
+
untrack as untrack8
|
|
1330
1511
|
} from "solid-js";
|
|
1331
1512
|
import { Portal } from "@solidjs/web";
|
|
1332
1513
|
import {
|
|
@@ -1342,36 +1523,36 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1342
1523
|
function SelectCellEditor(props) {
|
|
1343
1524
|
const texts = useGridLocaleText();
|
|
1344
1525
|
const portal = useGridPortal();
|
|
1345
|
-
const [input, setInput] =
|
|
1346
|
-
const [list, setList] =
|
|
1526
|
+
const [input, setInput] = createSignal6();
|
|
1527
|
+
const [list, setList] = createSignal6();
|
|
1347
1528
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1348
1529
|
const listId = createUniqueId();
|
|
1349
|
-
const start =
|
|
1530
|
+
const start = untrack8(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1350
1531
|
let typeahead = start.typeahead;
|
|
1351
|
-
const [highlight, setHighlight] =
|
|
1532
|
+
const [highlight, setHighlight] = createSignal6(start.highlight);
|
|
1352
1533
|
let currentHighlight = start.highlight;
|
|
1353
1534
|
const updateHighlight = (next) => {
|
|
1354
1535
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1355
1536
|
setHighlight(currentHighlight);
|
|
1356
1537
|
};
|
|
1357
|
-
const [placement2, setPlacement] =
|
|
1538
|
+
const [placement2, setPlacement] = createSignal6(null);
|
|
1358
1539
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1359
|
-
const [error, setError] =
|
|
1360
|
-
const [composing, setComposing] =
|
|
1540
|
+
const [error, setError] = createSignal6(null);
|
|
1541
|
+
const [composing, setComposing] = createSignal6(null);
|
|
1361
1542
|
let composingNow = null;
|
|
1362
1543
|
const updateComposing = (next) => {
|
|
1363
1544
|
composingNow = next;
|
|
1364
1545
|
setComposing(next);
|
|
1365
1546
|
};
|
|
1366
1547
|
const measure = () => {
|
|
1367
|
-
const element =
|
|
1548
|
+
const element = untrack8(input);
|
|
1368
1549
|
if (!element) {
|
|
1369
1550
|
return;
|
|
1370
1551
|
}
|
|
1371
1552
|
setPlacement(
|
|
1372
1553
|
computeSelectPopoverPlacement(
|
|
1373
1554
|
element.getBoundingClientRect(),
|
|
1374
|
-
|
|
1555
|
+
untrack8(() => props.options.length),
|
|
1375
1556
|
window.innerWidth,
|
|
1376
1557
|
window.innerHeight,
|
|
1377
1558
|
optionRowHeight
|
|
@@ -1379,7 +1560,7 @@ function SelectCellEditor(props) {
|
|
|
1379
1560
|
);
|
|
1380
1561
|
};
|
|
1381
1562
|
onSettled5(() => {
|
|
1382
|
-
|
|
1563
|
+
untrack8(input)?.focus();
|
|
1383
1564
|
measure();
|
|
1384
1565
|
window.addEventListener("resize", measure);
|
|
1385
1566
|
window.addEventListener("scroll", measure, true);
|
|
@@ -1388,17 +1569,17 @@ function SelectCellEditor(props) {
|
|
|
1388
1569
|
window.removeEventListener("scroll", measure, true);
|
|
1389
1570
|
};
|
|
1390
1571
|
});
|
|
1391
|
-
|
|
1572
|
+
createEffect2(
|
|
1392
1573
|
() => props.options.length,
|
|
1393
1574
|
(_length, previous) => {
|
|
1394
1575
|
if (previous !== void 0) {
|
|
1395
|
-
|
|
1576
|
+
untrack8(input)?.focus();
|
|
1396
1577
|
measure();
|
|
1397
1578
|
}
|
|
1398
1579
|
},
|
|
1399
1580
|
{ name: "selectEditorOptionsRefocus" }
|
|
1400
1581
|
);
|
|
1401
|
-
|
|
1582
|
+
createEffect2(
|
|
1402
1583
|
() => `${props.cellTop ?? 0}:${props.cellLeft ?? 0}`,
|
|
1403
1584
|
(position, previous) => {
|
|
1404
1585
|
if (previous !== void 0 && previous !== position) {
|
|
@@ -1408,7 +1589,7 @@ function SelectCellEditor(props) {
|
|
|
1408
1589
|
{ name: "selectEditorFollowCell" }
|
|
1409
1590
|
);
|
|
1410
1591
|
const mount = () => placement2() !== null ? portal.container() : null;
|
|
1411
|
-
|
|
1592
|
+
createEffect2(
|
|
1412
1593
|
() => [highlight(), list()],
|
|
1413
1594
|
([index, element]) => {
|
|
1414
1595
|
const option = element?.children[index];
|
|
@@ -1458,9 +1639,9 @@ function SelectCellEditor(props) {
|
|
|
1458
1639
|
};
|
|
1459
1640
|
const highlightedOption = () => props.options[highlight()];
|
|
1460
1641
|
const shownText = () => highlightedOption()?.label ?? String(props.value ?? "");
|
|
1461
|
-
const initialShownText =
|
|
1642
|
+
const initialShownText = untrack8(shownText);
|
|
1462
1643
|
let disposed = false;
|
|
1463
|
-
|
|
1644
|
+
onCleanup5(() => {
|
|
1464
1645
|
disposed = true;
|
|
1465
1646
|
});
|
|
1466
1647
|
const view = <>
|
|
@@ -1473,7 +1654,7 @@ function SelectCellEditor(props) {
|
|
|
1473
1654
|
if (event.isComposing) {
|
|
1474
1655
|
updateComposing(event.currentTarget.value);
|
|
1475
1656
|
} else {
|
|
1476
|
-
event.currentTarget.value = composingNow ??
|
|
1657
|
+
event.currentTarget.value = composingNow ?? untrack8(shownText);
|
|
1477
1658
|
}
|
|
1478
1659
|
}}
|
|
1479
1660
|
onCompositionStart={(event) => updateComposing(event.currentTarget.value)}
|
|
@@ -1576,25 +1757,25 @@ function SelectCellEditor(props) {
|
|
|
1576
1757
|
}
|
|
1577
1758
|
|
|
1578
1759
|
// src/editors/DateCellEditor.tsx
|
|
1579
|
-
import { createSignal as
|
|
1760
|
+
import { createSignal as createSignal7, onCleanup as onCleanup6, onSettled as onSettled6, untrack as untrack9 } from "solid-js";
|
|
1580
1761
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1581
1762
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1582
1763
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1583
1764
|
function DateCellEditor(props) {
|
|
1584
1765
|
const texts = useGridLocaleText();
|
|
1585
|
-
const [input, setInput] =
|
|
1586
|
-
const [error, setError] =
|
|
1587
|
-
const [shift, setShift] =
|
|
1766
|
+
const [input, setInput] = createSignal7();
|
|
1767
|
+
const [error, setError] = createSignal7(null);
|
|
1768
|
+
const [shift, setShift] = createSignal7(0);
|
|
1588
1769
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1589
|
-
const initialText =
|
|
1770
|
+
const initialText = untrack9(() => props.initialText);
|
|
1590
1771
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
1591
|
-
const startValue = textMode ? initialText ?? "" :
|
|
1772
|
+
const startValue = textMode ? initialText ?? "" : untrack9(() => props.initialValue);
|
|
1592
1773
|
let disposed = false;
|
|
1593
|
-
|
|
1774
|
+
onCleanup6(() => {
|
|
1594
1775
|
disposed = true;
|
|
1595
1776
|
});
|
|
1596
1777
|
onSettled6(() => {
|
|
1597
|
-
const element =
|
|
1778
|
+
const element = untrack9(input);
|
|
1598
1779
|
if (!element) {
|
|
1599
1780
|
return;
|
|
1600
1781
|
}
|
|
@@ -1613,7 +1794,7 @@ function DateCellEditor(props) {
|
|
|
1613
1794
|
return normalized === null ? { status: "rejected", message: texts().enterDate } : props.onCommit(normalized, direction);
|
|
1614
1795
|
};
|
|
1615
1796
|
props.onRegisterFlush?.(() => {
|
|
1616
|
-
|
|
1797
|
+
untrack9(() => {
|
|
1617
1798
|
const element = input();
|
|
1618
1799
|
if (element) {
|
|
1619
1800
|
commitDraft(element.value);
|
|
@@ -1657,13 +1838,13 @@ function DateCellEditor(props) {
|
|
|
1657
1838
|
}
|
|
1658
1839
|
|
|
1659
1840
|
// src/editors/CustomCellEditor.tsx
|
|
1660
|
-
import { onCleanup as
|
|
1841
|
+
import { onCleanup as onCleanup7, untrack as untrack10 } from "solid-js";
|
|
1661
1842
|
function CustomCellEditor(props) {
|
|
1662
1843
|
let alive = true;
|
|
1663
|
-
|
|
1844
|
+
onCleanup7(() => {
|
|
1664
1845
|
alive = false;
|
|
1665
1846
|
});
|
|
1666
|
-
const context =
|
|
1847
|
+
const context = untrack10(() => props.context);
|
|
1667
1848
|
const sessionContext = Object.defineProperties({}, Object.getOwnPropertyDescriptors(context));
|
|
1668
1849
|
sessionContext.commit = (value, direction) => alive ? context.commit(value, direction) : { status: "noop" };
|
|
1669
1850
|
sessionContext.cancel = () => {
|
|
@@ -1671,14 +1852,14 @@ function CustomCellEditor(props) {
|
|
|
1671
1852
|
context.cancel();
|
|
1672
1853
|
}
|
|
1673
1854
|
};
|
|
1674
|
-
return <>{
|
|
1855
|
+
return <>{untrack10(() => props.render(sessionContext))}</>;
|
|
1675
1856
|
}
|
|
1676
1857
|
|
|
1677
1858
|
// src/editors/CellEditorLayer.tsx
|
|
1678
1859
|
function CellEditorLayer(props) {
|
|
1679
1860
|
const texts = useGridLocaleText();
|
|
1680
1861
|
const editor = () => props.editor;
|
|
1681
|
-
const kind =
|
|
1862
|
+
const kind = createMemo7(() => {
|
|
1682
1863
|
const type = editor()?.type;
|
|
1683
1864
|
return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
|
|
1684
1865
|
});
|
|
@@ -1687,7 +1868,7 @@ function CellEditorLayer(props) {
|
|
|
1687
1868
|
return session ? formatLocaleText4(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1688
1869
|
};
|
|
1689
1870
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1690
|
-
const selectOptions =
|
|
1871
|
+
const selectOptions = createMemo7(() => {
|
|
1691
1872
|
const current = editor();
|
|
1692
1873
|
if (current?.type !== "select") {
|
|
1693
1874
|
return [];
|
|
@@ -1699,7 +1880,7 @@ function CellEditorLayer(props) {
|
|
|
1699
1880
|
return row !== void 0 ? current.options(row) : [];
|
|
1700
1881
|
});
|
|
1701
1882
|
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1702
|
-
const session =
|
|
1883
|
+
const session = createMemo7(
|
|
1703
1884
|
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session ?? previous ?? null : previous
|
|
1704
1885
|
);
|
|
1705
1886
|
const context = {
|
|
@@ -1757,7 +1938,7 @@ function CellEditorLayer(props) {
|
|
|
1757
1938
|
onCancel: () => props.onCancel(),
|
|
1758
1939
|
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
1759
1940
|
};
|
|
1760
|
-
const initialValue =
|
|
1941
|
+
const initialValue = untrack11(props.initialValue);
|
|
1761
1942
|
if (type === "select" || type === "custom") {
|
|
1762
1943
|
props.onRegisterFlush?.(null);
|
|
1763
1944
|
}
|
|
@@ -1776,7 +1957,7 @@ function CellEditorLayer(props) {
|
|
|
1776
1957
|
/>;
|
|
1777
1958
|
}
|
|
1778
1959
|
case "date": {
|
|
1779
|
-
const session =
|
|
1960
|
+
const session = untrack11(() => props.session);
|
|
1780
1961
|
return <DateCellEditor
|
|
1781
1962
|
{...common}
|
|
1782
1963
|
initialValue={toDateInputValue(session ? session.value : initialValue)}
|
|
@@ -1784,7 +1965,7 @@ function CellEditorLayer(props) {
|
|
|
1784
1965
|
/>;
|
|
1785
1966
|
}
|
|
1786
1967
|
case "select": {
|
|
1787
|
-
const session =
|
|
1968
|
+
const session = untrack11(() => props.session);
|
|
1788
1969
|
return <SelectCellEditor
|
|
1789
1970
|
{...common}
|
|
1790
1971
|
popoverSlot={props.slots.popover}
|
|
@@ -1797,7 +1978,7 @@ function CellEditorLayer(props) {
|
|
|
1797
1978
|
/>;
|
|
1798
1979
|
}
|
|
1799
1980
|
case "custom": {
|
|
1800
|
-
const current =
|
|
1981
|
+
const current = untrack11(editor);
|
|
1801
1982
|
if (current?.type !== "custom") {
|
|
1802
1983
|
return null;
|
|
1803
1984
|
}
|
|
@@ -1842,7 +2023,7 @@ function CellEditorLayer(props) {
|
|
|
1842
2023
|
}
|
|
1843
2024
|
|
|
1844
2025
|
// src/view/DefaultGridTopBar.tsx
|
|
1845
|
-
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";
|
|
1846
2027
|
var DefaultFilterIcon = () => <svg
|
|
1847
2028
|
width="14"
|
|
1848
2029
|
height="14"
|
|
@@ -1874,8 +2055,8 @@ function DefaultGridTopBar(props) {
|
|
|
1874
2055
|
const texts = useGridLocaleText();
|
|
1875
2056
|
const filterSummaryId = createUniqueId2();
|
|
1876
2057
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1877
|
-
const [input, setInput] =
|
|
1878
|
-
const initialText =
|
|
2058
|
+
const [input, setInput] = createSignal8();
|
|
2059
|
+
const initialText = untrack12(() => props.globalFilterText);
|
|
1879
2060
|
createRenderEffect4(
|
|
1880
2061
|
() => [input(), props.globalFilterText],
|
|
1881
2062
|
([element, text]) => {
|
|
@@ -1886,7 +2067,7 @@ function DefaultGridTopBar(props) {
|
|
|
1886
2067
|
{ name: "globalFilterInput" }
|
|
1887
2068
|
);
|
|
1888
2069
|
const hasFilterText = () => props.globalFilterText.trim().length > 0;
|
|
1889
|
-
const filterIcon =
|
|
2070
|
+
const filterIcon = createMemo8(() => {
|
|
1890
2071
|
const icon = props.globalFilterIcon;
|
|
1891
2072
|
return icon === void 0 ? <DefaultFilterIcon /> : icon;
|
|
1892
2073
|
});
|
|
@@ -1994,7 +2175,7 @@ function DefaultGridBottomBar(props) {
|
|
|
1994
2175
|
}
|
|
1995
2176
|
|
|
1996
2177
|
// src/devWarnings.ts
|
|
1997
|
-
import {
|
|
2178
|
+
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
1998
2179
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
1999
2180
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2000
2181
|
import {
|
|
@@ -2005,7 +2186,7 @@ import {
|
|
|
2005
2186
|
var noop2 = () => {
|
|
2006
2187
|
};
|
|
2007
2188
|
var createChangeEffect = (compute, effect) => {
|
|
2008
|
-
|
|
2189
|
+
createEffect3(createMemo9(compute), effect, { name: "devWarning" });
|
|
2009
2190
|
};
|
|
2010
2191
|
var FEATURE_PROPS = {
|
|
2011
2192
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2147,7 +2328,6 @@ var warnOncePerGrid = (warned, id, message) => {
|
|
|
2147
2328
|
warned.add(id);
|
|
2148
2329
|
console.warn(message);
|
|
2149
2330
|
};
|
|
2150
|
-
var isSolidStore = (value) => typeof value === "object" && value !== null && $PROXY in value;
|
|
2151
2331
|
function createShellDevWarningsInDev(args) {
|
|
2152
2332
|
createChangeEffect(
|
|
2153
2333
|
() => args.isServerSide() ? args.groupColumnCount() : 0,
|
|
@@ -2202,18 +2382,6 @@ function createShellDevWarningsInDev(args) {
|
|
|
2202
2382
|
}
|
|
2203
2383
|
}
|
|
2204
2384
|
);
|
|
2205
|
-
createChangeEffect(
|
|
2206
|
-
() => isSolidStore(args.rows()),
|
|
2207
|
-
(fromStore) => {
|
|
2208
|
-
if (fromStore) {
|
|
2209
|
-
warnOncePerGrid(
|
|
2210
|
-
warned,
|
|
2211
|
-
"rowsFromStore",
|
|
2212
|
-
"[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."
|
|
2213
|
-
);
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
);
|
|
2217
2385
|
if (!args.filteringAvailable) {
|
|
2218
2386
|
createChangeEffect(
|
|
2219
2387
|
() => args.globalFilterText().trim() !== "" || args.columnFilterCount() > 0,
|
|
@@ -2261,7 +2429,7 @@ var noop3 = () => {
|
|
|
2261
2429
|
};
|
|
2262
2430
|
var applyHandleRef = (ref, handle) => {
|
|
2263
2431
|
if (typeof ref === "function") {
|
|
2264
|
-
ref(handle);
|
|
2432
|
+
runWithOwner3(null, () => untrack13(() => ref(handle)));
|
|
2265
2433
|
} else if (Array.isArray(ref)) {
|
|
2266
2434
|
for (const item of ref) applyHandleRef(item, handle);
|
|
2267
2435
|
}
|
|
@@ -2292,23 +2460,49 @@ var SLOT_CONTEXT_KEYS = Object.keys({
|
|
|
2292
2460
|
globalFilterProgress: true,
|
|
2293
2461
|
selectionAggregates: true
|
|
2294
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
|
+
});
|
|
2295
2480
|
function GridShell(props, features) {
|
|
2481
|
+
const serverSnapshot = isServer && untrack13(() => props.dataSource == null);
|
|
2296
2482
|
const mountGate = createMountGate();
|
|
2297
|
-
|
|
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];
|
|
2298
2491
|
}
|
|
2299
|
-
function GridShellBody(props, features, mountGate) {
|
|
2492
|
+
function GridShellBody(props, features, mountGate, mode) {
|
|
2300
2493
|
const serverSideFeature2 = features.serverSide;
|
|
2301
|
-
const isServerSide =
|
|
2494
|
+
const isServerSide = createMemo10(() => props.dataSource != null);
|
|
2302
2495
|
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2303
|
-
const [hydrated, setHydrated] =
|
|
2304
|
-
if (!
|
|
2496
|
+
const [hydrated, setHydrated] = createSignal9(mode === "snapshot" || !isServer && !isHydrating(), { name: "hydrated" });
|
|
2497
|
+
if (!untrack13(hydrated)) {
|
|
2305
2498
|
onGridMounted(() => {
|
|
2499
|
+
revealServerFrame(gridRootRef.current?.parentElement, untrack13(() => rootStyle().display));
|
|
2306
2500
|
setHydrated(true);
|
|
2307
2501
|
});
|
|
2308
2502
|
}
|
|
2309
|
-
const [relayedRows, setRelayedRows] =
|
|
2310
|
-
|
|
2311
|
-
() =>
|
|
2503
|
+
const [relayedRows, setRelayedRows] = createSignal9(null);
|
|
2504
|
+
createEffect4(
|
|
2505
|
+
() => latest2(() => props.rows),
|
|
2312
2506
|
{
|
|
2313
2507
|
effect: (value) => {
|
|
2314
2508
|
setRelayedRows({ value });
|
|
@@ -2321,14 +2515,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2321
2515
|
},
|
|
2322
2516
|
{ name: "relayRows" }
|
|
2323
2517
|
);
|
|
2324
|
-
const
|
|
2518
|
+
const plainRows = createPlainRows(() => {
|
|
2519
|
+
const relayed = relayedRows();
|
|
2520
|
+
return relayed ? relayed.value : props.rows;
|
|
2521
|
+
});
|
|
2522
|
+
const rows = createMemo10(() => {
|
|
2325
2523
|
if (props.dataSource != null || !hydrated()) {
|
|
2326
2524
|
return EMPTY_ROWS;
|
|
2327
2525
|
}
|
|
2328
|
-
|
|
2329
|
-
return (relayed ? relayed.value : props.rows) ?? EMPTY_ROWS;
|
|
2526
|
+
return plainRows() ?? EMPTY_ROWS;
|
|
2330
2527
|
});
|
|
2331
|
-
const columns =
|
|
2528
|
+
const columns = createMemo10(() => props.columns);
|
|
2332
2529
|
const density = () => props.density ?? "standard";
|
|
2333
2530
|
const rowHeight = () => props.rowHeight ?? GRID_DENSITY_DIMENSIONS[density()].rowHeight;
|
|
2334
2531
|
const columnHeaderHeight = () => props.headerHeight ?? GRID_DENSITY_DIMENSIONS[density()].headerHeight;
|
|
@@ -2346,7 +2543,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2346
2543
|
const enableRowSelection = () => props.enableRowSelection ?? false;
|
|
2347
2544
|
const rowSelectionMode = () => props.rowSelectionMode ?? "multiple";
|
|
2348
2545
|
const enableSelectAllRows = () => props.enableSelectAllRows ?? (enableRowSelection() && rowSelectionMode() === "multiple");
|
|
2349
|
-
const detailRowEnabled =
|
|
2546
|
+
const detailRowEnabled = createMemo10(() => props.detailRow != null);
|
|
2350
2547
|
const detailToggleColumnActive = () => props.detailRow != null && props.detailRow.showToggleColumn !== false;
|
|
2351
2548
|
const columnInputs = () => ({
|
|
2352
2549
|
columns: columns(),
|
|
@@ -2358,50 +2555,50 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2358
2555
|
renderDetailToggleCell
|
|
2359
2556
|
});
|
|
2360
2557
|
const resolveLocaleText = createLocaleTextResolver(mergeFeatureLocaleDefaults(features));
|
|
2361
|
-
const localeTexts =
|
|
2558
|
+
const localeTexts = createMemo10(() => resolveLocaleText(props.localeText));
|
|
2362
2559
|
const totalRowFeature2 = features.totalRow;
|
|
2363
2560
|
const TotalRow = totalRowFeature2?.TotalRow;
|
|
2364
2561
|
const PinnedRows = features.pinnedRows?.PinnedRows;
|
|
2365
|
-
const totalRowOptions =
|
|
2562
|
+
const totalRowOptions = createMemo10(
|
|
2366
2563
|
() => typeof props.totalRow === "object" && props.totalRow !== null ? props.totalRow : null
|
|
2367
2564
|
);
|
|
2368
|
-
const totalRowEnabled =
|
|
2565
|
+
const totalRowEnabled = createMemo10(
|
|
2369
2566
|
() => (props.totalRow === true || totalRowOptions() !== null) && totalRowFeature2 !== void 0
|
|
2370
2567
|
);
|
|
2371
2568
|
const totalRowLabel = () => totalRowOptions()?.label ?? localeTexts().totalRowLabel;
|
|
2372
|
-
const totalRowHeight =
|
|
2373
|
-
const pinnedTop =
|
|
2569
|
+
const totalRowHeight = createMemo10(() => totalRowEnabled() ? Math.max(0, totalRowOptions()?.height ?? rowHeight()) : 0);
|
|
2570
|
+
const pinnedTop = createMemo10(
|
|
2374
2571
|
() => PinnedRows && props.pinnedTopRows && props.pinnedTopRows.length > 0 ? props.pinnedTopRows : null
|
|
2375
2572
|
);
|
|
2376
|
-
const pinnedBottom =
|
|
2573
|
+
const pinnedBottom = createMemo10(
|
|
2377
2574
|
() => PinnedRows && props.pinnedBottomRows && props.pinnedBottomRows.length > 0 ? props.pinnedBottomRows : null
|
|
2378
2575
|
);
|
|
2379
2576
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2380
2577
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2381
|
-
const headerHeight =
|
|
2382
|
-
const footerHeight =
|
|
2383
|
-
const pinnedBelowTotal =
|
|
2578
|
+
const headerHeight = createMemo10(() => columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2579
|
+
const footerHeight = createMemo10(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2580
|
+
const pinnedBelowTotal = createMemo10(
|
|
2384
2581
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2385
2582
|
);
|
|
2386
2583
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
2387
2584
|
const engine = createGridEngine({
|
|
2388
2585
|
features,
|
|
2389
|
-
initialState:
|
|
2390
|
-
columnInputs:
|
|
2586
|
+
initialState: untrack13(() => props.initialState),
|
|
2587
|
+
columnInputs: untrack13(columnInputs),
|
|
2391
2588
|
serverSide: {
|
|
2392
|
-
isServerSide:
|
|
2393
|
-
enableGlobalFilter:
|
|
2394
|
-
enableColumnFilter:
|
|
2395
|
-
enableSorting:
|
|
2589
|
+
isServerSide: untrack13(isServerSide),
|
|
2590
|
+
enableGlobalFilter: untrack13(globalFilterEnabled),
|
|
2591
|
+
enableColumnFilter: untrack13(columnFilterEnabled),
|
|
2592
|
+
enableSorting: untrack13(enableSorting)
|
|
2396
2593
|
}
|
|
2397
2594
|
});
|
|
2398
|
-
|
|
2595
|
+
onCleanup8(() => engine.dispose());
|
|
2399
2596
|
const store = engine.store;
|
|
2400
2597
|
const dispatch = store.dispatch;
|
|
2401
2598
|
const { state: ui, view } = createGridStoreSignals(store);
|
|
2402
|
-
const viewportWidth =
|
|
2403
|
-
const viewportHeight =
|
|
2404
|
-
const viewScrollTop =
|
|
2599
|
+
const viewportWidth = createMemo10(() => view().viewportWidth);
|
|
2600
|
+
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2601
|
+
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2405
2602
|
const viewSetters = createGridViewSetters(store);
|
|
2406
2603
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2407
2604
|
const gridRootRef = { current: null };
|
|
@@ -2416,23 +2613,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2416
2613
|
const cellDoubleClickRef = { current: noop3 };
|
|
2417
2614
|
const getPopupContainer = () => resolvePopupContainer(
|
|
2418
2615
|
gridRootRef.current,
|
|
2419
|
-
|
|
2616
|
+
untrack13(() => props.popupContainer) ?? "auto"
|
|
2420
2617
|
);
|
|
2421
2618
|
const portalContext = { source: () => gridRootRef.current, container: getPopupContainer };
|
|
2422
2619
|
onGridMounted(() => {
|
|
2423
2620
|
const shell = gridRootRef.current;
|
|
2424
2621
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2425
2622
|
});
|
|
2426
|
-
const columnResolution =
|
|
2623
|
+
const columnResolution = createMemo10(() => engine.resolveColumns(columnInputs()));
|
|
2427
2624
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2428
2625
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2429
2626
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
2430
2627
|
const groupColumns = () => columnResolution().groupColumns;
|
|
2431
2628
|
const aggColumns = () => columnResolution().aggColumns;
|
|
2432
|
-
const activeGroupColumns =
|
|
2433
|
-
const resolvedRowKeyGetter =
|
|
2434
|
-
const selectionSnapshot =
|
|
2435
|
-
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(
|
|
2436
2633
|
() => engine.resolvePaneLayout({
|
|
2437
2634
|
orderedColumns: orderedColumns(),
|
|
2438
2635
|
columnWidths: ui().columnWidths,
|
|
@@ -2442,32 +2639,32 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2442
2639
|
);
|
|
2443
2640
|
const paneLayout = () => paneResolution().paneLayout;
|
|
2444
2641
|
let previousColumnsForWidths = null;
|
|
2445
|
-
|
|
2642
|
+
createEffect4(
|
|
2446
2643
|
columns,
|
|
2447
|
-
(next) => {
|
|
2644
|
+
outsideGraphApply((next) => {
|
|
2448
2645
|
dispatch(gridActions.reconcileColumnWidths(previousColumnsForWidths, next));
|
|
2449
2646
|
previousColumnsForWidths = next;
|
|
2450
|
-
},
|
|
2647
|
+
}),
|
|
2451
2648
|
{ name: "reconcileColumnWidths" }
|
|
2452
2649
|
);
|
|
2453
2650
|
const labelRowFeature2 = features.labelRow;
|
|
2454
|
-
const labelIsLabelRow =
|
|
2455
|
-
const labelGetLabel =
|
|
2456
|
-
const labelRender =
|
|
2457
|
-
const labelRowClassName =
|
|
2458
|
-
const labelRowHeightOption =
|
|
2459
|
-
const labelSortMode =
|
|
2460
|
-
const labelSticky =
|
|
2461
|
-
const labelExportText =
|
|
2462
|
-
const labelKeepEmptySections =
|
|
2463
|
-
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(
|
|
2464
2661
|
() => labelIsLabelRow() != null && labelGetLabel() != null && labelRowFeature2 !== void 0
|
|
2465
2662
|
);
|
|
2466
2663
|
const StickyLabelLayer = labelRowFeature2?.StickyLabelLayer;
|
|
2467
|
-
const labelLayout =
|
|
2664
|
+
const labelLayout = createMemo10(
|
|
2468
2665
|
() => engine.rowPipeline.resolveLabelRowLayout(rows(), isServerSide() ? void 0 : labelIsLabelRow())
|
|
2469
2666
|
);
|
|
2470
|
-
const filterCandidateRows =
|
|
2667
|
+
const filterCandidateRows = createMemo10(() => {
|
|
2471
2668
|
const layout = labelLayout();
|
|
2472
2669
|
const currentRows = rows();
|
|
2473
2670
|
if (!layout) {
|
|
@@ -2485,11 +2682,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2485
2682
|
}
|
|
2486
2683
|
return dataRows;
|
|
2487
2684
|
});
|
|
2488
|
-
const baseOrder =
|
|
2489
|
-
const globalFilterText =
|
|
2490
|
-
const columnFilters =
|
|
2491
|
-
const filterSortColumns =
|
|
2492
|
-
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(() => {
|
|
2493
2690
|
const groups = activeGroupColumns();
|
|
2494
2691
|
return groups.length > 0 ? [...visibleColumns(), ...groups] : visibleColumns();
|
|
2495
2692
|
});
|
|
@@ -2513,7 +2710,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2513
2710
|
const globalFilterStatus = filterOrder ? filterOrder.globalFilterStatus : () => "idle";
|
|
2514
2711
|
const globalFilterProgress = filterOrder ? filterOrder.globalFilterProgress : () => 1;
|
|
2515
2712
|
const relativeDateKey = filterOrder ? filterOrder.relativeDateKey : () => "";
|
|
2516
|
-
const orderResolution =
|
|
2713
|
+
const orderResolution = createMemo10(
|
|
2517
2714
|
() => engine.rowPipeline.resolveOrder({
|
|
2518
2715
|
rows: rows(),
|
|
2519
2716
|
labelLayout: labelLayout(),
|
|
@@ -2531,7 +2728,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2531
2728
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
2532
2729
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
2533
2730
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
2534
|
-
const clientRowModel =
|
|
2731
|
+
const clientRowModel = createMemo10(
|
|
2535
2732
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
2536
2733
|
rows: rows(),
|
|
2537
2734
|
order: orderResolution().order,
|
|
@@ -2550,7 +2747,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2550
2747
|
manualSorting: manualSorting()
|
|
2551
2748
|
})
|
|
2552
2749
|
);
|
|
2553
|
-
const liveServerSideQuery =
|
|
2750
|
+
const liveServerSideQuery = createMemo10(
|
|
2554
2751
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
2555
2752
|
isServerSide: isServerSide(),
|
|
2556
2753
|
globalFilterEnabled: globalFilterEnabled(),
|
|
@@ -2569,7 +2766,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2569
2766
|
"serverSideQueryStore"
|
|
2570
2767
|
);
|
|
2571
2768
|
const serverSideQuerySnapshot = createExternalStoreSignal(engine.serverSideQueryStore, "serverSideQueryStore");
|
|
2572
|
-
const serverSideQueryKey =
|
|
2769
|
+
const serverSideQueryKey = createMemo10(() => serverSideQuerySnapshot().queryKey);
|
|
2573
2770
|
const serverSide = serverSideFeature2?.createServerSide(() => ({
|
|
2574
2771
|
dataSource: props.dataSource,
|
|
2575
2772
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
@@ -2581,7 +2778,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2581
2778
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2582
2779
|
onWriteStateChange: engine.saveStatus.handle
|
|
2583
2780
|
}));
|
|
2584
|
-
const rowModel =
|
|
2781
|
+
const rowModel = createMemo10(() => {
|
|
2585
2782
|
if (!isServerSide() || !serverSide) {
|
|
2586
2783
|
return clientRowModel().rowModel;
|
|
2587
2784
|
}
|
|
@@ -2590,38 +2787,39 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2590
2787
|
const getLabel = labelGetLabel();
|
|
2591
2788
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
2592
2789
|
});
|
|
2593
|
-
const canEditCell =
|
|
2790
|
+
const canEditCell = createMemo10(
|
|
2594
2791
|
() => isServerSide() && !(serverSide?.canUpdateRows() ?? false) ? NEVER_EDITABLE : props.canEditCell
|
|
2595
2792
|
);
|
|
2596
|
-
const applyServerSideCellEdits =
|
|
2793
|
+
const applyServerSideCellEdits = createMemo10(
|
|
2597
2794
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
2598
2795
|
);
|
|
2599
|
-
const viewRowCount =
|
|
2796
|
+
const viewRowCount = createMemo10(() => rowModel().getRowCount());
|
|
2600
2797
|
const viewColCount = () => orderedColumns().length;
|
|
2601
2798
|
const order = () => orderResolution().order;
|
|
2602
2799
|
const groupTree = () => clientRowModel().groupTree;
|
|
2603
2800
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
2604
|
-
const labelViewIndexes =
|
|
2605
|
-
const leafRowCount =
|
|
2801
|
+
const labelViewIndexes = createMemo10(() => labelDisplay()?.labelViewIndexes);
|
|
2802
|
+
const leafRowCount = createMemo10(
|
|
2606
2803
|
() => clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : viewRowCount()
|
|
2607
2804
|
);
|
|
2608
2805
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
2609
2806
|
const groupingFeature2 = features.grouping;
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2807
|
+
const orderArray = createMemo10(() => order());
|
|
2808
|
+
const getFilteredRows = createMemo10(() => {
|
|
2809
|
+
const currentOrder = orderArray();
|
|
2612
2810
|
const currentRows = rows();
|
|
2613
2811
|
let cache = null;
|
|
2614
2812
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
2615
2813
|
});
|
|
2616
|
-
|
|
2814
|
+
createEffect4(
|
|
2617
2815
|
() => [viewRowCount(), viewColCount()],
|
|
2618
|
-
([rowCount, colCount]) => {
|
|
2816
|
+
outsideGraphApply(([rowCount, colCount]) => {
|
|
2619
2817
|
dispatch(gridActions.clampSelectionToRowCount(rowCount, colCount));
|
|
2620
|
-
},
|
|
2818
|
+
}),
|
|
2621
2819
|
{ name: "clampSelectionToRowCount" }
|
|
2622
2820
|
);
|
|
2623
2821
|
const autoHeightSnapshot = createExternalStoreSignal(engine.autoHeightMeasurer, "autoHeightStore");
|
|
2624
|
-
const vertical =
|
|
2822
|
+
const vertical = createMemo10(
|
|
2625
2823
|
() => engine.resolveVerticalLayout({
|
|
2626
2824
|
isServerSide: isServerSide(),
|
|
2627
2825
|
autoHeight: props.autoHeight ?? false,
|
|
@@ -2657,18 +2855,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2657
2855
|
detailExtraCount: () => vertical().detailExtras.length,
|
|
2658
2856
|
detailActive: () => vertical().detailActive,
|
|
2659
2857
|
globalFilterText,
|
|
2660
|
-
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2661
|
-
// 写した rows を読みます(取り直しの失敗を、写しの effect だけが <Errored> へ渡すように。S7-02)。写す前は props.rows。
|
|
2662
|
-
rows: () => {
|
|
2663
|
-
const relayed = relayedRows();
|
|
2664
|
-
return relayed ? relayed.value : props.rows;
|
|
2665
|
-
}
|
|
2858
|
+
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2666
2859
|
});
|
|
2667
|
-
const stickyLabelIndexes =
|
|
2860
|
+
const stickyLabelIndexes = createMemo10(() => {
|
|
2668
2861
|
const indexes = labelViewIndexes();
|
|
2669
2862
|
return labelSticky() && labelRowFeature2 && indexes && indexes.length > 0 ? indexes : null;
|
|
2670
2863
|
});
|
|
2671
|
-
const stickyLabelEntry =
|
|
2864
|
+
const stickyLabelEntry = createMemo10(() => {
|
|
2672
2865
|
const indexes = stickyLabelIndexes();
|
|
2673
2866
|
if (!indexes || !labelRowFeature2) {
|
|
2674
2867
|
return null;
|
|
@@ -2694,7 +2887,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2694
2887
|
pushOffset: resolution.pushOffset
|
|
2695
2888
|
};
|
|
2696
2889
|
});
|
|
2697
|
-
const stickyTopInset =
|
|
2890
|
+
const stickyTopInset = createMemo10(() => {
|
|
2698
2891
|
const indexes = stickyLabelIndexes();
|
|
2699
2892
|
const feature = labelRowFeature2;
|
|
2700
2893
|
if (!indexes || !feature) {
|
|
@@ -2711,8 +2904,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2711
2904
|
};
|
|
2712
2905
|
});
|
|
2713
2906
|
const conditionalFormatFeature2 = features.conditionalFormat;
|
|
2714
|
-
const conditionalFormatStats =
|
|
2715
|
-
const totalRowCells =
|
|
2907
|
+
const conditionalFormatStats = createMemo10(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
|
|
2908
|
+
const totalRowCells = createMemo10(
|
|
2716
2909
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
2717
2910
|
rows: rows(),
|
|
2718
2911
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
@@ -2721,11 +2914,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2721
2914
|
values: totalRowOptions()?.values
|
|
2722
2915
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
2723
2916
|
);
|
|
2724
|
-
const totalRowLabelColumnKey =
|
|
2917
|
+
const totalRowLabelColumnKey = createMemo10(
|
|
2725
2918
|
() => totalRowFeature2 ? totalRowFeature2.resolveTotalRowLabelColumnKey(orderedColumns(), totalRowCells()) : null
|
|
2726
2919
|
);
|
|
2727
2920
|
const columnAutosizeFeature2 = features.columnAutosize;
|
|
2728
|
-
const totalRowAutosizeTexts =
|
|
2921
|
+
const totalRowAutosizeTexts = createMemo10(() => {
|
|
2729
2922
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
2730
2923
|
return void 0;
|
|
2731
2924
|
}
|
|
@@ -2744,10 +2937,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2744
2937
|
}
|
|
2745
2938
|
return texts;
|
|
2746
2939
|
});
|
|
2747
|
-
const pinnedAutosizeRows =
|
|
2940
|
+
const pinnedAutosizeRows = createMemo10(
|
|
2748
2941
|
() => pinnedTop() || pinnedBottom() ? [...pinnedTop() ?? [], ...pinnedBottom() ?? []] : void 0
|
|
2749
2942
|
);
|
|
2750
|
-
const autosizeChipOf =
|
|
2943
|
+
const autosizeChipOf = createMemo10(() => {
|
|
2751
2944
|
const chipFeature = conditionalFormatFeature2;
|
|
2752
2945
|
if (!chipFeature) {
|
|
2753
2946
|
return void 0;
|
|
@@ -2822,27 +3015,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2822
3015
|
"effect",
|
|
2823
3016
|
"autoSizeOnData"
|
|
2824
3017
|
);
|
|
2825
|
-
const totalRowSlotSignature =
|
|
2826
|
-
const totalRowSlot =
|
|
2827
|
-
const totalRowExport =
|
|
3018
|
+
const totalRowSlotSignature = createMemo10(() => serializeSlotValue(totalRowOptions()?.className));
|
|
3019
|
+
const totalRowSlot = createMemo10(() => resolveSlotFromSignature(totalRowSlotSignature()));
|
|
3020
|
+
const totalRowExport = createMemo10(
|
|
2828
3021
|
() => totalRowEnabled() ? { cells: totalRowCells(), label: totalRowLabel() } : void 0
|
|
2829
3022
|
);
|
|
2830
|
-
const pinnedRowsExport =
|
|
3023
|
+
const pinnedRowsExport = createMemo10(
|
|
2831
3024
|
() => pinnedTop() || pinnedBottom() ? { top: pinnedTop() ?? [], bottom: pinnedBottom() ?? [], bottomAfterTotal: pinnedBelowTotal() } : void 0
|
|
2832
3025
|
);
|
|
2833
3026
|
const scrollHintFeature2 = features.scrollHint;
|
|
2834
3027
|
const findFeature2 = features.find;
|
|
2835
3028
|
const imeFeature = features.imeDirectInput;
|
|
2836
|
-
const resolvedScrollHint =
|
|
3029
|
+
const resolvedScrollHint = createMemo10(
|
|
2837
3030
|
() => scrollHintFeature2 ? scrollHintFeature2.resolveScrollHintOptions(props.scrollHint) : null
|
|
2838
3031
|
);
|
|
2839
|
-
const activeScrollHint =
|
|
3032
|
+
const activeScrollHint = createMemo10(() => {
|
|
2840
3033
|
const resolved = resolvedScrollHint();
|
|
2841
3034
|
return resolved !== null && viewRowCount() >= resolved.minRows ? resolved : null;
|
|
2842
3035
|
});
|
|
2843
|
-
const customScrollbar =
|
|
2844
|
-
const autoHeightActive =
|
|
2845
|
-
const bodyRows =
|
|
3036
|
+
const customScrollbar = createMemo10(() => activeScrollHint()?.scrollbar === true);
|
|
3037
|
+
const autoHeightActive = createMemo10(() => vertical().autoHeightActive);
|
|
3038
|
+
const bodyRows = createMemo10(() => {
|
|
2846
3039
|
const { virtualRows, virtualRowIndexes } = vertical();
|
|
2847
3040
|
const model = rowModel();
|
|
2848
3041
|
const serverSideActive = isServerSide();
|
|
@@ -2887,7 +3080,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2887
3080
|
footerHeight: footerHeight()
|
|
2888
3081
|
}), "effect", "scrollSync");
|
|
2889
3082
|
let lastServerSideQueryKey = null;
|
|
2890
|
-
|
|
3083
|
+
createEffect4(
|
|
2891
3084
|
() => isServerSide() ? serverSideQueryKey() : null,
|
|
2892
3085
|
(key) => {
|
|
2893
3086
|
if (key === null) {
|
|
@@ -2908,7 +3101,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2908
3101
|
{ name: "serverSideQueryReset" }
|
|
2909
3102
|
);
|
|
2910
3103
|
let lastDetailQueryKey = null;
|
|
2911
|
-
|
|
3104
|
+
createEffect4(
|
|
2912
3105
|
() => isServerSide() && detailRowEnabled() ? serverSideQueryKey() : null,
|
|
2913
3106
|
(key) => {
|
|
2914
3107
|
if (key === null) {
|
|
@@ -2925,9 +3118,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2925
3118
|
},
|
|
2926
3119
|
{ name: "detailRowsQueryReset" }
|
|
2927
3120
|
);
|
|
2928
|
-
const windowFirstRow =
|
|
2929
|
-
const windowLastRow =
|
|
2930
|
-
|
|
3121
|
+
const windowFirstRow = createMemo10(() => vertical().windowFirstRow);
|
|
3122
|
+
const windowLastRow = createMemo10(() => vertical().windowLastRow);
|
|
3123
|
+
createEffect4(
|
|
2931
3124
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
2932
3125
|
([serverSideActive, firstRow, lastRow]) => {
|
|
2933
3126
|
if (!serverSideActive || !serverSide || lastRow < firstRow) {
|
|
@@ -2937,7 +3130,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2937
3130
|
},
|
|
2938
3131
|
{ name: "serverSideRequestRange" }
|
|
2939
3132
|
);
|
|
2940
|
-
const columnMeasurements =
|
|
3133
|
+
const columnMeasurements = createMemo10(
|
|
2941
3134
|
() => buildColumnMeasurements(visibleColumns(), paneResolution().effectiveColumnWidths)
|
|
2942
3135
|
);
|
|
2943
3136
|
const measuredByColumnVirtualizer = { measure: () => {
|
|
@@ -2956,11 +3149,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2956
3149
|
measureKey: columnMeasurements()
|
|
2957
3150
|
};
|
|
2958
3151
|
});
|
|
2959
|
-
const centerRenderEntries =
|
|
3152
|
+
const centerRenderEntries = createMemo10(() => {
|
|
2960
3153
|
const entries = centerEntries();
|
|
2961
3154
|
return columnVirtualizer.items().map((item) => entries[item.index]).filter((entry) => Boolean(entry));
|
|
2962
3155
|
});
|
|
2963
|
-
const activeCellRendered =
|
|
3156
|
+
const activeCellRendered = createMemo10(
|
|
2964
3157
|
() => isActiveCellRendered(ui().activeCell, vertical().virtualRowIndexes, rowModel(), [
|
|
2965
3158
|
paneLayout().left.entries,
|
|
2966
3159
|
centerRenderEntries(),
|
|
@@ -2995,28 +3188,28 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2995
3188
|
}), "render", "saveStatus");
|
|
2996
3189
|
const systemPrefersDark = createExternalStoreSignal(systemColorSchemeStore, "systemColorSchemeStore");
|
|
2997
3190
|
const themeClassName = () => resolveGridThemeClassName(props.theme ?? "light", systemPrefersDark());
|
|
2998
|
-
const heightLayout =
|
|
2999
|
-
const slotSignature =
|
|
3000
|
-
const slots =
|
|
3191
|
+
const heightLayout = createMemo10(() => resolveGridHeightLayout(props.height, props.maxHeight));
|
|
3192
|
+
const slotSignature = createMemo10(() => serializeSlotValue(props.classNames));
|
|
3193
|
+
const slots = createMemo10(
|
|
3001
3194
|
() => resolveSlotMapFromSignature(slotSignature())
|
|
3002
3195
|
);
|
|
3003
|
-
const activeCellPlacement =
|
|
3196
|
+
const activeCellPlacement = createMemo10(
|
|
3004
3197
|
() => resolveCellPlacement(ui().activeCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3005
3198
|
);
|
|
3006
|
-
const editingCellPlacement =
|
|
3199
|
+
const editingCellPlacement = createMemo10(
|
|
3007
3200
|
() => resolveCellPlacement(ui().editingCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3008
3201
|
);
|
|
3009
|
-
const editorAlignTop =
|
|
3202
|
+
const editorAlignTop = createMemo10(() => {
|
|
3010
3203
|
const editing = ui().editingCell;
|
|
3011
3204
|
const column = editing ? orderedColumns()[editing.col] : void 0;
|
|
3012
3205
|
const placement2 = editingCellPlacement();
|
|
3013
3206
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
3014
3207
|
});
|
|
3015
|
-
const selectionExtents =
|
|
3016
|
-
const selectionBand =
|
|
3208
|
+
const selectionExtents = createMemo10(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3209
|
+
const selectionBand = createMemo10(
|
|
3017
3210
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3018
3211
|
);
|
|
3019
|
-
const selectionBandSegments =
|
|
3212
|
+
const selectionBandSegments = createMemo10(
|
|
3020
3213
|
() => resolveSelectionBandSegments(
|
|
3021
3214
|
vertical().detailActive,
|
|
3022
3215
|
selectionExtents(),
|
|
@@ -3030,7 +3223,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3030
3223
|
resolvePaneBandRect(selectionExtents(), selectionBand(), pane)
|
|
3031
3224
|
];
|
|
3032
3225
|
const motionExtrasFeature2 = features.motionExtras;
|
|
3033
|
-
const copiedSelection =
|
|
3226
|
+
const copiedSelection = createMemo10(() => {
|
|
3034
3227
|
const copied = view().copiedRange;
|
|
3035
3228
|
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true) || !copied) {
|
|
3036
3229
|
return null;
|
|
@@ -3038,11 +3231,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3038
3231
|
const state = ui();
|
|
3039
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;
|
|
3040
3233
|
});
|
|
3041
|
-
const copiedExtents =
|
|
3042
|
-
const copiedBand =
|
|
3234
|
+
const copiedExtents = createMemo10(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3235
|
+
const copiedBand = createMemo10(
|
|
3043
3236
|
() => resolveSelectionBand(copiedExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3044
3237
|
);
|
|
3045
|
-
const copiedBandSegments =
|
|
3238
|
+
const copiedBandSegments = createMemo10(
|
|
3046
3239
|
() => resolveSelectionBandSegments(
|
|
3047
3240
|
vertical().detailActive,
|
|
3048
3241
|
copiedExtents(),
|
|
@@ -3075,24 +3268,24 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3075
3268
|
onGridMounted(() => {
|
|
3076
3269
|
const controller = acquireTooltipController(void 0, gridRootRef.current);
|
|
3077
3270
|
tooltipController = controller;
|
|
3078
|
-
controller.setSlot(
|
|
3271
|
+
controller.setSlot(untrack13(slots).tooltip);
|
|
3079
3272
|
return () => {
|
|
3080
3273
|
controller.dispose();
|
|
3081
3274
|
tooltipController = null;
|
|
3082
3275
|
};
|
|
3083
3276
|
});
|
|
3084
|
-
|
|
3277
|
+
createEffect4(
|
|
3085
3278
|
() => slots().tooltip,
|
|
3086
3279
|
(slot) => {
|
|
3087
3280
|
tooltipController?.setSlot(slot);
|
|
3088
3281
|
},
|
|
3089
3282
|
{ name: "tooltipSlot" }
|
|
3090
3283
|
);
|
|
3091
|
-
const activeCellTooltipKey =
|
|
3284
|
+
const activeCellTooltipKey = createMemo10(() => {
|
|
3092
3285
|
const active = ui().activeCell;
|
|
3093
3286
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3094
3287
|
});
|
|
3095
|
-
|
|
3288
|
+
createEffect4(activeCellTooltipKey, (key) => {
|
|
3096
3289
|
if (key === null) {
|
|
3097
3290
|
hideActiveCellTooltip(gridRootRef.current);
|
|
3098
3291
|
return void 0;
|
|
@@ -3149,7 +3342,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3149
3342
|
"effect",
|
|
3150
3343
|
"viewportSync"
|
|
3151
3344
|
);
|
|
3152
|
-
const controlledRowSelectionModel =
|
|
3345
|
+
const controlledRowSelectionModel = createMemo10(() => {
|
|
3153
3346
|
if (props.rowSelection !== void 0) {
|
|
3154
3347
|
return props.rowSelection;
|
|
3155
3348
|
}
|
|
@@ -3158,11 +3351,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3158
3351
|
}
|
|
3159
3352
|
return void 0;
|
|
3160
3353
|
});
|
|
3161
|
-
const filteredDataRows =
|
|
3354
|
+
const filteredDataRows = createMemo10(
|
|
3162
3355
|
() => !isServerSide() && order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null
|
|
3163
3356
|
);
|
|
3164
3357
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3165
|
-
const selectAllRowsState =
|
|
3358
|
+
const selectAllRowsState = createMemo10(() => {
|
|
3166
3359
|
const filtered = filteredDataRows();
|
|
3167
3360
|
return filtered && enableRowSelection() ? resolveSelectAllState(
|
|
3168
3361
|
countSelectedRowsInOrder(ui().rowSelection, filtered.rows, filtered.order, filtered.rowKeyGetter),
|
|
@@ -3196,8 +3389,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3196
3389
|
keyOf: resolvedRowKeyGetter(),
|
|
3197
3390
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3198
3391
|
}), "render", "detailKeysPruner");
|
|
3199
|
-
const detailDrawable =
|
|
3200
|
-
const hasDetailCards =
|
|
3392
|
+
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <= MAX_BODY_PX2);
|
|
3393
|
+
const hasDetailCards = createMemo10(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3201
3394
|
const detailRows = createDetailRowController();
|
|
3202
3395
|
connectController(detailRows, () => ({
|
|
3203
3396
|
rowModel: rowModel(),
|
|
@@ -3223,11 +3416,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3223
3416
|
),
|
|
3224
3417
|
0
|
|
3225
3418
|
);
|
|
3226
|
-
const detailRender =
|
|
3227
|
-
const detailCardSlotSignature =
|
|
3228
|
-
const detailCardSlot =
|
|
3419
|
+
const detailRender = createMemo10(() => props.detailRow?.render);
|
|
3420
|
+
const detailCardSlotSignature = createMemo10(() => serializeSlotValue(props.detailRow?.className));
|
|
3421
|
+
const detailCardSlot = createMemo10(() => resolveSlotFromSignature(detailCardSlotSignature()));
|
|
3229
3422
|
const collapseDetailRow = (rowKey, viewIndex) => detailRows.setExpandedAt(rowKey, viewIndex, false);
|
|
3230
|
-
const renderLabelRowContent =
|
|
3423
|
+
const renderLabelRowContent = createMemo10(() => {
|
|
3231
3424
|
const render = labelRender();
|
|
3232
3425
|
return render ? (ctx) => render(ctx) : (ctx) => <span class="ssg-label-row-content--default ssg-label-row-default">
|
|
3233
3426
|
<span class="ssg-label-row-text">{ctx.label}</span>
|
|
@@ -3237,7 +3430,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3237
3430
|
const className = labelRowClassName();
|
|
3238
3431
|
return typeof className === "function" ? className(labelRow.row) : className;
|
|
3239
3432
|
};
|
|
3240
|
-
const labelRowLayerCenter =
|
|
3433
|
+
const labelRowLayerCenter = createMemo10(
|
|
3241
3434
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3242
3435
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3243
3436
|
renderContent: renderLabelRowContent(),
|
|
@@ -3246,7 +3439,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3246
3439
|
resolveRowSlot: resolveLabelRowSlot
|
|
3247
3440
|
} : void 0
|
|
3248
3441
|
);
|
|
3249
|
-
const labelRowLayerBand =
|
|
3442
|
+
const labelRowLayerBand = createMemo10(
|
|
3250
3443
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3251
3444
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3252
3445
|
renderContent: null,
|
|
@@ -3255,11 +3448,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3255
3448
|
resolveRowSlot: resolveLabelRowSlot
|
|
3256
3449
|
} : void 0
|
|
3257
3450
|
);
|
|
3258
|
-
const stickyLabelSlot =
|
|
3451
|
+
const stickyLabelSlot = createMemo10(() => {
|
|
3259
3452
|
const entry = stickyLabelEntry();
|
|
3260
3453
|
return resolveSlotProps2(entry ? resolveLabelRowSlot(entry.labelRow) : void 0);
|
|
3261
3454
|
});
|
|
3262
|
-
const labelRowExport =
|
|
3455
|
+
const labelRowExport = createMemo10(() => {
|
|
3263
3456
|
const isLabelRow = labelIsLabelRow();
|
|
3264
3457
|
const getLabel = labelGetLabel();
|
|
3265
3458
|
return labelRowEnabled() && isLabelRow && getLabel ? { isLabelRow, getLabel, exportText: labelExportText() } : void 0;
|
|
@@ -3356,7 +3549,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3356
3549
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
3357
3550
|
const cells = createCellCommands();
|
|
3358
3551
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
3359
|
-
const orderedColumnKeys =
|
|
3552
|
+
const orderedColumnKeys = createMemo10(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
3360
3553
|
const clipboard = createClipboardController();
|
|
3361
3554
|
connectController(clipboard, () => ({
|
|
3362
3555
|
rows: rows(),
|
|
@@ -3378,8 +3571,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3378
3571
|
sort: state.sort,
|
|
3379
3572
|
filters: state.filters,
|
|
3380
3573
|
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
3381
|
-
viewRowCount:
|
|
3382
|
-
columns:
|
|
3574
|
+
viewRowCount: untrack13(viewRowCount),
|
|
3575
|
+
columns: untrack13(orderedColumnKeys)
|
|
3383
3576
|
}
|
|
3384
3577
|
}
|
|
3385
3578
|
});
|
|
@@ -3395,7 +3588,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3395
3588
|
isRowExportable: props.isRowExportable,
|
|
3396
3589
|
dispatch
|
|
3397
3590
|
}), "render", "clipboard");
|
|
3398
|
-
const isWholeGridSelected =
|
|
3591
|
+
const isWholeGridSelected = createMemo10(
|
|
3399
3592
|
() => computeIsWholeGridSelected(ui().selection, viewRowCount(), visibleColumns().length)
|
|
3400
3593
|
);
|
|
3401
3594
|
const fillHandleFeature2 = features.fillHandle;
|
|
@@ -3430,13 +3623,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3430
3623
|
const pageHeight = Math.max(viewportHeight() - headerHeight(), rowHeight());
|
|
3431
3624
|
return resolvePageTargetRow(vertical().rowMetrics, fromRow, direction, pageHeight);
|
|
3432
3625
|
};
|
|
3433
|
-
const findEnabled =
|
|
3434
|
-
const findOptions =
|
|
3435
|
-
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));
|
|
3436
3629
|
const findSnapshot = createExternalStoreSignal(engine.find, "findStore");
|
|
3437
3630
|
const FindBar = findFeature2?.FindBar;
|
|
3438
|
-
const findIndex =
|
|
3439
|
-
const findCurrentIndex =
|
|
3631
|
+
const findIndex = createMemo10(() => findSnapshot().index);
|
|
3632
|
+
const findCurrentIndex = createMemo10(() => findSnapshot().currentIndex);
|
|
3440
3633
|
connectController(engine.find, () => ({
|
|
3441
3634
|
enabled: findEnabled(),
|
|
3442
3635
|
rowModel: rowModel(),
|
|
@@ -3477,13 +3670,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3477
3670
|
});
|
|
3478
3671
|
const columnMenuEnabled = () => enableColumnMenu() && columnMenu !== void 0;
|
|
3479
3672
|
const openColumnMenuFromButton = columnMenu ? (column, event) => {
|
|
3480
|
-
if (filterPopover &&
|
|
3673
|
+
if (filterPopover && untrack13(filterPopover.isOpen) && event.button === 0) {
|
|
3481
3674
|
filterPopover.close();
|
|
3482
3675
|
}
|
|
3483
3676
|
columnMenu.openFromButton(column, event);
|
|
3484
3677
|
} : void 0;
|
|
3485
3678
|
const openColumnMenuForCell = (col) => {
|
|
3486
|
-
const column =
|
|
3679
|
+
const column = untrack13(orderedColumns)[col];
|
|
3487
3680
|
const root = gridRootRef.current;
|
|
3488
3681
|
if (!columnMenu || !column || !root || isSyntheticColumnKey2(column.key)) {
|
|
3489
3682
|
return false;
|
|
@@ -3522,7 +3715,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3522
3715
|
if (!toolPanel) {
|
|
3523
3716
|
return;
|
|
3524
3717
|
}
|
|
3525
|
-
if (
|
|
3718
|
+
if (untrack13(toolPanel.activeTab) === "filter") {
|
|
3526
3719
|
toolPanel.close();
|
|
3527
3720
|
} else {
|
|
3528
3721
|
toolPanel.open("filter");
|
|
@@ -3535,7 +3728,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3535
3728
|
let keyboardContextMenu = null;
|
|
3536
3729
|
const openContextMenuForCell = (cell) => {
|
|
3537
3730
|
const root = gridRootRef.current;
|
|
3538
|
-
const columnsNow =
|
|
3731
|
+
const columnsNow = untrack13(orderedColumns);
|
|
3539
3732
|
const column = columnsNow[cell.col];
|
|
3540
3733
|
const getItems = props.getContextMenuItems;
|
|
3541
3734
|
if (!contextMenuActive() || !contextMenuFeature2 || !contextMenu || !getItems || !root || !column) {
|
|
@@ -3545,12 +3738,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3545
3738
|
root.querySelectorAll(`[data-row-index="${cell.row}"] [data-ssg-col-key]`)
|
|
3546
3739
|
).find((element) => element.dataset.ssgColKey === column.key && !isInsideDetailCardOf(root, element));
|
|
3547
3740
|
const rect = (cellEl ?? root).getBoundingClientRect();
|
|
3548
|
-
const state =
|
|
3741
|
+
const state = untrack13(ui);
|
|
3549
3742
|
const params = contextMenuFeature2.buildCellContextMenuParams({
|
|
3550
3743
|
cell,
|
|
3551
3744
|
clientX: rect.left,
|
|
3552
3745
|
clientY: cellEl ? rect.bottom : rect.top,
|
|
3553
|
-
rowModel:
|
|
3746
|
+
rowModel: untrack13(rowModel),
|
|
3554
3747
|
orderedColumns: columnsNow,
|
|
3555
3748
|
selection: state.selection,
|
|
3556
3749
|
activeCell: state.activeCell
|
|
@@ -3606,17 +3799,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3606
3799
|
}
|
|
3607
3800
|
return;
|
|
3608
3801
|
}
|
|
3609
|
-
const activeCell =
|
|
3802
|
+
const activeCell = untrack13(ui).activeCell;
|
|
3610
3803
|
if (activeCell && openContextMenuForCell(activeCell)) {
|
|
3611
3804
|
event.preventDefault();
|
|
3612
3805
|
}
|
|
3613
3806
|
return;
|
|
3614
3807
|
}
|
|
3615
|
-
const state =
|
|
3808
|
+
const state = untrack13(ui);
|
|
3616
3809
|
const params = contextMenuFeature2.buildBodyContextMenuParams({
|
|
3617
3810
|
event,
|
|
3618
|
-
rowModel:
|
|
3619
|
-
orderedColumns:
|
|
3811
|
+
rowModel: untrack13(rowModel),
|
|
3812
|
+
orderedColumns: untrack13(orderedColumns),
|
|
3620
3813
|
selection: state.selection,
|
|
3621
3814
|
activeCell: state.activeCell
|
|
3622
3815
|
});
|
|
@@ -3633,16 +3826,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3633
3826
|
}
|
|
3634
3827
|
contextMenu.open(params, items);
|
|
3635
3828
|
};
|
|
3636
|
-
const contextMenuView =
|
|
3637
|
-
const
|
|
3638
|
-
if (!
|
|
3829
|
+
const contextMenuView = createMemo10(() => {
|
|
3830
|
+
const snapshot2 = contextMenu?.snapshot();
|
|
3831
|
+
if (!snapshot2?.state || !snapshot2.layout) {
|
|
3639
3832
|
return null;
|
|
3640
3833
|
}
|
|
3641
3834
|
const texts = localeTexts();
|
|
3642
3835
|
return {
|
|
3643
|
-
items:
|
|
3644
|
-
layout:
|
|
3645
|
-
ariaLabel:
|
|
3836
|
+
items: snapshot2.state.items,
|
|
3837
|
+
layout: snapshot2.layout,
|
|
3838
|
+
ariaLabel: snapshot2.state.params.target.type === "rowHeader" ? texts.contextMenuRow : texts.contextMenuCell
|
|
3646
3839
|
};
|
|
3647
3840
|
});
|
|
3648
3841
|
const keyboard = createKeyboardController();
|
|
@@ -3708,7 +3901,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3708
3901
|
startEditWithValue: edit.startEditWithValue,
|
|
3709
3902
|
dispatch
|
|
3710
3903
|
}), "render", "cells");
|
|
3711
|
-
const imeDirectInputEnabled =
|
|
3904
|
+
const imeDirectInputEnabled = createMemo10(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
3712
3905
|
connectController(
|
|
3713
3906
|
engine.imeInput,
|
|
3714
3907
|
() => {
|
|
@@ -3719,27 +3912,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3719
3912
|
editing: ui().editingCell !== null,
|
|
3720
3913
|
activeCell: ui().activeCell,
|
|
3721
3914
|
resolveCell: (cell) => {
|
|
3722
|
-
const column =
|
|
3915
|
+
const column = untrack13(orderedColumns)[cell.col];
|
|
3723
3916
|
return column ? { colKey: column.key, align: column.align } : null;
|
|
3724
3917
|
},
|
|
3725
3918
|
canStartEdit: (cell) => imeFeature?.canStartImeEdit(
|
|
3726
3919
|
{
|
|
3727
|
-
rowModel:
|
|
3728
|
-
columns:
|
|
3729
|
-
readOnly:
|
|
3730
|
-
canEditCell:
|
|
3920
|
+
rowModel: untrack13(rowModel),
|
|
3921
|
+
columns: untrack13(orderedColumns),
|
|
3922
|
+
readOnly: untrack13(readOnly),
|
|
3923
|
+
canEditCell: untrack13(canEditCell)
|
|
3731
3924
|
},
|
|
3732
3925
|
cell
|
|
3733
3926
|
) === true,
|
|
3734
3927
|
startEdit: edit.startEditWithValue,
|
|
3735
3928
|
// number の列は確定した文字を半角の数値の表記へ直して編集を始めます(読めない変換は捨てる)。
|
|
3736
|
-
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(
|
|
3929
|
+
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack13(orderedColumns), cell, text) : text
|
|
3737
3930
|
};
|
|
3738
3931
|
},
|
|
3739
3932
|
"effect",
|
|
3740
3933
|
"imeInput"
|
|
3741
3934
|
);
|
|
3742
|
-
|
|
3935
|
+
createEffect4(imeDirectInputEnabled, (enabled) => {
|
|
3743
3936
|
if (!enabled) {
|
|
3744
3937
|
engine.imeInput.attach(null);
|
|
3745
3938
|
}
|
|
@@ -3756,7 +3949,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3756
3949
|
isClaimedTarget: (target, root) => {
|
|
3757
3950
|
const state = store.getState();
|
|
3758
3951
|
if (!root.contains(target)) {
|
|
3759
|
-
const popupOpen =
|
|
3952
|
+
const popupOpen = untrack13(isAnyGridPopupOpen);
|
|
3760
3953
|
if (target.closest(GRID_POPUP_SELECTOR) !== null) {
|
|
3761
3954
|
return popupOpen || state.editingCell !== null;
|
|
3762
3955
|
}
|
|
@@ -3767,13 +3960,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3767
3960
|
return true;
|
|
3768
3961
|
}
|
|
3769
3962
|
if (target === root || target.hasAttribute("data-ssg-ime-input")) {
|
|
3770
|
-
return state.editingCell !== null || isClearableSelection(state.selection) ||
|
|
3963
|
+
return state.editingCell !== null || isClearableSelection(state.selection) || untrack13(copiedSelection) !== null;
|
|
3771
3964
|
}
|
|
3772
3965
|
return false;
|
|
3773
3966
|
}
|
|
3774
3967
|
}), "render", "escapeClaim");
|
|
3775
3968
|
const handleShellKeyDown = (event) => {
|
|
3776
|
-
if (!
|
|
3969
|
+
if (!untrack13(isAnyGridPopupOpen)) {
|
|
3777
3970
|
handleRootKeyDown(event);
|
|
3778
3971
|
}
|
|
3779
3972
|
if (isEscapeClaimedByGrid(event)) {
|
|
@@ -3826,7 +4019,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3826
4019
|
groupColumns: activeGroupColumns,
|
|
3827
4020
|
localeTexts
|
|
3828
4021
|
});
|
|
3829
|
-
const columnChooserItems =
|
|
4022
|
+
const columnChooserItems = createMemo10(
|
|
3830
4023
|
() => columns().map((column) => ({
|
|
3831
4024
|
key: column.key,
|
|
3832
4025
|
title: column.title || column.key,
|
|
@@ -3836,11 +4029,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3836
4029
|
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
3837
4030
|
}))
|
|
3838
4031
|
);
|
|
3839
|
-
const sortManagerColumns =
|
|
4032
|
+
const sortManagerColumns = createMemo10(
|
|
3840
4033
|
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
3841
4034
|
);
|
|
3842
4035
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
3843
|
-
const toolPanelTabs =
|
|
4036
|
+
const toolPanelTabs = createMemo10(
|
|
3844
4037
|
() => (toolPanel?.availableTabs() ?? []).map((tab) => {
|
|
3845
4038
|
const texts = localeTexts();
|
|
3846
4039
|
if (tab === "filter") {
|
|
@@ -3856,7 +4049,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3856
4049
|
return { tab, label: texts.toolPanelColumns };
|
|
3857
4050
|
})
|
|
3858
4051
|
);
|
|
3859
|
-
const columnMenuGroupingAvailable =
|
|
4052
|
+
const columnMenuGroupingAvailable = createMemo10(
|
|
3860
4053
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
3861
4054
|
);
|
|
3862
4055
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
@@ -3874,7 +4067,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3874
4067
|
ghostSlot: slots().dragGhost,
|
|
3875
4068
|
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
3876
4069
|
}));
|
|
3877
|
-
const columnDragHandler =
|
|
4070
|
+
const columnDragHandler = createMemo10(
|
|
3878
4071
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
3879
4072
|
);
|
|
3880
4073
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
@@ -4095,7 +4288,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4095
4288
|
return engine.scrollSync.markApiScroll();
|
|
4096
4289
|
}
|
|
4097
4290
|
}), "render", "gridApi");
|
|
4098
|
-
|
|
4291
|
+
createEffect4(
|
|
4099
4292
|
() => vertical().physicalBodyHeight,
|
|
4100
4293
|
() => {
|
|
4101
4294
|
engine.gridApi.settleBottomPin();
|
|
@@ -4103,7 +4296,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4103
4296
|
{ name: "gridApiBottomPin" }
|
|
4104
4297
|
);
|
|
4105
4298
|
const handleCallBeforeMountWarned = { current: false };
|
|
4106
|
-
applyHandleRef(
|
|
4299
|
+
applyHandleRef(untrack13(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4107
4300
|
if (mountGate.done) {
|
|
4108
4301
|
return;
|
|
4109
4302
|
}
|
|
@@ -4150,14 +4343,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4150
4343
|
element.removeEventListener("keydown", onKey, { capture: true });
|
|
4151
4344
|
};
|
|
4152
4345
|
});
|
|
4153
|
-
const columnNamer =
|
|
4346
|
+
const columnNamer = createMemo10(
|
|
4154
4347
|
() => createDataColumnNamer(orderedColumns(), {
|
|
4155
4348
|
detail: localeTexts().detailColumnName,
|
|
4156
4349
|
rowDrag: localeTexts().rowDragColumnName
|
|
4157
4350
|
})
|
|
4158
4351
|
);
|
|
4159
|
-
const rowNumberer =
|
|
4160
|
-
const slotContextBase =
|
|
4352
|
+
const rowNumberer = createMemo10(() => createDataRowNumberer(labelViewIndexes()));
|
|
4353
|
+
const slotContextBase = createMemo10(() => ({
|
|
4161
4354
|
rows: rows(),
|
|
4162
4355
|
columns: props.columns,
|
|
4163
4356
|
visibleColumns: visibleColumns(),
|
|
@@ -4167,7 +4360,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4167
4360
|
activeCell: ui().activeCell,
|
|
4168
4361
|
selection: ui().selection
|
|
4169
4362
|
}));
|
|
4170
|
-
const derivedSummary =
|
|
4363
|
+
const derivedSummary = createMemo10(() => {
|
|
4171
4364
|
const summary = buildGridDerivedSummary(
|
|
4172
4365
|
filteringAvailable ? slotContextBase() : { ...slotContextBase(), globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4173
4366
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
@@ -4189,7 +4382,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4189
4382
|
orderedColumns: orderedColumns(),
|
|
4190
4383
|
rowModel: rowModel()
|
|
4191
4384
|
})) : () => null;
|
|
4192
|
-
const
|
|
4385
|
+
const liveDerivedSummary = createLiveObject(DERIVED_SUMMARY_KEYS, derivedSummary);
|
|
4386
|
+
const slotContext = createMemo10(() => {
|
|
4193
4387
|
const filteredRows = getFilteredRows();
|
|
4194
4388
|
return {
|
|
4195
4389
|
...slotContextBase(),
|
|
@@ -4197,20 +4391,20 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4197
4391
|
return filteredRows();
|
|
4198
4392
|
},
|
|
4199
4393
|
setGlobalFilterText,
|
|
4200
|
-
derivedSummary:
|
|
4394
|
+
derivedSummary: liveDerivedSummary,
|
|
4201
4395
|
globalFilterStatus: globalFilterStatus(),
|
|
4202
4396
|
globalFilterProgress: globalFilterProgress(),
|
|
4203
4397
|
selectionAggregates: selectionAggregates()
|
|
4204
4398
|
};
|
|
4205
4399
|
});
|
|
4206
4400
|
const liveSlotContext = createLiveObject(SLOT_CONTEXT_KEYS, slotContext);
|
|
4207
|
-
const renderTopBarFn =
|
|
4208
|
-
const renderBottomBarFn =
|
|
4209
|
-
const customTopBar =
|
|
4401
|
+
const renderTopBarFn = createMemo10(() => props.renderTopBar);
|
|
4402
|
+
const renderBottomBarFn = createMemo10(() => props.renderBottomBar);
|
|
4403
|
+
const customTopBar = createMemo10(() => {
|
|
4210
4404
|
const render = renderTopBarFn();
|
|
4211
4405
|
return render ? render(liveSlotContext) : void 0;
|
|
4212
4406
|
});
|
|
4213
|
-
const customBottomBar =
|
|
4407
|
+
const customBottomBar = createMemo10(() => {
|
|
4214
4408
|
const render = renderBottomBarFn();
|
|
4215
4409
|
return render ? render(liveSlotContext) : void 0;
|
|
4216
4410
|
});
|
|
@@ -4252,7 +4446,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4252
4446
|
{customBottomBar()}
|
|
4253
4447
|
</Show11>
|
|
4254
4448
|
</Show11>;
|
|
4255
|
-
const editorSession =
|
|
4449
|
+
const editorSession = createMemo10((previous) => {
|
|
4256
4450
|
const cell = ui().editingCell;
|
|
4257
4451
|
if (cell === null) {
|
|
4258
4452
|
return null;
|
|
@@ -4280,12 +4474,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4280
4474
|
const rekeyed = !Object.is(identity.rowKey, previous.identity.rowKey) || identity.columnKey !== previous.identity.columnKey;
|
|
4281
4475
|
return { id: rekeyed ? previous.id + 1 : previous.id, identity };
|
|
4282
4476
|
});
|
|
4283
|
-
const editorSessionId =
|
|
4284
|
-
const editingColumn =
|
|
4477
|
+
const editorSessionId = createMemo10(() => editorSession()?.id ?? null);
|
|
4478
|
+
const editingColumn = createMemo10(() => {
|
|
4285
4479
|
const cell = ui().editingCell;
|
|
4286
4480
|
return cell === null ? void 0 : orderedColumns()[cell.col];
|
|
4287
4481
|
});
|
|
4288
|
-
const editingSessionInfo =
|
|
4482
|
+
const editingSessionInfo = createMemo10(() => {
|
|
4289
4483
|
const cell = ui().editingCell;
|
|
4290
4484
|
if (cell === null) {
|
|
4291
4485
|
return null;
|
|
@@ -4312,13 +4506,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4312
4506
|
if (viewIndex < 0) {
|
|
4313
4507
|
return;
|
|
4314
4508
|
}
|
|
4315
|
-
const model =
|
|
4509
|
+
const model = untrack13(rowModel);
|
|
4316
4510
|
const row = model.getRow(viewIndex);
|
|
4317
4511
|
if (row === void 0) {
|
|
4318
4512
|
return;
|
|
4319
4513
|
}
|
|
4320
4514
|
writeCellValueTo(
|
|
4321
|
-
{ rows:
|
|
4515
|
+
{ rows: untrack13(rows), rowModel: model, handleRowsChange: untrack13(handleRowsChange), applyServerSideCellEdits: untrack13(applyServerSideCellEdits) },
|
|
4322
4516
|
viewIndex,
|
|
4323
4517
|
row,
|
|
4324
4518
|
column,
|
|
@@ -4331,7 +4525,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4331
4525
|
if (!RowDragHandle2 || !rowDrag) {
|
|
4332
4526
|
return null;
|
|
4333
4527
|
}
|
|
4334
|
-
const draggable =
|
|
4528
|
+
const draggable = createMemo10(() => {
|
|
4335
4529
|
const isRowDraggable = props.isRowDraggable;
|
|
4336
4530
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
4337
4531
|
});
|
|
@@ -4339,7 +4533,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4339
4533
|
<RowDragHandle2
|
|
4340
4534
|
operable={rowDragOperable()}
|
|
4341
4535
|
tooltip={rowDragOperable() ? rowDragTexts().dragRow : rowDragTexts().dragRowDisabled}
|
|
4342
|
-
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(
|
|
4536
|
+
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(untrack13(() => cell.rowIndex), event)}
|
|
4343
4537
|
/>
|
|
4344
4538
|
</Show11>;
|
|
4345
4539
|
};
|
|
@@ -4358,12 +4552,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4358
4552
|
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4359
4553
|
/>;
|
|
4360
4554
|
}
|
|
4361
|
-
const row = currentRow();
|
|
4362
|
-
const value = getCellValue2(row, unbound);
|
|
4363
4555
|
if (column.renderCell) {
|
|
4364
|
-
const
|
|
4365
|
-
const
|
|
4366
|
-
|
|
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)
|
|
4367
4560
|
);
|
|
4368
4561
|
const detail = {
|
|
4369
4562
|
get expanded() {
|
|
@@ -4372,8 +4565,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4372
4565
|
get expandable() {
|
|
4373
4566
|
return expandable();
|
|
4374
4567
|
},
|
|
4375
|
-
toggle: () => detailRows.toggleAt(cell.rowKey,
|
|
4376
|
-
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey,
|
|
4568
|
+
toggle: () => detailRows.toggleAt(cell.rowKey, untrack13(() => cell.rowIndex)),
|
|
4569
|
+
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey, untrack13(() => cell.rowIndex), expanded2)
|
|
4377
4570
|
};
|
|
4378
4571
|
if (column.key === DETAIL_TOGGLE_COLUMN_KEY2) {
|
|
4379
4572
|
const rowNumber = () => {
|
|
@@ -4385,7 +4578,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4385
4578
|
</Show11>;
|
|
4386
4579
|
}
|
|
4387
4580
|
return column.renderCell({
|
|
4388
|
-
row
|
|
4581
|
+
get row() {
|
|
4582
|
+
return currentRow();
|
|
4583
|
+
},
|
|
4389
4584
|
get rowIndex() {
|
|
4390
4585
|
return cell.rowIndex;
|
|
4391
4586
|
},
|
|
@@ -4399,7 +4594,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4399
4594
|
get detail() {
|
|
4400
4595
|
return detailRowEnabled() ? detail : void 0;
|
|
4401
4596
|
},
|
|
4402
|
-
value
|
|
4597
|
+
get value() {
|
|
4598
|
+
return cellValue();
|
|
4599
|
+
},
|
|
4403
4600
|
column,
|
|
4404
4601
|
get isActive() {
|
|
4405
4602
|
return cell.isActive;
|
|
@@ -4416,6 +4613,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4416
4613
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4417
4614
|
});
|
|
4418
4615
|
}
|
|
4616
|
+
const row = currentRow();
|
|
4617
|
+
const value = getCellValue2(row, unbound);
|
|
4419
4618
|
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4420
4619
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4421
4620
|
const highlightFind = (content) => {
|
|
@@ -4437,7 +4636,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4437
4636
|
const chips = formatRules?.chips;
|
|
4438
4637
|
if (conditionalFormatFeature2 && chips) {
|
|
4439
4638
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4440
|
-
const chip =
|
|
4639
|
+
const chip = createMemo10(
|
|
4441
4640
|
() => resolveChipSpec2(chips, {
|
|
4442
4641
|
row,
|
|
4443
4642
|
get rowIndex() {
|
|
@@ -4750,6 +4949,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4750
4949
|
};
|
|
4751
4950
|
const activeDescendantId = () => activeCellRendered() ? activeCellDomId : void 0;
|
|
4752
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
|
+
});
|
|
4753
4957
|
const shellView = <GridLocaleTextContext value={localeTexts}>
|
|
4754
4958
|
<GridPortalContext value={portalContext}>
|
|
4755
4959
|
<div
|
|
@@ -4770,7 +4974,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4770
4974
|
"ssg-root--hover-cross": hoverCross()
|
|
4771
4975
|
}
|
|
4772
4976
|
]}
|
|
4773
|
-
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}
|
|
4774
4984
|
>
|
|
4775
4985
|
{topBar()}
|
|
4776
4986
|
{
|
|
@@ -4798,7 +5008,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4798
5008
|
data-ssg-has-active-cell={ui().activeCell === null ? void 0 : ""}
|
|
4799
5009
|
onKeyDown={handleShellKeyDown}
|
|
4800
5010
|
onPaste={(event) => {
|
|
4801
|
-
if (
|
|
5011
|
+
if (untrack13(isAnyGridPopupOpen)) {
|
|
4802
5012
|
return;
|
|
4803
5013
|
}
|
|
4804
5014
|
clipboard.handlePaste({
|
|
@@ -5074,7 +5284,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
5074
5284
|
{(tab) => <Show11 when={toolPanel.layout()}>
|
|
5075
5285
|
{(layout) => <Show11 when={toolPanelViews()}>
|
|
5076
5286
|
{(views) => {
|
|
5077
|
-
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } =
|
|
5287
|
+
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } = untrack13(views);
|
|
5078
5288
|
return <ToolPanel
|
|
5079
5289
|
popoverSlot={slots().popover}
|
|
5080
5290
|
themeClassName={portalClassName()}
|
|
@@ -5223,7 +5433,7 @@ var columnAutosizeFeature = {
|
|
|
5223
5433
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5224
5434
|
|
|
5225
5435
|
// src/primitives/columnMenu.ts
|
|
5226
|
-
import { createMemo as
|
|
5436
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
5227
5437
|
import {
|
|
5228
5438
|
createColumnMenuController
|
|
5229
5439
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5234,17 +5444,17 @@ function createColumnMenu(inputs) {
|
|
|
5234
5444
|
enableColumnMenu: inputs.enableColumnMenu(),
|
|
5235
5445
|
gridRootRef: inputs.gridRootRef
|
|
5236
5446
|
}), "render", "columnMenu");
|
|
5237
|
-
const
|
|
5238
|
-
const openedColumnKey =
|
|
5239
|
-
const openedColumn =
|
|
5447
|
+
const snapshot2 = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5448
|
+
const openedColumnKey = createMemo11(() => snapshot2().columnKey);
|
|
5449
|
+
const openedColumn = createMemo11(() => {
|
|
5240
5450
|
const key = openedColumnKey();
|
|
5241
5451
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5242
5452
|
});
|
|
5243
5453
|
return {
|
|
5244
5454
|
openedColumnKey,
|
|
5245
5455
|
openedColumn,
|
|
5246
|
-
layout:
|
|
5247
|
-
isOpen:
|
|
5456
|
+
layout: createMemo11(() => snapshot2().layout),
|
|
5457
|
+
isOpen: createMemo11(() => openedColumnKey() !== null),
|
|
5248
5458
|
panelRef: controller.panelRef,
|
|
5249
5459
|
openFromButton: controller.openFromButton,
|
|
5250
5460
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5255,7 +5465,7 @@ function createColumnMenu(inputs) {
|
|
|
5255
5465
|
}
|
|
5256
5466
|
|
|
5257
5467
|
// src/view/ColumnMenuPopover.tsx
|
|
5258
|
-
import { For as For6, Show as Show12, createEffect 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";
|
|
5259
5469
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5260
5470
|
var PINNED_ITEMS = [
|
|
5261
5471
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5273,21 +5483,21 @@ function ColumnMenuPopover(props) {
|
|
|
5273
5483
|
const texts = useFeatureLocaleText();
|
|
5274
5484
|
const portal = useGridPortal();
|
|
5275
5485
|
const container = portal.container();
|
|
5276
|
-
const [panel, setPanel] =
|
|
5486
|
+
const [panel, setPanel] = createSignal10();
|
|
5277
5487
|
let panelElement;
|
|
5278
|
-
|
|
5488
|
+
onCleanup9(() => {
|
|
5279
5489
|
if (props.panelRef.current === panelElement) {
|
|
5280
5490
|
props.panelRef.current = null;
|
|
5281
5491
|
}
|
|
5282
5492
|
});
|
|
5283
|
-
const layout =
|
|
5284
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5493
|
+
const layout = createMemo12(() => props.layout);
|
|
5494
|
+
const [openSubmenu, setOpenSubmenu] = createSignal10(null);
|
|
5285
5495
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5286
|
-
const isPinSubmenuOpen =
|
|
5496
|
+
const isPinSubmenuOpen = createMemo12(() => {
|
|
5287
5497
|
const current = openSubmenu();
|
|
5288
5498
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5289
5499
|
});
|
|
5290
|
-
|
|
5500
|
+
createEffect5(
|
|
5291
5501
|
() => props.columnKey,
|
|
5292
5502
|
() => {
|
|
5293
5503
|
setOpenSubmenu(null);
|
|
@@ -5298,8 +5508,8 @@ function ColumnMenuPopover(props) {
|
|
|
5298
5508
|
{ name: "columnMenuScrollReset" }
|
|
5299
5509
|
);
|
|
5300
5510
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5301
|
-
const submenuInline =
|
|
5302
|
-
const [pinSubmenu, setPinSubmenu] =
|
|
5511
|
+
const submenuInline = createMemo12(() => layout().maxHeight !== void 0);
|
|
5512
|
+
const [pinSubmenu, setPinSubmenu] = createSignal10();
|
|
5303
5513
|
let pinSubmenuElement;
|
|
5304
5514
|
createPortalTokens(
|
|
5305
5515
|
() => isPinSubmenuOpen() && !submenuInline() ? pinSubmenu() : void 0,
|
|
@@ -5316,7 +5526,7 @@ function ColumnMenuPopover(props) {
|
|
|
5316
5526
|
item?.focus();
|
|
5317
5527
|
return item != null;
|
|
5318
5528
|
};
|
|
5319
|
-
|
|
5529
|
+
createEffect5(isPinSubmenuOpen, (open) => {
|
|
5320
5530
|
if (!open) {
|
|
5321
5531
|
return;
|
|
5322
5532
|
}
|
|
@@ -5693,7 +5903,7 @@ var columnMenuFeature = {
|
|
|
5693
5903
|
};
|
|
5694
5904
|
|
|
5695
5905
|
// src/primitives/columnReorder.ts
|
|
5696
|
-
import { createEffect as
|
|
5906
|
+
import { createEffect as createEffect6 } from "solid-js";
|
|
5697
5907
|
import {
|
|
5698
5908
|
createColumnHeaderDragController
|
|
5699
5909
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnHeaderDragController";
|
|
@@ -5708,7 +5918,7 @@ function createColumnReorder(args) {
|
|
|
5708
5918
|
centerIndicatorRef,
|
|
5709
5919
|
rightIndicatorRef
|
|
5710
5920
|
}), "render", "columnReorder");
|
|
5711
|
-
|
|
5921
|
+
createEffect6(
|
|
5712
5922
|
() => args().paneLayout,
|
|
5713
5923
|
() => {
|
|
5714
5924
|
controller.applyReorderSettle();
|
|
@@ -5805,17 +6015,17 @@ import {
|
|
|
5805
6015
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5806
6016
|
|
|
5807
6017
|
// src/primitives/contextMenu.ts
|
|
5808
|
-
import { createMemo as
|
|
6018
|
+
import { createMemo as createMemo13 } from "solid-js";
|
|
5809
6019
|
import {
|
|
5810
6020
|
createContextMenuController
|
|
5811
6021
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
5812
6022
|
function createCellContextMenu(inputs) {
|
|
5813
6023
|
const controller = createContextMenuController();
|
|
5814
6024
|
connectController(controller, () => ({ gridRootRef: inputs.gridRootRef }), "render", "contextMenu");
|
|
5815
|
-
const
|
|
6025
|
+
const snapshot2 = createExternalStoreSignal(controller, "contextMenuStore");
|
|
5816
6026
|
return {
|
|
5817
|
-
snapshot,
|
|
5818
|
-
isOpen:
|
|
6027
|
+
snapshot: snapshot2,
|
|
6028
|
+
isOpen: createMemo13(() => snapshot2().state !== null),
|
|
5819
6029
|
open: controller.open,
|
|
5820
6030
|
close: controller.close,
|
|
5821
6031
|
panelRef: controller.panelRef
|
|
@@ -5823,19 +6033,19 @@ function createCellContextMenu(inputs) {
|
|
|
5823
6033
|
}
|
|
5824
6034
|
|
|
5825
6035
|
// src/view/CellContextMenuPopover.tsx
|
|
5826
|
-
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";
|
|
5827
6037
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5828
6038
|
function CellContextMenuPopover(props) {
|
|
5829
6039
|
const portal = useGridPortal();
|
|
5830
6040
|
const container = portal.container();
|
|
5831
|
-
const [panel, setPanel] =
|
|
6041
|
+
const [panel, setPanel] = createSignal11();
|
|
5832
6042
|
let panelElement;
|
|
5833
|
-
|
|
6043
|
+
onCleanup10(() => {
|
|
5834
6044
|
if (props.panelRef.current === panelElement) {
|
|
5835
6045
|
props.panelRef.current = null;
|
|
5836
6046
|
}
|
|
5837
6047
|
});
|
|
5838
|
-
const layout =
|
|
6048
|
+
const layout = createMemo14(() => props.layout);
|
|
5839
6049
|
const element = <Show14 when={container}>
|
|
5840
6050
|
{(mount) => <Portal3 mount={mount()}>
|
|
5841
6051
|
<div
|
|
@@ -5948,7 +6158,7 @@ var exportFeature = {
|
|
|
5948
6158
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5949
6159
|
|
|
5950
6160
|
// src/primitives/fillHandle.ts
|
|
5951
|
-
import { createMemo as
|
|
6161
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
5952
6162
|
import {
|
|
5953
6163
|
createFillHandleController
|
|
5954
6164
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -5966,11 +6176,11 @@ import {
|
|
|
5966
6176
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
5967
6177
|
function createFillHandle(inputs) {
|
|
5968
6178
|
const controller = createFillHandleController();
|
|
5969
|
-
const options =
|
|
6179
|
+
const options = createMemo15(() => {
|
|
5970
6180
|
const fillHandle = inputs.fillHandle();
|
|
5971
6181
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
5972
6182
|
});
|
|
5973
|
-
const enabled =
|
|
6183
|
+
const enabled = createMemo15(
|
|
5974
6184
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
5975
6185
|
);
|
|
5976
6186
|
connectController(controller, () => {
|
|
@@ -6007,18 +6217,18 @@ function createFillHandle(inputs) {
|
|
|
6007
6217
|
applyServerSideCellEdits: inputs.applyServerSideCellEdits()
|
|
6008
6218
|
};
|
|
6009
6219
|
}, "render", "fillHandle");
|
|
6010
|
-
const
|
|
6011
|
-
const rowMetrics =
|
|
6012
|
-
const windowFirstRow =
|
|
6013
|
-
const windowLastRow =
|
|
6014
|
-
const detailActive =
|
|
6015
|
-
const detailExtras =
|
|
6016
|
-
const verticalScaleFactor =
|
|
6017
|
-
const paneLayout =
|
|
6018
|
-
const viewportHeight =
|
|
6019
|
-
const scrollTop =
|
|
6020
|
-
const headerHeight =
|
|
6021
|
-
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(() => {
|
|
6022
6232
|
const ui = inputs.uiState();
|
|
6023
6233
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6024
6234
|
return null;
|
|
@@ -6031,8 +6241,8 @@ function createFillHandle(inputs) {
|
|
|
6031
6241
|
}
|
|
6032
6242
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6033
6243
|
});
|
|
6034
|
-
const previewSelection =
|
|
6035
|
-
const current =
|
|
6244
|
+
const previewSelection = createMemo15(() => {
|
|
6245
|
+
const current = snapshot2();
|
|
6036
6246
|
if (current.status !== "dragging" || current.target === null) {
|
|
6037
6247
|
return null;
|
|
6038
6248
|
}
|
|
@@ -6051,7 +6261,7 @@ function createFillHandle(inputs) {
|
|
|
6051
6261
|
}
|
|
6052
6262
|
};
|
|
6053
6263
|
});
|
|
6054
|
-
const previewGeometry =
|
|
6264
|
+
const previewGeometry = createMemo15(() => {
|
|
6055
6265
|
const selection = previewSelection();
|
|
6056
6266
|
if (selection === null) {
|
|
6057
6267
|
return null;
|
|
@@ -6084,8 +6294,8 @@ function createFillHandle(inputs) {
|
|
|
6084
6294
|
}
|
|
6085
6295
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6086
6296
|
};
|
|
6087
|
-
const chip =
|
|
6088
|
-
const current =
|
|
6297
|
+
const chip = createMemo15(() => {
|
|
6298
|
+
const current = snapshot2();
|
|
6089
6299
|
if (current.status !== "filled") {
|
|
6090
6300
|
return null;
|
|
6091
6301
|
}
|
|
@@ -6105,9 +6315,9 @@ function createFillHandle(inputs) {
|
|
|
6105
6315
|
});
|
|
6106
6316
|
return {
|
|
6107
6317
|
controller,
|
|
6108
|
-
snapshot,
|
|
6318
|
+
snapshot: snapshot2,
|
|
6109
6319
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6110
|
-
filling:
|
|
6320
|
+
filling: createMemo15(() => snapshot2().status === "dragging"),
|
|
6111
6321
|
corner,
|
|
6112
6322
|
previewRects,
|
|
6113
6323
|
chip
|
|
@@ -6115,7 +6325,7 @@ function createFillHandle(inputs) {
|
|
|
6115
6325
|
}
|
|
6116
6326
|
|
|
6117
6327
|
// src/view/FillHandleLayer.tsx
|
|
6118
|
-
import { For as For8, Show as Show15, createEffect as
|
|
6328
|
+
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as createMemo16, createSignal as createSignal12, onCleanup as onCleanup11 } from "solid-js";
|
|
6119
6329
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6120
6330
|
import { formatLocaleText as formatLocaleText7 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6121
6331
|
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
@@ -6129,9 +6339,9 @@ function FillHandleLayer(props) {
|
|
|
6129
6339
|
const current = props.fill.chip();
|
|
6130
6340
|
return current?.pane === props.pane ? current.position : null;
|
|
6131
6341
|
};
|
|
6132
|
-
const filled =
|
|
6133
|
-
const
|
|
6134
|
-
return
|
|
6342
|
+
const filled = createMemo16(() => {
|
|
6343
|
+
const snapshot2 = props.fill.snapshot();
|
|
6344
|
+
return snapshot2.status === "filled" ? snapshot2 : null;
|
|
6135
6345
|
});
|
|
6136
6346
|
return <>
|
|
6137
6347
|
{
|
|
@@ -6170,13 +6380,13 @@ function FillHandleLayer(props) {
|
|
|
6170
6380
|
/* 埋めたあとのボタン(左上の位置)。 */
|
|
6171
6381
|
}
|
|
6172
6382
|
<Show15 when={filled()}>
|
|
6173
|
-
{(
|
|
6383
|
+
{(snapshot2) => <Show15 when={chip()}>
|
|
6174
6384
|
{(position) => <FillOptionsChip
|
|
6175
6385
|
fill={props.fill}
|
|
6176
6386
|
x={props.leadingWidth + position().x}
|
|
6177
6387
|
y={props.headerHeight + position().y - props.baseOffset}
|
|
6178
|
-
kind={
|
|
6179
|
-
menuOpen={
|
|
6388
|
+
kind={snapshot2().kind}
|
|
6389
|
+
menuOpen={snapshot2().menu !== null}
|
|
6180
6390
|
/>}
|
|
6181
6391
|
</Show15>}
|
|
6182
6392
|
</Show15>
|
|
@@ -6186,7 +6396,7 @@ function FillOptionsChip(props) {
|
|
|
6186
6396
|
const texts = useFeatureLocaleText();
|
|
6187
6397
|
const { chipElement } = props.fill.controller;
|
|
6188
6398
|
let element;
|
|
6189
|
-
|
|
6399
|
+
onCleanup11(() => {
|
|
6190
6400
|
if (chipElement.current === element) {
|
|
6191
6401
|
chipElement.current = null;
|
|
6192
6402
|
}
|
|
@@ -6240,15 +6450,15 @@ function FillOptionsMenu(props) {
|
|
|
6240
6450
|
const texts = useFeatureLocaleText();
|
|
6241
6451
|
const portal = useGridPortal();
|
|
6242
6452
|
const container = portal.container();
|
|
6243
|
-
const [panel, setPanel] =
|
|
6453
|
+
const [panel, setPanel] = createSignal12();
|
|
6244
6454
|
const { menuPanel } = props.fill.controller;
|
|
6245
6455
|
let panelElement;
|
|
6246
|
-
|
|
6456
|
+
onCleanup11(() => {
|
|
6247
6457
|
if (menuPanel.current === panelElement) {
|
|
6248
6458
|
menuPanel.current = null;
|
|
6249
6459
|
}
|
|
6250
6460
|
});
|
|
6251
|
-
|
|
6461
|
+
createEffect7(panel, (element2) => {
|
|
6252
6462
|
element2?.querySelector('[aria-checked="true"]')?.focus({ preventScroll: true });
|
|
6253
6463
|
}, { name: "fillMenuFocus" });
|
|
6254
6464
|
const handleKeyDown = (event) => {
|
|
@@ -6316,9 +6526,9 @@ function FillTooltip(props) {
|
|
|
6316
6526
|
subscribe: props.fill.controller.subscribePointer,
|
|
6317
6527
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6318
6528
|
}, "fillPointerStore");
|
|
6319
|
-
const visible =
|
|
6320
|
-
const container =
|
|
6321
|
-
const [tooltip, setTooltip] =
|
|
6529
|
+
const visible = createMemo16(() => pointer() !== null);
|
|
6530
|
+
const container = createMemo16(() => visible() ? portal.container() : null);
|
|
6531
|
+
const [tooltip, setTooltip] = createSignal12();
|
|
6322
6532
|
const element = <Show15 when={container()}>
|
|
6323
6533
|
{(mount) => <Portal4 mount={mount()}>
|
|
6324
6534
|
<div
|
|
@@ -6339,22 +6549,22 @@ function FillTooltip(props) {
|
|
|
6339
6549
|
return element;
|
|
6340
6550
|
}
|
|
6341
6551
|
function FillHandlePortals(props) {
|
|
6342
|
-
const menu =
|
|
6343
|
-
const
|
|
6344
|
-
return
|
|
6552
|
+
const menu = createMemo16(() => {
|
|
6553
|
+
const snapshot2 = props.fill.snapshot();
|
|
6554
|
+
return snapshot2.status === "filled" && snapshot2.menu !== null ? snapshot2 : null;
|
|
6345
6555
|
});
|
|
6346
|
-
const tooltipText =
|
|
6347
|
-
const
|
|
6348
|
-
return
|
|
6556
|
+
const tooltipText = createMemo16(() => {
|
|
6557
|
+
const snapshot2 = props.fill.snapshot();
|
|
6558
|
+
return snapshot2.status === "dragging" ? snapshot2.previewText : null;
|
|
6349
6559
|
});
|
|
6350
6560
|
return <>
|
|
6351
6561
|
<Show15 when={menu()}>
|
|
6352
|
-
{(
|
|
6562
|
+
{(snapshot2) => <Show15 when={snapshot2().menu}>
|
|
6353
6563
|
{(layout) => <FillOptionsMenu
|
|
6354
6564
|
fill={props.fill}
|
|
6355
6565
|
layout={layout()}
|
|
6356
|
-
kind={
|
|
6357
|
-
seriesAvailable={
|
|
6566
|
+
kind={snapshot2().kind}
|
|
6567
|
+
seriesAvailable={snapshot2().seriesAvailable}
|
|
6358
6568
|
themeClassName={props.themeClassName}
|
|
6359
6569
|
/>}
|
|
6360
6570
|
</Show15>}
|
|
@@ -6381,7 +6591,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6381
6591
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6382
6592
|
|
|
6383
6593
|
// src/primitives/filterOrder.ts
|
|
6384
|
-
import { createMemo as
|
|
6594
|
+
import { createMemo as createMemo17 } from "solid-js";
|
|
6385
6595
|
import {
|
|
6386
6596
|
createGlobalFilteredOrderRunner,
|
|
6387
6597
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6394,11 +6604,11 @@ import {
|
|
|
6394
6604
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6395
6605
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6396
6606
|
function createFilterOrder(inputs) {
|
|
6397
|
-
const visibleColumns =
|
|
6398
|
-
const globalFilterColumns =
|
|
6399
|
-
const text =
|
|
6400
|
-
const needle =
|
|
6401
|
-
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(
|
|
6402
6612
|
() => ({
|
|
6403
6613
|
rows: inputs.rows(),
|
|
6404
6614
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6408,30 +6618,30 @@ function createFilterOrder(inputs) {
|
|
|
6408
6618
|
{ equals: sameGlobalFilterKey }
|
|
6409
6619
|
);
|
|
6410
6620
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6411
|
-
const syncResult =
|
|
6621
|
+
const syncResult = createMemo17(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6412
6622
|
const runner = createGlobalFilteredOrderRunner();
|
|
6413
6623
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6414
|
-
const
|
|
6415
|
-
const result =
|
|
6416
|
-
const columnFilters =
|
|
6417
|
-
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(
|
|
6418
6628
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6419
6629
|
);
|
|
6420
6630
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6421
6631
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6422
|
-
const relativeDateKey =
|
|
6632
|
+
const relativeDateKey = createMemo17(
|
|
6423
6633
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6424
6634
|
);
|
|
6425
6635
|
return {
|
|
6426
|
-
globalFilteredOrder:
|
|
6427
|
-
globalFilterStatus:
|
|
6428
|
-
globalFilterProgress:
|
|
6636
|
+
globalFilteredOrder: createMemo17(() => result().order),
|
|
6637
|
+
globalFilterStatus: createMemo17(() => result().status),
|
|
6638
|
+
globalFilterProgress: createMemo17(() => result().progress),
|
|
6429
6639
|
relativeDateKey
|
|
6430
6640
|
};
|
|
6431
6641
|
}
|
|
6432
6642
|
|
|
6433
6643
|
// src/primitives/filterPopover.ts
|
|
6434
|
-
import { createMemo as
|
|
6644
|
+
import { createMemo as createMemo18, createSignal as createSignal13, untrack as untrack14 } from "solid-js";
|
|
6435
6645
|
import {
|
|
6436
6646
|
createFilterPopoverController,
|
|
6437
6647
|
resolveOpenedFilterColumn
|
|
@@ -6443,7 +6653,7 @@ var NO_GROUP_COLUMNS = [];
|
|
|
6443
6653
|
function createFilterPopover(inputs) {
|
|
6444
6654
|
const controller = createFilterPopoverController();
|
|
6445
6655
|
const autoFilterTypeCache = /* @__PURE__ */ new Map();
|
|
6446
|
-
const resolveAutoColumnFilterType = (column) =>
|
|
6656
|
+
const resolveAutoColumnFilterType = (column) => untrack14(() => {
|
|
6447
6657
|
const currentValue = inputs.columnFilters()[column.key];
|
|
6448
6658
|
if (currentValue?.kind === "numberSet" || currentValue?.kind === "textSet" || currentValue?.kind === "dateSet" || currentValue?.kind === "text") {
|
|
6449
6659
|
return currentValue.kind;
|
|
@@ -6469,16 +6679,16 @@ function createFilterPopover(inputs) {
|
|
|
6469
6679
|
}
|
|
6470
6680
|
return result.filterType;
|
|
6471
6681
|
});
|
|
6472
|
-
const groupColumns =
|
|
6473
|
-
const popoverColumns =
|
|
6682
|
+
const groupColumns = createMemo18(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
6683
|
+
const popoverColumns = createMemo18(() => {
|
|
6474
6684
|
const groups = groupColumns();
|
|
6475
6685
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6476
6686
|
});
|
|
6477
|
-
const resolveAnchorColumnKey = (columnKey) =>
|
|
6478
|
-
const
|
|
6479
|
-
const state =
|
|
6480
|
-
const layout =
|
|
6481
|
-
const [panel, setPanel] =
|
|
6687
|
+
const resolveAnchorColumnKey = (columnKey) => untrack14(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6688
|
+
const snapshot2 = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6689
|
+
const state = createMemo18(() => snapshot2().state);
|
|
6690
|
+
const layout = createMemo18(() => snapshot2().layout);
|
|
6691
|
+
const [panel, setPanel] = createSignal13(null);
|
|
6482
6692
|
connectController(
|
|
6483
6693
|
controller,
|
|
6484
6694
|
() => {
|
|
@@ -6497,19 +6707,19 @@ function createFilterPopover(inputs) {
|
|
|
6497
6707
|
"effect",
|
|
6498
6708
|
"filterPopover"
|
|
6499
6709
|
);
|
|
6500
|
-
const openedColumnKey =
|
|
6501
|
-
const openedFilterType =
|
|
6502
|
-
const openedColumn =
|
|
6710
|
+
const openedColumnKey = createMemo18(() => state()?.columnKey ?? null);
|
|
6711
|
+
const openedFilterType = createMemo18(() => state()?.filterType ?? null);
|
|
6712
|
+
const openedColumn = createMemo18(() => {
|
|
6503
6713
|
openedColumnKey();
|
|
6504
6714
|
openedFilterType();
|
|
6505
|
-
return resolveOpenedFilterColumn(popoverColumns(),
|
|
6715
|
+
return resolveOpenedFilterColumn(popoverColumns(), untrack14(state));
|
|
6506
6716
|
});
|
|
6507
6717
|
return {
|
|
6508
6718
|
state,
|
|
6509
6719
|
layout,
|
|
6510
6720
|
openedColumn,
|
|
6511
6721
|
openedFilterType,
|
|
6512
|
-
isOpen:
|
|
6722
|
+
isOpen: createMemo18(() => state() !== null),
|
|
6513
6723
|
setPanel: (element) => {
|
|
6514
6724
|
controller.panelRef.current = element;
|
|
6515
6725
|
setPanel(element);
|
|
@@ -6527,7 +6737,7 @@ function createFilterPopover(inputs) {
|
|
|
6527
6737
|
}
|
|
6528
6738
|
|
|
6529
6739
|
// src/primitives/filterManagement.ts
|
|
6530
|
-
import { createMemo as
|
|
6740
|
+
import { createMemo as createMemo19, onCleanup as onCleanup12, untrack as untrack15 } from "solid-js";
|
|
6531
6741
|
import {
|
|
6532
6742
|
createColumnFilterDescribeOptions,
|
|
6533
6743
|
describeColumnFilterValue
|
|
@@ -6543,9 +6753,9 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6543
6753
|
var NO_COLUMNS2 = [];
|
|
6544
6754
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6545
6755
|
function createFilterManagement(inputs) {
|
|
6546
|
-
const groupColumns =
|
|
6547
|
-
const groupColumnKeys =
|
|
6548
|
-
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(() => {
|
|
6549
6759
|
const columnFilters = inputs.columnFilters();
|
|
6550
6760
|
const texts = inputs.localeTexts();
|
|
6551
6761
|
const result = [];
|
|
@@ -6577,7 +6787,7 @@ function createFilterManagement(inputs) {
|
|
|
6577
6787
|
}
|
|
6578
6788
|
return result;
|
|
6579
6789
|
});
|
|
6580
|
-
const addableColumns =
|
|
6790
|
+
const addableColumns = createMemo19(() => {
|
|
6581
6791
|
const columnFilters = inputs.columnFilters();
|
|
6582
6792
|
const texts = inputs.localeTexts();
|
|
6583
6793
|
const grouped = groupColumnKeys();
|
|
@@ -6588,7 +6798,7 @@ function createFilterManagement(inputs) {
|
|
|
6588
6798
|
});
|
|
6589
6799
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
6590
6800
|
let disposed = false;
|
|
6591
|
-
|
|
6801
|
+
onCleanup12(() => {
|
|
6592
6802
|
disposed = true;
|
|
6593
6803
|
for (const frame of pendingFrames) {
|
|
6594
6804
|
cancelAnimationFrame(frame);
|
|
@@ -6602,7 +6812,7 @@ function createFilterManagement(inputs) {
|
|
|
6602
6812
|
});
|
|
6603
6813
|
pendingFrames.add(frame);
|
|
6604
6814
|
};
|
|
6605
|
-
const jumpToColumnFilter = (columnKey) =>
|
|
6815
|
+
const jumpToColumnFilter = (columnKey) => untrack15(() => {
|
|
6606
6816
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
6607
6817
|
const groupColumn = groupColumns().find((candidate) => candidate.key === columnKey);
|
|
6608
6818
|
const anchorKey = groupColumn ? GROUP_AUTO_COLUMN_KEY2 : columnKey;
|
|
@@ -6667,7 +6877,7 @@ function createFilterManagement(inputs) {
|
|
|
6667
6877
|
}
|
|
6668
6878
|
|
|
6669
6879
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6670
|
-
import { Show as Show16, createMemo as
|
|
6880
|
+
import { Show as Show16, createMemo as createMemo20, untrack as untrack16 } from "solid-js";
|
|
6671
6881
|
import {
|
|
6672
6882
|
createFilterPopoverCommands,
|
|
6673
6883
|
createFilterPopoverDerivedResolver
|
|
@@ -6700,11 +6910,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6700
6910
|
const filterPopover = props.filterPopover;
|
|
6701
6911
|
const openedColumn = filterPopover.openedColumn;
|
|
6702
6912
|
const openedType = filterPopover.openedFilterType;
|
|
6703
|
-
const openedOptionsKey =
|
|
6913
|
+
const openedOptionsKey = createMemo20(() => {
|
|
6704
6914
|
const column = openedColumn();
|
|
6705
6915
|
return column ? String(column.key) : null;
|
|
6706
6916
|
});
|
|
6707
|
-
const optionRowsHold =
|
|
6917
|
+
const optionRowsHold = createMemo20((prev) => {
|
|
6708
6918
|
const key = openedOptionsKey();
|
|
6709
6919
|
const rows = props.rows;
|
|
6710
6920
|
if (key === null) {
|
|
@@ -6715,9 +6925,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6715
6925
|
}
|
|
6716
6926
|
return prev;
|
|
6717
6927
|
});
|
|
6718
|
-
const optionRows =
|
|
6719
|
-
const openedIsDateSet =
|
|
6720
|
-
const getOpenedColumnRawValueAt =
|
|
6928
|
+
const optionRows = createMemo20(() => optionRowsHold().rows);
|
|
6929
|
+
const openedIsDateSet = createMemo20(() => openedType() === "dateSet");
|
|
6930
|
+
const getOpenedColumnRawValueAt = createMemo20(() => {
|
|
6721
6931
|
const rows = optionRows();
|
|
6722
6932
|
const column = openedColumn();
|
|
6723
6933
|
const isDateSet = openedIsDateSet();
|
|
@@ -6729,7 +6939,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6729
6939
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6730
6940
|
};
|
|
6731
6941
|
});
|
|
6732
|
-
const usesAsyncOptions =
|
|
6942
|
+
const usesAsyncOptions = createMemo20(() => {
|
|
6733
6943
|
const column = openedColumn();
|
|
6734
6944
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
6735
6945
|
});
|
|
@@ -6746,12 +6956,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6746
6956
|
};
|
|
6747
6957
|
}, "render", "filterOptionsSource");
|
|
6748
6958
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
6749
|
-
const collectColumn =
|
|
6750
|
-
const numeric =
|
|
6751
|
-
const syncResult =
|
|
6959
|
+
const collectColumn = createMemo20(() => usesAsyncOptions() ? null : openedColumn());
|
|
6960
|
+
const numeric = createMemo20(() => openedType() === "numberSet");
|
|
6961
|
+
const syncResult = createMemo20(
|
|
6752
6962
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
6753
6963
|
);
|
|
6754
|
-
const sourceKey =
|
|
6964
|
+
const sourceKey = createMemo20(() => {
|
|
6755
6965
|
const column = collectColumn();
|
|
6756
6966
|
return column === null ? void 0 : String(column.key);
|
|
6757
6967
|
});
|
|
@@ -6764,14 +6974,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6764
6974
|
sourceKey: sourceKey()
|
|
6765
6975
|
}), "render", "filterValueCollector");
|
|
6766
6976
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
6767
|
-
const optionsResult =
|
|
6977
|
+
const optionsResult = createMemo20(() => {
|
|
6768
6978
|
if (usesAsyncOptions()) {
|
|
6769
6979
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
6770
6980
|
}
|
|
6771
6981
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
6772
6982
|
});
|
|
6773
6983
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
6774
|
-
const derived =
|
|
6984
|
+
const derived = createMemo20(
|
|
6775
6985
|
() => resolveDerived({
|
|
6776
6986
|
openedFilterColumn: openedColumn(),
|
|
6777
6987
|
openedFilterType: openedType(),
|
|
@@ -6795,7 +7005,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6795
7005
|
filterTexts: props.localeTexts
|
|
6796
7006
|
}), "render", "filterPopoverCommands");
|
|
6797
7007
|
const texts = () => props.localeTexts;
|
|
6798
|
-
const currentValueText =
|
|
7008
|
+
const currentValueText = createMemo20(() => {
|
|
6799
7009
|
const column = openedColumn();
|
|
6800
7010
|
if (!column) {
|
|
6801
7011
|
return texts().filterCurrentNone;
|
|
@@ -6812,16 +7022,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6812
7022
|
const text = columnFilterValueToDraftText(rawValue);
|
|
6813
7023
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
6814
7024
|
});
|
|
6815
|
-
const datePresets =
|
|
7025
|
+
const datePresets = createMemo20(() => {
|
|
6816
7026
|
const column = openedColumn();
|
|
6817
7027
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
6818
7028
|
});
|
|
6819
|
-
const comboSummaryText =
|
|
7029
|
+
const comboSummaryText = createMemo20(() => {
|
|
6820
7030
|
const column = openedColumn();
|
|
6821
7031
|
const value = derived().openedSetFilterValue;
|
|
6822
7032
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
6823
7033
|
});
|
|
6824
|
-
const renderDateInput =
|
|
7034
|
+
const renderDateInput = createMemo20(() => {
|
|
6825
7035
|
const render = props.renderFilterDateInput;
|
|
6826
7036
|
const column = openedColumn();
|
|
6827
7037
|
if (!render || !column) {
|
|
@@ -6844,7 +7054,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6844
7054
|
{(column) => <Show16 when={filterPopover.layout()}>
|
|
6845
7055
|
{(layout) => <Show16 when={props.views()}>
|
|
6846
7056
|
{(views) => {
|
|
6847
|
-
const ColumnFilterPopover =
|
|
7057
|
+
const ColumnFilterPopover = untrack16(views).ColumnFilterPopover;
|
|
6848
7058
|
return <Show16 when={column().key} keyed>
|
|
6849
7059
|
{(columnKey) => <ColumnFilterPopover
|
|
6850
7060
|
popoverSlot={props.popoverSlot}
|
|
@@ -6950,10 +7160,10 @@ function GridFilterChipBar(props) {
|
|
|
6950
7160
|
}
|
|
6951
7161
|
|
|
6952
7162
|
// src/view/lazyPopups.ts
|
|
6953
|
-
import { createEffect as
|
|
7163
|
+
import { createEffect as createEffect8, createMemo as createMemo21 } from "solid-js";
|
|
6954
7164
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
6955
7165
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
6956
|
-
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-
|
|
7166
|
+
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-D7INPNVB.jsx"));
|
|
6957
7167
|
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-HIQGRX3N.jsx"));
|
|
6958
7168
|
var preloadGridPopups = async () => {
|
|
6959
7169
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
@@ -6963,8 +7173,8 @@ var reportLoadError = (error) => {
|
|
|
6963
7173
|
};
|
|
6964
7174
|
function createLazyModuleSignal(module, options, name) {
|
|
6965
7175
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
6966
|
-
|
|
6967
|
-
|
|
7176
|
+
createEffect8(
|
|
7177
|
+
createMemo21(() => options.needed() && loaded() === null),
|
|
6968
7178
|
(shouldLoad) => {
|
|
6969
7179
|
if (!shouldLoad) {
|
|
6970
7180
|
return;
|
|
@@ -6982,8 +7192,8 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
6982
7192
|
},
|
|
6983
7193
|
{ name: `${name}Load` }
|
|
6984
7194
|
);
|
|
6985
|
-
|
|
6986
|
-
|
|
7195
|
+
createEffect8(
|
|
7196
|
+
createMemo21(() => options.prefetch() && module.getSnapshot() === null),
|
|
6987
7197
|
(shouldPrefetch) => {
|
|
6988
7198
|
if (!shouldPrefetch) {
|
|
6989
7199
|
return;
|
|
@@ -7018,14 +7228,14 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7018
7228
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7019
7229
|
|
|
7020
7230
|
// src/view/GridFindBar.tsx
|
|
7021
|
-
import { createRenderEffect as createRenderEffect5, createSignal as
|
|
7231
|
+
import { createRenderEffect as createRenderEffect5, createSignal as createSignal14, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
7022
7232
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7023
7233
|
function GridFindBar(props) {
|
|
7024
7234
|
const texts = useFeatureLocaleText();
|
|
7025
|
-
const [input, setInput] =
|
|
7026
|
-
const initialQuery =
|
|
7235
|
+
const [input, setInput] = createSignal14();
|
|
7236
|
+
const initialQuery = untrack17(() => props.snapshot.query);
|
|
7027
7237
|
onSettled7(() => {
|
|
7028
|
-
const element =
|
|
7238
|
+
const element = untrack17(input);
|
|
7029
7239
|
element?.focus();
|
|
7030
7240
|
element?.select();
|
|
7031
7241
|
});
|
|
@@ -7040,18 +7250,18 @@ function GridFindBar(props) {
|
|
|
7040
7250
|
);
|
|
7041
7251
|
const count = () => props.snapshot.matches.length;
|
|
7042
7252
|
const countLabel = () => {
|
|
7043
|
-
const
|
|
7253
|
+
const snapshot2 = props.snapshot;
|
|
7044
7254
|
const localeTexts = texts();
|
|
7045
|
-
if (
|
|
7255
|
+
if (snapshot2.query.length === 0) {
|
|
7046
7256
|
return "";
|
|
7047
7257
|
}
|
|
7048
|
-
if (
|
|
7258
|
+
if (snapshot2.scanning) {
|
|
7049
7259
|
return localeTexts.findSearching;
|
|
7050
7260
|
}
|
|
7051
7261
|
if (count() === 0) {
|
|
7052
7262
|
return localeTexts.findNoResults;
|
|
7053
7263
|
}
|
|
7054
|
-
return `${(
|
|
7264
|
+
return `${(snapshot2.currentIndex ?? 0) + 1} / ${count()}${snapshot2.truncated ? "+" : ""}`;
|
|
7055
7265
|
};
|
|
7056
7266
|
const handleKeyDown = (event) => {
|
|
7057
7267
|
if (isImeComposingKeyEvent3(event)) {
|
|
@@ -7154,7 +7364,7 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7154
7364
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7155
7365
|
|
|
7156
7366
|
// src/view/GridBodyGroupRow.tsx
|
|
7157
|
-
import { For as For10, Show as Show18, createMemo as
|
|
7367
|
+
import { For as For10, Show as Show18, createMemo as createMemo22 } from "solid-js";
|
|
7158
7368
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7159
7369
|
import {
|
|
7160
7370
|
formatTotalRowCellText,
|
|
@@ -7212,10 +7422,10 @@ function GridBodyGroupRow(props) {
|
|
|
7212
7422
|
</Show18>
|
|
7213
7423
|
<For10 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7214
7424
|
{(entry) => {
|
|
7215
|
-
const unbound =
|
|
7425
|
+
const unbound = createMemo22(() => entry().column);
|
|
7216
7426
|
const column = () => unbound();
|
|
7217
7427
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7218
|
-
const aggregate =
|
|
7428
|
+
const aggregate = createMemo22(() => {
|
|
7219
7429
|
const current = column();
|
|
7220
7430
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7221
7431
|
return null;
|
|
@@ -7324,12 +7534,12 @@ import {
|
|
|
7324
7534
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7325
7535
|
|
|
7326
7536
|
// src/view/GridBodyLabelRow.tsx
|
|
7327
|
-
import { Show as Show19, createMemo as
|
|
7537
|
+
import { Show as Show19, createMemo as createMemo23 } from "solid-js";
|
|
7328
7538
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7329
|
-
const row =
|
|
7330
|
-
const sourceRowIndex =
|
|
7331
|
-
const label =
|
|
7332
|
-
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);
|
|
7333
7543
|
return {
|
|
7334
7544
|
get row() {
|
|
7335
7545
|
return row();
|
|
@@ -7405,7 +7615,7 @@ function GridBodyLabelRow(props) {
|
|
|
7405
7615
|
}
|
|
7406
7616
|
|
|
7407
7617
|
// src/view/GridStickyLabelLayer.tsx
|
|
7408
|
-
import { Show as Show20, createMemo as
|
|
7618
|
+
import { Show as Show20, createMemo as createMemo24, onSettled as onSettled8 } from "solid-js";
|
|
7409
7619
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7410
7620
|
function GridStickyLabelLayer(props) {
|
|
7411
7621
|
return <Show20 when={props.entry}>
|
|
@@ -7414,10 +7624,10 @@ function GridStickyLabelLayer(props) {
|
|
|
7414
7624
|
}
|
|
7415
7625
|
function StickyLabel(props) {
|
|
7416
7626
|
const layer = props.layer;
|
|
7417
|
-
const labelRow =
|
|
7418
|
-
const rowIndex =
|
|
7419
|
-
const rowKey =
|
|
7420
|
-
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);
|
|
7421
7631
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7422
7632
|
let element;
|
|
7423
7633
|
onSettled8(() => {
|
|
@@ -7520,12 +7730,12 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7520
7730
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7521
7731
|
|
|
7522
7732
|
// src/primitives/serverSide.ts
|
|
7523
|
-
import { createMemo as
|
|
7733
|
+
import { createMemo as createMemo25, untrack as untrack18 } from "solid-js";
|
|
7524
7734
|
import {
|
|
7525
7735
|
createServerSideRowModel
|
|
7526
7736
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
7527
7737
|
function createServerSide(args) {
|
|
7528
|
-
const controller = createServerSideRowModel(
|
|
7738
|
+
const controller = createServerSideRowModel(untrack18(args));
|
|
7529
7739
|
let updated = false;
|
|
7530
7740
|
let pendingRange = null;
|
|
7531
7741
|
connectController(
|
|
@@ -7555,28 +7765,28 @@ function createServerSide(args) {
|
|
|
7555
7765
|
}
|
|
7556
7766
|
controller.requestRange(startIndex, endIndex);
|
|
7557
7767
|
};
|
|
7558
|
-
const
|
|
7768
|
+
const snapshot2 = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7559
7769
|
return {
|
|
7560
|
-
rowModel:
|
|
7561
|
-
rowCount: () =>
|
|
7562
|
-
loadError:
|
|
7563
|
-
writeError:
|
|
7770
|
+
rowModel: createMemo25(() => snapshot2().rowModel),
|
|
7771
|
+
rowCount: () => snapshot2().rowCount,
|
|
7772
|
+
loadError: createMemo25(() => snapshot2().loadError),
|
|
7773
|
+
writeError: createMemo25(() => snapshot2().writeError),
|
|
7564
7774
|
isRowLoaded: controller.isRowLoaded,
|
|
7565
7775
|
requestRange,
|
|
7566
7776
|
refresh: controller.refresh,
|
|
7567
7777
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7568
7778
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7569
|
-
canUpdateRows:
|
|
7779
|
+
canUpdateRows: createMemo25(() => args().dataSource?.updateRows !== void 0),
|
|
7570
7780
|
applyCellEdits: controller.applyCellEdits
|
|
7571
7781
|
};
|
|
7572
7782
|
}
|
|
7573
7783
|
|
|
7574
7784
|
// src/view/GridServerSideErrorBars.tsx
|
|
7575
|
-
import { Show as Show21, createSignal as
|
|
7785
|
+
import { Show as Show21, createSignal as createSignal15 } from "solid-js";
|
|
7576
7786
|
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7577
7787
|
function GridServerSideErrorBars(props) {
|
|
7578
|
-
const [dismissedLoadError, setDismissedLoadError] =
|
|
7579
|
-
const [dismissedWriteError, setDismissedWriteError] =
|
|
7788
|
+
const [dismissedLoadError, setDismissedLoadError] = createSignal15(null);
|
|
7789
|
+
const [dismissedWriteError, setDismissedWriteError] = createSignal15(null);
|
|
7580
7790
|
const texts = () => props.localeTexts;
|
|
7581
7791
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7582
7792
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
@@ -7748,7 +7958,7 @@ var motionExtrasFeature = {
|
|
|
7748
7958
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7749
7959
|
|
|
7750
7960
|
// src/view/GridPinnedRows.tsx
|
|
7751
|
-
import { For as For12, Show as Show24, createMemo as
|
|
7961
|
+
import { For as For12, Show as Show24, createMemo as createMemo26 } from "solid-js";
|
|
7752
7962
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7753
7963
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7754
7964
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
@@ -7772,7 +7982,7 @@ function GridPinnedRows(props) {
|
|
|
7772
7982
|
<For12 each={props.rows} keyed={false}>
|
|
7773
7983
|
{(row, index) => {
|
|
7774
7984
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
7775
|
-
const rowSlot =
|
|
7985
|
+
const rowSlot = createMemo26(
|
|
7776
7986
|
() => resolveSlotProps3(
|
|
7777
7987
|
props.getRowClassName?.(row(), index, {
|
|
7778
7988
|
row: row(),
|
|
@@ -7827,11 +8037,11 @@ function GridPinnedRows(props) {
|
|
|
7827
8037
|
</Show24>
|
|
7828
8038
|
<For12 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7829
8039
|
{(entry) => {
|
|
7830
|
-
const unbound =
|
|
8040
|
+
const unbound = createMemo26(() => entry().column);
|
|
7831
8041
|
const column = () => unbound();
|
|
7832
|
-
const value =
|
|
7833
|
-
const colIndex =
|
|
7834
|
-
const ctx =
|
|
8042
|
+
const value = createMemo26(() => getCellValue5(row(), unbound()));
|
|
8043
|
+
const colIndex = createMemo26(() => entry().logicalIndex);
|
|
8044
|
+
const ctx = createMemo26(
|
|
7835
8045
|
() => ({
|
|
7836
8046
|
row: row(),
|
|
7837
8047
|
rowIndex: index,
|
|
@@ -7847,19 +8057,19 @@ function GridPinnedRows(props) {
|
|
|
7847
8057
|
pinned: props.position
|
|
7848
8058
|
})
|
|
7849
8059
|
);
|
|
7850
|
-
const cellSlot =
|
|
8060
|
+
const cellSlot = createMemo26(() => {
|
|
7851
8061
|
const cellClassName = column().cellClassName;
|
|
7852
8062
|
return resolveSlotProps3(
|
|
7853
8063
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
7854
8064
|
);
|
|
7855
8065
|
});
|
|
7856
8066
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
7857
|
-
const dataBar =
|
|
8067
|
+
const dataBar = createMemo26(() => {
|
|
7858
8068
|
const feature = props.conditionalFormat;
|
|
7859
8069
|
const format = rules()?.dataBar;
|
|
7860
8070
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
7861
8071
|
});
|
|
7862
|
-
const scaleBackground =
|
|
8072
|
+
const scaleBackground = createMemo26(() => {
|
|
7863
8073
|
const feature = props.conditionalFormat;
|
|
7864
8074
|
const format = rules()?.colorScale;
|
|
7865
8075
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -7869,7 +8079,7 @@ function GridPinnedRows(props) {
|
|
|
7869
8079
|
const format = rules()?.dataBar;
|
|
7870
8080
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
7871
8081
|
};
|
|
7872
|
-
const content =
|
|
8082
|
+
const content = createMemo26(() => {
|
|
7873
8083
|
const current = column();
|
|
7874
8084
|
if (isSyntheticColumnKey3(current.key)) {
|
|
7875
8085
|
return null;
|
|
@@ -7963,7 +8173,7 @@ var pinnedRowsFeature = {
|
|
|
7963
8173
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7964
8174
|
|
|
7965
8175
|
// src/primitives/rowDrag.ts
|
|
7966
|
-
import { createEffect as
|
|
8176
|
+
import { createEffect as createEffect9, createMemo as createMemo27, untrack as untrack19 } from "solid-js";
|
|
7967
8177
|
import {
|
|
7968
8178
|
createRowDragController
|
|
7969
8179
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
@@ -7978,10 +8188,10 @@ function createRowDrag(inputs) {
|
|
|
7978
8188
|
const leftIndicatorRef = { current: null };
|
|
7979
8189
|
const centerIndicatorRef = { current: null };
|
|
7980
8190
|
const rightIndicatorRef = { current: null };
|
|
7981
|
-
const canDropAt =
|
|
7982
|
-
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(
|
|
7983
|
-
const getDragRow = (viewIndex) => getDragRowToken(
|
|
7984
|
-
const locateDragRow =
|
|
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(() => {
|
|
7985
8195
|
const rowModel = inputs.rowModel();
|
|
7986
8196
|
const hasRowKeys = inputs.hasRowKeys();
|
|
7987
8197
|
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
@@ -8001,7 +8211,7 @@ function createRowDrag(inputs) {
|
|
|
8001
8211
|
"effect",
|
|
8002
8212
|
"rowDrag"
|
|
8003
8213
|
);
|
|
8004
|
-
|
|
8214
|
+
createEffect9(inputs.rowModel, () => {
|
|
8005
8215
|
controller.applyReorderSettle();
|
|
8006
8216
|
}, { name: "rowDragSettle" });
|
|
8007
8217
|
return {
|
|
@@ -8055,7 +8265,7 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8055
8265
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8056
8266
|
|
|
8057
8267
|
// src/view/GridScrollHint.tsx
|
|
8058
|
-
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";
|
|
8059
8269
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8060
8270
|
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8061
8271
|
import {
|
|
@@ -8073,18 +8283,18 @@ var SCROLL_HINT_OVERLAY_TRACK_ZONE_PX = 8;
|
|
|
8073
8283
|
var SCROLL_HINT_JUMP_LABEL_FLIP_PX = 28;
|
|
8074
8284
|
function GridScrollHint(props) {
|
|
8075
8285
|
const texts = useFeatureLocaleText();
|
|
8076
|
-
const [scrollActive, setScrollActive] =
|
|
8077
|
-
const [hovered, setHovered] =
|
|
8078
|
-
const [scrollbarWidth, setScrollbarWidth] =
|
|
8079
|
-
const [trackPointerY, setTrackPointerY] =
|
|
8080
|
-
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);
|
|
8081
8291
|
let lingerTimer = null;
|
|
8082
8292
|
let dragGrab = null;
|
|
8083
8293
|
let gutter;
|
|
8084
|
-
const scrollbar =
|
|
8294
|
+
const scrollbar = createMemo28(() => props.options.scrollbar);
|
|
8085
8295
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8086
8296
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8087
|
-
const track =
|
|
8297
|
+
const track = createMemo28(
|
|
8088
8298
|
() => computeScrollHintTrack({
|
|
8089
8299
|
scrollTop: props.scrollTop,
|
|
8090
8300
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8092,8 +8302,8 @@ function GridScrollHint(props) {
|
|
|
8092
8302
|
trackHeight: trackHeight()
|
|
8093
8303
|
})
|
|
8094
8304
|
);
|
|
8095
|
-
const shown =
|
|
8096
|
-
|
|
8305
|
+
const shown = createMemo28(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8306
|
+
createEffect10(scrollbar, (customScrollbar) => {
|
|
8097
8307
|
const element = props.scrollContainerRef.current;
|
|
8098
8308
|
if (!element) {
|
|
8099
8309
|
return void 0;
|
|
@@ -8142,7 +8352,7 @@ function GridScrollHint(props) {
|
|
|
8142
8352
|
}
|
|
8143
8353
|
};
|
|
8144
8354
|
}, { name: "scrollHintListeners" });
|
|
8145
|
-
|
|
8355
|
+
createEffect10(
|
|
8146
8356
|
() => scrollbar() && shown(),
|
|
8147
8357
|
(on) => {
|
|
8148
8358
|
const element = props.scrollContainerRef.current;
|
|
@@ -8161,12 +8371,12 @@ function GridScrollHint(props) {
|
|
|
8161
8371
|
);
|
|
8162
8372
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8163
8373
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8164
|
-
const dataRowCount =
|
|
8374
|
+
const dataRowCount = createMemo28(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8165
8375
|
const rowNumberOf = (viewIndex) => {
|
|
8166
8376
|
const labels = props.labelViewIndexes;
|
|
8167
8377
|
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8168
8378
|
};
|
|
8169
|
-
const rulerTicks =
|
|
8379
|
+
const rulerTicks = createMemo28(
|
|
8170
8380
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8171
8381
|
rowCount: dataRowCount(),
|
|
8172
8382
|
rulerHeight: rulerHeight(),
|
|
@@ -8176,7 +8386,7 @@ function GridScrollHint(props) {
|
|
|
8176
8386
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8177
8387
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8178
8388
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8179
|
-
const topRowIndex =
|
|
8389
|
+
const topRowIndex = createMemo28(() => {
|
|
8180
8390
|
const current = track();
|
|
8181
8391
|
if (current === null) {
|
|
8182
8392
|
return 0;
|
|
@@ -8191,8 +8401,8 @@ function GridScrollHint(props) {
|
|
|
8191
8401
|
rowIndex,
|
|
8192
8402
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8193
8403
|
});
|
|
8194
|
-
const detail =
|
|
8195
|
-
const jumpPreview =
|
|
8404
|
+
const detail = createMemo28(() => detailOf(topRowIndex()));
|
|
8405
|
+
const jumpPreview = createMemo28(() => {
|
|
8196
8406
|
const pointerY = trackPointerY();
|
|
8197
8407
|
const current = track();
|
|
8198
8408
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8355,7 +8565,7 @@ var scrollHintFeature = {
|
|
|
8355
8565
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8356
8566
|
|
|
8357
8567
|
// src/primitives/selectionAggregates.ts
|
|
8358
|
-
import { createMemo as
|
|
8568
|
+
import { createMemo as createMemo29 } from "solid-js";
|
|
8359
8569
|
import {
|
|
8360
8570
|
createSelectionAggregatesRunner,
|
|
8361
8571
|
resolveSyncSelectionAggregates,
|
|
@@ -8367,15 +8577,15 @@ import {
|
|
|
8367
8577
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8368
8578
|
function createSelectionAggregates(args) {
|
|
8369
8579
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8370
|
-
const target =
|
|
8580
|
+
const target = createMemo29(() => {
|
|
8371
8581
|
const current = args();
|
|
8372
8582
|
return stabilizeTarget(
|
|
8373
8583
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8374
8584
|
);
|
|
8375
8585
|
});
|
|
8376
|
-
const rowModel =
|
|
8377
|
-
const key =
|
|
8378
|
-
const syncResult =
|
|
8586
|
+
const rowModel = createMemo29(() => args().rowModel);
|
|
8587
|
+
const key = createMemo29(() => ({ rowModel: rowModel(), target: target() }));
|
|
8588
|
+
const syncResult = createMemo29(() => resolveSyncSelectionAggregates(key()));
|
|
8379
8589
|
const runner = createSelectionAggregatesRunner();
|
|
8380
8590
|
connectController(
|
|
8381
8591
|
runner,
|
|
@@ -8383,17 +8593,17 @@ function createSelectionAggregates(args) {
|
|
|
8383
8593
|
"render",
|
|
8384
8594
|
"selectionAggregates"
|
|
8385
8595
|
);
|
|
8386
|
-
const
|
|
8387
|
-
return
|
|
8596
|
+
const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8597
|
+
return createMemo29(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
|
|
8388
8598
|
}
|
|
8389
8599
|
|
|
8390
8600
|
// src/view/GridSelectionAggregates.tsx
|
|
8391
|
-
import { For as For14, Show as Show26, createMemo as
|
|
8601
|
+
import { For as For14, Show as Show26, createMemo as createMemo30 } from "solid-js";
|
|
8392
8602
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8393
8603
|
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8394
8604
|
function GridSelectionAggregates(props) {
|
|
8395
8605
|
const texts = useFeatureLocaleText();
|
|
8396
|
-
const chips =
|
|
8606
|
+
const chips = createMemo30(() => {
|
|
8397
8607
|
const aggregates = props.aggregates;
|
|
8398
8608
|
if (!aggregates) {
|
|
8399
8609
|
return null;
|
|
@@ -8462,7 +8672,7 @@ var selectionAggregatesFeature = {
|
|
|
8462
8672
|
};
|
|
8463
8673
|
|
|
8464
8674
|
// src/primitives/toolPanel.ts
|
|
8465
|
-
import { createMemo as
|
|
8675
|
+
import { createMemo as createMemo31 } from "solid-js";
|
|
8466
8676
|
import {
|
|
8467
8677
|
createToolPanelController,
|
|
8468
8678
|
resolveActiveToolPanelTab,
|
|
@@ -8480,8 +8690,8 @@ function createToolPanel(inputs) {
|
|
|
8480
8690
|
suppressEscape: inputs.suppressEscape(),
|
|
8481
8691
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8482
8692
|
}), "render", "toolPanel");
|
|
8483
|
-
const
|
|
8484
|
-
const availableTabs =
|
|
8693
|
+
const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8694
|
+
const availableTabs = createMemo31(
|
|
8485
8695
|
() => resolveAvailableToolPanelTabs({
|
|
8486
8696
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8487
8697
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8490,10 +8700,10 @@ function createToolPanel(inputs) {
|
|
|
8490
8700
|
{ equals: sameTabs }
|
|
8491
8701
|
);
|
|
8492
8702
|
return {
|
|
8493
|
-
activeTab:
|
|
8703
|
+
activeTab: createMemo31(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
|
|
8494
8704
|
availableTabs,
|
|
8495
|
-
layout:
|
|
8496
|
-
flashTick:
|
|
8705
|
+
layout: createMemo31(() => snapshot2().layout),
|
|
8706
|
+
flashTick: createMemo31(() => snapshot2().flashTick),
|
|
8497
8707
|
panelRef: controller.panelRef,
|
|
8498
8708
|
open: controller.open,
|
|
8499
8709
|
close: controller.close,
|
|
@@ -8517,7 +8727,7 @@ import {
|
|
|
8517
8727
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8518
8728
|
|
|
8519
8729
|
// src/view/GridTotalRow.tsx
|
|
8520
|
-
import { For as For15, Show as Show27, createMemo as
|
|
8730
|
+
import { For as For15, Show as Show27, createMemo as createMemo32 } from "solid-js";
|
|
8521
8731
|
import {
|
|
8522
8732
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8523
8733
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8562,10 +8772,10 @@ function GridTotalRow(props) {
|
|
|
8562
8772
|
</Show27>
|
|
8563
8773
|
<For15 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8564
8774
|
{(entry) => {
|
|
8565
|
-
const unbound =
|
|
8775
|
+
const unbound = createMemo32(() => entry().column);
|
|
8566
8776
|
const cell = () => props.cells.get(unbound().key);
|
|
8567
8777
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8568
|
-
const content =
|
|
8778
|
+
const content = createMemo32(() => {
|
|
8569
8779
|
const total = cell();
|
|
8570
8780
|
if (total) {
|
|
8571
8781
|
const column = unbound();
|