@ishibashi0112/spreadsheet-grid-solid 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +2864 -0
- package/README.md +41 -17
- package/dist/ColumnFilterPopover-CzSRfcDF.js +1426 -0
- package/dist/columnVirtualizer-Bv79_vW1.js +186 -0
- package/dist/createSpreadsheetGrid.d.ts +14 -0
- package/dist/devWarnings.d.ts +3 -0
- package/dist/editors/CellEditorLayer.d.ts +2 -0
- package/dist/editors/DateCellEditor.d.ts +1 -0
- package/dist/editors/NumberCellEditor.d.ts +1 -0
- package/dist/editors/SelectCellEditor.d.ts +3 -1
- package/dist/editors/TextCellEditor.d.ts +1 -0
- package/dist/features/contextMenu.d.ts +0 -14
- package/dist/features/types.d.ts +1 -1
- package/dist/index.js +2656 -2670
- package/dist/primitives/externalStore.d.ts +1 -0
- package/dist/primitives/userCallback.d.ts +10 -0
- package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-2DW5SZT3.jsx} +29 -10
- package/dist/source/chunks/chunk-FTQFOPXC.jsx +293 -0
- package/dist/source/chunks/{toolPanelViews-W6KROURU.jsx → toolPanelViews-HIQGRX3N.jsx} +4 -2
- package/dist/source/index.jsx +745 -775
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BE4gv_L0.js → toolPanelViews-BISN9iaG.js} +120 -119
- package/dist/view/DetailToggleButton.d.ts +1 -0
- package/dist/view/GridBodyLayer.d.ts +1 -1
- package/package.json +8 -5
- package/skills/spreadsheet-grid-solid/SKILL.md +106 -0
- package/dist/ColumnFilterPopover-BmxumbB7.js +0 -1418
- package/dist/columnVirtualizer-CGHyzbwH.js +0 -95
- package/dist/source/chunks/chunk-5KX4SR2S.jsx +0 -143
package/dist/source/index.jsx
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
callInOwnFrame,
|
|
2
3
|
closeMountGateOnSettled,
|
|
4
|
+
connectController,
|
|
3
5
|
createColumnVirtualizer,
|
|
6
|
+
createExternalStoreSignal,
|
|
4
7
|
createMountGate,
|
|
8
|
+
createUserCallbacks,
|
|
5
9
|
flushMountGate,
|
|
6
10
|
onGridMounted,
|
|
11
|
+
runHandleCall,
|
|
7
12
|
runInMountGate
|
|
8
|
-
} from "./chunks/chunk-
|
|
13
|
+
} from "./chunks/chunk-FTQFOPXC.jsx";
|
|
9
14
|
import {
|
|
10
15
|
GridLocaleTextContext,
|
|
11
16
|
GridPortalContext,
|
|
@@ -24,7 +29,8 @@ import {
|
|
|
24
29
|
import { merge } from "solid-js";
|
|
25
30
|
|
|
26
31
|
// src/SpreadsheetGrid.tsx
|
|
27
|
-
import { For as For5, Match, Show as Show11, Switch, createEffect as
|
|
32
|
+
import { For as For5, Match, Show as Show11, Switch, createEffect as createEffect3, createMemo as createMemo9, createSignal as createSignal8, createUniqueId as createUniqueId3, isHydrating, latest, onCleanup as onCleanup7, untrack as untrack12 } from "solid-js";
|
|
33
|
+
import { isServer } from "@solidjs/web";
|
|
28
34
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
29
35
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
30
36
|
import { buildSelectionSnapshot, selectGlobalFilter } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridSelectors";
|
|
@@ -53,7 +59,7 @@ import { resolveGridThemeClassName } from "@ishibashi0112/spreadsheet-grid-core/
|
|
|
53
59
|
import { MOTION_OFF_CLASS_NAME, resolveGridMotion } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/motion";
|
|
54
60
|
import { systemColorSchemeStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/systemColorSchemeStore";
|
|
55
61
|
import { reducedMotionStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/reducedMotionStore";
|
|
56
|
-
import { createLocaleTextResolver, formatLocaleText as
|
|
62
|
+
import { createLocaleTextResolver, formatLocaleText as formatLocaleText6 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
57
63
|
import { EMPTY_TOTAL_ROW_CELLS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
58
64
|
import {
|
|
59
65
|
resolveSlotFromSignature,
|
|
@@ -74,12 +80,14 @@ import {
|
|
|
74
80
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
75
81
|
import {
|
|
76
82
|
DEFAULT_DETAIL_ROW_HEIGHT,
|
|
83
|
+
DETAIL_TOGGLE_COLUMN_KEY as DETAIL_TOGGLE_COLUMN_KEY2,
|
|
77
84
|
isControlColumnKey,
|
|
78
85
|
isDetailRowExpandable,
|
|
79
86
|
isInsideDetailCardOf,
|
|
80
87
|
isSyntheticColumnKey as isSyntheticColumnKey2,
|
|
81
88
|
resolveFirstDataColIndex
|
|
82
89
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
90
|
+
import { resolveDataRowNumber as resolveDataRowNumber2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
83
91
|
import {
|
|
84
92
|
createSelectedRowsInOrderCounter,
|
|
85
93
|
getSelectAllState,
|
|
@@ -136,17 +144,6 @@ function createGridStoreSignals(store) {
|
|
|
136
144
|
return { state, view };
|
|
137
145
|
}
|
|
138
146
|
|
|
139
|
-
// src/primitives/externalStore.ts
|
|
140
|
-
import { createSignal as createSignal2 } from "solid-js";
|
|
141
|
-
function createExternalStoreSignal(store, name) {
|
|
142
|
-
const [value, setValue] = createSignal2(store.getSnapshot(), name === void 0 ? void 0 : { name });
|
|
143
|
-
onGridMounted(() => {
|
|
144
|
-
setValue(() => store.getSnapshot());
|
|
145
|
-
return store.subscribe(() => setValue(() => store.getSnapshot()));
|
|
146
|
-
});
|
|
147
|
-
return value;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
147
|
// src/primitives/viewSetters.ts
|
|
151
148
|
import {
|
|
152
149
|
resolveUpdater
|
|
@@ -171,47 +168,22 @@ function createGridViewSetters(store) {
|
|
|
171
168
|
};
|
|
172
169
|
}
|
|
173
170
|
|
|
174
|
-
// src/primitives/controller.ts
|
|
175
|
-
import { createEffect, createRenderEffect, untrack } from "solid-js";
|
|
176
|
-
function connectController(controller, args, timing = "render", name) {
|
|
177
|
-
let mounted = false;
|
|
178
|
-
let latest = null;
|
|
179
|
-
const apply = (next) => {
|
|
180
|
-
latest = { value: next };
|
|
181
|
-
if (mounted) {
|
|
182
|
-
untrack(() => controller.update(next));
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
const options = name === void 0 ? void 0 : { name };
|
|
186
|
-
if (timing === "render") {
|
|
187
|
-
createRenderEffect(args, apply, options);
|
|
188
|
-
} else {
|
|
189
|
-
createEffect(args, apply, options);
|
|
190
|
-
}
|
|
191
|
-
onGridMounted(() => {
|
|
192
|
-
mounted = true;
|
|
193
|
-
if (latest) {
|
|
194
|
-
const value = latest.value;
|
|
195
|
-
untrack(() => controller.update(value));
|
|
196
|
-
}
|
|
197
|
-
return () => controller.dispose?.();
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
171
|
// src/primitives/liveObject.ts
|
|
172
|
+
import { createMemo } from "solid-js";
|
|
202
173
|
function createLiveObject(keys, read) {
|
|
203
174
|
const live = {};
|
|
204
175
|
for (const key of keys) {
|
|
176
|
+
const value = createMemo(() => read()[key]);
|
|
205
177
|
Object.defineProperty(live, key, {
|
|
206
178
|
enumerable: true,
|
|
207
|
-
get:
|
|
179
|
+
get: value
|
|
208
180
|
});
|
|
209
181
|
}
|
|
210
182
|
return live;
|
|
211
183
|
}
|
|
212
184
|
|
|
213
185
|
// src/view/GridHeaderRow.tsx
|
|
214
|
-
import { For, Show, createMemo } from "solid-js";
|
|
186
|
+
import { For, Show, createMemo as createMemo2 } from "solid-js";
|
|
215
187
|
import { isActiveColumnFilterValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
216
188
|
import {
|
|
217
189
|
DETAIL_TOGGLE_COLUMN_KEY,
|
|
@@ -219,7 +191,7 @@ import {
|
|
|
219
191
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
220
192
|
import { ROW_DRAG_HANDLE_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowReorder";
|
|
221
193
|
import { formatLocaleText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
222
|
-
import { isFromRenderHeaderControl } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
194
|
+
import { isFromRenderHeaderControl, syncRenderHeaderControlHover } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
223
195
|
|
|
224
196
|
// src/view/RowSelectionCheckbox.tsx
|
|
225
197
|
function RowSelectionCheckbox(props) {
|
|
@@ -287,9 +259,9 @@ function GridHeaderRow(props) {
|
|
|
287
259
|
</Show>
|
|
288
260
|
<For each={props.entries} keyed={(entry) => entry.column.key}>
|
|
289
261
|
{(entry) => {
|
|
290
|
-
const column =
|
|
291
|
-
const colIndex =
|
|
292
|
-
const size =
|
|
262
|
+
const column = createMemo2(() => entry().column);
|
|
263
|
+
const colIndex = createMemo2(() => entry().logicalIndex);
|
|
264
|
+
const size = createMemo2(() => entry().paneLocalSize);
|
|
293
265
|
const isFiltered = () => isActiveColumnFilterValue(props.columnFilterValues[column().key]);
|
|
294
266
|
const isColumnSelected = () => props.selection.kind === "col" && colIndex() >= props.selection.startCol && colIndex() <= props.selection.endCol;
|
|
295
267
|
const sortIndex = () => props.sort.findIndex((item) => item.columnKey === column().key);
|
|
@@ -326,7 +298,13 @@ function GridHeaderRow(props) {
|
|
|
326
298
|
props.onColumnHeaderPointerDown(colIndex(), event);
|
|
327
299
|
}}
|
|
328
300
|
onPointerEnter={(event) => props.onColumnHeaderPointerEnter(colIndex(), event)}
|
|
329
|
-
|
|
301
|
+
onPointerMove={(event) => {
|
|
302
|
+
if (column().renderHeader) syncRenderHeaderControlHover(event.currentTarget, event);
|
|
303
|
+
}}
|
|
304
|
+
onPointerLeave={(event) => {
|
|
305
|
+
if (column().renderHeader) syncRenderHeaderControlHover(event.currentTarget, null);
|
|
306
|
+
props.onColumnHeaderPointerLeave(colIndex());
|
|
307
|
+
}}
|
|
330
308
|
onContextMenu={(event) => {
|
|
331
309
|
if (isSynthetic()) {
|
|
332
310
|
event.preventDefault();
|
|
@@ -360,7 +338,12 @@ function GridHeaderRow(props) {
|
|
|
360
338
|
]}
|
|
361
339
|
data-ssg-tooltip={column().renderHeader || isDetailToggleColumn() ? void 0 : column().title || column().key}
|
|
362
340
|
>
|
|
363
|
-
{column().renderHeader ? column().renderHeader?.(headerContext) : isDetailToggleColumn() ?
|
|
341
|
+
{column().renderHeader ? column().renderHeader?.(headerContext) : isDetailToggleColumn() ? (
|
|
342
|
+
// 見た目は空のまま、読み上げの名前だけ置く(下部バーの番地と同じ「詳細」/「移動」。1.3.0 / S6-03)。
|
|
343
|
+
<span class="ssg-visually-hidden">
|
|
344
|
+
{column().key === DETAIL_TOGGLE_COLUMN_KEY ? texts().detailColumnName : texts().rowDragColumnName}
|
|
345
|
+
</span>
|
|
346
|
+
) : column().title || column().key}
|
|
364
347
|
</div>
|
|
365
348
|
<div class="ssg-header-status">
|
|
366
349
|
<Show when={sortEntry()}>
|
|
@@ -441,7 +424,7 @@ function GridHeaderRow(props) {
|
|
|
441
424
|
}
|
|
442
425
|
|
|
443
426
|
// src/view/GridBodyLayer.tsx
|
|
444
|
-
import { For as For2, Show as Show2, createMemo as
|
|
427
|
+
import { For as For2, Show as Show2, createMemo as createMemo4, untrack as untrack2 } from "solid-js";
|
|
445
428
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
446
429
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
447
430
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -452,11 +435,11 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
452
435
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
453
436
|
|
|
454
437
|
// src/primitives/memoWhen.ts
|
|
455
|
-
import { createMemo as
|
|
438
|
+
import { createMemo as createMemo3, getOwner, isDisposed, runWithOwner, untrack } from "solid-js";
|
|
456
439
|
function createMemoWhen(needed, compute, empty) {
|
|
457
440
|
const guarded = () => needed() ? compute() : empty;
|
|
458
|
-
if (
|
|
459
|
-
return
|
|
441
|
+
if (untrack(needed)) {
|
|
442
|
+
return createMemo3(guarded);
|
|
460
443
|
}
|
|
461
444
|
const owner = getOwner();
|
|
462
445
|
let memo;
|
|
@@ -470,7 +453,7 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
470
453
|
if (!owner || isDisposed(owner)) {
|
|
471
454
|
return compute();
|
|
472
455
|
}
|
|
473
|
-
memo = runWithOwner(owner, () =>
|
|
456
|
+
memo = runWithOwner(owner, () => createMemo3(guarded));
|
|
474
457
|
return memo();
|
|
475
458
|
};
|
|
476
459
|
}
|
|
@@ -489,8 +472,8 @@ function GridBodyLayer(props) {
|
|
|
489
472
|
const texts = useGridLocaleText();
|
|
490
473
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
491
474
|
{(item) => {
|
|
492
|
-
const rowIndex =
|
|
493
|
-
const SkeletonRow =
|
|
475
|
+
const rowIndex = createMemo4(() => item().index);
|
|
476
|
+
const SkeletonRow = untrack2(() => item().skeleton ? props.skeletonRow : void 0);
|
|
494
477
|
if (SkeletonRow) {
|
|
495
478
|
return <SkeletonRow
|
|
496
479
|
pane={props.pane}
|
|
@@ -513,14 +496,14 @@ function GridBodyLayer(props) {
|
|
|
513
496
|
/>;
|
|
514
497
|
}
|
|
515
498
|
const row = () => props.rowModel.getRow(rowIndex());
|
|
516
|
-
const groupRow =
|
|
517
|
-
const labelRow =
|
|
499
|
+
const groupRow = createMemo4(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
500
|
+
const labelRow = createMemo4(
|
|
518
501
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
519
502
|
);
|
|
520
503
|
return <>
|
|
521
504
|
<Show2 when={groupRow()}>
|
|
522
505
|
{(group) => {
|
|
523
|
-
const GroupRow =
|
|
506
|
+
const GroupRow = untrack2(() => props.grouping)?.BodyGroupRow;
|
|
524
507
|
return GroupRow ? <GroupRow
|
|
525
508
|
pane={props.pane}
|
|
526
509
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -547,9 +530,9 @@ function GridBodyLayer(props) {
|
|
|
547
530
|
<Show2 when={labelRow()}>
|
|
548
531
|
{(label) => {
|
|
549
532
|
const layer = () => props.labelRowLayer;
|
|
550
|
-
const LabelRow =
|
|
551
|
-
const labelSlot =
|
|
552
|
-
const labelRowKey =
|
|
533
|
+
const LabelRow = untrack2(layer)?.Row;
|
|
534
|
+
const labelSlot = createMemo4(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
535
|
+
const labelRowKey = createMemo4(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
553
536
|
return LabelRow ? <LabelRow
|
|
554
537
|
pane={props.pane}
|
|
555
538
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -573,14 +556,14 @@ function GridBodyLayer(props) {
|
|
|
573
556
|
{(currentRow) => {
|
|
574
557
|
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
575
558
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
576
|
-
const rowSize =
|
|
577
|
-
const isRowChecked =
|
|
559
|
+
const rowSize = createMemo4(() => item().size ?? props.rowHeight);
|
|
560
|
+
const isRowChecked = createMemo4(
|
|
578
561
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
579
562
|
);
|
|
580
|
-
const isRowSelected =
|
|
563
|
+
const isRowSelected = createMemo4(
|
|
581
564
|
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
582
565
|
);
|
|
583
|
-
const selectedColRange =
|
|
566
|
+
const selectedColRange = createMemo4(() => {
|
|
584
567
|
const selection = props.selection;
|
|
585
568
|
if (selection.kind === "col") {
|
|
586
569
|
return [selection.startCol, selection.endCol];
|
|
@@ -592,9 +575,9 @@ function GridBodyLayer(props) {
|
|
|
592
575
|
});
|
|
593
576
|
const selectedColStart = () => selectedColRange()[0];
|
|
594
577
|
const selectedColEnd = () => selectedColRange()[1];
|
|
595
|
-
const activeCol =
|
|
596
|
-
const rowFindHits =
|
|
597
|
-
const rowFindCurrent =
|
|
578
|
+
const activeCol = createMemo4(() => props.activeCell?.row === rowIndex() ? props.activeCell.col : -1);
|
|
579
|
+
const rowFindHits = createMemo4(() => props.findIndex.get(rowIndex()));
|
|
580
|
+
const rowFindCurrent = createMemo4(() => {
|
|
598
581
|
const hits = rowFindHits();
|
|
599
582
|
const current = hits ? props.findCurrentIndex : null;
|
|
600
583
|
if (!hits || current === null) {
|
|
@@ -607,10 +590,10 @@ function GridBodyLayer(props) {
|
|
|
607
590
|
}
|
|
608
591
|
return null;
|
|
609
592
|
});
|
|
610
|
-
const editingCol =
|
|
611
|
-
const rowAutoHeight =
|
|
612
|
-
const isHovered =
|
|
613
|
-
const rowSlot =
|
|
593
|
+
const editingCol = createMemo4(() => props.editingCell?.row === rowIndex() ? props.editingCell.col : -1);
|
|
594
|
+
const rowAutoHeight = createMemo4(() => !!props.autoHeight);
|
|
595
|
+
const isHovered = createMemo4(() => props.hoveredRowIndex === rowIndex());
|
|
596
|
+
const rowSlot = createMemo4(
|
|
614
597
|
() => resolveSlotProps(
|
|
615
598
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
616
599
|
row: currentRow(),
|
|
@@ -679,14 +662,14 @@ function GridBodyLayer(props) {
|
|
|
679
662
|
</Show2>
|
|
680
663
|
<For2 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
681
664
|
{(entry) => {
|
|
682
|
-
const unbound =
|
|
665
|
+
const unbound = createMemo4(() => entry().column);
|
|
683
666
|
const column = () => unbound();
|
|
684
|
-
const colIndex =
|
|
667
|
+
const colIndex = createMemo4(() => entry().logicalIndex);
|
|
685
668
|
const size = () => entry().paneLocalSize;
|
|
686
669
|
const isActive = () => activeCol() === colIndex();
|
|
687
670
|
const isEditing = () => editingCol() === colIndex();
|
|
688
671
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
689
|
-
const readOnlyCell =
|
|
672
|
+
const readOnlyCell = createMemo4(
|
|
690
673
|
() => !isCellEditable(
|
|
691
674
|
{ readOnly: props.readOnly, canEditCell: props.canEditCell },
|
|
692
675
|
rowIndex(),
|
|
@@ -702,7 +685,7 @@ function GridBodyLayer(props) {
|
|
|
702
685
|
() => rowFindHits()?.get(colIndex()),
|
|
703
686
|
void 0
|
|
704
687
|
);
|
|
705
|
-
const cellRowKey =
|
|
688
|
+
const cellRowKey = untrack2(rowKey);
|
|
706
689
|
const cellState = {
|
|
707
690
|
get rowIndex() {
|
|
708
691
|
return rowIndex();
|
|
@@ -891,10 +874,10 @@ function GridBodyLayer(props) {
|
|
|
891
874
|
</Show2>
|
|
892
875
|
<Show2
|
|
893
876
|
when={isAutoHeightCell()}
|
|
894
|
-
fallback={props.renderCellContent(currentRow
|
|
877
|
+
fallback={props.renderCellContent(currentRow, column(), cellState)}
|
|
895
878
|
>
|
|
896
879
|
<div class="ssg-autoheight-content" data-autoheight-content="">
|
|
897
|
-
{props.renderCellContent(currentRow
|
|
880
|
+
{props.renderCellContent(currentRow, column(), cellState)}
|
|
898
881
|
</div>
|
|
899
882
|
</Show2>
|
|
900
883
|
</div>;
|
|
@@ -927,7 +910,7 @@ function Overlay(props) {
|
|
|
927
910
|
}
|
|
928
911
|
|
|
929
912
|
// src/view/GridDetailLayer.tsx
|
|
930
|
-
import { For as For3, Show as Show4, createMemo as
|
|
913
|
+
import { For as For3, Show as Show4, createMemo as createMemo5, onCleanup, untrack as untrack3 } from "solid-js";
|
|
931
914
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
932
915
|
var stopPropagation = (event) => {
|
|
933
916
|
event.stopPropagation();
|
|
@@ -939,7 +922,7 @@ var mergeSlotStyles = (...styles) => {
|
|
|
939
922
|
function GridDetailLayer(props) {
|
|
940
923
|
return <For3 each={props.entries} keyed={(entry) => entry.rowKey}>
|
|
941
924
|
{(entry) => {
|
|
942
|
-
const index =
|
|
925
|
+
const index = createMemo5(() => entry().virtualRow.index);
|
|
943
926
|
const detailSize = () => entry().virtualRow.detailSize ?? 0;
|
|
944
927
|
return <Show4 when={detailSize() > 0}>
|
|
945
928
|
<div
|
|
@@ -966,9 +949,9 @@ function GridDetailLayer(props) {
|
|
|
966
949
|
}
|
|
967
950
|
function DetailCard(props) {
|
|
968
951
|
const layer = props.layer;
|
|
969
|
-
const rowKey =
|
|
970
|
-
const row =
|
|
971
|
-
const sourceRowIndex =
|
|
952
|
+
const rowKey = untrack3(() => props.entry().rowKey);
|
|
953
|
+
const row = createMemo5(() => layer.rowModel.getRow(props.index()));
|
|
954
|
+
const sourceRowIndex = createMemo5(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
972
955
|
const ctx = {
|
|
973
956
|
get row() {
|
|
974
957
|
return row();
|
|
@@ -980,7 +963,7 @@ function DetailCard(props) {
|
|
|
980
963
|
get sourceRowIndex() {
|
|
981
964
|
return sourceRowIndex();
|
|
982
965
|
},
|
|
983
|
-
collapse: () => layer.onCollapse?.(rowKey,
|
|
966
|
+
collapse: () => layer.onCollapse?.(rowKey, untrack3(props.index))
|
|
984
967
|
};
|
|
985
968
|
let card;
|
|
986
969
|
onCleanup(() => notifyDetailCardFocusLost(card ?? null, layer.onCardFocusLost));
|
|
@@ -997,7 +980,7 @@ function DetailCard(props) {
|
|
|
997
980
|
style={mergeSlotStyles(layer.slots.detailCard?.style, layer.cardSlot?.style)}
|
|
998
981
|
data-ssg-detail=""
|
|
999
982
|
onKeyDown={(event) => {
|
|
1000
|
-
layer.onCardKeyDown?.(event, event.currentTarget,
|
|
983
|
+
layer.onCardKeyDown?.(event, event.currentTarget, untrack3(props.index));
|
|
1001
984
|
event.stopPropagation();
|
|
1002
985
|
}}
|
|
1003
986
|
onKeyUp={stopPropagation}
|
|
@@ -1014,6 +997,7 @@ function DetailCard(props) {
|
|
|
1014
997
|
}
|
|
1015
998
|
|
|
1016
999
|
// src/view/DetailToggleButton.tsx
|
|
1000
|
+
import { formatLocaleText as formatLocaleText3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1017
1001
|
function DetailToggleButton(props) {
|
|
1018
1002
|
const texts = useGridLocaleText();
|
|
1019
1003
|
return <button
|
|
@@ -1021,7 +1005,9 @@ function DetailToggleButton(props) {
|
|
|
1021
1005
|
tabindex={-1}
|
|
1022
1006
|
class="ssg-detail-toggle"
|
|
1023
1007
|
aria-expanded={props.detail.expanded ? "true" : "false"}
|
|
1024
|
-
aria-label={props.detail.expanded ? texts().hideDetails : texts().showDetails
|
|
1008
|
+
aria-label={formatLocaleText3(props.detail.expanded ? texts().hideDetails : texts().showDetails, {
|
|
1009
|
+
row: props.rowNumber
|
|
1010
|
+
})}
|
|
1025
1011
|
onClick={() => props.detail.toggle()}
|
|
1026
1012
|
onPointerDown={(event) => {
|
|
1027
1013
|
if (event.button !== 0) {
|
|
@@ -1056,13 +1042,13 @@ function CheckboxCell(props) {
|
|
|
1056
1042
|
}
|
|
1057
1043
|
|
|
1058
1044
|
// src/editors/CellEditorLayer.tsx
|
|
1059
|
-
import { Show as Show8, createMemo as
|
|
1045
|
+
import { Show as Show8, createMemo as createMemo6, untrack as untrack10 } from "solid-js";
|
|
1060
1046
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1061
1047
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1062
|
-
import { formatLocaleText as
|
|
1048
|
+
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1063
1049
|
|
|
1064
1050
|
// src/editors/TextCellEditor.tsx
|
|
1065
|
-
import { Show as Show6, createRenderEffect as
|
|
1051
|
+
import { Show as Show6, createRenderEffect as createRenderEffect2, createSignal as createSignal3, onCleanup as onCleanup2, onSettled as onSettled3, untrack as untrack5 } from "solid-js";
|
|
1066
1052
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1067
1053
|
import {
|
|
1068
1054
|
fitMultilineEditor,
|
|
@@ -1072,7 +1058,7 @@ import {
|
|
|
1072
1058
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1073
1059
|
|
|
1074
1060
|
// src/primitives/topAlignedInput.ts
|
|
1075
|
-
import { createRenderEffect
|
|
1061
|
+
import { createRenderEffect, onSettled, untrack as untrack4 } from "solid-js";
|
|
1076
1062
|
import {
|
|
1077
1063
|
alignInputTextToTop,
|
|
1078
1064
|
resolveHiddenTopOf
|
|
@@ -1084,12 +1070,12 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1084
1070
|
}
|
|
1085
1071
|
};
|
|
1086
1072
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1087
|
-
|
|
1088
|
-
onSettled(() => apply(
|
|
1073
|
+
createRenderEffect(read, apply, { name: "topAlignedInput" });
|
|
1074
|
+
onSettled(() => apply(untrack4(read)));
|
|
1089
1075
|
}
|
|
1090
1076
|
|
|
1091
1077
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1092
|
-
import { Show as Show5, createSignal as
|
|
1078
|
+
import { Show as Show5, createSignal as createSignal2, onSettled as onSettled2 } from "solid-js";
|
|
1093
1079
|
import {
|
|
1094
1080
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1095
1081
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1102,7 +1088,7 @@ function CellEditorError(props) {
|
|
|
1102
1088
|
}
|
|
1103
1089
|
function CellEditorErrorBubble(props) {
|
|
1104
1090
|
let element;
|
|
1105
|
-
const [placement2, setPlacement] =
|
|
1091
|
+
const [placement2, setPlacement] = createSignal2(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1106
1092
|
onSettled2(() => {
|
|
1107
1093
|
if (element) {
|
|
1108
1094
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1126,11 +1112,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1126
1112
|
|
|
1127
1113
|
// src/editors/TextCellEditor.tsx
|
|
1128
1114
|
function TextCellEditor(props) {
|
|
1129
|
-
const [input, setInput] =
|
|
1130
|
-
const [textarea, setTextarea] =
|
|
1131
|
-
const [error, setError] =
|
|
1132
|
-
const initialValue =
|
|
1133
|
-
const [draft, setDraft] =
|
|
1115
|
+
const [input, setInput] = createSignal3();
|
|
1116
|
+
const [textarea, setTextarea] = createSignal3();
|
|
1117
|
+
const [error, setError] = createSignal3(null);
|
|
1118
|
+
const initialValue = untrack5(() => props.initialValue);
|
|
1119
|
+
const [draft, setDraft] = createSignal3(initialValue);
|
|
1134
1120
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1135
1121
|
const alignTop = () => props.alignTop ?? false;
|
|
1136
1122
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1151,9 +1137,9 @@ function TextCellEditor(props) {
|
|
|
1151
1137
|
element.setSelectionRange(caret, caret);
|
|
1152
1138
|
}
|
|
1153
1139
|
};
|
|
1154
|
-
|
|
1140
|
+
createRenderEffect2(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1155
1141
|
onSettled3(() => {
|
|
1156
|
-
const element =
|
|
1142
|
+
const element = untrack5(() => input() ?? textarea());
|
|
1157
1143
|
if (!element) {
|
|
1158
1144
|
return;
|
|
1159
1145
|
}
|
|
@@ -1165,6 +1151,14 @@ function TextCellEditor(props) {
|
|
|
1165
1151
|
onCleanup2(() => {
|
|
1166
1152
|
disposed = true;
|
|
1167
1153
|
});
|
|
1154
|
+
props.onRegisterFlush?.(() => {
|
|
1155
|
+
untrack5(() => {
|
|
1156
|
+
const element = input() ?? textarea();
|
|
1157
|
+
if (element) {
|
|
1158
|
+
props.onCommit(element.value);
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
});
|
|
1168
1162
|
const commitOnBlur = (value) => {
|
|
1169
1163
|
if (disposed) {
|
|
1170
1164
|
return;
|
|
@@ -1188,7 +1182,7 @@ function TextCellEditor(props) {
|
|
|
1188
1182
|
handleInput(next.value);
|
|
1189
1183
|
};
|
|
1190
1184
|
const renderInput = () => {
|
|
1191
|
-
const startValue =
|
|
1185
|
+
const startValue = untrack5(draft);
|
|
1192
1186
|
return <>
|
|
1193
1187
|
<input
|
|
1194
1188
|
ref={setInput}
|
|
@@ -1212,7 +1206,7 @@ function TextCellEditor(props) {
|
|
|
1212
1206
|
</>;
|
|
1213
1207
|
};
|
|
1214
1208
|
const renderTextarea = () => {
|
|
1215
|
-
const startValue =
|
|
1209
|
+
const startValue = untrack5(draft);
|
|
1216
1210
|
return <div class="ssg-cell-editor-multiline">
|
|
1217
1211
|
<textarea
|
|
1218
1212
|
ref={setTextarea}
|
|
@@ -1251,25 +1245,33 @@ function TextCellEditor(props) {
|
|
|
1251
1245
|
}
|
|
1252
1246
|
|
|
1253
1247
|
// src/editors/NumberCellEditor.tsx
|
|
1254
|
-
import { createSignal as
|
|
1248
|
+
import { createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled4, untrack as untrack6 } from "solid-js";
|
|
1255
1249
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1256
1250
|
import {
|
|
1257
1251
|
resolveNumberEditorCommitValue,
|
|
1258
1252
|
resolveNumberEditorStart
|
|
1259
1253
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1260
1254
|
function NumberCellEditor(props) {
|
|
1261
|
-
const [input, setInput] =
|
|
1262
|
-
const [error, setError] =
|
|
1255
|
+
const [input, setInput] = createSignal4();
|
|
1256
|
+
const [error, setError] = createSignal4(null);
|
|
1263
1257
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1264
|
-
const start = resolveNumberEditorStart(
|
|
1258
|
+
const start = resolveNumberEditorStart(untrack6(() => props.initialValue));
|
|
1265
1259
|
const textMode = start.textMode;
|
|
1266
1260
|
const startText = start.text;
|
|
1267
1261
|
let disposed = false;
|
|
1268
1262
|
onCleanup3(() => {
|
|
1269
1263
|
disposed = true;
|
|
1270
1264
|
});
|
|
1265
|
+
props.onRegisterFlush?.(() => {
|
|
1266
|
+
untrack6(() => {
|
|
1267
|
+
const element = input();
|
|
1268
|
+
if (element) {
|
|
1269
|
+
props.onCommit(resolveNumberEditorCommitValue(element.value, textMode));
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
});
|
|
1271
1273
|
onSettled4(() => {
|
|
1272
|
-
const element =
|
|
1274
|
+
const element = untrack6(input);
|
|
1273
1275
|
if (!element) {
|
|
1274
1276
|
return;
|
|
1275
1277
|
}
|
|
@@ -1318,13 +1320,13 @@ function NumberCellEditor(props) {
|
|
|
1318
1320
|
import {
|
|
1319
1321
|
For as For4,
|
|
1320
1322
|
Show as Show7,
|
|
1321
|
-
createEffect
|
|
1322
|
-
createRenderEffect as
|
|
1323
|
-
createSignal as
|
|
1323
|
+
createEffect,
|
|
1324
|
+
createRenderEffect as createRenderEffect3,
|
|
1325
|
+
createSignal as createSignal5,
|
|
1324
1326
|
createUniqueId,
|
|
1325
1327
|
onCleanup as onCleanup4,
|
|
1326
1328
|
onSettled as onSettled5,
|
|
1327
|
-
untrack as
|
|
1329
|
+
untrack as untrack7
|
|
1328
1330
|
} from "solid-js";
|
|
1329
1331
|
import { Portal } from "@solidjs/web";
|
|
1330
1332
|
import {
|
|
@@ -1340,36 +1342,36 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1340
1342
|
function SelectCellEditor(props) {
|
|
1341
1343
|
const texts = useGridLocaleText();
|
|
1342
1344
|
const portal = useGridPortal();
|
|
1343
|
-
const [input, setInput] =
|
|
1344
|
-
const [list, setList] =
|
|
1345
|
+
const [input, setInput] = createSignal5();
|
|
1346
|
+
const [list, setList] = createSignal5();
|
|
1345
1347
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1346
1348
|
const listId = createUniqueId();
|
|
1347
|
-
const start =
|
|
1349
|
+
const start = untrack7(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1348
1350
|
let typeahead = start.typeahead;
|
|
1349
|
-
const [highlight, setHighlight] =
|
|
1351
|
+
const [highlight, setHighlight] = createSignal5(start.highlight);
|
|
1350
1352
|
let currentHighlight = start.highlight;
|
|
1351
1353
|
const updateHighlight = (next) => {
|
|
1352
1354
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1353
1355
|
setHighlight(currentHighlight);
|
|
1354
1356
|
};
|
|
1355
|
-
const [placement2, setPlacement] =
|
|
1357
|
+
const [placement2, setPlacement] = createSignal5(null);
|
|
1356
1358
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1357
|
-
const [error, setError] =
|
|
1358
|
-
const [composing, setComposing] =
|
|
1359
|
+
const [error, setError] = createSignal5(null);
|
|
1360
|
+
const [composing, setComposing] = createSignal5(null);
|
|
1359
1361
|
let composingNow = null;
|
|
1360
1362
|
const updateComposing = (next) => {
|
|
1361
1363
|
composingNow = next;
|
|
1362
1364
|
setComposing(next);
|
|
1363
1365
|
};
|
|
1364
1366
|
const measure = () => {
|
|
1365
|
-
const element =
|
|
1367
|
+
const element = untrack7(input);
|
|
1366
1368
|
if (!element) {
|
|
1367
1369
|
return;
|
|
1368
1370
|
}
|
|
1369
1371
|
setPlacement(
|
|
1370
1372
|
computeSelectPopoverPlacement(
|
|
1371
1373
|
element.getBoundingClientRect(),
|
|
1372
|
-
|
|
1374
|
+
untrack7(() => props.options.length),
|
|
1373
1375
|
window.innerWidth,
|
|
1374
1376
|
window.innerHeight,
|
|
1375
1377
|
optionRowHeight
|
|
@@ -1377,7 +1379,7 @@ function SelectCellEditor(props) {
|
|
|
1377
1379
|
);
|
|
1378
1380
|
};
|
|
1379
1381
|
onSettled5(() => {
|
|
1380
|
-
|
|
1382
|
+
untrack7(input)?.focus();
|
|
1381
1383
|
measure();
|
|
1382
1384
|
window.addEventListener("resize", measure);
|
|
1383
1385
|
window.addEventListener("scroll", measure, true);
|
|
@@ -1386,18 +1388,27 @@ function SelectCellEditor(props) {
|
|
|
1386
1388
|
window.removeEventListener("scroll", measure, true);
|
|
1387
1389
|
};
|
|
1388
1390
|
});
|
|
1389
|
-
|
|
1391
|
+
createEffect(
|
|
1390
1392
|
() => props.options.length,
|
|
1391
1393
|
(_length, previous) => {
|
|
1392
1394
|
if (previous !== void 0) {
|
|
1393
|
-
|
|
1395
|
+
untrack7(input)?.focus();
|
|
1394
1396
|
measure();
|
|
1395
1397
|
}
|
|
1396
1398
|
},
|
|
1397
1399
|
{ name: "selectEditorOptionsRefocus" }
|
|
1398
1400
|
);
|
|
1401
|
+
createEffect(
|
|
1402
|
+
() => `${props.cellTop ?? 0}:${props.cellLeft ?? 0}`,
|
|
1403
|
+
(position, previous) => {
|
|
1404
|
+
if (previous !== void 0 && previous !== position) {
|
|
1405
|
+
measure();
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
{ name: "selectEditorFollowCell" }
|
|
1409
|
+
);
|
|
1399
1410
|
const mount = () => placement2() !== null ? portal.container() : null;
|
|
1400
|
-
|
|
1411
|
+
createEffect(
|
|
1401
1412
|
() => [highlight(), list()],
|
|
1402
1413
|
([index, element]) => {
|
|
1403
1414
|
const option = element?.children[index];
|
|
@@ -1447,7 +1458,7 @@ function SelectCellEditor(props) {
|
|
|
1447
1458
|
};
|
|
1448
1459
|
const highlightedOption = () => props.options[highlight()];
|
|
1449
1460
|
const shownText = () => highlightedOption()?.label ?? String(props.value ?? "");
|
|
1450
|
-
const initialShownText =
|
|
1461
|
+
const initialShownText = untrack7(shownText);
|
|
1451
1462
|
let disposed = false;
|
|
1452
1463
|
onCleanup4(() => {
|
|
1453
1464
|
disposed = true;
|
|
@@ -1462,7 +1473,7 @@ function SelectCellEditor(props) {
|
|
|
1462
1473
|
if (event.isComposing) {
|
|
1463
1474
|
updateComposing(event.currentTarget.value);
|
|
1464
1475
|
} else {
|
|
1465
|
-
event.currentTarget.value = composingNow ??
|
|
1476
|
+
event.currentTarget.value = composingNow ?? untrack7(shownText);
|
|
1466
1477
|
}
|
|
1467
1478
|
}}
|
|
1468
1479
|
onCompositionStart={(event) => updateComposing(event.currentTarget.value)}
|
|
@@ -1541,7 +1552,7 @@ function SelectCellEditor(props) {
|
|
|
1541
1552
|
</Show7>
|
|
1542
1553
|
</>;
|
|
1543
1554
|
createPortalTokens(list, () => props.themeClassName, placement2);
|
|
1544
|
-
|
|
1555
|
+
createRenderEffect3(
|
|
1545
1556
|
() => [input(), composing() ?? shownText()],
|
|
1546
1557
|
([element, text]) => {
|
|
1547
1558
|
if (element && element.value !== text) {
|
|
@@ -1550,7 +1561,7 @@ function SelectCellEditor(props) {
|
|
|
1550
1561
|
},
|
|
1551
1562
|
{ name: "selectEditorInputText" }
|
|
1552
1563
|
);
|
|
1553
|
-
|
|
1564
|
+
createRenderEffect3(
|
|
1554
1565
|
() => [input(), shownText(), composing()],
|
|
1555
1566
|
([element, , composingText]) => {
|
|
1556
1567
|
if (!element || composingText !== null) {
|
|
@@ -1565,25 +1576,25 @@ function SelectCellEditor(props) {
|
|
|
1565
1576
|
}
|
|
1566
1577
|
|
|
1567
1578
|
// src/editors/DateCellEditor.tsx
|
|
1568
|
-
import { createSignal as
|
|
1579
|
+
import { createSignal as createSignal6, onCleanup as onCleanup5, onSettled as onSettled6, untrack as untrack8 } from "solid-js";
|
|
1569
1580
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1570
1581
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1571
1582
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1572
1583
|
function DateCellEditor(props) {
|
|
1573
1584
|
const texts = useGridLocaleText();
|
|
1574
|
-
const [input, setInput] =
|
|
1575
|
-
const [error, setError] =
|
|
1576
|
-
const [shift, setShift] =
|
|
1585
|
+
const [input, setInput] = createSignal6();
|
|
1586
|
+
const [error, setError] = createSignal6(null);
|
|
1587
|
+
const [shift, setShift] = createSignal6(0);
|
|
1577
1588
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1578
|
-
const initialText =
|
|
1589
|
+
const initialText = untrack8(() => props.initialText);
|
|
1579
1590
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
1580
|
-
const startValue = textMode ? initialText ?? "" :
|
|
1591
|
+
const startValue = textMode ? initialText ?? "" : untrack8(() => props.initialValue);
|
|
1581
1592
|
let disposed = false;
|
|
1582
1593
|
onCleanup5(() => {
|
|
1583
1594
|
disposed = true;
|
|
1584
1595
|
});
|
|
1585
1596
|
onSettled6(() => {
|
|
1586
|
-
const element =
|
|
1597
|
+
const element = untrack8(input);
|
|
1587
1598
|
if (!element) {
|
|
1588
1599
|
return;
|
|
1589
1600
|
}
|
|
@@ -1601,6 +1612,14 @@ function DateCellEditor(props) {
|
|
|
1601
1612
|
const normalized = readTypedDateCommitValue(value);
|
|
1602
1613
|
return normalized === null ? { status: "rejected", message: texts().enterDate } : props.onCommit(normalized, direction);
|
|
1603
1614
|
};
|
|
1615
|
+
props.onRegisterFlush?.(() => {
|
|
1616
|
+
untrack8(() => {
|
|
1617
|
+
const element = input();
|
|
1618
|
+
if (element) {
|
|
1619
|
+
commitDraft(element.value);
|
|
1620
|
+
}
|
|
1621
|
+
});
|
|
1622
|
+
});
|
|
1604
1623
|
return <>
|
|
1605
1624
|
<input
|
|
1606
1625
|
ref={setInput}
|
|
@@ -1638,13 +1657,13 @@ function DateCellEditor(props) {
|
|
|
1638
1657
|
}
|
|
1639
1658
|
|
|
1640
1659
|
// src/editors/CustomCellEditor.tsx
|
|
1641
|
-
import { onCleanup as onCleanup6, untrack as
|
|
1660
|
+
import { onCleanup as onCleanup6, untrack as untrack9 } from "solid-js";
|
|
1642
1661
|
function CustomCellEditor(props) {
|
|
1643
1662
|
let alive = true;
|
|
1644
1663
|
onCleanup6(() => {
|
|
1645
1664
|
alive = false;
|
|
1646
1665
|
});
|
|
1647
|
-
const context =
|
|
1666
|
+
const context = untrack9(() => props.context);
|
|
1648
1667
|
const sessionContext = Object.defineProperties({}, Object.getOwnPropertyDescriptors(context));
|
|
1649
1668
|
sessionContext.commit = (value, direction) => alive ? context.commit(value, direction) : { status: "noop" };
|
|
1650
1669
|
sessionContext.cancel = () => {
|
|
@@ -1652,23 +1671,23 @@ function CustomCellEditor(props) {
|
|
|
1652
1671
|
context.cancel();
|
|
1653
1672
|
}
|
|
1654
1673
|
};
|
|
1655
|
-
return <>{
|
|
1674
|
+
return <>{untrack9(() => props.render(sessionContext))}</>;
|
|
1656
1675
|
}
|
|
1657
1676
|
|
|
1658
1677
|
// src/editors/CellEditorLayer.tsx
|
|
1659
1678
|
function CellEditorLayer(props) {
|
|
1660
1679
|
const texts = useGridLocaleText();
|
|
1661
|
-
const editor = () => props.
|
|
1662
|
-
const kind =
|
|
1680
|
+
const editor = () => props.editor;
|
|
1681
|
+
const kind = createMemo6(() => {
|
|
1663
1682
|
const type = editor()?.type;
|
|
1664
1683
|
return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
|
|
1665
1684
|
});
|
|
1666
1685
|
const editLabel = () => {
|
|
1667
1686
|
const session = props.session;
|
|
1668
|
-
return session ?
|
|
1687
|
+
return session ? formatLocaleText4(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1669
1688
|
};
|
|
1670
1689
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1671
|
-
const selectOptions =
|
|
1690
|
+
const selectOptions = createMemo6(() => {
|
|
1672
1691
|
const current = editor();
|
|
1673
1692
|
if (current?.type !== "select") {
|
|
1674
1693
|
return [];
|
|
@@ -1679,6 +1698,44 @@ function CellEditorLayer(props) {
|
|
|
1679
1698
|
const row = props.session?.row;
|
|
1680
1699
|
return row !== void 0 ? current.options(row) : [];
|
|
1681
1700
|
});
|
|
1701
|
+
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1702
|
+
const session = createMemo6(
|
|
1703
|
+
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session ?? previous ?? null : previous
|
|
1704
|
+
);
|
|
1705
|
+
const context = {
|
|
1706
|
+
get row() {
|
|
1707
|
+
return session()?.row;
|
|
1708
|
+
},
|
|
1709
|
+
get rowIndex() {
|
|
1710
|
+
return session()?.rowIndex ?? -1;
|
|
1711
|
+
},
|
|
1712
|
+
get sourceRowIndex() {
|
|
1713
|
+
return session()?.sourceRowIndex ?? -1;
|
|
1714
|
+
},
|
|
1715
|
+
get rowKey() {
|
|
1716
|
+
return session()?.rowKey ?? -1;
|
|
1717
|
+
},
|
|
1718
|
+
get colIndex() {
|
|
1719
|
+
return session()?.colIndex ?? -1;
|
|
1720
|
+
},
|
|
1721
|
+
get column() {
|
|
1722
|
+
return session()?.column;
|
|
1723
|
+
},
|
|
1724
|
+
get value() {
|
|
1725
|
+
return session()?.value;
|
|
1726
|
+
},
|
|
1727
|
+
initialText: initialValue,
|
|
1728
|
+
get align() {
|
|
1729
|
+
return props.align;
|
|
1730
|
+
},
|
|
1731
|
+
// void の戻り(モックなど)は noop にそろえて、利用側の分岐を単純にします。
|
|
1732
|
+
commit: (value, direction) => props.onCommit(value, direction) ?? { status: "noop" },
|
|
1733
|
+
cancel: () => props.onCancel()
|
|
1734
|
+
};
|
|
1735
|
+
return <Show8 when={session() !== null}>
|
|
1736
|
+
<CustomCellEditor render={render} context={context} />
|
|
1737
|
+
</Show8>;
|
|
1738
|
+
};
|
|
1682
1739
|
const renderEditor = (type, sessionId) => {
|
|
1683
1740
|
const common = {
|
|
1684
1741
|
get ariaLabel() {
|
|
@@ -1697,9 +1754,13 @@ function CellEditorLayer(props) {
|
|
|
1697
1754
|
return props.alignTop;
|
|
1698
1755
|
},
|
|
1699
1756
|
onCommit: (value, direction) => props.onCommit(value, direction),
|
|
1700
|
-
onCancel: () => props.onCancel()
|
|
1757
|
+
onCancel: () => props.onCancel(),
|
|
1758
|
+
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
1701
1759
|
};
|
|
1702
|
-
const initialValue =
|
|
1760
|
+
const initialValue = untrack10(props.initialValue);
|
|
1761
|
+
if (type === "select" || type === "custom") {
|
|
1762
|
+
props.onRegisterFlush?.(null);
|
|
1763
|
+
}
|
|
1703
1764
|
switch (type) {
|
|
1704
1765
|
case "number": {
|
|
1705
1766
|
const numberEditor = () => {
|
|
@@ -1715,7 +1776,7 @@ function CellEditorLayer(props) {
|
|
|
1715
1776
|
/>;
|
|
1716
1777
|
}
|
|
1717
1778
|
case "date": {
|
|
1718
|
-
const session =
|
|
1779
|
+
const session = untrack10(() => props.session);
|
|
1719
1780
|
return <DateCellEditor
|
|
1720
1781
|
{...common}
|
|
1721
1782
|
initialValue={toDateInputValue(session ? session.value : initialValue)}
|
|
@@ -1723,55 +1784,24 @@ function CellEditorLayer(props) {
|
|
|
1723
1784
|
/>;
|
|
1724
1785
|
}
|
|
1725
1786
|
case "select": {
|
|
1726
|
-
const session =
|
|
1787
|
+
const session = untrack10(() => props.session);
|
|
1727
1788
|
return <SelectCellEditor
|
|
1728
1789
|
{...common}
|
|
1729
1790
|
popoverSlot={props.slots.popover}
|
|
1730
1791
|
themeClassName={props.themeClassName}
|
|
1731
1792
|
options={selectOptions()}
|
|
1732
1793
|
value={props.session?.value}
|
|
1794
|
+
cellTop={props.rect?.top ?? 0}
|
|
1795
|
+
cellLeft={props.rect?.left ?? 0}
|
|
1733
1796
|
initialText={session ? resolveTypedStartText(initialValue, session.value) : void 0}
|
|
1734
1797
|
/>;
|
|
1735
1798
|
}
|
|
1736
1799
|
case "custom": {
|
|
1737
|
-
const current =
|
|
1738
|
-
if (current?.type !== "custom"
|
|
1800
|
+
const current = untrack10(editor);
|
|
1801
|
+
if (current?.type !== "custom") {
|
|
1739
1802
|
return null;
|
|
1740
1803
|
}
|
|
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} />;
|
|
1804
|
+
return renderCustomEditor(current.render, sessionId, initialValue);
|
|
1775
1805
|
}
|
|
1776
1806
|
default: {
|
|
1777
1807
|
const textEditor = () => {
|
|
@@ -1812,7 +1842,7 @@ function CellEditorLayer(props) {
|
|
|
1812
1842
|
}
|
|
1813
1843
|
|
|
1814
1844
|
// src/view/DefaultGridTopBar.tsx
|
|
1815
|
-
import { Show as Show9, createMemo as
|
|
1845
|
+
import { Show as Show9, createMemo as createMemo7, createRenderEffect as createRenderEffect4, createSignal as createSignal7, createUniqueId as createUniqueId2, untrack as untrack11 } from "solid-js";
|
|
1816
1846
|
var DefaultFilterIcon = () => <svg
|
|
1817
1847
|
width="14"
|
|
1818
1848
|
height="14"
|
|
@@ -1844,9 +1874,9 @@ function DefaultGridTopBar(props) {
|
|
|
1844
1874
|
const texts = useGridLocaleText();
|
|
1845
1875
|
const filterSummaryId = createUniqueId2();
|
|
1846
1876
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1847
|
-
const [input, setInput] =
|
|
1848
|
-
const initialText =
|
|
1849
|
-
|
|
1877
|
+
const [input, setInput] = createSignal7();
|
|
1878
|
+
const initialText = untrack11(() => props.globalFilterText);
|
|
1879
|
+
createRenderEffect4(
|
|
1850
1880
|
() => [input(), props.globalFilterText],
|
|
1851
1881
|
([element, text]) => {
|
|
1852
1882
|
if (element && element.value !== text) {
|
|
@@ -1856,7 +1886,7 @@ function DefaultGridTopBar(props) {
|
|
|
1856
1886
|
{ name: "globalFilterInput" }
|
|
1857
1887
|
);
|
|
1858
1888
|
const hasFilterText = () => props.globalFilterText.trim().length > 0;
|
|
1859
|
-
const filterIcon =
|
|
1889
|
+
const filterIcon = createMemo7(() => {
|
|
1860
1890
|
const icon = props.globalFilterIcon;
|
|
1861
1891
|
return icon === void 0 ? <DefaultFilterIcon /> : icon;
|
|
1862
1892
|
});
|
|
@@ -1932,7 +1962,7 @@ function DefaultGridTopBar(props) {
|
|
|
1932
1962
|
|
|
1933
1963
|
// src/view/DefaultGridBottomBar.tsx
|
|
1934
1964
|
import { Show as Show10 } from "solid-js";
|
|
1935
|
-
import { formatLocaleText as
|
|
1965
|
+
import { formatLocaleText as formatLocaleText5 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1936
1966
|
function DefaultGridBottomBar(props) {
|
|
1937
1967
|
const texts = useGridLocaleText();
|
|
1938
1968
|
const aggregates = (trailing) => {
|
|
@@ -1950,10 +1980,10 @@ function DefaultGridBottomBar(props) {
|
|
|
1950
1980
|
</Show10>
|
|
1951
1981
|
<div class="ssg-bar-group">
|
|
1952
1982
|
<span class="ssg-bar-chip">
|
|
1953
|
-
{
|
|
1983
|
+
{formatLocaleText5(texts().activeCell, { cell: props.derivedSummary.activeCellLabel })}
|
|
1954
1984
|
</span>
|
|
1955
1985
|
<span class="ssg-bar-chip">
|
|
1956
|
-
{
|
|
1986
|
+
{formatLocaleText5(texts().selection, { range: props.derivedSummary.selectionLabel })}
|
|
1957
1987
|
</span>
|
|
1958
1988
|
<span class="ssg-bar-chip">{props.derivedSummary.selectionStatsText}</span>
|
|
1959
1989
|
<span class="ssg-bar-chip">{props.derivedSummary.selectedColumnsText}</span>
|
|
@@ -1964,7 +1994,7 @@ function DefaultGridBottomBar(props) {
|
|
|
1964
1994
|
}
|
|
1965
1995
|
|
|
1966
1996
|
// src/devWarnings.ts
|
|
1967
|
-
import { $PROXY, createEffect as
|
|
1997
|
+
import { $PROXY, createEffect as createEffect2, createMemo as createMemo8 } from "solid-js";
|
|
1968
1998
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
1969
1999
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
1970
2000
|
import {
|
|
@@ -1975,7 +2005,7 @@ import {
|
|
|
1975
2005
|
var noop2 = () => {
|
|
1976
2006
|
};
|
|
1977
2007
|
var createChangeEffect = (compute, effect) => {
|
|
1978
|
-
|
|
2008
|
+
createEffect2(createMemo8(compute), effect, { name: "devWarning" });
|
|
1979
2009
|
};
|
|
1980
2010
|
var FEATURE_PROPS = {
|
|
1981
2011
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2207,15 +2237,26 @@ var warnMoveRowOnServerSide = () => {
|
|
|
2207
2237
|
);
|
|
2208
2238
|
}
|
|
2209
2239
|
};
|
|
2240
|
+
var READ_ONLY_HANDLE_METHOD = /^(get|is|can|export)/;
|
|
2241
|
+
var warnHandleCallBeforeMount = (warned, method) => {
|
|
2242
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2243
|
+
if (warned.current || READ_ONLY_HANDLE_METHOD.test(method)) {
|
|
2244
|
+
return;
|
|
2245
|
+
}
|
|
2246
|
+
warned.current = true;
|
|
2247
|
+
console.warn(
|
|
2248
|
+
`[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
|
|
2249
|
+
[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)).`
|
|
2250
|
+
);
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2210
2253
|
|
|
2211
2254
|
// src/SpreadsheetGrid.tsx
|
|
2212
2255
|
var EMPTY_ROWS = [];
|
|
2213
2256
|
var NEVER_EDITABLE = () => false;
|
|
2214
2257
|
var NO_COLUMNS = [];
|
|
2215
2258
|
var NO_COLUMN_FILTERS = {};
|
|
2216
|
-
var renderDetailToggleCell = (
|
|
2217
|
-
<DetailToggleButton detail={ctx.detail} />
|
|
2218
|
-
</Show11>;
|
|
2259
|
+
var renderDetailToggleCell = () => null;
|
|
2219
2260
|
var noop3 = () => {
|
|
2220
2261
|
};
|
|
2221
2262
|
var applyHandleRef = (ref, handle) => {
|
|
@@ -2228,10 +2269,10 @@ var applyHandleRef = (ref, handle) => {
|
|
|
2228
2269
|
var exposeHandle = (handle, before) => {
|
|
2229
2270
|
const exposed = {};
|
|
2230
2271
|
for (const [key, value] of Object.entries(handle)) {
|
|
2231
|
-
exposed[key] = typeof value === "function" ? (...args) => {
|
|
2232
|
-
before();
|
|
2272
|
+
exposed[key] = typeof value === "function" ? (...args) => runHandleCall(() => {
|
|
2273
|
+
before(key);
|
|
2233
2274
|
return value(...args);
|
|
2234
|
-
} : value;
|
|
2275
|
+
}) : value;
|
|
2235
2276
|
}
|
|
2236
2277
|
return exposed;
|
|
2237
2278
|
};
|
|
@@ -2257,9 +2298,37 @@ function GridShell(props, features) {
|
|
|
2257
2298
|
}
|
|
2258
2299
|
function GridShellBody(props, features, mountGate) {
|
|
2259
2300
|
const serverSideFeature2 = features.serverSide;
|
|
2260
|
-
const isServerSide =
|
|
2261
|
-
const
|
|
2262
|
-
const
|
|
2301
|
+
const isServerSide = createMemo9(() => props.dataSource != null);
|
|
2302
|
+
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2303
|
+
const [hydrated, setHydrated] = createSignal8(!isServer && !isHydrating(), { name: "hydrated" });
|
|
2304
|
+
if (!untrack12(hydrated)) {
|
|
2305
|
+
onGridMounted(() => {
|
|
2306
|
+
setHydrated(true);
|
|
2307
|
+
});
|
|
2308
|
+
}
|
|
2309
|
+
const [relayedRows, setRelayedRows] = createSignal8(null);
|
|
2310
|
+
createEffect3(
|
|
2311
|
+
() => latest(() => props.rows),
|
|
2312
|
+
{
|
|
2313
|
+
effect: (value) => {
|
|
2314
|
+
setRelayedRows({ value });
|
|
2315
|
+
},
|
|
2316
|
+
// 行の読み込みの失敗(非同期の memo の取り直しの失敗など)は、利用側の <Errored> へそのまま渡します(段階 4 の測り直し
|
|
2317
|
+
// S7-02。行を JSX で読んだときと同じ。受けないと、effect ごとに同じエラーが console へ出ていた)。
|
|
2318
|
+
error: (error) => {
|
|
2319
|
+
throw error;
|
|
2320
|
+
}
|
|
2321
|
+
},
|
|
2322
|
+
{ name: "relayRows" }
|
|
2323
|
+
);
|
|
2324
|
+
const rows = createMemo9(() => {
|
|
2325
|
+
if (props.dataSource != null || !hydrated()) {
|
|
2326
|
+
return EMPTY_ROWS;
|
|
2327
|
+
}
|
|
2328
|
+
const relayed = relayedRows();
|
|
2329
|
+
return (relayed ? relayed.value : props.rows) ?? EMPTY_ROWS;
|
|
2330
|
+
});
|
|
2331
|
+
const columns = createMemo9(() => props.columns);
|
|
2263
2332
|
const density = () => props.density ?? "standard";
|
|
2264
2333
|
const rowHeight = () => props.rowHeight ?? GRID_DENSITY_DIMENSIONS[density()].rowHeight;
|
|
2265
2334
|
const columnHeaderHeight = () => props.headerHeight ?? GRID_DENSITY_DIMENSIONS[density()].headerHeight;
|
|
@@ -2277,7 +2346,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2277
2346
|
const enableRowSelection = () => props.enableRowSelection ?? false;
|
|
2278
2347
|
const rowSelectionMode = () => props.rowSelectionMode ?? "multiple";
|
|
2279
2348
|
const enableSelectAllRows = () => props.enableSelectAllRows ?? (enableRowSelection() && rowSelectionMode() === "multiple");
|
|
2280
|
-
const detailRowEnabled =
|
|
2349
|
+
const detailRowEnabled = createMemo9(() => props.detailRow != null);
|
|
2281
2350
|
const detailToggleColumnActive = () => props.detailRow != null && props.detailRow.showToggleColumn !== false;
|
|
2282
2351
|
const columnInputs = () => ({
|
|
2283
2352
|
columns: columns(),
|
|
@@ -2289,50 +2358,50 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2289
2358
|
renderDetailToggleCell
|
|
2290
2359
|
});
|
|
2291
2360
|
const resolveLocaleText = createLocaleTextResolver(mergeFeatureLocaleDefaults(features));
|
|
2292
|
-
const localeTexts =
|
|
2361
|
+
const localeTexts = createMemo9(() => resolveLocaleText(props.localeText));
|
|
2293
2362
|
const totalRowFeature2 = features.totalRow;
|
|
2294
2363
|
const TotalRow = totalRowFeature2?.TotalRow;
|
|
2295
2364
|
const PinnedRows = features.pinnedRows?.PinnedRows;
|
|
2296
|
-
const totalRowOptions =
|
|
2365
|
+
const totalRowOptions = createMemo9(
|
|
2297
2366
|
() => typeof props.totalRow === "object" && props.totalRow !== null ? props.totalRow : null
|
|
2298
2367
|
);
|
|
2299
|
-
const totalRowEnabled =
|
|
2368
|
+
const totalRowEnabled = createMemo9(
|
|
2300
2369
|
() => (props.totalRow === true || totalRowOptions() !== null) && totalRowFeature2 !== void 0
|
|
2301
2370
|
);
|
|
2302
2371
|
const totalRowLabel = () => totalRowOptions()?.label ?? localeTexts().totalRowLabel;
|
|
2303
|
-
const totalRowHeight =
|
|
2304
|
-
const pinnedTop =
|
|
2372
|
+
const totalRowHeight = createMemo9(() => totalRowEnabled() ? Math.max(0, totalRowOptions()?.height ?? rowHeight()) : 0);
|
|
2373
|
+
const pinnedTop = createMemo9(
|
|
2305
2374
|
() => PinnedRows && props.pinnedTopRows && props.pinnedTopRows.length > 0 ? props.pinnedTopRows : null
|
|
2306
2375
|
);
|
|
2307
|
-
const pinnedBottom =
|
|
2376
|
+
const pinnedBottom = createMemo9(
|
|
2308
2377
|
() => PinnedRows && props.pinnedBottomRows && props.pinnedBottomRows.length > 0 ? props.pinnedBottomRows : null
|
|
2309
2378
|
);
|
|
2310
2379
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2311
2380
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2312
|
-
const headerHeight =
|
|
2313
|
-
const footerHeight =
|
|
2314
|
-
const pinnedBelowTotal =
|
|
2381
|
+
const headerHeight = createMemo9(() => columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2382
|
+
const footerHeight = createMemo9(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2383
|
+
const pinnedBelowTotal = createMemo9(
|
|
2315
2384
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2316
2385
|
);
|
|
2317
2386
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
2318
2387
|
const engine = createGridEngine({
|
|
2319
2388
|
features,
|
|
2320
|
-
initialState:
|
|
2321
|
-
columnInputs:
|
|
2389
|
+
initialState: untrack12(() => props.initialState),
|
|
2390
|
+
columnInputs: untrack12(columnInputs),
|
|
2322
2391
|
serverSide: {
|
|
2323
|
-
isServerSide:
|
|
2324
|
-
enableGlobalFilter:
|
|
2325
|
-
enableColumnFilter:
|
|
2326
|
-
enableSorting:
|
|
2392
|
+
isServerSide: untrack12(isServerSide),
|
|
2393
|
+
enableGlobalFilter: untrack12(globalFilterEnabled),
|
|
2394
|
+
enableColumnFilter: untrack12(columnFilterEnabled),
|
|
2395
|
+
enableSorting: untrack12(enableSorting)
|
|
2327
2396
|
}
|
|
2328
2397
|
});
|
|
2329
2398
|
onCleanup7(() => engine.dispose());
|
|
2330
2399
|
const store = engine.store;
|
|
2331
2400
|
const dispatch = store.dispatch;
|
|
2332
2401
|
const { state: ui, view } = createGridStoreSignals(store);
|
|
2333
|
-
const viewportWidth =
|
|
2334
|
-
const viewportHeight =
|
|
2335
|
-
const viewScrollTop =
|
|
2402
|
+
const viewportWidth = createMemo9(() => view().viewportWidth);
|
|
2403
|
+
const viewportHeight = createMemo9(() => view().viewportHeight);
|
|
2404
|
+
const viewScrollTop = createMemo9(() => view().scrollTop);
|
|
2336
2405
|
const viewSetters = createGridViewSetters(store);
|
|
2337
2406
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2338
2407
|
const gridRootRef = { current: null };
|
|
@@ -2347,23 +2416,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2347
2416
|
const cellDoubleClickRef = { current: noop3 };
|
|
2348
2417
|
const getPopupContainer = () => resolvePopupContainer(
|
|
2349
2418
|
gridRootRef.current,
|
|
2350
|
-
|
|
2419
|
+
untrack12(() => props.popupContainer) ?? "auto"
|
|
2351
2420
|
);
|
|
2352
2421
|
const portalContext = { source: () => gridRootRef.current, container: getPopupContainer };
|
|
2353
2422
|
onGridMounted(() => {
|
|
2354
2423
|
const shell = gridRootRef.current;
|
|
2355
2424
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2356
2425
|
});
|
|
2357
|
-
const columnResolution =
|
|
2426
|
+
const columnResolution = createMemo9(() => engine.resolveColumns(columnInputs()));
|
|
2358
2427
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2359
2428
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2360
2429
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
2361
2430
|
const groupColumns = () => columnResolution().groupColumns;
|
|
2362
2431
|
const aggColumns = () => columnResolution().aggColumns;
|
|
2363
|
-
const activeGroupColumns =
|
|
2364
|
-
const resolvedRowKeyGetter =
|
|
2365
|
-
const selectionSnapshot =
|
|
2366
|
-
const paneResolution =
|
|
2432
|
+
const activeGroupColumns = createMemo9(() => rowGroupingActive() ? groupColumns() : NO_COLUMNS);
|
|
2433
|
+
const resolvedRowKeyGetter = createMemo9(() => props.rowKeyGetter ?? ((_row, index) => index));
|
|
2434
|
+
const selectionSnapshot = createMemo9(() => buildSelectionSnapshot(ui().selection));
|
|
2435
|
+
const paneResolution = createMemo9(
|
|
2367
2436
|
() => engine.resolvePaneLayout({
|
|
2368
2437
|
orderedColumns: orderedColumns(),
|
|
2369
2438
|
columnWidths: ui().columnWidths,
|
|
@@ -2373,7 +2442,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2373
2442
|
);
|
|
2374
2443
|
const paneLayout = () => paneResolution().paneLayout;
|
|
2375
2444
|
let previousColumnsForWidths = null;
|
|
2376
|
-
|
|
2445
|
+
createEffect3(
|
|
2377
2446
|
columns,
|
|
2378
2447
|
(next) => {
|
|
2379
2448
|
dispatch(gridActions.reconcileColumnWidths(previousColumnsForWidths, next));
|
|
@@ -2382,23 +2451,23 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2382
2451
|
{ name: "reconcileColumnWidths" }
|
|
2383
2452
|
);
|
|
2384
2453
|
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 =
|
|
2454
|
+
const labelIsLabelRow = createMemo9(() => props.labelRow?.isLabelRow);
|
|
2455
|
+
const labelGetLabel = createMemo9(() => props.labelRow?.getLabel);
|
|
2456
|
+
const labelRender = createMemo9(() => props.labelRow?.render);
|
|
2457
|
+
const labelRowClassName = createMemo9(() => props.labelRow?.className);
|
|
2458
|
+
const labelRowHeightOption = createMemo9(() => props.labelRow?.height);
|
|
2459
|
+
const labelSortMode = createMemo9(() => props.labelRow?.sortMode ?? "section");
|
|
2460
|
+
const labelSticky = createMemo9(() => props.labelRow?.sticky === true);
|
|
2461
|
+
const labelExportText = createMemo9(() => props.labelRow?.exportText);
|
|
2462
|
+
const labelKeepEmptySections = createMemo9(() => props.labelRow?.keepEmptySections ?? false);
|
|
2463
|
+
const labelRowEnabled = createMemo9(
|
|
2395
2464
|
() => labelIsLabelRow() != null && labelGetLabel() != null && labelRowFeature2 !== void 0
|
|
2396
2465
|
);
|
|
2397
2466
|
const StickyLabelLayer = labelRowFeature2?.StickyLabelLayer;
|
|
2398
|
-
const labelLayout =
|
|
2467
|
+
const labelLayout = createMemo9(
|
|
2399
2468
|
() => engine.rowPipeline.resolveLabelRowLayout(rows(), isServerSide() ? void 0 : labelIsLabelRow())
|
|
2400
2469
|
);
|
|
2401
|
-
const filterCandidateRows =
|
|
2470
|
+
const filterCandidateRows = createMemo9(() => {
|
|
2402
2471
|
const layout = labelLayout();
|
|
2403
2472
|
const currentRows = rows();
|
|
2404
2473
|
if (!layout) {
|
|
@@ -2416,11 +2485,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2416
2485
|
}
|
|
2417
2486
|
return dataRows;
|
|
2418
2487
|
});
|
|
2419
|
-
const baseOrder =
|
|
2420
|
-
const globalFilterText =
|
|
2421
|
-
const columnFilters =
|
|
2422
|
-
const filterSortColumns =
|
|
2423
|
-
const globalFilterColumns =
|
|
2488
|
+
const baseOrder = createMemo9(() => engine.rowPipeline.resolveBaseOrder(rows().length, labelLayout()));
|
|
2489
|
+
const globalFilterText = createMemo9(() => selectGlobalFilter(ui()));
|
|
2490
|
+
const columnFilters = createMemo9(() => ui().filters.columnFilters);
|
|
2491
|
+
const filterSortColumns = createMemo9(() => columnResolution().filterSortColumns);
|
|
2492
|
+
const globalFilterColumns = createMemo9(() => {
|
|
2424
2493
|
const groups = activeGroupColumns();
|
|
2425
2494
|
return groups.length > 0 ? [...visibleColumns(), ...groups] : visibleColumns();
|
|
2426
2495
|
});
|
|
@@ -2444,7 +2513,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2444
2513
|
const globalFilterStatus = filterOrder ? filterOrder.globalFilterStatus : () => "idle";
|
|
2445
2514
|
const globalFilterProgress = filterOrder ? filterOrder.globalFilterProgress : () => 1;
|
|
2446
2515
|
const relativeDateKey = filterOrder ? filterOrder.relativeDateKey : () => "";
|
|
2447
|
-
const orderResolution =
|
|
2516
|
+
const orderResolution = createMemo9(
|
|
2448
2517
|
() => engine.rowPipeline.resolveOrder({
|
|
2449
2518
|
rows: rows(),
|
|
2450
2519
|
labelLayout: labelLayout(),
|
|
@@ -2462,7 +2531,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2462
2531
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
2463
2532
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
2464
2533
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
2465
|
-
const clientRowModel =
|
|
2534
|
+
const clientRowModel = createMemo9(
|
|
2466
2535
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
2467
2536
|
rows: rows(),
|
|
2468
2537
|
order: orderResolution().order,
|
|
@@ -2481,7 +2550,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2481
2550
|
manualSorting: manualSorting()
|
|
2482
2551
|
})
|
|
2483
2552
|
);
|
|
2484
|
-
const liveServerSideQuery =
|
|
2553
|
+
const liveServerSideQuery = createMemo9(
|
|
2485
2554
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
2486
2555
|
isServerSide: isServerSide(),
|
|
2487
2556
|
globalFilterEnabled: globalFilterEnabled(),
|
|
@@ -2500,19 +2569,19 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2500
2569
|
"serverSideQueryStore"
|
|
2501
2570
|
);
|
|
2502
2571
|
const serverSideQuerySnapshot = createExternalStoreSignal(engine.serverSideQueryStore, "serverSideQueryStore");
|
|
2503
|
-
const serverSideQueryKey =
|
|
2572
|
+
const serverSideQueryKey = createMemo9(() => serverSideQuerySnapshot().queryKey);
|
|
2504
2573
|
const serverSide = serverSideFeature2?.createServerSide(() => ({
|
|
2505
2574
|
dataSource: props.dataSource,
|
|
2506
2575
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
2507
2576
|
query: serverSideQuerySnapshot().query,
|
|
2508
2577
|
queryKey: serverSideQuerySnapshot().queryKey,
|
|
2509
2578
|
refreshToken: props.serverSideRefreshToken,
|
|
2510
|
-
onLoadError: props.onServerSideLoadError,
|
|
2511
|
-
onWriteError: props.onServerSideWriteError,
|
|
2579
|
+
onLoadError: inOwnTick(props.onServerSideLoadError),
|
|
2580
|
+
onWriteError: inOwnTick(props.onServerSideWriteError),
|
|
2512
2581
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2513
2582
|
onWriteStateChange: engine.saveStatus.handle
|
|
2514
2583
|
}));
|
|
2515
|
-
const rowModel =
|
|
2584
|
+
const rowModel = createMemo9(() => {
|
|
2516
2585
|
if (!isServerSide() || !serverSide) {
|
|
2517
2586
|
return clientRowModel().rowModel;
|
|
2518
2587
|
}
|
|
@@ -2521,30 +2590,30 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2521
2590
|
const getLabel = labelGetLabel();
|
|
2522
2591
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
2523
2592
|
});
|
|
2524
|
-
const canEditCell =
|
|
2593
|
+
const canEditCell = createMemo9(
|
|
2525
2594
|
() => isServerSide() && !(serverSide?.canUpdateRows() ?? false) ? NEVER_EDITABLE : props.canEditCell
|
|
2526
2595
|
);
|
|
2527
|
-
const applyServerSideCellEdits =
|
|
2596
|
+
const applyServerSideCellEdits = createMemo9(
|
|
2528
2597
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
2529
2598
|
);
|
|
2530
|
-
const viewRowCount =
|
|
2599
|
+
const viewRowCount = createMemo9(() => rowModel().getRowCount());
|
|
2531
2600
|
const viewColCount = () => orderedColumns().length;
|
|
2532
2601
|
const order = () => orderResolution().order;
|
|
2533
2602
|
const groupTree = () => clientRowModel().groupTree;
|
|
2534
2603
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
2535
|
-
const labelViewIndexes =
|
|
2536
|
-
const leafRowCount =
|
|
2604
|
+
const labelViewIndexes = createMemo9(() => labelDisplay()?.labelViewIndexes);
|
|
2605
|
+
const leafRowCount = createMemo9(
|
|
2537
2606
|
() => clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : viewRowCount()
|
|
2538
2607
|
);
|
|
2539
2608
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
2540
2609
|
const groupingFeature2 = features.grouping;
|
|
2541
|
-
const getFilteredRows =
|
|
2610
|
+
const getFilteredRows = createMemo9(() => {
|
|
2542
2611
|
const currentOrder = order();
|
|
2543
2612
|
const currentRows = rows();
|
|
2544
2613
|
let cache = null;
|
|
2545
2614
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
2546
2615
|
});
|
|
2547
|
-
|
|
2616
|
+
createEffect3(
|
|
2548
2617
|
() => [viewRowCount(), viewColCount()],
|
|
2549
2618
|
([rowCount, colCount]) => {
|
|
2550
2619
|
dispatch(gridActions.clampSelectionToRowCount(rowCount, colCount));
|
|
@@ -2552,7 +2621,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2552
2621
|
{ name: "clampSelectionToRowCount" }
|
|
2553
2622
|
);
|
|
2554
2623
|
const autoHeightSnapshot = createExternalStoreSignal(engine.autoHeightMeasurer, "autoHeightStore");
|
|
2555
|
-
const vertical =
|
|
2624
|
+
const vertical = createMemo9(
|
|
2556
2625
|
() => engine.resolveVerticalLayout({
|
|
2557
2626
|
isServerSide: isServerSide(),
|
|
2558
2627
|
autoHeight: props.autoHeight ?? false,
|
|
@@ -2589,13 +2658,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2589
2658
|
detailActive: () => vertical().detailActive,
|
|
2590
2659
|
globalFilterText,
|
|
2591
2660
|
columnFilterCount: () => Object.keys(columnFilters()).length,
|
|
2592
|
-
rows
|
|
2661
|
+
// 写した rows を読みます(取り直しの失敗を、写しの effect だけが <Errored> へ渡すように。S7-02)。写す前は props.rows。
|
|
2662
|
+
rows: () => {
|
|
2663
|
+
const relayed = relayedRows();
|
|
2664
|
+
return relayed ? relayed.value : props.rows;
|
|
2665
|
+
}
|
|
2593
2666
|
});
|
|
2594
|
-
const stickyLabelIndexes =
|
|
2667
|
+
const stickyLabelIndexes = createMemo9(() => {
|
|
2595
2668
|
const indexes = labelViewIndexes();
|
|
2596
2669
|
return labelSticky() && labelRowFeature2 && indexes && indexes.length > 0 ? indexes : null;
|
|
2597
2670
|
});
|
|
2598
|
-
const stickyLabelEntry =
|
|
2671
|
+
const stickyLabelEntry = createMemo9(() => {
|
|
2599
2672
|
const indexes = stickyLabelIndexes();
|
|
2600
2673
|
if (!indexes || !labelRowFeature2) {
|
|
2601
2674
|
return null;
|
|
@@ -2621,7 +2694,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2621
2694
|
pushOffset: resolution.pushOffset
|
|
2622
2695
|
};
|
|
2623
2696
|
});
|
|
2624
|
-
const stickyTopInset =
|
|
2697
|
+
const stickyTopInset = createMemo9(() => {
|
|
2625
2698
|
const indexes = stickyLabelIndexes();
|
|
2626
2699
|
const feature = labelRowFeature2;
|
|
2627
2700
|
if (!indexes || !feature) {
|
|
@@ -2638,8 +2711,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2638
2711
|
};
|
|
2639
2712
|
});
|
|
2640
2713
|
const conditionalFormatFeature2 = features.conditionalFormat;
|
|
2641
|
-
const conditionalFormatStats =
|
|
2642
|
-
const totalRowCells =
|
|
2714
|
+
const conditionalFormatStats = createMemo9(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
|
|
2715
|
+
const totalRowCells = createMemo9(
|
|
2643
2716
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
2644
2717
|
rows: rows(),
|
|
2645
2718
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
@@ -2648,11 +2721,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2648
2721
|
values: totalRowOptions()?.values
|
|
2649
2722
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
2650
2723
|
);
|
|
2651
|
-
const totalRowLabelColumnKey =
|
|
2724
|
+
const totalRowLabelColumnKey = createMemo9(
|
|
2652
2725
|
() => totalRowFeature2 ? totalRowFeature2.resolveTotalRowLabelColumnKey(orderedColumns(), totalRowCells()) : null
|
|
2653
2726
|
);
|
|
2654
2727
|
const columnAutosizeFeature2 = features.columnAutosize;
|
|
2655
|
-
const totalRowAutosizeTexts =
|
|
2728
|
+
const totalRowAutosizeTexts = createMemo9(() => {
|
|
2656
2729
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
2657
2730
|
return void 0;
|
|
2658
2731
|
}
|
|
@@ -2671,10 +2744,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2671
2744
|
}
|
|
2672
2745
|
return texts;
|
|
2673
2746
|
});
|
|
2674
|
-
const pinnedAutosizeRows =
|
|
2747
|
+
const pinnedAutosizeRows = createMemo9(
|
|
2675
2748
|
() => pinnedTop() || pinnedBottom() ? [...pinnedTop() ?? [], ...pinnedBottom() ?? []] : void 0
|
|
2676
2749
|
);
|
|
2677
|
-
const autosizeChipOf =
|
|
2750
|
+
const autosizeChipOf = createMemo9(() => {
|
|
2678
2751
|
const chipFeature = conditionalFormatFeature2;
|
|
2679
2752
|
if (!chipFeature) {
|
|
2680
2753
|
return void 0;
|
|
@@ -2749,27 +2822,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2749
2822
|
"effect",
|
|
2750
2823
|
"autoSizeOnData"
|
|
2751
2824
|
);
|
|
2752
|
-
const totalRowSlotSignature =
|
|
2753
|
-
const totalRowSlot =
|
|
2754
|
-
const totalRowExport =
|
|
2825
|
+
const totalRowSlotSignature = createMemo9(() => serializeSlotValue(totalRowOptions()?.className));
|
|
2826
|
+
const totalRowSlot = createMemo9(() => resolveSlotFromSignature(totalRowSlotSignature()));
|
|
2827
|
+
const totalRowExport = createMemo9(
|
|
2755
2828
|
() => totalRowEnabled() ? { cells: totalRowCells(), label: totalRowLabel() } : void 0
|
|
2756
2829
|
);
|
|
2757
|
-
const pinnedRowsExport =
|
|
2830
|
+
const pinnedRowsExport = createMemo9(
|
|
2758
2831
|
() => pinnedTop() || pinnedBottom() ? { top: pinnedTop() ?? [], bottom: pinnedBottom() ?? [], bottomAfterTotal: pinnedBelowTotal() } : void 0
|
|
2759
2832
|
);
|
|
2760
2833
|
const scrollHintFeature2 = features.scrollHint;
|
|
2761
2834
|
const findFeature2 = features.find;
|
|
2762
2835
|
const imeFeature = features.imeDirectInput;
|
|
2763
|
-
const resolvedScrollHint =
|
|
2836
|
+
const resolvedScrollHint = createMemo9(
|
|
2764
2837
|
() => scrollHintFeature2 ? scrollHintFeature2.resolveScrollHintOptions(props.scrollHint) : null
|
|
2765
2838
|
);
|
|
2766
|
-
const activeScrollHint =
|
|
2839
|
+
const activeScrollHint = createMemo9(() => {
|
|
2767
2840
|
const resolved = resolvedScrollHint();
|
|
2768
2841
|
return resolved !== null && viewRowCount() >= resolved.minRows ? resolved : null;
|
|
2769
2842
|
});
|
|
2770
|
-
const customScrollbar =
|
|
2771
|
-
const autoHeightActive =
|
|
2772
|
-
const bodyRows =
|
|
2843
|
+
const customScrollbar = createMemo9(() => activeScrollHint()?.scrollbar === true);
|
|
2844
|
+
const autoHeightActive = createMemo9(() => vertical().autoHeightActive);
|
|
2845
|
+
const bodyRows = createMemo9(() => {
|
|
2773
2846
|
const { virtualRows, virtualRowIndexes } = vertical();
|
|
2774
2847
|
const model = rowModel();
|
|
2775
2848
|
const serverSideActive = isServerSide();
|
|
@@ -2809,12 +2882,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2809
2882
|
connectController(engine.scrollSync, () => ({
|
|
2810
2883
|
scrollContainerRef,
|
|
2811
2884
|
setViewState: store.setViewState,
|
|
2812
|
-
onScroll: props.onScroll,
|
|
2885
|
+
onScroll: inOwnTick(props.onScroll),
|
|
2813
2886
|
// 見える高さは下端に固定する行(合計行 / 下の固定行)に隠れるぶんを除く。
|
|
2814
2887
|
footerHeight: footerHeight()
|
|
2815
2888
|
}), "effect", "scrollSync");
|
|
2816
2889
|
let lastServerSideQueryKey = null;
|
|
2817
|
-
|
|
2890
|
+
createEffect3(
|
|
2818
2891
|
() => isServerSide() ? serverSideQueryKey() : null,
|
|
2819
2892
|
(key) => {
|
|
2820
2893
|
if (key === null) {
|
|
@@ -2835,7 +2908,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2835
2908
|
{ name: "serverSideQueryReset" }
|
|
2836
2909
|
);
|
|
2837
2910
|
let lastDetailQueryKey = null;
|
|
2838
|
-
|
|
2911
|
+
createEffect3(
|
|
2839
2912
|
() => isServerSide() && detailRowEnabled() ? serverSideQueryKey() : null,
|
|
2840
2913
|
(key) => {
|
|
2841
2914
|
if (key === null) {
|
|
@@ -2852,9 +2925,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2852
2925
|
},
|
|
2853
2926
|
{ name: "detailRowsQueryReset" }
|
|
2854
2927
|
);
|
|
2855
|
-
const windowFirstRow =
|
|
2856
|
-
const windowLastRow =
|
|
2857
|
-
|
|
2928
|
+
const windowFirstRow = createMemo9(() => vertical().windowFirstRow);
|
|
2929
|
+
const windowLastRow = createMemo9(() => vertical().windowLastRow);
|
|
2930
|
+
createEffect3(
|
|
2858
2931
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
2859
2932
|
([serverSideActive, firstRow, lastRow]) => {
|
|
2860
2933
|
if (!serverSideActive || !serverSide || lastRow < firstRow) {
|
|
@@ -2864,7 +2937,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2864
2937
|
},
|
|
2865
2938
|
{ name: "serverSideRequestRange" }
|
|
2866
2939
|
);
|
|
2867
|
-
const columnMeasurements =
|
|
2940
|
+
const columnMeasurements = createMemo9(
|
|
2868
2941
|
() => buildColumnMeasurements(visibleColumns(), paneResolution().effectiveColumnWidths)
|
|
2869
2942
|
);
|
|
2870
2943
|
const measuredByColumnVirtualizer = { measure: () => {
|
|
@@ -2883,11 +2956,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2883
2956
|
measureKey: columnMeasurements()
|
|
2884
2957
|
};
|
|
2885
2958
|
});
|
|
2886
|
-
const centerRenderEntries =
|
|
2959
|
+
const centerRenderEntries = createMemo9(() => {
|
|
2887
2960
|
const entries = centerEntries();
|
|
2888
2961
|
return columnVirtualizer.items().map((item) => entries[item.index]).filter((entry) => Boolean(entry));
|
|
2889
2962
|
});
|
|
2890
|
-
const activeCellRendered =
|
|
2963
|
+
const activeCellRendered = createMemo9(
|
|
2891
2964
|
() => isActiveCellRendered(ui().activeCell, vertical().virtualRowIndexes, rowModel(), [
|
|
2892
2965
|
paneLayout().left.entries,
|
|
2893
2966
|
centerRenderEntries(),
|
|
@@ -2922,28 +2995,28 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2922
2995
|
}), "render", "saveStatus");
|
|
2923
2996
|
const systemPrefersDark = createExternalStoreSignal(systemColorSchemeStore, "systemColorSchemeStore");
|
|
2924
2997
|
const themeClassName = () => resolveGridThemeClassName(props.theme ?? "light", systemPrefersDark());
|
|
2925
|
-
const heightLayout =
|
|
2926
|
-
const slotSignature =
|
|
2927
|
-
const slots =
|
|
2998
|
+
const heightLayout = createMemo9(() => resolveGridHeightLayout(props.height, props.maxHeight));
|
|
2999
|
+
const slotSignature = createMemo9(() => serializeSlotValue(props.classNames));
|
|
3000
|
+
const slots = createMemo9(
|
|
2928
3001
|
() => resolveSlotMapFromSignature(slotSignature())
|
|
2929
3002
|
);
|
|
2930
|
-
const activeCellPlacement =
|
|
3003
|
+
const activeCellPlacement = createMemo9(
|
|
2931
3004
|
() => resolveCellPlacement(ui().activeCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
2932
3005
|
);
|
|
2933
|
-
const editingCellPlacement =
|
|
3006
|
+
const editingCellPlacement = createMemo9(
|
|
2934
3007
|
() => resolveCellPlacement(ui().editingCell, viewRowCount(), paneLayout(), vertical().rowMetrics)
|
|
2935
3008
|
);
|
|
2936
|
-
const editorAlignTop =
|
|
3009
|
+
const editorAlignTop = createMemo9(() => {
|
|
2937
3010
|
const editing = ui().editingCell;
|
|
2938
3011
|
const column = editing ? orderedColumns()[editing.col] : void 0;
|
|
2939
3012
|
const placement2 = editingCellPlacement();
|
|
2940
3013
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
2941
3014
|
});
|
|
2942
|
-
const selectionExtents =
|
|
2943
|
-
const selectionBand =
|
|
3015
|
+
const selectionExtents = createMemo9(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3016
|
+
const selectionBand = createMemo9(
|
|
2944
3017
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
2945
3018
|
);
|
|
2946
|
-
const selectionBandSegments =
|
|
3019
|
+
const selectionBandSegments = createMemo9(
|
|
2947
3020
|
() => resolveSelectionBandSegments(
|
|
2948
3021
|
vertical().detailActive,
|
|
2949
3022
|
selectionExtents(),
|
|
@@ -2957,7 +3030,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2957
3030
|
resolvePaneBandRect(selectionExtents(), selectionBand(), pane)
|
|
2958
3031
|
];
|
|
2959
3032
|
const motionExtrasFeature2 = features.motionExtras;
|
|
2960
|
-
const copiedSelection =
|
|
3033
|
+
const copiedSelection = createMemo9(() => {
|
|
2961
3034
|
const copied = view().copiedRange;
|
|
2962
3035
|
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true) || !copied) {
|
|
2963
3036
|
return null;
|
|
@@ -2965,11 +3038,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2965
3038
|
const state = ui();
|
|
2966
3039
|
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
3040
|
});
|
|
2968
|
-
const copiedExtents =
|
|
2969
|
-
const copiedBand =
|
|
3041
|
+
const copiedExtents = createMemo9(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3042
|
+
const copiedBand = createMemo9(
|
|
2970
3043
|
() => resolveSelectionBand(copiedExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
2971
3044
|
);
|
|
2972
|
-
const copiedBandSegments =
|
|
3045
|
+
const copiedBandSegments = createMemo9(
|
|
2973
3046
|
() => resolveSelectionBandSegments(
|
|
2974
3047
|
vertical().detailActive,
|
|
2975
3048
|
copiedExtents(),
|
|
@@ -3000,26 +3073,26 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3000
3073
|
const cellEditorDomId = `${gridDomId}-cell-editor`;
|
|
3001
3074
|
let tooltipController = null;
|
|
3002
3075
|
onGridMounted(() => {
|
|
3003
|
-
const controller = acquireTooltipController();
|
|
3076
|
+
const controller = acquireTooltipController(void 0, gridRootRef.current);
|
|
3004
3077
|
tooltipController = controller;
|
|
3005
|
-
controller.setSlot(
|
|
3078
|
+
controller.setSlot(untrack12(slots).tooltip);
|
|
3006
3079
|
return () => {
|
|
3007
3080
|
controller.dispose();
|
|
3008
3081
|
tooltipController = null;
|
|
3009
3082
|
};
|
|
3010
3083
|
});
|
|
3011
|
-
|
|
3084
|
+
createEffect3(
|
|
3012
3085
|
() => slots().tooltip,
|
|
3013
3086
|
(slot) => {
|
|
3014
3087
|
tooltipController?.setSlot(slot);
|
|
3015
3088
|
},
|
|
3016
3089
|
{ name: "tooltipSlot" }
|
|
3017
3090
|
);
|
|
3018
|
-
const activeCellTooltipKey =
|
|
3091
|
+
const activeCellTooltipKey = createMemo9(() => {
|
|
3019
3092
|
const active = ui().activeCell;
|
|
3020
3093
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3021
3094
|
});
|
|
3022
|
-
|
|
3095
|
+
createEffect3(activeCellTooltipKey, (key) => {
|
|
3023
3096
|
if (key === null) {
|
|
3024
3097
|
hideActiveCellTooltip(gridRootRef.current);
|
|
3025
3098
|
return void 0;
|
|
@@ -3029,7 +3102,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3029
3102
|
connectController(engine.hoverRowNotifier, () => ({
|
|
3030
3103
|
enableRowHover: enableRowHover(),
|
|
3031
3104
|
isHoverControlled: props.hoveredRowIndex !== void 0,
|
|
3032
|
-
onHoveredRowChange: props.onHoveredRowChange,
|
|
3105
|
+
onHoveredRowChange: inOwnTick(props.onHoveredRowChange),
|
|
3033
3106
|
setHoveredRowIndex: viewSetters.setHoveredRowIndex
|
|
3034
3107
|
}), "render", "hoverRowNotifier");
|
|
3035
3108
|
const applyHoveredRowChange = engine.hoverRowNotifier.applyHoveredRowChange;
|
|
@@ -3076,7 +3149,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3076
3149
|
"effect",
|
|
3077
3150
|
"viewportSync"
|
|
3078
3151
|
);
|
|
3079
|
-
const controlledRowSelectionModel =
|
|
3152
|
+
const controlledRowSelectionModel = createMemo9(() => {
|
|
3080
3153
|
if (props.rowSelection !== void 0) {
|
|
3081
3154
|
return props.rowSelection;
|
|
3082
3155
|
}
|
|
@@ -3085,11 +3158,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3085
3158
|
}
|
|
3086
3159
|
return void 0;
|
|
3087
3160
|
});
|
|
3088
|
-
const filteredDataRows =
|
|
3161
|
+
const filteredDataRows = createMemo9(
|
|
3089
3162
|
() => !isServerSide() && order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null
|
|
3090
3163
|
);
|
|
3091
3164
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3092
|
-
const selectAllRowsState =
|
|
3165
|
+
const selectAllRowsState = createMemo9(() => {
|
|
3093
3166
|
const filtered = filteredDataRows();
|
|
3094
3167
|
return filtered && enableRowSelection() ? resolveSelectAllState(
|
|
3095
3168
|
countSelectedRowsInOrder(ui().rowSelection, filtered.rows, filtered.order, filtered.rowKeyGetter),
|
|
@@ -3101,15 +3174,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3101
3174
|
rowModel: rowModel(),
|
|
3102
3175
|
rowSelectionState: ui().rowSelection,
|
|
3103
3176
|
rowSelectionMode: rowSelectionMode(),
|
|
3104
|
-
onRowSelectionChange: props.onRowSelectionChange,
|
|
3177
|
+
onRowSelectionChange: inOwnTick(props.onRowSelectionChange),
|
|
3105
3178
|
controlledRowSelectionModel: controlledRowSelectionModel(),
|
|
3106
3179
|
leafRowCount: leafRowCount(),
|
|
3107
3180
|
filteredDataRows: filteredDataRows(),
|
|
3181
|
+
// 追加(Solid 版 0.1.2 / S4-09): 選んだ行が rows から消えたら選択から外す(clientSide。React 版と同じ)。
|
|
3182
|
+
sourceRows: isServerSide() ? void 0 : { rows: rows(), rowKeyGetter: resolvedRowKeyGetter() },
|
|
3108
3183
|
dispatch
|
|
3109
3184
|
}), "render", "rowSelectionCommands");
|
|
3110
3185
|
connectController(
|
|
3111
3186
|
engine.detailKeysNotifier,
|
|
3112
|
-
() => ({ expandedKeys: ui().expandedDetailRowKeys, onChange: props.onExpandedDetailRowKeysChange }),
|
|
3187
|
+
() => ({ expandedKeys: ui().expandedDetailRowKeys, onChange: inOwnTick(props.onExpandedDetailRowKeysChange) }),
|
|
3113
3188
|
"effect",
|
|
3114
3189
|
"detailKeysNotifier"
|
|
3115
3190
|
);
|
|
@@ -3121,8 +3196,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3121
3196
|
keyOf: resolvedRowKeyGetter(),
|
|
3122
3197
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3123
3198
|
}), "render", "detailKeysPruner");
|
|
3124
|
-
const detailDrawable =
|
|
3125
|
-
const hasDetailCards =
|
|
3199
|
+
const detailDrawable = createMemo9(() => vertical().baseRowMetrics.totalBodyHeight <= MAX_BODY_PX2);
|
|
3200
|
+
const hasDetailCards = createMemo9(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3126
3201
|
const detailRows = createDetailRowController();
|
|
3127
3202
|
connectController(detailRows, () => ({
|
|
3128
3203
|
rowModel: rowModel(),
|
|
@@ -3148,11 +3223,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3148
3223
|
),
|
|
3149
3224
|
0
|
|
3150
3225
|
);
|
|
3151
|
-
const detailRender =
|
|
3152
|
-
const detailCardSlotSignature =
|
|
3153
|
-
const detailCardSlot =
|
|
3226
|
+
const detailRender = createMemo9(() => props.detailRow?.render);
|
|
3227
|
+
const detailCardSlotSignature = createMemo9(() => serializeSlotValue(props.detailRow?.className));
|
|
3228
|
+
const detailCardSlot = createMemo9(() => resolveSlotFromSignature(detailCardSlotSignature()));
|
|
3154
3229
|
const collapseDetailRow = (rowKey, viewIndex) => detailRows.setExpandedAt(rowKey, viewIndex, false);
|
|
3155
|
-
const renderLabelRowContent =
|
|
3230
|
+
const renderLabelRowContent = createMemo9(() => {
|
|
3156
3231
|
const render = labelRender();
|
|
3157
3232
|
return render ? (ctx) => render(ctx) : (ctx) => <span class="ssg-label-row-content--default ssg-label-row-default">
|
|
3158
3233
|
<span class="ssg-label-row-text">{ctx.label}</span>
|
|
@@ -3162,7 +3237,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3162
3237
|
const className = labelRowClassName();
|
|
3163
3238
|
return typeof className === "function" ? className(labelRow.row) : className;
|
|
3164
3239
|
};
|
|
3165
|
-
const labelRowLayerCenter =
|
|
3240
|
+
const labelRowLayerCenter = createMemo9(
|
|
3166
3241
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3167
3242
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3168
3243
|
renderContent: renderLabelRowContent(),
|
|
@@ -3171,7 +3246,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3171
3246
|
resolveRowSlot: resolveLabelRowSlot
|
|
3172
3247
|
} : void 0
|
|
3173
3248
|
);
|
|
3174
|
-
const labelRowLayerBand =
|
|
3249
|
+
const labelRowLayerBand = createMemo9(
|
|
3175
3250
|
() => labelRowEnabled() && labelRowFeature2 ? {
|
|
3176
3251
|
Row: labelRowFeature2.BodyLabelRow,
|
|
3177
3252
|
renderContent: null,
|
|
@@ -3180,11 +3255,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3180
3255
|
resolveRowSlot: resolveLabelRowSlot
|
|
3181
3256
|
} : void 0
|
|
3182
3257
|
);
|
|
3183
|
-
const stickyLabelSlot =
|
|
3258
|
+
const stickyLabelSlot = createMemo9(() => {
|
|
3184
3259
|
const entry = stickyLabelEntry();
|
|
3185
3260
|
return resolveSlotProps2(entry ? resolveLabelRowSlot(entry.labelRow) : void 0);
|
|
3186
3261
|
});
|
|
3187
|
-
const labelRowExport =
|
|
3262
|
+
const labelRowExport = createMemo9(() => {
|
|
3188
3263
|
const isLabelRow = labelIsLabelRow();
|
|
3189
3264
|
const getLabel = labelGetLabel();
|
|
3190
3265
|
return labelRowEnabled() && isLabelRow && getLabel ? { isLabelRow, getLabel, exportText: labelExportText() } : void 0;
|
|
@@ -3192,8 +3267,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3192
3267
|
connectController(engine.cellEventNotifier, () => ({
|
|
3193
3268
|
rowModel: rowModel(),
|
|
3194
3269
|
orderedColumns: orderedColumns(),
|
|
3195
|
-
onCellClick: props.onCellClick,
|
|
3196
|
-
onCellDoubleClick: props.onCellDoubleClick
|
|
3270
|
+
onCellClick: inOwnTick(props.onCellClick),
|
|
3271
|
+
onCellDoubleClick: inOwnTick(props.onCellDoubleClick)
|
|
3197
3272
|
}), "render", "cellEventNotifier");
|
|
3198
3273
|
connectController(engine.activeRowFollow, () => ({
|
|
3199
3274
|
enabled: activeRowFollowEnabled(),
|
|
@@ -3214,7 +3289,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3214
3289
|
editingCell: ui().editingCell,
|
|
3215
3290
|
rowModel: rowModel(),
|
|
3216
3291
|
orderedColumns: orderedColumns(),
|
|
3217
|
-
onActiveCellChange: props.onActiveCellChange,
|
|
3292
|
+
onActiveCellChange: inOwnTick(props.onActiveCellChange),
|
|
3218
3293
|
followsRow: activeRowFollowEnabled(),
|
|
3219
3294
|
isRowFollowPending: engine.activeRowFollow.isFollowPending
|
|
3220
3295
|
}),
|
|
@@ -3265,12 +3340,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3265
3340
|
rows: rows(),
|
|
3266
3341
|
selection: ui().selection,
|
|
3267
3342
|
activeCell: ui().activeCell,
|
|
3268
|
-
onRowsChange: props.onRowsChange,
|
|
3343
|
+
onRowsChange: inOwnTick(props.onRowsChange),
|
|
3269
3344
|
dispatch,
|
|
3270
3345
|
// サーバーサイドは rows を持たず戻す先が無いので無効(React 版と同じ)。
|
|
3271
3346
|
enabled: (props.enableUndoRedo ?? true) && !readOnly() && !isServerSide(),
|
|
3272
3347
|
limit: props.undoHistoryLimit ?? 100,
|
|
3273
|
-
onUndoRedoStateChange: props.onUndoRedoStateChange,
|
|
3348
|
+
onUndoRedoStateChange: inOwnTick(props.onUndoRedoStateChange),
|
|
3274
3349
|
onAfterRestore: (activeCell) => {
|
|
3275
3350
|
if (activeCell) {
|
|
3276
3351
|
requestAnimationFrame(() => engine.gridApi.scrollToCellInternal(activeCell.row, activeCell.col, "auto"));
|
|
@@ -3281,7 +3356,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3281
3356
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
3282
3357
|
const cells = createCellCommands();
|
|
3283
3358
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
3284
|
-
const orderedColumnKeys =
|
|
3359
|
+
const orderedColumnKeys = createMemo9(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
3285
3360
|
const clipboard = createClipboardController();
|
|
3286
3361
|
connectController(clipboard, () => ({
|
|
3287
3362
|
rows: rows(),
|
|
@@ -3303,24 +3378,24 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3303
3378
|
sort: state.sort,
|
|
3304
3379
|
filters: state.filters,
|
|
3305
3380
|
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
3306
|
-
viewRowCount:
|
|
3307
|
-
columns:
|
|
3381
|
+
viewRowCount: untrack12(viewRowCount),
|
|
3382
|
+
columns: untrack12(orderedColumnKeys)
|
|
3308
3383
|
}
|
|
3309
3384
|
}
|
|
3310
3385
|
});
|
|
3311
3386
|
},
|
|
3312
3387
|
createRow: props.createRow,
|
|
3313
3388
|
createOverflowColumn: props.createOverflowColumn,
|
|
3314
|
-
onPasteSkipped: props.onPasteSkipped,
|
|
3389
|
+
onPasteSkipped: inOwnTick(props.onPasteSkipped),
|
|
3315
3390
|
localeTexts: localeTexts(),
|
|
3316
3391
|
pasteFillsSelection: props.pasteFillsSelection,
|
|
3317
3392
|
onRowsChange: handleRowsChange(),
|
|
3318
|
-
onColumnsChange: props.onColumnsChange,
|
|
3393
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3319
3394
|
applyServerSideCellEdits: applyServerSideCellEdits(),
|
|
3320
3395
|
isRowExportable: props.isRowExportable,
|
|
3321
3396
|
dispatch
|
|
3322
3397
|
}), "render", "clipboard");
|
|
3323
|
-
const isWholeGridSelected =
|
|
3398
|
+
const isWholeGridSelected = createMemo9(
|
|
3324
3399
|
() => computeIsWholeGridSelected(ui().selection, viewRowCount(), visibleColumns().length)
|
|
3325
3400
|
);
|
|
3326
3401
|
const fillHandleFeature2 = features.fillHandle;
|
|
@@ -3355,13 +3430,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3355
3430
|
const pageHeight = Math.max(viewportHeight() - headerHeight(), rowHeight());
|
|
3356
3431
|
return resolvePageTargetRow(vertical().rowMetrics, fromRow, direction, pageHeight);
|
|
3357
3432
|
};
|
|
3358
|
-
const findEnabled =
|
|
3359
|
-
const findOptions =
|
|
3360
|
-
const findShortcut =
|
|
3433
|
+
const findEnabled = createMemo9(() => props.find !== false && props.find !== void 0 && findFeature2 !== void 0);
|
|
3434
|
+
const findOptions = createMemo9(() => typeof props.find === "object" ? props.find : null);
|
|
3435
|
+
const findShortcut = createMemo9(() => findEnabled() && (findOptions()?.shortcut ?? true));
|
|
3361
3436
|
const findSnapshot = createExternalStoreSignal(engine.find, "findStore");
|
|
3362
3437
|
const FindBar = findFeature2?.FindBar;
|
|
3363
|
-
const findIndex =
|
|
3364
|
-
const findCurrentIndex =
|
|
3438
|
+
const findIndex = createMemo9(() => findSnapshot().index);
|
|
3439
|
+
const findCurrentIndex = createMemo9(() => findSnapshot().currentIndex);
|
|
3365
3440
|
connectController(engine.find, () => ({
|
|
3366
3441
|
enabled: findEnabled(),
|
|
3367
3442
|
rowModel: rowModel(),
|
|
@@ -3373,7 +3448,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3373
3448
|
onNavigate: (rowIndex, colIndex) => {
|
|
3374
3449
|
engine.gridApi.handle.selectCell(rowIndex, colIndex, { scrollIntoView: true });
|
|
3375
3450
|
},
|
|
3376
|
-
onChange: props.onFindChange
|
|
3451
|
+
onChange: inOwnTick(props.onFindChange)
|
|
3377
3452
|
}), "render", "find");
|
|
3378
3453
|
const openFindFromShortcut = () => engine.find.open();
|
|
3379
3454
|
const closeFindAndRefocus = () => {
|
|
@@ -3402,13 +3477,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3402
3477
|
});
|
|
3403
3478
|
const columnMenuEnabled = () => enableColumnMenu() && columnMenu !== void 0;
|
|
3404
3479
|
const openColumnMenuFromButton = columnMenu ? (column, event) => {
|
|
3405
|
-
if (filterPopover &&
|
|
3480
|
+
if (filterPopover && untrack12(filterPopover.isOpen) && event.button === 0) {
|
|
3406
3481
|
filterPopover.close();
|
|
3407
3482
|
}
|
|
3408
3483
|
columnMenu.openFromButton(column, event);
|
|
3409
3484
|
} : void 0;
|
|
3410
3485
|
const openColumnMenuForCell = (col) => {
|
|
3411
|
-
const column =
|
|
3486
|
+
const column = untrack12(orderedColumns)[col];
|
|
3412
3487
|
const root = gridRootRef.current;
|
|
3413
3488
|
if (!columnMenu || !column || !root || isSyntheticColumnKey2(column.key)) {
|
|
3414
3489
|
return false;
|
|
@@ -3447,7 +3522,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3447
3522
|
if (!toolPanel) {
|
|
3448
3523
|
return;
|
|
3449
3524
|
}
|
|
3450
|
-
if (
|
|
3525
|
+
if (untrack12(toolPanel.activeTab) === "filter") {
|
|
3451
3526
|
toolPanel.close();
|
|
3452
3527
|
} else {
|
|
3453
3528
|
toolPanel.open("filter");
|
|
@@ -3460,7 +3535,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3460
3535
|
let keyboardContextMenu = null;
|
|
3461
3536
|
const openContextMenuForCell = (cell) => {
|
|
3462
3537
|
const root = gridRootRef.current;
|
|
3463
|
-
const columnsNow =
|
|
3538
|
+
const columnsNow = untrack12(orderedColumns);
|
|
3464
3539
|
const column = columnsNow[cell.col];
|
|
3465
3540
|
const getItems = props.getContextMenuItems;
|
|
3466
3541
|
if (!contextMenuActive() || !contextMenuFeature2 || !contextMenu || !getItems || !root || !column) {
|
|
@@ -3470,12 +3545,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3470
3545
|
root.querySelectorAll(`[data-row-index="${cell.row}"] [data-ssg-col-key]`)
|
|
3471
3546
|
).find((element) => element.dataset.ssgColKey === column.key && !isInsideDetailCardOf(root, element));
|
|
3472
3547
|
const rect = (cellEl ?? root).getBoundingClientRect();
|
|
3473
|
-
const state =
|
|
3548
|
+
const state = untrack12(ui);
|
|
3474
3549
|
const params = contextMenuFeature2.buildCellContextMenuParams({
|
|
3475
3550
|
cell,
|
|
3476
3551
|
clientX: rect.left,
|
|
3477
3552
|
clientY: cellEl ? rect.bottom : rect.top,
|
|
3478
|
-
rowModel:
|
|
3553
|
+
rowModel: untrack12(rowModel),
|
|
3479
3554
|
orderedColumns: columnsNow,
|
|
3480
3555
|
selection: state.selection,
|
|
3481
3556
|
activeCell: state.activeCell
|
|
@@ -3487,7 +3562,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3487
3562
|
if (!items || items.length === 0) {
|
|
3488
3563
|
return false;
|
|
3489
3564
|
}
|
|
3490
|
-
props.onContextMenuOpen
|
|
3565
|
+
if (props.onContextMenuOpen) {
|
|
3566
|
+
callInOwnTick(props.onContextMenuOpen, params);
|
|
3567
|
+
}
|
|
3491
3568
|
contextMenu.open(params, items, { focus: "firstItem" });
|
|
3492
3569
|
return true;
|
|
3493
3570
|
};
|
|
@@ -3529,17 +3606,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3529
3606
|
}
|
|
3530
3607
|
return;
|
|
3531
3608
|
}
|
|
3532
|
-
const activeCell =
|
|
3609
|
+
const activeCell = untrack12(ui).activeCell;
|
|
3533
3610
|
if (activeCell && openContextMenuForCell(activeCell)) {
|
|
3534
3611
|
event.preventDefault();
|
|
3535
3612
|
}
|
|
3536
3613
|
return;
|
|
3537
3614
|
}
|
|
3538
|
-
const state =
|
|
3615
|
+
const state = untrack12(ui);
|
|
3539
3616
|
const params = contextMenuFeature2.buildBodyContextMenuParams({
|
|
3540
3617
|
event,
|
|
3541
|
-
rowModel:
|
|
3542
|
-
orderedColumns:
|
|
3618
|
+
rowModel: untrack12(rowModel),
|
|
3619
|
+
orderedColumns: untrack12(orderedColumns),
|
|
3543
3620
|
selection: state.selection,
|
|
3544
3621
|
activeCell: state.activeCell
|
|
3545
3622
|
});
|
|
@@ -3551,10 +3628,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3551
3628
|
return;
|
|
3552
3629
|
}
|
|
3553
3630
|
event.preventDefault();
|
|
3554
|
-
props.onContextMenuOpen
|
|
3631
|
+
if (props.onContextMenuOpen) {
|
|
3632
|
+
callInOwnTick(props.onContextMenuOpen, params);
|
|
3633
|
+
}
|
|
3555
3634
|
contextMenu.open(params, items);
|
|
3556
3635
|
};
|
|
3557
|
-
const contextMenuView =
|
|
3636
|
+
const contextMenuView = createMemo9(() => {
|
|
3558
3637
|
const snapshot = contextMenu?.snapshot();
|
|
3559
3638
|
if (!snapshot?.state || !snapshot.layout) {
|
|
3560
3639
|
return null;
|
|
@@ -3569,6 +3648,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3569
3648
|
const keyboard = createKeyboardController();
|
|
3570
3649
|
connectController(keyboard, () => ({
|
|
3571
3650
|
uiState: ui(),
|
|
3651
|
+
// 端の固定列へ移ったときに中央の横のスクロールを端へ戻す(S12-05。React 版と同じ)。
|
|
3652
|
+
scrollContainerRef,
|
|
3572
3653
|
// イベントの時点の状態は store から読む(core controllers/liveUiState)。
|
|
3573
3654
|
getUiState: store.getState,
|
|
3574
3655
|
rowModel: rowModel(),
|
|
@@ -3610,7 +3691,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3610
3691
|
readOnly: readOnly(),
|
|
3611
3692
|
canEditCell: canEditCell(),
|
|
3612
3693
|
localeTexts: localeTexts(),
|
|
3613
|
-
followsRow: activeRowFollowEnabled()
|
|
3694
|
+
followsRow: activeRowFollowEnabled(),
|
|
3695
|
+
getUiState: store.getState,
|
|
3696
|
+
rowKeyGetter: resolvedRowKeyGetter()
|
|
3614
3697
|
}), "render", "edit");
|
|
3615
3698
|
connectController(cells, () => ({
|
|
3616
3699
|
rows: rows(),
|
|
@@ -3625,7 +3708,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3625
3708
|
startEditWithValue: edit.startEditWithValue,
|
|
3626
3709
|
dispatch
|
|
3627
3710
|
}), "render", "cells");
|
|
3628
|
-
const imeDirectInputEnabled =
|
|
3711
|
+
const imeDirectInputEnabled = createMemo9(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
3629
3712
|
connectController(
|
|
3630
3713
|
engine.imeInput,
|
|
3631
3714
|
() => {
|
|
@@ -3636,27 +3719,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3636
3719
|
editing: ui().editingCell !== null,
|
|
3637
3720
|
activeCell: ui().activeCell,
|
|
3638
3721
|
resolveCell: (cell) => {
|
|
3639
|
-
const column =
|
|
3722
|
+
const column = untrack12(orderedColumns)[cell.col];
|
|
3640
3723
|
return column ? { colKey: column.key, align: column.align } : null;
|
|
3641
3724
|
},
|
|
3642
3725
|
canStartEdit: (cell) => imeFeature?.canStartImeEdit(
|
|
3643
3726
|
{
|
|
3644
|
-
rowModel:
|
|
3645
|
-
columns:
|
|
3646
|
-
readOnly:
|
|
3647
|
-
canEditCell:
|
|
3727
|
+
rowModel: untrack12(rowModel),
|
|
3728
|
+
columns: untrack12(orderedColumns),
|
|
3729
|
+
readOnly: untrack12(readOnly),
|
|
3730
|
+
canEditCell: untrack12(canEditCell)
|
|
3648
3731
|
},
|
|
3649
3732
|
cell
|
|
3650
3733
|
) === true,
|
|
3651
3734
|
startEdit: edit.startEditWithValue,
|
|
3652
3735
|
// number の列は確定した文字を半角の数値の表記へ直して編集を始めます(読めない変換は捨てる)。
|
|
3653
|
-
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(
|
|
3736
|
+
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack12(orderedColumns), cell, text) : text
|
|
3654
3737
|
};
|
|
3655
3738
|
},
|
|
3656
3739
|
"effect",
|
|
3657
3740
|
"imeInput"
|
|
3658
3741
|
);
|
|
3659
|
-
|
|
3742
|
+
createEffect3(imeDirectInputEnabled, (enabled) => {
|
|
3660
3743
|
if (!enabled) {
|
|
3661
3744
|
engine.imeInput.attach(null);
|
|
3662
3745
|
}
|
|
@@ -3673,7 +3756,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3673
3756
|
isClaimedTarget: (target, root) => {
|
|
3674
3757
|
const state = store.getState();
|
|
3675
3758
|
if (!root.contains(target)) {
|
|
3676
|
-
const popupOpen =
|
|
3759
|
+
const popupOpen = untrack12(isAnyGridPopupOpen);
|
|
3677
3760
|
if (target.closest(GRID_POPUP_SELECTOR) !== null) {
|
|
3678
3761
|
return popupOpen || state.editingCell !== null;
|
|
3679
3762
|
}
|
|
@@ -3684,13 +3767,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3684
3767
|
return true;
|
|
3685
3768
|
}
|
|
3686
3769
|
if (target === root || target.hasAttribute("data-ssg-ime-input")) {
|
|
3687
|
-
return state.editingCell !== null || isClearableSelection(state.selection) ||
|
|
3770
|
+
return state.editingCell !== null || isClearableSelection(state.selection) || untrack12(copiedSelection) !== null;
|
|
3688
3771
|
}
|
|
3689
3772
|
return false;
|
|
3690
3773
|
}
|
|
3691
3774
|
}), "render", "escapeClaim");
|
|
3692
3775
|
const handleShellKeyDown = (event) => {
|
|
3693
|
-
if (!
|
|
3776
|
+
if (!untrack12(isAnyGridPopupOpen)) {
|
|
3694
3777
|
handleRootKeyDown(event);
|
|
3695
3778
|
}
|
|
3696
3779
|
if (isEscapeClaimedByGrid(event)) {
|
|
@@ -3716,8 +3799,10 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3716
3799
|
visibleColumns: visibleColumns(),
|
|
3717
3800
|
orderedColumns: orderedColumns(),
|
|
3718
3801
|
columnWidths: paneResolution().effectiveColumnWidths,
|
|
3719
|
-
onColumnsChange: props.onColumnsChange,
|
|
3802
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3720
3803
|
dispatch,
|
|
3804
|
+
// 列を変えた後、アクティブセルを列のキーに付いていかせる(S12-01。React 版と同じ)。
|
|
3805
|
+
getUiState: store.getState,
|
|
3721
3806
|
enableSorting: enableSorting(),
|
|
3722
3807
|
sort: ui().sort,
|
|
3723
3808
|
globalFilterText: selectGlobalFilter(ui()),
|
|
@@ -3741,7 +3826,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3741
3826
|
groupColumns: activeGroupColumns,
|
|
3742
3827
|
localeTexts
|
|
3743
3828
|
});
|
|
3744
|
-
const columnChooserItems =
|
|
3829
|
+
const columnChooserItems = createMemo9(
|
|
3745
3830
|
() => columns().map((column) => ({
|
|
3746
3831
|
key: column.key,
|
|
3747
3832
|
title: column.title || column.key,
|
|
@@ -3751,11 +3836,11 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3751
3836
|
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
3752
3837
|
}))
|
|
3753
3838
|
);
|
|
3754
|
-
const sortManagerColumns =
|
|
3839
|
+
const sortManagerColumns = createMemo9(
|
|
3755
3840
|
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
3756
3841
|
);
|
|
3757
3842
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
3758
|
-
const toolPanelTabs =
|
|
3843
|
+
const toolPanelTabs = createMemo9(
|
|
3759
3844
|
() => (toolPanel?.availableTabs() ?? []).map((tab) => {
|
|
3760
3845
|
const texts = localeTexts();
|
|
3761
3846
|
if (tab === "filter") {
|
|
@@ -3771,7 +3856,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3771
3856
|
return { tab, label: texts.toolPanelColumns };
|
|
3772
3857
|
})
|
|
3773
3858
|
);
|
|
3774
|
-
const columnMenuGroupingAvailable =
|
|
3859
|
+
const columnMenuGroupingAvailable = createMemo9(
|
|
3775
3860
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
3776
3861
|
);
|
|
3777
3862
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
@@ -3789,7 +3874,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3789
3874
|
ghostSlot: slots().dragGhost,
|
|
3790
3875
|
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
3791
3876
|
}));
|
|
3792
|
-
const columnDragHandler =
|
|
3877
|
+
const columnDragHandler = createMemo9(
|
|
3793
3878
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
3794
3879
|
);
|
|
3795
3880
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
@@ -3818,12 +3903,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3818
3903
|
const movedRow = currentRows[fromIndex];
|
|
3819
3904
|
const nextRows = next;
|
|
3820
3905
|
onRowsChange(nextRows);
|
|
3821
|
-
props.onRowMove
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3906
|
+
if (props.onRowMove) {
|
|
3907
|
+
callInOwnTick(props.onRowMove, {
|
|
3908
|
+
rowKey: resolvedRowKeyGetter()(movedRow, fromIndex),
|
|
3909
|
+
fromIndex,
|
|
3910
|
+
toIndex,
|
|
3911
|
+
rows: nextRows
|
|
3912
|
+
});
|
|
3913
|
+
}
|
|
3827
3914
|
return true;
|
|
3828
3915
|
};
|
|
3829
3916
|
const moveRowByKey = (rowKey, toIndex) => {
|
|
@@ -3957,7 +4044,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3957
4044
|
paneLayout: paneLayout(),
|
|
3958
4045
|
orderedColumns: orderedColumns(),
|
|
3959
4046
|
columns: columns(),
|
|
3960
|
-
onColumnsChange: props.onColumnsChange,
|
|
4047
|
+
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3961
4048
|
includeGroupingInState: props.includeGroupingInState ?? false,
|
|
3962
4049
|
uiState: ui(),
|
|
3963
4050
|
getUiState: store.getState,
|
|
@@ -4008,16 +4095,22 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4008
4095
|
return engine.scrollSync.markApiScroll();
|
|
4009
4096
|
}
|
|
4010
4097
|
}), "render", "gridApi");
|
|
4011
|
-
|
|
4098
|
+
createEffect3(
|
|
4012
4099
|
() => vertical().physicalBodyHeight,
|
|
4013
4100
|
() => {
|
|
4014
4101
|
engine.gridApi.settleBottomPin();
|
|
4015
4102
|
},
|
|
4016
4103
|
{ name: "gridApiBottomPin" }
|
|
4017
4104
|
);
|
|
4018
|
-
|
|
4019
|
-
|
|
4105
|
+
const handleCallBeforeMountWarned = { current: false };
|
|
4106
|
+
applyHandleRef(untrack12(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4107
|
+
if (mountGate.done) {
|
|
4108
|
+
return;
|
|
4109
|
+
}
|
|
4110
|
+
if (gridRootRef.current?.isConnected === true) {
|
|
4020
4111
|
flushMountGate(mountGate);
|
|
4112
|
+
} else {
|
|
4113
|
+
warnHandleCallBeforeMount(handleCallBeforeMountWarned, method);
|
|
4021
4114
|
}
|
|
4022
4115
|
}));
|
|
4023
4116
|
connectController(
|
|
@@ -4030,9 +4123,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4030
4123
|
columns: columns(),
|
|
4031
4124
|
collapsedGroupKeys: ui().collapsedGroupKeys,
|
|
4032
4125
|
includeGroupingInState: props.includeGroupingInState ?? false,
|
|
4033
|
-
onStateChange: props.onStateChange,
|
|
4034
|
-
onFiltersChange: props.onFiltersChange,
|
|
4035
|
-
onSortChange: props.onSortChange
|
|
4126
|
+
onStateChange: inOwnTick(props.onStateChange),
|
|
4127
|
+
onFiltersChange: inOwnTick(props.onFiltersChange),
|
|
4128
|
+
onSortChange: inOwnTick(props.onSortChange)
|
|
4036
4129
|
}),
|
|
4037
4130
|
"effect",
|
|
4038
4131
|
"stateChangeNotifier"
|
|
@@ -4057,14 +4150,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4057
4150
|
element.removeEventListener("keydown", onKey, { capture: true });
|
|
4058
4151
|
};
|
|
4059
4152
|
});
|
|
4060
|
-
const columnNamer =
|
|
4153
|
+
const columnNamer = createMemo9(
|
|
4061
4154
|
() => createDataColumnNamer(orderedColumns(), {
|
|
4062
4155
|
detail: localeTexts().detailColumnName,
|
|
4063
4156
|
rowDrag: localeTexts().rowDragColumnName
|
|
4064
4157
|
})
|
|
4065
4158
|
);
|
|
4066
|
-
const rowNumberer =
|
|
4067
|
-
const slotContextBase =
|
|
4159
|
+
const rowNumberer = createMemo9(() => createDataRowNumberer(labelViewIndexes()));
|
|
4160
|
+
const slotContextBase = createMemo9(() => ({
|
|
4068
4161
|
rows: rows(),
|
|
4069
4162
|
columns: props.columns,
|
|
4070
4163
|
visibleColumns: visibleColumns(),
|
|
@@ -4074,8 +4167,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4074
4167
|
activeCell: ui().activeCell,
|
|
4075
4168
|
selection: ui().selection
|
|
4076
4169
|
}));
|
|
4077
|
-
const derivedSummary =
|
|
4078
|
-
|
|
4170
|
+
const derivedSummary = createMemo9(() => {
|
|
4171
|
+
const summary = buildGridDerivedSummary(
|
|
4079
4172
|
filteringAvailable ? slotContextBase() : { ...slotContextBase(), globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4080
4173
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
4081
4174
|
// (ラベル行が無ければ rows の数)。サーバーサイドは rows が空なので、サーバーが返した今の条件での件数(React 版と同じ)。
|
|
@@ -4084,8 +4177,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4084
4177
|
columnNamer(),
|
|
4085
4178
|
rowNumberer(),
|
|
4086
4179
|
localeTexts()
|
|
4087
|
-
)
|
|
4088
|
-
|
|
4180
|
+
);
|
|
4181
|
+
return hydrated() ? summary : { ...summary, rowSummaryText: "" };
|
|
4182
|
+
});
|
|
4089
4183
|
const setGlobalFilterText = (value) => dispatch(gridActions.setGlobalFilter(value));
|
|
4090
4184
|
const selectionAggregatesFeature2 = features.selectionAggregates;
|
|
4091
4185
|
const selectionAggregates = selectionAggregatesFeature2 ? selectionAggregatesFeature2.createSelectionAggregates(() => ({
|
|
@@ -4095,7 +4189,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4095
4189
|
orderedColumns: orderedColumns(),
|
|
4096
4190
|
rowModel: rowModel()
|
|
4097
4191
|
})) : () => null;
|
|
4098
|
-
const slotContext =
|
|
4192
|
+
const slotContext = createMemo9(() => {
|
|
4099
4193
|
const filteredRows = getFilteredRows();
|
|
4100
4194
|
return {
|
|
4101
4195
|
...slotContextBase(),
|
|
@@ -4110,15 +4204,15 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4110
4204
|
};
|
|
4111
4205
|
});
|
|
4112
4206
|
const liveSlotContext = createLiveObject(SLOT_CONTEXT_KEYS, slotContext);
|
|
4113
|
-
const renderTopBarFn =
|
|
4114
|
-
const renderBottomBarFn =
|
|
4115
|
-
const customTopBar =
|
|
4207
|
+
const renderTopBarFn = createMemo9(() => props.renderTopBar);
|
|
4208
|
+
const renderBottomBarFn = createMemo9(() => props.renderBottomBar);
|
|
4209
|
+
const customTopBar = createMemo9(() => {
|
|
4116
4210
|
const render = renderTopBarFn();
|
|
4117
|
-
return render ?
|
|
4211
|
+
return render ? render(liveSlotContext) : void 0;
|
|
4118
4212
|
});
|
|
4119
|
-
const customBottomBar =
|
|
4213
|
+
const customBottomBar = createMemo9(() => {
|
|
4120
4214
|
const render = renderBottomBarFn();
|
|
4121
|
-
return render ?
|
|
4215
|
+
return render ? render(liveSlotContext) : void 0;
|
|
4122
4216
|
});
|
|
4123
4217
|
const showTopBarSummary = () => props.showTopBarSummary ?? true;
|
|
4124
4218
|
const showTopBarFilter = () => (props.showTopBarFilter ?? true) && globalFilterEnabled();
|
|
@@ -4158,7 +4252,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4158
4252
|
{customBottomBar()}
|
|
4159
4253
|
</Show11>
|
|
4160
4254
|
</Show11>;
|
|
4161
|
-
const editorSession =
|
|
4255
|
+
const editorSession = createMemo9((previous) => {
|
|
4162
4256
|
const cell = ui().editingCell;
|
|
4163
4257
|
if (cell === null) {
|
|
4164
4258
|
return null;
|
|
@@ -4186,8 +4280,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4186
4280
|
const rekeyed = !Object.is(identity.rowKey, previous.identity.rowKey) || identity.columnKey !== previous.identity.columnKey;
|
|
4187
4281
|
return { id: rekeyed ? previous.id + 1 : previous.id, identity };
|
|
4188
4282
|
});
|
|
4189
|
-
const editorSessionId =
|
|
4190
|
-
const
|
|
4283
|
+
const editorSessionId = createMemo9(() => editorSession()?.id ?? null);
|
|
4284
|
+
const editingColumn = createMemo9(() => {
|
|
4285
|
+
const cell = ui().editingCell;
|
|
4286
|
+
return cell === null ? void 0 : orderedColumns()[cell.col];
|
|
4287
|
+
});
|
|
4288
|
+
const editingSessionInfo = createMemo9(() => {
|
|
4191
4289
|
const cell = ui().editingCell;
|
|
4192
4290
|
if (cell === null) {
|
|
4193
4291
|
return null;
|
|
@@ -4214,13 +4312,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4214
4312
|
if (viewIndex < 0) {
|
|
4215
4313
|
return;
|
|
4216
4314
|
}
|
|
4217
|
-
const model =
|
|
4315
|
+
const model = untrack12(rowModel);
|
|
4218
4316
|
const row = model.getRow(viewIndex);
|
|
4219
4317
|
if (row === void 0) {
|
|
4220
4318
|
return;
|
|
4221
4319
|
}
|
|
4222
4320
|
writeCellValueTo(
|
|
4223
|
-
{ rows:
|
|
4321
|
+
{ rows: untrack12(rows), rowModel: model, handleRowsChange: untrack12(handleRowsChange), applyServerSideCellEdits: untrack12(applyServerSideCellEdits) },
|
|
4224
4322
|
viewIndex,
|
|
4225
4323
|
row,
|
|
4226
4324
|
column,
|
|
@@ -4233,7 +4331,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4233
4331
|
if (!RowDragHandle2 || !rowDrag) {
|
|
4234
4332
|
return null;
|
|
4235
4333
|
}
|
|
4236
|
-
const draggable =
|
|
4334
|
+
const draggable = createMemo9(() => {
|
|
4237
4335
|
const isRowDraggable = props.isRowDraggable;
|
|
4238
4336
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
4239
4337
|
});
|
|
@@ -4241,19 +4339,30 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4241
4339
|
<RowDragHandle2
|
|
4242
4340
|
operable={rowDragOperable()}
|
|
4243
4341
|
tooltip={rowDragOperable() ? rowDragTexts().dragRow : rowDragTexts().dragRowDisabled}
|
|
4244
|
-
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(
|
|
4342
|
+
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(untrack12(() => cell.rowIndex), event)}
|
|
4245
4343
|
/>
|
|
4246
4344
|
</Show11>;
|
|
4247
4345
|
};
|
|
4248
|
-
const renderCellContent = (
|
|
4346
|
+
const renderCellContent = (currentRow, column, cell) => {
|
|
4249
4347
|
if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
4250
|
-
return renderRowDragHandleCell(
|
|
4348
|
+
return renderRowDragHandleCell(currentRow(), cell);
|
|
4251
4349
|
}
|
|
4252
4350
|
const unbound = column;
|
|
4351
|
+
if (!column.renderCell && column.editor?.type === "checkbox") {
|
|
4352
|
+
const editor = column.editor;
|
|
4353
|
+
return <CheckboxCell
|
|
4354
|
+
slot={slots().checkbox}
|
|
4355
|
+
label={column.title || column.key}
|
|
4356
|
+
checked={isCheckboxChecked(getCellValue2(currentRow(), unbound), editor)}
|
|
4357
|
+
readOnly={cell.readOnly}
|
|
4358
|
+
onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
|
|
4359
|
+
/>;
|
|
4360
|
+
}
|
|
4361
|
+
const row = currentRow();
|
|
4253
4362
|
const value = getCellValue2(row, unbound);
|
|
4254
4363
|
if (column.renderCell) {
|
|
4255
|
-
const expanded =
|
|
4256
|
-
const expandable =
|
|
4364
|
+
const expanded = createMemo9(() => ui().expandedDetailRowKeys.has(cell.rowKey));
|
|
4365
|
+
const expandable = createMemo9(
|
|
4257
4366
|
() => isDetailRowExpandable(detailDrawable(), props.detailRow?.isExpandable, row, cell.rowKey, cell.sourceRowIndex)
|
|
4258
4367
|
);
|
|
4259
4368
|
const detail = {
|
|
@@ -4263,9 +4372,18 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4263
4372
|
get expandable() {
|
|
4264
4373
|
return expandable();
|
|
4265
4374
|
},
|
|
4266
|
-
toggle: () => detailRows.toggleAt(cell.rowKey,
|
|
4267
|
-
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey,
|
|
4375
|
+
toggle: () => detailRows.toggleAt(cell.rowKey, untrack12(() => cell.rowIndex)),
|
|
4376
|
+
setExpanded: (expanded2) => detailRows.setExpandedAt(cell.rowKey, untrack12(() => cell.rowIndex), expanded2)
|
|
4268
4377
|
};
|
|
4378
|
+
if (column.key === DETAIL_TOGGLE_COLUMN_KEY2) {
|
|
4379
|
+
const rowNumber = () => {
|
|
4380
|
+
const indexes = labelViewIndexes();
|
|
4381
|
+
return indexes ? resolveDataRowNumber2(indexes, cell.rowIndex) : cell.rowIndex + 1;
|
|
4382
|
+
};
|
|
4383
|
+
return <Show11 when={expandable()}>
|
|
4384
|
+
<DetailToggleButton detail={detail} rowNumber={rowNumber()} />
|
|
4385
|
+
</Show11>;
|
|
4386
|
+
}
|
|
4269
4387
|
return column.renderCell({
|
|
4270
4388
|
row,
|
|
4271
4389
|
get rowIndex() {
|
|
@@ -4298,16 +4416,6 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4298
4416
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4299
4417
|
});
|
|
4300
4418
|
}
|
|
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
4419
|
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4312
4420
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4313
4421
|
const highlightFind = (content) => {
|
|
@@ -4329,7 +4437,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4329
4437
|
const chips = formatRules?.chips;
|
|
4330
4438
|
if (conditionalFormatFeature2 && chips) {
|
|
4331
4439
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4332
|
-
const chip =
|
|
4440
|
+
const chip = createMemo9(
|
|
4333
4441
|
() => resolveChipSpec2(chips, {
|
|
4334
4442
|
row,
|
|
4335
4443
|
get rowIndex() {
|
|
@@ -4550,12 +4658,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4550
4658
|
leadingWidth={leadingWidth()}
|
|
4551
4659
|
baseOffset={vertical().overlayBaseOffset}
|
|
4552
4660
|
initialValue={() => view().editorInitialValue ?? store.getViewState().editorInitialValue ?? ""}
|
|
4661
|
+
editor={editingColumn()?.editor}
|
|
4553
4662
|
session={editingSessionInfo()}
|
|
4554
4663
|
themeClassName={portalClassName()}
|
|
4555
4664
|
slots={slots()}
|
|
4556
4665
|
onCommit={(value, direction) => edit.commitEdit(value, direction)}
|
|
4557
4666
|
onCancel={edit.cancelEdit}
|
|
4558
|
-
|
|
4667
|
+
onRegisterFlush={edit.registerDraftFlush}
|
|
4668
|
+
align={editingColumn()?.align}
|
|
4559
4669
|
enterMove={props.editorEnterMove}
|
|
4560
4670
|
domId={cellEditorDomId}
|
|
4561
4671
|
alignTop={editorAlignTop()}
|
|
@@ -4688,7 +4798,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4688
4798
|
data-ssg-has-active-cell={ui().activeCell === null ? void 0 : ""}
|
|
4689
4799
|
onKeyDown={handleShellKeyDown}
|
|
4690
4800
|
onPaste={(event) => {
|
|
4691
|
-
if (
|
|
4801
|
+
if (untrack12(isAnyGridPopupOpen)) {
|
|
4692
4802
|
return;
|
|
4693
4803
|
}
|
|
4694
4804
|
clipboard.handlePaste({
|
|
@@ -4799,7 +4909,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4799
4909
|
{renderColumnDropIndicator("right")}
|
|
4800
4910
|
</div>
|
|
4801
4911
|
</div>
|
|
4802
|
-
<Show11 when={viewRowCount() === 0}>
|
|
4912
|
+
<Show11 when={viewRowCount() === 0 && hydrated()}>
|
|
4803
4913
|
<div class={["ssg-empty-state", slots().emptyState?.className]} style={slots().emptyState?.style}>
|
|
4804
4914
|
{emptyStateText()}
|
|
4805
4915
|
</div>
|
|
@@ -4811,7 +4921,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4811
4921
|
}}
|
|
4812
4922
|
class="ssg-tab-exit"
|
|
4813
4923
|
tabindex={hasDetailCards() ? 0 : -1}
|
|
4814
|
-
aria-hidden="true"
|
|
4924
|
+
aria-hidden={hasDetailCards() ? void 0 : "true"}
|
|
4815
4925
|
onFocus={(event) => detailRows.handleTableExitFocus(event.relatedTarget)}
|
|
4816
4926
|
/>
|
|
4817
4927
|
<Show11 when={scrollHintFeature2 !== void 0 && activeScrollHint()}>
|
|
@@ -4848,7 +4958,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4848
4958
|
<span class="ssg-filter-overlay-chip" role="status" aria-live="polite">
|
|
4849
4959
|
<span class="ssg-filter-spinner" aria-hidden="true" />
|
|
4850
4960
|
<span class="ssg-filter-overlay-text">
|
|
4851
|
-
{
|
|
4961
|
+
{formatLocaleText6(localeTexts().applyingFilter, { percent: Math.round(globalFilterProgress() * 100) })}
|
|
4852
4962
|
</span>
|
|
4853
4963
|
</span>
|
|
4854
4964
|
</div>
|
|
@@ -4964,7 +5074,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4964
5074
|
{(tab) => <Show11 when={toolPanel.layout()}>
|
|
4965
5075
|
{(layout) => <Show11 when={toolPanelViews()}>
|
|
4966
5076
|
{(views) => {
|
|
4967
|
-
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } =
|
|
5077
|
+
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } = untrack12(views);
|
|
4968
5078
|
return <ToolPanel
|
|
4969
5079
|
popoverSlot={slots().popover}
|
|
4970
5080
|
themeClassName={portalClassName()}
|
|
@@ -5113,7 +5223,7 @@ var columnAutosizeFeature = {
|
|
|
5113
5223
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5114
5224
|
|
|
5115
5225
|
// src/primitives/columnMenu.ts
|
|
5116
|
-
import { createMemo as
|
|
5226
|
+
import { createMemo as createMemo10 } from "solid-js";
|
|
5117
5227
|
import {
|
|
5118
5228
|
createColumnMenuController
|
|
5119
5229
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5125,16 +5235,16 @@ function createColumnMenu(inputs) {
|
|
|
5125
5235
|
gridRootRef: inputs.gridRootRef
|
|
5126
5236
|
}), "render", "columnMenu");
|
|
5127
5237
|
const snapshot = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5128
|
-
const openedColumnKey =
|
|
5129
|
-
const openedColumn =
|
|
5238
|
+
const openedColumnKey = createMemo10(() => snapshot().columnKey);
|
|
5239
|
+
const openedColumn = createMemo10(() => {
|
|
5130
5240
|
const key = openedColumnKey();
|
|
5131
5241
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5132
5242
|
});
|
|
5133
5243
|
return {
|
|
5134
5244
|
openedColumnKey,
|
|
5135
5245
|
openedColumn,
|
|
5136
|
-
layout:
|
|
5137
|
-
isOpen:
|
|
5246
|
+
layout: createMemo10(() => snapshot().layout),
|
|
5247
|
+
isOpen: createMemo10(() => openedColumnKey() !== null),
|
|
5138
5248
|
panelRef: controller.panelRef,
|
|
5139
5249
|
openFromButton: controller.openFromButton,
|
|
5140
5250
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5145,7 +5255,7 @@ function createColumnMenu(inputs) {
|
|
|
5145
5255
|
}
|
|
5146
5256
|
|
|
5147
5257
|
// src/view/ColumnMenuPopover.tsx
|
|
5148
|
-
import { For as For6, Show as Show12, createEffect as
|
|
5258
|
+
import { For as For6, Show as Show12, createEffect as createEffect4, createMemo as createMemo11, createSignal as createSignal9, createUniqueId as createUniqueId4, onCleanup as onCleanup8 } from "solid-js";
|
|
5149
5259
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5150
5260
|
var PINNED_ITEMS = [
|
|
5151
5261
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5170,16 +5280,17 @@ function ColumnMenuPopover(props) {
|
|
|
5170
5280
|
props.panelRef.current = null;
|
|
5171
5281
|
}
|
|
5172
5282
|
});
|
|
5173
|
-
const layout =
|
|
5283
|
+
const layout = createMemo11(() => props.layout);
|
|
5174
5284
|
const [openSubmenu, setOpenSubmenu] = createSignal9(null);
|
|
5175
5285
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5176
|
-
const isPinSubmenuOpen =
|
|
5286
|
+
const isPinSubmenuOpen = createMemo11(() => {
|
|
5177
5287
|
const current = openSubmenu();
|
|
5178
5288
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5179
5289
|
});
|
|
5180
|
-
|
|
5290
|
+
createEffect4(
|
|
5181
5291
|
() => props.columnKey,
|
|
5182
5292
|
() => {
|
|
5293
|
+
setOpenSubmenu(null);
|
|
5183
5294
|
if (panelElement) {
|
|
5184
5295
|
panelElement.scrollTop = 0;
|
|
5185
5296
|
}
|
|
@@ -5187,7 +5298,7 @@ function ColumnMenuPopover(props) {
|
|
|
5187
5298
|
{ name: "columnMenuScrollReset" }
|
|
5188
5299
|
);
|
|
5189
5300
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5190
|
-
const submenuInline =
|
|
5301
|
+
const submenuInline = createMemo11(() => layout().maxHeight !== void 0);
|
|
5191
5302
|
const [pinSubmenu, setPinSubmenu] = createSignal9();
|
|
5192
5303
|
let pinSubmenuElement;
|
|
5193
5304
|
createPortalTokens(
|
|
@@ -5205,7 +5316,7 @@ function ColumnMenuPopover(props) {
|
|
|
5205
5316
|
item?.focus();
|
|
5206
5317
|
return item != null;
|
|
5207
5318
|
};
|
|
5208
|
-
|
|
5319
|
+
createEffect4(isPinSubmenuOpen, (open) => {
|
|
5209
5320
|
if (!open) {
|
|
5210
5321
|
return;
|
|
5211
5322
|
}
|
|
@@ -5582,7 +5693,7 @@ var columnMenuFeature = {
|
|
|
5582
5693
|
};
|
|
5583
5694
|
|
|
5584
5695
|
// src/primitives/columnReorder.ts
|
|
5585
|
-
import { createEffect as
|
|
5696
|
+
import { createEffect as createEffect5 } from "solid-js";
|
|
5586
5697
|
import {
|
|
5587
5698
|
createColumnHeaderDragController
|
|
5588
5699
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnHeaderDragController";
|
|
@@ -5597,7 +5708,7 @@ function createColumnReorder(args) {
|
|
|
5597
5708
|
centerIndicatorRef,
|
|
5598
5709
|
rightIndicatorRef
|
|
5599
5710
|
}), "render", "columnReorder");
|
|
5600
|
-
|
|
5711
|
+
createEffect5(
|
|
5601
5712
|
() => args().paneLayout,
|
|
5602
5713
|
() => {
|
|
5603
5714
|
controller.applyReorderSettle();
|
|
@@ -5688,15 +5799,13 @@ var conditionalFormatFeature = {
|
|
|
5688
5799
|
|
|
5689
5800
|
// src/features/contextMenu.ts
|
|
5690
5801
|
import {
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
resolveContextMenuColIndex
|
|
5802
|
+
buildBodyContextMenuParams,
|
|
5803
|
+
buildCellContextMenuParams
|
|
5694
5804
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/contextMenuTarget";
|
|
5695
5805
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5696
|
-
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
5697
5806
|
|
|
5698
5807
|
// src/primitives/contextMenu.ts
|
|
5699
|
-
import { createMemo as
|
|
5808
|
+
import { createMemo as createMemo12 } from "solid-js";
|
|
5700
5809
|
import {
|
|
5701
5810
|
createContextMenuController
|
|
5702
5811
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
@@ -5706,7 +5815,7 @@ function createCellContextMenu(inputs) {
|
|
|
5706
5815
|
const snapshot = createExternalStoreSignal(controller, "contextMenuStore");
|
|
5707
5816
|
return {
|
|
5708
5817
|
snapshot,
|
|
5709
|
-
isOpen:
|
|
5818
|
+
isOpen: createMemo12(() => snapshot().state !== null),
|
|
5710
5819
|
open: controller.open,
|
|
5711
5820
|
close: controller.close,
|
|
5712
5821
|
panelRef: controller.panelRef
|
|
@@ -5714,7 +5823,7 @@ function createCellContextMenu(inputs) {
|
|
|
5714
5823
|
}
|
|
5715
5824
|
|
|
5716
5825
|
// src/view/CellContextMenuPopover.tsx
|
|
5717
|
-
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as
|
|
5826
|
+
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as createMemo13, createSignal as createSignal10, onCleanup as onCleanup9 } from "solid-js";
|
|
5718
5827
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5719
5828
|
function CellContextMenuPopover(props) {
|
|
5720
5829
|
const portal = useGridPortal();
|
|
@@ -5726,7 +5835,7 @@ function CellContextMenuPopover(props) {
|
|
|
5726
5835
|
props.panelRef.current = null;
|
|
5727
5836
|
}
|
|
5728
5837
|
});
|
|
5729
|
-
const layout =
|
|
5838
|
+
const layout = createMemo13(() => props.layout);
|
|
5730
5839
|
const element = <Show14 when={container}>
|
|
5731
5840
|
{(mount) => <Portal3 mount={mount()}>
|
|
5732
5841
|
<div
|
|
@@ -5798,7 +5907,7 @@ function ActionItem(props) {
|
|
|
5798
5907
|
role="menuitem"
|
|
5799
5908
|
disabled={props.item.disabled}
|
|
5800
5909
|
onClick={() => {
|
|
5801
|
-
props.item.onSelect
|
|
5910
|
+
callInOwnFrame(props.item.onSelect);
|
|
5802
5911
|
props.onRequestClose();
|
|
5803
5912
|
}}
|
|
5804
5913
|
class={[
|
|
@@ -5820,95 +5929,6 @@ function ActionItem(props) {
|
|
|
5820
5929
|
}
|
|
5821
5930
|
|
|
5822
5931
|
// src/features/contextMenu.ts
|
|
5823
|
-
var buildCellContextMenuParams = ({
|
|
5824
|
-
cell,
|
|
5825
|
-
clientX,
|
|
5826
|
-
clientY,
|
|
5827
|
-
rowModel,
|
|
5828
|
-
orderedColumns,
|
|
5829
|
-
selection,
|
|
5830
|
-
activeCell
|
|
5831
|
-
}) => {
|
|
5832
|
-
const rowIndex = cell.row;
|
|
5833
|
-
const colIndex = cell.col;
|
|
5834
|
-
const row = rowModel.getRow(rowIndex);
|
|
5835
|
-
const column = orderedColumns[colIndex];
|
|
5836
|
-
if (!row || !column) {
|
|
5837
|
-
return null;
|
|
5838
|
-
}
|
|
5839
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
5840
|
-
return {
|
|
5841
|
-
target: {
|
|
5842
|
-
type: "cell",
|
|
5843
|
-
rowIndex,
|
|
5844
|
-
colIndex,
|
|
5845
|
-
rowKey,
|
|
5846
|
-
row,
|
|
5847
|
-
column,
|
|
5848
|
-
value: getCellValue3(row, column)
|
|
5849
|
-
},
|
|
5850
|
-
clientX,
|
|
5851
|
-
clientY,
|
|
5852
|
-
selection,
|
|
5853
|
-
activeCell,
|
|
5854
|
-
isTargetSelected: isContextMenuCellSelected(selection, rowIndex, colIndex)
|
|
5855
|
-
};
|
|
5856
|
-
};
|
|
5857
|
-
var buildBodyContextMenuParams = ({
|
|
5858
|
-
event,
|
|
5859
|
-
rowModel,
|
|
5860
|
-
orderedColumns,
|
|
5861
|
-
selection,
|
|
5862
|
-
activeCell
|
|
5863
|
-
}) => {
|
|
5864
|
-
const targetEl = event.target;
|
|
5865
|
-
if (!targetEl) {
|
|
5866
|
-
return null;
|
|
5867
|
-
}
|
|
5868
|
-
const rowEl = targetEl.closest("[data-row-index]");
|
|
5869
|
-
if (!rowEl) {
|
|
5870
|
-
return null;
|
|
5871
|
-
}
|
|
5872
|
-
const rowIndexRaw = rowEl.dataset.rowIndex;
|
|
5873
|
-
if (rowIndexRaw === void 0) {
|
|
5874
|
-
return null;
|
|
5875
|
-
}
|
|
5876
|
-
const rowIndex = Number(rowIndexRaw);
|
|
5877
|
-
if (!Number.isInteger(rowIndex)) {
|
|
5878
|
-
return null;
|
|
5879
|
-
}
|
|
5880
|
-
const row = rowModel.getRow(rowIndex);
|
|
5881
|
-
if (!row) {
|
|
5882
|
-
return null;
|
|
5883
|
-
}
|
|
5884
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
5885
|
-
const cellEl = targetEl.closest("[data-ssg-col-key]");
|
|
5886
|
-
const colKey = cellEl?.dataset.ssgColKey;
|
|
5887
|
-
if (cellEl && colKey !== void 0) {
|
|
5888
|
-
const colIndex = resolveContextMenuColIndex(orderedColumns, colKey);
|
|
5889
|
-
if (colIndex < 0) {
|
|
5890
|
-
return null;
|
|
5891
|
-
}
|
|
5892
|
-
return buildCellContextMenuParams({
|
|
5893
|
-
cell: { row: rowIndex, col: colIndex },
|
|
5894
|
-
clientX: event.clientX,
|
|
5895
|
-
clientY: event.clientY,
|
|
5896
|
-
rowModel,
|
|
5897
|
-
orderedColumns,
|
|
5898
|
-
selection,
|
|
5899
|
-
activeCell
|
|
5900
|
-
});
|
|
5901
|
-
}
|
|
5902
|
-
const target = { type: "rowHeader", rowIndex, rowKey, row };
|
|
5903
|
-
return {
|
|
5904
|
-
target,
|
|
5905
|
-
clientX: event.clientX,
|
|
5906
|
-
clientY: event.clientY,
|
|
5907
|
-
selection,
|
|
5908
|
-
activeCell,
|
|
5909
|
-
isTargetSelected: isContextMenuRowSelected(selection, rowIndex)
|
|
5910
|
-
};
|
|
5911
|
-
};
|
|
5912
5932
|
var contextMenuFeature = {
|
|
5913
5933
|
// メニューの読み上げの名前の既定(シェルが本体の既定に重ねる)。
|
|
5914
5934
|
localeText: DEFAULT_CONTEXT_MENU_LOCALE_TEXT,
|
|
@@ -5928,7 +5948,7 @@ var exportFeature = {
|
|
|
5928
5948
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5929
5949
|
|
|
5930
5950
|
// src/primitives/fillHandle.ts
|
|
5931
|
-
import { createMemo as
|
|
5951
|
+
import { createMemo as createMemo14 } from "solid-js";
|
|
5932
5952
|
import {
|
|
5933
5953
|
createFillHandleController
|
|
5934
5954
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -5946,11 +5966,11 @@ import {
|
|
|
5946
5966
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
5947
5967
|
function createFillHandle(inputs) {
|
|
5948
5968
|
const controller = createFillHandleController();
|
|
5949
|
-
const options =
|
|
5969
|
+
const options = createMemo14(() => {
|
|
5950
5970
|
const fillHandle = inputs.fillHandle();
|
|
5951
5971
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
5952
5972
|
});
|
|
5953
|
-
const enabled =
|
|
5973
|
+
const enabled = createMemo14(
|
|
5954
5974
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
5955
5975
|
);
|
|
5956
5976
|
connectController(controller, () => {
|
|
@@ -5988,17 +6008,17 @@ function createFillHandle(inputs) {
|
|
|
5988
6008
|
};
|
|
5989
6009
|
}, "render", "fillHandle");
|
|
5990
6010
|
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 =
|
|
6011
|
+
const rowMetrics = createMemo14(() => inputs.vertical().rowMetrics);
|
|
6012
|
+
const windowFirstRow = createMemo14(() => inputs.vertical().windowFirstRow);
|
|
6013
|
+
const windowLastRow = createMemo14(() => inputs.vertical().windowLastRow);
|
|
6014
|
+
const detailActive = createMemo14(() => inputs.vertical().detailActive);
|
|
6015
|
+
const detailExtras = createMemo14(() => inputs.vertical().detailExtras);
|
|
6016
|
+
const verticalScaleFactor = createMemo14(() => inputs.vertical().verticalScaleFactor);
|
|
6017
|
+
const paneLayout = createMemo14(inputs.paneLayout);
|
|
6018
|
+
const viewportHeight = createMemo14(inputs.viewportHeight);
|
|
6019
|
+
const scrollTop = createMemo14(inputs.scrollTop);
|
|
6020
|
+
const headerHeight = createMemo14(inputs.headerHeight);
|
|
6021
|
+
const corner = createMemo14(() => {
|
|
6002
6022
|
const ui = inputs.uiState();
|
|
6003
6023
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6004
6024
|
return null;
|
|
@@ -6011,7 +6031,7 @@ function createFillHandle(inputs) {
|
|
|
6011
6031
|
}
|
|
6012
6032
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6013
6033
|
});
|
|
6014
|
-
const previewSelection =
|
|
6034
|
+
const previewSelection = createMemo14(() => {
|
|
6015
6035
|
const current = snapshot();
|
|
6016
6036
|
if (current.status !== "dragging" || current.target === null) {
|
|
6017
6037
|
return null;
|
|
@@ -6031,7 +6051,7 @@ function createFillHandle(inputs) {
|
|
|
6031
6051
|
}
|
|
6032
6052
|
};
|
|
6033
6053
|
});
|
|
6034
|
-
const previewGeometry =
|
|
6054
|
+
const previewGeometry = createMemo14(() => {
|
|
6035
6055
|
const selection = previewSelection();
|
|
6036
6056
|
if (selection === null) {
|
|
6037
6057
|
return null;
|
|
@@ -6064,7 +6084,7 @@ function createFillHandle(inputs) {
|
|
|
6064
6084
|
}
|
|
6065
6085
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6066
6086
|
};
|
|
6067
|
-
const chip =
|
|
6087
|
+
const chip = createMemo14(() => {
|
|
6068
6088
|
const current = snapshot();
|
|
6069
6089
|
if (current.status !== "filled") {
|
|
6070
6090
|
return null;
|
|
@@ -6087,7 +6107,7 @@ function createFillHandle(inputs) {
|
|
|
6087
6107
|
controller,
|
|
6088
6108
|
snapshot,
|
|
6089
6109
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6090
|
-
filling:
|
|
6110
|
+
filling: createMemo14(() => snapshot().status === "dragging"),
|
|
6091
6111
|
corner,
|
|
6092
6112
|
previewRects,
|
|
6093
6113
|
chip
|
|
@@ -6095,9 +6115,10 @@ function createFillHandle(inputs) {
|
|
|
6095
6115
|
}
|
|
6096
6116
|
|
|
6097
6117
|
// src/view/FillHandleLayer.tsx
|
|
6098
|
-
import { For as For8, Show as Show15, createEffect as
|
|
6118
|
+
import { For as For8, Show as Show15, createEffect as createEffect6, createMemo as createMemo15, createSignal as createSignal11, onCleanup as onCleanup10 } from "solid-js";
|
|
6099
6119
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6100
|
-
import { formatLocaleText as
|
|
6120
|
+
import { formatLocaleText as formatLocaleText7 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6121
|
+
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
6101
6122
|
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
6102
6123
|
function FillHandleLayer(props) {
|
|
6103
6124
|
const corner = () => {
|
|
@@ -6108,7 +6129,7 @@ function FillHandleLayer(props) {
|
|
|
6108
6129
|
const current = props.fill.chip();
|
|
6109
6130
|
return current?.pane === props.pane ? current.position : null;
|
|
6110
6131
|
};
|
|
6111
|
-
const filled =
|
|
6132
|
+
const filled = createMemo15(() => {
|
|
6112
6133
|
const snapshot = props.fill.snapshot();
|
|
6113
6134
|
return snapshot.status === "filled" ? snapshot : null;
|
|
6114
6135
|
});
|
|
@@ -6179,7 +6200,7 @@ function FillOptionsChip(props) {
|
|
|
6179
6200
|
class={["ssg-fill-options", { "ssg-fill-options--open": props.menuOpen }]}
|
|
6180
6201
|
style={{ position: "absolute", left: px(props.x), top: px(props.y) }}
|
|
6181
6202
|
data-ssg-fill-options=""
|
|
6182
|
-
aria-label={
|
|
6203
|
+
aria-label={formatLocaleText7(texts().fillOptionsCurrent, {
|
|
6183
6204
|
kind: props.kind === "series" ? texts().fillSeries : texts().fillCopy
|
|
6184
6205
|
})}
|
|
6185
6206
|
aria-haspopup="menu"
|
|
@@ -6227,7 +6248,7 @@ function FillOptionsMenu(props) {
|
|
|
6227
6248
|
menuPanel.current = null;
|
|
6228
6249
|
}
|
|
6229
6250
|
});
|
|
6230
|
-
|
|
6251
|
+
createEffect6(panel, (element2) => {
|
|
6231
6252
|
element2?.querySelector('[aria-checked="true"]')?.focus({ preventScroll: true });
|
|
6232
6253
|
}, { name: "fillMenuFocus" });
|
|
6233
6254
|
const handleKeyDown = (event) => {
|
|
@@ -6236,7 +6257,7 @@ function FillOptionsMenu(props) {
|
|
|
6236
6257
|
const items = Array.from(
|
|
6237
6258
|
panel()?.querySelectorAll('[role="menuitemradio"]:not(:disabled)') ?? []
|
|
6238
6259
|
);
|
|
6239
|
-
const index = items.findIndex((item) => item ===
|
|
6260
|
+
const index = items.findIndex((item) => item === getActiveElement(item));
|
|
6240
6261
|
const next = items[(index + (event.key === "ArrowDown" ? 1 : items.length - 1)) % items.length];
|
|
6241
6262
|
next?.focus({ preventScroll: true });
|
|
6242
6263
|
} else if (readEventKey(event) === "Tab") {
|
|
@@ -6295,8 +6316,8 @@ function FillTooltip(props) {
|
|
|
6295
6316
|
subscribe: props.fill.controller.subscribePointer,
|
|
6296
6317
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6297
6318
|
}, "fillPointerStore");
|
|
6298
|
-
const visible =
|
|
6299
|
-
const container =
|
|
6319
|
+
const visible = createMemo15(() => pointer() !== null);
|
|
6320
|
+
const container = createMemo15(() => visible() ? portal.container() : null);
|
|
6300
6321
|
const [tooltip, setTooltip] = createSignal11();
|
|
6301
6322
|
const element = <Show15 when={container()}>
|
|
6302
6323
|
{(mount) => <Portal4 mount={mount()}>
|
|
@@ -6318,11 +6339,11 @@ function FillTooltip(props) {
|
|
|
6318
6339
|
return element;
|
|
6319
6340
|
}
|
|
6320
6341
|
function FillHandlePortals(props) {
|
|
6321
|
-
const menu =
|
|
6342
|
+
const menu = createMemo15(() => {
|
|
6322
6343
|
const snapshot = props.fill.snapshot();
|
|
6323
6344
|
return snapshot.status === "filled" && snapshot.menu !== null ? snapshot : null;
|
|
6324
6345
|
});
|
|
6325
|
-
const tooltipText =
|
|
6346
|
+
const tooltipText = createMemo15(() => {
|
|
6326
6347
|
const snapshot = props.fill.snapshot();
|
|
6327
6348
|
return snapshot.status === "dragging" ? snapshot.previewText : null;
|
|
6328
6349
|
});
|
|
@@ -6360,7 +6381,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6360
6381
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6361
6382
|
|
|
6362
6383
|
// src/primitives/filterOrder.ts
|
|
6363
|
-
import { createMemo as
|
|
6384
|
+
import { createMemo as createMemo16 } from "solid-js";
|
|
6364
6385
|
import {
|
|
6365
6386
|
createGlobalFilteredOrderRunner,
|
|
6366
6387
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6373,11 +6394,11 @@ import {
|
|
|
6373
6394
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6374
6395
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6375
6396
|
function createFilterOrder(inputs) {
|
|
6376
|
-
const visibleColumns =
|
|
6377
|
-
const globalFilterColumns =
|
|
6378
|
-
const text =
|
|
6379
|
-
const needle =
|
|
6380
|
-
const key =
|
|
6397
|
+
const visibleColumns = createMemo16(() => inputs.visibleColumns());
|
|
6398
|
+
const globalFilterColumns = createMemo16(() => toGlobalFilterColumns(visibleColumns(), inputs.globalFilterMatch()));
|
|
6399
|
+
const text = createMemo16(() => inputs.globalFilterText());
|
|
6400
|
+
const needle = createMemo16(() => text().trim().toLowerCase());
|
|
6401
|
+
const key = createMemo16(
|
|
6381
6402
|
() => ({
|
|
6382
6403
|
rows: inputs.rows(),
|
|
6383
6404
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6387,42 +6408,42 @@ function createFilterOrder(inputs) {
|
|
|
6387
6408
|
{ equals: sameGlobalFilterKey }
|
|
6388
6409
|
);
|
|
6389
6410
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6390
|
-
const syncResult =
|
|
6411
|
+
const syncResult = createMemo16(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6391
6412
|
const runner = createGlobalFilteredOrderRunner();
|
|
6392
6413
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6393
6414
|
const snapshot = createExternalStoreSignal(runner, "globalFilterStore");
|
|
6394
|
-
const result =
|
|
6395
|
-
const columnFilters =
|
|
6396
|
-
const relativeDateFilterActive =
|
|
6415
|
+
const result = createMemo16(() => selectGlobalFilteredOrderResult(syncResult(), snapshot(), key()));
|
|
6416
|
+
const columnFilters = createMemo16(() => inputs.columnFilters());
|
|
6417
|
+
const relativeDateFilterActive = createMemo16(
|
|
6397
6418
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6398
6419
|
);
|
|
6399
6420
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6400
6421
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6401
|
-
const relativeDateKey =
|
|
6422
|
+
const relativeDateKey = createMemo16(
|
|
6402
6423
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6403
6424
|
);
|
|
6404
6425
|
return {
|
|
6405
|
-
globalFilteredOrder:
|
|
6406
|
-
globalFilterStatus:
|
|
6407
|
-
globalFilterProgress:
|
|
6426
|
+
globalFilteredOrder: createMemo16(() => result().order),
|
|
6427
|
+
globalFilterStatus: createMemo16(() => result().status),
|
|
6428
|
+
globalFilterProgress: createMemo16(() => result().progress),
|
|
6408
6429
|
relativeDateKey
|
|
6409
6430
|
};
|
|
6410
6431
|
}
|
|
6411
6432
|
|
|
6412
6433
|
// src/primitives/filterPopover.ts
|
|
6413
|
-
import { createMemo as
|
|
6434
|
+
import { createMemo as createMemo17, createSignal as createSignal12, untrack as untrack13 } from "solid-js";
|
|
6414
6435
|
import {
|
|
6415
6436
|
createFilterPopoverController,
|
|
6416
6437
|
resolveOpenedFilterColumn
|
|
6417
6438
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/filterPopoverController";
|
|
6418
6439
|
import { inferColumnFilterType } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/inferFilterType";
|
|
6419
|
-
import { getCellValue as
|
|
6440
|
+
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
6420
6441
|
import { GROUP_AUTO_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
6421
6442
|
var NO_GROUP_COLUMNS = [];
|
|
6422
6443
|
function createFilterPopover(inputs) {
|
|
6423
6444
|
const controller = createFilterPopoverController();
|
|
6424
6445
|
const autoFilterTypeCache = /* @__PURE__ */ new Map();
|
|
6425
|
-
const resolveAutoColumnFilterType = (column) =>
|
|
6446
|
+
const resolveAutoColumnFilterType = (column) => untrack13(() => {
|
|
6426
6447
|
const currentValue = inputs.columnFilters()[column.key];
|
|
6427
6448
|
if (currentValue?.kind === "numberSet" || currentValue?.kind === "textSet" || currentValue?.kind === "dateSet" || currentValue?.kind === "text") {
|
|
6428
6449
|
return currentValue.kind;
|
|
@@ -6440,7 +6461,7 @@ function createFilterPopover(inputs) {
|
|
|
6440
6461
|
// ラベル行は空として数えます(見出しの文字で数値の列が文字の列に推定されないように)。
|
|
6441
6462
|
getRawValueAt: (index) => {
|
|
6442
6463
|
const row = rows[index];
|
|
6443
|
-
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 :
|
|
6464
|
+
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 : getCellValue3(row, column);
|
|
6444
6465
|
}
|
|
6445
6466
|
});
|
|
6446
6467
|
if (result.conclusive) {
|
|
@@ -6448,15 +6469,15 @@ function createFilterPopover(inputs) {
|
|
|
6448
6469
|
}
|
|
6449
6470
|
return result.filterType;
|
|
6450
6471
|
});
|
|
6451
|
-
const groupColumns =
|
|
6452
|
-
const popoverColumns =
|
|
6472
|
+
const groupColumns = createMemo17(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
6473
|
+
const popoverColumns = createMemo17(() => {
|
|
6453
6474
|
const groups = groupColumns();
|
|
6454
6475
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6455
6476
|
});
|
|
6456
|
-
const resolveAnchorColumnKey = (columnKey) =>
|
|
6477
|
+
const resolveAnchorColumnKey = (columnKey) => untrack13(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6457
6478
|
const snapshot = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6458
|
-
const state =
|
|
6459
|
-
const layout =
|
|
6479
|
+
const state = createMemo17(() => snapshot().state);
|
|
6480
|
+
const layout = createMemo17(() => snapshot().layout);
|
|
6460
6481
|
const [panel, setPanel] = createSignal12(null);
|
|
6461
6482
|
connectController(
|
|
6462
6483
|
controller,
|
|
@@ -6476,19 +6497,19 @@ function createFilterPopover(inputs) {
|
|
|
6476
6497
|
"effect",
|
|
6477
6498
|
"filterPopover"
|
|
6478
6499
|
);
|
|
6479
|
-
const openedColumnKey =
|
|
6480
|
-
const openedFilterType =
|
|
6481
|
-
const openedColumn =
|
|
6500
|
+
const openedColumnKey = createMemo17(() => state()?.columnKey ?? null);
|
|
6501
|
+
const openedFilterType = createMemo17(() => state()?.filterType ?? null);
|
|
6502
|
+
const openedColumn = createMemo17(() => {
|
|
6482
6503
|
openedColumnKey();
|
|
6483
6504
|
openedFilterType();
|
|
6484
|
-
return resolveOpenedFilterColumn(popoverColumns(),
|
|
6505
|
+
return resolveOpenedFilterColumn(popoverColumns(), untrack13(state));
|
|
6485
6506
|
});
|
|
6486
6507
|
return {
|
|
6487
6508
|
state,
|
|
6488
6509
|
layout,
|
|
6489
6510
|
openedColumn,
|
|
6490
6511
|
openedFilterType,
|
|
6491
|
-
isOpen:
|
|
6512
|
+
isOpen: createMemo17(() => state() !== null),
|
|
6492
6513
|
setPanel: (element) => {
|
|
6493
6514
|
controller.panelRef.current = element;
|
|
6494
6515
|
setPanel(element);
|
|
@@ -6506,13 +6527,13 @@ function createFilterPopover(inputs) {
|
|
|
6506
6527
|
}
|
|
6507
6528
|
|
|
6508
6529
|
// src/primitives/filterManagement.ts
|
|
6509
|
-
import { createMemo as
|
|
6530
|
+
import { createMemo as createMemo18, onCleanup as onCleanup11, untrack as untrack14 } from "solid-js";
|
|
6510
6531
|
import {
|
|
6511
6532
|
createColumnFilterDescribeOptions,
|
|
6512
6533
|
describeColumnFilterValue
|
|
6513
6534
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6514
6535
|
import { isActiveColumnFilterValue as isActiveColumnFilterValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6515
|
-
import { formatLocaleText as
|
|
6536
|
+
import { formatLocaleText as formatLocaleText8 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6516
6537
|
import {
|
|
6517
6538
|
computeSinglePaneColumnExtent as computeSinglePaneColumnExtent2
|
|
6518
6539
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry";
|
|
@@ -6522,9 +6543,9 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6522
6543
|
var NO_COLUMNS2 = [];
|
|
6523
6544
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6524
6545
|
function createFilterManagement(inputs) {
|
|
6525
|
-
const groupColumns =
|
|
6526
|
-
const groupColumnKeys =
|
|
6527
|
-
const entries =
|
|
6546
|
+
const groupColumns = createMemo18(() => inputs.groupColumns?.() ?? NO_COLUMNS2);
|
|
6547
|
+
const groupColumnKeys = createMemo18(() => new Set(groupColumns().map((column) => column.key)));
|
|
6548
|
+
const entries = createMemo18(() => {
|
|
6528
6549
|
const columnFilters = inputs.columnFilters();
|
|
6529
6550
|
const texts = inputs.localeTexts();
|
|
6530
6551
|
const result = [];
|
|
@@ -6556,13 +6577,13 @@ function createFilterManagement(inputs) {
|
|
|
6556
6577
|
}
|
|
6557
6578
|
return result;
|
|
6558
6579
|
});
|
|
6559
|
-
const addableColumns =
|
|
6580
|
+
const addableColumns = createMemo18(() => {
|
|
6560
6581
|
const columnFilters = inputs.columnFilters();
|
|
6561
6582
|
const texts = inputs.localeTexts();
|
|
6562
6583
|
const grouped = groupColumnKeys();
|
|
6563
6584
|
return [...inputs.visibleColumns(), ...groupColumns()].filter((column) => Boolean(column.filterType) && !isActiveColumnFilterValue2(columnFilters[column.key])).map((column) => ({
|
|
6564
6585
|
key: column.key,
|
|
6565
|
-
title: grouped.has(column.key) ?
|
|
6586
|
+
title: grouped.has(column.key) ? formatLocaleText8(texts.groupedColumnTitle, { column: column.title || column.key }) : column.title || column.key
|
|
6566
6587
|
}));
|
|
6567
6588
|
});
|
|
6568
6589
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
@@ -6581,7 +6602,7 @@ function createFilterManagement(inputs) {
|
|
|
6581
6602
|
});
|
|
6582
6603
|
pendingFrames.add(frame);
|
|
6583
6604
|
};
|
|
6584
|
-
const jumpToColumnFilter = (columnKey) =>
|
|
6605
|
+
const jumpToColumnFilter = (columnKey) => untrack14(() => {
|
|
6585
6606
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
6586
6607
|
const groupColumn = groupColumns().find((candidate) => candidate.key === columnKey);
|
|
6587
6608
|
const anchorKey = groupColumn ? GROUP_AUTO_COLUMN_KEY2 : columnKey;
|
|
@@ -6646,7 +6667,7 @@ function createFilterManagement(inputs) {
|
|
|
6646
6667
|
}
|
|
6647
6668
|
|
|
6648
6669
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6649
|
-
import { Show as Show16, createMemo as
|
|
6670
|
+
import { Show as Show16, createMemo as createMemo19, untrack as untrack15 } from "solid-js";
|
|
6650
6671
|
import {
|
|
6651
6672
|
createFilterPopoverCommands,
|
|
6652
6673
|
createFilterPopoverDerivedResolver
|
|
@@ -6673,17 +6694,17 @@ import {
|
|
|
6673
6694
|
describeColumnFilterValue as describeColumnFilterValue2
|
|
6674
6695
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6675
6696
|
import { normalizeDateFilterPresets } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
|
|
6676
|
-
import { formatLocaleText as
|
|
6677
|
-
import { getCellValue as
|
|
6697
|
+
import { formatLocaleText as formatLocaleText9 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6698
|
+
import { getCellValue as getCellValue4 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
6678
6699
|
function ColumnFilterPopoverHost(props) {
|
|
6679
6700
|
const filterPopover = props.filterPopover;
|
|
6680
6701
|
const openedColumn = filterPopover.openedColumn;
|
|
6681
6702
|
const openedType = filterPopover.openedFilterType;
|
|
6682
|
-
const openedOptionsKey =
|
|
6703
|
+
const openedOptionsKey = createMemo19(() => {
|
|
6683
6704
|
const column = openedColumn();
|
|
6684
6705
|
return column ? String(column.key) : null;
|
|
6685
6706
|
});
|
|
6686
|
-
const optionRowsHold =
|
|
6707
|
+
const optionRowsHold = createMemo19((prev) => {
|
|
6687
6708
|
const key = openedOptionsKey();
|
|
6688
6709
|
const rows = props.rows;
|
|
6689
6710
|
if (key === null) {
|
|
@@ -6694,9 +6715,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6694
6715
|
}
|
|
6695
6716
|
return prev;
|
|
6696
6717
|
});
|
|
6697
|
-
const optionRows =
|
|
6698
|
-
const openedIsDateSet =
|
|
6699
|
-
const getOpenedColumnRawValueAt =
|
|
6718
|
+
const optionRows = createMemo19(() => optionRowsHold().rows);
|
|
6719
|
+
const openedIsDateSet = createMemo19(() => openedType() === "dateSet");
|
|
6720
|
+
const getOpenedColumnRawValueAt = createMemo19(() => {
|
|
6700
6721
|
const rows = optionRows();
|
|
6701
6722
|
const column = openedColumn();
|
|
6702
6723
|
const isDateSet = openedIsDateSet();
|
|
@@ -6704,11 +6725,11 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6704
6725
|
if (!column) {
|
|
6705
6726
|
return void 0;
|
|
6706
6727
|
}
|
|
6707
|
-
const value =
|
|
6728
|
+
const value = getCellValue4(rows[index], column);
|
|
6708
6729
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6709
6730
|
};
|
|
6710
6731
|
});
|
|
6711
|
-
const usesAsyncOptions =
|
|
6732
|
+
const usesAsyncOptions = createMemo19(() => {
|
|
6712
6733
|
const column = openedColumn();
|
|
6713
6734
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
6714
6735
|
});
|
|
@@ -6725,12 +6746,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6725
6746
|
};
|
|
6726
6747
|
}, "render", "filterOptionsSource");
|
|
6727
6748
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
6728
|
-
const collectColumn =
|
|
6729
|
-
const numeric =
|
|
6730
|
-
const syncResult =
|
|
6749
|
+
const collectColumn = createMemo19(() => usesAsyncOptions() ? null : openedColumn());
|
|
6750
|
+
const numeric = createMemo19(() => openedType() === "numberSet");
|
|
6751
|
+
const syncResult = createMemo19(
|
|
6731
6752
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
6732
6753
|
);
|
|
6733
|
-
const sourceKey =
|
|
6754
|
+
const sourceKey = createMemo19(() => {
|
|
6734
6755
|
const column = collectColumn();
|
|
6735
6756
|
return column === null ? void 0 : String(column.key);
|
|
6736
6757
|
});
|
|
@@ -6743,14 +6764,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6743
6764
|
sourceKey: sourceKey()
|
|
6744
6765
|
}), "render", "filterValueCollector");
|
|
6745
6766
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
6746
|
-
const optionsResult =
|
|
6767
|
+
const optionsResult = createMemo19(() => {
|
|
6747
6768
|
if (usesAsyncOptions()) {
|
|
6748
6769
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
6749
6770
|
}
|
|
6750
6771
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
6751
6772
|
});
|
|
6752
6773
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
6753
|
-
const derived =
|
|
6774
|
+
const derived = createMemo19(
|
|
6754
6775
|
() => resolveDerived({
|
|
6755
6776
|
openedFilterColumn: openedColumn(),
|
|
6756
6777
|
openedFilterType: openedType(),
|
|
@@ -6774,14 +6795,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6774
6795
|
filterTexts: props.localeTexts
|
|
6775
6796
|
}), "render", "filterPopoverCommands");
|
|
6776
6797
|
const texts = () => props.localeTexts;
|
|
6777
|
-
const currentValueText =
|
|
6798
|
+
const currentValueText = createMemo19(() => {
|
|
6778
6799
|
const column = openedColumn();
|
|
6779
6800
|
if (!column) {
|
|
6780
6801
|
return texts().filterCurrentNone;
|
|
6781
6802
|
}
|
|
6782
6803
|
const rawValue = props.columnFilters[column.key];
|
|
6783
6804
|
if (isSetColumnFilterValue(rawValue)) {
|
|
6784
|
-
return
|
|
6805
|
+
return formatLocaleText9(rawValue.mode === "exclude" ? texts().filterCurrentExcluded : texts().filterCurrentSelected, {
|
|
6785
6806
|
count: rawValue.values.length
|
|
6786
6807
|
});
|
|
6787
6808
|
}
|
|
@@ -6791,16 +6812,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6791
6812
|
const text = columnFilterValueToDraftText(rawValue);
|
|
6792
6813
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
6793
6814
|
});
|
|
6794
|
-
const datePresets =
|
|
6815
|
+
const datePresets = createMemo19(() => {
|
|
6795
6816
|
const column = openedColumn();
|
|
6796
6817
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
6797
6818
|
});
|
|
6798
|
-
const comboSummaryText =
|
|
6819
|
+
const comboSummaryText = createMemo19(() => {
|
|
6799
6820
|
const column = openedColumn();
|
|
6800
6821
|
const value = derived().openedSetFilterValue;
|
|
6801
6822
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
6802
6823
|
});
|
|
6803
|
-
const renderDateInput =
|
|
6824
|
+
const renderDateInput = createMemo19(() => {
|
|
6804
6825
|
const render = props.renderFilterDateInput;
|
|
6805
6826
|
const column = openedColumn();
|
|
6806
6827
|
if (!render || !column) {
|
|
@@ -6823,11 +6844,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6823
6844
|
{(column) => <Show16 when={filterPopover.layout()}>
|
|
6824
6845
|
{(layout) => <Show16 when={props.views()}>
|
|
6825
6846
|
{(views) => {
|
|
6826
|
-
const ColumnFilterPopover =
|
|
6827
|
-
return <
|
|
6847
|
+
const ColumnFilterPopover = untrack15(views).ColumnFilterPopover;
|
|
6848
|
+
return <Show16 when={column().key} keyed>
|
|
6849
|
+
{(columnKey) => <ColumnFilterPopover
|
|
6828
6850
|
popoverSlot={props.popoverSlot}
|
|
6829
6851
|
themeClassName={props.themeClassName}
|
|
6830
|
-
title={column().title ||
|
|
6852
|
+
title={column().title || columnKey}
|
|
6831
6853
|
filterType={openedType() ?? "text"}
|
|
6832
6854
|
isServerSide={props.isServerSide && !usesAsyncOptions()}
|
|
6833
6855
|
draftValue={filterPopover.state()?.draftValue ?? ""}
|
|
@@ -6863,7 +6885,8 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6863
6885
|
onSetSelectAllChange={commands.handleSetFilterSelectAllChange}
|
|
6864
6886
|
onSetClear={commands.clearSetFilterPopoverValue}
|
|
6865
6887
|
onSetReplaceSelection={commands.handleSetFilterReplaceSelection}
|
|
6866
|
-
|
|
6888
|
+
/>}
|
|
6889
|
+
</Show16>;
|
|
6867
6890
|
}}
|
|
6868
6891
|
</Show16>}
|
|
6869
6892
|
</Show16>}
|
|
@@ -6872,7 +6895,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6872
6895
|
|
|
6873
6896
|
// src/view/GridFilterChipBar.tsx
|
|
6874
6897
|
import { For as For9, Show as Show17, createUniqueId as createUniqueId5 } from "solid-js";
|
|
6875
|
-
import { formatLocaleText as
|
|
6898
|
+
import { formatLocaleText as formatLocaleText10 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6876
6899
|
function GridFilterChipBar(props) {
|
|
6877
6900
|
const texts = useFeatureLocaleText();
|
|
6878
6901
|
const chipIdBase = createUniqueId5();
|
|
@@ -6901,7 +6924,7 @@ function GridFilterChipBar(props) {
|
|
|
6901
6924
|
class="ssg-filter-chip-clear"
|
|
6902
6925
|
disabled={!props.canFilter}
|
|
6903
6926
|
data-ssg-tooltip={texts().filterClear}
|
|
6904
|
-
aria-label={
|
|
6927
|
+
aria-label={formatLocaleText10(texts().filterClearFor, { column: entry().title })}
|
|
6905
6928
|
onClick={() => props.onClearFilter(entry().columnKey)}
|
|
6906
6929
|
>
|
|
6907
6930
|
×
|
|
@@ -6910,7 +6933,7 @@ function GridFilterChipBar(props) {
|
|
|
6910
6933
|
/* 名前の後半(操作の説明)。ボタンの中に置くと文字に混ざるので外に置きます。 */
|
|
6911
6934
|
}
|
|
6912
6935
|
<span id={`${chipIdBase}-${index()}-action`} hidden>
|
|
6913
|
-
{
|
|
6936
|
+
{formatLocaleText10(texts().filterEditFor, { column: entry().title })}
|
|
6914
6937
|
</span>
|
|
6915
6938
|
</div>}
|
|
6916
6939
|
</For9>
|
|
@@ -6927,11 +6950,11 @@ function GridFilterChipBar(props) {
|
|
|
6927
6950
|
}
|
|
6928
6951
|
|
|
6929
6952
|
// src/view/lazyPopups.ts
|
|
6930
|
-
import { createEffect as
|
|
6953
|
+
import { createEffect as createEffect7, createMemo as createMemo20 } from "solid-js";
|
|
6931
6954
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
6932
6955
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
6933
|
-
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-
|
|
6934
|
-
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-
|
|
6956
|
+
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-2DW5SZT3.jsx"));
|
|
6957
|
+
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-HIQGRX3N.jsx"));
|
|
6935
6958
|
var preloadGridPopups = async () => {
|
|
6936
6959
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
6937
6960
|
};
|
|
@@ -6940,8 +6963,8 @@ var reportLoadError = (error) => {
|
|
|
6940
6963
|
};
|
|
6941
6964
|
function createLazyModuleSignal(module, options, name) {
|
|
6942
6965
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
6943
|
-
|
|
6944
|
-
|
|
6966
|
+
createEffect7(
|
|
6967
|
+
createMemo20(() => options.needed() && loaded() === null),
|
|
6945
6968
|
(shouldLoad) => {
|
|
6946
6969
|
if (!shouldLoad) {
|
|
6947
6970
|
return;
|
|
@@ -6959,8 +6982,8 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
6959
6982
|
},
|
|
6960
6983
|
{ name: `${name}Load` }
|
|
6961
6984
|
);
|
|
6962
|
-
|
|
6963
|
-
|
|
6985
|
+
createEffect7(
|
|
6986
|
+
createMemo20(() => options.prefetch() && module.getSnapshot() === null),
|
|
6964
6987
|
(shouldPrefetch) => {
|
|
6965
6988
|
if (!shouldPrefetch) {
|
|
6966
6989
|
return;
|
|
@@ -6995,18 +7018,18 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
6995
7018
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6996
7019
|
|
|
6997
7020
|
// src/view/GridFindBar.tsx
|
|
6998
|
-
import { createRenderEffect as
|
|
7021
|
+
import { createRenderEffect as createRenderEffect5, createSignal as createSignal13, onSettled as onSettled7, untrack as untrack16 } from "solid-js";
|
|
6999
7022
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7000
7023
|
function GridFindBar(props) {
|
|
7001
7024
|
const texts = useFeatureLocaleText();
|
|
7002
7025
|
const [input, setInput] = createSignal13();
|
|
7003
|
-
const initialQuery =
|
|
7026
|
+
const initialQuery = untrack16(() => props.snapshot.query);
|
|
7004
7027
|
onSettled7(() => {
|
|
7005
|
-
const element =
|
|
7028
|
+
const element = untrack16(input);
|
|
7006
7029
|
element?.focus();
|
|
7007
7030
|
element?.select();
|
|
7008
7031
|
});
|
|
7009
|
-
|
|
7032
|
+
createRenderEffect5(
|
|
7010
7033
|
() => [input(), props.snapshot.query],
|
|
7011
7034
|
([element, query]) => {
|
|
7012
7035
|
if (element && element.value !== query) {
|
|
@@ -7131,14 +7154,14 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7131
7154
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7132
7155
|
|
|
7133
7156
|
// src/view/GridBodyGroupRow.tsx
|
|
7134
|
-
import { For as For10, Show as Show18, createMemo as
|
|
7157
|
+
import { For as For10, Show as Show18, createMemo as createMemo21 } from "solid-js";
|
|
7135
7158
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7136
7159
|
import {
|
|
7137
7160
|
formatTotalRowCellText,
|
|
7138
7161
|
formatTotalRowNumber,
|
|
7139
7162
|
resolveTotalRowCaption
|
|
7140
7163
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
7141
|
-
import { formatLocaleText as
|
|
7164
|
+
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7142
7165
|
var GROUP_INDENT_PX = 16;
|
|
7143
7166
|
function GridBodyGroupRow(props) {
|
|
7144
7167
|
const texts = useFeatureLocaleText();
|
|
@@ -7189,10 +7212,10 @@ function GridBodyGroupRow(props) {
|
|
|
7189
7212
|
</Show18>
|
|
7190
7213
|
<For10 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7191
7214
|
{(entry) => {
|
|
7192
|
-
const unbound =
|
|
7215
|
+
const unbound = createMemo21(() => entry().column);
|
|
7193
7216
|
const column = () => unbound();
|
|
7194
7217
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7195
|
-
const aggregate =
|
|
7218
|
+
const aggregate = createMemo21(() => {
|
|
7196
7219
|
const current = column();
|
|
7197
7220
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7198
7221
|
return null;
|
|
@@ -7253,7 +7276,7 @@ function GridBodyGroupRow(props) {
|
|
|
7253
7276
|
tabindex={-1}
|
|
7254
7277
|
class="ssg-group-toggle"
|
|
7255
7278
|
aria-expanded={props.isCollapsed ? "false" : "true"}
|
|
7256
|
-
aria-label={
|
|
7279
|
+
aria-label={formatLocaleText11(props.isCollapsed ? texts().expandGroup : texts().collapseGroup, {
|
|
7257
7280
|
group: groupLabel()
|
|
7258
7281
|
})}
|
|
7259
7282
|
onClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
@@ -7263,7 +7286,7 @@ function GridBodyGroupRow(props) {
|
|
|
7263
7286
|
</button>
|
|
7264
7287
|
<span class="ssg-group-label">{groupLabel()}</span>
|
|
7265
7288
|
<span class="ssg-group-count">
|
|
7266
|
-
{
|
|
7289
|
+
{formatLocaleText11(texts().groupRowCount, { count: formatTotalRowNumber(props.groupRow.leafCount) })}
|
|
7267
7290
|
</span>
|
|
7268
7291
|
</Show18>
|
|
7269
7292
|
</div>;
|
|
@@ -7301,12 +7324,12 @@ import {
|
|
|
7301
7324
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7302
7325
|
|
|
7303
7326
|
// src/view/GridBodyLabelRow.tsx
|
|
7304
|
-
import { Show as Show19, createMemo as
|
|
7327
|
+
import { Show as Show19, createMemo as createMemo22 } from "solid-js";
|
|
7305
7328
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7306
|
-
const row =
|
|
7307
|
-
const sourceRowIndex =
|
|
7308
|
-
const label =
|
|
7309
|
-
const sectionRowCount =
|
|
7329
|
+
const row = createMemo22(() => labelRow().row);
|
|
7330
|
+
const sourceRowIndex = createMemo22(() => labelRow().sourceIndex);
|
|
7331
|
+
const label = createMemo22(() => labelRow().label);
|
|
7332
|
+
const sectionRowCount = createMemo22(() => labelRow().sectionRowCount);
|
|
7310
7333
|
return {
|
|
7311
7334
|
get row() {
|
|
7312
7335
|
return row();
|
|
@@ -7382,7 +7405,7 @@ function GridBodyLabelRow(props) {
|
|
|
7382
7405
|
}
|
|
7383
7406
|
|
|
7384
7407
|
// src/view/GridStickyLabelLayer.tsx
|
|
7385
|
-
import { Show as Show20, createMemo as
|
|
7408
|
+
import { Show as Show20, createMemo as createMemo23, onSettled as onSettled8 } from "solid-js";
|
|
7386
7409
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7387
7410
|
function GridStickyLabelLayer(props) {
|
|
7388
7411
|
return <Show20 when={props.entry}>
|
|
@@ -7391,10 +7414,10 @@ function GridStickyLabelLayer(props) {
|
|
|
7391
7414
|
}
|
|
7392
7415
|
function StickyLabel(props) {
|
|
7393
7416
|
const layer = props.layer;
|
|
7394
|
-
const labelRow =
|
|
7395
|
-
const rowIndex =
|
|
7396
|
-
const rowKey =
|
|
7397
|
-
const height =
|
|
7417
|
+
const labelRow = createMemo23(() => props.entry().labelRow);
|
|
7418
|
+
const rowIndex = createMemo23(() => props.entry().rowIndex);
|
|
7419
|
+
const rowKey = createMemo23(() => props.entry().rowKey);
|
|
7420
|
+
const height = createMemo23(() => props.entry().height);
|
|
7398
7421
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7399
7422
|
let element;
|
|
7400
7423
|
onSettled8(() => {
|
|
@@ -7497,12 +7520,12 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7497
7520
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7498
7521
|
|
|
7499
7522
|
// src/primitives/serverSide.ts
|
|
7500
|
-
import { createMemo as
|
|
7523
|
+
import { createMemo as createMemo24, untrack as untrack17 } from "solid-js";
|
|
7501
7524
|
import {
|
|
7502
7525
|
createServerSideRowModel
|
|
7503
7526
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
7504
7527
|
function createServerSide(args) {
|
|
7505
|
-
const controller = createServerSideRowModel(
|
|
7528
|
+
const controller = createServerSideRowModel(untrack17(args));
|
|
7506
7529
|
let updated = false;
|
|
7507
7530
|
let pendingRange = null;
|
|
7508
7531
|
connectController(
|
|
@@ -7534,23 +7557,23 @@ function createServerSide(args) {
|
|
|
7534
7557
|
};
|
|
7535
7558
|
const snapshot = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7536
7559
|
return {
|
|
7537
|
-
rowModel:
|
|
7560
|
+
rowModel: createMemo24(() => snapshot().rowModel),
|
|
7538
7561
|
rowCount: () => snapshot().rowCount,
|
|
7539
|
-
loadError:
|
|
7540
|
-
writeError:
|
|
7562
|
+
loadError: createMemo24(() => snapshot().loadError),
|
|
7563
|
+
writeError: createMemo24(() => snapshot().writeError),
|
|
7541
7564
|
isRowLoaded: controller.isRowLoaded,
|
|
7542
7565
|
requestRange,
|
|
7543
7566
|
refresh: controller.refresh,
|
|
7544
7567
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7545
7568
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7546
|
-
canUpdateRows:
|
|
7569
|
+
canUpdateRows: createMemo24(() => args().dataSource?.updateRows !== void 0),
|
|
7547
7570
|
applyCellEdits: controller.applyCellEdits
|
|
7548
7571
|
};
|
|
7549
7572
|
}
|
|
7550
7573
|
|
|
7551
7574
|
// src/view/GridServerSideErrorBars.tsx
|
|
7552
7575
|
import { Show as Show21, createSignal as createSignal14 } from "solid-js";
|
|
7553
|
-
import { formatLocaleText as
|
|
7576
|
+
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7554
7577
|
function GridServerSideErrorBars(props) {
|
|
7555
7578
|
const [dismissedLoadError, setDismissedLoadError] = createSignal14(null);
|
|
7556
7579
|
const [dismissedWriteError, setDismissedWriteError] = createSignal14(null);
|
|
@@ -7563,7 +7586,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7563
7586
|
{(loadError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7564
7587
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7565
7588
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7566
|
-
{
|
|
7589
|
+
{formatLocaleText12(texts().loadFailed, { count: loadError().failedBlockCount })}
|
|
7567
7590
|
</span>
|
|
7568
7591
|
<button type="button" class="ssg-ssrm-error-bar-retry" onClick={() => props.onRetry()}>
|
|
7569
7592
|
{texts().retry}
|
|
@@ -7582,7 +7605,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7582
7605
|
{(writeError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7583
7606
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7584
7607
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7585
|
-
{
|
|
7608
|
+
{formatLocaleText12(texts().saveFailed, { count: writeError().failedRowCount })}
|
|
7586
7609
|
</span>
|
|
7587
7610
|
<button
|
|
7588
7611
|
type="button"
|
|
@@ -7725,12 +7748,12 @@ var motionExtrasFeature = {
|
|
|
7725
7748
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7726
7749
|
|
|
7727
7750
|
// src/view/GridPinnedRows.tsx
|
|
7728
|
-
import { For as For12, Show as Show24, createMemo as
|
|
7751
|
+
import { For as For12, Show as Show24, createMemo as createMemo25 } from "solid-js";
|
|
7729
7752
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7730
7753
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7731
7754
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
7732
|
-
import { formatLocaleText as
|
|
7733
|
-
import { getCellValue as
|
|
7755
|
+
import { formatLocaleText as formatLocaleText13 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7756
|
+
import { getCellValue as getCellValue5 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
7734
7757
|
var noop4 = () => {
|
|
7735
7758
|
};
|
|
7736
7759
|
var PIN_ICON_PATH = "M9.8 1.5 14.5 6.2l-1.4 1.4-1-.9-2.6 2.6.3 3.2-1.4 1.4-2.6-2.6-3.3 3.3-.7-.7 3.3-3.3L2.5 8l1.4-1.4 3.2.3 2.6-2.6-.9-1z";
|
|
@@ -7749,7 +7772,7 @@ function GridPinnedRows(props) {
|
|
|
7749
7772
|
<For12 each={props.rows} keyed={false}>
|
|
7750
7773
|
{(row, index) => {
|
|
7751
7774
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
7752
|
-
const rowSlot =
|
|
7775
|
+
const rowSlot = createMemo25(
|
|
7753
7776
|
() => resolveSlotProps3(
|
|
7754
7777
|
props.getRowClassName?.(row(), index, {
|
|
7755
7778
|
row: row(),
|
|
@@ -7793,7 +7816,7 @@ function GridPinnedRows(props) {
|
|
|
7793
7816
|
class="ssg-pinned-row-icon"
|
|
7794
7817
|
viewBox="0 0 16 16"
|
|
7795
7818
|
role="img"
|
|
7796
|
-
aria-label={
|
|
7819
|
+
aria-label={formatLocaleText13(
|
|
7797
7820
|
props.position === "top" ? texts().pinnedTopRow : texts().pinnedBottomRow,
|
|
7798
7821
|
{ row: index + 1 }
|
|
7799
7822
|
)}
|
|
@@ -7804,11 +7827,11 @@ function GridPinnedRows(props) {
|
|
|
7804
7827
|
</Show24>
|
|
7805
7828
|
<For12 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7806
7829
|
{(entry) => {
|
|
7807
|
-
const unbound =
|
|
7830
|
+
const unbound = createMemo25(() => entry().column);
|
|
7808
7831
|
const column = () => unbound();
|
|
7809
|
-
const value =
|
|
7810
|
-
const colIndex =
|
|
7811
|
-
const ctx =
|
|
7832
|
+
const value = createMemo25(() => getCellValue5(row(), unbound()));
|
|
7833
|
+
const colIndex = createMemo25(() => entry().logicalIndex);
|
|
7834
|
+
const ctx = createMemo25(
|
|
7812
7835
|
() => ({
|
|
7813
7836
|
row: row(),
|
|
7814
7837
|
rowIndex: index,
|
|
@@ -7824,19 +7847,19 @@ function GridPinnedRows(props) {
|
|
|
7824
7847
|
pinned: props.position
|
|
7825
7848
|
})
|
|
7826
7849
|
);
|
|
7827
|
-
const cellSlot =
|
|
7850
|
+
const cellSlot = createMemo25(() => {
|
|
7828
7851
|
const cellClassName = column().cellClassName;
|
|
7829
7852
|
return resolveSlotProps3(
|
|
7830
7853
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
7831
7854
|
);
|
|
7832
7855
|
});
|
|
7833
7856
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
7834
|
-
const dataBar =
|
|
7857
|
+
const dataBar = createMemo25(() => {
|
|
7835
7858
|
const feature = props.conditionalFormat;
|
|
7836
7859
|
const format = rules()?.dataBar;
|
|
7837
7860
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
7838
7861
|
});
|
|
7839
|
-
const scaleBackground =
|
|
7862
|
+
const scaleBackground = createMemo25(() => {
|
|
7840
7863
|
const feature = props.conditionalFormat;
|
|
7841
7864
|
const format = rules()?.colorScale;
|
|
7842
7865
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -7846,7 +7869,7 @@ function GridPinnedRows(props) {
|
|
|
7846
7869
|
const format = rules()?.dataBar;
|
|
7847
7870
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
7848
7871
|
};
|
|
7849
|
-
const content =
|
|
7872
|
+
const content = createMemo25(() => {
|
|
7850
7873
|
const current = column();
|
|
7851
7874
|
if (isSyntheticColumnKey3(current.key)) {
|
|
7852
7875
|
return null;
|
|
@@ -7940,81 +7963,28 @@ var pinnedRowsFeature = {
|
|
|
7940
7963
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7941
7964
|
|
|
7942
7965
|
// src/primitives/rowDrag.ts
|
|
7943
|
-
import { createEffect as
|
|
7966
|
+
import { createEffect as createEffect8, createMemo as createMemo26, untrack as untrack18 } from "solid-js";
|
|
7944
7967
|
import {
|
|
7945
7968
|
createRowDragController
|
|
7946
7969
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
7947
|
-
import {
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7970
|
+
import {
|
|
7971
|
+
createRowDropCheck,
|
|
7972
|
+
getDragRowToken,
|
|
7973
|
+
locateDragRowToken,
|
|
7974
|
+
resolveRowDragLabel
|
|
7975
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowDragTarget";
|
|
7951
7976
|
function createRowDrag(inputs) {
|
|
7952
7977
|
const controller = createRowDragController();
|
|
7953
7978
|
const leftIndicatorRef = { current: null };
|
|
7954
7979
|
const centerIndicatorRef = { current: null };
|
|
7955
7980
|
const rightIndicatorRef = { current: null };
|
|
7956
|
-
const canDropAt =
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
}
|
|
7961
|
-
const rows = inputs.rows();
|
|
7962
|
-
const resolveRowKey = inputs.resolveRowKey();
|
|
7963
|
-
return (fromIndex, slot) => {
|
|
7964
|
-
const toIndex = resolveMoveTargetIndex(fromIndex, slot);
|
|
7965
|
-
const row = rows[fromIndex];
|
|
7966
|
-
if (toIndex === null || row === void 0) return false;
|
|
7967
|
-
return canDropRow({
|
|
7968
|
-
row,
|
|
7969
|
-
rowKey: resolveRowKey(row, fromIndex),
|
|
7970
|
-
fromIndex,
|
|
7971
|
-
toIndex,
|
|
7972
|
-
rowAbove: slot > 0 ? rows[slot - 1] : void 0,
|
|
7973
|
-
rowBelow: slot < rows.length ? rows[slot] : void 0,
|
|
7974
|
-
rows
|
|
7975
|
-
});
|
|
7976
|
-
};
|
|
7977
|
-
});
|
|
7978
|
-
const getRowDragLabel = (viewIndex) => {
|
|
7979
|
-
const fallback = formatLocaleText13(untrack19(inputs.dragRowLabel), { row: viewIndex + 1 });
|
|
7980
|
-
const row = untrack19(inputs.rowModel).getRow(viewIndex);
|
|
7981
|
-
if (!row) {
|
|
7982
|
-
return fallback;
|
|
7983
|
-
}
|
|
7984
|
-
const column = untrack19(inputs.visibleColumns).find(
|
|
7985
|
-
(candidate) => !isSyntheticColumnKey4(candidate.key) && (candidate.renderCell === void 0 || candidate.valueFormatter !== void 0) && candidate.editor?.type !== "checkbox" && candidate.conditionalFormat?.dataBar?.showValue !== false
|
|
7986
|
-
);
|
|
7987
|
-
if (!column) {
|
|
7988
|
-
return fallback;
|
|
7989
|
-
}
|
|
7990
|
-
const value = getCellValue7(row, column);
|
|
7991
|
-
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
7992
|
-
return text.trim().length > 0 ? text : fallback;
|
|
7993
|
-
};
|
|
7994
|
-
const getDragRow = (viewIndex) => {
|
|
7995
|
-
const rowModel = untrack19(inputs.rowModel);
|
|
7996
|
-
const row = rowModel.getRow(viewIndex);
|
|
7997
|
-
if (row === void 0) return null;
|
|
7998
|
-
return { row, rowKey: rowModel.getRowKey(viewIndex), rowCount: rowModel.getRowCount() };
|
|
7999
|
-
};
|
|
8000
|
-
const locateDragRow = createMemo25(() => {
|
|
7981
|
+
const canDropAt = createMemo26(() => createRowDropCheck(inputs.canDropRow(), inputs.rows(), inputs.resolveRowKey()));
|
|
7982
|
+
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(untrack18(inputs.rowModel), untrack18(inputs.visibleColumns), viewIndex, untrack18(inputs.dragRowLabel));
|
|
7983
|
+
const getDragRow = (viewIndex) => getDragRowToken(untrack18(inputs.rowModel), viewIndex);
|
|
7984
|
+
const locateDragRow = createMemo26(() => {
|
|
8001
7985
|
const rowModel = inputs.rowModel();
|
|
8002
7986
|
const hasRowKeys = inputs.hasRowKeys();
|
|
8003
|
-
return (token, hint) =>
|
|
8004
|
-
const { row, rowKey, rowCount } = token;
|
|
8005
|
-
if (rowModel.getRow(hint) === row) return hint;
|
|
8006
|
-
const count = rowModel.getRowCount();
|
|
8007
|
-
for (let index = 0; index < count; index += 1) {
|
|
8008
|
-
if (rowModel.getRow(index) === row) return index;
|
|
8009
|
-
}
|
|
8010
|
-
if (hasRowKeys) {
|
|
8011
|
-
for (let index = 0; index < count; index += 1) {
|
|
8012
|
-
if (Object.is(rowModel.getRowKey(index), rowKey)) return index;
|
|
8013
|
-
}
|
|
8014
|
-
return null;
|
|
8015
|
-
}
|
|
8016
|
-
return count === rowCount && hint < rowCount ? hint : null;
|
|
8017
|
-
};
|
|
7987
|
+
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
8018
7988
|
});
|
|
8019
7989
|
connectController(
|
|
8020
7990
|
controller,
|
|
@@ -8031,7 +8001,7 @@ function createRowDrag(inputs) {
|
|
|
8031
8001
|
"effect",
|
|
8032
8002
|
"rowDrag"
|
|
8033
8003
|
);
|
|
8034
|
-
|
|
8004
|
+
createEffect8(inputs.rowModel, () => {
|
|
8035
8005
|
controller.applyReorderSettle();
|
|
8036
8006
|
}, { name: "rowDragSettle" });
|
|
8037
8007
|
return {
|
|
@@ -8085,9 +8055,9 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8085
8055
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8086
8056
|
|
|
8087
8057
|
// src/view/GridScrollHint.tsx
|
|
8088
|
-
import { For as For13, Show as Show25, createMemo as
|
|
8058
|
+
import { For as For13, Show as Show25, createMemo as createMemo27, createSignal as createSignal15, createEffect as createEffect9 } from "solid-js";
|
|
8089
8059
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8090
|
-
import { resolveDataRowNumber as
|
|
8060
|
+
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8091
8061
|
import {
|
|
8092
8062
|
computeScrollHintRulerTicks,
|
|
8093
8063
|
computeScrollHintTrack,
|
|
@@ -8111,10 +8081,10 @@ function GridScrollHint(props) {
|
|
|
8111
8081
|
let lingerTimer = null;
|
|
8112
8082
|
let dragGrab = null;
|
|
8113
8083
|
let gutter;
|
|
8114
|
-
const scrollbar =
|
|
8084
|
+
const scrollbar = createMemo27(() => props.options.scrollbar);
|
|
8115
8085
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8116
8086
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8117
|
-
const track =
|
|
8087
|
+
const track = createMemo27(
|
|
8118
8088
|
() => computeScrollHintTrack({
|
|
8119
8089
|
scrollTop: props.scrollTop,
|
|
8120
8090
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8122,8 +8092,8 @@ function GridScrollHint(props) {
|
|
|
8122
8092
|
trackHeight: trackHeight()
|
|
8123
8093
|
})
|
|
8124
8094
|
);
|
|
8125
|
-
const shown =
|
|
8126
|
-
|
|
8095
|
+
const shown = createMemo27(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8096
|
+
createEffect9(scrollbar, (customScrollbar) => {
|
|
8127
8097
|
const element = props.scrollContainerRef.current;
|
|
8128
8098
|
if (!element) {
|
|
8129
8099
|
return void 0;
|
|
@@ -8172,7 +8142,7 @@ function GridScrollHint(props) {
|
|
|
8172
8142
|
}
|
|
8173
8143
|
};
|
|
8174
8144
|
}, { name: "scrollHintListeners" });
|
|
8175
|
-
|
|
8145
|
+
createEffect9(
|
|
8176
8146
|
() => scrollbar() && shown(),
|
|
8177
8147
|
(on) => {
|
|
8178
8148
|
const element = props.scrollContainerRef.current;
|
|
@@ -8191,12 +8161,12 @@ function GridScrollHint(props) {
|
|
|
8191
8161
|
);
|
|
8192
8162
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8193
8163
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8194
|
-
const dataRowCount =
|
|
8164
|
+
const dataRowCount = createMemo27(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8195
8165
|
const rowNumberOf = (viewIndex) => {
|
|
8196
8166
|
const labels = props.labelViewIndexes;
|
|
8197
|
-
return labels && labels.length > 0 ?
|
|
8167
|
+
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8198
8168
|
};
|
|
8199
|
-
const rulerTicks =
|
|
8169
|
+
const rulerTicks = createMemo27(
|
|
8200
8170
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8201
8171
|
rowCount: dataRowCount(),
|
|
8202
8172
|
rulerHeight: rulerHeight(),
|
|
@@ -8206,7 +8176,7 @@ function GridScrollHint(props) {
|
|
|
8206
8176
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8207
8177
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8208
8178
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8209
|
-
const topRowIndex =
|
|
8179
|
+
const topRowIndex = createMemo27(() => {
|
|
8210
8180
|
const current = track();
|
|
8211
8181
|
if (current === null) {
|
|
8212
8182
|
return 0;
|
|
@@ -8221,8 +8191,8 @@ function GridScrollHint(props) {
|
|
|
8221
8191
|
rowIndex,
|
|
8222
8192
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8223
8193
|
});
|
|
8224
|
-
const detail =
|
|
8225
|
-
const jumpPreview =
|
|
8194
|
+
const detail = createMemo27(() => detailOf(topRowIndex()));
|
|
8195
|
+
const jumpPreview = createMemo27(() => {
|
|
8226
8196
|
const pointerY = trackPointerY();
|
|
8227
8197
|
const current = track();
|
|
8228
8198
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8385,7 +8355,7 @@ var scrollHintFeature = {
|
|
|
8385
8355
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8386
8356
|
|
|
8387
8357
|
// src/primitives/selectionAggregates.ts
|
|
8388
|
-
import { createMemo as
|
|
8358
|
+
import { createMemo as createMemo28 } from "solid-js";
|
|
8389
8359
|
import {
|
|
8390
8360
|
createSelectionAggregatesRunner,
|
|
8391
8361
|
resolveSyncSelectionAggregates,
|
|
@@ -8397,15 +8367,15 @@ import {
|
|
|
8397
8367
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8398
8368
|
function createSelectionAggregates(args) {
|
|
8399
8369
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8400
|
-
const target =
|
|
8370
|
+
const target = createMemo28(() => {
|
|
8401
8371
|
const current = args();
|
|
8402
8372
|
return stabilizeTarget(
|
|
8403
8373
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8404
8374
|
);
|
|
8405
8375
|
});
|
|
8406
|
-
const rowModel =
|
|
8407
|
-
const key =
|
|
8408
|
-
const syncResult =
|
|
8376
|
+
const rowModel = createMemo28(() => args().rowModel);
|
|
8377
|
+
const key = createMemo28(() => ({ rowModel: rowModel(), target: target() }));
|
|
8378
|
+
const syncResult = createMemo28(() => resolveSyncSelectionAggregates(key()));
|
|
8409
8379
|
const runner = createSelectionAggregatesRunner();
|
|
8410
8380
|
connectController(
|
|
8411
8381
|
runner,
|
|
@@ -8414,16 +8384,16 @@ function createSelectionAggregates(args) {
|
|
|
8414
8384
|
"selectionAggregates"
|
|
8415
8385
|
);
|
|
8416
8386
|
const snapshot = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8417
|
-
return
|
|
8387
|
+
return createMemo28(() => selectSelectionAggregatesResult(syncResult(), snapshot(), key()));
|
|
8418
8388
|
}
|
|
8419
8389
|
|
|
8420
8390
|
// src/view/GridSelectionAggregates.tsx
|
|
8421
|
-
import { For as For14, Show as Show26, createMemo as
|
|
8391
|
+
import { For as For14, Show as Show26, createMemo as createMemo29 } from "solid-js";
|
|
8422
8392
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8423
8393
|
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8424
8394
|
function GridSelectionAggregates(props) {
|
|
8425
8395
|
const texts = useFeatureLocaleText();
|
|
8426
|
-
const chips =
|
|
8396
|
+
const chips = createMemo29(() => {
|
|
8427
8397
|
const aggregates = props.aggregates;
|
|
8428
8398
|
if (!aggregates) {
|
|
8429
8399
|
return null;
|
|
@@ -8492,7 +8462,7 @@ var selectionAggregatesFeature = {
|
|
|
8492
8462
|
};
|
|
8493
8463
|
|
|
8494
8464
|
// src/primitives/toolPanel.ts
|
|
8495
|
-
import { createMemo as
|
|
8465
|
+
import { createMemo as createMemo30 } from "solid-js";
|
|
8496
8466
|
import {
|
|
8497
8467
|
createToolPanelController,
|
|
8498
8468
|
resolveActiveToolPanelTab,
|
|
@@ -8511,7 +8481,7 @@ function createToolPanel(inputs) {
|
|
|
8511
8481
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8512
8482
|
}), "render", "toolPanel");
|
|
8513
8483
|
const snapshot = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8514
|
-
const availableTabs =
|
|
8484
|
+
const availableTabs = createMemo30(
|
|
8515
8485
|
() => resolveAvailableToolPanelTabs({
|
|
8516
8486
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8517
8487
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8520,10 +8490,10 @@ function createToolPanel(inputs) {
|
|
|
8520
8490
|
{ equals: sameTabs }
|
|
8521
8491
|
);
|
|
8522
8492
|
return {
|
|
8523
|
-
activeTab:
|
|
8493
|
+
activeTab: createMemo30(() => resolveActiveToolPanelTab(snapshot().requestedTab, availableTabs())),
|
|
8524
8494
|
availableTabs,
|
|
8525
|
-
layout:
|
|
8526
|
-
flashTick:
|
|
8495
|
+
layout: createMemo30(() => snapshot().layout),
|
|
8496
|
+
flashTick: createMemo30(() => snapshot().flashTick),
|
|
8527
8497
|
panelRef: controller.panelRef,
|
|
8528
8498
|
open: controller.open,
|
|
8529
8499
|
close: controller.close,
|
|
@@ -8547,7 +8517,7 @@ import {
|
|
|
8547
8517
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8548
8518
|
|
|
8549
8519
|
// src/view/GridTotalRow.tsx
|
|
8550
|
-
import { For as For15, Show as Show27, createMemo as
|
|
8520
|
+
import { For as For15, Show as Show27, createMemo as createMemo31 } from "solid-js";
|
|
8551
8521
|
import {
|
|
8552
8522
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8553
8523
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8592,10 +8562,10 @@ function GridTotalRow(props) {
|
|
|
8592
8562
|
</Show27>
|
|
8593
8563
|
<For15 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8594
8564
|
{(entry) => {
|
|
8595
|
-
const unbound =
|
|
8565
|
+
const unbound = createMemo31(() => entry().column);
|
|
8596
8566
|
const cell = () => props.cells.get(unbound().key);
|
|
8597
8567
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8598
|
-
const content =
|
|
8568
|
+
const content = createMemo31(() => {
|
|
8599
8569
|
const total = cell();
|
|
8600
8570
|
if (total) {
|
|
8601
8571
|
const column = unbound();
|