@ishibashi0112/spreadsheet-grid-solid 0.1.0 → 0.1.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/README.md +20 -12
- package/dist/devWarnings.d.ts +3 -0
- package/dist/editors/CellEditorLayer.d.ts +1 -0
- package/dist/index.js +2000 -1879
- package/dist/primitives/externalStore.d.ts +1 -0
- package/dist/primitives/userCallback.d.ts +10 -0
- package/dist/source/index.jsx +631 -455
- package/dist/view/GridBodyLayer.d.ts +1 -1
- package/package.json +2 -1
package/dist/source/index.jsx
CHANGED
|
@@ -24,7 +24,8 @@ import {
|
|
|
24
24
|
import { merge } from "solid-js";
|
|
25
25
|
|
|
26
26
|
// src/SpreadsheetGrid.tsx
|
|
27
|
-
import { For as For5, Match, Show as Show11, Switch, createEffect as createEffect4, createMemo as
|
|
27
|
+
import { For as For5, Match, Show as Show11, Switch, createEffect as createEffect4, createMemo as createMemo9, createSignal as createSignal10, createUniqueId as createUniqueId3, isHydrating as isHydrating2, latest, onCleanup as onCleanup7, untrack as untrack13 } from "solid-js";
|
|
28
|
+
import { isServer } from "@solidjs/web";
|
|
28
29
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
29
30
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
30
31
|
import { buildSelectionSnapshot, selectGlobalFilter } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridSelectors";
|
|
@@ -120,6 +121,95 @@ import {
|
|
|
120
121
|
isEscapeClaimedByGrid
|
|
121
122
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
|
|
122
123
|
|
|
124
|
+
// src/primitives/userCallback.ts
|
|
125
|
+
import { flush, getOwner, isDisposed } from "solid-js";
|
|
126
|
+
var gridUpdateDepth = 0;
|
|
127
|
+
var handleCallDepth = 0;
|
|
128
|
+
var isolatingDepth = 0;
|
|
129
|
+
var pendingReplays = /* @__PURE__ */ new Set();
|
|
130
|
+
function runGridUpdate(fn) {
|
|
131
|
+
gridUpdateDepth++;
|
|
132
|
+
try {
|
|
133
|
+
return fn();
|
|
134
|
+
} finally {
|
|
135
|
+
gridUpdateDepth--;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function runHandleCall(fn) {
|
|
139
|
+
handleCallDepth++;
|
|
140
|
+
try {
|
|
141
|
+
return fn();
|
|
142
|
+
} finally {
|
|
143
|
+
handleCallDepth--;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function isIsolatingFlush() {
|
|
147
|
+
return isolatingDepth > 0;
|
|
148
|
+
}
|
|
149
|
+
function deferControllerUpdate(replay) {
|
|
150
|
+
pendingReplays.add(replay);
|
|
151
|
+
}
|
|
152
|
+
var flushQuietly = () => {
|
|
153
|
+
try {
|
|
154
|
+
flush();
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
var isolatedFlush = () => {
|
|
159
|
+
isolatingDepth++;
|
|
160
|
+
try {
|
|
161
|
+
flushQuietly();
|
|
162
|
+
} finally {
|
|
163
|
+
isolatingDepth--;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
var releaseReplays = () => {
|
|
167
|
+
if (pendingReplays.size === 0) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const replays = Array.from(pendingReplays);
|
|
171
|
+
pendingReplays.clear();
|
|
172
|
+
for (const replay of replays) {
|
|
173
|
+
replay();
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
function callInOwnFrame(fn, ...args) {
|
|
177
|
+
if (handleCallDepth > 0 || gridUpdateDepth > 0 || getOwner() !== null) {
|
|
178
|
+
return fn(...args);
|
|
179
|
+
}
|
|
180
|
+
isolatedFlush();
|
|
181
|
+
try {
|
|
182
|
+
return fn(...args);
|
|
183
|
+
} finally {
|
|
184
|
+
isolatedFlush();
|
|
185
|
+
releaseReplays();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function createUserCallbacks() {
|
|
189
|
+
const owner = getOwner();
|
|
190
|
+
const call = (fn, ...args) => {
|
|
191
|
+
if (handleCallDepth > 0 || gridUpdateDepth === 0 && getOwner() !== null) {
|
|
192
|
+
return fn(...args);
|
|
193
|
+
}
|
|
194
|
+
if (gridUpdateDepth > 0) {
|
|
195
|
+
queueMicrotask(() => {
|
|
196
|
+
if (owner && isDisposed(owner)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
flushQuietly();
|
|
200
|
+
fn(...args);
|
|
201
|
+
flushQuietly();
|
|
202
|
+
});
|
|
203
|
+
return void 0;
|
|
204
|
+
}
|
|
205
|
+
return callInOwnFrame(fn, ...args);
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
call,
|
|
209
|
+
wrap: (fn) => fn ? (...args) => call(fn, ...args) : void 0
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
123
213
|
// src/primitives/gridStoreSignals.ts
|
|
124
214
|
import { createSignal } from "solid-js";
|
|
125
215
|
function createGridStoreSignals(store) {
|
|
@@ -137,9 +227,10 @@ function createGridStoreSignals(store) {
|
|
|
137
227
|
}
|
|
138
228
|
|
|
139
229
|
// src/primitives/externalStore.ts
|
|
140
|
-
import { createSignal as createSignal2 } from "solid-js";
|
|
230
|
+
import { createSignal as createSignal2, isHydrating } from "solid-js";
|
|
141
231
|
function createExternalStoreSignal(store, name) {
|
|
142
|
-
const
|
|
232
|
+
const initial = isHydrating() && store.getServerSnapshot ? store.getServerSnapshot() : store.getSnapshot();
|
|
233
|
+
const [value, setValue] = createSignal2(initial, name === void 0 ? void 0 : { name });
|
|
143
234
|
onGridMounted(() => {
|
|
144
235
|
setValue(() => store.getSnapshot());
|
|
145
236
|
return store.subscribe(() => setValue(() => store.getSnapshot()));
|
|
@@ -172,46 +263,63 @@ function createGridViewSetters(store) {
|
|
|
172
263
|
}
|
|
173
264
|
|
|
174
265
|
// src/primitives/controller.ts
|
|
175
|
-
import { createEffect, createRenderEffect, untrack } from "solid-js";
|
|
266
|
+
import { createEffect, createRenderEffect, createSignal as createSignal3, untrack } from "solid-js";
|
|
176
267
|
function connectController(controller, args, timing = "render", name) {
|
|
177
268
|
let mounted = false;
|
|
178
|
-
let
|
|
269
|
+
let latest2 = null;
|
|
270
|
+
const [replay, setReplay] = createSignal3(0, name === void 0 ? void 0 : { name: `${name}Replay` });
|
|
271
|
+
const requestReplay = () => {
|
|
272
|
+
setReplay((value) => value + 1);
|
|
273
|
+
};
|
|
274
|
+
const run = (value) => {
|
|
275
|
+
runGridUpdate(() => untrack(() => controller.update(value)));
|
|
276
|
+
};
|
|
179
277
|
const apply = (next) => {
|
|
180
|
-
|
|
181
|
-
if (mounted) {
|
|
182
|
-
|
|
278
|
+
latest2 = { value: next };
|
|
279
|
+
if (!mounted) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (isIsolatingFlush()) {
|
|
283
|
+
deferControllerUpdate(requestReplay);
|
|
284
|
+
return;
|
|
183
285
|
}
|
|
286
|
+
run(next);
|
|
287
|
+
};
|
|
288
|
+
const compute = () => {
|
|
289
|
+
replay();
|
|
290
|
+
return args();
|
|
184
291
|
};
|
|
185
292
|
const options = name === void 0 ? void 0 : { name };
|
|
186
293
|
if (timing === "render") {
|
|
187
|
-
createRenderEffect(
|
|
294
|
+
createRenderEffect(compute, apply, options);
|
|
188
295
|
} else {
|
|
189
|
-
createEffect(
|
|
296
|
+
createEffect(compute, apply, options);
|
|
190
297
|
}
|
|
191
298
|
onGridMounted(() => {
|
|
192
299
|
mounted = true;
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
untrack(() => controller.update(value));
|
|
300
|
+
if (latest2) {
|
|
301
|
+
run(latest2.value);
|
|
196
302
|
}
|
|
197
303
|
return () => controller.dispose?.();
|
|
198
304
|
});
|
|
199
305
|
}
|
|
200
306
|
|
|
201
307
|
// src/primitives/liveObject.ts
|
|
308
|
+
import { createMemo } from "solid-js";
|
|
202
309
|
function createLiveObject(keys, read) {
|
|
203
310
|
const live = {};
|
|
204
311
|
for (const key of keys) {
|
|
312
|
+
const value = createMemo(() => read()[key]);
|
|
205
313
|
Object.defineProperty(live, key, {
|
|
206
314
|
enumerable: true,
|
|
207
|
-
get:
|
|
315
|
+
get: value
|
|
208
316
|
});
|
|
209
317
|
}
|
|
210
318
|
return live;
|
|
211
319
|
}
|
|
212
320
|
|
|
213
321
|
// src/view/GridHeaderRow.tsx
|
|
214
|
-
import { For, Show, createMemo } from "solid-js";
|
|
322
|
+
import { For, Show, createMemo as createMemo2 } from "solid-js";
|
|
215
323
|
import { isActiveColumnFilterValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
216
324
|
import {
|
|
217
325
|
DETAIL_TOGGLE_COLUMN_KEY,
|
|
@@ -287,9 +395,9 @@ function GridHeaderRow(props) {
|
|
|
287
395
|
</Show>
|
|
288
396
|
<For each={props.entries} keyed={(entry) => entry.column.key}>
|
|
289
397
|
{(entry) => {
|
|
290
|
-
const column =
|
|
291
|
-
const colIndex =
|
|
292
|
-
const size =
|
|
398
|
+
const column = createMemo2(() => entry().column);
|
|
399
|
+
const colIndex = createMemo2(() => entry().logicalIndex);
|
|
400
|
+
const size = createMemo2(() => entry().paneLocalSize);
|
|
293
401
|
const isFiltered = () => isActiveColumnFilterValue(props.columnFilterValues[column().key]);
|
|
294
402
|
const isColumnSelected = () => props.selection.kind === "col" && colIndex() >= props.selection.startCol && colIndex() <= props.selection.endCol;
|
|
295
403
|
const sortIndex = () => props.sort.findIndex((item) => item.columnKey === column().key);
|
|
@@ -441,7 +549,7 @@ function GridHeaderRow(props) {
|
|
|
441
549
|
}
|
|
442
550
|
|
|
443
551
|
// src/view/GridBodyLayer.tsx
|
|
444
|
-
import { For as For2, Show as Show2, createMemo as
|
|
552
|
+
import { For as For2, Show as Show2, createMemo as createMemo4, untrack as untrack3 } from "solid-js";
|
|
445
553
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
446
554
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
447
555
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -452,13 +560,13 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
452
560
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
453
561
|
|
|
454
562
|
// src/primitives/memoWhen.ts
|
|
455
|
-
import { createMemo as
|
|
563
|
+
import { createMemo as createMemo3, getOwner as getOwner2, isDisposed as isDisposed2, runWithOwner, untrack as untrack2 } from "solid-js";
|
|
456
564
|
function createMemoWhen(needed, compute, empty) {
|
|
457
565
|
const guarded = () => needed() ? compute() : empty;
|
|
458
566
|
if (untrack2(needed)) {
|
|
459
|
-
return
|
|
567
|
+
return createMemo3(guarded);
|
|
460
568
|
}
|
|
461
|
-
const owner =
|
|
569
|
+
const owner = getOwner2();
|
|
462
570
|
let memo;
|
|
463
571
|
return () => {
|
|
464
572
|
if (memo) {
|
|
@@ -467,10 +575,10 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
467
575
|
if (!needed()) {
|
|
468
576
|
return empty;
|
|
469
577
|
}
|
|
470
|
-
if (!owner ||
|
|
578
|
+
if (!owner || isDisposed2(owner)) {
|
|
471
579
|
return compute();
|
|
472
580
|
}
|
|
473
|
-
memo = runWithOwner(owner, () =>
|
|
581
|
+
memo = runWithOwner(owner, () => createMemo3(guarded));
|
|
474
582
|
return memo();
|
|
475
583
|
};
|
|
476
584
|
}
|
|
@@ -489,7 +597,7 @@ function GridBodyLayer(props) {
|
|
|
489
597
|
const texts = useGridLocaleText();
|
|
490
598
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
491
599
|
{(item) => {
|
|
492
|
-
const rowIndex =
|
|
600
|
+
const rowIndex = createMemo4(() => item().index);
|
|
493
601
|
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
494
602
|
if (SkeletonRow) {
|
|
495
603
|
return <SkeletonRow
|
|
@@ -513,8 +621,8 @@ function GridBodyLayer(props) {
|
|
|
513
621
|
/>;
|
|
514
622
|
}
|
|
515
623
|
const row = () => props.rowModel.getRow(rowIndex());
|
|
516
|
-
const groupRow =
|
|
517
|
-
const labelRow =
|
|
624
|
+
const groupRow = createMemo4(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
625
|
+
const labelRow = createMemo4(
|
|
518
626
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
519
627
|
);
|
|
520
628
|
return <>
|
|
@@ -548,8 +656,8 @@ function GridBodyLayer(props) {
|
|
|
548
656
|
{(label) => {
|
|
549
657
|
const layer = () => props.labelRowLayer;
|
|
550
658
|
const LabelRow = untrack3(layer)?.Row;
|
|
551
|
-
const labelSlot =
|
|
552
|
-
const labelRowKey =
|
|
659
|
+
const labelSlot = createMemo4(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
660
|
+
const labelRowKey = createMemo4(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
553
661
|
return LabelRow ? <LabelRow
|
|
554
662
|
pane={props.pane}
|
|
555
663
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -573,14 +681,14 @@ function GridBodyLayer(props) {
|
|
|
573
681
|
{(currentRow) => {
|
|
574
682
|
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
575
683
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
576
|
-
const rowSize =
|
|
577
|
-
const isRowChecked =
|
|
684
|
+
const rowSize = createMemo4(() => item().size ?? props.rowHeight);
|
|
685
|
+
const isRowChecked = createMemo4(
|
|
578
686
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
579
687
|
);
|
|
580
|
-
const isRowSelected =
|
|
688
|
+
const isRowSelected = createMemo4(
|
|
581
689
|
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
582
690
|
);
|
|
583
|
-
const selectedColRange =
|
|
691
|
+
const selectedColRange = createMemo4(() => {
|
|
584
692
|
const selection = props.selection;
|
|
585
693
|
if (selection.kind === "col") {
|
|
586
694
|
return [selection.startCol, selection.endCol];
|
|
@@ -592,9 +700,9 @@ function GridBodyLayer(props) {
|
|
|
592
700
|
});
|
|
593
701
|
const selectedColStart = () => selectedColRange()[0];
|
|
594
702
|
const selectedColEnd = () => selectedColRange()[1];
|
|
595
|
-
const activeCol =
|
|
596
|
-
const rowFindHits =
|
|
597
|
-
const rowFindCurrent =
|
|
703
|
+
const activeCol = createMemo4(() => props.activeCell?.row === rowIndex() ? props.activeCell.col : -1);
|
|
704
|
+
const rowFindHits = createMemo4(() => props.findIndex.get(rowIndex()));
|
|
705
|
+
const rowFindCurrent = createMemo4(() => {
|
|
598
706
|
const hits = rowFindHits();
|
|
599
707
|
const current = hits ? props.findCurrentIndex : null;
|
|
600
708
|
if (!hits || current === null) {
|
|
@@ -607,10 +715,10 @@ function GridBodyLayer(props) {
|
|
|
607
715
|
}
|
|
608
716
|
return null;
|
|
609
717
|
});
|
|
610
|
-
const editingCol =
|
|
611
|
-
const rowAutoHeight =
|
|
612
|
-
const isHovered =
|
|
613
|
-
const rowSlot =
|
|
718
|
+
const editingCol = createMemo4(() => props.editingCell?.row === rowIndex() ? props.editingCell.col : -1);
|
|
719
|
+
const rowAutoHeight = createMemo4(() => !!props.autoHeight);
|
|
720
|
+
const isHovered = createMemo4(() => props.hoveredRowIndex === rowIndex());
|
|
721
|
+
const rowSlot = createMemo4(
|
|
614
722
|
() => resolveSlotProps(
|
|
615
723
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
616
724
|
row: currentRow(),
|
|
@@ -679,14 +787,14 @@ function GridBodyLayer(props) {
|
|
|
679
787
|
</Show2>
|
|
680
788
|
<For2 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
681
789
|
{(entry) => {
|
|
682
|
-
const unbound =
|
|
790
|
+
const unbound = createMemo4(() => entry().column);
|
|
683
791
|
const column = () => unbound();
|
|
684
|
-
const colIndex =
|
|
792
|
+
const colIndex = createMemo4(() => entry().logicalIndex);
|
|
685
793
|
const size = () => entry().paneLocalSize;
|
|
686
794
|
const isActive = () => activeCol() === colIndex();
|
|
687
795
|
const isEditing = () => editingCol() === colIndex();
|
|
688
796
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
689
|
-
const readOnlyCell =
|
|
797
|
+
const readOnlyCell = createMemo4(
|
|
690
798
|
() => !isCellEditable(
|
|
691
799
|
{ readOnly: props.readOnly, canEditCell: props.canEditCell },
|
|
692
800
|
rowIndex(),
|
|
@@ -891,10 +999,10 @@ function GridBodyLayer(props) {
|
|
|
891
999
|
</Show2>
|
|
892
1000
|
<Show2
|
|
893
1001
|
when={isAutoHeightCell()}
|
|
894
|
-
fallback={props.renderCellContent(currentRow
|
|
1002
|
+
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
895
1003
|
>
|
|
896
1004
|
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
897
|
-
{props.renderCellContent(currentRow
|
|
1005
|
+
{props.renderCellContent(currentRow, column(), cellState)}
|
|
898
1006
|
</div>
|
|
899
1007
|
</Show2>
|
|
900
1008
|
</div>;
|
|
@@ -927,7 +1035,7 @@ function Overlay(props) {
|
|
|
927
1035
|
}
|
|
928
1036
|
|
|
929
1037
|
// src/view/GridDetailLayer.tsx
|
|
930
|
-
import { For as For3, Show as Show4, createMemo as
|
|
1038
|
+
import { For as For3, Show as Show4, createMemo as createMemo5, onCleanup, untrack as untrack4 } from "solid-js";
|
|
931
1039
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
932
1040
|
var stopPropagation = (event) => {
|
|
933
1041
|
event.stopPropagation();
|
|
@@ -939,7 +1047,7 @@ var mergeSlotStyles = (...styles) => {
|
|
|
939
1047
|
function GridDetailLayer(props) {
|
|
940
1048
|
return <For3 each={props.entries} keyed={(entry) => entry.rowKey}>
|
|
941
1049
|
{(entry) => {
|
|
942
|
-
const index =
|
|
1050
|
+
const index = createMemo5(() => entry().virtualRow.index);
|
|
943
1051
|
const detailSize = () => entry().virtualRow.detailSize ?? 0;
|
|
944
1052
|
return <Show4 when={detailSize() > 0}>
|
|
945
1053
|
<div
|
|
@@ -967,8 +1075,8 @@ function GridDetailLayer(props) {
|
|
|
967
1075
|
function DetailCard(props) {
|
|
968
1076
|
const layer = props.layer;
|
|
969
1077
|
const rowKey = untrack4(() => props.entry().rowKey);
|
|
970
|
-
const row =
|
|
971
|
-
const sourceRowIndex =
|
|
1078
|
+
const row = createMemo5(() => layer.rowModel.getRow(props.index()));
|
|
1079
|
+
const sourceRowIndex = createMemo5(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
972
1080
|
const ctx = {
|
|
973
1081
|
get row() {
|
|
974
1082
|
return row();
|
|
@@ -1056,13 +1164,13 @@ function CheckboxCell(props) {
|
|
|
1056
1164
|
}
|
|
1057
1165
|
|
|
1058
1166
|
// src/editors/CellEditorLayer.tsx
|
|
1059
|
-
import { Show as Show8, createMemo as
|
|
1167
|
+
import { Show as Show8, createMemo as createMemo6, untrack as untrack11 } from "solid-js";
|
|
1060
1168
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1061
1169
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1062
1170
|
import { formatLocaleText as formatLocaleText3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1063
1171
|
|
|
1064
1172
|
// src/editors/TextCellEditor.tsx
|
|
1065
|
-
import { Show as Show6, createRenderEffect as createRenderEffect3, createSignal as
|
|
1173
|
+
import { Show as Show6, createRenderEffect as createRenderEffect3, createSignal as createSignal5, onCleanup as onCleanup2, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1066
1174
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1067
1175
|
import {
|
|
1068
1176
|
fitMultilineEditor,
|
|
@@ -1089,7 +1197,7 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1089
1197
|
}
|
|
1090
1198
|
|
|
1091
1199
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1092
|
-
import { Show as Show5, createSignal as
|
|
1200
|
+
import { Show as Show5, createSignal as createSignal4, onSettled as onSettled2 } from "solid-js";
|
|
1093
1201
|
import {
|
|
1094
1202
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1095
1203
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1102,7 +1210,7 @@ function CellEditorError(props) {
|
|
|
1102
1210
|
}
|
|
1103
1211
|
function CellEditorErrorBubble(props) {
|
|
1104
1212
|
let element;
|
|
1105
|
-
const [placement2, setPlacement] =
|
|
1213
|
+
const [placement2, setPlacement] = createSignal4(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1106
1214
|
onSettled2(() => {
|
|
1107
1215
|
if (element) {
|
|
1108
1216
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1126,11 +1234,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1126
1234
|
|
|
1127
1235
|
// src/editors/TextCellEditor.tsx
|
|
1128
1236
|
function TextCellEditor(props) {
|
|
1129
|
-
const [input, setInput] =
|
|
1130
|
-
const [textarea, setTextarea] =
|
|
1131
|
-
const [error, setError] =
|
|
1237
|
+
const [input, setInput] = createSignal5();
|
|
1238
|
+
const [textarea, setTextarea] = createSignal5();
|
|
1239
|
+
const [error, setError] = createSignal5(null);
|
|
1132
1240
|
const initialValue = untrack6(() => props.initialValue);
|
|
1133
|
-
const [draft, setDraft] =
|
|
1241
|
+
const [draft, setDraft] = createSignal5(initialValue);
|
|
1134
1242
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1135
1243
|
const alignTop = () => props.alignTop ?? false;
|
|
1136
1244
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1251,15 +1359,15 @@ function TextCellEditor(props) {
|
|
|
1251
1359
|
}
|
|
1252
1360
|
|
|
1253
1361
|
// src/editors/NumberCellEditor.tsx
|
|
1254
|
-
import { createSignal as
|
|
1362
|
+
import { createSignal as createSignal6, onCleanup as onCleanup3, onSettled as onSettled4, untrack as untrack7 } from "solid-js";
|
|
1255
1363
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1256
1364
|
import {
|
|
1257
1365
|
resolveNumberEditorCommitValue,
|
|
1258
1366
|
resolveNumberEditorStart
|
|
1259
1367
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1260
1368
|
function NumberCellEditor(props) {
|
|
1261
|
-
const [input, setInput] =
|
|
1262
|
-
const [error, setError] =
|
|
1369
|
+
const [input, setInput] = createSignal6();
|
|
1370
|
+
const [error, setError] = createSignal6(null);
|
|
1263
1371
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1264
1372
|
const start = resolveNumberEditorStart(untrack7(() => props.initialValue));
|
|
1265
1373
|
const textMode = start.textMode;
|
|
@@ -1320,7 +1428,7 @@ import {
|
|
|
1320
1428
|
Show as Show7,
|
|
1321
1429
|
createEffect as createEffect2,
|
|
1322
1430
|
createRenderEffect as createRenderEffect4,
|
|
1323
|
-
createSignal as
|
|
1431
|
+
createSignal as createSignal7,
|
|
1324
1432
|
createUniqueId,
|
|
1325
1433
|
onCleanup as onCleanup4,
|
|
1326
1434
|
onSettled as onSettled5,
|
|
@@ -1340,22 +1448,22 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1340
1448
|
function SelectCellEditor(props) {
|
|
1341
1449
|
const texts = useGridLocaleText();
|
|
1342
1450
|
const portal = useGridPortal();
|
|
1343
|
-
const [input, setInput] =
|
|
1344
|
-
const [list, setList] =
|
|
1451
|
+
const [input, setInput] = createSignal7();
|
|
1452
|
+
const [list, setList] = createSignal7();
|
|
1345
1453
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1346
1454
|
const listId = createUniqueId();
|
|
1347
1455
|
const start = untrack8(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1348
1456
|
let typeahead = start.typeahead;
|
|
1349
|
-
const [highlight, setHighlight] =
|
|
1457
|
+
const [highlight, setHighlight] = createSignal7(start.highlight);
|
|
1350
1458
|
let currentHighlight = start.highlight;
|
|
1351
1459
|
const updateHighlight = (next) => {
|
|
1352
1460
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1353
1461
|
setHighlight(currentHighlight);
|
|
1354
1462
|
};
|
|
1355
|
-
const [placement2, setPlacement] =
|
|
1463
|
+
const [placement2, setPlacement] = createSignal7(null);
|
|
1356
1464
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1357
|
-
const [error, setError] =
|
|
1358
|
-
const [composing, setComposing] =
|
|
1465
|
+
const [error, setError] = createSignal7(null);
|
|
1466
|
+
const [composing, setComposing] = createSignal7(null);
|
|
1359
1467
|
let composingNow = null;
|
|
1360
1468
|
const updateComposing = (next) => {
|
|
1361
1469
|
composingNow = next;
|
|
@@ -1565,15 +1673,15 @@ function SelectCellEditor(props) {
|
|
|
1565
1673
|
}
|
|
1566
1674
|
|
|
1567
1675
|
// src/editors/DateCellEditor.tsx
|
|
1568
|
-
import { createSignal as
|
|
1676
|
+
import { createSignal as createSignal8, onCleanup as onCleanup5, onSettled as onSettled6, untrack as untrack9 } from "solid-js";
|
|
1569
1677
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1570
1678
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1571
1679
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1572
1680
|
function DateCellEditor(props) {
|
|
1573
1681
|
const texts = useGridLocaleText();
|
|
1574
|
-
const [input, setInput] =
|
|
1575
|
-
const [error, setError] =
|
|
1576
|
-
const [shift, setShift] =
|
|
1682
|
+
const [input, setInput] = createSignal8();
|
|
1683
|
+
const [error, setError] = createSignal8(null);
|
|
1684
|
+
const [shift, setShift] = createSignal8(0);
|
|
1577
1685
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1578
1686
|
const initialText = untrack9(() => props.initialText);
|
|
1579
1687
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
@@ -1658,8 +1766,8 @@ function CustomCellEditor(props) {
|
|
|
1658
1766
|
// src/editors/CellEditorLayer.tsx
|
|
1659
1767
|
function CellEditorLayer(props) {
|
|
1660
1768
|
const texts = useGridLocaleText();
|
|
1661
|
-
const editor = () => props.
|
|
1662
|
-
const kind =
|
|
1769
|
+
const editor = () => props.editor;
|
|
1770
|
+
const kind = createMemo6(() => {
|
|
1663
1771
|
const type = editor()?.type;
|
|
1664
1772
|
return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
|
|
1665
1773
|
});
|
|
@@ -1668,7 +1776,7 @@ function CellEditorLayer(props) {
|
|
|
1668
1776
|
return session ? formatLocaleText3(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1669
1777
|
};
|
|
1670
1778
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1671
|
-
const selectOptions =
|
|
1779
|
+
const selectOptions = createMemo6(() => {
|
|
1672
1780
|
const current = editor();
|
|
1673
1781
|
if (current?.type !== "select") {
|
|
1674
1782
|
return [];
|
|
@@ -1679,6 +1787,42 @@ function CellEditorLayer(props) {
|
|
|
1679
1787
|
const row = props.session?.row;
|
|
1680
1788
|
return row !== void 0 ? current.options(row) : [];
|
|
1681
1789
|
});
|
|
1790
|
+
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1791
|
+
const session = createMemo6(
|
|
1792
|
+
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session : previous
|
|
1793
|
+
);
|
|
1794
|
+
const context = {
|
|
1795
|
+
get row() {
|
|
1796
|
+
return session()?.row;
|
|
1797
|
+
},
|
|
1798
|
+
get rowIndex() {
|
|
1799
|
+
return session()?.rowIndex ?? -1;
|
|
1800
|
+
},
|
|
1801
|
+
get sourceRowIndex() {
|
|
1802
|
+
return session()?.sourceRowIndex ?? -1;
|
|
1803
|
+
},
|
|
1804
|
+
get rowKey() {
|
|
1805
|
+
return session()?.rowKey ?? -1;
|
|
1806
|
+
},
|
|
1807
|
+
get colIndex() {
|
|
1808
|
+
return session()?.colIndex ?? -1;
|
|
1809
|
+
},
|
|
1810
|
+
get column() {
|
|
1811
|
+
return session()?.column;
|
|
1812
|
+
},
|
|
1813
|
+
get value() {
|
|
1814
|
+
return session()?.value;
|
|
1815
|
+
},
|
|
1816
|
+
initialText: initialValue,
|
|
1817
|
+
get align() {
|
|
1818
|
+
return props.align;
|
|
1819
|
+
},
|
|
1820
|
+
// void の戻り(モックなど)は noop にそろえて、利用側の分岐を単純にします。
|
|
1821
|
+
commit: (value, direction) => props.onCommit(value, direction) ?? { status: "noop" },
|
|
1822
|
+
cancel: () => props.onCancel()
|
|
1823
|
+
};
|
|
1824
|
+
return <CustomCellEditor render={render} context={context} />;
|
|
1825
|
+
};
|
|
1682
1826
|
const renderEditor = (type, sessionId) => {
|
|
1683
1827
|
const common = {
|
|
1684
1828
|
get ariaLabel() {
|
|
@@ -1735,43 +1879,10 @@ function CellEditorLayer(props) {
|
|
|
1735
1879
|
}
|
|
1736
1880
|
case "custom": {
|
|
1737
1881
|
const current = untrack11(editor);
|
|
1738
|
-
if (current?.type !== "custom"
|
|
1882
|
+
if (current?.type !== "custom") {
|
|
1739
1883
|
return null;
|
|
1740
1884
|
}
|
|
1741
|
-
|
|
1742
|
-
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session : previous
|
|
1743
|
-
);
|
|
1744
|
-
const context = {
|
|
1745
|
-
get row() {
|
|
1746
|
-
return session()?.row;
|
|
1747
|
-
},
|
|
1748
|
-
get rowIndex() {
|
|
1749
|
-
return session()?.rowIndex ?? -1;
|
|
1750
|
-
},
|
|
1751
|
-
get sourceRowIndex() {
|
|
1752
|
-
return session()?.sourceRowIndex ?? -1;
|
|
1753
|
-
},
|
|
1754
|
-
get rowKey() {
|
|
1755
|
-
return session()?.rowKey ?? -1;
|
|
1756
|
-
},
|
|
1757
|
-
get colIndex() {
|
|
1758
|
-
return session()?.colIndex ?? -1;
|
|
1759
|
-
},
|
|
1760
|
-
get column() {
|
|
1761
|
-
return session()?.column;
|
|
1762
|
-
},
|
|
1763
|
-
get value() {
|
|
1764
|
-
return session()?.value;
|
|
1765
|
-
},
|
|
1766
|
-
initialText: initialValue,
|
|
1767
|
-
get align() {
|
|
1768
|
-
return props.align;
|
|
1769
|
-
},
|
|
1770
|
-
// void の戻り(モックなど)は noop にそろえて、利用側の分岐を単純にします。
|
|
1771
|
-
commit: (value, direction) => props.onCommit(value, direction) ?? { status: "noop" },
|
|
1772
|
-
cancel: () => props.onCancel()
|
|
1773
|
-
};
|
|
1774
|
-
return <CustomCellEditor render={current.render} context={context} />;
|
|
1885
|
+
return <Show8 when={props.session !== null}>{renderCustomEditor(current.render, sessionId, initialValue)}</Show8>;
|
|
1775
1886
|
}
|
|
1776
1887
|
default: {
|
|
1777
1888
|
const textEditor = () => {
|
|
@@ -1812,7 +1923,7 @@ function CellEditorLayer(props) {
|
|
|
1812
1923
|
}
|
|
1813
1924
|
|
|
1814
1925
|
// src/view/DefaultGridTopBar.tsx
|
|
1815
|
-
import { Show as Show9, createMemo as
|
|
1926
|
+
import { Show as Show9, createMemo as createMemo7, createRenderEffect as createRenderEffect5, createSignal as createSignal9, createUniqueId as createUniqueId2, untrack as untrack12 } from "solid-js";
|
|
1816
1927
|
var DefaultFilterIcon = () => <svg
|
|
1817
1928
|
width="14"
|
|
1818
1929
|
height="14"
|
|
@@ -1844,7 +1955,7 @@ function DefaultGridTopBar(props) {
|
|
|
1844
1955
|
const texts = useGridLocaleText();
|
|
1845
1956
|
const filterSummaryId = createUniqueId2();
|
|
1846
1957
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1847
|
-
const [input, setInput] =
|
|
1958
|
+
const [input, setInput] = createSignal9();
|
|
1848
1959
|
const initialText = untrack12(() => props.globalFilterText);
|
|
1849
1960
|
createRenderEffect5(
|
|
1850
1961
|
() => [input(), props.globalFilterText],
|
|
@@ -1856,7 +1967,7 @@ function DefaultGridTopBar(props) {
|
|
|
1856
1967
|
{ name: "globalFilterInput" }
|
|
1857
1968
|
);
|
|
1858
1969
|
const hasFilterText = () => props.globalFilterText.trim().length > 0;
|
|
1859
|
-
const filterIcon =
|
|
1970
|
+
const filterIcon = createMemo7(() => {
|
|
1860
1971
|
const icon = props.globalFilterIcon;
|
|
1861
1972
|
return icon === void 0 ? <DefaultFilterIcon /> : icon;
|
|
1862
1973
|
});
|
|
@@ -1964,7 +2075,7 @@ function DefaultGridBottomBar(props) {
|
|
|
1964
2075
|
}
|
|
1965
2076
|
|
|
1966
2077
|
// src/devWarnings.ts
|
|
1967
|
-
import { $PROXY, createEffect as createEffect3, createMemo as
|
|
2078
|
+
import { $PROXY, createEffect as createEffect3, createMemo as createMemo8 } from "solid-js";
|
|
1968
2079
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
1969
2080
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
1970
2081
|
import {
|
|
@@ -1975,7 +2086,7 @@ import {
|
|
|
1975
2086
|
var noop2 = () => {
|
|
1976
2087
|
};
|
|
1977
2088
|
var createChangeEffect = (compute, effect) => {
|
|
1978
|
-
createEffect3(
|
|
2089
|
+
createEffect3(createMemo8(compute), effect, { name: "devWarning" });
|
|
1979
2090
|
};
|
|
1980
2091
|
var FEATURE_PROPS = {
|
|
1981
2092
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2207,6 +2318,19 @@ var warnMoveRowOnServerSide = () => {
|
|
|
2207
2318
|
);
|
|
2208
2319
|
}
|
|
2209
2320
|
};
|
|
2321
|
+
var READ_ONLY_HANDLE_METHOD = /^(get|is|can|export)/;
|
|
2322
|
+
var warnHandleCallBeforeMount = (warned, method) => {
|
|
2323
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2324
|
+
if (warned.current || READ_ONLY_HANDLE_METHOD.test(method)) {
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2327
|
+
warned.current = true;
|
|
2328
|
+
console.warn(
|
|
2329
|
+
`[SpreadsheetGrid] \u30B0\u30EA\u30C3\u30C9\u3092\u63CF\u304F\u524D(<Loading> \u306E\u4E2D\u3067\u884C\u3092\u5F85\u3063\u3066\u3044\u308B\u9593\u306A\u3069)\u306B ${method}() \u304C\u547C\u3070\u308C\u305F\u305F\u3081\u3001\u4F55\u3082\u3057\u307E\u305B\u3093\u3002\u6700\u521D\u306E\u72B6\u614B\u306F initialState \u3067\u6E21\u3059\u304B\u3001\u884C\u3092\u8AAD\u3080 effect(createEffect(() => rows(), \u2026))\u304B\u3089\u547C\u3093\u3067\u304F\u3060\u3055\u3044\u3002
|
|
2330
|
+
[SpreadsheetGrid] ${method}() was called before the grid was drawn (for example while <Loading> waits for the rows), so it does nothing. Pass the first state with initialState, or call it from an effect that reads the rows (createEffect(() => rows(), \u2026)).`
|
|
2331
|
+
);
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2210
2334
|
|
|
2211
2335
|
// src/SpreadsheetGrid.tsx
|
|
2212
2336
|
var EMPTY_ROWS = [];
|
|
@@ -2228,10 +2352,10 @@ var applyHandleRef = (ref, handle) => {
|
|
|
2228
2352
|
var exposeHandle = (handle, before) => {
|
|
2229
2353
|
const exposed = {};
|
|
2230
2354
|
for (const [key, value] of Object.entries(handle)) {
|
|
2231
|
-
exposed[key] = typeof value === "function" ? (...args) => {
|
|
2232
|
-
before();
|
|
2355
|
+
exposed[key] = typeof value === "function" ? (...args) => runHandleCall(() => {
|
|
2356
|
+
before(key);
|
|
2233
2357
|
return value(...args);
|
|
2234
|
-
} : value;
|
|
2358
|
+
}) : value;
|
|
2235
2359
|
}
|
|
2236
2360
|
return exposed;
|
|
2237
2361
|
};
|
|
@@ -2257,9 +2381,37 @@ function GridShell(props, features) {
|
|
|
2257
2381
|
}
|
|
2258
2382
|
function GridShellBody(props, features, mountGate) {
|
|
2259
2383
|
const serverSideFeature2 = features.serverSide;
|
|
2260
|
-
const isServerSide =
|
|
2261
|
-
const
|
|
2262
|
-
const
|
|
2384
|
+
const isServerSide = createMemo9(() => props.dataSource != null);
|
|
2385
|
+
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2386
|
+
const [hydrated, setHydrated] = createSignal10(!isServer && !isHydrating2(), { name: "hydrated" });
|
|
2387
|
+
if (!untrack13(hydrated)) {
|
|
2388
|
+
onGridMounted(() => {
|
|
2389
|
+
setHydrated(true);
|
|
2390
|
+
});
|
|
2391
|
+
}
|
|
2392
|
+
const [relayedRows, setRelayedRows] = createSignal10(null);
|
|
2393
|
+
createEffect4(
|
|
2394
|
+
() => latest(() => props.rows),
|
|
2395
|
+
{
|
|
2396
|
+
effect: (value) => {
|
|
2397
|
+
setRelayedRows({ value });
|
|
2398
|
+
},
|
|
2399
|
+
// 行の読み込みの失敗(非同期の memo の取り直しの失敗など)は、利用側の <Errored> へそのまま渡します(段階 4 の測り直し
|
|
2400
|
+
// S7-02。行を JSX で読んだときと同じ。受けないと、effect ごとに同じエラーが console へ出ていた)。
|
|
2401
|
+
error: (error) => {
|
|
2402
|
+
throw error;
|
|
2403
|
+
}
|
|
2404
|
+
},
|
|
2405
|
+
{ name: "relayRows" }
|
|
2406
|
+
);
|
|
2407
|
+
const rows = createMemo9(() => {
|
|
2408
|
+
if (props.dataSource != null || !hydrated()) {
|
|
2409
|
+
return EMPTY_ROWS;
|
|
2410
|
+
}
|
|
2411
|
+
const relayed = relayedRows();
|
|
2412
|
+
return (relayed ? relayed.value : props.rows) ?? EMPTY_ROWS;
|
|
2413
|
+
});
|
|
2414
|
+
const columns = createMemo9(() => props.columns);
|
|
2263
2415
|
const density = () => props.density ?? "standard";
|
|
2264
2416
|
const rowHeight = () => props.rowHeight ?? GRID_DENSITY_DIMENSIONS[density()].rowHeight;
|
|
2265
2417
|
const columnHeaderHeight = () => props.headerHeight ?? GRID_DENSITY_DIMENSIONS[density()].headerHeight;
|
|
@@ -2277,7 +2429,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2277
2429
|
const enableRowSelection = () => props.enableRowSelection ?? false;
|
|
2278
2430
|
const rowSelectionMode = () => props.rowSelectionMode ?? "multiple";
|
|
2279
2431
|
const enableSelectAllRows = () => props.enableSelectAllRows ?? (enableRowSelection() && rowSelectionMode() === "multiple");
|
|
2280
|
-
const detailRowEnabled =
|
|
2432
|
+
const detailRowEnabled = createMemo9(() => props.detailRow != null);
|
|
2281
2433
|
const detailToggleColumnActive = () => props.detailRow != null && props.detailRow.showToggleColumn !== false;
|
|
2282
2434
|
const columnInputs = () => ({
|
|
2283
2435
|
columns: columns(),
|
|
@@ -2289,29 +2441,29 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2289
2441
|
renderDetailToggleCell
|
|
2290
2442
|
});
|
|
2291
2443
|
const resolveLocaleText = createLocaleTextResolver(mergeFeatureLocaleDefaults(features));
|
|
2292
|
-
const localeTexts =
|
|
2444
|
+
const localeTexts = createMemo9(() => resolveLocaleText(props.localeText));
|
|
2293
2445
|
const totalRowFeature2 = features.totalRow;
|
|
2294
2446
|
const TotalRow = totalRowFeature2?.TotalRow;
|
|
2295
2447
|
const PinnedRows = features.pinnedRows?.PinnedRows;
|
|
2296
|
-
const totalRowOptions =
|
|
2448
|
+
const totalRowOptions = createMemo9(
|
|
2297
2449
|
() => typeof props.totalRow === "object" && props.totalRow !== null ? props.totalRow : null
|
|
2298
2450
|
);
|
|
2299
|
-
const totalRowEnabled =
|
|
2451
|
+
const totalRowEnabled = createMemo9(
|
|
2300
2452
|
() => (props.totalRow === true || totalRowOptions() !== null) && totalRowFeature2 !== void 0
|
|
2301
2453
|
);
|
|
2302
2454
|
const totalRowLabel = () => totalRowOptions()?.label ?? localeTexts().totalRowLabel;
|
|
2303
|
-
const totalRowHeight =
|
|
2304
|
-
const pinnedTop =
|
|
2455
|
+
const totalRowHeight = createMemo9(() => totalRowEnabled() ? Math.max(0, totalRowOptions()?.height ?? rowHeight()) : 0);
|
|
2456
|
+
const pinnedTop = createMemo9(
|
|
2305
2457
|
() => PinnedRows && props.pinnedTopRows && props.pinnedTopRows.length > 0 ? props.pinnedTopRows : null
|
|
2306
2458
|
);
|
|
2307
|
-
const pinnedBottom =
|
|
2459
|
+
const pinnedBottom = createMemo9(
|
|
2308
2460
|
() => PinnedRows && props.pinnedBottomRows && props.pinnedBottomRows.length > 0 ? props.pinnedBottomRows : null
|
|
2309
2461
|
);
|
|
2310
2462
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2311
2463
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2312
|
-
const headerHeight =
|
|
2313
|
-
const footerHeight =
|
|
2314
|
-
const pinnedBelowTotal =
|
|
2464
|
+
const headerHeight = createMemo9(() => columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2465
|
+
const footerHeight = createMemo9(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2466
|
+
const pinnedBelowTotal = createMemo9(
|
|
2315
2467
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2316
2468
|
);
|
|
2317
2469
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
@@ -2330,9 +2482,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2330
2482
|
const store = engine.store;
|
|
2331
2483
|
const dispatch = store.dispatch;
|
|
2332
2484
|
const { state: ui, view } = createGridStoreSignals(store);
|
|
2333
|
-
const viewportWidth =
|
|
2334
|
-
const viewportHeight =
|
|
2335
|
-
const viewScrollTop =
|
|
2485
|
+
const viewportWidth = createMemo9(() => view().viewportWidth);
|
|
2486
|
+
const viewportHeight = createMemo9(() => view().viewportHeight);
|
|
2487
|
+
const viewScrollTop = createMemo9(() => view().scrollTop);
|
|
2336
2488
|
const viewSetters = createGridViewSetters(store);
|
|
2337
2489
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2338
2490
|
const gridRootRef = { current: null };
|
|
@@ -2354,16 +2506,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2354
2506
|
const shell = gridRootRef.current;
|
|
2355
2507
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2356
2508
|
});
|
|
2357
|
-
const columnResolution =
|
|
2509
|
+
const columnResolution = createMemo9(() => engine.resolveColumns(columnInputs()));
|
|
2358
2510
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2359
2511
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2360
2512
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
2361
2513
|
const groupColumns = () => columnResolution().groupColumns;
|
|
2362
2514
|
const aggColumns = () => columnResolution().aggColumns;
|
|
2363
|
-
const activeGroupColumns =
|
|
2364
|
-
const resolvedRowKeyGetter =
|
|
2365
|
-
const selectionSnapshot =
|
|
2366
|
-
const paneResolution =
|
|
2515
|
+
const activeGroupColumns = createMemo9(() => rowGroupingActive() ? groupColumns() : NO_COLUMNS);
|
|
2516
|
+
const resolvedRowKeyGetter = createMemo9(() => props.rowKeyGetter ?? ((_row, index) => index));
|
|
2517
|
+
const selectionSnapshot = createMemo9(() => buildSelectionSnapshot(ui().selection));
|
|
2518
|
+
const paneResolution = createMemo9(
|
|
2367
2519
|
() => engine.resolvePaneLayout({
|
|
2368
2520
|
orderedColumns: orderedColumns(),
|
|
2369
2521
|
columnWidths: ui().columnWidths,
|
|
@@ -2382,23 +2534,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2382
2534
|
{ name: "reconcileColumnWidths" }
|
|
2383
2535
|
);
|
|
2384
2536
|
const labelRowFeature2 = features.labelRow;
|
|
2385
|
-
const labelIsLabelRow =
|
|
2386
|
-
const labelGetLabel =
|
|
2387
|
-
const labelRender =
|
|
2388
|
-
const labelRowClassName =
|
|
2389
|
-
const labelRowHeightOption =
|
|
2390
|
-
const labelSortMode =
|
|
2391
|
-
const labelSticky =
|
|
2392
|
-
const labelExportText =
|
|
2393
|
-
const labelKeepEmptySections =
|
|
2394
|
-
const labelRowEnabled =
|
|
2537
|
+
const labelIsLabelRow = createMemo9(() => props.labelRow?.isLabelRow);
|
|
2538
|
+
const labelGetLabel = createMemo9(() => props.labelRow?.getLabel);
|
|
2539
|
+
const labelRender = createMemo9(() => props.labelRow?.render);
|
|
2540
|
+
const labelRowClassName = createMemo9(() => props.labelRow?.className);
|
|
2541
|
+
const labelRowHeightOption = createMemo9(() => props.labelRow?.height);
|
|
2542
|
+
const labelSortMode = createMemo9(() => props.labelRow?.sortMode ?? "section");
|
|
2543
|
+
const labelSticky = createMemo9(() => props.labelRow?.sticky === true);
|
|
2544
|
+
const labelExportText = createMemo9(() => props.labelRow?.exportText);
|
|
2545
|
+
const labelKeepEmptySections = createMemo9(() => props.labelRow?.keepEmptySections ?? false);
|
|
2546
|
+
const labelRowEnabled = createMemo9(
|
|
2395
2547
|
() => labelIsLabelRow() != null && labelGetLabel() != null && labelRowFeature2 !== void 0
|
|
2396
2548
|
);
|
|
2397
2549
|
const StickyLabelLayer = labelRowFeature2?.StickyLabelLayer;
|
|
2398
|
-
const labelLayout =
|
|
2550
|
+
const labelLayout = createMemo9(
|
|
2399
2551
|
() => engine.rowPipeline.resolveLabelRowLayout(rows(), isServerSide() ? void 0 : labelIsLabelRow())
|
|
2400
2552
|
);
|
|
2401
|
-
const filterCandidateRows =
|
|
2553
|
+
const filterCandidateRows = createMemo9(() => {
|
|
2402
2554
|
const layout = labelLayout();
|
|
2403
2555
|
const currentRows = rows();
|
|
2404
2556
|
if (!layout) {
|
|
@@ -2416,11 +2568,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2416
2568
|
}
|
|
2417
2569
|
return dataRows;
|
|
2418
2570
|
});
|
|
2419
|
-
const baseOrder =
|
|
2420
|
-
const globalFilterText =
|
|
2421
|
-
const columnFilters =
|
|
2422
|
-
const filterSortColumns =
|
|
2423
|
-
const globalFilterColumns =
|
|
2571
|
+
const baseOrder = createMemo9(() => engine.rowPipeline.resolveBaseOrder(rows().length, labelLayout()));
|
|
2572
|
+
const globalFilterText = createMemo9(() => selectGlobalFilter(ui()));
|
|
2573
|
+
const columnFilters = createMemo9(() => ui().filters.columnFilters);
|
|
2574
|
+
const filterSortColumns = createMemo9(() => columnResolution().filterSortColumns);
|
|
2575
|
+
const globalFilterColumns = createMemo9(() => {
|
|
2424
2576
|
const groups = activeGroupColumns();
|
|
2425
2577
|
return groups.length > 0 ? [...visibleColumns(), ...groups] : visibleColumns();
|
|
2426
2578
|
});
|
|
@@ -2444,7 +2596,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2444
2596
|
const globalFilterStatus = filterOrder ? filterOrder.globalFilterStatus : () => "idle";
|
|
2445
2597
|
const globalFilterProgress = filterOrder ? filterOrder.globalFilterProgress : () => 1;
|
|
2446
2598
|
const relativeDateKey = filterOrder ? filterOrder.relativeDateKey : () => "";
|
|
2447
|
-
const orderResolution =
|
|
2599
|
+
const orderResolution = createMemo9(
|
|
2448
2600
|
() => engine.rowPipeline.resolveOrder({
|
|
2449
2601
|
rows: rows(),
|
|
2450
2602
|
labelLayout: labelLayout(),
|
|
@@ -2462,7 +2614,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2462
2614
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
2463
2615
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
2464
2616
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
2465
|
-
const clientRowModel =
|
|
2617
|
+
const clientRowModel = createMemo9(
|
|
2466
2618
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
2467
2619
|
rows: rows(),
|
|
2468
2620
|
order: orderResolution().order,
|
|
@@ -2481,7 +2633,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2481
2633
|
manualSorting: manualSorting()
|
|
2482
2634
|
})
|
|
2483
2635
|
);
|
|
2484
|
-
const liveServerSideQuery =
|
|
2636
|
+
const liveServerSideQuery = createMemo9(
|
|
2485
2637
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
2486
2638
|
isServerSide: isServerSide(),
|
|
2487
2639
|
globalFilterEnabled: globalFilterEnabled(),
|
|
@@ -2500,19 +2652,19 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2500
2652
|
"serverSideQueryStore"
|
|
2501
2653
|
);
|
|
2502
2654
|
const serverSideQuerySnapshot = createExternalStoreSignal(engine.serverSideQueryStore, "serverSideQueryStore");
|
|
2503
|
-
const serverSideQueryKey =
|
|
2655
|
+
const serverSideQueryKey = createMemo9(() => serverSideQuerySnapshot().queryKey);
|
|
2504
2656
|
const serverSide = serverSideFeature2?.createServerSide(() => ({
|
|
2505
2657
|
dataSource: props.dataSource,
|
|
2506
2658
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
2507
2659
|
query: serverSideQuerySnapshot().query,
|
|
2508
2660
|
queryKey: serverSideQuerySnapshot().queryKey,
|
|
2509
2661
|
refreshToken: props.serverSideRefreshToken,
|
|
2510
|
-
onLoadError: props.onServerSideLoadError,
|
|
2511
|
-
onWriteError: props.onServerSideWriteError,
|
|
2662
|
+
onLoadError: inOwnTick(props.onServerSideLoadError),
|
|
2663
|
+
onWriteError: inOwnTick(props.onServerSideWriteError),
|
|
2512
2664
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2513
2665
|
onWriteStateChange: engine.saveStatus.handle
|
|
2514
2666
|
}));
|
|
2515
|
-
const rowModel =
|
|
2667
|
+
const rowModel = createMemo9(() => {
|
|
2516
2668
|
if (!isServerSide() || !serverSide) {
|
|
2517
2669
|
return clientRowModel().rowModel;
|
|
2518
2670
|
}
|
|
@@ -2521,24 +2673,24 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2521
2673
|
const getLabel = labelGetLabel();
|
|
2522
2674
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
2523
2675
|
});
|
|
2524
|
-
const canEditCell =
|
|
2676
|
+
const canEditCell = createMemo9(
|
|
2525
2677
|
() => isServerSide() && !(serverSide?.canUpdateRows() ?? false) ? NEVER_EDITABLE : props.canEditCell
|
|
2526
2678
|
);
|
|
2527
|
-
const applyServerSideCellEdits =
|
|
2679
|
+
const applyServerSideCellEdits = createMemo9(
|
|
2528
2680
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
2529
2681
|
);
|
|
2530
|
-
const viewRowCount =
|
|
2682
|
+
const viewRowCount = createMemo9(() => rowModel().getRowCount());
|
|
2531
2683
|
const viewColCount = () => orderedColumns().length;
|
|
2532
2684
|
const order = () => orderResolution().order;
|
|
2533
2685
|
const groupTree = () => clientRowModel().groupTree;
|
|
2534
2686
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
2535
|
-
const labelViewIndexes =
|
|
2536
|
-
const leafRowCount =
|
|
2687
|
+
const labelViewIndexes = createMemo9(() => labelDisplay()?.labelViewIndexes);
|
|
2688
|
+
const leafRowCount = createMemo9(
|
|
2537
2689
|
() => clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : viewRowCount()
|
|
2538
2690
|
);
|
|
2539
2691
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
2540
2692
|
const groupingFeature2 = features.grouping;
|
|
2541
|
-
const getFilteredRows =
|
|
2693
|
+
const getFilteredRows = createMemo9(() => {
|
|
2542
2694
|
const currentOrder = order();
|
|
2543
2695
|
const currentRows = rows();
|
|
2544
2696
|
let cache = null;
|
|
@@ -2552,7 +2704,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2552
2704
|
{ name: "clampSelectionToRowCount" }
|
|
2553
2705
|
);
|
|
2554
2706
|
const autoHeightSnapshot = createExternalStoreSignal(engine.autoHeightMeasurer, "autoHeightStore");
|
|
2555
|
-
const vertical =
|
|
2707
|
+
const vertical = createMemo9(
|
|
2556
2708
|
() => engine.resolveVerticalLayout({
|
|
2557
2709
|
isServerSide: isServerSide(),
|
|
2558
2710
|
autoHeight: props.autoHeight ?? false,
|
|
@@ -2589,13 +2741,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2589
2741
|
detailActive: () => vertical().detailActive,
|
|
2590
2742
|
globalFilterText,
|
|
2591
2743
|
columnFilterCount: () => Object.keys(columnFilters()).length,
|
|
2592
|
-
rows
|
|
2744
|
+
// 写した rows を読みます(取り直しの失敗を、写しの effect だけが <Errored> へ渡すように。S7-02)。写す前は props.rows。
|
|
2745
|
+
rows: () => {
|
|
2746
|
+
const relayed = relayedRows();
|
|
2747
|
+
return relayed ? relayed.value : props.rows;
|
|
2748
|
+
}
|
|
2593
2749
|
});
|
|
2594
|
-
const stickyLabelIndexes =
|
|
2750
|
+
const stickyLabelIndexes = createMemo9(() => {
|
|
2595
2751
|
const indexes = labelViewIndexes();
|
|
2596
2752
|
return labelSticky() && labelRowFeature2 && indexes && indexes.length > 0 ? indexes : null;
|
|
2597
2753
|
});
|
|
2598
|
-
const stickyLabelEntry =
|
|
2754
|
+
const stickyLabelEntry = createMemo9(() => {
|
|
2599
2755
|
const indexes = stickyLabelIndexes();
|
|
2600
2756
|
if (!indexes || !labelRowFeature2) {
|
|
2601
2757
|
return null;
|
|
@@ -2621,7 +2777,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2621
2777
|
pushOffset: resolution.pushOffset
|
|
2622
2778
|
};
|
|
2623
2779
|
});
|
|
2624
|
-
const stickyTopInset =
|
|
2780
|
+
const stickyTopInset = createMemo9(() => {
|
|
2625
2781
|
const indexes = stickyLabelIndexes();
|
|
2626
2782
|
const feature = labelRowFeature2;
|
|
2627
2783
|
if (!indexes || !feature) {
|
|
@@ -2638,8 +2794,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2638
2794
|
};
|
|
2639
2795
|
});
|
|
2640
2796
|
const conditionalFormatFeature2 = features.conditionalFormat;
|
|
2641
|
-
const conditionalFormatStats =
|
|
2642
|
-
const totalRowCells =
|
|
2797
|
+
const conditionalFormatStats = createMemo9(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
|
|
2798
|
+
const totalRowCells = createMemo9(
|
|
2643
2799
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
2644
2800
|
rows: rows(),
|
|
2645
2801
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
@@ -2648,11 +2804,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2648
2804
|
values: totalRowOptions()?.values
|
|
2649
2805
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
2650
2806
|
);
|
|
2651
|
-
const totalRowLabelColumnKey =
|
|
2807
|
+
const totalRowLabelColumnKey = createMemo9(
|
|
2652
2808
|
() => totalRowFeature2 ? totalRowFeature2.resolveTotalRowLabelColumnKey(orderedColumns(), totalRowCells()) : null
|
|
2653
2809
|
);
|
|
2654
2810
|
const columnAutosizeFeature2 = features.columnAutosize;
|
|
2655
|
-
const totalRowAutosizeTexts =
|
|
2811
|
+
const totalRowAutosizeTexts = createMemo9(() => {
|
|
2656
2812
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
2657
2813
|
return void 0;
|
|
2658
2814
|
}
|
|
@@ -2671,10 +2827,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2671
2827
|
}
|
|
2672
2828
|
return texts;
|
|
2673
2829
|
});
|
|
2674
|
-
const pinnedAutosizeRows =
|
|
2830
|
+
const pinnedAutosizeRows = createMemo9(
|
|
2675
2831
|
() => pinnedTop() || pinnedBottom() ? [...pinnedTop() ?? [], ...pinnedBottom() ?? []] : void 0
|
|
2676
2832
|
);
|
|
2677
|
-
const autosizeChipOf =
|
|
2833
|
+
const autosizeChipOf = createMemo9(() => {
|
|
2678
2834
|
const chipFeature = conditionalFormatFeature2;
|
|
2679
2835
|
if (!chipFeature) {
|
|
2680
2836
|
return void 0;
|
|
@@ -2749,27 +2905,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2749
2905
|
"effect",
|
|
2750
2906
|
"autoSizeOnData"
|
|
2751
2907
|
);
|
|
2752
|
-
const totalRowSlotSignature =
|
|
2753
|
-
const totalRowSlot =
|
|
2754
|
-
const totalRowExport =
|
|
2908
|
+
const totalRowSlotSignature = createMemo9(() => serializeSlotValue(totalRowOptions()?.className));
|
|
2909
|
+
const totalRowSlot = createMemo9(() => resolveSlotFromSignature(totalRowSlotSignature()));
|
|
2910
|
+
const totalRowExport = createMemo9(
|
|
2755
2911
|
() => totalRowEnabled() ? { cells: totalRowCells(), label: totalRowLabel() } : void 0
|
|
2756
2912
|
);
|
|
2757
|
-
const pinnedRowsExport =
|
|
2913
|
+
const pinnedRowsExport = createMemo9(
|
|
2758
2914
|
() => pinnedTop() || pinnedBottom() ? { top: pinnedTop() ?? [], bottom: pinnedBottom() ?? [], bottomAfterTotal: pinnedBelowTotal() } : void 0
|
|
2759
2915
|
);
|
|
2760
2916
|
const scrollHintFeature2 = features.scrollHint;
|
|
2761
2917
|
const findFeature2 = features.find;
|
|
2762
2918
|
const imeFeature = features.imeDirectInput;
|
|
2763
|
-
const resolvedScrollHint =
|
|
2919
|
+
const resolvedScrollHint = createMemo9(
|
|
2764
2920
|
() => scrollHintFeature2 ? scrollHintFeature2.resolveScrollHintOptions(props.scrollHint) : null
|
|
2765
2921
|
);
|
|
2766
|
-
const activeScrollHint =
|
|
2922
|
+
const activeScrollHint = createMemo9(() => {
|
|
2767
2923
|
const resolved = resolvedScrollHint();
|
|
2768
2924
|
return resolved !== null && viewRowCount() >= resolved.minRows ? resolved : null;
|
|
2769
2925
|
});
|
|
2770
|
-
const customScrollbar =
|
|
2771
|
-
const autoHeightActive =
|
|
2772
|
-
const bodyRows =
|
|
2926
|
+
const customScrollbar = createMemo9(() => activeScrollHint()?.scrollbar === true);
|
|
2927
|
+
const autoHeightActive = createMemo9(() => vertical().autoHeightActive);
|
|
2928
|
+
const bodyRows = createMemo9(() => {
|
|
2773
2929
|
const { virtualRows, virtualRowIndexes } = vertical();
|
|
2774
2930
|
const model = rowModel();
|
|
2775
2931
|
const serverSideActive = isServerSide();
|
|
@@ -2809,7 +2965,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2809
2965
|
connectController(engine.scrollSync, () => ({
|
|
2810
2966
|
scrollContainerRef,
|
|
2811
2967
|
setViewState: store.setViewState,
|
|
2812
|
-
onScroll: props.onScroll,
|
|
2968
|
+
onScroll: inOwnTick(props.onScroll),
|
|
2813
2969
|
// 見える高さは下端に固定する行(合計行 / 下の固定行)に隠れるぶんを除く。
|
|
2814
2970
|
footerHeight: footerHeight()
|
|
2815
2971
|
}), "effect", "scrollSync");
|
|
@@ -2852,8 +3008,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2852
3008
|
},
|
|
2853
3009
|
{ name: "detailRowsQueryReset" }
|
|
2854
3010
|
);
|
|
2855
|
-
const windowFirstRow =
|
|
2856
|
-
const windowLastRow =
|
|
3011
|
+
const windowFirstRow = createMemo9(() => vertical().windowFirstRow);
|
|
3012
|
+
const windowLastRow = createMemo9(() => vertical().windowLastRow);
|
|
2857
3013
|
createEffect4(
|
|
2858
3014
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
2859
3015
|
([serverSideActive, firstRow, lastRow]) => {
|
|
@@ -2864,7 +3020,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2864
3020
|
},
|
|
2865
3021
|
{ name: "serverSideRequestRange" }
|
|
2866
3022
|
);
|
|
2867
|
-
const columnMeasurements =
|
|
3023
|
+
const columnMeasurements = createMemo9(
|
|
2868
3024
|
() => buildColumnMeasurements(visibleColumns(), paneResolution().effectiveColumnWidths)
|
|
2869
3025
|
);
|
|
2870
3026
|
const measuredByColumnVirtualizer = { measure: () => {
|
|
@@ -2883,11 +3039,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2883
3039
|
measureKey: columnMeasurements()
|
|
2884
3040
|
};
|
|
2885
3041
|
});
|
|
2886
|
-
const centerRenderEntries =
|
|
3042
|
+
const centerRenderEntries = createMemo9(() => {
|
|
2887
3043
|
const entries = centerEntries();
|
|
2888
3044
|
return columnVirtualizer.items().map((item) => entries[item.index]).filter((entry) => Boolean(entry));
|
|
2889
3045
|
});
|
|
2890
|
-
const activeCellRendered =
|
|
3046
|
+
const activeCellRendered = createMemo9(
|
|
2891
3047
|
() => isActiveCellRendered(ui().activeCell, vertical().virtualRowIndexes, rowModel(), [
|
|
2892
3048
|
paneLayout().left.entries,
|
|
2893
3049
|
centerRenderEntries(),
|
|
@@ -2922,28 +3078,28 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2922
3078
|
}), "render", "saveStatus");
|
|
2923
3079
|
const systemPrefersDark = createExternalStoreSignal(systemColorSchemeStore, "systemColorSchemeStore");
|
|
2924
3080
|
const themeClassName = () => resolveGridThemeClassName(props.theme ?? "light", systemPrefersDark());
|
|
2925
|
-
const heightLayout =
|
|
2926
|
-
const slotSignature =
|
|
2927
|
-
const slots =
|
|
3081
|
+
const heightLayout = createMemo9(() => resolveGridHeightLayout(props.height, props.maxHeight));
|
|
3082
|
+
const slotSignature = createMemo9(() => serializeSlotValue(props.classNames));
|
|
3083
|
+
const slots = createMemo9(
|
|
2928
3084
|
() => resolveSlotMapFromSignature(slotSignature())
|
|
2929
3085
|
);
|
|
2930
|
-
const activeCellPlacement =
|
|
3086
|
+
const activeCellPlacement = createMemo9(
|
|
2931
3087
|
() => resolveCellPlacement(ui().activeCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
2932
3088
|
);
|
|
2933
|
-
const editingCellPlacement =
|
|
3089
|
+
const editingCellPlacement = createMemo9(
|
|
2934
3090
|
() => resolveCellPlacement(ui().editingCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
2935
3091
|
);
|
|
2936
|
-
const editorAlignTop =
|
|
3092
|
+
const editorAlignTop = createMemo9(() => {
|
|
2937
3093
|
const editing = ui().editingCell;
|
|
2938
3094
|
const column = editing ? orderedColumns()[editing.col] : void 0;
|
|
2939
3095
|
const placement2 = editingCellPlacement();
|
|
2940
3096
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
2941
3097
|
});
|
|
2942
|
-
const selectionExtents =
|
|
2943
|
-
const selectionBand =
|
|
3098
|
+
const selectionExtents = createMemo9(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3099
|
+
const selectionBand = createMemo9(
|
|
2944
3100
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
2945
3101
|
);
|
|
2946
|
-
const selectionBandSegments =
|
|
3102
|
+
const selectionBandSegments = createMemo9(
|
|
2947
3103
|
() => resolveSelectionBandSegments(
|
|
2948
3104
|
vertical().detailActive,
|
|
2949
3105
|
selectionExtents(),
|
|
@@ -2957,7 +3113,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2957
3113
|
resolvePaneBandRect(selectionExtents(), selectionBand(), pane)
|
|
2958
3114
|
];
|
|
2959
3115
|
const motionExtrasFeature2 = features.motionExtras;
|
|
2960
|
-
const copiedSelection =
|
|
3116
|
+
const copiedSelection = createMemo9(() => {
|
|
2961
3117
|
const copied = view().copiedRange;
|
|
2962
3118
|
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true) || !copied) {
|
|
2963
3119
|
return null;
|
|
@@ -2965,11 +3121,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2965
3121
|
const state = ui();
|
|
2966
3122
|
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;
|
|
2967
3123
|
});
|
|
2968
|
-
const copiedExtents =
|
|
2969
|
-
const copiedBand =
|
|
3124
|
+
const copiedExtents = createMemo9(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3125
|
+
const copiedBand = createMemo9(
|
|
2970
3126
|
() => resolveSelectionBand(copiedExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
2971
3127
|
);
|
|
2972
|
-
const copiedBandSegments =
|
|
3128
|
+
const copiedBandSegments = createMemo9(
|
|
2973
3129
|
() => resolveSelectionBandSegments(
|
|
2974
3130
|
vertical().detailActive,
|
|
2975
3131
|
copiedExtents(),
|
|
@@ -3015,7 +3171,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3015
3171
|
},
|
|
3016
3172
|
{ name: "tooltipSlot" }
|
|
3017
3173
|
);
|
|
3018
|
-
const activeCellTooltipKey =
|
|
3174
|
+
const activeCellTooltipKey = createMemo9(() => {
|
|
3019
3175
|
const active = ui().activeCell;
|
|
3020
3176
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3021
3177
|
});
|
|
@@ -3029,7 +3185,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3029
3185
|
connectController(engine.hoverRowNotifier, () => ({
|
|
3030
3186
|
enableRowHover: enableRowHover(),
|
|
3031
3187
|
isHoverControlled: props.hoveredRowIndex !== void 0,
|
|
3032
|
-
onHoveredRowChange: props.onHoveredRowChange,
|
|
3188
|
+
onHoveredRowChange: inOwnTick(props.onHoveredRowChange),
|
|
3033
3189
|
setHoveredRowIndex: viewSetters.setHoveredRowIndex
|
|
3034
3190
|
}), "render", "hoverRowNotifier");
|
|
3035
3191
|
const applyHoveredRowChange = engine.hoverRowNotifier.applyHoveredRowChange;
|
|
@@ -3076,7 +3232,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3076
3232
|
"effect",
|
|
3077
3233
|
"viewportSync"
|
|
3078
3234
|
);
|
|
3079
|
-
const controlledRowSelectionModel =
|
|
3235
|
+
const controlledRowSelectionModel = createMemo9(() => {
|
|
3080
3236
|
if (props.rowSelection !== void 0) {
|
|
3081
3237
|
return props.rowSelection;
|
|
3082
3238
|
}
|
|
@@ -3085,11 +3241,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3085
3241
|
}
|
|
3086
3242
|
return void 0;
|
|
3087
3243
|
});
|
|
3088
|
-
const filteredDataRows =
|
|
3244
|
+
const filteredDataRows = createMemo9(
|
|
3089
3245
|
() => !isServerSide() && order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null
|
|
3090
3246
|
);
|
|
3091
3247
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3092
|
-
const selectAllRowsState =
|
|
3248
|
+
const selectAllRowsState = createMemo9(() => {
|
|
3093
3249
|
const filtered = filteredDataRows();
|
|
3094
3250
|
return filtered && enableRowSelection() ? resolveSelectAllState(
|
|
3095
3251
|
countSelectedRowsInOrder(ui().rowSelection, filtered.rows, filtered.order, filtered.rowKeyGetter),
|
|
@@ -3101,7 +3257,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3101
3257
|
rowModel: rowModel(),
|
|
3102
3258
|
rowSelectionState: ui().rowSelection,
|
|
3103
3259
|
rowSelectionMode: rowSelectionMode(),
|
|
3104
|
-
onRowSelectionChange: props.onRowSelectionChange,
|
|
3260
|
+
onRowSelectionChange: inOwnTick(props.onRowSelectionChange),
|
|
3105
3261
|
controlledRowSelectionModel: controlledRowSelectionModel(),
|
|
3106
3262
|
leafRowCount: leafRowCount(),
|
|
3107
3263
|
filteredDataRows: filteredDataRows(),
|
|
@@ -3109,7 +3265,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3109
3265
|
}), "render", "rowSelectionCommands");
|
|
3110
3266
|
connectController(
|
|
3111
3267
|
engine.detailKeysNotifier,
|
|
3112
|
-
() => ({ expandedKeys: ui().expandedDetailRowKeys, onChange: props.onExpandedDetailRowKeysChange }),
|
|
3268
|
+
() => ({ expandedKeys: ui().expandedDetailRowKeys, onChange: inOwnTick(props.onExpandedDetailRowKeysChange) }),
|
|
3113
3269
|
"effect",
|
|
3114
3270
|
"detailKeysNotifier"
|
|
3115
3271
|
);
|
|
@@ -3121,8 +3277,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3121
3277
|
keyOf: resolvedRowKeyGetter(),
|
|
3122
3278
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3123
3279
|
}), "render", "detailKeysPruner");
|
|
3124
|
-
const detailDrawable =
|
|
3125
|
-
const hasDetailCards =
|
|
3280
|
+
const detailDrawable = createMemo9(() => vertical().baseRowMetrics.totalBodyHeight <= MAX_BODY_PX2);
|
|
3281
|
+
const hasDetailCards = createMemo9(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3126
3282
|
const detailRows = createDetailRowController();
|
|
3127
3283
|
connectController(detailRows, () => ({
|
|
3128
3284
|
rowModel: rowModel(),
|
|
@@ -3148,11 +3304,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3148
3304
|
),
|
|
3149
3305
|
0
|
|
3150
3306
|
);
|
|
3151
|
-
const detailRender =
|
|
3152
|
-
const detailCardSlotSignature =
|
|
3153
|
-
const detailCardSlot =
|
|
3307
|
+
const detailRender = createMemo9(() => props.detailRow?.render);
|
|
3308
|
+
const detailCardSlotSignature = createMemo9(() => serializeSlotValue(props.detailRow?.className));
|
|
3309
|
+
const detailCardSlot = createMemo9(() => resolveSlotFromSignature(detailCardSlotSignature()));
|
|
3154
3310
|
const collapseDetailRow = (rowKey, viewIndex) => detailRows.setExpandedAt(rowKey, viewIndex, false);
|
|
3155
|
-
const renderLabelRowContent =
|
|
3311
|
+
const renderLabelRowContent = createMemo9(() => {
|
|
3156
3312
|
const render = labelRender();
|
|
3157
3313
|
return render ? (ctx) => render(ctx) : (ctx) => <span class="ssg-label-row-content--default ssg-label-row-default">
|
|
3158
3314
|
<span class="ssg-label-row-text">{ctx.label}</span>
|
|
@@ -3162,7 +3318,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3162
3318
|
const className = labelRowClassName();
|
|
3163
3319
|
return typeof className === "function" ? className(labelRow.row) : className;
|
|
3164
3320
|
};
|
|
3165
|
-
const labelRowLayerCenter =
|
|
3321
|
+
const labelRowLayerCenter = createMemo9(
|
|
3166
3322
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3167
3323
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3168
3324
|
renderContent: renderLabelRowContent(),
|
|
@@ -3171,7 +3327,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3171
3327
|
resolveRowSlot: resolveLabelRowSlot
|
|
3172
3328
|
} : void 0
|
|
3173
3329
|
);
|
|
3174
|
-
const labelRowLayerBand =
|
|
3330
|
+
const labelRowLayerBand = createMemo9(
|
|
3175
3331
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3176
3332
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3177
3333
|
renderContent: null,
|
|
@@ -3180,11 +3336,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3180
3336
|
resolveRowSlot: resolveLabelRowSlot
|
|
3181
3337
|
} : void 0
|
|
3182
3338
|
);
|
|
3183
|
-
const stickyLabelSlot =
|
|
3339
|
+
const stickyLabelSlot = createMemo9(() => {
|
|
3184
3340
|
const entry = stickyLabelEntry();
|
|
3185
3341
|
return resolveSlotProps2(entry ? resolveLabelRowSlot(entry.labelRow) : void 0);
|
|
3186
3342
|
});
|
|
3187
|
-
const labelRowExport =
|
|
3343
|
+
const labelRowExport = createMemo9(() => {
|
|
3188
3344
|
const isLabelRow = labelIsLabelRow();
|
|
3189
3345
|
const getLabel = labelGetLabel();
|
|
3190
3346
|
return labelRowEnabled() && isLabelRow && getLabel ? { isLabelRow, getLabel, exportText: labelExportText() } : void 0;
|
|
@@ -3192,8 +3348,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3192
3348
|
connectController(engine.cellEventNotifier, () => ({
|
|
3193
3349
|
rowModel: rowModel(),
|
|
3194
3350
|
orderedColumns: orderedColumns(),
|
|
3195
|
-
onCellClick: props.onCellClick,
|
|
3196
|
-
onCellDoubleClick: props.onCellDoubleClick
|
|
3351
|
+
onCellClick: inOwnTick(props.onCellClick),
|
|
3352
|
+
onCellDoubleClick: inOwnTick(props.onCellDoubleClick)
|
|
3197
3353
|
}), "render", "cellEventNotifier");
|
|
3198
3354
|
connectController(engine.activeRowFollow, () => ({
|
|
3199
3355
|
enabled: activeRowFollowEnabled(),
|
|
@@ -3214,7 +3370,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3214
3370
|
editingCell: ui().editingCell,
|
|
3215
3371
|
rowModel: rowModel(),
|
|
3216
3372
|
orderedColumns: orderedColumns(),
|
|
3217
|
-
onActiveCellChange: props.onActiveCellChange,
|
|
3373
|
+
onActiveCellChange: inOwnTick(props.onActiveCellChange),
|
|
3218
3374
|
followsRow: activeRowFollowEnabled(),
|
|
3219
3375
|
isRowFollowPending: engine.activeRowFollow.isFollowPending
|
|
3220
3376
|
}),
|
|
@@ -3265,12 +3421,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3265
3421
|
rows: rows(),
|
|
3266
3422
|
selection: ui().selection,
|
|
3267
3423
|
activeCell: ui().activeCell,
|
|
3268
|
-
onRowsChange: props.onRowsChange,
|
|
3424
|
+
onRowsChange: inOwnTick(props.onRowsChange),
|
|
3269
3425
|
dispatch,
|
|
3270
3426
|
// サーバーサイドは rows を持たず戻す先が無いので無効(React 版と同じ)。
|
|
3271
3427
|
enabled: (props.enableUndoRedo ?? true) && !readOnly() && !isServerSide(),
|
|
3272
3428
|
limit: props.undoHistoryLimit ?? 100,
|
|
3273
|
-
onUndoRedoStateChange: props.onUndoRedoStateChange,
|
|
3429
|
+
onUndoRedoStateChange: inOwnTick(props.onUndoRedoStateChange),
|
|
3274
3430
|
onAfterRestore: (activeCell) => {
|
|
3275
3431
|
if (activeCell) {
|
|
3276
3432
|
requestAnimationFrame(() => engine.gridApi.scrollToCellInternal(activeCell.row, activeCell.col, "auto"));
|
|
@@ -3281,7 +3437,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3281
3437
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
3282
3438
|
const cells = createCellCommands();
|
|
3283
3439
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
3284
|
-
const orderedColumnKeys =
|
|
3440
|
+
const orderedColumnKeys = createMemo9(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
3285
3441
|
const clipboard = createClipboardController();
|
|
3286
3442
|
connectController(clipboard, () => ({
|
|
3287
3443
|
rows: rows(),
|
|
@@ -3311,16 +3467,16 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3311
3467
|
},
|
|
3312
3468
|
createRow: props.createRow,
|
|
3313
3469
|
createOverflowColumn: props.createOverflowColumn,
|
|
3314
|
-
onPasteSkipped: props.onPasteSkipped,
|
|
3470
|
+
onPasteSkipped: inOwnTick(props.onPasteSkipped),
|
|
3315
3471
|
localeTexts: localeTexts(),
|
|
3316
3472
|
pasteFillsSelection: props.pasteFillsSelection,
|
|
3317
3473
|
onRowsChange: handleRowsChange(),
|
|
3318
|
-
onColumnsChange: props.onColumnsChange,
|
|
3474
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3319
3475
|
applyServerSideCellEdits: applyServerSideCellEdits(),
|
|
3320
3476
|
isRowExportable: props.isRowExportable,
|
|
3321
3477
|
dispatch
|
|
3322
3478
|
}), "render", "clipboard");
|
|
3323
|
-
const isWholeGridSelected =
|
|
3479
|
+
const isWholeGridSelected = createMemo9(
|
|
3324
3480
|
() => computeIsWholeGridSelected(ui().selection, viewRowCount(), visibleColumns().length)
|
|
3325
3481
|
);
|
|
3326
3482
|
const fillHandleFeature2 = features.fillHandle;
|
|
@@ -3355,13 +3511,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3355
3511
|
const pageHeight = Math.max(viewportHeight() - headerHeight(), rowHeight());
|
|
3356
3512
|
return resolvePageTargetRow(vertical().rowMetrics, fromRow, direction, pageHeight);
|
|
3357
3513
|
};
|
|
3358
|
-
const findEnabled =
|
|
3359
|
-
const findOptions =
|
|
3360
|
-
const findShortcut =
|
|
3514
|
+
const findEnabled = createMemo9(() => props.find !== false && props.find !== void 0 && findFeature2 !== void 0);
|
|
3515
|
+
const findOptions = createMemo9(() => typeof props.find === "object" ? props.find : null);
|
|
3516
|
+
const findShortcut = createMemo9(() => findEnabled() && (findOptions()?.shortcut ?? true));
|
|
3361
3517
|
const findSnapshot = createExternalStoreSignal(engine.find, "findStore");
|
|
3362
3518
|
const FindBar = findFeature2?.FindBar;
|
|
3363
|
-
const findIndex =
|
|
3364
|
-
const findCurrentIndex =
|
|
3519
|
+
const findIndex = createMemo9(() => findSnapshot().index);
|
|
3520
|
+
const findCurrentIndex = createMemo9(() => findSnapshot().currentIndex);
|
|
3365
3521
|
connectController(engine.find, () => ({
|
|
3366
3522
|
enabled: findEnabled(),
|
|
3367
3523
|
rowModel: rowModel(),
|
|
@@ -3373,7 +3529,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3373
3529
|
onNavigate: (rowIndex, colIndex) => {
|
|
3374
3530
|
engine.gridApi.handle.selectCell(rowIndex, colIndex, { scrollIntoView: true });
|
|
3375
3531
|
},
|
|
3376
|
-
onChange: props.onFindChange
|
|
3532
|
+
onChange: inOwnTick(props.onFindChange)
|
|
3377
3533
|
}), "render", "find");
|
|
3378
3534
|
const openFindFromShortcut = () => engine.find.open();
|
|
3379
3535
|
const closeFindAndRefocus = () => {
|
|
@@ -3487,7 +3643,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3487
3643
|
if (!items || items.length === 0) {
|
|
3488
3644
|
return false;
|
|
3489
3645
|
}
|
|
3490
|
-
props.onContextMenuOpen
|
|
3646
|
+
if (props.onContextMenuOpen) {
|
|
3647
|
+
callInOwnTick(props.onContextMenuOpen, params);
|
|
3648
|
+
}
|
|
3491
3649
|
contextMenu.open(params, items, { focus: "firstItem" });
|
|
3492
3650
|
return true;
|
|
3493
3651
|
};
|
|
@@ -3551,10 +3709,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3551
3709
|
return;
|
|
3552
3710
|
}
|
|
3553
3711
|
event.preventDefault();
|
|
3554
|
-
props.onContextMenuOpen
|
|
3712
|
+
if (props.onContextMenuOpen) {
|
|
3713
|
+
callInOwnTick(props.onContextMenuOpen, params);
|
|
3714
|
+
}
|
|
3555
3715
|
contextMenu.open(params, items);
|
|
3556
3716
|
};
|
|
3557
|
-
const contextMenuView =
|
|
3717
|
+
const contextMenuView = createMemo9(() => {
|
|
3558
3718
|
const snapshot = contextMenu?.snapshot();
|
|
3559
3719
|
if (!snapshot?.state || !snapshot.layout) {
|
|
3560
3720
|
return null;
|
|
@@ -3625,7 +3785,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3625
3785
|
startEditWithValue: edit.startEditWithValue,
|
|
3626
3786
|
dispatch
|
|
3627
3787
|
}), "render", "cells");
|
|
3628
|
-
const imeDirectInputEnabled =
|
|
3788
|
+
const imeDirectInputEnabled = createMemo9(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
3629
3789
|
connectController(
|
|
3630
3790
|
engine.imeInput,
|
|
3631
3791
|
() => {
|
|
@@ -3716,7 +3876,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3716
3876
|
visibleColumns: visibleColumns(),
|
|
3717
3877
|
orderedColumns: orderedColumns(),
|
|
3718
3878
|
columnWidths: paneResolution().effectiveColumnWidths,
|
|
3719
|
-
onColumnsChange: props.onColumnsChange,
|
|
3879
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3720
3880
|
dispatch,
|
|
3721
3881
|
enableSorting: enableSorting(),
|
|
3722
3882
|
sort: ui().sort,
|
|
@@ -3741,7 +3901,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3741
3901
|
groupColumns: activeGroupColumns,
|
|
3742
3902
|
localeTexts
|
|
3743
3903
|
});
|
|
3744
|
-
const columnChooserItems =
|
|
3904
|
+
const columnChooserItems = createMemo9(
|
|
3745
3905
|
() => columns().map((column) => ({
|
|
3746
3906
|
key: column.key,
|
|
3747
3907
|
title: column.title || column.key,
|
|
@@ -3751,11 +3911,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3751
3911
|
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
3752
3912
|
}))
|
|
3753
3913
|
);
|
|
3754
|
-
const sortManagerColumns =
|
|
3914
|
+
const sortManagerColumns = createMemo9(
|
|
3755
3915
|
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
3756
3916
|
);
|
|
3757
3917
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
3758
|
-
const toolPanelTabs =
|
|
3918
|
+
const toolPanelTabs = createMemo9(
|
|
3759
3919
|
() => (toolPanel?.availableTabs() ?? []).map((tab) => {
|
|
3760
3920
|
const texts = localeTexts();
|
|
3761
3921
|
if (tab === "filter") {
|
|
@@ -3771,7 +3931,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3771
3931
|
return { tab, label: texts.toolPanelColumns };
|
|
3772
3932
|
})
|
|
3773
3933
|
);
|
|
3774
|
-
const columnMenuGroupingAvailable =
|
|
3934
|
+
const columnMenuGroupingAvailable = createMemo9(
|
|
3775
3935
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
3776
3936
|
);
|
|
3777
3937
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
@@ -3789,7 +3949,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3789
3949
|
ghostSlot: slots().dragGhost,
|
|
3790
3950
|
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
3791
3951
|
}));
|
|
3792
|
-
const columnDragHandler =
|
|
3952
|
+
const columnDragHandler = createMemo9(
|
|
3793
3953
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
3794
3954
|
);
|
|
3795
3955
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
@@ -3818,12 +3978,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3818
3978
|
const movedRow = currentRows[fromIndex];
|
|
3819
3979
|
const nextRows = next;
|
|
3820
3980
|
onRowsChange(nextRows);
|
|
3821
|
-
props.onRowMove
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3981
|
+
if (props.onRowMove) {
|
|
3982
|
+
callInOwnTick(props.onRowMove, {
|
|
3983
|
+
rowKey: resolvedRowKeyGetter()(movedRow, fromIndex),
|
|
3984
|
+
fromIndex,
|
|
3985
|
+
toIndex,
|
|
3986
|
+
rows: nextRows
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3827
3989
|
return true;
|
|
3828
3990
|
};
|
|
3829
3991
|
const moveRowByKey = (rowKey, toIndex) => {
|
|
@@ -3957,7 +4119,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3957
4119
|
paneLayout: paneLayout(),
|
|
3958
4120
|
orderedColumns: orderedColumns(),
|
|
3959
4121
|
columns: columns(),
|
|
3960
|
-
onColumnsChange: props.onColumnsChange,
|
|
4122
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3961
4123
|
includeGroupingInState: props.includeGroupingInState ?? false,
|
|
3962
4124
|
uiState: ui(),
|
|
3963
4125
|
getUiState: store.getState,
|
|
@@ -4015,9 +4177,15 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4015
4177
|
},
|
|
4016
4178
|
{ name: "gridApiBottomPin" }
|
|
4017
4179
|
);
|
|
4018
|
-
|
|
4019
|
-
|
|
4180
|
+
const handleCallBeforeMountWarned = { current: false };
|
|
4181
|
+
applyHandleRef(untrack13(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4182
|
+
if (mountGate.done) {
|
|
4183
|
+
return;
|
|
4184
|
+
}
|
|
4185
|
+
if (gridRootRef.current?.isConnected === true) {
|
|
4020
4186
|
flushMountGate(mountGate);
|
|
4187
|
+
} else {
|
|
4188
|
+
warnHandleCallBeforeMount(handleCallBeforeMountWarned, method);
|
|
4021
4189
|
}
|
|
4022
4190
|
}));
|
|
4023
4191
|
connectController(
|
|
@@ -4030,9 +4198,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4030
4198
|
columns: columns(),
|
|
4031
4199
|
collapsedGroupKeys: ui().collapsedGroupKeys,
|
|
4032
4200
|
includeGroupingInState: props.includeGroupingInState ?? false,
|
|
4033
|
-
onStateChange: props.onStateChange,
|
|
4034
|
-
onFiltersChange: props.onFiltersChange,
|
|
4035
|
-
onSortChange: props.onSortChange
|
|
4201
|
+
onStateChange: inOwnTick(props.onStateChange),
|
|
4202
|
+
onFiltersChange: inOwnTick(props.onFiltersChange),
|
|
4203
|
+
onSortChange: inOwnTick(props.onSortChange)
|
|
4036
4204
|
}),
|
|
4037
4205
|
"effect",
|
|
4038
4206
|
"stateChangeNotifier"
|
|
@@ -4057,14 +4225,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4057
4225
|
element.removeEventListener("keydown", onKey, { capture: true });
|
|
4058
4226
|
};
|
|
4059
4227
|
});
|
|
4060
|
-
const columnNamer =
|
|
4228
|
+
const columnNamer = createMemo9(
|
|
4061
4229
|
() => createDataColumnNamer(orderedColumns(), {
|
|
4062
4230
|
detail: localeTexts().detailColumnName,
|
|
4063
4231
|
rowDrag: localeTexts().rowDragColumnName
|
|
4064
4232
|
})
|
|
4065
4233
|
);
|
|
4066
|
-
const rowNumberer =
|
|
4067
|
-
const slotContextBase =
|
|
4234
|
+
const rowNumberer = createMemo9(() => createDataRowNumberer(labelViewIndexes()));
|
|
4235
|
+
const slotContextBase = createMemo9(() => ({
|
|
4068
4236
|
rows: rows(),
|
|
4069
4237
|
columns: props.columns,
|
|
4070
4238
|
visibleColumns: visibleColumns(),
|
|
@@ -4074,8 +4242,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4074
4242
|
activeCell: ui().activeCell,
|
|
4075
4243
|
selection: ui().selection
|
|
4076
4244
|
}));
|
|
4077
|
-
const derivedSummary =
|
|
4078
|
-
|
|
4245
|
+
const derivedSummary = createMemo9(() => {
|
|
4246
|
+
const summary = buildGridDerivedSummary(
|
|
4079
4247
|
filteringAvailable ? slotContextBase() : { ...slotContextBase(), globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4080
4248
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
4081
4249
|
// (ラベル行が無ければ rows の数)。サーバーサイドは rows が空なので、サーバーが返した今の条件での件数(React 版と同じ)。
|
|
@@ -4084,8 +4252,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4084
4252
|
columnNamer(),
|
|
4085
4253
|
rowNumberer(),
|
|
4086
4254
|
localeTexts()
|
|
4087
|
-
)
|
|
4088
|
-
|
|
4255
|
+
);
|
|
4256
|
+
return hydrated() ? summary : { ...summary, rowSummaryText: "" };
|
|
4257
|
+
});
|
|
4089
4258
|
const setGlobalFilterText = (value) => dispatch(gridActions.setGlobalFilter(value));
|
|
4090
4259
|
const selectionAggregatesFeature2 = features.selectionAggregates;
|
|
4091
4260
|
const selectionAggregates = selectionAggregatesFeature2 ? selectionAggregatesFeature2.createSelectionAggregates(() => ({
|
|
@@ -4095,7 +4264,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4095
4264
|
orderedColumns: orderedColumns(),
|
|
4096
4265
|
rowModel: rowModel()
|
|
4097
4266
|
})) : () => null;
|
|
4098
|
-
const slotContext =
|
|
4267
|
+
const slotContext = createMemo9(() => {
|
|
4099
4268
|
const filteredRows = getFilteredRows();
|
|
4100
4269
|
return {
|
|
4101
4270
|
...slotContextBase(),
|
|
@@ -4110,15 +4279,15 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4110
4279
|
};
|
|
4111
4280
|
});
|
|
4112
4281
|
const liveSlotContext = createLiveObject(SLOT_CONTEXT_KEYS, slotContext);
|
|
4113
|
-
const renderTopBarFn =
|
|
4114
|
-
const renderBottomBarFn =
|
|
4115
|
-
const customTopBar =
|
|
4282
|
+
const renderTopBarFn = createMemo9(() => props.renderTopBar);
|
|
4283
|
+
const renderBottomBarFn = createMemo9(() => props.renderBottomBar);
|
|
4284
|
+
const customTopBar = createMemo9(() => {
|
|
4116
4285
|
const render = renderTopBarFn();
|
|
4117
|
-
return render ?
|
|
4286
|
+
return render ? render(liveSlotContext) : void 0;
|
|
4118
4287
|
});
|
|
4119
|
-
const customBottomBar =
|
|
4288
|
+
const customBottomBar = createMemo9(() => {
|
|
4120
4289
|
const render = renderBottomBarFn();
|
|
4121
|
-
return render ?
|
|
4290
|
+
return render ? render(liveSlotContext) : void 0;
|
|
4122
4291
|
});
|
|
4123
4292
|
const showTopBarSummary = () => props.showTopBarSummary ?? true;
|
|
4124
4293
|
const showTopBarFilter = () => (props.showTopBarFilter ?? true) && globalFilterEnabled();
|
|
@@ -4158,7 +4327,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4158
4327
|
{customBottomBar()}
|
|
4159
4328
|
</Show11>
|
|
4160
4329
|
</Show11>;
|
|
4161
|
-
const editorSession =
|
|
4330
|
+
const editorSession = createMemo9((previous) => {
|
|
4162
4331
|
const cell = ui().editingCell;
|
|
4163
4332
|
if (cell === null) {
|
|
4164
4333
|
return null;
|
|
@@ -4186,8 +4355,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4186
4355
|
const rekeyed = !Object.is(identity.rowKey, previous.identity.rowKey) || identity.columnKey !== previous.identity.columnKey;
|
|
4187
4356
|
return { id: rekeyed ? previous.id + 1 : previous.id, identity };
|
|
4188
4357
|
});
|
|
4189
|
-
const editorSessionId =
|
|
4190
|
-
const
|
|
4358
|
+
const editorSessionId = createMemo9(() => editorSession()?.id ?? null);
|
|
4359
|
+
const editingColumn = createMemo9(() => {
|
|
4360
|
+
const cell = ui().editingCell;
|
|
4361
|
+
return cell === null ? void 0 : orderedColumns()[cell.col];
|
|
4362
|
+
});
|
|
4363
|
+
const editingSessionInfo = createMemo9(() => {
|
|
4191
4364
|
const cell = ui().editingCell;
|
|
4192
4365
|
if (cell === null) {
|
|
4193
4366
|
return null;
|
|
@@ -4233,7 +4406,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4233
4406
|
if (!RowDragHandle2 || !rowDrag) {
|
|
4234
4407
|
return null;
|
|
4235
4408
|
}
|
|
4236
|
-
const draggable =
|
|
4409
|
+
const draggable = createMemo9(() => {
|
|
4237
4410
|
const isRowDraggable = props.isRowDraggable;
|
|
4238
4411
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
4239
4412
|
});
|
|
@@ -4245,15 +4418,26 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4245
4418
|
/>
|
|
4246
4419
|
</Show11>;
|
|
4247
4420
|
};
|
|
4248
|
-
const renderCellContent = (
|
|
4421
|
+
const renderCellContent = (currentRow, column, cell) => {
|
|
4249
4422
|
if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
4250
|
-
return renderRowDragHandleCell(
|
|
4423
|
+
return renderRowDragHandleCell(currentRow(), cell);
|
|
4251
4424
|
}
|
|
4252
4425
|
const unbound = column;
|
|
4426
|
+
if (!column.renderCell && column.editor?.type === "checkbox") {
|
|
4427
|
+
const editor = column.editor;
|
|
4428
|
+
return <CheckboxCell
|
|
4429
|
+
slot={slots().checkbox}
|
|
4430
|
+
label={column.title || column.key}
|
|
4431
|
+
checked={isCheckboxChecked(getCellValue2(currentRow(), unbound), editor)}
|
|
4432
|
+
readOnly={cell.readOnly}
|
|
4433
|
+
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4434
|
+
/>;
|
|
4435
|
+
}
|
|
4436
|
+
const row = currentRow();
|
|
4253
4437
|
const value = getCellValue2(row, unbound);
|
|
4254
4438
|
if (column.renderCell) {
|
|
4255
|
-
const expanded =
|
|
4256
|
-
const expandable =
|
|
4439
|
+
const expanded = createMemo9(() => ui().expandedDetailRowKeys.has(cell.rowKey));
|
|
4440
|
+
const expandable = createMemo9(
|
|
4257
4441
|
() => isDetailRowExpandable(detailDrawable(), props.detailRow?.isExpandable, row, cell.rowKey, cell.sourceRowIndex)
|
|
4258
4442
|
);
|
|
4259
4443
|
const detail = {
|
|
@@ -4298,16 +4482,6 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4298
4482
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4299
4483
|
});
|
|
4300
4484
|
}
|
|
4301
|
-
if (column.editor?.type === "checkbox") {
|
|
4302
|
-
const editor = column.editor;
|
|
4303
|
-
return <CheckboxCell
|
|
4304
|
-
slot={slots().checkbox}
|
|
4305
|
-
label={column.title || column.key}
|
|
4306
|
-
checked={isCheckboxChecked(value, editor)}
|
|
4307
|
-
readOnly={cell.readOnly}
|
|
4308
|
-
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4309
|
-
/>;
|
|
4310
|
-
}
|
|
4311
4485
|
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4312
4486
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4313
4487
|
const highlightFind = (content) => {
|
|
@@ -4329,7 +4503,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4329
4503
|
const chips = formatRules?.chips;
|
|
4330
4504
|
if (conditionalFormatFeature2 && chips) {
|
|
4331
4505
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4332
|
-
const chip =
|
|
4506
|
+
const chip = createMemo9(
|
|
4333
4507
|
() => resolveChipSpec2(chips, {
|
|
4334
4508
|
row,
|
|
4335
4509
|
get rowIndex() {
|
|
@@ -4550,12 +4724,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4550
4724
|
leadingWidth={leadingWidth()}
|
|
4551
4725
|
baseOffset={vertical().overlayBaseOffset}
|
|
4552
4726
|
initialValue={() => view().editorInitialValue ?? store.getViewState().editorInitialValue ?? ""}
|
|
4727
|
+
editor={editingColumn()?.editor}
|
|
4553
4728
|
session={editingSessionInfo()}
|
|
4554
4729
|
themeClassName={portalClassName()}
|
|
4555
4730
|
slots={slots()}
|
|
4556
4731
|
onCommit={(value, direction) => edit.commitEdit(value, direction)}
|
|
4557
4732
|
onCancel={edit.cancelEdit}
|
|
4558
|
-
align={
|
|
4733
|
+
align={editingColumn()?.align}
|
|
4559
4734
|
enterMove={props.editorEnterMove}
|
|
4560
4735
|
domId={cellEditorDomId}
|
|
4561
4736
|
alignTop={editorAlignTop()}
|
|
@@ -4799,7 +4974,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4799
4974
|
{renderColumnDropIndicator("right")}
|
|
4800
4975
|
</div>
|
|
4801
4976
|
</div>
|
|
4802
|
-
<Show11 when={viewRowCount() === 0}>
|
|
4977
|
+
<Show11 when={viewRowCount() === 0 && hydrated()}>
|
|
4803
4978
|
<div class={["ssg-empty-state", slots().emptyState?.className]} style={slots().emptyState?.style}>
|
|
4804
4979
|
{emptyStateText()}
|
|
4805
4980
|
</div>
|
|
@@ -5113,7 +5288,7 @@ var columnAutosizeFeature = {
|
|
|
5113
5288
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5114
5289
|
|
|
5115
5290
|
// src/primitives/columnMenu.ts
|
|
5116
|
-
import { createMemo as
|
|
5291
|
+
import { createMemo as createMemo10 } from "solid-js";
|
|
5117
5292
|
import {
|
|
5118
5293
|
createColumnMenuController
|
|
5119
5294
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5125,16 +5300,16 @@ function createColumnMenu(inputs) {
|
|
|
5125
5300
|
gridRootRef: inputs.gridRootRef
|
|
5126
5301
|
}), "render", "columnMenu");
|
|
5127
5302
|
const snapshot = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5128
|
-
const openedColumnKey =
|
|
5129
|
-
const openedColumn =
|
|
5303
|
+
const openedColumnKey = createMemo10(() => snapshot().columnKey);
|
|
5304
|
+
const openedColumn = createMemo10(() => {
|
|
5130
5305
|
const key = openedColumnKey();
|
|
5131
5306
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5132
5307
|
});
|
|
5133
5308
|
return {
|
|
5134
5309
|
openedColumnKey,
|
|
5135
5310
|
openedColumn,
|
|
5136
|
-
layout:
|
|
5137
|
-
isOpen:
|
|
5311
|
+
layout: createMemo10(() => snapshot().layout),
|
|
5312
|
+
isOpen: createMemo10(() => openedColumnKey() !== null),
|
|
5138
5313
|
panelRef: controller.panelRef,
|
|
5139
5314
|
openFromButton: controller.openFromButton,
|
|
5140
5315
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5145,7 +5320,7 @@ function createColumnMenu(inputs) {
|
|
|
5145
5320
|
}
|
|
5146
5321
|
|
|
5147
5322
|
// src/view/ColumnMenuPopover.tsx
|
|
5148
|
-
import { For as For6, Show as Show12, createEffect as createEffect5, createMemo as
|
|
5323
|
+
import { For as For6, Show as Show12, createEffect as createEffect5, createMemo as createMemo11, createSignal as createSignal11, createUniqueId as createUniqueId4, onCleanup as onCleanup8 } from "solid-js";
|
|
5149
5324
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5150
5325
|
var PINNED_ITEMS = [
|
|
5151
5326
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5163,23 +5338,24 @@ function ColumnMenuPopover(props) {
|
|
|
5163
5338
|
const texts = useFeatureLocaleText();
|
|
5164
5339
|
const portal = useGridPortal();
|
|
5165
5340
|
const container = portal.container();
|
|
5166
|
-
const [panel, setPanel] =
|
|
5341
|
+
const [panel, setPanel] = createSignal11();
|
|
5167
5342
|
let panelElement;
|
|
5168
5343
|
onCleanup8(() => {
|
|
5169
5344
|
if (props.panelRef.current === panelElement) {
|
|
5170
5345
|
props.panelRef.current = null;
|
|
5171
5346
|
}
|
|
5172
5347
|
});
|
|
5173
|
-
const layout =
|
|
5174
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5348
|
+
const layout = createMemo11(() => props.layout);
|
|
5349
|
+
const [openSubmenu, setOpenSubmenu] = createSignal11(null);
|
|
5175
5350
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5176
|
-
const isPinSubmenuOpen =
|
|
5351
|
+
const isPinSubmenuOpen = createMemo11(() => {
|
|
5177
5352
|
const current = openSubmenu();
|
|
5178
5353
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5179
5354
|
});
|
|
5180
5355
|
createEffect5(
|
|
5181
5356
|
() => props.columnKey,
|
|
5182
5357
|
() => {
|
|
5358
|
+
setOpenSubmenu(null);
|
|
5183
5359
|
if (panelElement) {
|
|
5184
5360
|
panelElement.scrollTop = 0;
|
|
5185
5361
|
}
|
|
@@ -5187,8 +5363,8 @@ function ColumnMenuPopover(props) {
|
|
|
5187
5363
|
{ name: "columnMenuScrollReset" }
|
|
5188
5364
|
);
|
|
5189
5365
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5190
|
-
const submenuInline =
|
|
5191
|
-
const [pinSubmenu, setPinSubmenu] =
|
|
5366
|
+
const submenuInline = createMemo11(() => layout().maxHeight !== void 0);
|
|
5367
|
+
const [pinSubmenu, setPinSubmenu] = createSignal11();
|
|
5192
5368
|
let pinSubmenuElement;
|
|
5193
5369
|
createPortalTokens(
|
|
5194
5370
|
() => isPinSubmenuOpen() && !submenuInline() ? pinSubmenu() : void 0,
|
|
@@ -5696,7 +5872,7 @@ import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-gri
|
|
|
5696
5872
|
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
5697
5873
|
|
|
5698
5874
|
// src/primitives/contextMenu.ts
|
|
5699
|
-
import { createMemo as
|
|
5875
|
+
import { createMemo as createMemo12 } from "solid-js";
|
|
5700
5876
|
import {
|
|
5701
5877
|
createContextMenuController
|
|
5702
5878
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
@@ -5706,7 +5882,7 @@ function createCellContextMenu(inputs) {
|
|
|
5706
5882
|
const snapshot = createExternalStoreSignal(controller, "contextMenuStore");
|
|
5707
5883
|
return {
|
|
5708
5884
|
snapshot,
|
|
5709
|
-
isOpen:
|
|
5885
|
+
isOpen: createMemo12(() => snapshot().state !== null),
|
|
5710
5886
|
open: controller.open,
|
|
5711
5887
|
close: controller.close,
|
|
5712
5888
|
panelRef: controller.panelRef
|
|
@@ -5714,19 +5890,19 @@ function createCellContextMenu(inputs) {
|
|
|
5714
5890
|
}
|
|
5715
5891
|
|
|
5716
5892
|
// src/view/CellContextMenuPopover.tsx
|
|
5717
|
-
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as
|
|
5893
|
+
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as createMemo13, createSignal as createSignal12, onCleanup as onCleanup9 } from "solid-js";
|
|
5718
5894
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5719
5895
|
function CellContextMenuPopover(props) {
|
|
5720
5896
|
const portal = useGridPortal();
|
|
5721
5897
|
const container = portal.container();
|
|
5722
|
-
const [panel, setPanel] =
|
|
5898
|
+
const [panel, setPanel] = createSignal12();
|
|
5723
5899
|
let panelElement;
|
|
5724
5900
|
onCleanup9(() => {
|
|
5725
5901
|
if (props.panelRef.current === panelElement) {
|
|
5726
5902
|
props.panelRef.current = null;
|
|
5727
5903
|
}
|
|
5728
5904
|
});
|
|
5729
|
-
const layout =
|
|
5905
|
+
const layout = createMemo13(() => props.layout);
|
|
5730
5906
|
const element = <Show14 when={container}>
|
|
5731
5907
|
{(mount) => <Portal3 mount={mount()}>
|
|
5732
5908
|
<div
|
|
@@ -5798,7 +5974,7 @@ function ActionItem(props) {
|
|
|
5798
5974
|
role="menuitem"
|
|
5799
5975
|
disabled={props.item.disabled}
|
|
5800
5976
|
onClick={() => {
|
|
5801
|
-
props.item.onSelect
|
|
5977
|
+
callInOwnFrame(props.item.onSelect);
|
|
5802
5978
|
props.onRequestClose();
|
|
5803
5979
|
}}
|
|
5804
5980
|
class={[
|
|
@@ -5928,7 +6104,7 @@ var exportFeature = {
|
|
|
5928
6104
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5929
6105
|
|
|
5930
6106
|
// src/primitives/fillHandle.ts
|
|
5931
|
-
import { createMemo as
|
|
6107
|
+
import { createMemo as createMemo14 } from "solid-js";
|
|
5932
6108
|
import {
|
|
5933
6109
|
createFillHandleController
|
|
5934
6110
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -5946,11 +6122,11 @@ import {
|
|
|
5946
6122
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
5947
6123
|
function createFillHandle(inputs) {
|
|
5948
6124
|
const controller = createFillHandleController();
|
|
5949
|
-
const options =
|
|
6125
|
+
const options = createMemo14(() => {
|
|
5950
6126
|
const fillHandle = inputs.fillHandle();
|
|
5951
6127
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
5952
6128
|
});
|
|
5953
|
-
const enabled =
|
|
6129
|
+
const enabled = createMemo14(
|
|
5954
6130
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
5955
6131
|
);
|
|
5956
6132
|
connectController(controller, () => {
|
|
@@ -5988,17 +6164,17 @@ function createFillHandle(inputs) {
|
|
|
5988
6164
|
};
|
|
5989
6165
|
}, "render", "fillHandle");
|
|
5990
6166
|
const snapshot = createExternalStoreSignal(controller, "fillHandleStore");
|
|
5991
|
-
const rowMetrics =
|
|
5992
|
-
const windowFirstRow =
|
|
5993
|
-
const windowLastRow =
|
|
5994
|
-
const detailActive =
|
|
5995
|
-
const detailExtras =
|
|
5996
|
-
const verticalScaleFactor =
|
|
5997
|
-
const paneLayout =
|
|
5998
|
-
const viewportHeight =
|
|
5999
|
-
const scrollTop =
|
|
6000
|
-
const headerHeight =
|
|
6001
|
-
const corner =
|
|
6167
|
+
const rowMetrics = createMemo14(() => inputs.vertical().rowMetrics);
|
|
6168
|
+
const windowFirstRow = createMemo14(() => inputs.vertical().windowFirstRow);
|
|
6169
|
+
const windowLastRow = createMemo14(() => inputs.vertical().windowLastRow);
|
|
6170
|
+
const detailActive = createMemo14(() => inputs.vertical().detailActive);
|
|
6171
|
+
const detailExtras = createMemo14(() => inputs.vertical().detailExtras);
|
|
6172
|
+
const verticalScaleFactor = createMemo14(() => inputs.vertical().verticalScaleFactor);
|
|
6173
|
+
const paneLayout = createMemo14(inputs.paneLayout);
|
|
6174
|
+
const viewportHeight = createMemo14(inputs.viewportHeight);
|
|
6175
|
+
const scrollTop = createMemo14(inputs.scrollTop);
|
|
6176
|
+
const headerHeight = createMemo14(inputs.headerHeight);
|
|
6177
|
+
const corner = createMemo14(() => {
|
|
6002
6178
|
const ui = inputs.uiState();
|
|
6003
6179
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6004
6180
|
return null;
|
|
@@ -6011,7 +6187,7 @@ function createFillHandle(inputs) {
|
|
|
6011
6187
|
}
|
|
6012
6188
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6013
6189
|
});
|
|
6014
|
-
const previewSelection =
|
|
6190
|
+
const previewSelection = createMemo14(() => {
|
|
6015
6191
|
const current = snapshot();
|
|
6016
6192
|
if (current.status !== "dragging" || current.target === null) {
|
|
6017
6193
|
return null;
|
|
@@ -6031,7 +6207,7 @@ function createFillHandle(inputs) {
|
|
|
6031
6207
|
}
|
|
6032
6208
|
};
|
|
6033
6209
|
});
|
|
6034
|
-
const previewGeometry =
|
|
6210
|
+
const previewGeometry = createMemo14(() => {
|
|
6035
6211
|
const selection = previewSelection();
|
|
6036
6212
|
if (selection === null) {
|
|
6037
6213
|
return null;
|
|
@@ -6064,7 +6240,7 @@ function createFillHandle(inputs) {
|
|
|
6064
6240
|
}
|
|
6065
6241
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6066
6242
|
};
|
|
6067
|
-
const chip =
|
|
6243
|
+
const chip = createMemo14(() => {
|
|
6068
6244
|
const current = snapshot();
|
|
6069
6245
|
if (current.status !== "filled") {
|
|
6070
6246
|
return null;
|
|
@@ -6087,7 +6263,7 @@ function createFillHandle(inputs) {
|
|
|
6087
6263
|
controller,
|
|
6088
6264
|
snapshot,
|
|
6089
6265
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6090
|
-
filling:
|
|
6266
|
+
filling: createMemo14(() => snapshot().status === "dragging"),
|
|
6091
6267
|
corner,
|
|
6092
6268
|
previewRects,
|
|
6093
6269
|
chip
|
|
@@ -6095,7 +6271,7 @@ function createFillHandle(inputs) {
|
|
|
6095
6271
|
}
|
|
6096
6272
|
|
|
6097
6273
|
// src/view/FillHandleLayer.tsx
|
|
6098
|
-
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as
|
|
6274
|
+
import { For as For8, Show as Show15, createEffect as createEffect7, createMemo as createMemo15, createSignal as createSignal13, onCleanup as onCleanup10 } from "solid-js";
|
|
6099
6275
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6100
6276
|
import { formatLocaleText as formatLocaleText6 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6101
6277
|
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
@@ -6108,7 +6284,7 @@ function FillHandleLayer(props) {
|
|
|
6108
6284
|
const current = props.fill.chip();
|
|
6109
6285
|
return current?.pane === props.pane ? current.position : null;
|
|
6110
6286
|
};
|
|
6111
|
-
const filled =
|
|
6287
|
+
const filled = createMemo15(() => {
|
|
6112
6288
|
const snapshot = props.fill.snapshot();
|
|
6113
6289
|
return snapshot.status === "filled" ? snapshot : null;
|
|
6114
6290
|
});
|
|
@@ -6219,7 +6395,7 @@ function FillOptionsMenu(props) {
|
|
|
6219
6395
|
const texts = useFeatureLocaleText();
|
|
6220
6396
|
const portal = useGridPortal();
|
|
6221
6397
|
const container = portal.container();
|
|
6222
|
-
const [panel, setPanel] =
|
|
6398
|
+
const [panel, setPanel] = createSignal13();
|
|
6223
6399
|
const { menuPanel } = props.fill.controller;
|
|
6224
6400
|
let panelElement;
|
|
6225
6401
|
onCleanup10(() => {
|
|
@@ -6295,9 +6471,9 @@ function FillTooltip(props) {
|
|
|
6295
6471
|
subscribe: props.fill.controller.subscribePointer,
|
|
6296
6472
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6297
6473
|
}, "fillPointerStore");
|
|
6298
|
-
const visible =
|
|
6299
|
-
const container =
|
|
6300
|
-
const [tooltip, setTooltip] =
|
|
6474
|
+
const visible = createMemo15(() => pointer() !== null);
|
|
6475
|
+
const container = createMemo15(() => visible() ? portal.container() : null);
|
|
6476
|
+
const [tooltip, setTooltip] = createSignal13();
|
|
6301
6477
|
const element = <Show15 when={container()}>
|
|
6302
6478
|
{(mount) => <Portal4 mount={mount()}>
|
|
6303
6479
|
<div
|
|
@@ -6318,11 +6494,11 @@ function FillTooltip(props) {
|
|
|
6318
6494
|
return element;
|
|
6319
6495
|
}
|
|
6320
6496
|
function FillHandlePortals(props) {
|
|
6321
|
-
const menu =
|
|
6497
|
+
const menu = createMemo15(() => {
|
|
6322
6498
|
const snapshot = props.fill.snapshot();
|
|
6323
6499
|
return snapshot.status === "filled" && snapshot.menu !== null ? snapshot : null;
|
|
6324
6500
|
});
|
|
6325
|
-
const tooltipText =
|
|
6501
|
+
const tooltipText = createMemo15(() => {
|
|
6326
6502
|
const snapshot = props.fill.snapshot();
|
|
6327
6503
|
return snapshot.status === "dragging" ? snapshot.previewText : null;
|
|
6328
6504
|
});
|
|
@@ -6360,7 +6536,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6360
6536
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6361
6537
|
|
|
6362
6538
|
// src/primitives/filterOrder.ts
|
|
6363
|
-
import { createMemo as
|
|
6539
|
+
import { createMemo as createMemo16 } from "solid-js";
|
|
6364
6540
|
import {
|
|
6365
6541
|
createGlobalFilteredOrderRunner,
|
|
6366
6542
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6373,11 +6549,11 @@ import {
|
|
|
6373
6549
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6374
6550
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6375
6551
|
function createFilterOrder(inputs) {
|
|
6376
|
-
const visibleColumns =
|
|
6377
|
-
const globalFilterColumns =
|
|
6378
|
-
const text =
|
|
6379
|
-
const needle =
|
|
6380
|
-
const key =
|
|
6552
|
+
const visibleColumns = createMemo16(() => inputs.visibleColumns());
|
|
6553
|
+
const globalFilterColumns = createMemo16(() => toGlobalFilterColumns(visibleColumns(), inputs.globalFilterMatch()));
|
|
6554
|
+
const text = createMemo16(() => inputs.globalFilterText());
|
|
6555
|
+
const needle = createMemo16(() => text().trim().toLowerCase());
|
|
6556
|
+
const key = createMemo16(
|
|
6381
6557
|
() => ({
|
|
6382
6558
|
rows: inputs.rows(),
|
|
6383
6559
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6387,30 +6563,30 @@ function createFilterOrder(inputs) {
|
|
|
6387
6563
|
{ equals: sameGlobalFilterKey }
|
|
6388
6564
|
);
|
|
6389
6565
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6390
|
-
const syncResult =
|
|
6566
|
+
const syncResult = createMemo16(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6391
6567
|
const runner = createGlobalFilteredOrderRunner();
|
|
6392
6568
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6393
6569
|
const snapshot = createExternalStoreSignal(runner, "globalFilterStore");
|
|
6394
|
-
const result =
|
|
6395
|
-
const columnFilters =
|
|
6396
|
-
const relativeDateFilterActive =
|
|
6570
|
+
const result = createMemo16(() => selectGlobalFilteredOrderResult(syncResult(), snapshot(), key()));
|
|
6571
|
+
const columnFilters = createMemo16(() => inputs.columnFilters());
|
|
6572
|
+
const relativeDateFilterActive = createMemo16(
|
|
6397
6573
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6398
6574
|
);
|
|
6399
6575
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6400
6576
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6401
|
-
const relativeDateKey =
|
|
6577
|
+
const relativeDateKey = createMemo16(
|
|
6402
6578
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6403
6579
|
);
|
|
6404
6580
|
return {
|
|
6405
|
-
globalFilteredOrder:
|
|
6406
|
-
globalFilterStatus:
|
|
6407
|
-
globalFilterProgress:
|
|
6581
|
+
globalFilteredOrder: createMemo16(() => result().order),
|
|
6582
|
+
globalFilterStatus: createMemo16(() => result().status),
|
|
6583
|
+
globalFilterProgress: createMemo16(() => result().progress),
|
|
6408
6584
|
relativeDateKey
|
|
6409
6585
|
};
|
|
6410
6586
|
}
|
|
6411
6587
|
|
|
6412
6588
|
// src/primitives/filterPopover.ts
|
|
6413
|
-
import { createMemo as
|
|
6589
|
+
import { createMemo as createMemo17, createSignal as createSignal14, untrack as untrack14 } from "solid-js";
|
|
6414
6590
|
import {
|
|
6415
6591
|
createFilterPopoverController,
|
|
6416
6592
|
resolveOpenedFilterColumn
|
|
@@ -6448,16 +6624,16 @@ function createFilterPopover(inputs) {
|
|
|
6448
6624
|
}
|
|
6449
6625
|
return result.filterType;
|
|
6450
6626
|
});
|
|
6451
|
-
const groupColumns =
|
|
6452
|
-
const popoverColumns =
|
|
6627
|
+
const groupColumns = createMemo17(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
6628
|
+
const popoverColumns = createMemo17(() => {
|
|
6453
6629
|
const groups = groupColumns();
|
|
6454
6630
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6455
6631
|
});
|
|
6456
6632
|
const resolveAnchorColumnKey = (columnKey) => untrack14(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6457
6633
|
const snapshot = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6458
|
-
const state =
|
|
6459
|
-
const layout =
|
|
6460
|
-
const [panel, setPanel] =
|
|
6634
|
+
const state = createMemo17(() => snapshot().state);
|
|
6635
|
+
const layout = createMemo17(() => snapshot().layout);
|
|
6636
|
+
const [panel, setPanel] = createSignal14(null);
|
|
6461
6637
|
connectController(
|
|
6462
6638
|
controller,
|
|
6463
6639
|
() => {
|
|
@@ -6476,9 +6652,9 @@ function createFilterPopover(inputs) {
|
|
|
6476
6652
|
"effect",
|
|
6477
6653
|
"filterPopover"
|
|
6478
6654
|
);
|
|
6479
|
-
const openedColumnKey =
|
|
6480
|
-
const openedFilterType =
|
|
6481
|
-
const openedColumn =
|
|
6655
|
+
const openedColumnKey = createMemo17(() => state()?.columnKey ?? null);
|
|
6656
|
+
const openedFilterType = createMemo17(() => state()?.filterType ?? null);
|
|
6657
|
+
const openedColumn = createMemo17(() => {
|
|
6482
6658
|
openedColumnKey();
|
|
6483
6659
|
openedFilterType();
|
|
6484
6660
|
return resolveOpenedFilterColumn(popoverColumns(), untrack14(state));
|
|
@@ -6488,7 +6664,7 @@ function createFilterPopover(inputs) {
|
|
|
6488
6664
|
layout,
|
|
6489
6665
|
openedColumn,
|
|
6490
6666
|
openedFilterType,
|
|
6491
|
-
isOpen:
|
|
6667
|
+
isOpen: createMemo17(() => state() !== null),
|
|
6492
6668
|
setPanel: (element) => {
|
|
6493
6669
|
controller.panelRef.current = element;
|
|
6494
6670
|
setPanel(element);
|
|
@@ -6506,7 +6682,7 @@ function createFilterPopover(inputs) {
|
|
|
6506
6682
|
}
|
|
6507
6683
|
|
|
6508
6684
|
// src/primitives/filterManagement.ts
|
|
6509
|
-
import { createMemo as
|
|
6685
|
+
import { createMemo as createMemo18, onCleanup as onCleanup11, untrack as untrack15 } from "solid-js";
|
|
6510
6686
|
import {
|
|
6511
6687
|
createColumnFilterDescribeOptions,
|
|
6512
6688
|
describeColumnFilterValue
|
|
@@ -6522,9 +6698,9 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6522
6698
|
var NO_COLUMNS2 = [];
|
|
6523
6699
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6524
6700
|
function createFilterManagement(inputs) {
|
|
6525
|
-
const groupColumns =
|
|
6526
|
-
const groupColumnKeys =
|
|
6527
|
-
const entries =
|
|
6701
|
+
const groupColumns = createMemo18(() => inputs.groupColumns?.() ?? NO_COLUMNS2);
|
|
6702
|
+
const groupColumnKeys = createMemo18(() => new Set(groupColumns().map((column) => column.key)));
|
|
6703
|
+
const entries = createMemo18(() => {
|
|
6528
6704
|
const columnFilters = inputs.columnFilters();
|
|
6529
6705
|
const texts = inputs.localeTexts();
|
|
6530
6706
|
const result = [];
|
|
@@ -6556,7 +6732,7 @@ function createFilterManagement(inputs) {
|
|
|
6556
6732
|
}
|
|
6557
6733
|
return result;
|
|
6558
6734
|
});
|
|
6559
|
-
const addableColumns =
|
|
6735
|
+
const addableColumns = createMemo18(() => {
|
|
6560
6736
|
const columnFilters = inputs.columnFilters();
|
|
6561
6737
|
const texts = inputs.localeTexts();
|
|
6562
6738
|
const grouped = groupColumnKeys();
|
|
@@ -6646,7 +6822,7 @@ function createFilterManagement(inputs) {
|
|
|
6646
6822
|
}
|
|
6647
6823
|
|
|
6648
6824
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6649
|
-
import { Show as Show16, createMemo as
|
|
6825
|
+
import { Show as Show16, createMemo as createMemo19, untrack as untrack16 } from "solid-js";
|
|
6650
6826
|
import {
|
|
6651
6827
|
createFilterPopoverCommands,
|
|
6652
6828
|
createFilterPopoverDerivedResolver
|
|
@@ -6679,11 +6855,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6679
6855
|
const filterPopover = props.filterPopover;
|
|
6680
6856
|
const openedColumn = filterPopover.openedColumn;
|
|
6681
6857
|
const openedType = filterPopover.openedFilterType;
|
|
6682
|
-
const openedOptionsKey =
|
|
6858
|
+
const openedOptionsKey = createMemo19(() => {
|
|
6683
6859
|
const column = openedColumn();
|
|
6684
6860
|
return column ? String(column.key) : null;
|
|
6685
6861
|
});
|
|
6686
|
-
const optionRowsHold =
|
|
6862
|
+
const optionRowsHold = createMemo19((prev) => {
|
|
6687
6863
|
const key = openedOptionsKey();
|
|
6688
6864
|
const rows = props.rows;
|
|
6689
6865
|
if (key === null) {
|
|
@@ -6694,9 +6870,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6694
6870
|
}
|
|
6695
6871
|
return prev;
|
|
6696
6872
|
});
|
|
6697
|
-
const optionRows =
|
|
6698
|
-
const openedIsDateSet =
|
|
6699
|
-
const getOpenedColumnRawValueAt =
|
|
6873
|
+
const optionRows = createMemo19(() => optionRowsHold().rows);
|
|
6874
|
+
const openedIsDateSet = createMemo19(() => openedType() === "dateSet");
|
|
6875
|
+
const getOpenedColumnRawValueAt = createMemo19(() => {
|
|
6700
6876
|
const rows = optionRows();
|
|
6701
6877
|
const column = openedColumn();
|
|
6702
6878
|
const isDateSet = openedIsDateSet();
|
|
@@ -6708,7 +6884,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6708
6884
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6709
6885
|
};
|
|
6710
6886
|
});
|
|
6711
|
-
const usesAsyncOptions =
|
|
6887
|
+
const usesAsyncOptions = createMemo19(() => {
|
|
6712
6888
|
const column = openedColumn();
|
|
6713
6889
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
6714
6890
|
});
|
|
@@ -6725,12 +6901,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6725
6901
|
};
|
|
6726
6902
|
}, "render", "filterOptionsSource");
|
|
6727
6903
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
6728
|
-
const collectColumn =
|
|
6729
|
-
const numeric =
|
|
6730
|
-
const syncResult =
|
|
6904
|
+
const collectColumn = createMemo19(() => usesAsyncOptions() ? null : openedColumn());
|
|
6905
|
+
const numeric = createMemo19(() => openedType() === "numberSet");
|
|
6906
|
+
const syncResult = createMemo19(
|
|
6731
6907
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
6732
6908
|
);
|
|
6733
|
-
const sourceKey =
|
|
6909
|
+
const sourceKey = createMemo19(() => {
|
|
6734
6910
|
const column = collectColumn();
|
|
6735
6911
|
return column === null ? void 0 : String(column.key);
|
|
6736
6912
|
});
|
|
@@ -6743,14 +6919,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6743
6919
|
sourceKey: sourceKey()
|
|
6744
6920
|
}), "render", "filterValueCollector");
|
|
6745
6921
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
6746
|
-
const optionsResult =
|
|
6922
|
+
const optionsResult = createMemo19(() => {
|
|
6747
6923
|
if (usesAsyncOptions()) {
|
|
6748
6924
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
6749
6925
|
}
|
|
6750
6926
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
6751
6927
|
});
|
|
6752
6928
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
6753
|
-
const derived =
|
|
6929
|
+
const derived = createMemo19(
|
|
6754
6930
|
() => resolveDerived({
|
|
6755
6931
|
openedFilterColumn: openedColumn(),
|
|
6756
6932
|
openedFilterType: openedType(),
|
|
@@ -6774,7 +6950,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6774
6950
|
filterTexts: props.localeTexts
|
|
6775
6951
|
}), "render", "filterPopoverCommands");
|
|
6776
6952
|
const texts = () => props.localeTexts;
|
|
6777
|
-
const currentValueText =
|
|
6953
|
+
const currentValueText = createMemo19(() => {
|
|
6778
6954
|
const column = openedColumn();
|
|
6779
6955
|
if (!column) {
|
|
6780
6956
|
return texts().filterCurrentNone;
|
|
@@ -6791,16 +6967,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6791
6967
|
const text = columnFilterValueToDraftText(rawValue);
|
|
6792
6968
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
6793
6969
|
});
|
|
6794
|
-
const datePresets =
|
|
6970
|
+
const datePresets = createMemo19(() => {
|
|
6795
6971
|
const column = openedColumn();
|
|
6796
6972
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
6797
6973
|
});
|
|
6798
|
-
const comboSummaryText =
|
|
6974
|
+
const comboSummaryText = createMemo19(() => {
|
|
6799
6975
|
const column = openedColumn();
|
|
6800
6976
|
const value = derived().openedSetFilterValue;
|
|
6801
6977
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
6802
6978
|
});
|
|
6803
|
-
const renderDateInput =
|
|
6979
|
+
const renderDateInput = createMemo19(() => {
|
|
6804
6980
|
const render = props.renderFilterDateInput;
|
|
6805
6981
|
const column = openedColumn();
|
|
6806
6982
|
if (!render || !column) {
|
|
@@ -6927,7 +7103,7 @@ function GridFilterChipBar(props) {
|
|
|
6927
7103
|
}
|
|
6928
7104
|
|
|
6929
7105
|
// src/view/lazyPopups.ts
|
|
6930
|
-
import { createEffect as createEffect8, createMemo as
|
|
7106
|
+
import { createEffect as createEffect8, createMemo as createMemo20 } from "solid-js";
|
|
6931
7107
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
6932
7108
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
6933
7109
|
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-BMKPRELT.jsx"));
|
|
@@ -6941,7 +7117,7 @@ var reportLoadError = (error) => {
|
|
|
6941
7117
|
function createLazyModuleSignal(module, options, name) {
|
|
6942
7118
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
6943
7119
|
createEffect8(
|
|
6944
|
-
|
|
7120
|
+
createMemo20(() => options.needed() && loaded() === null),
|
|
6945
7121
|
(shouldLoad) => {
|
|
6946
7122
|
if (!shouldLoad) {
|
|
6947
7123
|
return;
|
|
@@ -6960,7 +7136,7 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
6960
7136
|
{ name: `${name}Load` }
|
|
6961
7137
|
);
|
|
6962
7138
|
createEffect8(
|
|
6963
|
-
|
|
7139
|
+
createMemo20(() => options.prefetch() && module.getSnapshot() === null),
|
|
6964
7140
|
(shouldPrefetch) => {
|
|
6965
7141
|
if (!shouldPrefetch) {
|
|
6966
7142
|
return;
|
|
@@ -6995,11 +7171,11 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
6995
7171
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6996
7172
|
|
|
6997
7173
|
// src/view/GridFindBar.tsx
|
|
6998
|
-
import { createRenderEffect as createRenderEffect6, createSignal as
|
|
7174
|
+
import { createRenderEffect as createRenderEffect6, createSignal as createSignal15, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
6999
7175
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7000
7176
|
function GridFindBar(props) {
|
|
7001
7177
|
const texts = useFeatureLocaleText();
|
|
7002
|
-
const [input, setInput] =
|
|
7178
|
+
const [input, setInput] = createSignal15();
|
|
7003
7179
|
const initialQuery = untrack17(() => props.snapshot.query);
|
|
7004
7180
|
onSettled7(() => {
|
|
7005
7181
|
const element = untrack17(input);
|
|
@@ -7131,7 +7307,7 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7131
7307
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7132
7308
|
|
|
7133
7309
|
// src/view/GridBodyGroupRow.tsx
|
|
7134
|
-
import { For as For10, Show as Show18, createMemo as
|
|
7310
|
+
import { For as For10, Show as Show18, createMemo as createMemo21 } from "solid-js";
|
|
7135
7311
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7136
7312
|
import {
|
|
7137
7313
|
formatTotalRowCellText,
|
|
@@ -7189,10 +7365,10 @@ function GridBodyGroupRow(props) {
|
|
|
7189
7365
|
</Show18>
|
|
7190
7366
|
<For10 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7191
7367
|
{(entry) => {
|
|
7192
|
-
const unbound =
|
|
7368
|
+
const unbound = createMemo21(() => entry().column);
|
|
7193
7369
|
const column = () => unbound();
|
|
7194
7370
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7195
|
-
const aggregate =
|
|
7371
|
+
const aggregate = createMemo21(() => {
|
|
7196
7372
|
const current = column();
|
|
7197
7373
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7198
7374
|
return null;
|
|
@@ -7301,12 +7477,12 @@ import {
|
|
|
7301
7477
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7302
7478
|
|
|
7303
7479
|
// src/view/GridBodyLabelRow.tsx
|
|
7304
|
-
import { Show as Show19, createMemo as
|
|
7480
|
+
import { Show as Show19, createMemo as createMemo22 } from "solid-js";
|
|
7305
7481
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7306
|
-
const row =
|
|
7307
|
-
const sourceRowIndex =
|
|
7308
|
-
const label =
|
|
7309
|
-
const sectionRowCount =
|
|
7482
|
+
const row = createMemo22(() => labelRow().row);
|
|
7483
|
+
const sourceRowIndex = createMemo22(() => labelRow().sourceIndex);
|
|
7484
|
+
const label = createMemo22(() => labelRow().label);
|
|
7485
|
+
const sectionRowCount = createMemo22(() => labelRow().sectionRowCount);
|
|
7310
7486
|
return {
|
|
7311
7487
|
get row() {
|
|
7312
7488
|
return row();
|
|
@@ -7382,7 +7558,7 @@ function GridBodyLabelRow(props) {
|
|
|
7382
7558
|
}
|
|
7383
7559
|
|
|
7384
7560
|
// src/view/GridStickyLabelLayer.tsx
|
|
7385
|
-
import { Show as Show20, createMemo as
|
|
7561
|
+
import { Show as Show20, createMemo as createMemo23, onSettled as onSettled8 } from "solid-js";
|
|
7386
7562
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7387
7563
|
function GridStickyLabelLayer(props) {
|
|
7388
7564
|
return <Show20 when={props.entry}>
|
|
@@ -7391,10 +7567,10 @@ function GridStickyLabelLayer(props) {
|
|
|
7391
7567
|
}
|
|
7392
7568
|
function StickyLabel(props) {
|
|
7393
7569
|
const layer = props.layer;
|
|
7394
|
-
const labelRow =
|
|
7395
|
-
const rowIndex =
|
|
7396
|
-
const rowKey =
|
|
7397
|
-
const height =
|
|
7570
|
+
const labelRow = createMemo23(() => props.entry().labelRow);
|
|
7571
|
+
const rowIndex = createMemo23(() => props.entry().rowIndex);
|
|
7572
|
+
const rowKey = createMemo23(() => props.entry().rowKey);
|
|
7573
|
+
const height = createMemo23(() => props.entry().height);
|
|
7398
7574
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7399
7575
|
let element;
|
|
7400
7576
|
onSettled8(() => {
|
|
@@ -7497,7 +7673,7 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7497
7673
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7498
7674
|
|
|
7499
7675
|
// src/primitives/serverSide.ts
|
|
7500
|
-
import { createMemo as
|
|
7676
|
+
import { createMemo as createMemo24, untrack as untrack18 } from "solid-js";
|
|
7501
7677
|
import {
|
|
7502
7678
|
createServerSideRowModel
|
|
7503
7679
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
@@ -7534,26 +7710,26 @@ function createServerSide(args) {
|
|
|
7534
7710
|
};
|
|
7535
7711
|
const snapshot = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7536
7712
|
return {
|
|
7537
|
-
rowModel:
|
|
7713
|
+
rowModel: createMemo24(() => snapshot().rowModel),
|
|
7538
7714
|
rowCount: () => snapshot().rowCount,
|
|
7539
|
-
loadError:
|
|
7540
|
-
writeError:
|
|
7715
|
+
loadError: createMemo24(() => snapshot().loadError),
|
|
7716
|
+
writeError: createMemo24(() => snapshot().writeError),
|
|
7541
7717
|
isRowLoaded: controller.isRowLoaded,
|
|
7542
7718
|
requestRange,
|
|
7543
7719
|
refresh: controller.refresh,
|
|
7544
7720
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7545
7721
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7546
|
-
canUpdateRows:
|
|
7722
|
+
canUpdateRows: createMemo24(() => args().dataSource?.updateRows !== void 0),
|
|
7547
7723
|
applyCellEdits: controller.applyCellEdits
|
|
7548
7724
|
};
|
|
7549
7725
|
}
|
|
7550
7726
|
|
|
7551
7727
|
// src/view/GridServerSideErrorBars.tsx
|
|
7552
|
-
import { Show as Show21, createSignal as
|
|
7728
|
+
import { Show as Show21, createSignal as createSignal16 } from "solid-js";
|
|
7553
7729
|
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7554
7730
|
function GridServerSideErrorBars(props) {
|
|
7555
|
-
const [dismissedLoadError, setDismissedLoadError] =
|
|
7556
|
-
const [dismissedWriteError, setDismissedWriteError] =
|
|
7731
|
+
const [dismissedLoadError, setDismissedLoadError] = createSignal16(null);
|
|
7732
|
+
const [dismissedWriteError, setDismissedWriteError] = createSignal16(null);
|
|
7557
7733
|
const texts = () => props.localeTexts;
|
|
7558
7734
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7559
7735
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
@@ -7725,7 +7901,7 @@ var motionExtrasFeature = {
|
|
|
7725
7901
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7726
7902
|
|
|
7727
7903
|
// src/view/GridPinnedRows.tsx
|
|
7728
|
-
import { For as For12, Show as Show24, createMemo as
|
|
7904
|
+
import { For as For12, Show as Show24, createMemo as createMemo25 } from "solid-js";
|
|
7729
7905
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7730
7906
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7731
7907
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
@@ -7749,7 +7925,7 @@ function GridPinnedRows(props) {
|
|
|
7749
7925
|
<For12 each={props.rows} keyed={false}>
|
|
7750
7926
|
{(row, index) => {
|
|
7751
7927
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
7752
|
-
const rowSlot =
|
|
7928
|
+
const rowSlot = createMemo25(
|
|
7753
7929
|
() => resolveSlotProps3(
|
|
7754
7930
|
props.getRowClassName?.(row(), index, {
|
|
7755
7931
|
row: row(),
|
|
@@ -7804,11 +7980,11 @@ function GridPinnedRows(props) {
|
|
|
7804
7980
|
</Show24>
|
|
7805
7981
|
<For12 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7806
7982
|
{(entry) => {
|
|
7807
|
-
const unbound =
|
|
7983
|
+
const unbound = createMemo25(() => entry().column);
|
|
7808
7984
|
const column = () => unbound();
|
|
7809
|
-
const value =
|
|
7810
|
-
const colIndex =
|
|
7811
|
-
const ctx =
|
|
7985
|
+
const value = createMemo25(() => getCellValue6(row(), unbound()));
|
|
7986
|
+
const colIndex = createMemo25(() => entry().logicalIndex);
|
|
7987
|
+
const ctx = createMemo25(
|
|
7812
7988
|
() => ({
|
|
7813
7989
|
row: row(),
|
|
7814
7990
|
rowIndex: index,
|
|
@@ -7824,19 +8000,19 @@ function GridPinnedRows(props) {
|
|
|
7824
8000
|
pinned: props.position
|
|
7825
8001
|
})
|
|
7826
8002
|
);
|
|
7827
|
-
const cellSlot =
|
|
8003
|
+
const cellSlot = createMemo25(() => {
|
|
7828
8004
|
const cellClassName = column().cellClassName;
|
|
7829
8005
|
return resolveSlotProps3(
|
|
7830
8006
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
7831
8007
|
);
|
|
7832
8008
|
});
|
|
7833
8009
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
7834
|
-
const dataBar =
|
|
8010
|
+
const dataBar = createMemo25(() => {
|
|
7835
8011
|
const feature = props.conditionalFormat;
|
|
7836
8012
|
const format = rules()?.dataBar;
|
|
7837
8013
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
7838
8014
|
});
|
|
7839
|
-
const scaleBackground =
|
|
8015
|
+
const scaleBackground = createMemo25(() => {
|
|
7840
8016
|
const feature = props.conditionalFormat;
|
|
7841
8017
|
const format = rules()?.colorScale;
|
|
7842
8018
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -7846,7 +8022,7 @@ function GridPinnedRows(props) {
|
|
|
7846
8022
|
const format = rules()?.dataBar;
|
|
7847
8023
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
7848
8024
|
};
|
|
7849
|
-
const content =
|
|
8025
|
+
const content = createMemo25(() => {
|
|
7850
8026
|
const current = column();
|
|
7851
8027
|
if (isSyntheticColumnKey3(current.key)) {
|
|
7852
8028
|
return null;
|
|
@@ -7940,7 +8116,7 @@ var pinnedRowsFeature = {
|
|
|
7940
8116
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7941
8117
|
|
|
7942
8118
|
// src/primitives/rowDrag.ts
|
|
7943
|
-
import { createEffect as createEffect9, createMemo as
|
|
8119
|
+
import { createEffect as createEffect9, createMemo as createMemo26, untrack as untrack19 } from "solid-js";
|
|
7944
8120
|
import {
|
|
7945
8121
|
createRowDragController
|
|
7946
8122
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
@@ -7953,7 +8129,7 @@ function createRowDrag(inputs) {
|
|
|
7953
8129
|
const leftIndicatorRef = { current: null };
|
|
7954
8130
|
const centerIndicatorRef = { current: null };
|
|
7955
8131
|
const rightIndicatorRef = { current: null };
|
|
7956
|
-
const canDropAt =
|
|
8132
|
+
const canDropAt = createMemo26(() => {
|
|
7957
8133
|
const canDropRow = inputs.canDropRow();
|
|
7958
8134
|
if (canDropRow === void 0) {
|
|
7959
8135
|
return void 0;
|
|
@@ -7997,7 +8173,7 @@ function createRowDrag(inputs) {
|
|
|
7997
8173
|
if (row === void 0) return null;
|
|
7998
8174
|
return { row, rowKey: rowModel.getRowKey(viewIndex), rowCount: rowModel.getRowCount() };
|
|
7999
8175
|
};
|
|
8000
|
-
const locateDragRow =
|
|
8176
|
+
const locateDragRow = createMemo26(() => {
|
|
8001
8177
|
const rowModel = inputs.rowModel();
|
|
8002
8178
|
const hasRowKeys = inputs.hasRowKeys();
|
|
8003
8179
|
return (token, hint) => {
|
|
@@ -8085,7 +8261,7 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8085
8261
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8086
8262
|
|
|
8087
8263
|
// src/view/GridScrollHint.tsx
|
|
8088
|
-
import { For as For13, Show as Show25, createMemo as
|
|
8264
|
+
import { For as For13, Show as Show25, createMemo as createMemo27, createSignal as createSignal17, createEffect as createEffect10 } from "solid-js";
|
|
8089
8265
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8090
8266
|
import { resolveDataRowNumber as resolveDataRowNumber2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8091
8267
|
import {
|
|
@@ -8103,18 +8279,18 @@ var SCROLL_HINT_OVERLAY_TRACK_ZONE_PX = 8;
|
|
|
8103
8279
|
var SCROLL_HINT_JUMP_LABEL_FLIP_PX = 28;
|
|
8104
8280
|
function GridScrollHint(props) {
|
|
8105
8281
|
const texts = useFeatureLocaleText();
|
|
8106
|
-
const [scrollActive, setScrollActive] =
|
|
8107
|
-
const [hovered, setHovered] =
|
|
8108
|
-
const [scrollbarWidth, setScrollbarWidth] =
|
|
8109
|
-
const [trackPointerY, setTrackPointerY] =
|
|
8110
|
-
const [dragging, setDragging] =
|
|
8282
|
+
const [scrollActive, setScrollActive] = createSignal17(false);
|
|
8283
|
+
const [hovered, setHovered] = createSignal17(false);
|
|
8284
|
+
const [scrollbarWidth, setScrollbarWidth] = createSignal17(0);
|
|
8285
|
+
const [trackPointerY, setTrackPointerY] = createSignal17(null);
|
|
8286
|
+
const [dragging, setDragging] = createSignal17(false);
|
|
8111
8287
|
let lingerTimer = null;
|
|
8112
8288
|
let dragGrab = null;
|
|
8113
8289
|
let gutter;
|
|
8114
|
-
const scrollbar =
|
|
8290
|
+
const scrollbar = createMemo27(() => props.options.scrollbar);
|
|
8115
8291
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8116
8292
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8117
|
-
const track =
|
|
8293
|
+
const track = createMemo27(
|
|
8118
8294
|
() => computeScrollHintTrack({
|
|
8119
8295
|
scrollTop: props.scrollTop,
|
|
8120
8296
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8122,7 +8298,7 @@ function GridScrollHint(props) {
|
|
|
8122
8298
|
trackHeight: trackHeight()
|
|
8123
8299
|
})
|
|
8124
8300
|
);
|
|
8125
|
-
const shown =
|
|
8301
|
+
const shown = createMemo27(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8126
8302
|
createEffect10(scrollbar, (customScrollbar) => {
|
|
8127
8303
|
const element = props.scrollContainerRef.current;
|
|
8128
8304
|
if (!element) {
|
|
@@ -8191,12 +8367,12 @@ function GridScrollHint(props) {
|
|
|
8191
8367
|
);
|
|
8192
8368
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8193
8369
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8194
|
-
const dataRowCount =
|
|
8370
|
+
const dataRowCount = createMemo27(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8195
8371
|
const rowNumberOf = (viewIndex) => {
|
|
8196
8372
|
const labels = props.labelViewIndexes;
|
|
8197
8373
|
return labels && labels.length > 0 ? resolveDataRowNumber2(labels, viewIndex) : viewIndex + 1;
|
|
8198
8374
|
};
|
|
8199
|
-
const rulerTicks =
|
|
8375
|
+
const rulerTicks = createMemo27(
|
|
8200
8376
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8201
8377
|
rowCount: dataRowCount(),
|
|
8202
8378
|
rulerHeight: rulerHeight(),
|
|
@@ -8206,7 +8382,7 @@ function GridScrollHint(props) {
|
|
|
8206
8382
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8207
8383
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8208
8384
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8209
|
-
const topRowIndex =
|
|
8385
|
+
const topRowIndex = createMemo27(() => {
|
|
8210
8386
|
const current = track();
|
|
8211
8387
|
if (current === null) {
|
|
8212
8388
|
return 0;
|
|
@@ -8221,8 +8397,8 @@ function GridScrollHint(props) {
|
|
|
8221
8397
|
rowIndex,
|
|
8222
8398
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8223
8399
|
});
|
|
8224
|
-
const detail =
|
|
8225
|
-
const jumpPreview =
|
|
8400
|
+
const detail = createMemo27(() => detailOf(topRowIndex()));
|
|
8401
|
+
const jumpPreview = createMemo27(() => {
|
|
8226
8402
|
const pointerY = trackPointerY();
|
|
8227
8403
|
const current = track();
|
|
8228
8404
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8385,7 +8561,7 @@ var scrollHintFeature = {
|
|
|
8385
8561
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8386
8562
|
|
|
8387
8563
|
// src/primitives/selectionAggregates.ts
|
|
8388
|
-
import { createMemo as
|
|
8564
|
+
import { createMemo as createMemo28 } from "solid-js";
|
|
8389
8565
|
import {
|
|
8390
8566
|
createSelectionAggregatesRunner,
|
|
8391
8567
|
resolveSyncSelectionAggregates,
|
|
@@ -8397,15 +8573,15 @@ import {
|
|
|
8397
8573
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8398
8574
|
function createSelectionAggregates(args) {
|
|
8399
8575
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8400
|
-
const target =
|
|
8576
|
+
const target = createMemo28(() => {
|
|
8401
8577
|
const current = args();
|
|
8402
8578
|
return stabilizeTarget(
|
|
8403
8579
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8404
8580
|
);
|
|
8405
8581
|
});
|
|
8406
|
-
const rowModel =
|
|
8407
|
-
const key =
|
|
8408
|
-
const syncResult =
|
|
8582
|
+
const rowModel = createMemo28(() => args().rowModel);
|
|
8583
|
+
const key = createMemo28(() => ({ rowModel: rowModel(), target: target() }));
|
|
8584
|
+
const syncResult = createMemo28(() => resolveSyncSelectionAggregates(key()));
|
|
8409
8585
|
const runner = createSelectionAggregatesRunner();
|
|
8410
8586
|
connectController(
|
|
8411
8587
|
runner,
|
|
@@ -8414,16 +8590,16 @@ function createSelectionAggregates(args) {
|
|
|
8414
8590
|
"selectionAggregates"
|
|
8415
8591
|
);
|
|
8416
8592
|
const snapshot = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8417
|
-
return
|
|
8593
|
+
return createMemo28(() => selectSelectionAggregatesResult(syncResult(), snapshot(), key()));
|
|
8418
8594
|
}
|
|
8419
8595
|
|
|
8420
8596
|
// src/view/GridSelectionAggregates.tsx
|
|
8421
|
-
import { For as For14, Show as Show26, createMemo as
|
|
8597
|
+
import { For as For14, Show as Show26, createMemo as createMemo29 } from "solid-js";
|
|
8422
8598
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8423
8599
|
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8424
8600
|
function GridSelectionAggregates(props) {
|
|
8425
8601
|
const texts = useFeatureLocaleText();
|
|
8426
|
-
const chips =
|
|
8602
|
+
const chips = createMemo29(() => {
|
|
8427
8603
|
const aggregates = props.aggregates;
|
|
8428
8604
|
if (!aggregates) {
|
|
8429
8605
|
return null;
|
|
@@ -8492,7 +8668,7 @@ var selectionAggregatesFeature = {
|
|
|
8492
8668
|
};
|
|
8493
8669
|
|
|
8494
8670
|
// src/primitives/toolPanel.ts
|
|
8495
|
-
import { createMemo as
|
|
8671
|
+
import { createMemo as createMemo30 } from "solid-js";
|
|
8496
8672
|
import {
|
|
8497
8673
|
createToolPanelController,
|
|
8498
8674
|
resolveActiveToolPanelTab,
|
|
@@ -8511,7 +8687,7 @@ function createToolPanel(inputs) {
|
|
|
8511
8687
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8512
8688
|
}), "render", "toolPanel");
|
|
8513
8689
|
const snapshot = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8514
|
-
const availableTabs =
|
|
8690
|
+
const availableTabs = createMemo30(
|
|
8515
8691
|
() => resolveAvailableToolPanelTabs({
|
|
8516
8692
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8517
8693
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8520,10 +8696,10 @@ function createToolPanel(inputs) {
|
|
|
8520
8696
|
{ equals: sameTabs }
|
|
8521
8697
|
);
|
|
8522
8698
|
return {
|
|
8523
|
-
activeTab:
|
|
8699
|
+
activeTab: createMemo30(() => resolveActiveToolPanelTab(snapshot().requestedTab, availableTabs())),
|
|
8524
8700
|
availableTabs,
|
|
8525
|
-
layout:
|
|
8526
|
-
flashTick:
|
|
8701
|
+
layout: createMemo30(() => snapshot().layout),
|
|
8702
|
+
flashTick: createMemo30(() => snapshot().flashTick),
|
|
8527
8703
|
panelRef: controller.panelRef,
|
|
8528
8704
|
open: controller.open,
|
|
8529
8705
|
close: controller.close,
|
|
@@ -8547,7 +8723,7 @@ import {
|
|
|
8547
8723
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8548
8724
|
|
|
8549
8725
|
// src/view/GridTotalRow.tsx
|
|
8550
|
-
import { For as For15, Show as Show27, createMemo as
|
|
8726
|
+
import { For as For15, Show as Show27, createMemo as createMemo31 } from "solid-js";
|
|
8551
8727
|
import {
|
|
8552
8728
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8553
8729
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8592,10 +8768,10 @@ function GridTotalRow(props) {
|
|
|
8592
8768
|
</Show27>
|
|
8593
8769
|
<For15 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8594
8770
|
{(entry) => {
|
|
8595
|
-
const unbound =
|
|
8771
|
+
const unbound = createMemo31(() => entry().column);
|
|
8596
8772
|
const cell = () => props.cells.get(unbound().key);
|
|
8597
8773
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8598
|
-
const content =
|
|
8774
|
+
const content = createMemo31(() => {
|
|
8599
8775
|
const total = cell();
|
|
8600
8776
|
if (total) {
|
|
8601
8777
|
const column = unbound();
|