@ishibashi0112/spreadsheet-grid-solid 0.1.2 → 1.4.1
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 +9 -8
- 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/editors/CellEditorLayer.d.ts +2 -0
- package/dist/editors/CustomCellEditor.d.ts +2 -0
- package/dist/index.js +2677 -2577
- 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 +863 -621
- package/dist/view/DetailToggleButton.d.ts +1 -0
- 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,52 @@ 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 ROOT_CLASS_NAME = "ssg-root";
|
|
319
|
+
var NOOP = () => {
|
|
320
|
+
};
|
|
321
|
+
var isCallbackKey = (key) => typeof key === "string" && /^on[A-Z]/.test(key);
|
|
322
|
+
function createSnapshotProps(props) {
|
|
323
|
+
const read = (key) => {
|
|
324
|
+
if (key === "ref") {
|
|
325
|
+
return void 0;
|
|
326
|
+
}
|
|
327
|
+
const value = Reflect.get(props, key);
|
|
328
|
+
return isCallbackKey(key) && typeof value === "function" ? NOOP : value;
|
|
329
|
+
};
|
|
330
|
+
return new Proxy({}, {
|
|
331
|
+
get: (_target, key) => read(key),
|
|
332
|
+
has: (_target, key) => Reflect.has(props, key),
|
|
333
|
+
ownKeys: () => Reflect.ownKeys(props),
|
|
334
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
335
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(props, key);
|
|
336
|
+
return descriptor ? { configurable: true, enumerable: descriptor.enumerable ?? true, writable: false, value: read(key) } : void 0;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function revealServerFrame(root, display) {
|
|
341
|
+
if (!root?.hasAttribute(SERVER_FRAME_ATTRIBUTE)) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
const snapshot2 = root.nextElementSibling;
|
|
345
|
+
if (snapshot2?.hasAttribute(SERVER_SNAPSHOT_ATTRIBUTE)) {
|
|
346
|
+
snapshot2.remove();
|
|
347
|
+
}
|
|
348
|
+
root.removeAttribute(SERVER_FRAME_ATTRIBUTE);
|
|
349
|
+
root.removeAttribute("hidden");
|
|
350
|
+
root.classList.add(ROOT_CLASS_NAME);
|
|
351
|
+
const style = root.style;
|
|
352
|
+
if (display === void 0 || display === "") {
|
|
353
|
+
style.removeProperty("display");
|
|
354
|
+
} else {
|
|
355
|
+
style.setProperty("display", display);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
185
359
|
// src/view/GridHeaderRow.tsx
|
|
186
|
-
import { For, Show, createMemo as
|
|
360
|
+
import { For, Show, createMemo as createMemo3 } from "solid-js";
|
|
187
361
|
import { isActiveColumnFilterValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
188
362
|
import {
|
|
189
363
|
DETAIL_TOGGLE_COLUMN_KEY,
|
|
@@ -259,9 +433,9 @@ function GridHeaderRow(props) {
|
|
|
259
433
|
</Show>
|
|
260
434
|
<For each={props.entries} keyed={(entry) => entry.column.key}>
|
|
261
435
|
{(entry) => {
|
|
262
|
-
const column =
|
|
263
|
-
const colIndex =
|
|
264
|
-
const size =
|
|
436
|
+
const column = createMemo3(() => entry().column);
|
|
437
|
+
const colIndex = createMemo3(() => entry().logicalIndex);
|
|
438
|
+
const size = createMemo3(() => entry().paneLocalSize);
|
|
265
439
|
const isFiltered = () => isActiveColumnFilterValue(props.columnFilterValues[column().key]);
|
|
266
440
|
const isColumnSelected = () => props.selection.kind === "col" && colIndex() >= props.selection.startCol && colIndex() <= props.selection.endCol;
|
|
267
441
|
const sortIndex = () => props.sort.findIndex((item) => item.columnKey === column().key);
|
|
@@ -424,7 +598,7 @@ function GridHeaderRow(props) {
|
|
|
424
598
|
}
|
|
425
599
|
|
|
426
600
|
// src/view/GridBodyLayer.tsx
|
|
427
|
-
import { For as For2, Show as Show2, createMemo as
|
|
601
|
+
import { For as For2, Show as Show2, createMemo as createMemo5, untrack as untrack3 } from "solid-js";
|
|
428
602
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
429
603
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
430
604
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -435,13 +609,13 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
435
609
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
436
610
|
|
|
437
611
|
// src/primitives/memoWhen.ts
|
|
438
|
-
import { createMemo as
|
|
612
|
+
import { createMemo as createMemo4, getOwner as getOwner2, isDisposed, runWithOwner as runWithOwner2, untrack as untrack2 } from "solid-js";
|
|
439
613
|
function createMemoWhen(needed, compute, empty) {
|
|
440
614
|
const guarded = () => needed() ? compute() : empty;
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
615
|
+
if (untrack2(needed)) {
|
|
616
|
+
return createMemo4(guarded);
|
|
443
617
|
}
|
|
444
|
-
const owner =
|
|
618
|
+
const owner = getOwner2();
|
|
445
619
|
let memo;
|
|
446
620
|
return () => {
|
|
447
621
|
if (memo) {
|
|
@@ -453,7 +627,7 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
453
627
|
if (!owner || isDisposed(owner)) {
|
|
454
628
|
return compute();
|
|
455
629
|
}
|
|
456
|
-
memo =
|
|
630
|
+
memo = runWithOwner2(owner, () => createMemo4(guarded));
|
|
457
631
|
return memo();
|
|
458
632
|
};
|
|
459
633
|
}
|
|
@@ -467,13 +641,25 @@ var markClickTarget = (element) => {
|
|
|
467
641
|
|
|
468
642
|
// src/view/GridBodyLayer.tsx
|
|
469
643
|
var NO_SELECTED_COLUMNS = [-1, -1];
|
|
644
|
+
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
645
|
+
var joinClasses = (...parts) => {
|
|
646
|
+
let out = "";
|
|
647
|
+
for (const part of parts) {
|
|
648
|
+
if (part) {
|
|
649
|
+
out = out ? `${out} ${part}` : part;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return out;
|
|
653
|
+
};
|
|
654
|
+
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
655
|
+
var cellKey = (entry) => isPlainCellColumn(entry.column) ? entry.column.key : `${entry.column.key}\0decorated`;
|
|
470
656
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
471
657
|
function GridBodyLayer(props) {
|
|
472
658
|
const texts = useGridLocaleText();
|
|
473
659
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
474
660
|
{(item) => {
|
|
475
|
-
const rowIndex =
|
|
476
|
-
const SkeletonRow =
|
|
661
|
+
const rowIndex = createMemo5(() => item().index);
|
|
662
|
+
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
477
663
|
if (SkeletonRow) {
|
|
478
664
|
return <SkeletonRow
|
|
479
665
|
pane={props.pane}
|
|
@@ -496,14 +682,14 @@ function GridBodyLayer(props) {
|
|
|
496
682
|
/>;
|
|
497
683
|
}
|
|
498
684
|
const row = () => props.rowModel.getRow(rowIndex());
|
|
499
|
-
const groupRow =
|
|
500
|
-
const labelRow =
|
|
685
|
+
const groupRow = createMemo5(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
686
|
+
const labelRow = createMemo5(
|
|
501
687
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
502
688
|
);
|
|
503
689
|
return <>
|
|
504
690
|
<Show2 when={groupRow()}>
|
|
505
691
|
{(group) => {
|
|
506
|
-
const GroupRow =
|
|
692
|
+
const GroupRow = untrack3(() => props.grouping)?.BodyGroupRow;
|
|
507
693
|
return GroupRow ? <GroupRow
|
|
508
694
|
pane={props.pane}
|
|
509
695
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -530,9 +716,9 @@ function GridBodyLayer(props) {
|
|
|
530
716
|
<Show2 when={labelRow()}>
|
|
531
717
|
{(label) => {
|
|
532
718
|
const layer = () => props.labelRowLayer;
|
|
533
|
-
const LabelRow =
|
|
534
|
-
const labelSlot =
|
|
535
|
-
const labelRowKey =
|
|
719
|
+
const LabelRow = untrack3(layer)?.Row;
|
|
720
|
+
const labelSlot = createMemo5(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
721
|
+
const labelRowKey = createMemo5(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
536
722
|
return LabelRow ? <LabelRow
|
|
537
723
|
pane={props.pane}
|
|
538
724
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -556,14 +742,14 @@ function GridBodyLayer(props) {
|
|
|
556
742
|
{(currentRow) => {
|
|
557
743
|
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
558
744
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
559
|
-
const rowSize =
|
|
560
|
-
const isRowChecked =
|
|
745
|
+
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
746
|
+
const isRowChecked = createMemo5(
|
|
561
747
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
562
748
|
);
|
|
563
|
-
const isRowSelected =
|
|
749
|
+
const isRowSelected = createMemo5(
|
|
564
750
|
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
565
751
|
);
|
|
566
|
-
const selectedColRange =
|
|
752
|
+
const selectedColRange = createMemo5(() => {
|
|
567
753
|
const selection = props.selection;
|
|
568
754
|
if (selection.kind === "col") {
|
|
569
755
|
return [selection.startCol, selection.endCol];
|
|
@@ -575,9 +761,9 @@ function GridBodyLayer(props) {
|
|
|
575
761
|
});
|
|
576
762
|
const selectedColStart = () => selectedColRange()[0];
|
|
577
763
|
const selectedColEnd = () => selectedColRange()[1];
|
|
578
|
-
const activeCol =
|
|
579
|
-
const rowFindHits =
|
|
580
|
-
const rowFindCurrent =
|
|
764
|
+
const activeCol = createMemo5(() => props.activeCell?.row === rowIndex() ? props.activeCell.col : -1);
|
|
765
|
+
const rowFindHits = createMemo5(() => props.findIndex.get(rowIndex()));
|
|
766
|
+
const rowFindCurrent = createMemo5(() => {
|
|
581
767
|
const hits = rowFindHits();
|
|
582
768
|
const current = hits ? props.findCurrentIndex : null;
|
|
583
769
|
if (!hits || current === null) {
|
|
@@ -590,10 +776,10 @@ function GridBodyLayer(props) {
|
|
|
590
776
|
}
|
|
591
777
|
return null;
|
|
592
778
|
});
|
|
593
|
-
const editingCol =
|
|
594
|
-
const rowAutoHeight =
|
|
595
|
-
const isHovered =
|
|
596
|
-
const rowSlot =
|
|
779
|
+
const editingCol = createMemo5(() => props.editingCell?.row === rowIndex() ? props.editingCell.col : -1);
|
|
780
|
+
const rowAutoHeight = createMemo5(() => !!props.autoHeight);
|
|
781
|
+
const isHovered = createMemo5(() => props.hoveredRowIndex === rowIndex());
|
|
782
|
+
const rowSlot = createMemo5(
|
|
597
783
|
() => resolveSlotProps(
|
|
598
784
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
599
785
|
row: currentRow(),
|
|
@@ -612,12 +798,12 @@ function GridBodyLayer(props) {
|
|
|
612
798
|
aria-rowindex={rowIndex() + 2 + props.ariaRowOffset}
|
|
613
799
|
aria-selected={props.enableRowSelection ? isRowChecked() ? "true" : "false" : void 0}
|
|
614
800
|
data-row-key={String(rowKey())}
|
|
615
|
-
class={
|
|
801
|
+
class={joinClasses(
|
|
616
802
|
"ssg-body-row",
|
|
617
803
|
rowSlot().className,
|
|
618
804
|
props.slots.bodyRow?.className,
|
|
619
|
-
|
|
620
|
-
|
|
805
|
+
isRowChecked() && "ssg-body-row--checked"
|
|
806
|
+
)}
|
|
621
807
|
style={{
|
|
622
808
|
...props.slots.bodyRow?.style,
|
|
623
809
|
...rowSlot().style,
|
|
@@ -632,17 +818,14 @@ function GridBodyLayer(props) {
|
|
|
632
818
|
onPointerDown={(event) => props.onRowHeaderPointerDown(rowIndex(), event)}
|
|
633
819
|
onPointerEnter={(event) => props.onRowHeaderPointerEnter(rowIndex(), event)}
|
|
634
820
|
onPointerLeave={() => props.onRowHeaderPointerLeave(rowIndex())}
|
|
635
|
-
class={
|
|
636
|
-
"ssg-header-cell",
|
|
637
|
-
"ssg-row-header-cell",
|
|
821
|
+
class={joinClasses(
|
|
822
|
+
"ssg-header-cell ssg-row-header-cell",
|
|
638
823
|
rowSlot().className,
|
|
639
824
|
props.slots.rowHeaderCell?.className,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
]}
|
|
825
|
+
props.enableRowSelection && "ssg-row-header-cell--checkbox",
|
|
826
|
+
(props.isWholeGridSelected || isRowSelected()) && "ssg-header-cell--selected",
|
|
827
|
+
isHovered() && "ssg-header-cell--hovered"
|
|
828
|
+
)}
|
|
646
829
|
style={{
|
|
647
830
|
...props.slots.rowHeaderCell?.style,
|
|
648
831
|
...rowSlot().style,
|
|
@@ -660,24 +843,23 @@ function GridBodyLayer(props) {
|
|
|
660
843
|
</Show2>
|
|
661
844
|
</div>
|
|
662
845
|
</Show2>
|
|
663
|
-
<For2 each={props.entries} keyed={
|
|
846
|
+
<For2 each={props.entries} keyed={cellKey}>
|
|
664
847
|
{(entry) => {
|
|
665
|
-
const
|
|
848
|
+
const plain = untrack3(() => isPlainCellColumn(entry().column));
|
|
849
|
+
const unbound = createMemo5(() => entry().column);
|
|
666
850
|
const column = () => unbound();
|
|
667
|
-
const colIndex =
|
|
851
|
+
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
668
852
|
const size = () => entry().paneLocalSize;
|
|
669
853
|
const isActive = () => activeCol() === colIndex();
|
|
670
854
|
const isEditing = () => editingCol() === colIndex();
|
|
671
855
|
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
|
-
)
|
|
856
|
+
const readOnlyCell = () => !isCellEditable(
|
|
857
|
+
{ readOnly: props.readOnly, canEditCell: props.canEditCell },
|
|
858
|
+
rowIndex(),
|
|
859
|
+
colIndex(),
|
|
860
|
+
currentRow(),
|
|
861
|
+
unbound(),
|
|
862
|
+
props.canEditCell ? { sourceRowIndex: sourceRowIndex(), rowKey: rowKey() } : void 0
|
|
681
863
|
);
|
|
682
864
|
const value = () => getCellValue(currentRow(), unbound());
|
|
683
865
|
const findRanges = createMemoWhen(
|
|
@@ -685,7 +867,7 @@ function GridBodyLayer(props) {
|
|
|
685
867
|
() => rowFindHits()?.get(colIndex()),
|
|
686
868
|
void 0
|
|
687
869
|
);
|
|
688
|
-
const cellRowKey =
|
|
870
|
+
const cellRowKey = untrack3(rowKey);
|
|
689
871
|
const cellState = {
|
|
690
872
|
get rowIndex() {
|
|
691
873
|
return rowIndex();
|
|
@@ -717,7 +899,7 @@ function GridBodyLayer(props) {
|
|
|
717
899
|
}
|
|
718
900
|
};
|
|
719
901
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
720
|
-
const styleContext = createMemoWhen(
|
|
902
|
+
const styleContext = plain ? () => null : createMemoWhen(
|
|
721
903
|
needsStyleContext,
|
|
722
904
|
() => ({
|
|
723
905
|
row: currentRow(),
|
|
@@ -734,7 +916,7 @@ function GridBodyLayer(props) {
|
|
|
734
916
|
}),
|
|
735
917
|
null
|
|
736
918
|
);
|
|
737
|
-
const conditionalCell = createMemoWhen(
|
|
919
|
+
const conditionalCell = plain ? () => EMPTY_SLOT : createMemoWhen(
|
|
738
920
|
() => column().cellClassName !== void 0,
|
|
739
921
|
() => {
|
|
740
922
|
const cellClassName = column().cellClassName;
|
|
@@ -746,7 +928,7 @@ function GridBodyLayer(props) {
|
|
|
746
928
|
resolveSlotProps(void 0)
|
|
747
929
|
);
|
|
748
930
|
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
749
|
-
const dataBar = createMemoWhen(
|
|
931
|
+
const dataBar = plain ? () => null : createMemoWhen(
|
|
750
932
|
() => formatRules()?.dataBar !== void 0,
|
|
751
933
|
() => {
|
|
752
934
|
const feature = props.conditionalFormat;
|
|
@@ -755,7 +937,7 @@ function GridBodyLayer(props) {
|
|
|
755
937
|
},
|
|
756
938
|
null
|
|
757
939
|
);
|
|
758
|
-
const scaleBackground = createMemoWhen(
|
|
940
|
+
const scaleBackground = plain ? () => null : createMemoWhen(
|
|
759
941
|
() => formatRules()?.colorScale !== void 0,
|
|
760
942
|
() => {
|
|
761
943
|
const feature = props.conditionalFormat;
|
|
@@ -773,12 +955,12 @@ function GridBodyLayer(props) {
|
|
|
773
955
|
const rules = formatRules()?.dataBar;
|
|
774
956
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
775
957
|
};
|
|
776
|
-
const invalidMessage = createMemoWhen(
|
|
958
|
+
const invalidMessage = plain ? () => null : createMemoWhen(
|
|
777
959
|
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
778
960
|
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
779
961
|
null
|
|
780
962
|
);
|
|
781
|
-
const cellNote = createMemoWhen(
|
|
963
|
+
const cellNote = plain ? () => null : createMemoWhen(
|
|
782
964
|
() => !!column().cellNote,
|
|
783
965
|
() => {
|
|
784
966
|
const note = column().cellNote;
|
|
@@ -805,6 +987,27 @@ function GridBodyLayer(props) {
|
|
|
805
987
|
hasRenderCell: column().renderCell !== void 0
|
|
806
988
|
});
|
|
807
989
|
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
990
|
+
const cellChildren = plain ? () => props.renderCellContent(currentRow, column(), cellState) : () => <>
|
|
991
|
+
<Show2 when={dataBar()}>
|
|
992
|
+
{(bar) => <span
|
|
993
|
+
class={["ssg-cf-bar", { "ssg-cf-bar--negative": bar().negative }]}
|
|
994
|
+
style={{
|
|
995
|
+
left: `${bar().start}%`,
|
|
996
|
+
width: `${bar().end - bar().start}%`,
|
|
997
|
+
...dataBarColor() ? { "background-color": dataBarColor() } : null
|
|
998
|
+
}}
|
|
999
|
+
aria-hidden="true"
|
|
1000
|
+
/>}
|
|
1001
|
+
</Show2>
|
|
1002
|
+
<Show2
|
|
1003
|
+
when={isAutoHeightCell()}
|
|
1004
|
+
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
1005
|
+
>
|
|
1006
|
+
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
1007
|
+
{props.renderCellContent(currentRow, column(), cellState)}
|
|
1008
|
+
</div>
|
|
1009
|
+
</Show2>
|
|
1010
|
+
</>;
|
|
808
1011
|
return <div
|
|
809
1012
|
role="gridcell"
|
|
810
1013
|
aria-colindex={colIndex() + 2}
|
|
@@ -818,25 +1021,23 @@ function GridBodyLayer(props) {
|
|
|
818
1021
|
data-autoheight-cell={isAutoHeightCell() ? "" : void 0}
|
|
819
1022
|
data-ssg-tooltip={tooltipText() ?? void 0}
|
|
820
1023
|
data-ssg-tooltip-overflow={markOverflowTooltip() ? "" : void 0}
|
|
821
|
-
class={
|
|
1024
|
+
class={joinClasses(
|
|
822
1025
|
"ssg-body-cell",
|
|
823
1026
|
rowSlot().className,
|
|
824
1027
|
conditionalCell().className,
|
|
825
1028
|
props.slots.bodyCell?.className,
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
]}
|
|
1029
|
+
column().align === "center" && "ssg-body-cell--align-center",
|
|
1030
|
+
column().align === "right" && "ssg-body-cell--align-right",
|
|
1031
|
+
dataBar() !== null && "ssg-body-cell--cf-bar",
|
|
1032
|
+
scaleBackground() !== null && "ssg-body-cell--cf-scale",
|
|
1033
|
+
formatRules()?.chips !== void 0 && size() < CHIP_COMPACT_MAX_WIDTH && "ssg-body-cell--chip-compact",
|
|
1034
|
+
isAutoHeightCell() && "ssg-body-cell--autoheight",
|
|
1035
|
+
alignTop() && "ssg-body-cell--valign-top",
|
|
1036
|
+
readOnlyCell() && !isSelected() && "ssg-body-cell--readonly",
|
|
1037
|
+
invalidMessage() !== null && "ssg-body-cell--invalid",
|
|
1038
|
+
cellNote() !== null && "ssg-body-cell--has-note",
|
|
1039
|
+
isHovered() && "ssg-body-cell--row-hovered"
|
|
1040
|
+
)}
|
|
840
1041
|
onPointerDown={(event) => {
|
|
841
1042
|
if (event.target instanceof Element && event.target.closest(".ssg-detail-toggle")) {
|
|
842
1043
|
return;
|
|
@@ -861,25 +1062,7 @@ function GridBodyLayer(props) {
|
|
|
861
1062
|
"z-index": isActive() ? 3 : 1
|
|
862
1063
|
}}
|
|
863
1064
|
>
|
|
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>
|
|
1065
|
+
{cellChildren()}
|
|
883
1066
|
</div>;
|
|
884
1067
|
}}
|
|
885
1068
|
</For2>
|
|
@@ -910,7 +1093,7 @@ function Overlay(props) {
|
|
|
910
1093
|
}
|
|
911
1094
|
|
|
912
1095
|
// src/view/GridDetailLayer.tsx
|
|
913
|
-
import { For as For3, Show as Show4, createMemo as
|
|
1096
|
+
import { For as For3, Show as Show4, createMemo as createMemo6, onCleanup as onCleanup2, untrack as untrack4 } from "solid-js";
|
|
914
1097
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
915
1098
|
var stopPropagation = (event) => {
|
|
916
1099
|
event.stopPropagation();
|
|
@@ -922,7 +1105,7 @@ var mergeSlotStyles = (...styles) => {
|
|
|
922
1105
|
function GridDetailLayer(props) {
|
|
923
1106
|
return <For3 each={props.entries} keyed={(entry) => entry.rowKey}>
|
|
924
1107
|
{(entry) => {
|
|
925
|
-
const index =
|
|
1108
|
+
const index = createMemo6(() => entry().virtualRow.index);
|
|
926
1109
|
const detailSize = () => entry().virtualRow.detailSize ?? 0;
|
|
927
1110
|
return <Show4 when={detailSize() > 0}>
|
|
928
1111
|
<div
|
|
@@ -949,9 +1132,9 @@ function GridDetailLayer(props) {
|
|
|
949
1132
|
}
|
|
950
1133
|
function DetailCard(props) {
|
|
951
1134
|
const layer = props.layer;
|
|
952
|
-
const rowKey =
|
|
953
|
-
const row =
|
|
954
|
-
const sourceRowIndex =
|
|
1135
|
+
const rowKey = untrack4(() => props.entry().rowKey);
|
|
1136
|
+
const row = createMemo6(() => layer.rowModel.getRow(props.index()));
|
|
1137
|
+
const sourceRowIndex = createMemo6(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
955
1138
|
const ctx = {
|
|
956
1139
|
get row() {
|
|
957
1140
|
return row();
|
|
@@ -963,10 +1146,10 @@ function DetailCard(props) {
|
|
|
963
1146
|
get sourceRowIndex() {
|
|
964
1147
|
return sourceRowIndex();
|
|
965
1148
|
},
|
|
966
|
-
collapse: () => layer.onCollapse?.(rowKey,
|
|
1149
|
+
collapse: () => layer.onCollapse?.(rowKey, untrack4(props.index))
|
|
967
1150
|
};
|
|
968
1151
|
let card;
|
|
969
|
-
|
|
1152
|
+
onCleanup2(() => notifyDetailCardFocusLost(card ?? null, layer.onCardFocusLost));
|
|
970
1153
|
return <div
|
|
971
1154
|
role="gridcell"
|
|
972
1155
|
class="ssg-detail-card-holder"
|
|
@@ -980,7 +1163,7 @@ function DetailCard(props) {
|
|
|
980
1163
|
style={mergeSlotStyles(layer.slots.detailCard?.style, layer.cardSlot?.style)}
|
|
981
1164
|
data-ssg-detail=""
|
|
982
1165
|
onKeyDown={(event) => {
|
|
983
|
-
layer.onCardKeyDown?.(event, event.currentTarget,
|
|
1166
|
+
layer.onCardKeyDown?.(event, event.currentTarget, untrack4(props.index));
|
|
984
1167
|
event.stopPropagation();
|
|
985
1168
|
}}
|
|
986
1169
|
onKeyUp={stopPropagation}
|
|
@@ -1015,6 +1198,7 @@ function DetailToggleButton(props) {
|
|
|
1015
1198
|
}
|
|
1016
1199
|
event.preventDefault();
|
|
1017
1200
|
event.currentTarget.closest(".ssg-shell")?.focus({ preventScroll: true });
|
|
1201
|
+
props.onPress?.();
|
|
1018
1202
|
}}
|
|
1019
1203
|
onDblClick={(event) => event.stopPropagation()}
|
|
1020
1204
|
>
|
|
@@ -1042,13 +1226,13 @@ function CheckboxCell(props) {
|
|
|
1042
1226
|
}
|
|
1043
1227
|
|
|
1044
1228
|
// src/editors/CellEditorLayer.tsx
|
|
1045
|
-
import { Show as Show8, createMemo as
|
|
1229
|
+
import { Show as Show8, createMemo as createMemo7, untrack as untrack11 } from "solid-js";
|
|
1046
1230
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1047
1231
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1048
1232
|
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1049
1233
|
|
|
1050
1234
|
// src/editors/TextCellEditor.tsx
|
|
1051
|
-
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as
|
|
1235
|
+
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1052
1236
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1053
1237
|
import {
|
|
1054
1238
|
fitMultilineEditor,
|
|
@@ -1058,7 +1242,7 @@ import {
|
|
|
1058
1242
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1059
1243
|
|
|
1060
1244
|
// src/primitives/topAlignedInput.ts
|
|
1061
|
-
import { createRenderEffect, onSettled, untrack as
|
|
1245
|
+
import { createRenderEffect, onSettled, untrack as untrack5 } from "solid-js";
|
|
1062
1246
|
import {
|
|
1063
1247
|
alignInputTextToTop,
|
|
1064
1248
|
resolveHiddenTopOf
|
|
@@ -1071,11 +1255,11 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1071
1255
|
};
|
|
1072
1256
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1073
1257
|
createRenderEffect(read, apply, { name: "topAlignedInput" });
|
|
1074
|
-
onSettled(() => apply(
|
|
1258
|
+
onSettled(() => apply(untrack5(read)));
|
|
1075
1259
|
}
|
|
1076
1260
|
|
|
1077
1261
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1078
|
-
import { Show as Show5, createSignal as
|
|
1262
|
+
import { Show as Show5, createSignal as createSignal3, onSettled as onSettled2 } from "solid-js";
|
|
1079
1263
|
import {
|
|
1080
1264
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1081
1265
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1088,7 +1272,7 @@ function CellEditorError(props) {
|
|
|
1088
1272
|
}
|
|
1089
1273
|
function CellEditorErrorBubble(props) {
|
|
1090
1274
|
let element;
|
|
1091
|
-
const [placement2, setPlacement] =
|
|
1275
|
+
const [placement2, setPlacement] = createSignal3(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1092
1276
|
onSettled2(() => {
|
|
1093
1277
|
if (element) {
|
|
1094
1278
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1112,11 +1296,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1112
1296
|
|
|
1113
1297
|
// src/editors/TextCellEditor.tsx
|
|
1114
1298
|
function TextCellEditor(props) {
|
|
1115
|
-
const [input, setInput] =
|
|
1116
|
-
const [textarea, setTextarea] =
|
|
1117
|
-
const [error, setError] =
|
|
1118
|
-
const initialValue =
|
|
1119
|
-
const [draft, setDraft] =
|
|
1299
|
+
const [input, setInput] = createSignal4();
|
|
1300
|
+
const [textarea, setTextarea] = createSignal4();
|
|
1301
|
+
const [error, setError] = createSignal4(null);
|
|
1302
|
+
const initialValue = untrack6(() => props.initialValue);
|
|
1303
|
+
const [draft, setDraft] = createSignal4(initialValue);
|
|
1120
1304
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1121
1305
|
const alignTop = () => props.alignTop ?? false;
|
|
1122
1306
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1139,7 +1323,7 @@ function TextCellEditor(props) {
|
|
|
1139
1323
|
};
|
|
1140
1324
|
createRenderEffect2(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1141
1325
|
onSettled3(() => {
|
|
1142
|
-
const element =
|
|
1326
|
+
const element = untrack6(() => input() ?? textarea());
|
|
1143
1327
|
if (!element) {
|
|
1144
1328
|
return;
|
|
1145
1329
|
}
|
|
@@ -1148,11 +1332,11 @@ function TextCellEditor(props) {
|
|
|
1148
1332
|
element.setSelectionRange(end, end);
|
|
1149
1333
|
});
|
|
1150
1334
|
let disposed = false;
|
|
1151
|
-
|
|
1335
|
+
onCleanup3(() => {
|
|
1152
1336
|
disposed = true;
|
|
1153
1337
|
});
|
|
1154
1338
|
props.onRegisterFlush?.(() => {
|
|
1155
|
-
|
|
1339
|
+
untrack6(() => {
|
|
1156
1340
|
const element = input() ?? textarea();
|
|
1157
1341
|
if (element) {
|
|
1158
1342
|
props.onCommit(element.value);
|
|
@@ -1182,7 +1366,7 @@ function TextCellEditor(props) {
|
|
|
1182
1366
|
handleInput(next.value);
|
|
1183
1367
|
};
|
|
1184
1368
|
const renderInput = () => {
|
|
1185
|
-
const startValue =
|
|
1369
|
+
const startValue = untrack6(draft);
|
|
1186
1370
|
return <>
|
|
1187
1371
|
<input
|
|
1188
1372
|
ref={setInput}
|
|
@@ -1206,7 +1390,7 @@ function TextCellEditor(props) {
|
|
|
1206
1390
|
</>;
|
|
1207
1391
|
};
|
|
1208
1392
|
const renderTextarea = () => {
|
|
1209
|
-
const startValue =
|
|
1393
|
+
const startValue = untrack6(draft);
|
|
1210
1394
|
return <div class="ssg-cell-editor-multiline">
|
|
1211
1395
|
<textarea
|
|
1212
1396
|
ref={setTextarea}
|
|
@@ -1245,25 +1429,25 @@ function TextCellEditor(props) {
|
|
|
1245
1429
|
}
|
|
1246
1430
|
|
|
1247
1431
|
// src/editors/NumberCellEditor.tsx
|
|
1248
|
-
import { createSignal as
|
|
1432
|
+
import { createSignal as createSignal5, onCleanup as onCleanup4, onSettled as onSettled4, untrack as untrack7 } from "solid-js";
|
|
1249
1433
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1250
1434
|
import {
|
|
1251
1435
|
resolveNumberEditorCommitValue,
|
|
1252
1436
|
resolveNumberEditorStart
|
|
1253
1437
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1254
1438
|
function NumberCellEditor(props) {
|
|
1255
|
-
const [input, setInput] =
|
|
1256
|
-
const [error, setError] =
|
|
1439
|
+
const [input, setInput] = createSignal5();
|
|
1440
|
+
const [error, setError] = createSignal5(null);
|
|
1257
1441
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1258
|
-
const start = resolveNumberEditorStart(
|
|
1442
|
+
const start = resolveNumberEditorStart(untrack7(() => props.initialValue));
|
|
1259
1443
|
const textMode = start.textMode;
|
|
1260
1444
|
const startText = start.text;
|
|
1261
1445
|
let disposed = false;
|
|
1262
|
-
|
|
1446
|
+
onCleanup4(() => {
|
|
1263
1447
|
disposed = true;
|
|
1264
1448
|
});
|
|
1265
1449
|
props.onRegisterFlush?.(() => {
|
|
1266
|
-
|
|
1450
|
+
untrack7(() => {
|
|
1267
1451
|
const element = input();
|
|
1268
1452
|
if (element) {
|
|
1269
1453
|
props.onCommit(resolveNumberEditorCommitValue(element.value, textMode));
|
|
@@ -1271,7 +1455,7 @@ function NumberCellEditor(props) {
|
|
|
1271
1455
|
});
|
|
1272
1456
|
});
|
|
1273
1457
|
onSettled4(() => {
|
|
1274
|
-
const element =
|
|
1458
|
+
const element = untrack7(input);
|
|
1275
1459
|
if (!element) {
|
|
1276
1460
|
return;
|
|
1277
1461
|
}
|
|
@@ -1320,13 +1504,13 @@ function NumberCellEditor(props) {
|
|
|
1320
1504
|
import {
|
|
1321
1505
|
For as For4,
|
|
1322
1506
|
Show as Show7,
|
|
1323
|
-
createEffect,
|
|
1507
|
+
createEffect as createEffect2,
|
|
1324
1508
|
createRenderEffect as createRenderEffect3,
|
|
1325
|
-
createSignal as
|
|
1509
|
+
createSignal as createSignal6,
|
|
1326
1510
|
createUniqueId,
|
|
1327
|
-
onCleanup as
|
|
1511
|
+
onCleanup as onCleanup5,
|
|
1328
1512
|
onSettled as onSettled5,
|
|
1329
|
-
untrack as
|
|
1513
|
+
untrack as untrack8
|
|
1330
1514
|
} from "solid-js";
|
|
1331
1515
|
import { Portal } from "@solidjs/web";
|
|
1332
1516
|
import {
|
|
@@ -1342,36 +1526,36 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1342
1526
|
function SelectCellEditor(props) {
|
|
1343
1527
|
const texts = useGridLocaleText();
|
|
1344
1528
|
const portal = useGridPortal();
|
|
1345
|
-
const [input, setInput] =
|
|
1346
|
-
const [list, setList] =
|
|
1529
|
+
const [input, setInput] = createSignal6();
|
|
1530
|
+
const [list, setList] = createSignal6();
|
|
1347
1531
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1348
1532
|
const listId = createUniqueId();
|
|
1349
|
-
const start =
|
|
1533
|
+
const start = untrack8(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1350
1534
|
let typeahead = start.typeahead;
|
|
1351
|
-
const [highlight, setHighlight] =
|
|
1535
|
+
const [highlight, setHighlight] = createSignal6(start.highlight);
|
|
1352
1536
|
let currentHighlight = start.highlight;
|
|
1353
1537
|
const updateHighlight = (next) => {
|
|
1354
1538
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1355
1539
|
setHighlight(currentHighlight);
|
|
1356
1540
|
};
|
|
1357
|
-
const [placement2, setPlacement] =
|
|
1541
|
+
const [placement2, setPlacement] = createSignal6(null);
|
|
1358
1542
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1359
|
-
const [error, setError] =
|
|
1360
|
-
const [composing, setComposing] =
|
|
1543
|
+
const [error, setError] = createSignal6(null);
|
|
1544
|
+
const [composing, setComposing] = createSignal6(null);
|
|
1361
1545
|
let composingNow = null;
|
|
1362
1546
|
const updateComposing = (next) => {
|
|
1363
1547
|
composingNow = next;
|
|
1364
1548
|
setComposing(next);
|
|
1365
1549
|
};
|
|
1366
1550
|
const measure = () => {
|
|
1367
|
-
const element =
|
|
1551
|
+
const element = untrack8(input);
|
|
1368
1552
|
if (!element) {
|
|
1369
1553
|
return;
|
|
1370
1554
|
}
|
|
1371
1555
|
setPlacement(
|
|
1372
1556
|
computeSelectPopoverPlacement(
|
|
1373
1557
|
element.getBoundingClientRect(),
|
|
1374
|
-
|
|
1558
|
+
untrack8(() => props.options.length),
|
|
1375
1559
|
window.innerWidth,
|
|
1376
1560
|
window.innerHeight,
|
|
1377
1561
|
optionRowHeight
|
|
@@ -1379,7 +1563,7 @@ function SelectCellEditor(props) {
|
|
|
1379
1563
|
);
|
|
1380
1564
|
};
|
|
1381
1565
|
onSettled5(() => {
|
|
1382
|
-
|
|
1566
|
+
untrack8(input)?.focus();
|
|
1383
1567
|
measure();
|
|
1384
1568
|
window.addEventListener("resize", measure);
|
|
1385
1569
|
window.addEventListener("scroll", measure, true);
|
|
@@ -1388,17 +1572,17 @@ function SelectCellEditor(props) {
|
|
|
1388
1572
|
window.removeEventListener("scroll", measure, true);
|
|
1389
1573
|
};
|
|
1390
1574
|
});
|
|
1391
|
-
|
|
1575
|
+
createEffect2(
|
|
1392
1576
|
() => props.options.length,
|
|
1393
1577
|
(_length, previous) => {
|
|
1394
1578
|
if (previous !== void 0) {
|
|
1395
|
-
|
|
1579
|
+
untrack8(input)?.focus();
|
|
1396
1580
|
measure();
|
|
1397
1581
|
}
|
|
1398
1582
|
},
|
|
1399
1583
|
{ name: "selectEditorOptionsRefocus" }
|
|
1400
1584
|
);
|
|
1401
|
-
|
|
1585
|
+
createEffect2(
|
|
1402
1586
|
() => `${props.cellTop ?? 0}:${props.cellLeft ?? 0}`,
|
|
1403
1587
|
(position, previous) => {
|
|
1404
1588
|
if (previous !== void 0 && previous !== position) {
|
|
@@ -1408,7 +1592,7 @@ function SelectCellEditor(props) {
|
|
|
1408
1592
|
{ name: "selectEditorFollowCell" }
|
|
1409
1593
|
);
|
|
1410
1594
|
const mount = () => placement2() !== null ? portal.container() : null;
|
|
1411
|
-
|
|
1595
|
+
createEffect2(
|
|
1412
1596
|
() => [highlight(), list()],
|
|
1413
1597
|
([index, element]) => {
|
|
1414
1598
|
const option = element?.children[index];
|
|
@@ -1458,9 +1642,9 @@ function SelectCellEditor(props) {
|
|
|
1458
1642
|
};
|
|
1459
1643
|
const highlightedOption = () => props.options[highlight()];
|
|
1460
1644
|
const shownText = () => highlightedOption()?.label ?? String(props.value ?? "");
|
|
1461
|
-
const initialShownText =
|
|
1645
|
+
const initialShownText = untrack8(shownText);
|
|
1462
1646
|
let disposed = false;
|
|
1463
|
-
|
|
1647
|
+
onCleanup5(() => {
|
|
1464
1648
|
disposed = true;
|
|
1465
1649
|
});
|
|
1466
1650
|
const view = <>
|
|
@@ -1473,7 +1657,7 @@ function SelectCellEditor(props) {
|
|
|
1473
1657
|
if (event.isComposing) {
|
|
1474
1658
|
updateComposing(event.currentTarget.value);
|
|
1475
1659
|
} else {
|
|
1476
|
-
event.currentTarget.value = composingNow ??
|
|
1660
|
+
event.currentTarget.value = composingNow ?? untrack8(shownText);
|
|
1477
1661
|
}
|
|
1478
1662
|
}}
|
|
1479
1663
|
onCompositionStart={(event) => updateComposing(event.currentTarget.value)}
|
|
@@ -1576,25 +1760,25 @@ function SelectCellEditor(props) {
|
|
|
1576
1760
|
}
|
|
1577
1761
|
|
|
1578
1762
|
// src/editors/DateCellEditor.tsx
|
|
1579
|
-
import { createSignal as
|
|
1763
|
+
import { createSignal as createSignal7, onCleanup as onCleanup6, onSettled as onSettled6, untrack as untrack9 } from "solid-js";
|
|
1580
1764
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1581
1765
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1582
1766
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1583
1767
|
function DateCellEditor(props) {
|
|
1584
1768
|
const texts = useGridLocaleText();
|
|
1585
|
-
const [input, setInput] =
|
|
1586
|
-
const [error, setError] =
|
|
1587
|
-
const [shift, setShift] =
|
|
1769
|
+
const [input, setInput] = createSignal7();
|
|
1770
|
+
const [error, setError] = createSignal7(null);
|
|
1771
|
+
const [shift, setShift] = createSignal7(0);
|
|
1588
1772
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1589
|
-
const initialText =
|
|
1773
|
+
const initialText = untrack9(() => props.initialText);
|
|
1590
1774
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
1591
|
-
const startValue = textMode ? initialText ?? "" :
|
|
1775
|
+
const startValue = textMode ? initialText ?? "" : untrack9(() => props.initialValue);
|
|
1592
1776
|
let disposed = false;
|
|
1593
|
-
|
|
1777
|
+
onCleanup6(() => {
|
|
1594
1778
|
disposed = true;
|
|
1595
1779
|
});
|
|
1596
1780
|
onSettled6(() => {
|
|
1597
|
-
const element =
|
|
1781
|
+
const element = untrack9(input);
|
|
1598
1782
|
if (!element) {
|
|
1599
1783
|
return;
|
|
1600
1784
|
}
|
|
@@ -1613,7 +1797,7 @@ function DateCellEditor(props) {
|
|
|
1613
1797
|
return normalized === null ? { status: "rejected", message: texts().enterDate } : props.onCommit(normalized, direction);
|
|
1614
1798
|
};
|
|
1615
1799
|
props.onRegisterFlush?.(() => {
|
|
1616
|
-
|
|
1800
|
+
untrack9(() => {
|
|
1617
1801
|
const element = input();
|
|
1618
1802
|
if (element) {
|
|
1619
1803
|
commitDraft(element.value);
|
|
@@ -1657,28 +1841,46 @@ function DateCellEditor(props) {
|
|
|
1657
1841
|
}
|
|
1658
1842
|
|
|
1659
1843
|
// src/editors/CustomCellEditor.tsx
|
|
1660
|
-
import { onCleanup as
|
|
1844
|
+
import { onCleanup as onCleanup7, untrack as untrack10 } from "solid-js";
|
|
1661
1845
|
function CustomCellEditor(props) {
|
|
1662
1846
|
let alive = true;
|
|
1663
|
-
|
|
1847
|
+
let late = null;
|
|
1848
|
+
const unregisterLateCommit = untrack10(() => props.onRegisterLateCommit)?.((commit) => {
|
|
1849
|
+
late = commit;
|
|
1850
|
+
});
|
|
1851
|
+
onCleanup7(() => {
|
|
1664
1852
|
alive = false;
|
|
1853
|
+
unregisterLateCommit?.();
|
|
1665
1854
|
});
|
|
1666
|
-
const context =
|
|
1855
|
+
const context = untrack10(() => props.context);
|
|
1667
1856
|
const sessionContext = Object.defineProperties({}, Object.getOwnPropertyDescriptors(context));
|
|
1668
|
-
sessionContext.commit = (value, direction) =>
|
|
1857
|
+
sessionContext.commit = (value, direction) => {
|
|
1858
|
+
if (late !== null) {
|
|
1859
|
+
const commit = late;
|
|
1860
|
+
late = null;
|
|
1861
|
+
return commit(value);
|
|
1862
|
+
}
|
|
1863
|
+
return alive ? context.commit(value, direction) : { status: "noop" };
|
|
1864
|
+
};
|
|
1669
1865
|
sessionContext.cancel = () => {
|
|
1866
|
+
if (late !== null) {
|
|
1867
|
+
late = null;
|
|
1868
|
+
return;
|
|
1869
|
+
}
|
|
1670
1870
|
if (alive) {
|
|
1671
1871
|
context.cancel();
|
|
1672
1872
|
}
|
|
1673
1873
|
};
|
|
1674
|
-
return <>{
|
|
1874
|
+
return <>{untrack10(() => props.render(sessionContext))}</>;
|
|
1675
1875
|
}
|
|
1676
1876
|
|
|
1677
1877
|
// src/editors/CellEditorLayer.tsx
|
|
1878
|
+
var NOOP2 = () => {
|
|
1879
|
+
};
|
|
1678
1880
|
function CellEditorLayer(props) {
|
|
1679
1881
|
const texts = useGridLocaleText();
|
|
1680
1882
|
const editor = () => props.editor;
|
|
1681
|
-
const kind =
|
|
1883
|
+
const kind = createMemo7(() => {
|
|
1682
1884
|
const type = editor()?.type;
|
|
1683
1885
|
return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
|
|
1684
1886
|
});
|
|
@@ -1687,7 +1889,7 @@ function CellEditorLayer(props) {
|
|
|
1687
1889
|
return session ? formatLocaleText4(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1688
1890
|
};
|
|
1689
1891
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1690
|
-
const selectOptions =
|
|
1892
|
+
const selectOptions = createMemo7(() => {
|
|
1691
1893
|
const current = editor();
|
|
1692
1894
|
if (current?.type !== "select") {
|
|
1693
1895
|
return [];
|
|
@@ -1699,7 +1901,7 @@ function CellEditorLayer(props) {
|
|
|
1699
1901
|
return row !== void 0 ? current.options(row) : [];
|
|
1700
1902
|
});
|
|
1701
1903
|
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1702
|
-
const session =
|
|
1904
|
+
const session = createMemo7(
|
|
1703
1905
|
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session ?? previous ?? null : previous
|
|
1704
1906
|
);
|
|
1705
1907
|
const context = {
|
|
@@ -1733,7 +1935,11 @@ function CellEditorLayer(props) {
|
|
|
1733
1935
|
cancel: () => props.onCancel()
|
|
1734
1936
|
};
|
|
1735
1937
|
return <Show8 when={session() !== null}>
|
|
1736
|
-
<CustomCellEditor
|
|
1938
|
+
<CustomCellEditor
|
|
1939
|
+
render={render}
|
|
1940
|
+
context={context}
|
|
1941
|
+
onRegisterLateCommit={(receiver) => props.onRegisterLateCommit?.(receiver) ?? NOOP2}
|
|
1942
|
+
/>
|
|
1737
1943
|
</Show8>;
|
|
1738
1944
|
};
|
|
1739
1945
|
const renderEditor = (type, sessionId) => {
|
|
@@ -1757,7 +1963,7 @@ function CellEditorLayer(props) {
|
|
|
1757
1963
|
onCancel: () => props.onCancel(),
|
|
1758
1964
|
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
1759
1965
|
};
|
|
1760
|
-
const initialValue =
|
|
1966
|
+
const initialValue = untrack11(props.initialValue);
|
|
1761
1967
|
if (type === "select" || type === "custom") {
|
|
1762
1968
|
props.onRegisterFlush?.(null);
|
|
1763
1969
|
}
|
|
@@ -1776,7 +1982,7 @@ function CellEditorLayer(props) {
|
|
|
1776
1982
|
/>;
|
|
1777
1983
|
}
|
|
1778
1984
|
case "date": {
|
|
1779
|
-
const session =
|
|
1985
|
+
const session = untrack11(() => props.session);
|
|
1780
1986
|
return <DateCellEditor
|
|
1781
1987
|
{...common}
|
|
1782
1988
|
initialValue={toDateInputValue(session ? session.value : initialValue)}
|
|
@@ -1784,7 +1990,7 @@ function CellEditorLayer(props) {
|
|
|
1784
1990
|
/>;
|
|
1785
1991
|
}
|
|
1786
1992
|
case "select": {
|
|
1787
|
-
const session =
|
|
1993
|
+
const session = untrack11(() => props.session);
|
|
1788
1994
|
return <SelectCellEditor
|
|
1789
1995
|
{...common}
|
|
1790
1996
|
popoverSlot={props.slots.popover}
|
|
@@ -1797,7 +2003,7 @@ function CellEditorLayer(props) {
|
|
|
1797
2003
|
/>;
|
|
1798
2004
|
}
|
|
1799
2005
|
case "custom": {
|
|
1800
|
-
const current =
|
|
2006
|
+
const current = untrack11(editor);
|
|
1801
2007
|
if (current?.type !== "custom") {
|
|
1802
2008
|
return null;
|
|
1803
2009
|
}
|
|
@@ -1842,7 +2048,7 @@ function CellEditorLayer(props) {
|
|
|
1842
2048
|
}
|
|
1843
2049
|
|
|
1844
2050
|
// src/view/DefaultGridTopBar.tsx
|
|
1845
|
-
import { Show as Show9, createMemo as
|
|
2051
|
+
import { Show as Show9, createMemo as createMemo8, createRenderEffect as createRenderEffect4, createSignal as createSignal8, createUniqueId as createUniqueId2, untrack as untrack12 } from "solid-js";
|
|
1846
2052
|
var DefaultFilterIcon = () => <svg
|
|
1847
2053
|
width="14"
|
|
1848
2054
|
height="14"
|
|
@@ -1874,8 +2080,8 @@ function DefaultGridTopBar(props) {
|
|
|
1874
2080
|
const texts = useGridLocaleText();
|
|
1875
2081
|
const filterSummaryId = createUniqueId2();
|
|
1876
2082
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1877
|
-
const [input, setInput] =
|
|
1878
|
-
const initialText =
|
|
2083
|
+
const [input, setInput] = createSignal8();
|
|
2084
|
+
const initialText = untrack12(() => props.globalFilterText);
|
|
1879
2085
|
createRenderEffect4(
|
|
1880
2086
|
() => [input(), props.globalFilterText],
|
|
1881
2087
|
([element, text]) => {
|
|
@@ -1886,7 +2092,7 @@ function DefaultGridTopBar(props) {
|
|
|
1886
2092
|
{ name: "globalFilterInput" }
|
|
1887
2093
|
);
|
|
1888
2094
|
const hasFilterText = () => props.globalFilterText.trim().length > 0;
|
|
1889
|
-
const filterIcon =
|
|
2095
|
+
const filterIcon = createMemo8(() => {
|
|
1890
2096
|
const icon = props.globalFilterIcon;
|
|
1891
2097
|
return icon === void 0 ? <DefaultFilterIcon /> : icon;
|
|
1892
2098
|
});
|
|
@@ -1994,7 +2200,7 @@ function DefaultGridBottomBar(props) {
|
|
|
1994
2200
|
}
|
|
1995
2201
|
|
|
1996
2202
|
// src/devWarnings.ts
|
|
1997
|
-
import {
|
|
2203
|
+
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
1998
2204
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
1999
2205
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2000
2206
|
import {
|
|
@@ -2005,7 +2211,7 @@ import {
|
|
|
2005
2211
|
var noop2 = () => {
|
|
2006
2212
|
};
|
|
2007
2213
|
var createChangeEffect = (compute, effect) => {
|
|
2008
|
-
|
|
2214
|
+
createEffect3(createMemo9(compute), effect, { name: "devWarning" });
|
|
2009
2215
|
};
|
|
2010
2216
|
var FEATURE_PROPS = {
|
|
2011
2217
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2147,7 +2353,6 @@ var warnOncePerGrid = (warned, id, message) => {
|
|
|
2147
2353
|
warned.add(id);
|
|
2148
2354
|
console.warn(message);
|
|
2149
2355
|
};
|
|
2150
|
-
var isSolidStore = (value) => typeof value === "object" && value !== null && $PROXY in value;
|
|
2151
2356
|
function createShellDevWarningsInDev(args) {
|
|
2152
2357
|
createChangeEffect(
|
|
2153
2358
|
() => args.isServerSide() ? args.groupColumnCount() : 0,
|
|
@@ -2202,18 +2407,6 @@ function createShellDevWarningsInDev(args) {
|
|
|
2202
2407
|
}
|
|
2203
2408
|
}
|
|
2204
2409
|
);
|
|
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
2410
|
if (!args.filteringAvailable) {
|
|
2218
2411
|
createChangeEffect(
|
|
2219
2412
|
() => args.globalFilterText().trim() !== "" || args.columnFilterCount() > 0,
|
|
@@ -2261,7 +2454,7 @@ var noop3 = () => {
|
|
|
2261
2454
|
};
|
|
2262
2455
|
var applyHandleRef = (ref, handle) => {
|
|
2263
2456
|
if (typeof ref === "function") {
|
|
2264
|
-
ref(handle);
|
|
2457
|
+
runWithOwner3(null, () => untrack13(() => ref(handle)));
|
|
2265
2458
|
} else if (Array.isArray(ref)) {
|
|
2266
2459
|
for (const item of ref) applyHandleRef(item, handle);
|
|
2267
2460
|
}
|
|
@@ -2292,23 +2485,49 @@ var SLOT_CONTEXT_KEYS = Object.keys({
|
|
|
2292
2485
|
globalFilterProgress: true,
|
|
2293
2486
|
selectionAggregates: true
|
|
2294
2487
|
});
|
|
2488
|
+
var DERIVED_SUMMARY_KEYS = Object.keys({
|
|
2489
|
+
rowSummaryText: true,
|
|
2490
|
+
columnSummaryText: true,
|
|
2491
|
+
filterSummaryText: true,
|
|
2492
|
+
sortSummaryText: true,
|
|
2493
|
+
activeCellLabel: true,
|
|
2494
|
+
selectionLabel: true,
|
|
2495
|
+
selectionStatsText: true,
|
|
2496
|
+
selectedColumnsText: true,
|
|
2497
|
+
selectionStats: true,
|
|
2498
|
+
hasGlobalFilter: true,
|
|
2499
|
+
globalFilterPreview: true,
|
|
2500
|
+
activeColumnFilterCount: true,
|
|
2501
|
+
hasAnyFilter: true,
|
|
2502
|
+
hasSorting: true,
|
|
2503
|
+
sortedColumnLabel: true
|
|
2504
|
+
});
|
|
2295
2505
|
function GridShell(props, features) {
|
|
2506
|
+
const serverSnapshot = isServer && untrack13(() => props.dataSource == null);
|
|
2296
2507
|
const mountGate = createMountGate();
|
|
2297
|
-
|
|
2508
|
+
const frame = runInMountGate(mountGate, () => GridShellBody(props, features, mountGate, serverSnapshot ? "hiddenFrame" : "normal"));
|
|
2509
|
+
const snapshot2 = <NoHydration>
|
|
2510
|
+
{serverSnapshot ? (() => {
|
|
2511
|
+
const snapshotGate = createMountGate();
|
|
2512
|
+
return runInMountGate(snapshotGate, () => GridShellBody(createSnapshotProps(props), features, snapshotGate, "snapshot"));
|
|
2513
|
+
})() : null}
|
|
2514
|
+
</NoHydration>;
|
|
2515
|
+
return [frame, snapshot2];
|
|
2298
2516
|
}
|
|
2299
|
-
function GridShellBody(props, features, mountGate) {
|
|
2517
|
+
function GridShellBody(props, features, mountGate, mode) {
|
|
2300
2518
|
const serverSideFeature2 = features.serverSide;
|
|
2301
|
-
const isServerSide =
|
|
2519
|
+
const isServerSide = createMemo10(() => props.dataSource != null);
|
|
2302
2520
|
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2303
|
-
const [hydrated, setHydrated] =
|
|
2304
|
-
if (!
|
|
2521
|
+
const [hydrated, setHydrated] = createSignal9(mode === "snapshot" || !isServer && !isHydrating(), { name: "hydrated" });
|
|
2522
|
+
if (!untrack13(hydrated)) {
|
|
2305
2523
|
onGridMounted(() => {
|
|
2524
|
+
revealServerFrame(gridRootRef.current?.parentElement, untrack13(() => rootStyle().display));
|
|
2306
2525
|
setHydrated(true);
|
|
2307
2526
|
});
|
|
2308
2527
|
}
|
|
2309
|
-
const [relayedRows, setRelayedRows] =
|
|
2310
|
-
|
|
2311
|
-
() =>
|
|
2528
|
+
const [relayedRows, setRelayedRows] = createSignal9(null);
|
|
2529
|
+
createEffect4(
|
|
2530
|
+
() => latest2(() => props.rows),
|
|
2312
2531
|
{
|
|
2313
2532
|
effect: (value) => {
|
|
2314
2533
|
setRelayedRows({ value });
|
|
@@ -2321,14 +2540,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2321
2540
|
},
|
|
2322
2541
|
{ name: "relayRows" }
|
|
2323
2542
|
);
|
|
2324
|
-
const
|
|
2543
|
+
const plainRows = createPlainRows(() => {
|
|
2544
|
+
const relayed = relayedRows();
|
|
2545
|
+
return relayed ? relayed.value : props.rows;
|
|
2546
|
+
});
|
|
2547
|
+
const rows = createMemo10(() => {
|
|
2325
2548
|
if (props.dataSource != null || !hydrated()) {
|
|
2326
2549
|
return EMPTY_ROWS;
|
|
2327
2550
|
}
|
|
2328
|
-
|
|
2329
|
-
return (relayed ? relayed.value : props.rows) ?? EMPTY_ROWS;
|
|
2551
|
+
return plainRows() ?? EMPTY_ROWS;
|
|
2330
2552
|
});
|
|
2331
|
-
const columns =
|
|
2553
|
+
const columns = createMemo10(() => props.columns);
|
|
2332
2554
|
const density = () => props.density ?? "standard";
|
|
2333
2555
|
const rowHeight = () => props.rowHeight ?? GRID_DENSITY_DIMENSIONS[density()].rowHeight;
|
|
2334
2556
|
const columnHeaderHeight = () => props.headerHeight ?? GRID_DENSITY_DIMENSIONS[density()].headerHeight;
|
|
@@ -2346,7 +2568,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2346
2568
|
const enableRowSelection = () => props.enableRowSelection ?? false;
|
|
2347
2569
|
const rowSelectionMode = () => props.rowSelectionMode ?? "multiple";
|
|
2348
2570
|
const enableSelectAllRows = () => props.enableSelectAllRows ?? (enableRowSelection() && rowSelectionMode() === "multiple");
|
|
2349
|
-
const detailRowEnabled =
|
|
2571
|
+
const detailRowEnabled = createMemo10(() => props.detailRow != null);
|
|
2350
2572
|
const detailToggleColumnActive = () => props.detailRow != null && props.detailRow.showToggleColumn !== false;
|
|
2351
2573
|
const columnInputs = () => ({
|
|
2352
2574
|
columns: columns(),
|
|
@@ -2358,50 +2580,50 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2358
2580
|
renderDetailToggleCell
|
|
2359
2581
|
});
|
|
2360
2582
|
const resolveLocaleText = createLocaleTextResolver(mergeFeatureLocaleDefaults(features));
|
|
2361
|
-
const localeTexts =
|
|
2583
|
+
const localeTexts = createMemo10(() => resolveLocaleText(props.localeText));
|
|
2362
2584
|
const totalRowFeature2 = features.totalRow;
|
|
2363
2585
|
const TotalRow = totalRowFeature2?.TotalRow;
|
|
2364
2586
|
const PinnedRows = features.pinnedRows?.PinnedRows;
|
|
2365
|
-
const totalRowOptions =
|
|
2587
|
+
const totalRowOptions = createMemo10(
|
|
2366
2588
|
() => typeof props.totalRow === "object" && props.totalRow !== null ? props.totalRow : null
|
|
2367
2589
|
);
|
|
2368
|
-
const totalRowEnabled =
|
|
2590
|
+
const totalRowEnabled = createMemo10(
|
|
2369
2591
|
() => (props.totalRow === true || totalRowOptions() !== null) && totalRowFeature2 !== void 0
|
|
2370
2592
|
);
|
|
2371
2593
|
const totalRowLabel = () => totalRowOptions()?.label ?? localeTexts().totalRowLabel;
|
|
2372
|
-
const totalRowHeight =
|
|
2373
|
-
const pinnedTop =
|
|
2594
|
+
const totalRowHeight = createMemo10(() => totalRowEnabled() ? Math.max(0, totalRowOptions()?.height ?? rowHeight()) : 0);
|
|
2595
|
+
const pinnedTop = createMemo10(
|
|
2374
2596
|
() => PinnedRows && props.pinnedTopRows && props.pinnedTopRows.length > 0 ? props.pinnedTopRows : null
|
|
2375
2597
|
);
|
|
2376
|
-
const pinnedBottom =
|
|
2598
|
+
const pinnedBottom = createMemo10(
|
|
2377
2599
|
() => PinnedRows && props.pinnedBottomRows && props.pinnedBottomRows.length > 0 ? props.pinnedBottomRows : null
|
|
2378
2600
|
);
|
|
2379
2601
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2380
2602
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2381
|
-
const headerHeight =
|
|
2382
|
-
const footerHeight =
|
|
2383
|
-
const pinnedBelowTotal =
|
|
2603
|
+
const headerHeight = createMemo10(() => columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2604
|
+
const footerHeight = createMemo10(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2605
|
+
const pinnedBelowTotal = createMemo10(
|
|
2384
2606
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2385
2607
|
);
|
|
2386
2608
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
2387
2609
|
const engine = createGridEngine({
|
|
2388
2610
|
features,
|
|
2389
|
-
initialState:
|
|
2390
|
-
columnInputs:
|
|
2611
|
+
initialState: untrack13(() => props.initialState),
|
|
2612
|
+
columnInputs: untrack13(columnInputs),
|
|
2391
2613
|
serverSide: {
|
|
2392
|
-
isServerSide:
|
|
2393
|
-
enableGlobalFilter:
|
|
2394
|
-
enableColumnFilter:
|
|
2395
|
-
enableSorting:
|
|
2614
|
+
isServerSide: untrack13(isServerSide),
|
|
2615
|
+
enableGlobalFilter: untrack13(globalFilterEnabled),
|
|
2616
|
+
enableColumnFilter: untrack13(columnFilterEnabled),
|
|
2617
|
+
enableSorting: untrack13(enableSorting)
|
|
2396
2618
|
}
|
|
2397
2619
|
});
|
|
2398
|
-
|
|
2620
|
+
onCleanup8(() => engine.dispose());
|
|
2399
2621
|
const store = engine.store;
|
|
2400
2622
|
const dispatch = store.dispatch;
|
|
2401
2623
|
const { state: ui, view } = createGridStoreSignals(store);
|
|
2402
|
-
const viewportWidth =
|
|
2403
|
-
const viewportHeight =
|
|
2404
|
-
const viewScrollTop =
|
|
2624
|
+
const viewportWidth = createMemo10(() => view().viewportWidth);
|
|
2625
|
+
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2626
|
+
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2405
2627
|
const viewSetters = createGridViewSetters(store);
|
|
2406
2628
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2407
2629
|
const gridRootRef = { current: null };
|
|
@@ -2416,23 +2638,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2416
2638
|
const cellDoubleClickRef = { current: noop3 };
|
|
2417
2639
|
const getPopupContainer = () => resolvePopupContainer(
|
|
2418
2640
|
gridRootRef.current,
|
|
2419
|
-
|
|
2641
|
+
untrack13(() => props.popupContainer) ?? "auto"
|
|
2420
2642
|
);
|
|
2421
2643
|
const portalContext = { source: () => gridRootRef.current, container: getPopupContainer };
|
|
2422
2644
|
onGridMounted(() => {
|
|
2423
2645
|
const shell = gridRootRef.current;
|
|
2424
2646
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2425
2647
|
});
|
|
2426
|
-
const columnResolution =
|
|
2648
|
+
const columnResolution = createMemo10(() => engine.resolveColumns(columnInputs()));
|
|
2427
2649
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2428
2650
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2429
2651
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
2430
2652
|
const groupColumns = () => columnResolution().groupColumns;
|
|
2431
2653
|
const aggColumns = () => columnResolution().aggColumns;
|
|
2432
|
-
const activeGroupColumns =
|
|
2433
|
-
const resolvedRowKeyGetter =
|
|
2434
|
-
const selectionSnapshot =
|
|
2435
|
-
const paneResolution =
|
|
2654
|
+
const activeGroupColumns = createMemo10(() => rowGroupingActive() ? groupColumns() : NO_COLUMNS);
|
|
2655
|
+
const resolvedRowKeyGetter = createMemo10(() => props.rowKeyGetter ?? ((_row, index) => index));
|
|
2656
|
+
const selectionSnapshot = createMemo10(() => buildSelectionSnapshot(ui().selection));
|
|
2657
|
+
const paneResolution = createMemo10(
|
|
2436
2658
|
() => engine.resolvePaneLayout({
|
|
2437
2659
|
orderedColumns: orderedColumns(),
|
|
2438
2660
|
columnWidths: ui().columnWidths,
|
|
@@ -2442,32 +2664,32 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2442
2664
|
);
|
|
2443
2665
|
const paneLayout = () => paneResolution().paneLayout;
|
|
2444
2666
|
let previousColumnsForWidths = null;
|
|
2445
|
-
|
|
2667
|
+
createEffect4(
|
|
2446
2668
|
columns,
|
|
2447
|
-
(next) => {
|
|
2669
|
+
outsideGraphApply((next) => {
|
|
2448
2670
|
dispatch(gridActions.reconcileColumnWidths(previousColumnsForWidths, next));
|
|
2449
2671
|
previousColumnsForWidths = next;
|
|
2450
|
-
},
|
|
2672
|
+
}),
|
|
2451
2673
|
{ name: "reconcileColumnWidths" }
|
|
2452
2674
|
);
|
|
2453
2675
|
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 =
|
|
2676
|
+
const labelIsLabelRow = createMemo10(() => props.labelRow?.isLabelRow);
|
|
2677
|
+
const labelGetLabel = createMemo10(() => props.labelRow?.getLabel);
|
|
2678
|
+
const labelRender = createMemo10(() => props.labelRow?.render);
|
|
2679
|
+
const labelRowClassName = createMemo10(() => props.labelRow?.className);
|
|
2680
|
+
const labelRowHeightOption = createMemo10(() => props.labelRow?.height);
|
|
2681
|
+
const labelSortMode = createMemo10(() => props.labelRow?.sortMode ?? "section");
|
|
2682
|
+
const labelSticky = createMemo10(() => props.labelRow?.sticky === true);
|
|
2683
|
+
const labelExportText = createMemo10(() => props.labelRow?.exportText);
|
|
2684
|
+
const labelKeepEmptySections = createMemo10(() => props.labelRow?.keepEmptySections ?? false);
|
|
2685
|
+
const labelRowEnabled = createMemo10(
|
|
2464
2686
|
() => labelIsLabelRow() != null && labelGetLabel() != null && labelRowFeature2 !== void 0
|
|
2465
2687
|
);
|
|
2466
2688
|
const StickyLabelLayer = labelRowFeature2?.StickyLabelLayer;
|
|
2467
|
-
const labelLayout =
|
|
2689
|
+
const labelLayout = createMemo10(
|
|
2468
2690
|
() => engine.rowPipeline.resolveLabelRowLayout(rows(), isServerSide() ? void 0 : labelIsLabelRow())
|
|
2469
2691
|
);
|
|
2470
|
-
const filterCandidateRows =
|
|
2692
|
+
const filterCandidateRows = createMemo10(() => {
|
|
2471
2693
|
const layout = labelLayout();
|
|
2472
2694
|
const currentRows = rows();
|
|
2473
2695
|
if (!layout) {
|
|
@@ -2485,11 +2707,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2485
2707
|
}
|
|
2486
2708
|
return dataRows;
|
|
2487
2709
|
});
|
|
2488
|
-
const baseOrder =
|
|
2489
|
-
const globalFilterText =
|
|
2490
|
-
const columnFilters =
|
|
2491
|
-
const filterSortColumns =
|
|
2492
|
-
const globalFilterColumns =
|
|
2710
|
+
const baseOrder = createMemo10(() => engine.rowPipeline.resolveBaseOrder(rows().length, labelLayout()));
|
|
2711
|
+
const globalFilterText = createMemo10(() => selectGlobalFilter(ui()));
|
|
2712
|
+
const columnFilters = createMemo10(() => ui().filters.columnFilters);
|
|
2713
|
+
const filterSortColumns = createMemo10(() => columnResolution().filterSortColumns);
|
|
2714
|
+
const globalFilterColumns = createMemo10(() => {
|
|
2493
2715
|
const groups = activeGroupColumns();
|
|
2494
2716
|
return groups.length > 0 ? [...visibleColumns(), ...groups] : visibleColumns();
|
|
2495
2717
|
});
|
|
@@ -2513,7 +2735,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2513
2735
|
const globalFilterStatus = filterOrder ? filterOrder.globalFilterStatus : () => "idle";
|
|
2514
2736
|
const globalFilterProgress = filterOrder ? filterOrder.globalFilterProgress : () => 1;
|
|
2515
2737
|
const relativeDateKey = filterOrder ? filterOrder.relativeDateKey : () => "";
|
|
2516
|
-
const orderResolution =
|
|
2738
|
+
const orderResolution = createMemo10(
|
|
2517
2739
|
() => engine.rowPipeline.resolveOrder({
|
|
2518
2740
|
rows: rows(),
|
|
2519
2741
|
labelLayout: labelLayout(),
|
|
@@ -2531,7 +2753,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2531
2753
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
2532
2754
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
2533
2755
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
2534
|
-
const clientRowModel =
|
|
2756
|
+
const clientRowModel = createMemo10(
|
|
2535
2757
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
2536
2758
|
rows: rows(),
|
|
2537
2759
|
order: orderResolution().order,
|
|
@@ -2550,7 +2772,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2550
2772
|
manualSorting: manualSorting()
|
|
2551
2773
|
})
|
|
2552
2774
|
);
|
|
2553
|
-
const liveServerSideQuery =
|
|
2775
|
+
const liveServerSideQuery = createMemo10(
|
|
2554
2776
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
2555
2777
|
isServerSide: isServerSide(),
|
|
2556
2778
|
globalFilterEnabled: globalFilterEnabled(),
|
|
@@ -2569,7 +2791,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2569
2791
|
"serverSideQueryStore"
|
|
2570
2792
|
);
|
|
2571
2793
|
const serverSideQuerySnapshot = createExternalStoreSignal(engine.serverSideQueryStore, "serverSideQueryStore");
|
|
2572
|
-
const serverSideQueryKey =
|
|
2794
|
+
const serverSideQueryKey = createMemo10(() => serverSideQuerySnapshot().queryKey);
|
|
2573
2795
|
const serverSide = serverSideFeature2?.createServerSide(() => ({
|
|
2574
2796
|
dataSource: props.dataSource,
|
|
2575
2797
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
@@ -2581,7 +2803,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2581
2803
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2582
2804
|
onWriteStateChange: engine.saveStatus.handle
|
|
2583
2805
|
}));
|
|
2584
|
-
const rowModel =
|
|
2806
|
+
const rowModel = createMemo10(() => {
|
|
2585
2807
|
if (!isServerSide() || !serverSide) {
|
|
2586
2808
|
return clientRowModel().rowModel;
|
|
2587
2809
|
}
|
|
@@ -2590,38 +2812,39 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2590
2812
|
const getLabel = labelGetLabel();
|
|
2591
2813
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
2592
2814
|
});
|
|
2593
|
-
const canEditCell =
|
|
2815
|
+
const canEditCell = createMemo10(
|
|
2594
2816
|
() => isServerSide() && !(serverSide?.canUpdateRows() ?? false) ? NEVER_EDITABLE : props.canEditCell
|
|
2595
2817
|
);
|
|
2596
|
-
const applyServerSideCellEdits =
|
|
2818
|
+
const applyServerSideCellEdits = createMemo10(
|
|
2597
2819
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
2598
2820
|
);
|
|
2599
|
-
const viewRowCount =
|
|
2821
|
+
const viewRowCount = createMemo10(() => rowModel().getRowCount());
|
|
2600
2822
|
const viewColCount = () => orderedColumns().length;
|
|
2601
2823
|
const order = () => orderResolution().order;
|
|
2602
2824
|
const groupTree = () => clientRowModel().groupTree;
|
|
2603
2825
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
2604
|
-
const labelViewIndexes =
|
|
2605
|
-
const leafRowCount =
|
|
2826
|
+
const labelViewIndexes = createMemo10(() => labelDisplay()?.labelViewIndexes);
|
|
2827
|
+
const leafRowCount = createMemo10(
|
|
2606
2828
|
() => clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : viewRowCount()
|
|
2607
2829
|
);
|
|
2608
2830
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
2609
2831
|
const groupingFeature2 = features.grouping;
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2832
|
+
const orderArray = createMemo10(() => order());
|
|
2833
|
+
const getFilteredRows = createMemo10(() => {
|
|
2834
|
+
const currentOrder = orderArray();
|
|
2612
2835
|
const currentRows = rows();
|
|
2613
2836
|
let cache = null;
|
|
2614
2837
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
2615
2838
|
});
|
|
2616
|
-
|
|
2839
|
+
createEffect4(
|
|
2617
2840
|
() => [viewRowCount(), viewColCount()],
|
|
2618
|
-
([rowCount, colCount]) => {
|
|
2841
|
+
outsideGraphApply(([rowCount, colCount]) => {
|
|
2619
2842
|
dispatch(gridActions.clampSelectionToRowCount(rowCount, colCount));
|
|
2620
|
-
},
|
|
2843
|
+
}),
|
|
2621
2844
|
{ name: "clampSelectionToRowCount" }
|
|
2622
2845
|
);
|
|
2623
2846
|
const autoHeightSnapshot = createExternalStoreSignal(engine.autoHeightMeasurer, "autoHeightStore");
|
|
2624
|
-
const vertical =
|
|
2847
|
+
const vertical = createMemo10(
|
|
2625
2848
|
() => engine.resolveVerticalLayout({
|
|
2626
2849
|
isServerSide: isServerSide(),
|
|
2627
2850
|
autoHeight: props.autoHeight ?? false,
|
|
@@ -2657,18 +2880,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2657
2880
|
detailExtraCount: () => vertical().detailExtras.length,
|
|
2658
2881
|
detailActive: () => vertical().detailActive,
|
|
2659
2882
|
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
|
-
}
|
|
2883
|
+
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2666
2884
|
});
|
|
2667
|
-
const stickyLabelIndexes =
|
|
2885
|
+
const stickyLabelIndexes = createMemo10(() => {
|
|
2668
2886
|
const indexes = labelViewIndexes();
|
|
2669
2887
|
return labelSticky() && labelRowFeature2 && indexes && indexes.length > 0 ? indexes : null;
|
|
2670
2888
|
});
|
|
2671
|
-
const stickyLabelEntry =
|
|
2889
|
+
const stickyLabelEntry = createMemo10(() => {
|
|
2672
2890
|
const indexes = stickyLabelIndexes();
|
|
2673
2891
|
if (!indexes || !labelRowFeature2) {
|
|
2674
2892
|
return null;
|
|
@@ -2694,7 +2912,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2694
2912
|
pushOffset: resolution.pushOffset
|
|
2695
2913
|
};
|
|
2696
2914
|
});
|
|
2697
|
-
const stickyTopInset =
|
|
2915
|
+
const stickyTopInset = createMemo10(() => {
|
|
2698
2916
|
const indexes = stickyLabelIndexes();
|
|
2699
2917
|
const feature = labelRowFeature2;
|
|
2700
2918
|
if (!indexes || !feature) {
|
|
@@ -2711,8 +2929,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2711
2929
|
};
|
|
2712
2930
|
});
|
|
2713
2931
|
const conditionalFormatFeature2 = features.conditionalFormat;
|
|
2714
|
-
const conditionalFormatStats =
|
|
2715
|
-
const totalRowCells =
|
|
2932
|
+
const conditionalFormatStats = createMemo10(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
|
|
2933
|
+
const totalRowCells = createMemo10(
|
|
2716
2934
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
2717
2935
|
rows: rows(),
|
|
2718
2936
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
@@ -2721,11 +2939,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2721
2939
|
values: totalRowOptions()?.values
|
|
2722
2940
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
2723
2941
|
);
|
|
2724
|
-
const totalRowLabelColumnKey =
|
|
2942
|
+
const totalRowLabelColumnKey = createMemo10(
|
|
2725
2943
|
() => totalRowFeature2 ? totalRowFeature2.resolveTotalRowLabelColumnKey(orderedColumns(), totalRowCells()) : null
|
|
2726
2944
|
);
|
|
2727
2945
|
const columnAutosizeFeature2 = features.columnAutosize;
|
|
2728
|
-
const totalRowAutosizeTexts =
|
|
2946
|
+
const totalRowAutosizeTexts = createMemo10(() => {
|
|
2729
2947
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
2730
2948
|
return void 0;
|
|
2731
2949
|
}
|
|
@@ -2744,10 +2962,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2744
2962
|
}
|
|
2745
2963
|
return texts;
|
|
2746
2964
|
});
|
|
2747
|
-
const pinnedAutosizeRows =
|
|
2965
|
+
const pinnedAutosizeRows = createMemo10(
|
|
2748
2966
|
() => pinnedTop() || pinnedBottom() ? [...pinnedTop() ?? [], ...pinnedBottom() ?? []] : void 0
|
|
2749
2967
|
);
|
|
2750
|
-
const autosizeChipOf =
|
|
2968
|
+
const autosizeChipOf = createMemo10(() => {
|
|
2751
2969
|
const chipFeature = conditionalFormatFeature2;
|
|
2752
2970
|
if (!chipFeature) {
|
|
2753
2971
|
return void 0;
|
|
@@ -2822,27 +3040,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2822
3040
|
"effect",
|
|
2823
3041
|
"autoSizeOnData"
|
|
2824
3042
|
);
|
|
2825
|
-
const totalRowSlotSignature =
|
|
2826
|
-
const totalRowSlot =
|
|
2827
|
-
const totalRowExport =
|
|
3043
|
+
const totalRowSlotSignature = createMemo10(() => serializeSlotValue(totalRowOptions()?.className));
|
|
3044
|
+
const totalRowSlot = createMemo10(() => resolveSlotFromSignature(totalRowSlotSignature()));
|
|
3045
|
+
const totalRowExport = createMemo10(
|
|
2828
3046
|
() => totalRowEnabled() ? { cells: totalRowCells(), label: totalRowLabel() } : void 0
|
|
2829
3047
|
);
|
|
2830
|
-
const pinnedRowsExport =
|
|
3048
|
+
const pinnedRowsExport = createMemo10(
|
|
2831
3049
|
() => pinnedTop() || pinnedBottom() ? { top: pinnedTop() ?? [], bottom: pinnedBottom() ?? [], bottomAfterTotal: pinnedBelowTotal() } : void 0
|
|
2832
3050
|
);
|
|
2833
3051
|
const scrollHintFeature2 = features.scrollHint;
|
|
2834
3052
|
const findFeature2 = features.find;
|
|
2835
3053
|
const imeFeature = features.imeDirectInput;
|
|
2836
|
-
const resolvedScrollHint =
|
|
3054
|
+
const resolvedScrollHint = createMemo10(
|
|
2837
3055
|
() => scrollHintFeature2 ? scrollHintFeature2.resolveScrollHintOptions(props.scrollHint) : null
|
|
2838
3056
|
);
|
|
2839
|
-
const activeScrollHint =
|
|
3057
|
+
const activeScrollHint = createMemo10(() => {
|
|
2840
3058
|
const resolved = resolvedScrollHint();
|
|
2841
3059
|
return resolved !== null && viewRowCount() >= resolved.minRows ? resolved : null;
|
|
2842
3060
|
});
|
|
2843
|
-
const customScrollbar =
|
|
2844
|
-
const autoHeightActive =
|
|
2845
|
-
const bodyRows =
|
|
3061
|
+
const customScrollbar = createMemo10(() => activeScrollHint()?.scrollbar === true);
|
|
3062
|
+
const autoHeightActive = createMemo10(() => vertical().autoHeightActive);
|
|
3063
|
+
const bodyRows = createMemo10(() => {
|
|
2846
3064
|
const { virtualRows, virtualRowIndexes } = vertical();
|
|
2847
3065
|
const model = rowModel();
|
|
2848
3066
|
const serverSideActive = isServerSide();
|
|
@@ -2887,7 +3105,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2887
3105
|
footerHeight: footerHeight()
|
|
2888
3106
|
}), "effect", "scrollSync");
|
|
2889
3107
|
let lastServerSideQueryKey = null;
|
|
2890
|
-
|
|
3108
|
+
createEffect4(
|
|
2891
3109
|
() => isServerSide() ? serverSideQueryKey() : null,
|
|
2892
3110
|
(key) => {
|
|
2893
3111
|
if (key === null) {
|
|
@@ -2908,7 +3126,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2908
3126
|
{ name: "serverSideQueryReset" }
|
|
2909
3127
|
);
|
|
2910
3128
|
let lastDetailQueryKey = null;
|
|
2911
|
-
|
|
3129
|
+
createEffect4(
|
|
2912
3130
|
() => isServerSide() && detailRowEnabled() ? serverSideQueryKey() : null,
|
|
2913
3131
|
(key) => {
|
|
2914
3132
|
if (key === null) {
|
|
@@ -2925,9 +3143,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2925
3143
|
},
|
|
2926
3144
|
{ name: "detailRowsQueryReset" }
|
|
2927
3145
|
);
|
|
2928
|
-
const windowFirstRow =
|
|
2929
|
-
const windowLastRow =
|
|
2930
|
-
|
|
3146
|
+
const windowFirstRow = createMemo10(() => vertical().windowFirstRow);
|
|
3147
|
+
const windowLastRow = createMemo10(() => vertical().windowLastRow);
|
|
3148
|
+
createEffect4(
|
|
2931
3149
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
2932
3150
|
([serverSideActive, firstRow, lastRow]) => {
|
|
2933
3151
|
if (!serverSideActive || !serverSide || lastRow < firstRow) {
|
|
@@ -2937,7 +3155,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2937
3155
|
},
|
|
2938
3156
|
{ name: "serverSideRequestRange" }
|
|
2939
3157
|
);
|
|
2940
|
-
const columnMeasurements =
|
|
3158
|
+
const columnMeasurements = createMemo10(
|
|
2941
3159
|
() => buildColumnMeasurements(visibleColumns(), paneResolution().effectiveColumnWidths)
|
|
2942
3160
|
);
|
|
2943
3161
|
const measuredByColumnVirtualizer = { measure: () => {
|
|
@@ -2956,11 +3174,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2956
3174
|
measureKey: columnMeasurements()
|
|
2957
3175
|
};
|
|
2958
3176
|
});
|
|
2959
|
-
const centerRenderEntries =
|
|
3177
|
+
const centerRenderEntries = createMemo10(() => {
|
|
2960
3178
|
const entries = centerEntries();
|
|
2961
3179
|
return columnVirtualizer.items().map((item) => entries[item.index]).filter((entry) => Boolean(entry));
|
|
2962
3180
|
});
|
|
2963
|
-
const activeCellRendered =
|
|
3181
|
+
const activeCellRendered = createMemo10(
|
|
2964
3182
|
() => isActiveCellRendered(ui().activeCell, vertical().virtualRowIndexes, rowModel(), [
|
|
2965
3183
|
paneLayout().left.entries,
|
|
2966
3184
|
centerRenderEntries(),
|
|
@@ -2995,28 +3213,28 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2995
3213
|
}), "render", "saveStatus");
|
|
2996
3214
|
const systemPrefersDark = createExternalStoreSignal(systemColorSchemeStore, "systemColorSchemeStore");
|
|
2997
3215
|
const themeClassName = () => resolveGridThemeClassName(props.theme ?? "light", systemPrefersDark());
|
|
2998
|
-
const heightLayout =
|
|
2999
|
-
const slotSignature =
|
|
3000
|
-
const slots =
|
|
3216
|
+
const heightLayout = createMemo10(() => resolveGridHeightLayout(props.height, props.maxHeight));
|
|
3217
|
+
const slotSignature = createMemo10(() => serializeSlotValue(props.classNames));
|
|
3218
|
+
const slots = createMemo10(
|
|
3001
3219
|
() => resolveSlotMapFromSignature(slotSignature())
|
|
3002
3220
|
);
|
|
3003
|
-
const activeCellPlacement =
|
|
3221
|
+
const activeCellPlacement = createMemo10(
|
|
3004
3222
|
() => resolveCellPlacement(ui().activeCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3005
3223
|
);
|
|
3006
|
-
const editingCellPlacement =
|
|
3224
|
+
const editingCellPlacement = createMemo10(
|
|
3007
3225
|
() => resolveCellPlacement(ui().editingCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
3008
3226
|
);
|
|
3009
|
-
const editorAlignTop =
|
|
3227
|
+
const editorAlignTop = createMemo10(() => {
|
|
3010
3228
|
const editing = ui().editingCell;
|
|
3011
3229
|
const column = editing ? orderedColumns()[editing.col] : void 0;
|
|
3012
3230
|
const placement2 = editingCellPlacement();
|
|
3013
3231
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
3014
3232
|
});
|
|
3015
|
-
const selectionExtents =
|
|
3016
|
-
const selectionBand =
|
|
3233
|
+
const selectionExtents = createMemo10(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3234
|
+
const selectionBand = createMemo10(
|
|
3017
3235
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3018
3236
|
);
|
|
3019
|
-
const selectionBandSegments =
|
|
3237
|
+
const selectionBandSegments = createMemo10(
|
|
3020
3238
|
() => resolveSelectionBandSegments(
|
|
3021
3239
|
vertical().detailActive,
|
|
3022
3240
|
selectionExtents(),
|
|
@@ -3030,7 +3248,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3030
3248
|
resolvePaneBandRect(selectionExtents(), selectionBand(), pane)
|
|
3031
3249
|
];
|
|
3032
3250
|
const motionExtrasFeature2 = features.motionExtras;
|
|
3033
|
-
const copiedSelection =
|
|
3251
|
+
const copiedSelection = createMemo10(() => {
|
|
3034
3252
|
const copied = view().copiedRange;
|
|
3035
3253
|
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true) || !copied) {
|
|
3036
3254
|
return null;
|
|
@@ -3038,11 +3256,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3038
3256
|
const state = ui();
|
|
3039
3257
|
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
3258
|
});
|
|
3041
|
-
const copiedExtents =
|
|
3042
|
-
const copiedBand =
|
|
3259
|
+
const copiedExtents = createMemo10(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3260
|
+
const copiedBand = createMemo10(
|
|
3043
3261
|
() => resolveSelectionBand(copiedExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
3044
3262
|
);
|
|
3045
|
-
const copiedBandSegments =
|
|
3263
|
+
const copiedBandSegments = createMemo10(
|
|
3046
3264
|
() => resolveSelectionBandSegments(
|
|
3047
3265
|
vertical().detailActive,
|
|
3048
3266
|
copiedExtents(),
|
|
@@ -3075,24 +3293,24 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3075
3293
|
onGridMounted(() => {
|
|
3076
3294
|
const controller = acquireTooltipController(void 0, gridRootRef.current);
|
|
3077
3295
|
tooltipController = controller;
|
|
3078
|
-
controller.setSlot(
|
|
3296
|
+
controller.setSlot(untrack13(slots).tooltip);
|
|
3079
3297
|
return () => {
|
|
3080
3298
|
controller.dispose();
|
|
3081
3299
|
tooltipController = null;
|
|
3082
3300
|
};
|
|
3083
3301
|
});
|
|
3084
|
-
|
|
3302
|
+
createEffect4(
|
|
3085
3303
|
() => slots().tooltip,
|
|
3086
3304
|
(slot) => {
|
|
3087
3305
|
tooltipController?.setSlot(slot);
|
|
3088
3306
|
},
|
|
3089
3307
|
{ name: "tooltipSlot" }
|
|
3090
3308
|
);
|
|
3091
|
-
const activeCellTooltipKey =
|
|
3309
|
+
const activeCellTooltipKey = createMemo10(() => {
|
|
3092
3310
|
const active = ui().activeCell;
|
|
3093
3311
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3094
3312
|
});
|
|
3095
|
-
|
|
3313
|
+
createEffect4(activeCellTooltipKey, (key) => {
|
|
3096
3314
|
if (key === null) {
|
|
3097
3315
|
hideActiveCellTooltip(gridRootRef.current);
|
|
3098
3316
|
return void 0;
|
|
@@ -3149,7 +3367,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3149
3367
|
"effect",
|
|
3150
3368
|
"viewportSync"
|
|
3151
3369
|
);
|
|
3152
|
-
const controlledRowSelectionModel =
|
|
3370
|
+
const controlledRowSelectionModel = createMemo10(() => {
|
|
3153
3371
|
if (props.rowSelection !== void 0) {
|
|
3154
3372
|
return props.rowSelection;
|
|
3155
3373
|
}
|
|
@@ -3158,11 +3376,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3158
3376
|
}
|
|
3159
3377
|
return void 0;
|
|
3160
3378
|
});
|
|
3161
|
-
const filteredDataRows =
|
|
3379
|
+
const filteredDataRows = createMemo10(
|
|
3162
3380
|
() => !isServerSide() && order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null
|
|
3163
3381
|
);
|
|
3164
3382
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3165
|
-
const selectAllRowsState =
|
|
3383
|
+
const selectAllRowsState = createMemo10(() => {
|
|
3166
3384
|
const filtered = filteredDataRows();
|
|
3167
3385
|
return filtered && enableRowSelection() ? resolveSelectAllState(
|
|
3168
3386
|
countSelectedRowsInOrder(ui().rowSelection, filtered.rows, filtered.order, filtered.rowKeyGetter),
|
|
@@ -3196,8 +3414,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3196
3414
|
keyOf: resolvedRowKeyGetter(),
|
|
3197
3415
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3198
3416
|
}), "render", "detailKeysPruner");
|
|
3199
|
-
const detailDrawable =
|
|
3200
|
-
const hasDetailCards =
|
|
3417
|
+
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <= MAX_BODY_PX2);
|
|
3418
|
+
const hasDetailCards = createMemo10(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3201
3419
|
const detailRows = createDetailRowController();
|
|
3202
3420
|
connectController(detailRows, () => ({
|
|
3203
3421
|
rowModel: rowModel(),
|
|
@@ -3223,11 +3441,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3223
3441
|
),
|
|
3224
3442
|
0
|
|
3225
3443
|
);
|
|
3226
|
-
const detailRender =
|
|
3227
|
-
const detailCardSlotSignature =
|
|
3228
|
-
const detailCardSlot =
|
|
3444
|
+
const detailRender = createMemo10(() => props.detailRow?.render);
|
|
3445
|
+
const detailCardSlotSignature = createMemo10(() => serializeSlotValue(props.detailRow?.className));
|
|
3446
|
+
const detailCardSlot = createMemo10(() => resolveSlotFromSignature(detailCardSlotSignature()));
|
|
3229
3447
|
const collapseDetailRow = (rowKey, viewIndex) => detailRows.setExpandedAt(rowKey, viewIndex, false);
|
|
3230
|
-
const renderLabelRowContent =
|
|
3448
|
+
const renderLabelRowContent = createMemo10(() => {
|
|
3231
3449
|
const render = labelRender();
|
|
3232
3450
|
return render ? (ctx) => render(ctx) : (ctx) => <span class="ssg-label-row-content--default ssg-label-row-default">
|
|
3233
3451
|
<span class="ssg-label-row-text">{ctx.label}</span>
|
|
@@ -3237,7 +3455,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3237
3455
|
const className = labelRowClassName();
|
|
3238
3456
|
return typeof className === "function" ? className(labelRow.row) : className;
|
|
3239
3457
|
};
|
|
3240
|
-
const labelRowLayerCenter =
|
|
3458
|
+
const labelRowLayerCenter = createMemo10(
|
|
3241
3459
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3242
3460
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3243
3461
|
renderContent: renderLabelRowContent(),
|
|
@@ -3246,7 +3464,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3246
3464
|
resolveRowSlot: resolveLabelRowSlot
|
|
3247
3465
|
} : void 0
|
|
3248
3466
|
);
|
|
3249
|
-
const labelRowLayerBand =
|
|
3467
|
+
const labelRowLayerBand = createMemo10(
|
|
3250
3468
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3251
3469
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3252
3470
|
renderContent: null,
|
|
@@ -3255,11 +3473,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3255
3473
|
resolveRowSlot: resolveLabelRowSlot
|
|
3256
3474
|
} : void 0
|
|
3257
3475
|
);
|
|
3258
|
-
const stickyLabelSlot =
|
|
3476
|
+
const stickyLabelSlot = createMemo10(() => {
|
|
3259
3477
|
const entry = stickyLabelEntry();
|
|
3260
3478
|
return resolveSlotProps2(entry ? resolveLabelRowSlot(entry.labelRow) : void 0);
|
|
3261
3479
|
});
|
|
3262
|
-
const labelRowExport =
|
|
3480
|
+
const labelRowExport = createMemo10(() => {
|
|
3263
3481
|
const isLabelRow = labelIsLabelRow();
|
|
3264
3482
|
const getLabel = labelGetLabel();
|
|
3265
3483
|
return labelRowEnabled() && isLabelRow && getLabel ? { isLabelRow, getLabel, exportText: labelExportText() } : void 0;
|
|
@@ -3296,11 +3514,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3296
3514
|
"effect",
|
|
3297
3515
|
"activeCellNotifier"
|
|
3298
3516
|
);
|
|
3517
|
+
const edit = createEditController();
|
|
3299
3518
|
const pointer = createPointerInteractionsController();
|
|
3300
3519
|
connectController(pointer, () => ({
|
|
3301
3520
|
gridRootRef,
|
|
3302
3521
|
bodyScrollRef,
|
|
3303
3522
|
onCellDoubleClickRef: cellDoubleClickRef,
|
|
3523
|
+
// 押してフォーカスをルートへ移した後、開いたままの custom エディタの編集を終える(1.4.1 / AP-11)。
|
|
3524
|
+
endEditLeftOpen: edit.endEditLeftOpen,
|
|
3304
3525
|
scrollContainerRef,
|
|
3305
3526
|
leftPaneScrollRef,
|
|
3306
3527
|
rightPaneScrollRef,
|
|
@@ -3356,7 +3577,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3356
3577
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
3357
3578
|
const cells = createCellCommands();
|
|
3358
3579
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
3359
|
-
const orderedColumnKeys =
|
|
3580
|
+
const orderedColumnKeys = createMemo10(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
3360
3581
|
const clipboard = createClipboardController();
|
|
3361
3582
|
connectController(clipboard, () => ({
|
|
3362
3583
|
rows: rows(),
|
|
@@ -3378,8 +3599,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3378
3599
|
sort: state.sort,
|
|
3379
3600
|
filters: state.filters,
|
|
3380
3601
|
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
3381
|
-
viewRowCount:
|
|
3382
|
-
columns:
|
|
3602
|
+
viewRowCount: untrack13(viewRowCount),
|
|
3603
|
+
columns: untrack13(orderedColumnKeys)
|
|
3383
3604
|
}
|
|
3384
3605
|
}
|
|
3385
3606
|
});
|
|
@@ -3395,7 +3616,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3395
3616
|
isRowExportable: props.isRowExportable,
|
|
3396
3617
|
dispatch
|
|
3397
3618
|
}), "render", "clipboard");
|
|
3398
|
-
const isWholeGridSelected =
|
|
3619
|
+
const isWholeGridSelected = createMemo10(
|
|
3399
3620
|
() => computeIsWholeGridSelected(ui().selection, viewRowCount(), visibleColumns().length)
|
|
3400
3621
|
);
|
|
3401
3622
|
const fillHandleFeature2 = features.fillHandle;
|
|
@@ -3430,13 +3651,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3430
3651
|
const pageHeight = Math.max(viewportHeight() - headerHeight(), rowHeight());
|
|
3431
3652
|
return resolvePageTargetRow(vertical().rowMetrics, fromRow, direction, pageHeight);
|
|
3432
3653
|
};
|
|
3433
|
-
const findEnabled =
|
|
3434
|
-
const findOptions =
|
|
3435
|
-
const findShortcut =
|
|
3654
|
+
const findEnabled = createMemo10(() => props.find !== false && props.find !== void 0 && findFeature2 !== void 0);
|
|
3655
|
+
const findOptions = createMemo10(() => typeof props.find === "object" ? props.find : null);
|
|
3656
|
+
const findShortcut = createMemo10(() => findEnabled() && (findOptions()?.shortcut ?? true));
|
|
3436
3657
|
const findSnapshot = createExternalStoreSignal(engine.find, "findStore");
|
|
3437
3658
|
const FindBar = findFeature2?.FindBar;
|
|
3438
|
-
const findIndex =
|
|
3439
|
-
const findCurrentIndex =
|
|
3659
|
+
const findIndex = createMemo10(() => findSnapshot().index);
|
|
3660
|
+
const findCurrentIndex = createMemo10(() => findSnapshot().currentIndex);
|
|
3440
3661
|
connectController(engine.find, () => ({
|
|
3441
3662
|
enabled: findEnabled(),
|
|
3442
3663
|
rowModel: rowModel(),
|
|
@@ -3477,13 +3698,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3477
3698
|
});
|
|
3478
3699
|
const columnMenuEnabled = () => enableColumnMenu() && columnMenu !== void 0;
|
|
3479
3700
|
const openColumnMenuFromButton = columnMenu ? (column, event) => {
|
|
3480
|
-
if (filterPopover &&
|
|
3701
|
+
if (filterPopover && untrack13(filterPopover.isOpen) && event.button === 0) {
|
|
3481
3702
|
filterPopover.close();
|
|
3482
3703
|
}
|
|
3483
3704
|
columnMenu.openFromButton(column, event);
|
|
3484
3705
|
} : void 0;
|
|
3485
3706
|
const openColumnMenuForCell = (col) => {
|
|
3486
|
-
const column =
|
|
3707
|
+
const column = untrack13(orderedColumns)[col];
|
|
3487
3708
|
const root = gridRootRef.current;
|
|
3488
3709
|
if (!columnMenu || !column || !root || isSyntheticColumnKey2(column.key)) {
|
|
3489
3710
|
return false;
|
|
@@ -3522,7 +3743,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3522
3743
|
if (!toolPanel) {
|
|
3523
3744
|
return;
|
|
3524
3745
|
}
|
|
3525
|
-
if (
|
|
3746
|
+
if (untrack13(toolPanel.activeTab) === "filter") {
|
|
3526
3747
|
toolPanel.close();
|
|
3527
3748
|
} else {
|
|
3528
3749
|
toolPanel.open("filter");
|
|
@@ -3535,7 +3756,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3535
3756
|
let keyboardContextMenu = null;
|
|
3536
3757
|
const openContextMenuForCell = (cell) => {
|
|
3537
3758
|
const root = gridRootRef.current;
|
|
3538
|
-
const columnsNow =
|
|
3759
|
+
const columnsNow = untrack13(orderedColumns);
|
|
3539
3760
|
const column = columnsNow[cell.col];
|
|
3540
3761
|
const getItems = props.getContextMenuItems;
|
|
3541
3762
|
if (!contextMenuActive() || !contextMenuFeature2 || !contextMenu || !getItems || !root || !column) {
|
|
@@ -3545,12 +3766,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3545
3766
|
root.querySelectorAll(`[data-row-index="${cell.row}"] [data-ssg-col-key]`)
|
|
3546
3767
|
).find((element) => element.dataset.ssgColKey === column.key && !isInsideDetailCardOf(root, element));
|
|
3547
3768
|
const rect = (cellEl ?? root).getBoundingClientRect();
|
|
3548
|
-
const state =
|
|
3769
|
+
const state = untrack13(ui);
|
|
3549
3770
|
const params = contextMenuFeature2.buildCellContextMenuParams({
|
|
3550
3771
|
cell,
|
|
3551
3772
|
clientX: rect.left,
|
|
3552
3773
|
clientY: cellEl ? rect.bottom : rect.top,
|
|
3553
|
-
rowModel:
|
|
3774
|
+
rowModel: untrack13(rowModel),
|
|
3554
3775
|
orderedColumns: columnsNow,
|
|
3555
3776
|
selection: state.selection,
|
|
3556
3777
|
activeCell: state.activeCell
|
|
@@ -3606,17 +3827,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3606
3827
|
}
|
|
3607
3828
|
return;
|
|
3608
3829
|
}
|
|
3609
|
-
const activeCell =
|
|
3830
|
+
const activeCell = untrack13(ui).activeCell;
|
|
3610
3831
|
if (activeCell && openContextMenuForCell(activeCell)) {
|
|
3611
3832
|
event.preventDefault();
|
|
3612
3833
|
}
|
|
3613
3834
|
return;
|
|
3614
3835
|
}
|
|
3615
|
-
const state =
|
|
3836
|
+
const state = untrack13(ui);
|
|
3616
3837
|
const params = contextMenuFeature2.buildBodyContextMenuParams({
|
|
3617
3838
|
event,
|
|
3618
|
-
rowModel:
|
|
3619
|
-
orderedColumns:
|
|
3839
|
+
rowModel: untrack13(rowModel),
|
|
3840
|
+
orderedColumns: untrack13(orderedColumns),
|
|
3620
3841
|
selection: state.selection,
|
|
3621
3842
|
activeCell: state.activeCell
|
|
3622
3843
|
});
|
|
@@ -3633,16 +3854,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3633
3854
|
}
|
|
3634
3855
|
contextMenu.open(params, items);
|
|
3635
3856
|
};
|
|
3636
|
-
const contextMenuView =
|
|
3637
|
-
const
|
|
3638
|
-
if (!
|
|
3857
|
+
const contextMenuView = createMemo10(() => {
|
|
3858
|
+
const snapshot2 = contextMenu?.snapshot();
|
|
3859
|
+
if (!snapshot2?.state || !snapshot2.layout) {
|
|
3639
3860
|
return null;
|
|
3640
3861
|
}
|
|
3641
3862
|
const texts = localeTexts();
|
|
3642
3863
|
return {
|
|
3643
|
-
items:
|
|
3644
|
-
layout:
|
|
3645
|
-
ariaLabel:
|
|
3864
|
+
items: snapshot2.state.items,
|
|
3865
|
+
layout: snapshot2.layout,
|
|
3866
|
+
ariaLabel: snapshot2.state.params.target.type === "rowHeader" ? texts.contextMenuRow : texts.contextMenuCell
|
|
3646
3867
|
};
|
|
3647
3868
|
});
|
|
3648
3869
|
const keyboard = createKeyboardController();
|
|
@@ -3676,7 +3897,6 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3676
3897
|
// 最終列の Tab: その行のカードが開いていればカードの最初の要素へ、無ければ表の直後の目印から既定の Tab(段階 2 C-N2 / F-10)。
|
|
3677
3898
|
onTabPastLastColumn: detailRows.handleTabPastLastColumn
|
|
3678
3899
|
}), "render", "keyboard");
|
|
3679
|
-
const edit = createEditController();
|
|
3680
3900
|
connectController(edit, () => ({
|
|
3681
3901
|
uiState: ui(),
|
|
3682
3902
|
rows: rows(),
|
|
@@ -3708,7 +3928,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3708
3928
|
startEditWithValue: edit.startEditWithValue,
|
|
3709
3929
|
dispatch
|
|
3710
3930
|
}), "render", "cells");
|
|
3711
|
-
const imeDirectInputEnabled =
|
|
3931
|
+
const imeDirectInputEnabled = createMemo10(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
3712
3932
|
connectController(
|
|
3713
3933
|
engine.imeInput,
|
|
3714
3934
|
() => {
|
|
@@ -3719,27 +3939,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3719
3939
|
editing: ui().editingCell !== null,
|
|
3720
3940
|
activeCell: ui().activeCell,
|
|
3721
3941
|
resolveCell: (cell) => {
|
|
3722
|
-
const column =
|
|
3942
|
+
const column = untrack13(orderedColumns)[cell.col];
|
|
3723
3943
|
return column ? { colKey: column.key, align: column.align } : null;
|
|
3724
3944
|
},
|
|
3725
3945
|
canStartEdit: (cell) => imeFeature?.canStartImeEdit(
|
|
3726
3946
|
{
|
|
3727
|
-
rowModel:
|
|
3728
|
-
columns:
|
|
3729
|
-
readOnly:
|
|
3730
|
-
canEditCell:
|
|
3947
|
+
rowModel: untrack13(rowModel),
|
|
3948
|
+
columns: untrack13(orderedColumns),
|
|
3949
|
+
readOnly: untrack13(readOnly),
|
|
3950
|
+
canEditCell: untrack13(canEditCell)
|
|
3731
3951
|
},
|
|
3732
3952
|
cell
|
|
3733
3953
|
) === true,
|
|
3734
3954
|
startEdit: edit.startEditWithValue,
|
|
3735
3955
|
// number の列は確定した文字を半角の数値の表記へ直して編集を始めます(読めない変換は捨てる)。
|
|
3736
|
-
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(
|
|
3956
|
+
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack13(orderedColumns), cell, text) : text
|
|
3737
3957
|
};
|
|
3738
3958
|
},
|
|
3739
3959
|
"effect",
|
|
3740
3960
|
"imeInput"
|
|
3741
3961
|
);
|
|
3742
|
-
|
|
3962
|
+
createEffect4(imeDirectInputEnabled, (enabled) => {
|
|
3743
3963
|
if (!enabled) {
|
|
3744
3964
|
engine.imeInput.attach(null);
|
|
3745
3965
|
}
|
|
@@ -3756,7 +3976,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3756
3976
|
isClaimedTarget: (target, root) => {
|
|
3757
3977
|
const state = store.getState();
|
|
3758
3978
|
if (!root.contains(target)) {
|
|
3759
|
-
const popupOpen =
|
|
3979
|
+
const popupOpen = untrack13(isAnyGridPopupOpen);
|
|
3760
3980
|
if (target.closest(GRID_POPUP_SELECTOR) !== null) {
|
|
3761
3981
|
return popupOpen || state.editingCell !== null;
|
|
3762
3982
|
}
|
|
@@ -3767,13 +3987,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3767
3987
|
return true;
|
|
3768
3988
|
}
|
|
3769
3989
|
if (target === root || target.hasAttribute("data-ssg-ime-input")) {
|
|
3770
|
-
return state.editingCell !== null || isClearableSelection(state.selection) ||
|
|
3990
|
+
return state.editingCell !== null || isClearableSelection(state.selection) || untrack13(copiedSelection) !== null;
|
|
3771
3991
|
}
|
|
3772
3992
|
return false;
|
|
3773
3993
|
}
|
|
3774
3994
|
}), "render", "escapeClaim");
|
|
3775
3995
|
const handleShellKeyDown = (event) => {
|
|
3776
|
-
if (!
|
|
3996
|
+
if (!untrack13(isAnyGridPopupOpen)) {
|
|
3777
3997
|
handleRootKeyDown(event);
|
|
3778
3998
|
}
|
|
3779
3999
|
if (isEscapeClaimedByGrid(event)) {
|
|
@@ -3826,7 +4046,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3826
4046
|
groupColumns: activeGroupColumns,
|
|
3827
4047
|
localeTexts
|
|
3828
4048
|
});
|
|
3829
|
-
const columnChooserItems =
|
|
4049
|
+
const columnChooserItems = createMemo10(
|
|
3830
4050
|
() => columns().map((column) => ({
|
|
3831
4051
|
key: column.key,
|
|
3832
4052
|
title: column.title || column.key,
|
|
@@ -3836,11 +4056,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3836
4056
|
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
3837
4057
|
}))
|
|
3838
4058
|
);
|
|
3839
|
-
const sortManagerColumns =
|
|
4059
|
+
const sortManagerColumns = createMemo10(
|
|
3840
4060
|
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
3841
4061
|
);
|
|
3842
4062
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
3843
|
-
const toolPanelTabs =
|
|
4063
|
+
const toolPanelTabs = createMemo10(
|
|
3844
4064
|
() => (toolPanel?.availableTabs() ?? []).map((tab) => {
|
|
3845
4065
|
const texts = localeTexts();
|
|
3846
4066
|
if (tab === "filter") {
|
|
@@ -3856,7 +4076,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3856
4076
|
return { tab, label: texts.toolPanelColumns };
|
|
3857
4077
|
})
|
|
3858
4078
|
);
|
|
3859
|
-
const columnMenuGroupingAvailable =
|
|
4079
|
+
const columnMenuGroupingAvailable = createMemo10(
|
|
3860
4080
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
3861
4081
|
);
|
|
3862
4082
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
@@ -3874,7 +4094,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3874
4094
|
ghostSlot: slots().dragGhost,
|
|
3875
4095
|
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
3876
4096
|
}));
|
|
3877
|
-
const columnDragHandler =
|
|
4097
|
+
const columnDragHandler = createMemo10(
|
|
3878
4098
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
3879
4099
|
);
|
|
3880
4100
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
@@ -3989,6 +4209,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3989
4209
|
scrollContainerRef,
|
|
3990
4210
|
bodyScrollRef,
|
|
3991
4211
|
gridRootRef,
|
|
4212
|
+
// 追加(1.4.1 / AP-11 のレビュー): フォーカスを移した後に、開いたままの custom エディタの編集を終える。
|
|
4213
|
+
endEditLeftOpen: edit.endEditLeftOpen,
|
|
3992
4214
|
commitRowMove: commitRowMoveFromDrag,
|
|
3993
4215
|
ghostSlot: slots().dragGhost,
|
|
3994
4216
|
motion: resolvedMotion() === "off" ? "ghost" : props.rowDragMotion ?? "ghost"
|
|
@@ -4016,6 +4238,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4016
4238
|
return;
|
|
4017
4239
|
}
|
|
4018
4240
|
gridRootRef.current?.focus({ preventScroll: true });
|
|
4241
|
+
edit.endEditLeftOpen();
|
|
4019
4242
|
if (enableSelectAllRows()) {
|
|
4020
4243
|
rowSelectionCommands.handleToggleSelectAllRows();
|
|
4021
4244
|
return;
|
|
@@ -4095,7 +4318,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4095
4318
|
return engine.scrollSync.markApiScroll();
|
|
4096
4319
|
}
|
|
4097
4320
|
}), "render", "gridApi");
|
|
4098
|
-
|
|
4321
|
+
createEffect4(
|
|
4099
4322
|
() => vertical().physicalBodyHeight,
|
|
4100
4323
|
() => {
|
|
4101
4324
|
engine.gridApi.settleBottomPin();
|
|
@@ -4103,7 +4326,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4103
4326
|
{ name: "gridApiBottomPin" }
|
|
4104
4327
|
);
|
|
4105
4328
|
const handleCallBeforeMountWarned = { current: false };
|
|
4106
|
-
applyHandleRef(
|
|
4329
|
+
applyHandleRef(untrack13(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4107
4330
|
if (mountGate.done) {
|
|
4108
4331
|
return;
|
|
4109
4332
|
}
|
|
@@ -4150,14 +4373,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4150
4373
|
element.removeEventListener("keydown", onKey, { capture: true });
|
|
4151
4374
|
};
|
|
4152
4375
|
});
|
|
4153
|
-
const columnNamer =
|
|
4376
|
+
const columnNamer = createMemo10(
|
|
4154
4377
|
() => createDataColumnNamer(orderedColumns(), {
|
|
4155
4378
|
detail: localeTexts().detailColumnName,
|
|
4156
4379
|
rowDrag: localeTexts().rowDragColumnName
|
|
4157
4380
|
})
|
|
4158
4381
|
);
|
|
4159
|
-
const rowNumberer =
|
|
4160
|
-
const slotContextBase =
|
|
4382
|
+
const rowNumberer = createMemo10(() => createDataRowNumberer(labelViewIndexes()));
|
|
4383
|
+
const slotContextBase = createMemo10(() => ({
|
|
4161
4384
|
rows: rows(),
|
|
4162
4385
|
columns: props.columns,
|
|
4163
4386
|
visibleColumns: visibleColumns(),
|
|
@@ -4167,7 +4390,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4167
4390
|
activeCell: ui().activeCell,
|
|
4168
4391
|
selection: ui().selection
|
|
4169
4392
|
}));
|
|
4170
|
-
const derivedSummary =
|
|
4393
|
+
const derivedSummary = createMemo10(() => {
|
|
4171
4394
|
const summary = buildGridDerivedSummary(
|
|
4172
4395
|
filteringAvailable ? slotContextBase() : { ...slotContextBase(), globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4173
4396
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
@@ -4189,7 +4412,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4189
4412
|
orderedColumns: orderedColumns(),
|
|
4190
4413
|
rowModel: rowModel()
|
|
4191
4414
|
})) : () => null;
|
|
4192
|
-
const
|
|
4415
|
+
const liveDerivedSummary = createLiveObject(DERIVED_SUMMARY_KEYS, derivedSummary);
|
|
4416
|
+
const slotContext = createMemo10(() => {
|
|
4193
4417
|
const filteredRows = getFilteredRows();
|
|
4194
4418
|
return {
|
|
4195
4419
|
...slotContextBase(),
|
|
@@ -4197,20 +4421,20 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4197
4421
|
return filteredRows();
|
|
4198
4422
|
},
|
|
4199
4423
|
setGlobalFilterText,
|
|
4200
|
-
derivedSummary:
|
|
4424
|
+
derivedSummary: liveDerivedSummary,
|
|
4201
4425
|
globalFilterStatus: globalFilterStatus(),
|
|
4202
4426
|
globalFilterProgress: globalFilterProgress(),
|
|
4203
4427
|
selectionAggregates: selectionAggregates()
|
|
4204
4428
|
};
|
|
4205
4429
|
});
|
|
4206
4430
|
const liveSlotContext = createLiveObject(SLOT_CONTEXT_KEYS, slotContext);
|
|
4207
|
-
const renderTopBarFn =
|
|
4208
|
-
const renderBottomBarFn =
|
|
4209
|
-
const customTopBar =
|
|
4431
|
+
const renderTopBarFn = createMemo10(() => props.renderTopBar);
|
|
4432
|
+
const renderBottomBarFn = createMemo10(() => props.renderBottomBar);
|
|
4433
|
+
const customTopBar = createMemo10(() => {
|
|
4210
4434
|
const render = renderTopBarFn();
|
|
4211
4435
|
return render ? render(liveSlotContext) : void 0;
|
|
4212
4436
|
});
|
|
4213
|
-
const customBottomBar =
|
|
4437
|
+
const customBottomBar = createMemo10(() => {
|
|
4214
4438
|
const render = renderBottomBarFn();
|
|
4215
4439
|
return render ? render(liveSlotContext) : void 0;
|
|
4216
4440
|
});
|
|
@@ -4252,7 +4476,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4252
4476
|
{customBottomBar()}
|
|
4253
4477
|
</Show11>
|
|
4254
4478
|
</Show11>;
|
|
4255
|
-
const editorSession =
|
|
4479
|
+
const editorSession = createMemo10((previous) => {
|
|
4256
4480
|
const cell = ui().editingCell;
|
|
4257
4481
|
if (cell === null) {
|
|
4258
4482
|
return null;
|
|
@@ -4280,12 +4504,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4280
4504
|
const rekeyed = !Object.is(identity.rowKey, previous.identity.rowKey) || identity.columnKey !== previous.identity.columnKey;
|
|
4281
4505
|
return { id: rekeyed ? previous.id + 1 : previous.id, identity };
|
|
4282
4506
|
});
|
|
4283
|
-
const editorSessionId =
|
|
4284
|
-
const editingColumn =
|
|
4507
|
+
const editorSessionId = createMemo10(() => editorSession()?.id ?? null);
|
|
4508
|
+
const editingColumn = createMemo10(() => {
|
|
4285
4509
|
const cell = ui().editingCell;
|
|
4286
4510
|
return cell === null ? void 0 : orderedColumns()[cell.col];
|
|
4287
4511
|
});
|
|
4288
|
-
const editingSessionInfo =
|
|
4512
|
+
const editingSessionInfo = createMemo10(() => {
|
|
4289
4513
|
const cell = ui().editingCell;
|
|
4290
4514
|
if (cell === null) {
|
|
4291
4515
|
return null;
|
|
@@ -4312,13 +4536,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4312
4536
|
if (viewIndex < 0) {
|
|
4313
4537
|
return;
|
|
4314
4538
|
}
|
|
4315
|
-
const model =
|
|
4539
|
+
const model = untrack13(rowModel);
|
|
4316
4540
|
const row = model.getRow(viewIndex);
|
|
4317
4541
|
if (row === void 0) {
|
|
4318
4542
|
return;
|
|
4319
4543
|
}
|
|
4320
4544
|
writeCellValueTo(
|
|
4321
|
-
{ rows:
|
|
4545
|
+
{ rows: untrack13(rows), rowModel: model, handleRowsChange: untrack13(handleRowsChange), applyServerSideCellEdits: untrack13(applyServerSideCellEdits) },
|
|
4322
4546
|
viewIndex,
|
|
4323
4547
|
row,
|
|
4324
4548
|
column,
|
|
@@ -4331,7 +4555,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4331
4555
|
if (!RowDragHandle2 || !rowDrag) {
|
|
4332
4556
|
return null;
|
|
4333
4557
|
}
|
|
4334
|
-
const draggable =
|
|
4558
|
+
const draggable = createMemo10(() => {
|
|
4335
4559
|
const isRowDraggable = props.isRowDraggable;
|
|
4336
4560
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
4337
4561
|
});
|
|
@@ -4339,7 +4563,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4339
4563
|
<RowDragHandle2
|
|
4340
4564
|
operable={rowDragOperable()}
|
|
4341
4565
|
tooltip={rowDragOperable() ? rowDragTexts().dragRow : rowDragTexts().dragRowDisabled}
|
|
4342
|
-
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(
|
|
4566
|
+
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(untrack13(() => cell.rowIndex), event)}
|
|
4343
4567
|
/>
|
|
4344
4568
|
</Show11>;
|
|
4345
4569
|
};
|
|
@@ -4358,12 +4582,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4358
4582
|
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4359
4583
|
/>;
|
|
4360
4584
|
}
|
|
4361
|
-
const row = currentRow();
|
|
4362
|
-
const value = getCellValue2(row, unbound);
|
|
4363
4585
|
if (column.renderCell) {
|
|
4364
|
-
const
|
|
4365
|
-
const
|
|
4366
|
-
|
|
4586
|
+
const cellValue = createMemo10(() => getCellValue2(currentRow(), unbound));
|
|
4587
|
+
const expanded = createMemo10(() => ui().expandedDetailRowKeys.has(cell.rowKey));
|
|
4588
|
+
const expandable = createMemo10(
|
|
4589
|
+
() => isDetailRowExpandable(detailDrawable(), props.detailRow?.isExpandable, currentRow(), cell.rowKey, cell.sourceRowIndex)
|
|
4367
4590
|
);
|
|
4368
4591
|
const detail = {
|
|
4369
4592
|
get expanded() {
|
|
@@ -4372,8 +4595,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4372
4595
|
get expandable() {
|
|
4373
4596
|
return expandable();
|
|
4374
4597
|
},
|
|
4375
|
-
toggle: () => detailRows.toggleAt(cell.rowKey,
|
|
4376
|
-
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey,
|
|
4598
|
+
toggle: () => detailRows.toggleAt(cell.rowKey, untrack13(() => cell.rowIndex)),
|
|
4599
|
+
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey, untrack13(() => cell.rowIndex), expanded2)
|
|
4377
4600
|
};
|
|
4378
4601
|
if (column.key === DETAIL_TOGGLE_COLUMN_KEY2) {
|
|
4379
4602
|
const rowNumber = () => {
|
|
@@ -4381,11 +4604,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4381
4604
|
return indexes ? resolveDataRowNumber2(indexes, cell.rowIndex) : cell.rowIndex + 1;
|
|
4382
4605
|
};
|
|
4383
4606
|
return <Show11 when={expandable()}>
|
|
4384
|
-
<DetailToggleButton detail={detail} rowNumber={rowNumber()} />
|
|
4607
|
+
<DetailToggleButton detail={detail} rowNumber={rowNumber()} onPress={edit.endEditLeftOpen} />
|
|
4385
4608
|
</Show11>;
|
|
4386
4609
|
}
|
|
4387
4610
|
return column.renderCell({
|
|
4388
|
-
row
|
|
4611
|
+
get row() {
|
|
4612
|
+
return currentRow();
|
|
4613
|
+
},
|
|
4389
4614
|
get rowIndex() {
|
|
4390
4615
|
return cell.rowIndex;
|
|
4391
4616
|
},
|
|
@@ -4399,7 +4624,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4399
4624
|
get detail() {
|
|
4400
4625
|
return detailRowEnabled() ? detail : void 0;
|
|
4401
4626
|
},
|
|
4402
|
-
value
|
|
4627
|
+
get value() {
|
|
4628
|
+
return cellValue();
|
|
4629
|
+
},
|
|
4403
4630
|
column,
|
|
4404
4631
|
get isActive() {
|
|
4405
4632
|
return cell.isActive;
|
|
@@ -4416,6 +4643,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4416
4643
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4417
4644
|
});
|
|
4418
4645
|
}
|
|
4646
|
+
const row = currentRow();
|
|
4647
|
+
const value = getCellValue2(row, unbound);
|
|
4419
4648
|
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4420
4649
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4421
4650
|
const highlightFind = (content) => {
|
|
@@ -4437,7 +4666,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4437
4666
|
const chips = formatRules?.chips;
|
|
4438
4667
|
if (conditionalFormatFeature2 && chips) {
|
|
4439
4668
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4440
|
-
const chip =
|
|
4669
|
+
const chip = createMemo10(
|
|
4441
4670
|
() => resolveChipSpec2(chips, {
|
|
4442
4671
|
row,
|
|
4443
4672
|
get rowIndex() {
|
|
@@ -4665,6 +4894,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4665
4894
|
onCommit={(value, direction) => edit.commitEdit(value, direction)}
|
|
4666
4895
|
onCancel={edit.cancelEdit}
|
|
4667
4896
|
onRegisterFlush={edit.registerDraftFlush}
|
|
4897
|
+
onRegisterLateCommit={edit.registerLateCommitReceiver}
|
|
4668
4898
|
align={editingColumn()?.align}
|
|
4669
4899
|
enterMove={props.editorEnterMove}
|
|
4670
4900
|
domId={cellEditorDomId}
|
|
@@ -4750,11 +4980,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4750
4980
|
};
|
|
4751
4981
|
const activeDescendantId = () => activeCellRendered() ? activeCellDomId : void 0;
|
|
4752
4982
|
const emptyStateText = () => (isServerSide() ? !filterConditionsActive() : rows().length === 0 && !manualFilterActive()) ? props.noRowsText ?? localeTexts().noRows : props.noMatchingRowsText ?? localeTexts().noMatchingRows;
|
|
4983
|
+
const rootStyle = () => ({
|
|
4984
|
+
...toSolidStyle(heightLayout().rootStyle),
|
|
4985
|
+
...slots().root?.style,
|
|
4986
|
+
...props.style
|
|
4987
|
+
});
|
|
4753
4988
|
const shellView = <GridLocaleTextContext value={localeTexts}>
|
|
4754
4989
|
<GridPortalContext value={portalContext}>
|
|
4755
4990
|
<div
|
|
4756
4991
|
class={[
|
|
4757
|
-
"ssg-root",
|
|
4992
|
+
mode === "hiddenFrame" ? void 0 : "ssg-root",
|
|
4758
4993
|
themeClassName(),
|
|
4759
4994
|
slots().root?.className,
|
|
4760
4995
|
props.className,
|
|
@@ -4770,7 +5005,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4770
5005
|
"ssg-root--hover-cross": hoverCross()
|
|
4771
5006
|
}
|
|
4772
5007
|
]}
|
|
4773
|
-
style={{
|
|
5008
|
+
style={{
|
|
5009
|
+
...rootStyle(),
|
|
5010
|
+
...mode === "hiddenFrame" ? { display: "none" } : void 0
|
|
5011
|
+
}}
|
|
5012
|
+
hidden={mode === "hiddenFrame" ? true : void 0}
|
|
5013
|
+
data-ssg-ssr={mode === "hiddenFrame" ? "" : void 0}
|
|
5014
|
+
data-ssg-ssr-snapshot={mode === "snapshot" ? "" : void 0}
|
|
4774
5015
|
>
|
|
4775
5016
|
{topBar()}
|
|
4776
5017
|
{
|
|
@@ -4798,7 +5039,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4798
5039
|
data-ssg-has-active-cell={ui().activeCell === null ? void 0 : ""}
|
|
4799
5040
|
onKeyDown={handleShellKeyDown}
|
|
4800
5041
|
onPaste={(event) => {
|
|
4801
|
-
if (
|
|
5042
|
+
if (untrack13(isAnyGridPopupOpen)) {
|
|
4802
5043
|
return;
|
|
4803
5044
|
}
|
|
4804
5045
|
clipboard.handlePaste({
|
|
@@ -4837,6 +5078,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4837
5078
|
onFocusIn={(event) => {
|
|
4838
5079
|
if (event.target === event.currentTarget) {
|
|
4839
5080
|
gridRootRef.current?.focus({ preventScroll: true });
|
|
5081
|
+
edit.endEditLeftOpen();
|
|
4840
5082
|
}
|
|
4841
5083
|
}}
|
|
4842
5084
|
role="grid"
|
|
@@ -5074,7 +5316,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
5074
5316
|
{(tab) => <Show11 when={toolPanel.layout()}>
|
|
5075
5317
|
{(layout) => <Show11 when={toolPanelViews()}>
|
|
5076
5318
|
{(views) => {
|
|
5077
|
-
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } =
|
|
5319
|
+
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } = untrack13(views);
|
|
5078
5320
|
return <ToolPanel
|
|
5079
5321
|
popoverSlot={slots().popover}
|
|
5080
5322
|
themeClassName={portalClassName()}
|
|
@@ -5223,7 +5465,7 @@ var columnAutosizeFeature = {
|
|
|
5223
5465
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5224
5466
|
|
|
5225
5467
|
// src/primitives/columnMenu.ts
|
|
5226
|
-
import { createMemo as
|
|
5468
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
5227
5469
|
import {
|
|
5228
5470
|
createColumnMenuController
|
|
5229
5471
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5234,17 +5476,17 @@ function createColumnMenu(inputs) {
|
|
|
5234
5476
|
enableColumnMenu: inputs.enableColumnMenu(),
|
|
5235
5477
|
gridRootRef: inputs.gridRootRef
|
|
5236
5478
|
}), "render", "columnMenu");
|
|
5237
|
-
const
|
|
5238
|
-
const openedColumnKey =
|
|
5239
|
-
const openedColumn =
|
|
5479
|
+
const snapshot2 = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5480
|
+
const openedColumnKey = createMemo11(() => snapshot2().columnKey);
|
|
5481
|
+
const openedColumn = createMemo11(() => {
|
|
5240
5482
|
const key = openedColumnKey();
|
|
5241
5483
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5242
5484
|
});
|
|
5243
5485
|
return {
|
|
5244
5486
|
openedColumnKey,
|
|
5245
5487
|
openedColumn,
|
|
5246
|
-
layout:
|
|
5247
|
-
isOpen:
|
|
5488
|
+
layout: createMemo11(() => snapshot2().layout),
|
|
5489
|
+
isOpen: createMemo11(() => openedColumnKey() !== null),
|
|
5248
5490
|
panelRef: controller.panelRef,
|
|
5249
5491
|
openFromButton: controller.openFromButton,
|
|
5250
5492
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5255,7 +5497,7 @@ function createColumnMenu(inputs) {
|
|
|
5255
5497
|
}
|
|
5256
5498
|
|
|
5257
5499
|
// src/view/ColumnMenuPopover.tsx
|
|
5258
|
-
import { For as For6, Show as Show12, createEffect as
|
|
5500
|
+
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
5501
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5260
5502
|
var PINNED_ITEMS = [
|
|
5261
5503
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5273,21 +5515,21 @@ function ColumnMenuPopover(props) {
|
|
|
5273
5515
|
const texts = useFeatureLocaleText();
|
|
5274
5516
|
const portal = useGridPortal();
|
|
5275
5517
|
const container = portal.container();
|
|
5276
|
-
const [panel, setPanel] =
|
|
5518
|
+
const [panel, setPanel] = createSignal10();
|
|
5277
5519
|
let panelElement;
|
|
5278
|
-
|
|
5520
|
+
onCleanup9(() => {
|
|
5279
5521
|
if (props.panelRef.current === panelElement) {
|
|
5280
5522
|
props.panelRef.current = null;
|
|
5281
5523
|
}
|
|
5282
5524
|
});
|
|
5283
|
-
const layout =
|
|
5284
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5525
|
+
const layout = createMemo12(() => props.layout);
|
|
5526
|
+
const [openSubmenu, setOpenSubmenu] = createSignal10(null);
|
|
5285
5527
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5286
|
-
const isPinSubmenuOpen =
|
|
5528
|
+
const isPinSubmenuOpen = createMemo12(() => {
|
|
5287
5529
|
const current = openSubmenu();
|
|
5288
5530
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5289
5531
|
});
|
|
5290
|
-
|
|
5532
|
+
createEffect5(
|
|
5291
5533
|
() => props.columnKey,
|
|
5292
5534
|
() => {
|
|
5293
5535
|
setOpenSubmenu(null);
|
|
@@ -5298,8 +5540,8 @@ function ColumnMenuPopover(props) {
|
|
|
5298
5540
|
{ name: "columnMenuScrollReset" }
|
|
5299
5541
|
);
|
|
5300
5542
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5301
|
-
const submenuInline =
|
|
5302
|
-
const [pinSubmenu, setPinSubmenu] =
|
|
5543
|
+
const submenuInline = createMemo12(() => layout().maxHeight !== void 0);
|
|
5544
|
+
const [pinSubmenu, setPinSubmenu] = createSignal10();
|
|
5303
5545
|
let pinSubmenuElement;
|
|
5304
5546
|
createPortalTokens(
|
|
5305
5547
|
() => isPinSubmenuOpen() && !submenuInline() ? pinSubmenu() : void 0,
|
|
@@ -5316,7 +5558,7 @@ function ColumnMenuPopover(props) {
|
|
|
5316
5558
|
item?.focus();
|
|
5317
5559
|
return item != null;
|
|
5318
5560
|
};
|
|
5319
|
-
|
|
5561
|
+
createEffect5(isPinSubmenuOpen, (open) => {
|
|
5320
5562
|
if (!open) {
|
|
5321
5563
|
return;
|
|
5322
5564
|
}
|
|
@@ -5693,7 +5935,7 @@ var columnMenuFeature = {
|
|
|
5693
5935
|
};
|
|
5694
5936
|
|
|
5695
5937
|
// src/primitives/columnReorder.ts
|
|
5696
|
-
import { createEffect as
|
|
5938
|
+
import { createEffect as createEffect6 } from "solid-js";
|
|
5697
5939
|
import {
|
|
5698
5940
|
createColumnHeaderDragController
|
|
5699
5941
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnHeaderDragController";
|
|
@@ -5708,7 +5950,7 @@ function createColumnReorder(args) {
|
|
|
5708
5950
|
centerIndicatorRef,
|
|
5709
5951
|
rightIndicatorRef
|
|
5710
5952
|
}), "render", "columnReorder");
|
|
5711
|
-
|
|
5953
|
+
createEffect6(
|
|
5712
5954
|
() => args().paneLayout,
|
|
5713
5955
|
() => {
|
|
5714
5956
|
controller.applyReorderSettle();
|
|
@@ -5805,17 +6047,17 @@ import {
|
|
|
5805
6047
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5806
6048
|
|
|
5807
6049
|
// src/primitives/contextMenu.ts
|
|
5808
|
-
import { createMemo as
|
|
6050
|
+
import { createMemo as createMemo13 } from "solid-js";
|
|
5809
6051
|
import {
|
|
5810
6052
|
createContextMenuController
|
|
5811
6053
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
5812
6054
|
function createCellContextMenu(inputs) {
|
|
5813
6055
|
const controller = createContextMenuController();
|
|
5814
6056
|
connectController(controller, () => ({ gridRootRef: inputs.gridRootRef }), "render", "contextMenu");
|
|
5815
|
-
const
|
|
6057
|
+
const snapshot2 = createExternalStoreSignal(controller, "contextMenuStore");
|
|
5816
6058
|
return {
|
|
5817
|
-
snapshot,
|
|
5818
|
-
isOpen:
|
|
6059
|
+
snapshot: snapshot2,
|
|
6060
|
+
isOpen: createMemo13(() => snapshot2().state !== null),
|
|
5819
6061
|
open: controller.open,
|
|
5820
6062
|
close: controller.close,
|
|
5821
6063
|
panelRef: controller.panelRef
|
|
@@ -5823,19 +6065,19 @@ function createCellContextMenu(inputs) {
|
|
|
5823
6065
|
}
|
|
5824
6066
|
|
|
5825
6067
|
// src/view/CellContextMenuPopover.tsx
|
|
5826
|
-
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as
|
|
6068
|
+
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
6069
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5828
6070
|
function CellContextMenuPopover(props) {
|
|
5829
6071
|
const portal = useGridPortal();
|
|
5830
6072
|
const container = portal.container();
|
|
5831
|
-
const [panel, setPanel] =
|
|
6073
|
+
const [panel, setPanel] = createSignal11();
|
|
5832
6074
|
let panelElement;
|
|
5833
|
-
|
|
6075
|
+
onCleanup10(() => {
|
|
5834
6076
|
if (props.panelRef.current === panelElement) {
|
|
5835
6077
|
props.panelRef.current = null;
|
|
5836
6078
|
}
|
|
5837
6079
|
});
|
|
5838
|
-
const layout =
|
|
6080
|
+
const layout = createMemo14(() => props.layout);
|
|
5839
6081
|
const element = <Show14 when={container}>
|
|
5840
6082
|
{(mount) => <Portal3 mount={mount()}>
|
|
5841
6083
|
<div
|
|
@@ -5948,7 +6190,7 @@ var exportFeature = {
|
|
|
5948
6190
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5949
6191
|
|
|
5950
6192
|
// src/primitives/fillHandle.ts
|
|
5951
|
-
import { createMemo as
|
|
6193
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
5952
6194
|
import {
|
|
5953
6195
|
createFillHandleController
|
|
5954
6196
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -5966,11 +6208,11 @@ import {
|
|
|
5966
6208
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
5967
6209
|
function createFillHandle(inputs) {
|
|
5968
6210
|
const controller = createFillHandleController();
|
|
5969
|
-
const options =
|
|
6211
|
+
const options = createMemo15(() => {
|
|
5970
6212
|
const fillHandle = inputs.fillHandle();
|
|
5971
6213
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
5972
6214
|
});
|
|
5973
|
-
const enabled =
|
|
6215
|
+
const enabled = createMemo15(
|
|
5974
6216
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
5975
6217
|
);
|
|
5976
6218
|
connectController(controller, () => {
|
|
@@ -6007,18 +6249,18 @@ function createFillHandle(inputs) {
|
|
|
6007
6249
|
applyServerSideCellEdits: inputs.applyServerSideCellEdits()
|
|
6008
6250
|
};
|
|
6009
6251
|
}, "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 =
|
|
6252
|
+
const snapshot2 = createExternalStoreSignal(controller, "fillHandleStore");
|
|
6253
|
+
const rowMetrics = createMemo15(() => inputs.vertical().rowMetrics);
|
|
6254
|
+
const windowFirstRow = createMemo15(() => inputs.vertical().windowFirstRow);
|
|
6255
|
+
const windowLastRow = createMemo15(() => inputs.vertical().windowLastRow);
|
|
6256
|
+
const detailActive = createMemo15(() => inputs.vertical().detailActive);
|
|
6257
|
+
const detailExtras = createMemo15(() => inputs.vertical().detailExtras);
|
|
6258
|
+
const verticalScaleFactor = createMemo15(() => inputs.vertical().verticalScaleFactor);
|
|
6259
|
+
const paneLayout = createMemo15(inputs.paneLayout);
|
|
6260
|
+
const viewportHeight = createMemo15(inputs.viewportHeight);
|
|
6261
|
+
const scrollTop = createMemo15(inputs.scrollTop);
|
|
6262
|
+
const headerHeight = createMemo15(inputs.headerHeight);
|
|
6263
|
+
const corner = createMemo15(() => {
|
|
6022
6264
|
const ui = inputs.uiState();
|
|
6023
6265
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6024
6266
|
return null;
|
|
@@ -6031,8 +6273,8 @@ function createFillHandle(inputs) {
|
|
|
6031
6273
|
}
|
|
6032
6274
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6033
6275
|
});
|
|
6034
|
-
const previewSelection =
|
|
6035
|
-
const current =
|
|
6276
|
+
const previewSelection = createMemo15(() => {
|
|
6277
|
+
const current = snapshot2();
|
|
6036
6278
|
if (current.status !== "dragging" || current.target === null) {
|
|
6037
6279
|
return null;
|
|
6038
6280
|
}
|
|
@@ -6051,7 +6293,7 @@ function createFillHandle(inputs) {
|
|
|
6051
6293
|
}
|
|
6052
6294
|
};
|
|
6053
6295
|
});
|
|
6054
|
-
const previewGeometry =
|
|
6296
|
+
const previewGeometry = createMemo15(() => {
|
|
6055
6297
|
const selection = previewSelection();
|
|
6056
6298
|
if (selection === null) {
|
|
6057
6299
|
return null;
|
|
@@ -6084,8 +6326,8 @@ function createFillHandle(inputs) {
|
|
|
6084
6326
|
}
|
|
6085
6327
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6086
6328
|
};
|
|
6087
|
-
const chip =
|
|
6088
|
-
const current =
|
|
6329
|
+
const chip = createMemo15(() => {
|
|
6330
|
+
const current = snapshot2();
|
|
6089
6331
|
if (current.status !== "filled") {
|
|
6090
6332
|
return null;
|
|
6091
6333
|
}
|
|
@@ -6105,9 +6347,9 @@ function createFillHandle(inputs) {
|
|
|
6105
6347
|
});
|
|
6106
6348
|
return {
|
|
6107
6349
|
controller,
|
|
6108
|
-
snapshot,
|
|
6350
|
+
snapshot: snapshot2,
|
|
6109
6351
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6110
|
-
filling:
|
|
6352
|
+
filling: createMemo15(() => snapshot2().status === "dragging"),
|
|
6111
6353
|
corner,
|
|
6112
6354
|
previewRects,
|
|
6113
6355
|
chip
|
|
@@ -6115,7 +6357,7 @@ function createFillHandle(inputs) {
|
|
|
6115
6357
|
}
|
|
6116
6358
|
|
|
6117
6359
|
// src/view/FillHandleLayer.tsx
|
|
6118
|
-
import { For as For8, Show as Show15, createEffect as
|
|
6360
|
+
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as createMemo16, createSignal as createSignal12, onCleanup as onCleanup11 } from "solid-js";
|
|
6119
6361
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6120
6362
|
import { formatLocaleText as formatLocaleText7 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6121
6363
|
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
@@ -6129,9 +6371,9 @@ function FillHandleLayer(props) {
|
|
|
6129
6371
|
const current = props.fill.chip();
|
|
6130
6372
|
return current?.pane === props.pane ? current.position : null;
|
|
6131
6373
|
};
|
|
6132
|
-
const filled =
|
|
6133
|
-
const
|
|
6134
|
-
return
|
|
6374
|
+
const filled = createMemo16(() => {
|
|
6375
|
+
const snapshot2 = props.fill.snapshot();
|
|
6376
|
+
return snapshot2.status === "filled" ? snapshot2 : null;
|
|
6135
6377
|
});
|
|
6136
6378
|
return <>
|
|
6137
6379
|
{
|
|
@@ -6170,13 +6412,13 @@ function FillHandleLayer(props) {
|
|
|
6170
6412
|
/* 埋めたあとのボタン(左上の位置)。 */
|
|
6171
6413
|
}
|
|
6172
6414
|
<Show15 when={filled()}>
|
|
6173
|
-
{(
|
|
6415
|
+
{(snapshot2) => <Show15 when={chip()}>
|
|
6174
6416
|
{(position) => <FillOptionsChip
|
|
6175
6417
|
fill={props.fill}
|
|
6176
6418
|
x={props.leadingWidth + position().x}
|
|
6177
6419
|
y={props.headerHeight + position().y - props.baseOffset}
|
|
6178
|
-
kind={
|
|
6179
|
-
menuOpen={
|
|
6420
|
+
kind={snapshot2().kind}
|
|
6421
|
+
menuOpen={snapshot2().menu !== null}
|
|
6180
6422
|
/>}
|
|
6181
6423
|
</Show15>}
|
|
6182
6424
|
</Show15>
|
|
@@ -6186,7 +6428,7 @@ function FillOptionsChip(props) {
|
|
|
6186
6428
|
const texts = useFeatureLocaleText();
|
|
6187
6429
|
const { chipElement } = props.fill.controller;
|
|
6188
6430
|
let element;
|
|
6189
|
-
|
|
6431
|
+
onCleanup11(() => {
|
|
6190
6432
|
if (chipElement.current === element) {
|
|
6191
6433
|
chipElement.current = null;
|
|
6192
6434
|
}
|
|
@@ -6240,15 +6482,15 @@ function FillOptionsMenu(props) {
|
|
|
6240
6482
|
const texts = useFeatureLocaleText();
|
|
6241
6483
|
const portal = useGridPortal();
|
|
6242
6484
|
const container = portal.container();
|
|
6243
|
-
const [panel, setPanel] =
|
|
6485
|
+
const [panel, setPanel] = createSignal12();
|
|
6244
6486
|
const { menuPanel } = props.fill.controller;
|
|
6245
6487
|
let panelElement;
|
|
6246
|
-
|
|
6488
|
+
onCleanup11(() => {
|
|
6247
6489
|
if (menuPanel.current === panelElement) {
|
|
6248
6490
|
menuPanel.current = null;
|
|
6249
6491
|
}
|
|
6250
6492
|
});
|
|
6251
|
-
|
|
6493
|
+
createEffect7(panel, (element2) => {
|
|
6252
6494
|
element2?.querySelector('[aria-checked="true"]')?.focus({ preventScroll: true });
|
|
6253
6495
|
}, { name: "fillMenuFocus" });
|
|
6254
6496
|
const handleKeyDown = (event) => {
|
|
@@ -6316,9 +6558,9 @@ function FillTooltip(props) {
|
|
|
6316
6558
|
subscribe: props.fill.controller.subscribePointer,
|
|
6317
6559
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6318
6560
|
}, "fillPointerStore");
|
|
6319
|
-
const visible =
|
|
6320
|
-
const container =
|
|
6321
|
-
const [tooltip, setTooltip] =
|
|
6561
|
+
const visible = createMemo16(() => pointer() !== null);
|
|
6562
|
+
const container = createMemo16(() => visible() ? portal.container() : null);
|
|
6563
|
+
const [tooltip, setTooltip] = createSignal12();
|
|
6322
6564
|
const element = <Show15 when={container()}>
|
|
6323
6565
|
{(mount) => <Portal4 mount={mount()}>
|
|
6324
6566
|
<div
|
|
@@ -6339,22 +6581,22 @@ function FillTooltip(props) {
|
|
|
6339
6581
|
return element;
|
|
6340
6582
|
}
|
|
6341
6583
|
function FillHandlePortals(props) {
|
|
6342
|
-
const menu =
|
|
6343
|
-
const
|
|
6344
|
-
return
|
|
6584
|
+
const menu = createMemo16(() => {
|
|
6585
|
+
const snapshot2 = props.fill.snapshot();
|
|
6586
|
+
return snapshot2.status === "filled" && snapshot2.menu !== null ? snapshot2 : null;
|
|
6345
6587
|
});
|
|
6346
|
-
const tooltipText =
|
|
6347
|
-
const
|
|
6348
|
-
return
|
|
6588
|
+
const tooltipText = createMemo16(() => {
|
|
6589
|
+
const snapshot2 = props.fill.snapshot();
|
|
6590
|
+
return snapshot2.status === "dragging" ? snapshot2.previewText : null;
|
|
6349
6591
|
});
|
|
6350
6592
|
return <>
|
|
6351
6593
|
<Show15 when={menu()}>
|
|
6352
|
-
{(
|
|
6594
|
+
{(snapshot2) => <Show15 when={snapshot2().menu}>
|
|
6353
6595
|
{(layout) => <FillOptionsMenu
|
|
6354
6596
|
fill={props.fill}
|
|
6355
6597
|
layout={layout()}
|
|
6356
|
-
kind={
|
|
6357
|
-
seriesAvailable={
|
|
6598
|
+
kind={snapshot2().kind}
|
|
6599
|
+
seriesAvailable={snapshot2().seriesAvailable}
|
|
6358
6600
|
themeClassName={props.themeClassName}
|
|
6359
6601
|
/>}
|
|
6360
6602
|
</Show15>}
|
|
@@ -6381,7 +6623,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6381
6623
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6382
6624
|
|
|
6383
6625
|
// src/primitives/filterOrder.ts
|
|
6384
|
-
import { createMemo as
|
|
6626
|
+
import { createMemo as createMemo17 } from "solid-js";
|
|
6385
6627
|
import {
|
|
6386
6628
|
createGlobalFilteredOrderRunner,
|
|
6387
6629
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6394,11 +6636,11 @@ import {
|
|
|
6394
6636
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6395
6637
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6396
6638
|
function createFilterOrder(inputs) {
|
|
6397
|
-
const visibleColumns =
|
|
6398
|
-
const globalFilterColumns =
|
|
6399
|
-
const text =
|
|
6400
|
-
const needle =
|
|
6401
|
-
const key =
|
|
6639
|
+
const visibleColumns = createMemo17(() => inputs.visibleColumns());
|
|
6640
|
+
const globalFilterColumns = createMemo17(() => toGlobalFilterColumns(visibleColumns(), inputs.globalFilterMatch()));
|
|
6641
|
+
const text = createMemo17(() => inputs.globalFilterText());
|
|
6642
|
+
const needle = createMemo17(() => text().trim().toLowerCase());
|
|
6643
|
+
const key = createMemo17(
|
|
6402
6644
|
() => ({
|
|
6403
6645
|
rows: inputs.rows(),
|
|
6404
6646
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6408,30 +6650,30 @@ function createFilterOrder(inputs) {
|
|
|
6408
6650
|
{ equals: sameGlobalFilterKey }
|
|
6409
6651
|
);
|
|
6410
6652
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6411
|
-
const syncResult =
|
|
6653
|
+
const syncResult = createMemo17(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6412
6654
|
const runner = createGlobalFilteredOrderRunner();
|
|
6413
6655
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6414
|
-
const
|
|
6415
|
-
const result =
|
|
6416
|
-
const columnFilters =
|
|
6417
|
-
const relativeDateFilterActive =
|
|
6656
|
+
const snapshot2 = createExternalStoreSignal(runner, "globalFilterStore");
|
|
6657
|
+
const result = createMemo17(() => selectGlobalFilteredOrderResult(syncResult(), snapshot2(), key()));
|
|
6658
|
+
const columnFilters = createMemo17(() => inputs.columnFilters());
|
|
6659
|
+
const relativeDateFilterActive = createMemo17(
|
|
6418
6660
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6419
6661
|
);
|
|
6420
6662
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6421
6663
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6422
|
-
const relativeDateKey =
|
|
6664
|
+
const relativeDateKey = createMemo17(
|
|
6423
6665
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6424
6666
|
);
|
|
6425
6667
|
return {
|
|
6426
|
-
globalFilteredOrder:
|
|
6427
|
-
globalFilterStatus:
|
|
6428
|
-
globalFilterProgress:
|
|
6668
|
+
globalFilteredOrder: createMemo17(() => result().order),
|
|
6669
|
+
globalFilterStatus: createMemo17(() => result().status),
|
|
6670
|
+
globalFilterProgress: createMemo17(() => result().progress),
|
|
6429
6671
|
relativeDateKey
|
|
6430
6672
|
};
|
|
6431
6673
|
}
|
|
6432
6674
|
|
|
6433
6675
|
// src/primitives/filterPopover.ts
|
|
6434
|
-
import { createMemo as
|
|
6676
|
+
import { createMemo as createMemo18, createSignal as createSignal13, untrack as untrack14 } from "solid-js";
|
|
6435
6677
|
import {
|
|
6436
6678
|
createFilterPopoverController,
|
|
6437
6679
|
resolveOpenedFilterColumn
|
|
@@ -6443,7 +6685,7 @@ var NO_GROUP_COLUMNS = [];
|
|
|
6443
6685
|
function createFilterPopover(inputs) {
|
|
6444
6686
|
const controller = createFilterPopoverController();
|
|
6445
6687
|
const autoFilterTypeCache = /* @__PURE__ */ new Map();
|
|
6446
|
-
const resolveAutoColumnFilterType = (column) =>
|
|
6688
|
+
const resolveAutoColumnFilterType = (column) => untrack14(() => {
|
|
6447
6689
|
const currentValue = inputs.columnFilters()[column.key];
|
|
6448
6690
|
if (currentValue?.kind === "numberSet" || currentValue?.kind === "textSet" || currentValue?.kind === "dateSet" || currentValue?.kind === "text") {
|
|
6449
6691
|
return currentValue.kind;
|
|
@@ -6469,16 +6711,16 @@ function createFilterPopover(inputs) {
|
|
|
6469
6711
|
}
|
|
6470
6712
|
return result.filterType;
|
|
6471
6713
|
});
|
|
6472
|
-
const groupColumns =
|
|
6473
|
-
const popoverColumns =
|
|
6714
|
+
const groupColumns = createMemo18(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
6715
|
+
const popoverColumns = createMemo18(() => {
|
|
6474
6716
|
const groups = groupColumns();
|
|
6475
6717
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6476
6718
|
});
|
|
6477
|
-
const resolveAnchorColumnKey = (columnKey) =>
|
|
6478
|
-
const
|
|
6479
|
-
const state =
|
|
6480
|
-
const layout =
|
|
6481
|
-
const [panel, setPanel] =
|
|
6719
|
+
const resolveAnchorColumnKey = (columnKey) => untrack14(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6720
|
+
const snapshot2 = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6721
|
+
const state = createMemo18(() => snapshot2().state);
|
|
6722
|
+
const layout = createMemo18(() => snapshot2().layout);
|
|
6723
|
+
const [panel, setPanel] = createSignal13(null);
|
|
6482
6724
|
connectController(
|
|
6483
6725
|
controller,
|
|
6484
6726
|
() => {
|
|
@@ -6497,19 +6739,19 @@ function createFilterPopover(inputs) {
|
|
|
6497
6739
|
"effect",
|
|
6498
6740
|
"filterPopover"
|
|
6499
6741
|
);
|
|
6500
|
-
const openedColumnKey =
|
|
6501
|
-
const openedFilterType =
|
|
6502
|
-
const openedColumn =
|
|
6742
|
+
const openedColumnKey = createMemo18(() => state()?.columnKey ?? null);
|
|
6743
|
+
const openedFilterType = createMemo18(() => state()?.filterType ?? null);
|
|
6744
|
+
const openedColumn = createMemo18(() => {
|
|
6503
6745
|
openedColumnKey();
|
|
6504
6746
|
openedFilterType();
|
|
6505
|
-
return resolveOpenedFilterColumn(popoverColumns(),
|
|
6747
|
+
return resolveOpenedFilterColumn(popoverColumns(), untrack14(state));
|
|
6506
6748
|
});
|
|
6507
6749
|
return {
|
|
6508
6750
|
state,
|
|
6509
6751
|
layout,
|
|
6510
6752
|
openedColumn,
|
|
6511
6753
|
openedFilterType,
|
|
6512
|
-
isOpen:
|
|
6754
|
+
isOpen: createMemo18(() => state() !== null),
|
|
6513
6755
|
setPanel: (element) => {
|
|
6514
6756
|
controller.panelRef.current = element;
|
|
6515
6757
|
setPanel(element);
|
|
@@ -6527,7 +6769,7 @@ function createFilterPopover(inputs) {
|
|
|
6527
6769
|
}
|
|
6528
6770
|
|
|
6529
6771
|
// src/primitives/filterManagement.ts
|
|
6530
|
-
import { createMemo as
|
|
6772
|
+
import { createMemo as createMemo19, onCleanup as onCleanup12, untrack as untrack15 } from "solid-js";
|
|
6531
6773
|
import {
|
|
6532
6774
|
createColumnFilterDescribeOptions,
|
|
6533
6775
|
describeColumnFilterValue
|
|
@@ -6543,9 +6785,9 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6543
6785
|
var NO_COLUMNS2 = [];
|
|
6544
6786
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6545
6787
|
function createFilterManagement(inputs) {
|
|
6546
|
-
const groupColumns =
|
|
6547
|
-
const groupColumnKeys =
|
|
6548
|
-
const entries =
|
|
6788
|
+
const groupColumns = createMemo19(() => inputs.groupColumns?.() ?? NO_COLUMNS2);
|
|
6789
|
+
const groupColumnKeys = createMemo19(() => new Set(groupColumns().map((column) => column.key)));
|
|
6790
|
+
const entries = createMemo19(() => {
|
|
6549
6791
|
const columnFilters = inputs.columnFilters();
|
|
6550
6792
|
const texts = inputs.localeTexts();
|
|
6551
6793
|
const result = [];
|
|
@@ -6577,7 +6819,7 @@ function createFilterManagement(inputs) {
|
|
|
6577
6819
|
}
|
|
6578
6820
|
return result;
|
|
6579
6821
|
});
|
|
6580
|
-
const addableColumns =
|
|
6822
|
+
const addableColumns = createMemo19(() => {
|
|
6581
6823
|
const columnFilters = inputs.columnFilters();
|
|
6582
6824
|
const texts = inputs.localeTexts();
|
|
6583
6825
|
const grouped = groupColumnKeys();
|
|
@@ -6588,7 +6830,7 @@ function createFilterManagement(inputs) {
|
|
|
6588
6830
|
});
|
|
6589
6831
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
6590
6832
|
let disposed = false;
|
|
6591
|
-
|
|
6833
|
+
onCleanup12(() => {
|
|
6592
6834
|
disposed = true;
|
|
6593
6835
|
for (const frame of pendingFrames) {
|
|
6594
6836
|
cancelAnimationFrame(frame);
|
|
@@ -6602,7 +6844,7 @@ function createFilterManagement(inputs) {
|
|
|
6602
6844
|
});
|
|
6603
6845
|
pendingFrames.add(frame);
|
|
6604
6846
|
};
|
|
6605
|
-
const jumpToColumnFilter = (columnKey) =>
|
|
6847
|
+
const jumpToColumnFilter = (columnKey) => untrack15(() => {
|
|
6606
6848
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
6607
6849
|
const groupColumn = groupColumns().find((candidate) => candidate.key === columnKey);
|
|
6608
6850
|
const anchorKey = groupColumn ? GROUP_AUTO_COLUMN_KEY2 : columnKey;
|
|
@@ -6667,7 +6909,7 @@ function createFilterManagement(inputs) {
|
|
|
6667
6909
|
}
|
|
6668
6910
|
|
|
6669
6911
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6670
|
-
import { Show as Show16, createMemo as
|
|
6912
|
+
import { Show as Show16, createMemo as createMemo20, untrack as untrack16 } from "solid-js";
|
|
6671
6913
|
import {
|
|
6672
6914
|
createFilterPopoverCommands,
|
|
6673
6915
|
createFilterPopoverDerivedResolver
|
|
@@ -6700,11 +6942,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6700
6942
|
const filterPopover = props.filterPopover;
|
|
6701
6943
|
const openedColumn = filterPopover.openedColumn;
|
|
6702
6944
|
const openedType = filterPopover.openedFilterType;
|
|
6703
|
-
const openedOptionsKey =
|
|
6945
|
+
const openedOptionsKey = createMemo20(() => {
|
|
6704
6946
|
const column = openedColumn();
|
|
6705
6947
|
return column ? String(column.key) : null;
|
|
6706
6948
|
});
|
|
6707
|
-
const optionRowsHold =
|
|
6949
|
+
const optionRowsHold = createMemo20((prev) => {
|
|
6708
6950
|
const key = openedOptionsKey();
|
|
6709
6951
|
const rows = props.rows;
|
|
6710
6952
|
if (key === null) {
|
|
@@ -6715,9 +6957,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6715
6957
|
}
|
|
6716
6958
|
return prev;
|
|
6717
6959
|
});
|
|
6718
|
-
const optionRows =
|
|
6719
|
-
const openedIsDateSet =
|
|
6720
|
-
const getOpenedColumnRawValueAt =
|
|
6960
|
+
const optionRows = createMemo20(() => optionRowsHold().rows);
|
|
6961
|
+
const openedIsDateSet = createMemo20(() => openedType() === "dateSet");
|
|
6962
|
+
const getOpenedColumnRawValueAt = createMemo20(() => {
|
|
6721
6963
|
const rows = optionRows();
|
|
6722
6964
|
const column = openedColumn();
|
|
6723
6965
|
const isDateSet = openedIsDateSet();
|
|
@@ -6729,7 +6971,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6729
6971
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6730
6972
|
};
|
|
6731
6973
|
});
|
|
6732
|
-
const usesAsyncOptions =
|
|
6974
|
+
const usesAsyncOptions = createMemo20(() => {
|
|
6733
6975
|
const column = openedColumn();
|
|
6734
6976
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
6735
6977
|
});
|
|
@@ -6746,12 +6988,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6746
6988
|
};
|
|
6747
6989
|
}, "render", "filterOptionsSource");
|
|
6748
6990
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
6749
|
-
const collectColumn =
|
|
6750
|
-
const numeric =
|
|
6751
|
-
const syncResult =
|
|
6991
|
+
const collectColumn = createMemo20(() => usesAsyncOptions() ? null : openedColumn());
|
|
6992
|
+
const numeric = createMemo20(() => openedType() === "numberSet");
|
|
6993
|
+
const syncResult = createMemo20(
|
|
6752
6994
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
6753
6995
|
);
|
|
6754
|
-
const sourceKey =
|
|
6996
|
+
const sourceKey = createMemo20(() => {
|
|
6755
6997
|
const column = collectColumn();
|
|
6756
6998
|
return column === null ? void 0 : String(column.key);
|
|
6757
6999
|
});
|
|
@@ -6764,14 +7006,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6764
7006
|
sourceKey: sourceKey()
|
|
6765
7007
|
}), "render", "filterValueCollector");
|
|
6766
7008
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
6767
|
-
const optionsResult =
|
|
7009
|
+
const optionsResult = createMemo20(() => {
|
|
6768
7010
|
if (usesAsyncOptions()) {
|
|
6769
7011
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
6770
7012
|
}
|
|
6771
7013
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
6772
7014
|
});
|
|
6773
7015
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
6774
|
-
const derived =
|
|
7016
|
+
const derived = createMemo20(
|
|
6775
7017
|
() => resolveDerived({
|
|
6776
7018
|
openedFilterColumn: openedColumn(),
|
|
6777
7019
|
openedFilterType: openedType(),
|
|
@@ -6795,7 +7037,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6795
7037
|
filterTexts: props.localeTexts
|
|
6796
7038
|
}), "render", "filterPopoverCommands");
|
|
6797
7039
|
const texts = () => props.localeTexts;
|
|
6798
|
-
const currentValueText =
|
|
7040
|
+
const currentValueText = createMemo20(() => {
|
|
6799
7041
|
const column = openedColumn();
|
|
6800
7042
|
if (!column) {
|
|
6801
7043
|
return texts().filterCurrentNone;
|
|
@@ -6812,16 +7054,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6812
7054
|
const text = columnFilterValueToDraftText(rawValue);
|
|
6813
7055
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
6814
7056
|
});
|
|
6815
|
-
const datePresets =
|
|
7057
|
+
const datePresets = createMemo20(() => {
|
|
6816
7058
|
const column = openedColumn();
|
|
6817
7059
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
6818
7060
|
});
|
|
6819
|
-
const comboSummaryText =
|
|
7061
|
+
const comboSummaryText = createMemo20(() => {
|
|
6820
7062
|
const column = openedColumn();
|
|
6821
7063
|
const value = derived().openedSetFilterValue;
|
|
6822
7064
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
6823
7065
|
});
|
|
6824
|
-
const renderDateInput =
|
|
7066
|
+
const renderDateInput = createMemo20(() => {
|
|
6825
7067
|
const render = props.renderFilterDateInput;
|
|
6826
7068
|
const column = openedColumn();
|
|
6827
7069
|
if (!render || !column) {
|
|
@@ -6844,7 +7086,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6844
7086
|
{(column) => <Show16 when={filterPopover.layout()}>
|
|
6845
7087
|
{(layout) => <Show16 when={props.views()}>
|
|
6846
7088
|
{(views) => {
|
|
6847
|
-
const ColumnFilterPopover =
|
|
7089
|
+
const ColumnFilterPopover = untrack16(views).ColumnFilterPopover;
|
|
6848
7090
|
return <Show16 when={column().key} keyed>
|
|
6849
7091
|
{(columnKey) => <ColumnFilterPopover
|
|
6850
7092
|
popoverSlot={props.popoverSlot}
|
|
@@ -6950,10 +7192,10 @@ function GridFilterChipBar(props) {
|
|
|
6950
7192
|
}
|
|
6951
7193
|
|
|
6952
7194
|
// src/view/lazyPopups.ts
|
|
6953
|
-
import { createEffect as
|
|
7195
|
+
import { createEffect as createEffect8, createMemo as createMemo21 } from "solid-js";
|
|
6954
7196
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
6955
7197
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
6956
|
-
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-
|
|
7198
|
+
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-D7INPNVB.jsx"));
|
|
6957
7199
|
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-HIQGRX3N.jsx"));
|
|
6958
7200
|
var preloadGridPopups = async () => {
|
|
6959
7201
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
@@ -6963,8 +7205,8 @@ var reportLoadError = (error) => {
|
|
|
6963
7205
|
};
|
|
6964
7206
|
function createLazyModuleSignal(module, options, name) {
|
|
6965
7207
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
6966
|
-
|
|
6967
|
-
|
|
7208
|
+
createEffect8(
|
|
7209
|
+
createMemo21(() => options.needed() && loaded() === null),
|
|
6968
7210
|
(shouldLoad) => {
|
|
6969
7211
|
if (!shouldLoad) {
|
|
6970
7212
|
return;
|
|
@@ -6982,8 +7224,8 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
6982
7224
|
},
|
|
6983
7225
|
{ name: `${name}Load` }
|
|
6984
7226
|
);
|
|
6985
|
-
|
|
6986
|
-
|
|
7227
|
+
createEffect8(
|
|
7228
|
+
createMemo21(() => options.prefetch() && module.getSnapshot() === null),
|
|
6987
7229
|
(shouldPrefetch) => {
|
|
6988
7230
|
if (!shouldPrefetch) {
|
|
6989
7231
|
return;
|
|
@@ -7018,14 +7260,14 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7018
7260
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7019
7261
|
|
|
7020
7262
|
// src/view/GridFindBar.tsx
|
|
7021
|
-
import { createRenderEffect as createRenderEffect5, createSignal as
|
|
7263
|
+
import { createRenderEffect as createRenderEffect5, createSignal as createSignal14, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
7022
7264
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7023
7265
|
function GridFindBar(props) {
|
|
7024
7266
|
const texts = useFeatureLocaleText();
|
|
7025
|
-
const [input, setInput] =
|
|
7026
|
-
const initialQuery =
|
|
7267
|
+
const [input, setInput] = createSignal14();
|
|
7268
|
+
const initialQuery = untrack17(() => props.snapshot.query);
|
|
7027
7269
|
onSettled7(() => {
|
|
7028
|
-
const element =
|
|
7270
|
+
const element = untrack17(input);
|
|
7029
7271
|
element?.focus();
|
|
7030
7272
|
element?.select();
|
|
7031
7273
|
});
|
|
@@ -7040,18 +7282,18 @@ function GridFindBar(props) {
|
|
|
7040
7282
|
);
|
|
7041
7283
|
const count = () => props.snapshot.matches.length;
|
|
7042
7284
|
const countLabel = () => {
|
|
7043
|
-
const
|
|
7285
|
+
const snapshot2 = props.snapshot;
|
|
7044
7286
|
const localeTexts = texts();
|
|
7045
|
-
if (
|
|
7287
|
+
if (snapshot2.query.length === 0) {
|
|
7046
7288
|
return "";
|
|
7047
7289
|
}
|
|
7048
|
-
if (
|
|
7290
|
+
if (snapshot2.scanning) {
|
|
7049
7291
|
return localeTexts.findSearching;
|
|
7050
7292
|
}
|
|
7051
7293
|
if (count() === 0) {
|
|
7052
7294
|
return localeTexts.findNoResults;
|
|
7053
7295
|
}
|
|
7054
|
-
return `${(
|
|
7296
|
+
return `${(snapshot2.currentIndex ?? 0) + 1} / ${count()}${snapshot2.truncated ? "+" : ""}`;
|
|
7055
7297
|
};
|
|
7056
7298
|
const handleKeyDown = (event) => {
|
|
7057
7299
|
if (isImeComposingKeyEvent3(event)) {
|
|
@@ -7154,7 +7396,7 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7154
7396
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7155
7397
|
|
|
7156
7398
|
// src/view/GridBodyGroupRow.tsx
|
|
7157
|
-
import { For as For10, Show as Show18, createMemo as
|
|
7399
|
+
import { For as For10, Show as Show18, createMemo as createMemo22 } from "solid-js";
|
|
7158
7400
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7159
7401
|
import {
|
|
7160
7402
|
formatTotalRowCellText,
|
|
@@ -7212,10 +7454,10 @@ function GridBodyGroupRow(props) {
|
|
|
7212
7454
|
</Show18>
|
|
7213
7455
|
<For10 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7214
7456
|
{(entry) => {
|
|
7215
|
-
const unbound =
|
|
7457
|
+
const unbound = createMemo22(() => entry().column);
|
|
7216
7458
|
const column = () => unbound();
|
|
7217
7459
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7218
|
-
const aggregate =
|
|
7460
|
+
const aggregate = createMemo22(() => {
|
|
7219
7461
|
const current = column();
|
|
7220
7462
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7221
7463
|
return null;
|
|
@@ -7324,12 +7566,12 @@ import {
|
|
|
7324
7566
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7325
7567
|
|
|
7326
7568
|
// src/view/GridBodyLabelRow.tsx
|
|
7327
|
-
import { Show as Show19, createMemo as
|
|
7569
|
+
import { Show as Show19, createMemo as createMemo23 } from "solid-js";
|
|
7328
7570
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7329
|
-
const row =
|
|
7330
|
-
const sourceRowIndex =
|
|
7331
|
-
const label =
|
|
7332
|
-
const sectionRowCount =
|
|
7571
|
+
const row = createMemo23(() => labelRow().row);
|
|
7572
|
+
const sourceRowIndex = createMemo23(() => labelRow().sourceIndex);
|
|
7573
|
+
const label = createMemo23(() => labelRow().label);
|
|
7574
|
+
const sectionRowCount = createMemo23(() => labelRow().sectionRowCount);
|
|
7333
7575
|
return {
|
|
7334
7576
|
get row() {
|
|
7335
7577
|
return row();
|
|
@@ -7405,7 +7647,7 @@ function GridBodyLabelRow(props) {
|
|
|
7405
7647
|
}
|
|
7406
7648
|
|
|
7407
7649
|
// src/view/GridStickyLabelLayer.tsx
|
|
7408
|
-
import { Show as Show20, createMemo as
|
|
7650
|
+
import { Show as Show20, createMemo as createMemo24, onSettled as onSettled8 } from "solid-js";
|
|
7409
7651
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7410
7652
|
function GridStickyLabelLayer(props) {
|
|
7411
7653
|
return <Show20 when={props.entry}>
|
|
@@ -7414,10 +7656,10 @@ function GridStickyLabelLayer(props) {
|
|
|
7414
7656
|
}
|
|
7415
7657
|
function StickyLabel(props) {
|
|
7416
7658
|
const layer = props.layer;
|
|
7417
|
-
const labelRow =
|
|
7418
|
-
const rowIndex =
|
|
7419
|
-
const rowKey =
|
|
7420
|
-
const height =
|
|
7659
|
+
const labelRow = createMemo24(() => props.entry().labelRow);
|
|
7660
|
+
const rowIndex = createMemo24(() => props.entry().rowIndex);
|
|
7661
|
+
const rowKey = createMemo24(() => props.entry().rowKey);
|
|
7662
|
+
const height = createMemo24(() => props.entry().height);
|
|
7421
7663
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7422
7664
|
let element;
|
|
7423
7665
|
onSettled8(() => {
|
|
@@ -7520,12 +7762,12 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7520
7762
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7521
7763
|
|
|
7522
7764
|
// src/primitives/serverSide.ts
|
|
7523
|
-
import { createMemo as
|
|
7765
|
+
import { createMemo as createMemo25, untrack as untrack18 } from "solid-js";
|
|
7524
7766
|
import {
|
|
7525
7767
|
createServerSideRowModel
|
|
7526
7768
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
7527
7769
|
function createServerSide(args) {
|
|
7528
|
-
const controller = createServerSideRowModel(
|
|
7770
|
+
const controller = createServerSideRowModel(untrack18(args));
|
|
7529
7771
|
let updated = false;
|
|
7530
7772
|
let pendingRange = null;
|
|
7531
7773
|
connectController(
|
|
@@ -7555,28 +7797,28 @@ function createServerSide(args) {
|
|
|
7555
7797
|
}
|
|
7556
7798
|
controller.requestRange(startIndex, endIndex);
|
|
7557
7799
|
};
|
|
7558
|
-
const
|
|
7800
|
+
const snapshot2 = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7559
7801
|
return {
|
|
7560
|
-
rowModel:
|
|
7561
|
-
rowCount: () =>
|
|
7562
|
-
loadError:
|
|
7563
|
-
writeError:
|
|
7802
|
+
rowModel: createMemo25(() => snapshot2().rowModel),
|
|
7803
|
+
rowCount: () => snapshot2().rowCount,
|
|
7804
|
+
loadError: createMemo25(() => snapshot2().loadError),
|
|
7805
|
+
writeError: createMemo25(() => snapshot2().writeError),
|
|
7564
7806
|
isRowLoaded: controller.isRowLoaded,
|
|
7565
7807
|
requestRange,
|
|
7566
7808
|
refresh: controller.refresh,
|
|
7567
7809
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7568
7810
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7569
|
-
canUpdateRows:
|
|
7811
|
+
canUpdateRows: createMemo25(() => args().dataSource?.updateRows !== void 0),
|
|
7570
7812
|
applyCellEdits: controller.applyCellEdits
|
|
7571
7813
|
};
|
|
7572
7814
|
}
|
|
7573
7815
|
|
|
7574
7816
|
// src/view/GridServerSideErrorBars.tsx
|
|
7575
|
-
import { Show as Show21, createSignal as
|
|
7817
|
+
import { Show as Show21, createSignal as createSignal15 } from "solid-js";
|
|
7576
7818
|
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7577
7819
|
function GridServerSideErrorBars(props) {
|
|
7578
|
-
const [dismissedLoadError, setDismissedLoadError] =
|
|
7579
|
-
const [dismissedWriteError, setDismissedWriteError] =
|
|
7820
|
+
const [dismissedLoadError, setDismissedLoadError] = createSignal15(null);
|
|
7821
|
+
const [dismissedWriteError, setDismissedWriteError] = createSignal15(null);
|
|
7580
7822
|
const texts = () => props.localeTexts;
|
|
7581
7823
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7582
7824
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
@@ -7748,7 +7990,7 @@ var motionExtrasFeature = {
|
|
|
7748
7990
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7749
7991
|
|
|
7750
7992
|
// src/view/GridPinnedRows.tsx
|
|
7751
|
-
import { For as For12, Show as Show24, createMemo as
|
|
7993
|
+
import { For as For12, Show as Show24, createMemo as createMemo26 } from "solid-js";
|
|
7752
7994
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7753
7995
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7754
7996
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
@@ -7772,7 +8014,7 @@ function GridPinnedRows(props) {
|
|
|
7772
8014
|
<For12 each={props.rows} keyed={false}>
|
|
7773
8015
|
{(row, index) => {
|
|
7774
8016
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
7775
|
-
const rowSlot =
|
|
8017
|
+
const rowSlot = createMemo26(
|
|
7776
8018
|
() => resolveSlotProps3(
|
|
7777
8019
|
props.getRowClassName?.(row(), index, {
|
|
7778
8020
|
row: row(),
|
|
@@ -7827,11 +8069,11 @@ function GridPinnedRows(props) {
|
|
|
7827
8069
|
</Show24>
|
|
7828
8070
|
<For12 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7829
8071
|
{(entry) => {
|
|
7830
|
-
const unbound =
|
|
8072
|
+
const unbound = createMemo26(() => entry().column);
|
|
7831
8073
|
const column = () => unbound();
|
|
7832
|
-
const value =
|
|
7833
|
-
const colIndex =
|
|
7834
|
-
const ctx =
|
|
8074
|
+
const value = createMemo26(() => getCellValue5(row(), unbound()));
|
|
8075
|
+
const colIndex = createMemo26(() => entry().logicalIndex);
|
|
8076
|
+
const ctx = createMemo26(
|
|
7835
8077
|
() => ({
|
|
7836
8078
|
row: row(),
|
|
7837
8079
|
rowIndex: index,
|
|
@@ -7847,19 +8089,19 @@ function GridPinnedRows(props) {
|
|
|
7847
8089
|
pinned: props.position
|
|
7848
8090
|
})
|
|
7849
8091
|
);
|
|
7850
|
-
const cellSlot =
|
|
8092
|
+
const cellSlot = createMemo26(() => {
|
|
7851
8093
|
const cellClassName = column().cellClassName;
|
|
7852
8094
|
return resolveSlotProps3(
|
|
7853
8095
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
7854
8096
|
);
|
|
7855
8097
|
});
|
|
7856
8098
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
7857
|
-
const dataBar =
|
|
8099
|
+
const dataBar = createMemo26(() => {
|
|
7858
8100
|
const feature = props.conditionalFormat;
|
|
7859
8101
|
const format = rules()?.dataBar;
|
|
7860
8102
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
7861
8103
|
});
|
|
7862
|
-
const scaleBackground =
|
|
8104
|
+
const scaleBackground = createMemo26(() => {
|
|
7863
8105
|
const feature = props.conditionalFormat;
|
|
7864
8106
|
const format = rules()?.colorScale;
|
|
7865
8107
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -7869,7 +8111,7 @@ function GridPinnedRows(props) {
|
|
|
7869
8111
|
const format = rules()?.dataBar;
|
|
7870
8112
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
7871
8113
|
};
|
|
7872
|
-
const content =
|
|
8114
|
+
const content = createMemo26(() => {
|
|
7873
8115
|
const current = column();
|
|
7874
8116
|
if (isSyntheticColumnKey3(current.key)) {
|
|
7875
8117
|
return null;
|
|
@@ -7963,7 +8205,7 @@ var pinnedRowsFeature = {
|
|
|
7963
8205
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7964
8206
|
|
|
7965
8207
|
// src/primitives/rowDrag.ts
|
|
7966
|
-
import { createEffect as
|
|
8208
|
+
import { createEffect as createEffect9, createMemo as createMemo27, untrack as untrack19 } from "solid-js";
|
|
7967
8209
|
import {
|
|
7968
8210
|
createRowDragController
|
|
7969
8211
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
@@ -7978,10 +8220,10 @@ function createRowDrag(inputs) {
|
|
|
7978
8220
|
const leftIndicatorRef = { current: null };
|
|
7979
8221
|
const centerIndicatorRef = { current: null };
|
|
7980
8222
|
const rightIndicatorRef = { current: null };
|
|
7981
|
-
const canDropAt =
|
|
7982
|
-
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(
|
|
7983
|
-
const getDragRow = (viewIndex) => getDragRowToken(
|
|
7984
|
-
const locateDragRow =
|
|
8223
|
+
const canDropAt = createMemo27(() => createRowDropCheck(inputs.canDropRow(), inputs.rows(), inputs.resolveRowKey()));
|
|
8224
|
+
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(untrack19(inputs.rowModel), untrack19(inputs.visibleColumns), viewIndex, untrack19(inputs.dragRowLabel));
|
|
8225
|
+
const getDragRow = (viewIndex) => getDragRowToken(untrack19(inputs.rowModel), viewIndex);
|
|
8226
|
+
const locateDragRow = createMemo27(() => {
|
|
7985
8227
|
const rowModel = inputs.rowModel();
|
|
7986
8228
|
const hasRowKeys = inputs.hasRowKeys();
|
|
7987
8229
|
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
@@ -8001,7 +8243,7 @@ function createRowDrag(inputs) {
|
|
|
8001
8243
|
"effect",
|
|
8002
8244
|
"rowDrag"
|
|
8003
8245
|
);
|
|
8004
|
-
|
|
8246
|
+
createEffect9(inputs.rowModel, () => {
|
|
8005
8247
|
controller.applyReorderSettle();
|
|
8006
8248
|
}, { name: "rowDragSettle" });
|
|
8007
8249
|
return {
|
|
@@ -8055,7 +8297,7 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8055
8297
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8056
8298
|
|
|
8057
8299
|
// src/view/GridScrollHint.tsx
|
|
8058
|
-
import { For as For13, Show as Show25, createMemo as
|
|
8300
|
+
import { For as For13, Show as Show25, createMemo as createMemo28, createSignal as createSignal16, createEffect as createEffect10 } from "solid-js";
|
|
8059
8301
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8060
8302
|
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8061
8303
|
import {
|
|
@@ -8073,18 +8315,18 @@ var SCROLL_HINT_OVERLAY_TRACK_ZONE_PX = 8;
|
|
|
8073
8315
|
var SCROLL_HINT_JUMP_LABEL_FLIP_PX = 28;
|
|
8074
8316
|
function GridScrollHint(props) {
|
|
8075
8317
|
const texts = useFeatureLocaleText();
|
|
8076
|
-
const [scrollActive, setScrollActive] =
|
|
8077
|
-
const [hovered, setHovered] =
|
|
8078
|
-
const [scrollbarWidth, setScrollbarWidth] =
|
|
8079
|
-
const [trackPointerY, setTrackPointerY] =
|
|
8080
|
-
const [dragging, setDragging] =
|
|
8318
|
+
const [scrollActive, setScrollActive] = createSignal16(false);
|
|
8319
|
+
const [hovered, setHovered] = createSignal16(false);
|
|
8320
|
+
const [scrollbarWidth, setScrollbarWidth] = createSignal16(0);
|
|
8321
|
+
const [trackPointerY, setTrackPointerY] = createSignal16(null);
|
|
8322
|
+
const [dragging, setDragging] = createSignal16(false);
|
|
8081
8323
|
let lingerTimer = null;
|
|
8082
8324
|
let dragGrab = null;
|
|
8083
8325
|
let gutter;
|
|
8084
|
-
const scrollbar =
|
|
8326
|
+
const scrollbar = createMemo28(() => props.options.scrollbar);
|
|
8085
8327
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8086
8328
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8087
|
-
const track =
|
|
8329
|
+
const track = createMemo28(
|
|
8088
8330
|
() => computeScrollHintTrack({
|
|
8089
8331
|
scrollTop: props.scrollTop,
|
|
8090
8332
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8092,8 +8334,8 @@ function GridScrollHint(props) {
|
|
|
8092
8334
|
trackHeight: trackHeight()
|
|
8093
8335
|
})
|
|
8094
8336
|
);
|
|
8095
|
-
const shown =
|
|
8096
|
-
|
|
8337
|
+
const shown = createMemo28(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8338
|
+
createEffect10(scrollbar, (customScrollbar) => {
|
|
8097
8339
|
const element = props.scrollContainerRef.current;
|
|
8098
8340
|
if (!element) {
|
|
8099
8341
|
return void 0;
|
|
@@ -8142,7 +8384,7 @@ function GridScrollHint(props) {
|
|
|
8142
8384
|
}
|
|
8143
8385
|
};
|
|
8144
8386
|
}, { name: "scrollHintListeners" });
|
|
8145
|
-
|
|
8387
|
+
createEffect10(
|
|
8146
8388
|
() => scrollbar() && shown(),
|
|
8147
8389
|
(on) => {
|
|
8148
8390
|
const element = props.scrollContainerRef.current;
|
|
@@ -8161,12 +8403,12 @@ function GridScrollHint(props) {
|
|
|
8161
8403
|
);
|
|
8162
8404
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8163
8405
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8164
|
-
const dataRowCount =
|
|
8406
|
+
const dataRowCount = createMemo28(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8165
8407
|
const rowNumberOf = (viewIndex) => {
|
|
8166
8408
|
const labels = props.labelViewIndexes;
|
|
8167
8409
|
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8168
8410
|
};
|
|
8169
|
-
const rulerTicks =
|
|
8411
|
+
const rulerTicks = createMemo28(
|
|
8170
8412
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8171
8413
|
rowCount: dataRowCount(),
|
|
8172
8414
|
rulerHeight: rulerHeight(),
|
|
@@ -8176,7 +8418,7 @@ function GridScrollHint(props) {
|
|
|
8176
8418
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8177
8419
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8178
8420
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8179
|
-
const topRowIndex =
|
|
8421
|
+
const topRowIndex = createMemo28(() => {
|
|
8180
8422
|
const current = track();
|
|
8181
8423
|
if (current === null) {
|
|
8182
8424
|
return 0;
|
|
@@ -8191,8 +8433,8 @@ function GridScrollHint(props) {
|
|
|
8191
8433
|
rowIndex,
|
|
8192
8434
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8193
8435
|
});
|
|
8194
|
-
const detail =
|
|
8195
|
-
const jumpPreview =
|
|
8436
|
+
const detail = createMemo28(() => detailOf(topRowIndex()));
|
|
8437
|
+
const jumpPreview = createMemo28(() => {
|
|
8196
8438
|
const pointerY = trackPointerY();
|
|
8197
8439
|
const current = track();
|
|
8198
8440
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8355,7 +8597,7 @@ var scrollHintFeature = {
|
|
|
8355
8597
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8356
8598
|
|
|
8357
8599
|
// src/primitives/selectionAggregates.ts
|
|
8358
|
-
import { createMemo as
|
|
8600
|
+
import { createMemo as createMemo29 } from "solid-js";
|
|
8359
8601
|
import {
|
|
8360
8602
|
createSelectionAggregatesRunner,
|
|
8361
8603
|
resolveSyncSelectionAggregates,
|
|
@@ -8367,15 +8609,15 @@ import {
|
|
|
8367
8609
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8368
8610
|
function createSelectionAggregates(args) {
|
|
8369
8611
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8370
|
-
const target =
|
|
8612
|
+
const target = createMemo29(() => {
|
|
8371
8613
|
const current = args();
|
|
8372
8614
|
return stabilizeTarget(
|
|
8373
8615
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8374
8616
|
);
|
|
8375
8617
|
});
|
|
8376
|
-
const rowModel =
|
|
8377
|
-
const key =
|
|
8378
|
-
const syncResult =
|
|
8618
|
+
const rowModel = createMemo29(() => args().rowModel);
|
|
8619
|
+
const key = createMemo29(() => ({ rowModel: rowModel(), target: target() }));
|
|
8620
|
+
const syncResult = createMemo29(() => resolveSyncSelectionAggregates(key()));
|
|
8379
8621
|
const runner = createSelectionAggregatesRunner();
|
|
8380
8622
|
connectController(
|
|
8381
8623
|
runner,
|
|
@@ -8383,17 +8625,17 @@ function createSelectionAggregates(args) {
|
|
|
8383
8625
|
"render",
|
|
8384
8626
|
"selectionAggregates"
|
|
8385
8627
|
);
|
|
8386
|
-
const
|
|
8387
|
-
return
|
|
8628
|
+
const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8629
|
+
return createMemo29(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
|
|
8388
8630
|
}
|
|
8389
8631
|
|
|
8390
8632
|
// src/view/GridSelectionAggregates.tsx
|
|
8391
|
-
import { For as For14, Show as Show26, createMemo as
|
|
8633
|
+
import { For as For14, Show as Show26, createMemo as createMemo30 } from "solid-js";
|
|
8392
8634
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8393
8635
|
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8394
8636
|
function GridSelectionAggregates(props) {
|
|
8395
8637
|
const texts = useFeatureLocaleText();
|
|
8396
|
-
const chips =
|
|
8638
|
+
const chips = createMemo30(() => {
|
|
8397
8639
|
const aggregates = props.aggregates;
|
|
8398
8640
|
if (!aggregates) {
|
|
8399
8641
|
return null;
|
|
@@ -8462,7 +8704,7 @@ var selectionAggregatesFeature = {
|
|
|
8462
8704
|
};
|
|
8463
8705
|
|
|
8464
8706
|
// src/primitives/toolPanel.ts
|
|
8465
|
-
import { createMemo as
|
|
8707
|
+
import { createMemo as createMemo31 } from "solid-js";
|
|
8466
8708
|
import {
|
|
8467
8709
|
createToolPanelController,
|
|
8468
8710
|
resolveActiveToolPanelTab,
|
|
@@ -8480,8 +8722,8 @@ function createToolPanel(inputs) {
|
|
|
8480
8722
|
suppressEscape: inputs.suppressEscape(),
|
|
8481
8723
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8482
8724
|
}), "render", "toolPanel");
|
|
8483
|
-
const
|
|
8484
|
-
const availableTabs =
|
|
8725
|
+
const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8726
|
+
const availableTabs = createMemo31(
|
|
8485
8727
|
() => resolveAvailableToolPanelTabs({
|
|
8486
8728
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8487
8729
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8490,10 +8732,10 @@ function createToolPanel(inputs) {
|
|
|
8490
8732
|
{ equals: sameTabs }
|
|
8491
8733
|
);
|
|
8492
8734
|
return {
|
|
8493
|
-
activeTab:
|
|
8735
|
+
activeTab: createMemo31(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
|
|
8494
8736
|
availableTabs,
|
|
8495
|
-
layout:
|
|
8496
|
-
flashTick:
|
|
8737
|
+
layout: createMemo31(() => snapshot2().layout),
|
|
8738
|
+
flashTick: createMemo31(() => snapshot2().flashTick),
|
|
8497
8739
|
panelRef: controller.panelRef,
|
|
8498
8740
|
open: controller.open,
|
|
8499
8741
|
close: controller.close,
|
|
@@ -8517,7 +8759,7 @@ import {
|
|
|
8517
8759
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8518
8760
|
|
|
8519
8761
|
// src/view/GridTotalRow.tsx
|
|
8520
|
-
import { For as For15, Show as Show27, createMemo as
|
|
8762
|
+
import { For as For15, Show as Show27, createMemo as createMemo32 } from "solid-js";
|
|
8521
8763
|
import {
|
|
8522
8764
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8523
8765
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8562,10 +8804,10 @@ function GridTotalRow(props) {
|
|
|
8562
8804
|
</Show27>
|
|
8563
8805
|
<For15 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8564
8806
|
{(entry) => {
|
|
8565
|
-
const unbound =
|
|
8807
|
+
const unbound = createMemo32(() => entry().column);
|
|
8566
8808
|
const cell = () => props.cells.get(unbound().key);
|
|
8567
8809
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8568
|
-
const content =
|
|
8810
|
+
const content = createMemo32(() => {
|
|
8569
8811
|
const total = cell();
|
|
8570
8812
|
if (total) {
|
|
8571
8813
|
const column = unbound();
|