@ishibashi0112/spreadsheet-grid-solid 0.1.1 → 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 +25 -9
- package/dist/ColumnFilterPopover-CzSRfcDF.js +1426 -0
- package/dist/columnVirtualizer-Bv79_vW1.js +186 -0
- package/dist/createSpreadsheetGrid.d.ts +14 -0
- package/dist/editors/CellEditorLayer.d.ts +1 -0
- package/dist/editors/DateCellEditor.d.ts +1 -0
- package/dist/editors/NumberCellEditor.d.ts +1 -0
- package/dist/editors/SelectCellEditor.d.ts +3 -1
- package/dist/editors/TextCellEditor.d.ts +1 -0
- package/dist/features/contextMenu.d.ts +0 -14
- package/dist/features/types.d.ts +1 -1
- package/dist/index.js +2574 -2709
- 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 +318 -524
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BE4gv_L0.js → toolPanelViews-BISN9iaG.js} +120 -119
- package/dist/view/DetailToggleButton.d.ts +1 -0
- package/package.json +7 -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,7 @@ 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";
|
|
28
33
|
import { isServer } from "@solidjs/web";
|
|
29
34
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
30
35
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
@@ -54,7 +59,7 @@ import { resolveGridThemeClassName } from "@ishibashi0112/spreadsheet-grid-core/
|
|
|
54
59
|
import { MOTION_OFF_CLASS_NAME, resolveGridMotion } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/motion";
|
|
55
60
|
import { systemColorSchemeStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/systemColorSchemeStore";
|
|
56
61
|
import { reducedMotionStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/reducedMotionStore";
|
|
57
|
-
import { createLocaleTextResolver, formatLocaleText as
|
|
62
|
+
import { createLocaleTextResolver, formatLocaleText as formatLocaleText6 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
58
63
|
import { EMPTY_TOTAL_ROW_CELLS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
59
64
|
import {
|
|
60
65
|
resolveSlotFromSignature,
|
|
@@ -75,12 +80,14 @@ import {
|
|
|
75
80
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
76
81
|
import {
|
|
77
82
|
DEFAULT_DETAIL_ROW_HEIGHT,
|
|
83
|
+
DETAIL_TOGGLE_COLUMN_KEY as DETAIL_TOGGLE_COLUMN_KEY2,
|
|
78
84
|
isControlColumnKey,
|
|
79
85
|
isDetailRowExpandable,
|
|
80
86
|
isInsideDetailCardOf,
|
|
81
87
|
isSyntheticColumnKey as isSyntheticColumnKey2,
|
|
82
88
|
resolveFirstDataColIndex
|
|
83
89
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
90
|
+
import { resolveDataRowNumber as resolveDataRowNumber2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
84
91
|
import {
|
|
85
92
|
createSelectedRowsInOrderCounter,
|
|
86
93
|
getSelectAllState,
|
|
@@ -121,95 +128,6 @@ import {
|
|
|
121
128
|
isEscapeClaimedByGrid
|
|
122
129
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
|
|
123
130
|
|
|
124
|
-
// src/primitives/userCallback.ts
|
|
125
|
-
import { flush, getOwner, isDisposed } from "solid-js";
|
|
126
|
-
var gridUpdateDepth = 0;
|
|
127
|
-
var handleCallDepth = 0;
|
|
128
|
-
var isolatingDepth = 0;
|
|
129
|
-
var pendingReplays = /* @__PURE__ */ new Set();
|
|
130
|
-
function runGridUpdate(fn) {
|
|
131
|
-
gridUpdateDepth++;
|
|
132
|
-
try {
|
|
133
|
-
return fn();
|
|
134
|
-
} finally {
|
|
135
|
-
gridUpdateDepth--;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
function runHandleCall(fn) {
|
|
139
|
-
handleCallDepth++;
|
|
140
|
-
try {
|
|
141
|
-
return fn();
|
|
142
|
-
} finally {
|
|
143
|
-
handleCallDepth--;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function isIsolatingFlush() {
|
|
147
|
-
return isolatingDepth > 0;
|
|
148
|
-
}
|
|
149
|
-
function deferControllerUpdate(replay) {
|
|
150
|
-
pendingReplays.add(replay);
|
|
151
|
-
}
|
|
152
|
-
var flushQuietly = () => {
|
|
153
|
-
try {
|
|
154
|
-
flush();
|
|
155
|
-
} catch {
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var isolatedFlush = () => {
|
|
159
|
-
isolatingDepth++;
|
|
160
|
-
try {
|
|
161
|
-
flushQuietly();
|
|
162
|
-
} finally {
|
|
163
|
-
isolatingDepth--;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
var releaseReplays = () => {
|
|
167
|
-
if (pendingReplays.size === 0) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const replays = Array.from(pendingReplays);
|
|
171
|
-
pendingReplays.clear();
|
|
172
|
-
for (const replay of replays) {
|
|
173
|
-
replay();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
function callInOwnFrame(fn, ...args) {
|
|
177
|
-
if (handleCallDepth > 0 || gridUpdateDepth > 0 || getOwner() !== null) {
|
|
178
|
-
return fn(...args);
|
|
179
|
-
}
|
|
180
|
-
isolatedFlush();
|
|
181
|
-
try {
|
|
182
|
-
return fn(...args);
|
|
183
|
-
} finally {
|
|
184
|
-
isolatedFlush();
|
|
185
|
-
releaseReplays();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function createUserCallbacks() {
|
|
189
|
-
const owner = getOwner();
|
|
190
|
-
const call = (fn, ...args) => {
|
|
191
|
-
if (handleCallDepth > 0 || gridUpdateDepth === 0 && getOwner() !== null) {
|
|
192
|
-
return fn(...args);
|
|
193
|
-
}
|
|
194
|
-
if (gridUpdateDepth > 0) {
|
|
195
|
-
queueMicrotask(() => {
|
|
196
|
-
if (owner && isDisposed(owner)) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
flushQuietly();
|
|
200
|
-
fn(...args);
|
|
201
|
-
flushQuietly();
|
|
202
|
-
});
|
|
203
|
-
return void 0;
|
|
204
|
-
}
|
|
205
|
-
return callInOwnFrame(fn, ...args);
|
|
206
|
-
};
|
|
207
|
-
return {
|
|
208
|
-
call,
|
|
209
|
-
wrap: (fn) => fn ? (...args) => call(fn, ...args) : void 0
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
131
|
// src/primitives/gridStoreSignals.ts
|
|
214
132
|
import { createSignal } from "solid-js";
|
|
215
133
|
function createGridStoreSignals(store) {
|
|
@@ -226,18 +144,6 @@ function createGridStoreSignals(store) {
|
|
|
226
144
|
return { state, view };
|
|
227
145
|
}
|
|
228
146
|
|
|
229
|
-
// src/primitives/externalStore.ts
|
|
230
|
-
import { createSignal as createSignal2, isHydrating } from "solid-js";
|
|
231
|
-
function createExternalStoreSignal(store, name) {
|
|
232
|
-
const initial = isHydrating() && store.getServerSnapshot ? store.getServerSnapshot() : store.getSnapshot();
|
|
233
|
-
const [value, setValue] = createSignal2(initial, name === void 0 ? void 0 : { name });
|
|
234
|
-
onGridMounted(() => {
|
|
235
|
-
setValue(() => store.getSnapshot());
|
|
236
|
-
return store.subscribe(() => setValue(() => store.getSnapshot()));
|
|
237
|
-
});
|
|
238
|
-
return value;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
147
|
// src/primitives/viewSetters.ts
|
|
242
148
|
import {
|
|
243
149
|
resolveUpdater
|
|
@@ -262,48 +168,6 @@ function createGridViewSetters(store) {
|
|
|
262
168
|
};
|
|
263
169
|
}
|
|
264
170
|
|
|
265
|
-
// src/primitives/controller.ts
|
|
266
|
-
import { createEffect, createRenderEffect, createSignal as createSignal3, untrack } from "solid-js";
|
|
267
|
-
function connectController(controller, args, timing = "render", name) {
|
|
268
|
-
let mounted = false;
|
|
269
|
-
let latest2 = null;
|
|
270
|
-
const [replay, setReplay] = createSignal3(0, name === void 0 ? void 0 : { name: `${name}Replay` });
|
|
271
|
-
const requestReplay = () => {
|
|
272
|
-
setReplay((value) => value + 1);
|
|
273
|
-
};
|
|
274
|
-
const run = (value) => {
|
|
275
|
-
runGridUpdate(() => untrack(() => controller.update(value)));
|
|
276
|
-
};
|
|
277
|
-
const apply = (next) => {
|
|
278
|
-
latest2 = { value: next };
|
|
279
|
-
if (!mounted) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (isIsolatingFlush()) {
|
|
283
|
-
deferControllerUpdate(requestReplay);
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
run(next);
|
|
287
|
-
};
|
|
288
|
-
const compute = () => {
|
|
289
|
-
replay();
|
|
290
|
-
return args();
|
|
291
|
-
};
|
|
292
|
-
const options = name === void 0 ? void 0 : { name };
|
|
293
|
-
if (timing === "render") {
|
|
294
|
-
createRenderEffect(compute, apply, options);
|
|
295
|
-
} else {
|
|
296
|
-
createEffect(compute, apply, options);
|
|
297
|
-
}
|
|
298
|
-
onGridMounted(() => {
|
|
299
|
-
mounted = true;
|
|
300
|
-
if (latest2) {
|
|
301
|
-
run(latest2.value);
|
|
302
|
-
}
|
|
303
|
-
return () => controller.dispose?.();
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
171
|
// src/primitives/liveObject.ts
|
|
308
172
|
import { createMemo } from "solid-js";
|
|
309
173
|
function createLiveObject(keys, read) {
|
|
@@ -327,7 +191,7 @@ import {
|
|
|
327
191
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
328
192
|
import { ROW_DRAG_HANDLE_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowReorder";
|
|
329
193
|
import { formatLocaleText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
330
|
-
import { isFromRenderHeaderControl } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
194
|
+
import { isFromRenderHeaderControl, syncRenderHeaderControlHover } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
331
195
|
|
|
332
196
|
// src/view/RowSelectionCheckbox.tsx
|
|
333
197
|
function RowSelectionCheckbox(props) {
|
|
@@ -434,7 +298,13 @@ function GridHeaderRow(props) {
|
|
|
434
298
|
props.onColumnHeaderPointerDown(colIndex(), event);
|
|
435
299
|
}}
|
|
436
300
|
onPointerEnter={(event) => props.onColumnHeaderPointerEnter(colIndex(), event)}
|
|
437
|
-
|
|
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
|
+
}}
|
|
438
308
|
onContextMenu={(event) => {
|
|
439
309
|
if (isSynthetic()) {
|
|
440
310
|
event.preventDefault();
|
|
@@ -468,7 +338,12 @@ function GridHeaderRow(props) {
|
|
|
468
338
|
]}
|
|
469
339
|
data-ssg-tooltip={column().renderHeader || isDetailToggleColumn() ? void 0 : column().title || column().key}
|
|
470
340
|
>
|
|
471
|
-
{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}
|
|
472
347
|
</div>
|
|
473
348
|
<div class="ssg-header-status">
|
|
474
349
|
<Show when={sortEntry()}>
|
|
@@ -549,7 +424,7 @@ function GridHeaderRow(props) {
|
|
|
549
424
|
}
|
|
550
425
|
|
|
551
426
|
// src/view/GridBodyLayer.tsx
|
|
552
|
-
import { For as For2, Show as Show2, createMemo as createMemo4, untrack as
|
|
427
|
+
import { For as For2, Show as Show2, createMemo as createMemo4, untrack as untrack2 } from "solid-js";
|
|
553
428
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
554
429
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
555
430
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -560,13 +435,13 @@ import { resolveSlotProps } from "@ishibashi0112/spreadsheet-grid-core/internal/
|
|
|
560
435
|
import { formatLocaleText as formatLocaleText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
561
436
|
|
|
562
437
|
// src/primitives/memoWhen.ts
|
|
563
|
-
import { createMemo as createMemo3, getOwner
|
|
438
|
+
import { createMemo as createMemo3, getOwner, isDisposed, runWithOwner, untrack } from "solid-js";
|
|
564
439
|
function createMemoWhen(needed, compute, empty) {
|
|
565
440
|
const guarded = () => needed() ? compute() : empty;
|
|
566
|
-
if (
|
|
441
|
+
if (untrack(needed)) {
|
|
567
442
|
return createMemo3(guarded);
|
|
568
443
|
}
|
|
569
|
-
const owner =
|
|
444
|
+
const owner = getOwner();
|
|
570
445
|
let memo;
|
|
571
446
|
return () => {
|
|
572
447
|
if (memo) {
|
|
@@ -575,7 +450,7 @@ function createMemoWhen(needed, compute, empty) {
|
|
|
575
450
|
if (!needed()) {
|
|
576
451
|
return empty;
|
|
577
452
|
}
|
|
578
|
-
if (!owner ||
|
|
453
|
+
if (!owner || isDisposed(owner)) {
|
|
579
454
|
return compute();
|
|
580
455
|
}
|
|
581
456
|
memo = runWithOwner(owner, () => createMemo3(guarded));
|
|
@@ -598,7 +473,7 @@ function GridBodyLayer(props) {
|
|
|
598
473
|
return <For2 each={props.rows} keyed={(item) => item.key}>
|
|
599
474
|
{(item) => {
|
|
600
475
|
const rowIndex = createMemo4(() => item().index);
|
|
601
|
-
const SkeletonRow =
|
|
476
|
+
const SkeletonRow = untrack2(() => item().skeleton ? props.skeletonRow : void 0);
|
|
602
477
|
if (SkeletonRow) {
|
|
603
478
|
return <SkeletonRow
|
|
604
479
|
pane={props.pane}
|
|
@@ -628,7 +503,7 @@ function GridBodyLayer(props) {
|
|
|
628
503
|
return <>
|
|
629
504
|
<Show2 when={groupRow()}>
|
|
630
505
|
{(group) => {
|
|
631
|
-
const GroupRow =
|
|
506
|
+
const GroupRow = untrack2(() => props.grouping)?.BodyGroupRow;
|
|
632
507
|
return GroupRow ? <GroupRow
|
|
633
508
|
pane={props.pane}
|
|
634
509
|
ownsRowHeader={props.ownsRowHeader}
|
|
@@ -655,7 +530,7 @@ function GridBodyLayer(props) {
|
|
|
655
530
|
<Show2 when={labelRow()}>
|
|
656
531
|
{(label) => {
|
|
657
532
|
const layer = () => props.labelRowLayer;
|
|
658
|
-
const LabelRow =
|
|
533
|
+
const LabelRow = untrack2(layer)?.Row;
|
|
659
534
|
const labelSlot = createMemo4(() => resolveSlotProps(layer()?.resolveRowSlot(label())));
|
|
660
535
|
const labelRowKey = createMemo4(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
661
536
|
return LabelRow ? <LabelRow
|
|
@@ -810,7 +685,7 @@ function GridBodyLayer(props) {
|
|
|
810
685
|
() => rowFindHits()?.get(colIndex()),
|
|
811
686
|
void 0
|
|
812
687
|
);
|
|
813
|
-
const cellRowKey =
|
|
688
|
+
const cellRowKey = untrack2(rowKey);
|
|
814
689
|
const cellState = {
|
|
815
690
|
get rowIndex() {
|
|
816
691
|
return rowIndex();
|
|
@@ -1035,7 +910,7 @@ function Overlay(props) {
|
|
|
1035
910
|
}
|
|
1036
911
|
|
|
1037
912
|
// src/view/GridDetailLayer.tsx
|
|
1038
|
-
import { For as For3, Show as Show4, createMemo as createMemo5, onCleanup, untrack as
|
|
913
|
+
import { For as For3, Show as Show4, createMemo as createMemo5, onCleanup, untrack as untrack3 } from "solid-js";
|
|
1039
914
|
import { notifyDetailCardFocusLost } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/detailRowController";
|
|
1040
915
|
var stopPropagation = (event) => {
|
|
1041
916
|
event.stopPropagation();
|
|
@@ -1074,7 +949,7 @@ function GridDetailLayer(props) {
|
|
|
1074
949
|
}
|
|
1075
950
|
function DetailCard(props) {
|
|
1076
951
|
const layer = props.layer;
|
|
1077
|
-
const rowKey =
|
|
952
|
+
const rowKey = untrack3(() => props.entry().rowKey);
|
|
1078
953
|
const row = createMemo5(() => layer.rowModel.getRow(props.index()));
|
|
1079
954
|
const sourceRowIndex = createMemo5(() => layer.rowModel.getSourceIndex(props.index()) ?? props.index());
|
|
1080
955
|
const ctx = {
|
|
@@ -1088,7 +963,7 @@ function DetailCard(props) {
|
|
|
1088
963
|
get sourceRowIndex() {
|
|
1089
964
|
return sourceRowIndex();
|
|
1090
965
|
},
|
|
1091
|
-
collapse: () => layer.onCollapse?.(rowKey,
|
|
966
|
+
collapse: () => layer.onCollapse?.(rowKey, untrack3(props.index))
|
|
1092
967
|
};
|
|
1093
968
|
let card;
|
|
1094
969
|
onCleanup(() => notifyDetailCardFocusLost(card ?? null, layer.onCardFocusLost));
|
|
@@ -1105,7 +980,7 @@ function DetailCard(props) {
|
|
|
1105
980
|
style={mergeSlotStyles(layer.slots.detailCard?.style, layer.cardSlot?.style)}
|
|
1106
981
|
data-ssg-detail=""
|
|
1107
982
|
onKeyDown={(event) => {
|
|
1108
|
-
layer.onCardKeyDown?.(event, event.currentTarget,
|
|
983
|
+
layer.onCardKeyDown?.(event, event.currentTarget, untrack3(props.index));
|
|
1109
984
|
event.stopPropagation();
|
|
1110
985
|
}}
|
|
1111
986
|
onKeyUp={stopPropagation}
|
|
@@ -1122,6 +997,7 @@ function DetailCard(props) {
|
|
|
1122
997
|
}
|
|
1123
998
|
|
|
1124
999
|
// src/view/DetailToggleButton.tsx
|
|
1000
|
+
import { formatLocaleText as formatLocaleText3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1125
1001
|
function DetailToggleButton(props) {
|
|
1126
1002
|
const texts = useGridLocaleText();
|
|
1127
1003
|
return <button
|
|
@@ -1129,7 +1005,9 @@ function DetailToggleButton(props) {
|
|
|
1129
1005
|
tabindex={-1}
|
|
1130
1006
|
class="ssg-detail-toggle"
|
|
1131
1007
|
aria-expanded={props.detail.expanded ? "true" : "false"}
|
|
1132
|
-
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
|
+
})}
|
|
1133
1011
|
onClick={() => props.detail.toggle()}
|
|
1134
1012
|
onPointerDown={(event) => {
|
|
1135
1013
|
if (event.button !== 0) {
|
|
@@ -1164,13 +1042,13 @@ function CheckboxCell(props) {
|
|
|
1164
1042
|
}
|
|
1165
1043
|
|
|
1166
1044
|
// src/editors/CellEditorLayer.tsx
|
|
1167
|
-
import { Show as Show8, createMemo as createMemo6, untrack as
|
|
1045
|
+
import { Show as Show8, createMemo as createMemo6, untrack as untrack10 } from "solid-js";
|
|
1168
1046
|
import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
1169
1047
|
import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1170
|
-
import { formatLocaleText as
|
|
1048
|
+
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1171
1049
|
|
|
1172
1050
|
// src/editors/TextCellEditor.tsx
|
|
1173
|
-
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";
|
|
1174
1052
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1175
1053
|
import {
|
|
1176
1054
|
fitMultilineEditor,
|
|
@@ -1180,7 +1058,7 @@ import {
|
|
|
1180
1058
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1181
1059
|
|
|
1182
1060
|
// src/primitives/topAlignedInput.ts
|
|
1183
|
-
import { createRenderEffect
|
|
1061
|
+
import { createRenderEffect, onSettled, untrack as untrack4 } from "solid-js";
|
|
1184
1062
|
import {
|
|
1185
1063
|
alignInputTextToTop,
|
|
1186
1064
|
resolveHiddenTopOf
|
|
@@ -1192,12 +1070,12 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1192
1070
|
}
|
|
1193
1071
|
};
|
|
1194
1072
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1195
|
-
|
|
1196
|
-
onSettled(() => apply(
|
|
1073
|
+
createRenderEffect(read, apply, { name: "topAlignedInput" });
|
|
1074
|
+
onSettled(() => apply(untrack4(read)));
|
|
1197
1075
|
}
|
|
1198
1076
|
|
|
1199
1077
|
// src/editors/CellEditorErrorBubble.tsx
|
|
1200
|
-
import { Show as Show5, createSignal as
|
|
1078
|
+
import { Show as Show5, createSignal as createSignal2, onSettled as onSettled2 } from "solid-js";
|
|
1201
1079
|
import {
|
|
1202
1080
|
DEFAULT_ERROR_BUBBLE_PLACEMENT,
|
|
1203
1081
|
ERROR_BUBBLE_ABOVE_CLASS,
|
|
@@ -1210,7 +1088,7 @@ function CellEditorError(props) {
|
|
|
1210
1088
|
}
|
|
1211
1089
|
function CellEditorErrorBubble(props) {
|
|
1212
1090
|
let element;
|
|
1213
|
-
const [placement2, setPlacement] =
|
|
1091
|
+
const [placement2, setPlacement] = createSignal2(DEFAULT_ERROR_BUBBLE_PLACEMENT);
|
|
1214
1092
|
onSettled2(() => {
|
|
1215
1093
|
if (element) {
|
|
1216
1094
|
setPlacement(placeErrorBubble(element));
|
|
@@ -1234,11 +1112,11 @@ function CellEditorErrorBubble(props) {
|
|
|
1234
1112
|
|
|
1235
1113
|
// src/editors/TextCellEditor.tsx
|
|
1236
1114
|
function TextCellEditor(props) {
|
|
1237
|
-
const [input, setInput] =
|
|
1238
|
-
const [textarea, setTextarea] =
|
|
1239
|
-
const [error, setError] =
|
|
1240
|
-
const initialValue =
|
|
1241
|
-
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);
|
|
1242
1120
|
const cellHeight = () => props.cellHeight ?? 0;
|
|
1243
1121
|
const alignTop = () => props.alignTop ?? false;
|
|
1244
1122
|
createTopAlignedInput(input, alignTop, cellHeight);
|
|
@@ -1259,9 +1137,9 @@ function TextCellEditor(props) {
|
|
|
1259
1137
|
element.setSelectionRange(caret, caret);
|
|
1260
1138
|
}
|
|
1261
1139
|
};
|
|
1262
|
-
|
|
1140
|
+
createRenderEffect2(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1263
1141
|
onSettled3(() => {
|
|
1264
|
-
const element =
|
|
1142
|
+
const element = untrack5(() => input() ?? textarea());
|
|
1265
1143
|
if (!element) {
|
|
1266
1144
|
return;
|
|
1267
1145
|
}
|
|
@@ -1273,6 +1151,14 @@ function TextCellEditor(props) {
|
|
|
1273
1151
|
onCleanup2(() => {
|
|
1274
1152
|
disposed = true;
|
|
1275
1153
|
});
|
|
1154
|
+
props.onRegisterFlush?.(() => {
|
|
1155
|
+
untrack5(() => {
|
|
1156
|
+
const element = input() ?? textarea();
|
|
1157
|
+
if (element) {
|
|
1158
|
+
props.onCommit(element.value);
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
});
|
|
1276
1162
|
const commitOnBlur = (value) => {
|
|
1277
1163
|
if (disposed) {
|
|
1278
1164
|
return;
|
|
@@ -1296,7 +1182,7 @@ function TextCellEditor(props) {
|
|
|
1296
1182
|
handleInput(next.value);
|
|
1297
1183
|
};
|
|
1298
1184
|
const renderInput = () => {
|
|
1299
|
-
const startValue =
|
|
1185
|
+
const startValue = untrack5(draft);
|
|
1300
1186
|
return <>
|
|
1301
1187
|
<input
|
|
1302
1188
|
ref={setInput}
|
|
@@ -1320,7 +1206,7 @@ function TextCellEditor(props) {
|
|
|
1320
1206
|
</>;
|
|
1321
1207
|
};
|
|
1322
1208
|
const renderTextarea = () => {
|
|
1323
|
-
const startValue =
|
|
1209
|
+
const startValue = untrack5(draft);
|
|
1324
1210
|
return <div class="ssg-cell-editor-multiline">
|
|
1325
1211
|
<textarea
|
|
1326
1212
|
ref={setTextarea}
|
|
@@ -1359,25 +1245,33 @@ function TextCellEditor(props) {
|
|
|
1359
1245
|
}
|
|
1360
1246
|
|
|
1361
1247
|
// src/editors/NumberCellEditor.tsx
|
|
1362
|
-
import { createSignal as
|
|
1248
|
+
import { createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled4, untrack as untrack6 } from "solid-js";
|
|
1363
1249
|
import { handleEditorKeyDown as handleEditorKeyDown2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1364
1250
|
import {
|
|
1365
1251
|
resolveNumberEditorCommitValue,
|
|
1366
1252
|
resolveNumberEditorStart
|
|
1367
1253
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1368
1254
|
function NumberCellEditor(props) {
|
|
1369
|
-
const [input, setInput] =
|
|
1370
|
-
const [error, setError] =
|
|
1255
|
+
const [input, setInput] = createSignal4();
|
|
1256
|
+
const [error, setError] = createSignal4(null);
|
|
1371
1257
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1372
|
-
const start = resolveNumberEditorStart(
|
|
1258
|
+
const start = resolveNumberEditorStart(untrack6(() => props.initialValue));
|
|
1373
1259
|
const textMode = start.textMode;
|
|
1374
1260
|
const startText = start.text;
|
|
1375
1261
|
let disposed = false;
|
|
1376
1262
|
onCleanup3(() => {
|
|
1377
1263
|
disposed = true;
|
|
1378
1264
|
});
|
|
1265
|
+
props.onRegisterFlush?.(() => {
|
|
1266
|
+
untrack6(() => {
|
|
1267
|
+
const element = input();
|
|
1268
|
+
if (element) {
|
|
1269
|
+
props.onCommit(resolveNumberEditorCommitValue(element.value, textMode));
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
});
|
|
1379
1273
|
onSettled4(() => {
|
|
1380
|
-
const element =
|
|
1274
|
+
const element = untrack6(input);
|
|
1381
1275
|
if (!element) {
|
|
1382
1276
|
return;
|
|
1383
1277
|
}
|
|
@@ -1426,13 +1320,13 @@ function NumberCellEditor(props) {
|
|
|
1426
1320
|
import {
|
|
1427
1321
|
For as For4,
|
|
1428
1322
|
Show as Show7,
|
|
1429
|
-
createEffect
|
|
1430
|
-
createRenderEffect as
|
|
1431
|
-
createSignal as
|
|
1323
|
+
createEffect,
|
|
1324
|
+
createRenderEffect as createRenderEffect3,
|
|
1325
|
+
createSignal as createSignal5,
|
|
1432
1326
|
createUniqueId,
|
|
1433
1327
|
onCleanup as onCleanup4,
|
|
1434
1328
|
onSettled as onSettled5,
|
|
1435
|
-
untrack as
|
|
1329
|
+
untrack as untrack7
|
|
1436
1330
|
} from "solid-js";
|
|
1437
1331
|
import { Portal } from "@solidjs/web";
|
|
1438
1332
|
import {
|
|
@@ -1448,36 +1342,36 @@ import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/int
|
|
|
1448
1342
|
function SelectCellEditor(props) {
|
|
1449
1343
|
const texts = useGridLocaleText();
|
|
1450
1344
|
const portal = useGridPortal();
|
|
1451
|
-
const [input, setInput] =
|
|
1452
|
-
const [list, setList] =
|
|
1345
|
+
const [input, setInput] = createSignal5();
|
|
1346
|
+
const [list, setList] = createSignal5();
|
|
1453
1347
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1454
1348
|
const listId = createUniqueId();
|
|
1455
|
-
const start =
|
|
1349
|
+
const start = untrack7(() => resolveSelectEditorStart(props.options, props.value, props.initialText, Date.now()));
|
|
1456
1350
|
let typeahead = start.typeahead;
|
|
1457
|
-
const [highlight, setHighlight] =
|
|
1351
|
+
const [highlight, setHighlight] = createSignal5(start.highlight);
|
|
1458
1352
|
let currentHighlight = start.highlight;
|
|
1459
1353
|
const updateHighlight = (next) => {
|
|
1460
1354
|
currentHighlight = typeof next === "function" ? next(currentHighlight) : next;
|
|
1461
1355
|
setHighlight(currentHighlight);
|
|
1462
1356
|
};
|
|
1463
|
-
const [placement2, setPlacement] =
|
|
1357
|
+
const [placement2, setPlacement] = createSignal5(null);
|
|
1464
1358
|
const optionRowHeight = resolveSelectOptionRowHeight();
|
|
1465
|
-
const [error, setError] =
|
|
1466
|
-
const [composing, setComposing] =
|
|
1359
|
+
const [error, setError] = createSignal5(null);
|
|
1360
|
+
const [composing, setComposing] = createSignal5(null);
|
|
1467
1361
|
let composingNow = null;
|
|
1468
1362
|
const updateComposing = (next) => {
|
|
1469
1363
|
composingNow = next;
|
|
1470
1364
|
setComposing(next);
|
|
1471
1365
|
};
|
|
1472
1366
|
const measure = () => {
|
|
1473
|
-
const element =
|
|
1367
|
+
const element = untrack7(input);
|
|
1474
1368
|
if (!element) {
|
|
1475
1369
|
return;
|
|
1476
1370
|
}
|
|
1477
1371
|
setPlacement(
|
|
1478
1372
|
computeSelectPopoverPlacement(
|
|
1479
1373
|
element.getBoundingClientRect(),
|
|
1480
|
-
|
|
1374
|
+
untrack7(() => props.options.length),
|
|
1481
1375
|
window.innerWidth,
|
|
1482
1376
|
window.innerHeight,
|
|
1483
1377
|
optionRowHeight
|
|
@@ -1485,7 +1379,7 @@ function SelectCellEditor(props) {
|
|
|
1485
1379
|
);
|
|
1486
1380
|
};
|
|
1487
1381
|
onSettled5(() => {
|
|
1488
|
-
|
|
1382
|
+
untrack7(input)?.focus();
|
|
1489
1383
|
measure();
|
|
1490
1384
|
window.addEventListener("resize", measure);
|
|
1491
1385
|
window.addEventListener("scroll", measure, true);
|
|
@@ -1494,18 +1388,27 @@ function SelectCellEditor(props) {
|
|
|
1494
1388
|
window.removeEventListener("scroll", measure, true);
|
|
1495
1389
|
};
|
|
1496
1390
|
});
|
|
1497
|
-
|
|
1391
|
+
createEffect(
|
|
1498
1392
|
() => props.options.length,
|
|
1499
1393
|
(_length, previous) => {
|
|
1500
1394
|
if (previous !== void 0) {
|
|
1501
|
-
|
|
1395
|
+
untrack7(input)?.focus();
|
|
1502
1396
|
measure();
|
|
1503
1397
|
}
|
|
1504
1398
|
},
|
|
1505
1399
|
{ name: "selectEditorOptionsRefocus" }
|
|
1506
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
|
+
);
|
|
1507
1410
|
const mount = () => placement2() !== null ? portal.container() : null;
|
|
1508
|
-
|
|
1411
|
+
createEffect(
|
|
1509
1412
|
() => [highlight(), list()],
|
|
1510
1413
|
([index, element]) => {
|
|
1511
1414
|
const option = element?.children[index];
|
|
@@ -1555,7 +1458,7 @@ function SelectCellEditor(props) {
|
|
|
1555
1458
|
};
|
|
1556
1459
|
const highlightedOption = () => props.options[highlight()];
|
|
1557
1460
|
const shownText = () => highlightedOption()?.label ?? String(props.value ?? "");
|
|
1558
|
-
const initialShownText =
|
|
1461
|
+
const initialShownText = untrack7(shownText);
|
|
1559
1462
|
let disposed = false;
|
|
1560
1463
|
onCleanup4(() => {
|
|
1561
1464
|
disposed = true;
|
|
@@ -1570,7 +1473,7 @@ function SelectCellEditor(props) {
|
|
|
1570
1473
|
if (event.isComposing) {
|
|
1571
1474
|
updateComposing(event.currentTarget.value);
|
|
1572
1475
|
} else {
|
|
1573
|
-
event.currentTarget.value = composingNow ??
|
|
1476
|
+
event.currentTarget.value = composingNow ?? untrack7(shownText);
|
|
1574
1477
|
}
|
|
1575
1478
|
}}
|
|
1576
1479
|
onCompositionStart={(event) => updateComposing(event.currentTarget.value)}
|
|
@@ -1649,7 +1552,7 @@ function SelectCellEditor(props) {
|
|
|
1649
1552
|
</Show7>
|
|
1650
1553
|
</>;
|
|
1651
1554
|
createPortalTokens(list, () => props.themeClassName, placement2);
|
|
1652
|
-
|
|
1555
|
+
createRenderEffect3(
|
|
1653
1556
|
() => [input(), composing() ?? shownText()],
|
|
1654
1557
|
([element, text]) => {
|
|
1655
1558
|
if (element && element.value !== text) {
|
|
@@ -1658,7 +1561,7 @@ function SelectCellEditor(props) {
|
|
|
1658
1561
|
},
|
|
1659
1562
|
{ name: "selectEditorInputText" }
|
|
1660
1563
|
);
|
|
1661
|
-
|
|
1564
|
+
createRenderEffect3(
|
|
1662
1565
|
() => [input(), shownText(), composing()],
|
|
1663
1566
|
([element, , composingText]) => {
|
|
1664
1567
|
if (!element || composingText !== null) {
|
|
@@ -1673,25 +1576,25 @@ function SelectCellEditor(props) {
|
|
|
1673
1576
|
}
|
|
1674
1577
|
|
|
1675
1578
|
// src/editors/DateCellEditor.tsx
|
|
1676
|
-
import { createSignal as
|
|
1579
|
+
import { createSignal as createSignal6, onCleanup as onCleanup5, onSettled as onSettled6, untrack as untrack8 } from "solid-js";
|
|
1677
1580
|
import { handleEditorKeyDown as handleEditorKeyDown3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1678
1581
|
import { readTypedDateCommitValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
1679
1582
|
import { resolveShiftIntoView } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1680
1583
|
function DateCellEditor(props) {
|
|
1681
1584
|
const texts = useGridLocaleText();
|
|
1682
|
-
const [input, setInput] =
|
|
1683
|
-
const [error, setError] =
|
|
1684
|
-
const [shift, setShift] =
|
|
1585
|
+
const [input, setInput] = createSignal6();
|
|
1586
|
+
const [error, setError] = createSignal6(null);
|
|
1587
|
+
const [shift, setShift] = createSignal6(0);
|
|
1685
1588
|
createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
|
|
1686
|
-
const initialText =
|
|
1589
|
+
const initialText = untrack8(() => props.initialText);
|
|
1687
1590
|
const textMode = initialText !== void 0 && initialText !== "";
|
|
1688
|
-
const startValue = textMode ? initialText ?? "" :
|
|
1591
|
+
const startValue = textMode ? initialText ?? "" : untrack8(() => props.initialValue);
|
|
1689
1592
|
let disposed = false;
|
|
1690
1593
|
onCleanup5(() => {
|
|
1691
1594
|
disposed = true;
|
|
1692
1595
|
});
|
|
1693
1596
|
onSettled6(() => {
|
|
1694
|
-
const element =
|
|
1597
|
+
const element = untrack8(input);
|
|
1695
1598
|
if (!element) {
|
|
1696
1599
|
return;
|
|
1697
1600
|
}
|
|
@@ -1709,6 +1612,14 @@ function DateCellEditor(props) {
|
|
|
1709
1612
|
const normalized = readTypedDateCommitValue(value);
|
|
1710
1613
|
return normalized === null ? { status: "rejected", message: texts().enterDate } : props.onCommit(normalized, direction);
|
|
1711
1614
|
};
|
|
1615
|
+
props.onRegisterFlush?.(() => {
|
|
1616
|
+
untrack8(() => {
|
|
1617
|
+
const element = input();
|
|
1618
|
+
if (element) {
|
|
1619
|
+
commitDraft(element.value);
|
|
1620
|
+
}
|
|
1621
|
+
});
|
|
1622
|
+
});
|
|
1712
1623
|
return <>
|
|
1713
1624
|
<input
|
|
1714
1625
|
ref={setInput}
|
|
@@ -1746,13 +1657,13 @@ function DateCellEditor(props) {
|
|
|
1746
1657
|
}
|
|
1747
1658
|
|
|
1748
1659
|
// src/editors/CustomCellEditor.tsx
|
|
1749
|
-
import { onCleanup as onCleanup6, untrack as
|
|
1660
|
+
import { onCleanup as onCleanup6, untrack as untrack9 } from "solid-js";
|
|
1750
1661
|
function CustomCellEditor(props) {
|
|
1751
1662
|
let alive = true;
|
|
1752
1663
|
onCleanup6(() => {
|
|
1753
1664
|
alive = false;
|
|
1754
1665
|
});
|
|
1755
|
-
const context =
|
|
1666
|
+
const context = untrack9(() => props.context);
|
|
1756
1667
|
const sessionContext = Object.defineProperties({}, Object.getOwnPropertyDescriptors(context));
|
|
1757
1668
|
sessionContext.commit = (value, direction) => alive ? context.commit(value, direction) : { status: "noop" };
|
|
1758
1669
|
sessionContext.cancel = () => {
|
|
@@ -1760,7 +1671,7 @@ function CustomCellEditor(props) {
|
|
|
1760
1671
|
context.cancel();
|
|
1761
1672
|
}
|
|
1762
1673
|
};
|
|
1763
|
-
return <>{
|
|
1674
|
+
return <>{untrack9(() => props.render(sessionContext))}</>;
|
|
1764
1675
|
}
|
|
1765
1676
|
|
|
1766
1677
|
// src/editors/CellEditorLayer.tsx
|
|
@@ -1773,7 +1684,7 @@ function CellEditorLayer(props) {
|
|
|
1773
1684
|
});
|
|
1774
1685
|
const editLabel = () => {
|
|
1775
1686
|
const session = props.session;
|
|
1776
|
-
return session ?
|
|
1687
|
+
return session ? formatLocaleText4(texts().editCell, { column: session.column.title || session.column.key }) : void 0;
|
|
1777
1688
|
};
|
|
1778
1689
|
const cellHeight = () => props.rect?.height ?? 0;
|
|
1779
1690
|
const selectOptions = createMemo6(() => {
|
|
@@ -1789,7 +1700,7 @@ function CellEditorLayer(props) {
|
|
|
1789
1700
|
});
|
|
1790
1701
|
const renderCustomEditor = (render, sessionId, initialValue) => {
|
|
1791
1702
|
const session = createMemo6(
|
|
1792
|
-
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session : previous
|
|
1703
|
+
(previous) => previous === void 0 || props.sessionId === sessionId ? props.session ?? previous ?? null : previous
|
|
1793
1704
|
);
|
|
1794
1705
|
const context = {
|
|
1795
1706
|
get row() {
|
|
@@ -1821,7 +1732,9 @@ function CellEditorLayer(props) {
|
|
|
1821
1732
|
commit: (value, direction) => props.onCommit(value, direction) ?? { status: "noop" },
|
|
1822
1733
|
cancel: () => props.onCancel()
|
|
1823
1734
|
};
|
|
1824
|
-
return <
|
|
1735
|
+
return <Show8 when={session() !== null}>
|
|
1736
|
+
<CustomCellEditor render={render} context={context} />
|
|
1737
|
+
</Show8>;
|
|
1825
1738
|
};
|
|
1826
1739
|
const renderEditor = (type, sessionId) => {
|
|
1827
1740
|
const common = {
|
|
@@ -1841,9 +1754,13 @@ function CellEditorLayer(props) {
|
|
|
1841
1754
|
return props.alignTop;
|
|
1842
1755
|
},
|
|
1843
1756
|
onCommit: (value, direction) => props.onCommit(value, direction),
|
|
1844
|
-
onCancel: () => props.onCancel()
|
|
1757
|
+
onCancel: () => props.onCancel(),
|
|
1758
|
+
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
1845
1759
|
};
|
|
1846
|
-
const initialValue =
|
|
1760
|
+
const initialValue = untrack10(props.initialValue);
|
|
1761
|
+
if (type === "select" || type === "custom") {
|
|
1762
|
+
props.onRegisterFlush?.(null);
|
|
1763
|
+
}
|
|
1847
1764
|
switch (type) {
|
|
1848
1765
|
case "number": {
|
|
1849
1766
|
const numberEditor = () => {
|
|
@@ -1859,7 +1776,7 @@ function CellEditorLayer(props) {
|
|
|
1859
1776
|
/>;
|
|
1860
1777
|
}
|
|
1861
1778
|
case "date": {
|
|
1862
|
-
const session =
|
|
1779
|
+
const session = untrack10(() => props.session);
|
|
1863
1780
|
return <DateCellEditor
|
|
1864
1781
|
{...common}
|
|
1865
1782
|
initialValue={toDateInputValue(session ? session.value : initialValue)}
|
|
@@ -1867,22 +1784,24 @@ function CellEditorLayer(props) {
|
|
|
1867
1784
|
/>;
|
|
1868
1785
|
}
|
|
1869
1786
|
case "select": {
|
|
1870
|
-
const session =
|
|
1787
|
+
const session = untrack10(() => props.session);
|
|
1871
1788
|
return <SelectCellEditor
|
|
1872
1789
|
{...common}
|
|
1873
1790
|
popoverSlot={props.slots.popover}
|
|
1874
1791
|
themeClassName={props.themeClassName}
|
|
1875
1792
|
options={selectOptions()}
|
|
1876
1793
|
value={props.session?.value}
|
|
1794
|
+
cellTop={props.rect?.top ?? 0}
|
|
1795
|
+
cellLeft={props.rect?.left ?? 0}
|
|
1877
1796
|
initialText={session ? resolveTypedStartText(initialValue, session.value) : void 0}
|
|
1878
1797
|
/>;
|
|
1879
1798
|
}
|
|
1880
1799
|
case "custom": {
|
|
1881
|
-
const current =
|
|
1800
|
+
const current = untrack10(editor);
|
|
1882
1801
|
if (current?.type !== "custom") {
|
|
1883
1802
|
return null;
|
|
1884
1803
|
}
|
|
1885
|
-
return
|
|
1804
|
+
return renderCustomEditor(current.render, sessionId, initialValue);
|
|
1886
1805
|
}
|
|
1887
1806
|
default: {
|
|
1888
1807
|
const textEditor = () => {
|
|
@@ -1923,7 +1842,7 @@ function CellEditorLayer(props) {
|
|
|
1923
1842
|
}
|
|
1924
1843
|
|
|
1925
1844
|
// src/view/DefaultGridTopBar.tsx
|
|
1926
|
-
import { Show as Show9, createMemo as createMemo7, createRenderEffect as
|
|
1845
|
+
import { Show as Show9, createMemo as createMemo7, createRenderEffect as createRenderEffect4, createSignal as createSignal7, createUniqueId as createUniqueId2, untrack as untrack11 } from "solid-js";
|
|
1927
1846
|
var DefaultFilterIcon = () => <svg
|
|
1928
1847
|
width="14"
|
|
1929
1848
|
height="14"
|
|
@@ -1955,9 +1874,9 @@ function DefaultGridTopBar(props) {
|
|
|
1955
1874
|
const texts = useGridLocaleText();
|
|
1956
1875
|
const filterSummaryId = createUniqueId2();
|
|
1957
1876
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
1958
|
-
const [input, setInput] =
|
|
1959
|
-
const initialText =
|
|
1960
|
-
|
|
1877
|
+
const [input, setInput] = createSignal7();
|
|
1878
|
+
const initialText = untrack11(() => props.globalFilterText);
|
|
1879
|
+
createRenderEffect4(
|
|
1961
1880
|
() => [input(), props.globalFilterText],
|
|
1962
1881
|
([element, text]) => {
|
|
1963
1882
|
if (element && element.value !== text) {
|
|
@@ -2043,7 +1962,7 @@ function DefaultGridTopBar(props) {
|
|
|
2043
1962
|
|
|
2044
1963
|
// src/view/DefaultGridBottomBar.tsx
|
|
2045
1964
|
import { Show as Show10 } from "solid-js";
|
|
2046
|
-
import { formatLocaleText as
|
|
1965
|
+
import { formatLocaleText as formatLocaleText5 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
2047
1966
|
function DefaultGridBottomBar(props) {
|
|
2048
1967
|
const texts = useGridLocaleText();
|
|
2049
1968
|
const aggregates = (trailing) => {
|
|
@@ -2061,10 +1980,10 @@ function DefaultGridBottomBar(props) {
|
|
|
2061
1980
|
</Show10>
|
|
2062
1981
|
<div class="ssg-bar-group">
|
|
2063
1982
|
<span class="ssg-bar-chip">
|
|
2064
|
-
{
|
|
1983
|
+
{formatLocaleText5(texts().activeCell, { cell: props.derivedSummary.activeCellLabel })}
|
|
2065
1984
|
</span>
|
|
2066
1985
|
<span class="ssg-bar-chip">
|
|
2067
|
-
{
|
|
1986
|
+
{formatLocaleText5(texts().selection, { range: props.derivedSummary.selectionLabel })}
|
|
2068
1987
|
</span>
|
|
2069
1988
|
<span class="ssg-bar-chip">{props.derivedSummary.selectionStatsText}</span>
|
|
2070
1989
|
<span class="ssg-bar-chip">{props.derivedSummary.selectedColumnsText}</span>
|
|
@@ -2075,7 +1994,7 @@ function DefaultGridBottomBar(props) {
|
|
|
2075
1994
|
}
|
|
2076
1995
|
|
|
2077
1996
|
// src/devWarnings.ts
|
|
2078
|
-
import { $PROXY, createEffect as
|
|
1997
|
+
import { $PROXY, createEffect as createEffect2, createMemo as createMemo8 } from "solid-js";
|
|
2079
1998
|
import { AUTO_HEIGHT_MAX_ROWS, MAX_BODY_PX } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
2080
1999
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2081
2000
|
import {
|
|
@@ -2086,7 +2005,7 @@ import {
|
|
|
2086
2005
|
var noop2 = () => {
|
|
2087
2006
|
};
|
|
2088
2007
|
var createChangeEffect = (compute, effect) => {
|
|
2089
|
-
|
|
2008
|
+
createEffect2(createMemo8(compute), effect, { name: "devWarning" });
|
|
2090
2009
|
};
|
|
2091
2010
|
var FEATURE_PROPS = {
|
|
2092
2011
|
find: [{ prop: "find", isUsed: (props) => props.find !== void 0 && props.find !== false }],
|
|
@@ -2337,9 +2256,7 @@ var EMPTY_ROWS = [];
|
|
|
2337
2256
|
var NEVER_EDITABLE = () => false;
|
|
2338
2257
|
var NO_COLUMNS = [];
|
|
2339
2258
|
var NO_COLUMN_FILTERS = {};
|
|
2340
|
-
var renderDetailToggleCell = (
|
|
2341
|
-
<DetailToggleButton detail={ctx.detail} />
|
|
2342
|
-
</Show11>;
|
|
2259
|
+
var renderDetailToggleCell = () => null;
|
|
2343
2260
|
var noop3 = () => {
|
|
2344
2261
|
};
|
|
2345
2262
|
var applyHandleRef = (ref, handle) => {
|
|
@@ -2383,14 +2300,14 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2383
2300
|
const serverSideFeature2 = features.serverSide;
|
|
2384
2301
|
const isServerSide = createMemo9(() => props.dataSource != null);
|
|
2385
2302
|
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2386
|
-
const [hydrated, setHydrated] =
|
|
2387
|
-
if (!
|
|
2303
|
+
const [hydrated, setHydrated] = createSignal8(!isServer && !isHydrating(), { name: "hydrated" });
|
|
2304
|
+
if (!untrack12(hydrated)) {
|
|
2388
2305
|
onGridMounted(() => {
|
|
2389
2306
|
setHydrated(true);
|
|
2390
2307
|
});
|
|
2391
2308
|
}
|
|
2392
|
-
const [relayedRows, setRelayedRows] =
|
|
2393
|
-
|
|
2309
|
+
const [relayedRows, setRelayedRows] = createSignal8(null);
|
|
2310
|
+
createEffect3(
|
|
2394
2311
|
() => latest(() => props.rows),
|
|
2395
2312
|
{
|
|
2396
2313
|
effect: (value) => {
|
|
@@ -2469,13 +2386,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2469
2386
|
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
2470
2387
|
const engine = createGridEngine({
|
|
2471
2388
|
features,
|
|
2472
|
-
initialState:
|
|
2473
|
-
columnInputs:
|
|
2389
|
+
initialState: untrack12(() => props.initialState),
|
|
2390
|
+
columnInputs: untrack12(columnInputs),
|
|
2474
2391
|
serverSide: {
|
|
2475
|
-
isServerSide:
|
|
2476
|
-
enableGlobalFilter:
|
|
2477
|
-
enableColumnFilter:
|
|
2478
|
-
enableSorting:
|
|
2392
|
+
isServerSide: untrack12(isServerSide),
|
|
2393
|
+
enableGlobalFilter: untrack12(globalFilterEnabled),
|
|
2394
|
+
enableColumnFilter: untrack12(columnFilterEnabled),
|
|
2395
|
+
enableSorting: untrack12(enableSorting)
|
|
2479
2396
|
}
|
|
2480
2397
|
});
|
|
2481
2398
|
onCleanup7(() => engine.dispose());
|
|
@@ -2499,7 +2416,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2499
2416
|
const cellDoubleClickRef = { current: noop3 };
|
|
2500
2417
|
const getPopupContainer = () => resolvePopupContainer(
|
|
2501
2418
|
gridRootRef.current,
|
|
2502
|
-
|
|
2419
|
+
untrack12(() => props.popupContainer) ?? "auto"
|
|
2503
2420
|
);
|
|
2504
2421
|
const portalContext = { source: () => gridRootRef.current, container: getPopupContainer };
|
|
2505
2422
|
onGridMounted(() => {
|
|
@@ -2525,7 +2442,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2525
2442
|
);
|
|
2526
2443
|
const paneLayout = () => paneResolution().paneLayout;
|
|
2527
2444
|
let previousColumnsForWidths = null;
|
|
2528
|
-
|
|
2445
|
+
createEffect3(
|
|
2529
2446
|
columns,
|
|
2530
2447
|
(next) => {
|
|
2531
2448
|
dispatch(gridActions.reconcileColumnWidths(previousColumnsForWidths, next));
|
|
@@ -2696,7 +2613,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2696
2613
|
let cache = null;
|
|
2697
2614
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
2698
2615
|
});
|
|
2699
|
-
|
|
2616
|
+
createEffect3(
|
|
2700
2617
|
() => [viewRowCount(), viewColCount()],
|
|
2701
2618
|
([rowCount, colCount]) => {
|
|
2702
2619
|
dispatch(gridActions.clampSelectionToRowCount(rowCount, colCount));
|
|
@@ -2970,7 +2887,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2970
2887
|
footerHeight: footerHeight()
|
|
2971
2888
|
}), "effect", "scrollSync");
|
|
2972
2889
|
let lastServerSideQueryKey = null;
|
|
2973
|
-
|
|
2890
|
+
createEffect3(
|
|
2974
2891
|
() => isServerSide() ? serverSideQueryKey() : null,
|
|
2975
2892
|
(key) => {
|
|
2976
2893
|
if (key === null) {
|
|
@@ -2991,7 +2908,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
2991
2908
|
{ name: "serverSideQueryReset" }
|
|
2992
2909
|
);
|
|
2993
2910
|
let lastDetailQueryKey = null;
|
|
2994
|
-
|
|
2911
|
+
createEffect3(
|
|
2995
2912
|
() => isServerSide() && detailRowEnabled() ? serverSideQueryKey() : null,
|
|
2996
2913
|
(key) => {
|
|
2997
2914
|
if (key === null) {
|
|
@@ -3010,7 +2927,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3010
2927
|
);
|
|
3011
2928
|
const windowFirstRow = createMemo9(() => vertical().windowFirstRow);
|
|
3012
2929
|
const windowLastRow = createMemo9(() => vertical().windowLastRow);
|
|
3013
|
-
|
|
2930
|
+
createEffect3(
|
|
3014
2931
|
() => [isServerSide(), windowFirstRow(), windowLastRow(), serverSideQueryKey()],
|
|
3015
2932
|
([serverSideActive, firstRow, lastRow]) => {
|
|
3016
2933
|
if (!serverSideActive || !serverSide || lastRow < firstRow) {
|
|
@@ -3156,15 +3073,15 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3156
3073
|
const cellEditorDomId = `${gridDomId}-cell-editor`;
|
|
3157
3074
|
let tooltipController = null;
|
|
3158
3075
|
onGridMounted(() => {
|
|
3159
|
-
const controller = acquireTooltipController();
|
|
3076
|
+
const controller = acquireTooltipController(void 0, gridRootRef.current);
|
|
3160
3077
|
tooltipController = controller;
|
|
3161
|
-
controller.setSlot(
|
|
3078
|
+
controller.setSlot(untrack12(slots).tooltip);
|
|
3162
3079
|
return () => {
|
|
3163
3080
|
controller.dispose();
|
|
3164
3081
|
tooltipController = null;
|
|
3165
3082
|
};
|
|
3166
3083
|
});
|
|
3167
|
-
|
|
3084
|
+
createEffect3(
|
|
3168
3085
|
() => slots().tooltip,
|
|
3169
3086
|
(slot) => {
|
|
3170
3087
|
tooltipController?.setSlot(slot);
|
|
@@ -3175,7 +3092,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3175
3092
|
const active = ui().activeCell;
|
|
3176
3093
|
return active === null || ui().editingCell !== null ? null : `${active.row}:${active.col}`;
|
|
3177
3094
|
});
|
|
3178
|
-
|
|
3095
|
+
createEffect3(activeCellTooltipKey, (key) => {
|
|
3179
3096
|
if (key === null) {
|
|
3180
3097
|
hideActiveCellTooltip(gridRootRef.current);
|
|
3181
3098
|
return void 0;
|
|
@@ -3261,6 +3178,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3261
3178
|
controlledRowSelectionModel: controlledRowSelectionModel(),
|
|
3262
3179
|
leafRowCount: leafRowCount(),
|
|
3263
3180
|
filteredDataRows: filteredDataRows(),
|
|
3181
|
+
// 追加(Solid 版 0.1.2 / S4-09): 選んだ行が rows から消えたら選択から外す(clientSide。React 版と同じ)。
|
|
3182
|
+
sourceRows: isServerSide() ? void 0 : { rows: rows(), rowKeyGetter: resolvedRowKeyGetter() },
|
|
3264
3183
|
dispatch
|
|
3265
3184
|
}), "render", "rowSelectionCommands");
|
|
3266
3185
|
connectController(
|
|
@@ -3459,8 +3378,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3459
3378
|
sort: state.sort,
|
|
3460
3379
|
filters: state.filters,
|
|
3461
3380
|
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
3462
|
-
viewRowCount:
|
|
3463
|
-
columns:
|
|
3381
|
+
viewRowCount: untrack12(viewRowCount),
|
|
3382
|
+
columns: untrack12(orderedColumnKeys)
|
|
3464
3383
|
}
|
|
3465
3384
|
}
|
|
3466
3385
|
});
|
|
@@ -3558,13 +3477,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3558
3477
|
});
|
|
3559
3478
|
const columnMenuEnabled = () => enableColumnMenu() && columnMenu !== void 0;
|
|
3560
3479
|
const openColumnMenuFromButton = columnMenu ? (column, event) => {
|
|
3561
|
-
if (filterPopover &&
|
|
3480
|
+
if (filterPopover && untrack12(filterPopover.isOpen) && event.button === 0) {
|
|
3562
3481
|
filterPopover.close();
|
|
3563
3482
|
}
|
|
3564
3483
|
columnMenu.openFromButton(column, event);
|
|
3565
3484
|
} : void 0;
|
|
3566
3485
|
const openColumnMenuForCell = (col) => {
|
|
3567
|
-
const column =
|
|
3486
|
+
const column = untrack12(orderedColumns)[col];
|
|
3568
3487
|
const root = gridRootRef.current;
|
|
3569
3488
|
if (!columnMenu || !column || !root || isSyntheticColumnKey2(column.key)) {
|
|
3570
3489
|
return false;
|
|
@@ -3603,7 +3522,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3603
3522
|
if (!toolPanel) {
|
|
3604
3523
|
return;
|
|
3605
3524
|
}
|
|
3606
|
-
if (
|
|
3525
|
+
if (untrack12(toolPanel.activeTab) === "filter") {
|
|
3607
3526
|
toolPanel.close();
|
|
3608
3527
|
} else {
|
|
3609
3528
|
toolPanel.open("filter");
|
|
@@ -3616,7 +3535,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3616
3535
|
let keyboardContextMenu = null;
|
|
3617
3536
|
const openContextMenuForCell = (cell) => {
|
|
3618
3537
|
const root = gridRootRef.current;
|
|
3619
|
-
const columnsNow =
|
|
3538
|
+
const columnsNow = untrack12(orderedColumns);
|
|
3620
3539
|
const column = columnsNow[cell.col];
|
|
3621
3540
|
const getItems = props.getContextMenuItems;
|
|
3622
3541
|
if (!contextMenuActive() || !contextMenuFeature2 || !contextMenu || !getItems || !root || !column) {
|
|
@@ -3626,12 +3545,12 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3626
3545
|
root.querySelectorAll(`[data-row-index="${cell.row}"] [data-ssg-col-key]`)
|
|
3627
3546
|
).find((element) => element.dataset.ssgColKey === column.key && !isInsideDetailCardOf(root, element));
|
|
3628
3547
|
const rect = (cellEl ?? root).getBoundingClientRect();
|
|
3629
|
-
const state =
|
|
3548
|
+
const state = untrack12(ui);
|
|
3630
3549
|
const params = contextMenuFeature2.buildCellContextMenuParams({
|
|
3631
3550
|
cell,
|
|
3632
3551
|
clientX: rect.left,
|
|
3633
3552
|
clientY: cellEl ? rect.bottom : rect.top,
|
|
3634
|
-
rowModel:
|
|
3553
|
+
rowModel: untrack12(rowModel),
|
|
3635
3554
|
orderedColumns: columnsNow,
|
|
3636
3555
|
selection: state.selection,
|
|
3637
3556
|
activeCell: state.activeCell
|
|
@@ -3687,17 +3606,17 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3687
3606
|
}
|
|
3688
3607
|
return;
|
|
3689
3608
|
}
|
|
3690
|
-
const activeCell =
|
|
3609
|
+
const activeCell = untrack12(ui).activeCell;
|
|
3691
3610
|
if (activeCell && openContextMenuForCell(activeCell)) {
|
|
3692
3611
|
event.preventDefault();
|
|
3693
3612
|
}
|
|
3694
3613
|
return;
|
|
3695
3614
|
}
|
|
3696
|
-
const state =
|
|
3615
|
+
const state = untrack12(ui);
|
|
3697
3616
|
const params = contextMenuFeature2.buildBodyContextMenuParams({
|
|
3698
3617
|
event,
|
|
3699
|
-
rowModel:
|
|
3700
|
-
orderedColumns:
|
|
3618
|
+
rowModel: untrack12(rowModel),
|
|
3619
|
+
orderedColumns: untrack12(orderedColumns),
|
|
3701
3620
|
selection: state.selection,
|
|
3702
3621
|
activeCell: state.activeCell
|
|
3703
3622
|
});
|
|
@@ -3729,6 +3648,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3729
3648
|
const keyboard = createKeyboardController();
|
|
3730
3649
|
connectController(keyboard, () => ({
|
|
3731
3650
|
uiState: ui(),
|
|
3651
|
+
// 端の固定列へ移ったときに中央の横のスクロールを端へ戻す(S12-05。React 版と同じ)。
|
|
3652
|
+
scrollContainerRef,
|
|
3732
3653
|
// イベントの時点の状態は store から読む(core controllers/liveUiState)。
|
|
3733
3654
|
getUiState: store.getState,
|
|
3734
3655
|
rowModel: rowModel(),
|
|
@@ -3770,7 +3691,9 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3770
3691
|
readOnly: readOnly(),
|
|
3771
3692
|
canEditCell: canEditCell(),
|
|
3772
3693
|
localeTexts: localeTexts(),
|
|
3773
|
-
followsRow: activeRowFollowEnabled()
|
|
3694
|
+
followsRow: activeRowFollowEnabled(),
|
|
3695
|
+
getUiState: store.getState,
|
|
3696
|
+
rowKeyGetter: resolvedRowKeyGetter()
|
|
3774
3697
|
}), "render", "edit");
|
|
3775
3698
|
connectController(cells, () => ({
|
|
3776
3699
|
rows: rows(),
|
|
@@ -3796,27 +3719,27 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3796
3719
|
editing: ui().editingCell !== null,
|
|
3797
3720
|
activeCell: ui().activeCell,
|
|
3798
3721
|
resolveCell: (cell) => {
|
|
3799
|
-
const column =
|
|
3722
|
+
const column = untrack12(orderedColumns)[cell.col];
|
|
3800
3723
|
return column ? { colKey: column.key, align: column.align } : null;
|
|
3801
3724
|
},
|
|
3802
3725
|
canStartEdit: (cell) => imeFeature?.canStartImeEdit(
|
|
3803
3726
|
{
|
|
3804
|
-
rowModel:
|
|
3805
|
-
columns:
|
|
3806
|
-
readOnly:
|
|
3807
|
-
canEditCell:
|
|
3727
|
+
rowModel: untrack12(rowModel),
|
|
3728
|
+
columns: untrack12(orderedColumns),
|
|
3729
|
+
readOnly: untrack12(readOnly),
|
|
3730
|
+
canEditCell: untrack12(canEditCell)
|
|
3808
3731
|
},
|
|
3809
3732
|
cell
|
|
3810
3733
|
) === true,
|
|
3811
3734
|
startEdit: edit.startEditWithValue,
|
|
3812
3735
|
// number の列は確定した文字を半角の数値の表記へ直して編集を始めます(読めない変換は捨てる)。
|
|
3813
|
-
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(
|
|
3736
|
+
resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack12(orderedColumns), cell, text) : text
|
|
3814
3737
|
};
|
|
3815
3738
|
},
|
|
3816
3739
|
"effect",
|
|
3817
3740
|
"imeInput"
|
|
3818
3741
|
);
|
|
3819
|
-
|
|
3742
|
+
createEffect3(imeDirectInputEnabled, (enabled) => {
|
|
3820
3743
|
if (!enabled) {
|
|
3821
3744
|
engine.imeInput.attach(null);
|
|
3822
3745
|
}
|
|
@@ -3833,7 +3756,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3833
3756
|
isClaimedTarget: (target, root) => {
|
|
3834
3757
|
const state = store.getState();
|
|
3835
3758
|
if (!root.contains(target)) {
|
|
3836
|
-
const popupOpen =
|
|
3759
|
+
const popupOpen = untrack12(isAnyGridPopupOpen);
|
|
3837
3760
|
if (target.closest(GRID_POPUP_SELECTOR) !== null) {
|
|
3838
3761
|
return popupOpen || state.editingCell !== null;
|
|
3839
3762
|
}
|
|
@@ -3844,13 +3767,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3844
3767
|
return true;
|
|
3845
3768
|
}
|
|
3846
3769
|
if (target === root || target.hasAttribute("data-ssg-ime-input")) {
|
|
3847
|
-
return state.editingCell !== null || isClearableSelection(state.selection) ||
|
|
3770
|
+
return state.editingCell !== null || isClearableSelection(state.selection) || untrack12(copiedSelection) !== null;
|
|
3848
3771
|
}
|
|
3849
3772
|
return false;
|
|
3850
3773
|
}
|
|
3851
3774
|
}), "render", "escapeClaim");
|
|
3852
3775
|
const handleShellKeyDown = (event) => {
|
|
3853
|
-
if (!
|
|
3776
|
+
if (!untrack12(isAnyGridPopupOpen)) {
|
|
3854
3777
|
handleRootKeyDown(event);
|
|
3855
3778
|
}
|
|
3856
3779
|
if (isEscapeClaimedByGrid(event)) {
|
|
@@ -3878,6 +3801,8 @@ function GridShellBody(props, features, mountGate) {
|
|
|
3878
3801
|
columnWidths: paneResolution().effectiveColumnWidths,
|
|
3879
3802
|
onColumnsChange: inOwnTick(props.onColumnsChange),
|
|
3880
3803
|
dispatch,
|
|
3804
|
+
// 列を変えた後、アクティブセルを列のキーに付いていかせる(S12-01。React 版と同じ)。
|
|
3805
|
+
getUiState: store.getState,
|
|
3881
3806
|
enableSorting: enableSorting(),
|
|
3882
3807
|
sort: ui().sort,
|
|
3883
3808
|
globalFilterText: selectGlobalFilter(ui()),
|
|
@@ -4170,7 +4095,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4170
4095
|
return engine.scrollSync.markApiScroll();
|
|
4171
4096
|
}
|
|
4172
4097
|
}), "render", "gridApi");
|
|
4173
|
-
|
|
4098
|
+
createEffect3(
|
|
4174
4099
|
() => vertical().physicalBodyHeight,
|
|
4175
4100
|
() => {
|
|
4176
4101
|
engine.gridApi.settleBottomPin();
|
|
@@ -4178,7 +4103,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4178
4103
|
{ name: "gridApiBottomPin" }
|
|
4179
4104
|
);
|
|
4180
4105
|
const handleCallBeforeMountWarned = { current: false };
|
|
4181
|
-
applyHandleRef(
|
|
4106
|
+
applyHandleRef(untrack12(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4182
4107
|
if (mountGate.done) {
|
|
4183
4108
|
return;
|
|
4184
4109
|
}
|
|
@@ -4387,13 +4312,13 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4387
4312
|
if (viewIndex < 0) {
|
|
4388
4313
|
return;
|
|
4389
4314
|
}
|
|
4390
|
-
const model =
|
|
4315
|
+
const model = untrack12(rowModel);
|
|
4391
4316
|
const row = model.getRow(viewIndex);
|
|
4392
4317
|
if (row === void 0) {
|
|
4393
4318
|
return;
|
|
4394
4319
|
}
|
|
4395
4320
|
writeCellValueTo(
|
|
4396
|
-
{ rows:
|
|
4321
|
+
{ rows: untrack12(rows), rowModel: model, handleRowsChange: untrack12(handleRowsChange), applyServerSideCellEdits: untrack12(applyServerSideCellEdits) },
|
|
4397
4322
|
viewIndex,
|
|
4398
4323
|
row,
|
|
4399
4324
|
column,
|
|
@@ -4414,7 +4339,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4414
4339
|
<RowDragHandle2
|
|
4415
4340
|
operable={rowDragOperable()}
|
|
4416
4341
|
tooltip={rowDragOperable() ? rowDragTexts().dragRow : rowDragTexts().dragRowDisabled}
|
|
4417
|
-
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(
|
|
4342
|
+
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(untrack12(() => cell.rowIndex), event)}
|
|
4418
4343
|
/>
|
|
4419
4344
|
</Show11>;
|
|
4420
4345
|
};
|
|
@@ -4447,9 +4372,18 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4447
4372
|
get expandable() {
|
|
4448
4373
|
return expandable();
|
|
4449
4374
|
},
|
|
4450
|
-
toggle: () => detailRows.toggleAt(cell.rowKey,
|
|
4451
|
-
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)
|
|
4452
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
|
+
}
|
|
4453
4387
|
return column.renderCell({
|
|
4454
4388
|
row,
|
|
4455
4389
|
get rowIndex() {
|
|
@@ -4730,6 +4664,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4730
4664
|
slots={slots()}
|
|
4731
4665
|
onCommit={(value, direction) => edit.commitEdit(value, direction)}
|
|
4732
4666
|
onCancel={edit.cancelEdit}
|
|
4667
|
+
onRegisterFlush={edit.registerDraftFlush}
|
|
4733
4668
|
align={editingColumn()?.align}
|
|
4734
4669
|
enterMove={props.editorEnterMove}
|
|
4735
4670
|
domId={cellEditorDomId}
|
|
@@ -4863,7 +4798,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4863
4798
|
data-ssg-has-active-cell={ui().activeCell === null ? void 0 : ""}
|
|
4864
4799
|
onKeyDown={handleShellKeyDown}
|
|
4865
4800
|
onPaste={(event) => {
|
|
4866
|
-
if (
|
|
4801
|
+
if (untrack12(isAnyGridPopupOpen)) {
|
|
4867
4802
|
return;
|
|
4868
4803
|
}
|
|
4869
4804
|
clipboard.handlePaste({
|
|
@@ -4986,7 +4921,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
4986
4921
|
}}
|
|
4987
4922
|
class="ssg-tab-exit"
|
|
4988
4923
|
tabindex={hasDetailCards() ? 0 : -1}
|
|
4989
|
-
aria-hidden="true"
|
|
4924
|
+
aria-hidden={hasDetailCards() ? void 0 : "true"}
|
|
4990
4925
|
onFocus={(event) => detailRows.handleTableExitFocus(event.relatedTarget)}
|
|
4991
4926
|
/>
|
|
4992
4927
|
<Show11 when={scrollHintFeature2 !== void 0 && activeScrollHint()}>
|
|
@@ -5023,7 +4958,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
5023
4958
|
<span class="ssg-filter-overlay-chip" role="status" aria-live="polite">
|
|
5024
4959
|
<span class="ssg-filter-spinner" aria-hidden="true" />
|
|
5025
4960
|
<span class="ssg-filter-overlay-text">
|
|
5026
|
-
{
|
|
4961
|
+
{formatLocaleText6(localeTexts().applyingFilter, { percent: Math.round(globalFilterProgress() * 100) })}
|
|
5027
4962
|
</span>
|
|
5028
4963
|
</span>
|
|
5029
4964
|
</div>
|
|
@@ -5139,7 +5074,7 @@ function GridShellBody(props, features, mountGate) {
|
|
|
5139
5074
|
{(tab) => <Show11 when={toolPanel.layout()}>
|
|
5140
5075
|
{(layout) => <Show11 when={toolPanelViews()}>
|
|
5141
5076
|
{(views) => {
|
|
5142
|
-
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } =
|
|
5077
|
+
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } = untrack12(views);
|
|
5143
5078
|
return <ToolPanel
|
|
5144
5079
|
popoverSlot={slots().popover}
|
|
5145
5080
|
themeClassName={portalClassName()}
|
|
@@ -5320,7 +5255,7 @@ function createColumnMenu(inputs) {
|
|
|
5320
5255
|
}
|
|
5321
5256
|
|
|
5322
5257
|
// src/view/ColumnMenuPopover.tsx
|
|
5323
|
-
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";
|
|
5324
5259
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5325
5260
|
var PINNED_ITEMS = [
|
|
5326
5261
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5338,7 +5273,7 @@ function ColumnMenuPopover(props) {
|
|
|
5338
5273
|
const texts = useFeatureLocaleText();
|
|
5339
5274
|
const portal = useGridPortal();
|
|
5340
5275
|
const container = portal.container();
|
|
5341
|
-
const [panel, setPanel] =
|
|
5276
|
+
const [panel, setPanel] = createSignal9();
|
|
5342
5277
|
let panelElement;
|
|
5343
5278
|
onCleanup8(() => {
|
|
5344
5279
|
if (props.panelRef.current === panelElement) {
|
|
@@ -5346,13 +5281,13 @@ function ColumnMenuPopover(props) {
|
|
|
5346
5281
|
}
|
|
5347
5282
|
});
|
|
5348
5283
|
const layout = createMemo11(() => props.layout);
|
|
5349
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5284
|
+
const [openSubmenu, setOpenSubmenu] = createSignal9(null);
|
|
5350
5285
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5351
5286
|
const isPinSubmenuOpen = createMemo11(() => {
|
|
5352
5287
|
const current = openSubmenu();
|
|
5353
5288
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5354
5289
|
});
|
|
5355
|
-
|
|
5290
|
+
createEffect4(
|
|
5356
5291
|
() => props.columnKey,
|
|
5357
5292
|
() => {
|
|
5358
5293
|
setOpenSubmenu(null);
|
|
@@ -5364,7 +5299,7 @@ function ColumnMenuPopover(props) {
|
|
|
5364
5299
|
);
|
|
5365
5300
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5366
5301
|
const submenuInline = createMemo11(() => layout().maxHeight !== void 0);
|
|
5367
|
-
const [pinSubmenu, setPinSubmenu] =
|
|
5302
|
+
const [pinSubmenu, setPinSubmenu] = createSignal9();
|
|
5368
5303
|
let pinSubmenuElement;
|
|
5369
5304
|
createPortalTokens(
|
|
5370
5305
|
() => isPinSubmenuOpen() && !submenuInline() ? pinSubmenu() : void 0,
|
|
@@ -5381,7 +5316,7 @@ function ColumnMenuPopover(props) {
|
|
|
5381
5316
|
item?.focus();
|
|
5382
5317
|
return item != null;
|
|
5383
5318
|
};
|
|
5384
|
-
|
|
5319
|
+
createEffect4(isPinSubmenuOpen, (open) => {
|
|
5385
5320
|
if (!open) {
|
|
5386
5321
|
return;
|
|
5387
5322
|
}
|
|
@@ -5758,7 +5693,7 @@ var columnMenuFeature = {
|
|
|
5758
5693
|
};
|
|
5759
5694
|
|
|
5760
5695
|
// src/primitives/columnReorder.ts
|
|
5761
|
-
import { createEffect as
|
|
5696
|
+
import { createEffect as createEffect5 } from "solid-js";
|
|
5762
5697
|
import {
|
|
5763
5698
|
createColumnHeaderDragController
|
|
5764
5699
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnHeaderDragController";
|
|
@@ -5773,7 +5708,7 @@ function createColumnReorder(args) {
|
|
|
5773
5708
|
centerIndicatorRef,
|
|
5774
5709
|
rightIndicatorRef
|
|
5775
5710
|
}), "render", "columnReorder");
|
|
5776
|
-
|
|
5711
|
+
createEffect5(
|
|
5777
5712
|
() => args().paneLayout,
|
|
5778
5713
|
() => {
|
|
5779
5714
|
controller.applyReorderSettle();
|
|
@@ -5864,12 +5799,10 @@ var conditionalFormatFeature = {
|
|
|
5864
5799
|
|
|
5865
5800
|
// src/features/contextMenu.ts
|
|
5866
5801
|
import {
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
resolveContextMenuColIndex
|
|
5802
|
+
buildBodyContextMenuParams,
|
|
5803
|
+
buildCellContextMenuParams
|
|
5870
5804
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/contextMenuTarget";
|
|
5871
5805
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5872
|
-
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
5873
5806
|
|
|
5874
5807
|
// src/primitives/contextMenu.ts
|
|
5875
5808
|
import { createMemo as createMemo12 } from "solid-js";
|
|
@@ -5890,12 +5823,12 @@ function createCellContextMenu(inputs) {
|
|
|
5890
5823
|
}
|
|
5891
5824
|
|
|
5892
5825
|
// src/view/CellContextMenuPopover.tsx
|
|
5893
|
-
import { For as For7, Match as Match2, Show as Show14, Switch as Switch2, createMemo as createMemo13, createSignal 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";
|
|
5894
5827
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
5895
5828
|
function CellContextMenuPopover(props) {
|
|
5896
5829
|
const portal = useGridPortal();
|
|
5897
5830
|
const container = portal.container();
|
|
5898
|
-
const [panel, setPanel] =
|
|
5831
|
+
const [panel, setPanel] = createSignal10();
|
|
5899
5832
|
let panelElement;
|
|
5900
5833
|
onCleanup9(() => {
|
|
5901
5834
|
if (props.panelRef.current === panelElement) {
|
|
@@ -5996,95 +5929,6 @@ function ActionItem(props) {
|
|
|
5996
5929
|
}
|
|
5997
5930
|
|
|
5998
5931
|
// src/features/contextMenu.ts
|
|
5999
|
-
var buildCellContextMenuParams = ({
|
|
6000
|
-
cell,
|
|
6001
|
-
clientX,
|
|
6002
|
-
clientY,
|
|
6003
|
-
rowModel,
|
|
6004
|
-
orderedColumns,
|
|
6005
|
-
selection,
|
|
6006
|
-
activeCell
|
|
6007
|
-
}) => {
|
|
6008
|
-
const rowIndex = cell.row;
|
|
6009
|
-
const colIndex = cell.col;
|
|
6010
|
-
const row = rowModel.getRow(rowIndex);
|
|
6011
|
-
const column = orderedColumns[colIndex];
|
|
6012
|
-
if (!row || !column) {
|
|
6013
|
-
return null;
|
|
6014
|
-
}
|
|
6015
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
6016
|
-
return {
|
|
6017
|
-
target: {
|
|
6018
|
-
type: "cell",
|
|
6019
|
-
rowIndex,
|
|
6020
|
-
colIndex,
|
|
6021
|
-
rowKey,
|
|
6022
|
-
row,
|
|
6023
|
-
column,
|
|
6024
|
-
value: getCellValue3(row, column)
|
|
6025
|
-
},
|
|
6026
|
-
clientX,
|
|
6027
|
-
clientY,
|
|
6028
|
-
selection,
|
|
6029
|
-
activeCell,
|
|
6030
|
-
isTargetSelected: isContextMenuCellSelected(selection, rowIndex, colIndex)
|
|
6031
|
-
};
|
|
6032
|
-
};
|
|
6033
|
-
var buildBodyContextMenuParams = ({
|
|
6034
|
-
event,
|
|
6035
|
-
rowModel,
|
|
6036
|
-
orderedColumns,
|
|
6037
|
-
selection,
|
|
6038
|
-
activeCell
|
|
6039
|
-
}) => {
|
|
6040
|
-
const targetEl = event.target;
|
|
6041
|
-
if (!targetEl) {
|
|
6042
|
-
return null;
|
|
6043
|
-
}
|
|
6044
|
-
const rowEl = targetEl.closest("[data-row-index]");
|
|
6045
|
-
if (!rowEl) {
|
|
6046
|
-
return null;
|
|
6047
|
-
}
|
|
6048
|
-
const rowIndexRaw = rowEl.dataset.rowIndex;
|
|
6049
|
-
if (rowIndexRaw === void 0) {
|
|
6050
|
-
return null;
|
|
6051
|
-
}
|
|
6052
|
-
const rowIndex = Number(rowIndexRaw);
|
|
6053
|
-
if (!Number.isInteger(rowIndex)) {
|
|
6054
|
-
return null;
|
|
6055
|
-
}
|
|
6056
|
-
const row = rowModel.getRow(rowIndex);
|
|
6057
|
-
if (!row) {
|
|
6058
|
-
return null;
|
|
6059
|
-
}
|
|
6060
|
-
const rowKey = rowModel.getRowKey(rowIndex) ?? rowIndex;
|
|
6061
|
-
const cellEl = targetEl.closest("[data-ssg-col-key]");
|
|
6062
|
-
const colKey = cellEl?.dataset.ssgColKey;
|
|
6063
|
-
if (cellEl && colKey !== void 0) {
|
|
6064
|
-
const colIndex = resolveContextMenuColIndex(orderedColumns, colKey);
|
|
6065
|
-
if (colIndex < 0) {
|
|
6066
|
-
return null;
|
|
6067
|
-
}
|
|
6068
|
-
return buildCellContextMenuParams({
|
|
6069
|
-
cell: { row: rowIndex, col: colIndex },
|
|
6070
|
-
clientX: event.clientX,
|
|
6071
|
-
clientY: event.clientY,
|
|
6072
|
-
rowModel,
|
|
6073
|
-
orderedColumns,
|
|
6074
|
-
selection,
|
|
6075
|
-
activeCell
|
|
6076
|
-
});
|
|
6077
|
-
}
|
|
6078
|
-
const target = { type: "rowHeader", rowIndex, rowKey, row };
|
|
6079
|
-
return {
|
|
6080
|
-
target,
|
|
6081
|
-
clientX: event.clientX,
|
|
6082
|
-
clientY: event.clientY,
|
|
6083
|
-
selection,
|
|
6084
|
-
activeCell,
|
|
6085
|
-
isTargetSelected: isContextMenuRowSelected(selection, rowIndex)
|
|
6086
|
-
};
|
|
6087
|
-
};
|
|
6088
5932
|
var contextMenuFeature = {
|
|
6089
5933
|
// メニューの読み上げの名前の既定(シェルが本体の既定に重ねる)。
|
|
6090
5934
|
localeText: DEFAULT_CONTEXT_MENU_LOCALE_TEXT,
|
|
@@ -6271,9 +6115,10 @@ function createFillHandle(inputs) {
|
|
|
6271
6115
|
}
|
|
6272
6116
|
|
|
6273
6117
|
// src/view/FillHandleLayer.tsx
|
|
6274
|
-
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";
|
|
6275
6119
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6276
|
-
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";
|
|
6277
6122
|
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
6278
6123
|
function FillHandleLayer(props) {
|
|
6279
6124
|
const corner = () => {
|
|
@@ -6355,7 +6200,7 @@ function FillOptionsChip(props) {
|
|
|
6355
6200
|
class={["ssg-fill-options", { "ssg-fill-options--open": props.menuOpen }]}
|
|
6356
6201
|
style={{ position: "absolute", left: px(props.x), top: px(props.y) }}
|
|
6357
6202
|
data-ssg-fill-options=""
|
|
6358
|
-
aria-label={
|
|
6203
|
+
aria-label={formatLocaleText7(texts().fillOptionsCurrent, {
|
|
6359
6204
|
kind: props.kind === "series" ? texts().fillSeries : texts().fillCopy
|
|
6360
6205
|
})}
|
|
6361
6206
|
aria-haspopup="menu"
|
|
@@ -6395,7 +6240,7 @@ function FillOptionsMenu(props) {
|
|
|
6395
6240
|
const texts = useFeatureLocaleText();
|
|
6396
6241
|
const portal = useGridPortal();
|
|
6397
6242
|
const container = portal.container();
|
|
6398
|
-
const [panel, setPanel] =
|
|
6243
|
+
const [panel, setPanel] = createSignal11();
|
|
6399
6244
|
const { menuPanel } = props.fill.controller;
|
|
6400
6245
|
let panelElement;
|
|
6401
6246
|
onCleanup10(() => {
|
|
@@ -6403,7 +6248,7 @@ function FillOptionsMenu(props) {
|
|
|
6403
6248
|
menuPanel.current = null;
|
|
6404
6249
|
}
|
|
6405
6250
|
});
|
|
6406
|
-
|
|
6251
|
+
createEffect6(panel, (element2) => {
|
|
6407
6252
|
element2?.querySelector('[aria-checked="true"]')?.focus({ preventScroll: true });
|
|
6408
6253
|
}, { name: "fillMenuFocus" });
|
|
6409
6254
|
const handleKeyDown = (event) => {
|
|
@@ -6412,7 +6257,7 @@ function FillOptionsMenu(props) {
|
|
|
6412
6257
|
const items = Array.from(
|
|
6413
6258
|
panel()?.querySelectorAll('[role="menuitemradio"]:not(:disabled)') ?? []
|
|
6414
6259
|
);
|
|
6415
|
-
const index = items.findIndex((item) => item ===
|
|
6260
|
+
const index = items.findIndex((item) => item === getActiveElement(item));
|
|
6416
6261
|
const next = items[(index + (event.key === "ArrowDown" ? 1 : items.length - 1)) % items.length];
|
|
6417
6262
|
next?.focus({ preventScroll: true });
|
|
6418
6263
|
} else if (readEventKey(event) === "Tab") {
|
|
@@ -6473,7 +6318,7 @@ function FillTooltip(props) {
|
|
|
6473
6318
|
}, "fillPointerStore");
|
|
6474
6319
|
const visible = createMemo15(() => pointer() !== null);
|
|
6475
6320
|
const container = createMemo15(() => visible() ? portal.container() : null);
|
|
6476
|
-
const [tooltip, setTooltip] =
|
|
6321
|
+
const [tooltip, setTooltip] = createSignal11();
|
|
6477
6322
|
const element = <Show15 when={container()}>
|
|
6478
6323
|
{(mount) => <Portal4 mount={mount()}>
|
|
6479
6324
|
<div
|
|
@@ -6586,19 +6431,19 @@ function createFilterOrder(inputs) {
|
|
|
6586
6431
|
}
|
|
6587
6432
|
|
|
6588
6433
|
// src/primitives/filterPopover.ts
|
|
6589
|
-
import { createMemo as createMemo17, createSignal as
|
|
6434
|
+
import { createMemo as createMemo17, createSignal as createSignal12, untrack as untrack13 } from "solid-js";
|
|
6590
6435
|
import {
|
|
6591
6436
|
createFilterPopoverController,
|
|
6592
6437
|
resolveOpenedFilterColumn
|
|
6593
6438
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/filterPopoverController";
|
|
6594
6439
|
import { inferColumnFilterType } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/inferFilterType";
|
|
6595
|
-
import { getCellValue as
|
|
6440
|
+
import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
6596
6441
|
import { GROUP_AUTO_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
6597
6442
|
var NO_GROUP_COLUMNS = [];
|
|
6598
6443
|
function createFilterPopover(inputs) {
|
|
6599
6444
|
const controller = createFilterPopoverController();
|
|
6600
6445
|
const autoFilterTypeCache = /* @__PURE__ */ new Map();
|
|
6601
|
-
const resolveAutoColumnFilterType = (column) =>
|
|
6446
|
+
const resolveAutoColumnFilterType = (column) => untrack13(() => {
|
|
6602
6447
|
const currentValue = inputs.columnFilters()[column.key];
|
|
6603
6448
|
if (currentValue?.kind === "numberSet" || currentValue?.kind === "textSet" || currentValue?.kind === "dateSet" || currentValue?.kind === "text") {
|
|
6604
6449
|
return currentValue.kind;
|
|
@@ -6616,7 +6461,7 @@ function createFilterPopover(inputs) {
|
|
|
6616
6461
|
// ラベル行は空として数えます(見出しの文字で数値の列が文字の列に推定されないように)。
|
|
6617
6462
|
getRawValueAt: (index) => {
|
|
6618
6463
|
const row = rows[index];
|
|
6619
|
-
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 :
|
|
6464
|
+
return isLabelRow && row !== void 0 && isLabelRow(row, index) ? void 0 : getCellValue3(row, column);
|
|
6620
6465
|
}
|
|
6621
6466
|
});
|
|
6622
6467
|
if (result.conclusive) {
|
|
@@ -6629,11 +6474,11 @@ function createFilterPopover(inputs) {
|
|
|
6629
6474
|
const groups = groupColumns();
|
|
6630
6475
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6631
6476
|
});
|
|
6632
|
-
const resolveAnchorColumnKey = (columnKey) =>
|
|
6477
|
+
const resolveAnchorColumnKey = (columnKey) => untrack13(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6633
6478
|
const snapshot = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6634
6479
|
const state = createMemo17(() => snapshot().state);
|
|
6635
6480
|
const layout = createMemo17(() => snapshot().layout);
|
|
6636
|
-
const [panel, setPanel] =
|
|
6481
|
+
const [panel, setPanel] = createSignal12(null);
|
|
6637
6482
|
connectController(
|
|
6638
6483
|
controller,
|
|
6639
6484
|
() => {
|
|
@@ -6657,7 +6502,7 @@ function createFilterPopover(inputs) {
|
|
|
6657
6502
|
const openedColumn = createMemo17(() => {
|
|
6658
6503
|
openedColumnKey();
|
|
6659
6504
|
openedFilterType();
|
|
6660
|
-
return resolveOpenedFilterColumn(popoverColumns(),
|
|
6505
|
+
return resolveOpenedFilterColumn(popoverColumns(), untrack13(state));
|
|
6661
6506
|
});
|
|
6662
6507
|
return {
|
|
6663
6508
|
state,
|
|
@@ -6682,13 +6527,13 @@ function createFilterPopover(inputs) {
|
|
|
6682
6527
|
}
|
|
6683
6528
|
|
|
6684
6529
|
// src/primitives/filterManagement.ts
|
|
6685
|
-
import { createMemo as createMemo18, onCleanup as onCleanup11, untrack as
|
|
6530
|
+
import { createMemo as createMemo18, onCleanup as onCleanup11, untrack as untrack14 } from "solid-js";
|
|
6686
6531
|
import {
|
|
6687
6532
|
createColumnFilterDescribeOptions,
|
|
6688
6533
|
describeColumnFilterValue
|
|
6689
6534
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6690
6535
|
import { isActiveColumnFilterValue as isActiveColumnFilterValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6691
|
-
import { formatLocaleText as
|
|
6536
|
+
import { formatLocaleText as formatLocaleText8 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6692
6537
|
import {
|
|
6693
6538
|
computeSinglePaneColumnExtent as computeSinglePaneColumnExtent2
|
|
6694
6539
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry";
|
|
@@ -6738,7 +6583,7 @@ function createFilterManagement(inputs) {
|
|
|
6738
6583
|
const grouped = groupColumnKeys();
|
|
6739
6584
|
return [...inputs.visibleColumns(), ...groupColumns()].filter((column) => Boolean(column.filterType) && !isActiveColumnFilterValue2(columnFilters[column.key])).map((column) => ({
|
|
6740
6585
|
key: column.key,
|
|
6741
|
-
title: grouped.has(column.key) ?
|
|
6586
|
+
title: grouped.has(column.key) ? formatLocaleText8(texts.groupedColumnTitle, { column: column.title || column.key }) : column.title || column.key
|
|
6742
6587
|
}));
|
|
6743
6588
|
});
|
|
6744
6589
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
@@ -6757,7 +6602,7 @@ function createFilterManagement(inputs) {
|
|
|
6757
6602
|
});
|
|
6758
6603
|
pendingFrames.add(frame);
|
|
6759
6604
|
};
|
|
6760
|
-
const jumpToColumnFilter = (columnKey) =>
|
|
6605
|
+
const jumpToColumnFilter = (columnKey) => untrack14(() => {
|
|
6761
6606
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
6762
6607
|
const groupColumn = groupColumns().find((candidate) => candidate.key === columnKey);
|
|
6763
6608
|
const anchorKey = groupColumn ? GROUP_AUTO_COLUMN_KEY2 : columnKey;
|
|
@@ -6822,7 +6667,7 @@ function createFilterManagement(inputs) {
|
|
|
6822
6667
|
}
|
|
6823
6668
|
|
|
6824
6669
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
6825
|
-
import { Show as Show16, createMemo as createMemo19, untrack as
|
|
6670
|
+
import { Show as Show16, createMemo as createMemo19, untrack as untrack15 } from "solid-js";
|
|
6826
6671
|
import {
|
|
6827
6672
|
createFilterPopoverCommands,
|
|
6828
6673
|
createFilterPopoverDerivedResolver
|
|
@@ -6849,8 +6694,8 @@ import {
|
|
|
6849
6694
|
describeColumnFilterValue as describeColumnFilterValue2
|
|
6850
6695
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6851
6696
|
import { normalizeDateFilterPresets } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
|
|
6852
|
-
import { formatLocaleText as
|
|
6853
|
-
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";
|
|
6854
6699
|
function ColumnFilterPopoverHost(props) {
|
|
6855
6700
|
const filterPopover = props.filterPopover;
|
|
6856
6701
|
const openedColumn = filterPopover.openedColumn;
|
|
@@ -6880,7 +6725,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6880
6725
|
if (!column) {
|
|
6881
6726
|
return void 0;
|
|
6882
6727
|
}
|
|
6883
|
-
const value =
|
|
6728
|
+
const value = getCellValue4(rows[index], column);
|
|
6884
6729
|
return isDateSet ? toDateSetKey(value) : value;
|
|
6885
6730
|
};
|
|
6886
6731
|
});
|
|
@@ -6957,7 +6802,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6957
6802
|
}
|
|
6958
6803
|
const rawValue = props.columnFilters[column.key];
|
|
6959
6804
|
if (isSetColumnFilterValue(rawValue)) {
|
|
6960
|
-
return
|
|
6805
|
+
return formatLocaleText9(rawValue.mode === "exclude" ? texts().filterCurrentExcluded : texts().filterCurrentSelected, {
|
|
6961
6806
|
count: rawValue.values.length
|
|
6962
6807
|
});
|
|
6963
6808
|
}
|
|
@@ -6999,11 +6844,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
6999
6844
|
{(column) => <Show16 when={filterPopover.layout()}>
|
|
7000
6845
|
{(layout) => <Show16 when={props.views()}>
|
|
7001
6846
|
{(views) => {
|
|
7002
|
-
const ColumnFilterPopover =
|
|
7003
|
-
return <
|
|
6847
|
+
const ColumnFilterPopover = untrack15(views).ColumnFilterPopover;
|
|
6848
|
+
return <Show16 when={column().key} keyed>
|
|
6849
|
+
{(columnKey) => <ColumnFilterPopover
|
|
7004
6850
|
popoverSlot={props.popoverSlot}
|
|
7005
6851
|
themeClassName={props.themeClassName}
|
|
7006
|
-
title={column().title ||
|
|
6852
|
+
title={column().title || columnKey}
|
|
7007
6853
|
filterType={openedType() ?? "text"}
|
|
7008
6854
|
isServerSide={props.isServerSide && !usesAsyncOptions()}
|
|
7009
6855
|
draftValue={filterPopover.state()?.draftValue ?? ""}
|
|
@@ -7039,7 +6885,8 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7039
6885
|
onSetSelectAllChange={commands.handleSetFilterSelectAllChange}
|
|
7040
6886
|
onSetClear={commands.clearSetFilterPopoverValue}
|
|
7041
6887
|
onSetReplaceSelection={commands.handleSetFilterReplaceSelection}
|
|
7042
|
-
|
|
6888
|
+
/>}
|
|
6889
|
+
</Show16>;
|
|
7043
6890
|
}}
|
|
7044
6891
|
</Show16>}
|
|
7045
6892
|
</Show16>}
|
|
@@ -7048,7 +6895,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7048
6895
|
|
|
7049
6896
|
// src/view/GridFilterChipBar.tsx
|
|
7050
6897
|
import { For as For9, Show as Show17, createUniqueId as createUniqueId5 } from "solid-js";
|
|
7051
|
-
import { formatLocaleText as
|
|
6898
|
+
import { formatLocaleText as formatLocaleText10 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7052
6899
|
function GridFilterChipBar(props) {
|
|
7053
6900
|
const texts = useFeatureLocaleText();
|
|
7054
6901
|
const chipIdBase = createUniqueId5();
|
|
@@ -7077,7 +6924,7 @@ function GridFilterChipBar(props) {
|
|
|
7077
6924
|
class="ssg-filter-chip-clear"
|
|
7078
6925
|
disabled={!props.canFilter}
|
|
7079
6926
|
data-ssg-tooltip={texts().filterClear}
|
|
7080
|
-
aria-label={
|
|
6927
|
+
aria-label={formatLocaleText10(texts().filterClearFor, { column: entry().title })}
|
|
7081
6928
|
onClick={() => props.onClearFilter(entry().columnKey)}
|
|
7082
6929
|
>
|
|
7083
6930
|
×
|
|
@@ -7086,7 +6933,7 @@ function GridFilterChipBar(props) {
|
|
|
7086
6933
|
/* 名前の後半(操作の説明)。ボタンの中に置くと文字に混ざるので外に置きます。 */
|
|
7087
6934
|
}
|
|
7088
6935
|
<span id={`${chipIdBase}-${index()}-action`} hidden>
|
|
7089
|
-
{
|
|
6936
|
+
{formatLocaleText10(texts().filterEditFor, { column: entry().title })}
|
|
7090
6937
|
</span>
|
|
7091
6938
|
</div>}
|
|
7092
6939
|
</For9>
|
|
@@ -7103,11 +6950,11 @@ function GridFilterChipBar(props) {
|
|
|
7103
6950
|
}
|
|
7104
6951
|
|
|
7105
6952
|
// src/view/lazyPopups.ts
|
|
7106
|
-
import { createEffect as
|
|
6953
|
+
import { createEffect as createEffect7, createMemo as createMemo20 } from "solid-js";
|
|
7107
6954
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
7108
6955
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
7109
|
-
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-
|
|
7110
|
-
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-
|
|
6956
|
+
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-2DW5SZT3.jsx"));
|
|
6957
|
+
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-HIQGRX3N.jsx"));
|
|
7111
6958
|
var preloadGridPopups = async () => {
|
|
7112
6959
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
7113
6960
|
};
|
|
@@ -7116,7 +6963,7 @@ var reportLoadError = (error) => {
|
|
|
7116
6963
|
};
|
|
7117
6964
|
function createLazyModuleSignal(module, options, name) {
|
|
7118
6965
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
7119
|
-
|
|
6966
|
+
createEffect7(
|
|
7120
6967
|
createMemo20(() => options.needed() && loaded() === null),
|
|
7121
6968
|
(shouldLoad) => {
|
|
7122
6969
|
if (!shouldLoad) {
|
|
@@ -7135,7 +6982,7 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
7135
6982
|
},
|
|
7136
6983
|
{ name: `${name}Load` }
|
|
7137
6984
|
);
|
|
7138
|
-
|
|
6985
|
+
createEffect7(
|
|
7139
6986
|
createMemo20(() => options.prefetch() && module.getSnapshot() === null),
|
|
7140
6987
|
(shouldPrefetch) => {
|
|
7141
6988
|
if (!shouldPrefetch) {
|
|
@@ -7171,18 +7018,18 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7171
7018
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7172
7019
|
|
|
7173
7020
|
// src/view/GridFindBar.tsx
|
|
7174
|
-
import { createRenderEffect as
|
|
7021
|
+
import { createRenderEffect as createRenderEffect5, createSignal as createSignal13, onSettled as onSettled7, untrack as untrack16 } from "solid-js";
|
|
7175
7022
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7176
7023
|
function GridFindBar(props) {
|
|
7177
7024
|
const texts = useFeatureLocaleText();
|
|
7178
|
-
const [input, setInput] =
|
|
7179
|
-
const initialQuery =
|
|
7025
|
+
const [input, setInput] = createSignal13();
|
|
7026
|
+
const initialQuery = untrack16(() => props.snapshot.query);
|
|
7180
7027
|
onSettled7(() => {
|
|
7181
|
-
const element =
|
|
7028
|
+
const element = untrack16(input);
|
|
7182
7029
|
element?.focus();
|
|
7183
7030
|
element?.select();
|
|
7184
7031
|
});
|
|
7185
|
-
|
|
7032
|
+
createRenderEffect5(
|
|
7186
7033
|
() => [input(), props.snapshot.query],
|
|
7187
7034
|
([element, query]) => {
|
|
7188
7035
|
if (element && element.value !== query) {
|
|
@@ -7314,7 +7161,7 @@ import {
|
|
|
7314
7161
|
formatTotalRowNumber,
|
|
7315
7162
|
resolveTotalRowCaption
|
|
7316
7163
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
7317
|
-
import { formatLocaleText as
|
|
7164
|
+
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7318
7165
|
var GROUP_INDENT_PX = 16;
|
|
7319
7166
|
function GridBodyGroupRow(props) {
|
|
7320
7167
|
const texts = useFeatureLocaleText();
|
|
@@ -7429,7 +7276,7 @@ function GridBodyGroupRow(props) {
|
|
|
7429
7276
|
tabindex={-1}
|
|
7430
7277
|
class="ssg-group-toggle"
|
|
7431
7278
|
aria-expanded={props.isCollapsed ? "false" : "true"}
|
|
7432
|
-
aria-label={
|
|
7279
|
+
aria-label={formatLocaleText11(props.isCollapsed ? texts().expandGroup : texts().collapseGroup, {
|
|
7433
7280
|
group: groupLabel()
|
|
7434
7281
|
})}
|
|
7435
7282
|
onClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
@@ -7439,7 +7286,7 @@ function GridBodyGroupRow(props) {
|
|
|
7439
7286
|
</button>
|
|
7440
7287
|
<span class="ssg-group-label">{groupLabel()}</span>
|
|
7441
7288
|
<span class="ssg-group-count">
|
|
7442
|
-
{
|
|
7289
|
+
{formatLocaleText11(texts().groupRowCount, { count: formatTotalRowNumber(props.groupRow.leafCount) })}
|
|
7443
7290
|
</span>
|
|
7444
7291
|
</Show18>
|
|
7445
7292
|
</div>;
|
|
@@ -7673,12 +7520,12 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7673
7520
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7674
7521
|
|
|
7675
7522
|
// src/primitives/serverSide.ts
|
|
7676
|
-
import { createMemo as createMemo24, untrack as
|
|
7523
|
+
import { createMemo as createMemo24, untrack as untrack17 } from "solid-js";
|
|
7677
7524
|
import {
|
|
7678
7525
|
createServerSideRowModel
|
|
7679
7526
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
7680
7527
|
function createServerSide(args) {
|
|
7681
|
-
const controller = createServerSideRowModel(
|
|
7528
|
+
const controller = createServerSideRowModel(untrack17(args));
|
|
7682
7529
|
let updated = false;
|
|
7683
7530
|
let pendingRange = null;
|
|
7684
7531
|
connectController(
|
|
@@ -7725,11 +7572,11 @@ function createServerSide(args) {
|
|
|
7725
7572
|
}
|
|
7726
7573
|
|
|
7727
7574
|
// src/view/GridServerSideErrorBars.tsx
|
|
7728
|
-
import { Show as Show21, createSignal as
|
|
7729
|
-
import { formatLocaleText as
|
|
7575
|
+
import { Show as Show21, createSignal as createSignal14 } from "solid-js";
|
|
7576
|
+
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7730
7577
|
function GridServerSideErrorBars(props) {
|
|
7731
|
-
const [dismissedLoadError, setDismissedLoadError] =
|
|
7732
|
-
const [dismissedWriteError, setDismissedWriteError] =
|
|
7578
|
+
const [dismissedLoadError, setDismissedLoadError] = createSignal14(null);
|
|
7579
|
+
const [dismissedWriteError, setDismissedWriteError] = createSignal14(null);
|
|
7733
7580
|
const texts = () => props.localeTexts;
|
|
7734
7581
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7735
7582
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
@@ -7739,7 +7586,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7739
7586
|
{(loadError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7740
7587
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7741
7588
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7742
|
-
{
|
|
7589
|
+
{formatLocaleText12(texts().loadFailed, { count: loadError().failedBlockCount })}
|
|
7743
7590
|
</span>
|
|
7744
7591
|
<button type="button" class="ssg-ssrm-error-bar-retry" onClick={() => props.onRetry()}>
|
|
7745
7592
|
{texts().retry}
|
|
@@ -7758,7 +7605,7 @@ function GridServerSideErrorBars(props) {
|
|
|
7758
7605
|
{(writeError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7759
7606
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7760
7607
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7761
|
-
{
|
|
7608
|
+
{formatLocaleText12(texts().saveFailed, { count: writeError().failedRowCount })}
|
|
7762
7609
|
</span>
|
|
7763
7610
|
<button
|
|
7764
7611
|
type="button"
|
|
@@ -7905,8 +7752,8 @@ import { For as For12, Show as Show24, createMemo as createMemo25 } from "solid-
|
|
|
7905
7752
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
7906
7753
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
7907
7754
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
7908
|
-
import { formatLocaleText as
|
|
7909
|
-
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";
|
|
7910
7757
|
var noop4 = () => {
|
|
7911
7758
|
};
|
|
7912
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";
|
|
@@ -7969,7 +7816,7 @@ function GridPinnedRows(props) {
|
|
|
7969
7816
|
class="ssg-pinned-row-icon"
|
|
7970
7817
|
viewBox="0 0 16 16"
|
|
7971
7818
|
role="img"
|
|
7972
|
-
aria-label={
|
|
7819
|
+
aria-label={formatLocaleText13(
|
|
7973
7820
|
props.position === "top" ? texts().pinnedTopRow : texts().pinnedBottomRow,
|
|
7974
7821
|
{ row: index + 1 }
|
|
7975
7822
|
)}
|
|
@@ -7982,7 +7829,7 @@ function GridPinnedRows(props) {
|
|
|
7982
7829
|
{(entry) => {
|
|
7983
7830
|
const unbound = createMemo25(() => entry().column);
|
|
7984
7831
|
const column = () => unbound();
|
|
7985
|
-
const value = createMemo25(() =>
|
|
7832
|
+
const value = createMemo25(() => getCellValue5(row(), unbound()));
|
|
7986
7833
|
const colIndex = createMemo25(() => entry().logicalIndex);
|
|
7987
7834
|
const ctx = createMemo25(
|
|
7988
7835
|
() => ({
|
|
@@ -8116,81 +7963,28 @@ var pinnedRowsFeature = {
|
|
|
8116
7963
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8117
7964
|
|
|
8118
7965
|
// src/primitives/rowDrag.ts
|
|
8119
|
-
import { createEffect as
|
|
7966
|
+
import { createEffect as createEffect8, createMemo as createMemo26, untrack as untrack18 } from "solid-js";
|
|
8120
7967
|
import {
|
|
8121
7968
|
createRowDragController
|
|
8122
7969
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
8123
|
-
import {
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
7970
|
+
import {
|
|
7971
|
+
createRowDropCheck,
|
|
7972
|
+
getDragRowToken,
|
|
7973
|
+
locateDragRowToken,
|
|
7974
|
+
resolveRowDragLabel
|
|
7975
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowDragTarget";
|
|
8127
7976
|
function createRowDrag(inputs) {
|
|
8128
7977
|
const controller = createRowDragController();
|
|
8129
7978
|
const leftIndicatorRef = { current: null };
|
|
8130
7979
|
const centerIndicatorRef = { current: null };
|
|
8131
7980
|
const rightIndicatorRef = { current: null };
|
|
8132
|
-
const canDropAt = createMemo26(() =>
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
return void 0;
|
|
8136
|
-
}
|
|
8137
|
-
const rows = inputs.rows();
|
|
8138
|
-
const resolveRowKey = inputs.resolveRowKey();
|
|
8139
|
-
return (fromIndex, slot) => {
|
|
8140
|
-
const toIndex = resolveMoveTargetIndex(fromIndex, slot);
|
|
8141
|
-
const row = rows[fromIndex];
|
|
8142
|
-
if (toIndex === null || row === void 0) return false;
|
|
8143
|
-
return canDropRow({
|
|
8144
|
-
row,
|
|
8145
|
-
rowKey: resolveRowKey(row, fromIndex),
|
|
8146
|
-
fromIndex,
|
|
8147
|
-
toIndex,
|
|
8148
|
-
rowAbove: slot > 0 ? rows[slot - 1] : void 0,
|
|
8149
|
-
rowBelow: slot < rows.length ? rows[slot] : void 0,
|
|
8150
|
-
rows
|
|
8151
|
-
});
|
|
8152
|
-
};
|
|
8153
|
-
});
|
|
8154
|
-
const getRowDragLabel = (viewIndex) => {
|
|
8155
|
-
const fallback = formatLocaleText13(untrack19(inputs.dragRowLabel), { row: viewIndex + 1 });
|
|
8156
|
-
const row = untrack19(inputs.rowModel).getRow(viewIndex);
|
|
8157
|
-
if (!row) {
|
|
8158
|
-
return fallback;
|
|
8159
|
-
}
|
|
8160
|
-
const column = untrack19(inputs.visibleColumns).find(
|
|
8161
|
-
(candidate) => !isSyntheticColumnKey4(candidate.key) && (candidate.renderCell === void 0 || candidate.valueFormatter !== void 0) && candidate.editor?.type !== "checkbox" && candidate.conditionalFormat?.dataBar?.showValue !== false
|
|
8162
|
-
);
|
|
8163
|
-
if (!column) {
|
|
8164
|
-
return fallback;
|
|
8165
|
-
}
|
|
8166
|
-
const value = getCellValue7(row, column);
|
|
8167
|
-
const text = column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
8168
|
-
return text.trim().length > 0 ? text : fallback;
|
|
8169
|
-
};
|
|
8170
|
-
const getDragRow = (viewIndex) => {
|
|
8171
|
-
const rowModel = untrack19(inputs.rowModel);
|
|
8172
|
-
const row = rowModel.getRow(viewIndex);
|
|
8173
|
-
if (row === void 0) return null;
|
|
8174
|
-
return { row, rowKey: rowModel.getRowKey(viewIndex), rowCount: rowModel.getRowCount() };
|
|
8175
|
-
};
|
|
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);
|
|
8176
7984
|
const locateDragRow = createMemo26(() => {
|
|
8177
7985
|
const rowModel = inputs.rowModel();
|
|
8178
7986
|
const hasRowKeys = inputs.hasRowKeys();
|
|
8179
|
-
return (token, hint) =>
|
|
8180
|
-
const { row, rowKey, rowCount } = token;
|
|
8181
|
-
if (rowModel.getRow(hint) === row) return hint;
|
|
8182
|
-
const count = rowModel.getRowCount();
|
|
8183
|
-
for (let index = 0; index < count; index += 1) {
|
|
8184
|
-
if (rowModel.getRow(index) === row) return index;
|
|
8185
|
-
}
|
|
8186
|
-
if (hasRowKeys) {
|
|
8187
|
-
for (let index = 0; index < count; index += 1) {
|
|
8188
|
-
if (Object.is(rowModel.getRowKey(index), rowKey)) return index;
|
|
8189
|
-
}
|
|
8190
|
-
return null;
|
|
8191
|
-
}
|
|
8192
|
-
return count === rowCount && hint < rowCount ? hint : null;
|
|
8193
|
-
};
|
|
7987
|
+
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
8194
7988
|
});
|
|
8195
7989
|
connectController(
|
|
8196
7990
|
controller,
|
|
@@ -8207,7 +8001,7 @@ function createRowDrag(inputs) {
|
|
|
8207
8001
|
"effect",
|
|
8208
8002
|
"rowDrag"
|
|
8209
8003
|
);
|
|
8210
|
-
|
|
8004
|
+
createEffect8(inputs.rowModel, () => {
|
|
8211
8005
|
controller.applyReorderSettle();
|
|
8212
8006
|
}, { name: "rowDragSettle" });
|
|
8213
8007
|
return {
|
|
@@ -8261,9 +8055,9 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8261
8055
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8262
8056
|
|
|
8263
8057
|
// src/view/GridScrollHint.tsx
|
|
8264
|
-
import { For as For13, Show as Show25, createMemo as createMemo27, createSignal as
|
|
8058
|
+
import { For as For13, Show as Show25, createMemo as createMemo27, createSignal as createSignal15, createEffect as createEffect9 } from "solid-js";
|
|
8265
8059
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8266
|
-
import { resolveDataRowNumber as
|
|
8060
|
+
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8267
8061
|
import {
|
|
8268
8062
|
computeScrollHintRulerTicks,
|
|
8269
8063
|
computeScrollHintTrack,
|
|
@@ -8279,11 +8073,11 @@ var SCROLL_HINT_OVERLAY_TRACK_ZONE_PX = 8;
|
|
|
8279
8073
|
var SCROLL_HINT_JUMP_LABEL_FLIP_PX = 28;
|
|
8280
8074
|
function GridScrollHint(props) {
|
|
8281
8075
|
const texts = useFeatureLocaleText();
|
|
8282
|
-
const [scrollActive, setScrollActive] =
|
|
8283
|
-
const [hovered, setHovered] =
|
|
8284
|
-
const [scrollbarWidth, setScrollbarWidth] =
|
|
8285
|
-
const [trackPointerY, setTrackPointerY] =
|
|
8286
|
-
const [dragging, setDragging] =
|
|
8076
|
+
const [scrollActive, setScrollActive] = createSignal15(false);
|
|
8077
|
+
const [hovered, setHovered] = createSignal15(false);
|
|
8078
|
+
const [scrollbarWidth, setScrollbarWidth] = createSignal15(0);
|
|
8079
|
+
const [trackPointerY, setTrackPointerY] = createSignal15(null);
|
|
8080
|
+
const [dragging, setDragging] = createSignal15(false);
|
|
8287
8081
|
let lingerTimer = null;
|
|
8288
8082
|
let dragGrab = null;
|
|
8289
8083
|
let gutter;
|
|
@@ -8299,7 +8093,7 @@ function GridScrollHint(props) {
|
|
|
8299
8093
|
})
|
|
8300
8094
|
);
|
|
8301
8095
|
const shown = createMemo27(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8302
|
-
|
|
8096
|
+
createEffect9(scrollbar, (customScrollbar) => {
|
|
8303
8097
|
const element = props.scrollContainerRef.current;
|
|
8304
8098
|
if (!element) {
|
|
8305
8099
|
return void 0;
|
|
@@ -8348,7 +8142,7 @@ function GridScrollHint(props) {
|
|
|
8348
8142
|
}
|
|
8349
8143
|
};
|
|
8350
8144
|
}, { name: "scrollHintListeners" });
|
|
8351
|
-
|
|
8145
|
+
createEffect9(
|
|
8352
8146
|
() => scrollbar() && shown(),
|
|
8353
8147
|
(on) => {
|
|
8354
8148
|
const element = props.scrollContainerRef.current;
|
|
@@ -8370,7 +8164,7 @@ function GridScrollHint(props) {
|
|
|
8370
8164
|
const dataRowCount = createMemo27(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8371
8165
|
const rowNumberOf = (viewIndex) => {
|
|
8372
8166
|
const labels = props.labelViewIndexes;
|
|
8373
|
-
return labels && labels.length > 0 ?
|
|
8167
|
+
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8374
8168
|
};
|
|
8375
8169
|
const rulerTicks = createMemo27(
|
|
8376
8170
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|