@ishibashi0112/spreadsheet-grid-solid 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +25 -8
- package/README.md +7 -7
- package/dist/index.js +2052 -1951
- package/dist/primitives/reusedRow.d.ts +2 -0
- package/dist/primitives/rowSlots.d.ts +12 -0
- package/dist/primitives/serverSide.d.ts +1 -0
- package/dist/source/index.jsx +179 -35
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RowSlotKind = 'data' | 'skeleton' | 'keyed';
|
|
2
|
+
export type RowSlotItem = {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
};
|
|
5
|
+
export type SlottedRow<R extends RowSlotItem> = R & {
|
|
6
|
+
readonly slot: string;
|
|
7
|
+
};
|
|
8
|
+
export type RowSlotState<R extends RowSlotItem> = {
|
|
9
|
+
readonly items: readonly SlottedRow<R>[];
|
|
10
|
+
readonly next: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const assignRowSlots: <R extends RowSlotItem>(prev: RowSlotState<R> | undefined, rows: readonly R[], kindOf: (row: R) => RowSlotKind, reuseFreedSlots: boolean) => RowSlotState<R>;
|
|
@@ -4,6 +4,7 @@ export declare function createServerSide<T>(args: () => ServerSideRowModelArgs<T
|
|
|
4
4
|
rowCount: () => number;
|
|
5
5
|
loadError: import("solid-js").SourceAccessor<import("@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel").ServerSideLoadErrorState | null>;
|
|
6
6
|
writeError: import("solid-js").SourceAccessor<import("@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel").ServerSideWriteErrorState | null>;
|
|
7
|
+
refetching: import("solid-js").SourceAccessor<boolean>;
|
|
7
8
|
isRowLoaded: (viewIndex: number) => boolean;
|
|
8
9
|
requestRange: (startIndex: number, endIndex: number) => void;
|
|
9
10
|
refresh: () => void;
|
package/dist/source/index.jsx
CHANGED
|
@@ -598,7 +598,7 @@ function GridHeaderRow(props) {
|
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
// src/view/GridBodyLayer.tsx
|
|
601
|
-
import { For as For2, Show as Show2, createMemo as createMemo5, untrack as untrack3 } from "solid-js";
|
|
601
|
+
import { For as For2, Show as Show2, createMemo as createMemo5, createRenderEffect, untrack as untrack3 } from "solid-js";
|
|
602
602
|
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
603
603
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
604
604
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -639,6 +639,83 @@ var markClickTarget = (element) => {
|
|
|
639
639
|
element.onclick = noop;
|
|
640
640
|
};
|
|
641
641
|
|
|
642
|
+
// src/primitives/rowSlots.ts
|
|
643
|
+
var PREFIX = { data: "r", skeleton: "s", keyed: "k" };
|
|
644
|
+
var assignRowSlots = (prev, rows, kindOf, reuseFreedSlots) => {
|
|
645
|
+
const slotByKey = /* @__PURE__ */ new Map();
|
|
646
|
+
if (prev) {
|
|
647
|
+
for (const item of prev.items) {
|
|
648
|
+
slotByKey.set(item.key, item.slot);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const used = /* @__PURE__ */ new Set();
|
|
652
|
+
const items = new Array(rows.length);
|
|
653
|
+
const unassigned = [];
|
|
654
|
+
for (let index = 0; index < rows.length; index += 1) {
|
|
655
|
+
const row = rows[index];
|
|
656
|
+
const kind = kindOf(row);
|
|
657
|
+
if (kind === "keyed") {
|
|
658
|
+
const slot2 = `${PREFIX.keyed}${row.key}`;
|
|
659
|
+
items[index] = { ...row, slot: slot2 };
|
|
660
|
+
used.add(slot2);
|
|
661
|
+
continue;
|
|
662
|
+
}
|
|
663
|
+
const slot = slotByKey.get(row.key);
|
|
664
|
+
if (slot !== void 0 && slot[0] === PREFIX[kind] && !used.has(slot)) {
|
|
665
|
+
items[index] = { ...row, slot };
|
|
666
|
+
used.add(slot);
|
|
667
|
+
} else {
|
|
668
|
+
unassigned.push(index);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
const freed = { [PREFIX.data]: [], [PREFIX.skeleton]: [] };
|
|
672
|
+
if (reuseFreedSlots && prev) {
|
|
673
|
+
for (const item of prev.items) {
|
|
674
|
+
if (!used.has(item.slot)) {
|
|
675
|
+
freed[item.slot[0]]?.push(item.slot);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
const taken = { [PREFIX.data]: 0, [PREFIX.skeleton]: 0 };
|
|
680
|
+
let next = prev?.next ?? 0;
|
|
681
|
+
for (const index of unassigned) {
|
|
682
|
+
const row = rows[index];
|
|
683
|
+
const prefix = PREFIX[kindOf(row)];
|
|
684
|
+
const position = taken[prefix];
|
|
685
|
+
let slot = freed[prefix][position];
|
|
686
|
+
if (slot === void 0) {
|
|
687
|
+
slot = `${prefix}${next}`;
|
|
688
|
+
next += 1;
|
|
689
|
+
} else {
|
|
690
|
+
taken[prefix] = position + 1;
|
|
691
|
+
}
|
|
692
|
+
items[index] = { ...row, slot };
|
|
693
|
+
}
|
|
694
|
+
return { items, next };
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
// src/primitives/reusedRow.ts
|
|
698
|
+
var REUSED_ROW_ATTRIBUTE = "data-ssg-reused";
|
|
699
|
+
var marked = /* @__PURE__ */ new Set();
|
|
700
|
+
var frame = null;
|
|
701
|
+
var release = () => {
|
|
702
|
+
frame = null;
|
|
703
|
+
for (const element of marked) {
|
|
704
|
+
element.removeAttribute(REUSED_ROW_ATTRIBUTE);
|
|
705
|
+
}
|
|
706
|
+
marked.clear();
|
|
707
|
+
};
|
|
708
|
+
var markReusedRow = (element) => {
|
|
709
|
+
element.setAttribute(REUSED_ROW_ATTRIBUTE, "");
|
|
710
|
+
marked.add(element);
|
|
711
|
+
if (frame !== null || typeof requestAnimationFrame !== "function") {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
frame = requestAnimationFrame(() => {
|
|
715
|
+
frame = requestAnimationFrame(release);
|
|
716
|
+
});
|
|
717
|
+
};
|
|
718
|
+
|
|
642
719
|
// src/view/GridBodyLayer.tsx
|
|
643
720
|
var NO_SELECTED_COLUMNS = [-1, -1];
|
|
644
721
|
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
@@ -652,11 +729,24 @@ var joinClasses = (...parts) => {
|
|
|
652
729
|
return out;
|
|
653
730
|
};
|
|
654
731
|
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
655
|
-
var cellKey = (entry) => isPlainCellColumn(entry.column) ?
|
|
732
|
+
var cellKey = (entry) => `${entry.column.key}\0${isPlainCellColumn(entry.column) ? "plain" : "decorated"}${entry.column.renderCell ? "+render" : ""}`;
|
|
656
733
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
657
734
|
function GridBodyLayer(props) {
|
|
658
735
|
const texts = useGridLocaleText();
|
|
659
|
-
|
|
736
|
+
const slotKindOf = (row) => {
|
|
737
|
+
if (row.skeleton) {
|
|
738
|
+
return "skeleton";
|
|
739
|
+
}
|
|
740
|
+
const model = props.rowModel;
|
|
741
|
+
return model.getGroupRow?.(row.index) !== void 0 || model.getLabelRow?.(row.index) !== void 0 ? "keyed" : "data";
|
|
742
|
+
};
|
|
743
|
+
const slotted = createMemo5(
|
|
744
|
+
(prev) => {
|
|
745
|
+
const model = props.rowModel;
|
|
746
|
+
return { state: assignRowSlots(prev?.state, props.rows, slotKindOf, prev?.model === model), model };
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
return <For2 each={slotted().state.items} keyed={(item) => item.slot}>
|
|
660
750
|
{(item) => {
|
|
661
751
|
const rowIndex = createMemo5(() => item().index);
|
|
662
752
|
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
@@ -740,7 +830,17 @@ function GridBodyLayer(props) {
|
|
|
740
830
|
</Show2>
|
|
741
831
|
<Show2 when={row()}>
|
|
742
832
|
{(currentRow) => {
|
|
743
|
-
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
833
|
+
const rowKey = createMemo5(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
834
|
+
let rowElement;
|
|
835
|
+
createRenderEffect(
|
|
836
|
+
rowKey,
|
|
837
|
+
(_next, previous) => {
|
|
838
|
+
if (previous !== void 0 && rowElement) {
|
|
839
|
+
markReusedRow(rowElement);
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
{ name: "reusedRow" }
|
|
843
|
+
);
|
|
744
844
|
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
745
845
|
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
746
846
|
const isRowChecked = createMemo5(
|
|
@@ -792,6 +892,9 @@ function GridBodyLayer(props) {
|
|
|
792
892
|
);
|
|
793
893
|
const rowNumber = () => props.labelViewIndexes ? resolveDataRowNumber(props.labelViewIndexes, rowIndex()) : rowIndex() + 1;
|
|
794
894
|
return <div
|
|
895
|
+
ref={(element) => {
|
|
896
|
+
rowElement = element;
|
|
897
|
+
}}
|
|
795
898
|
data-pane={props.pane}
|
|
796
899
|
data-row-index={rowIndex()}
|
|
797
900
|
role="row"
|
|
@@ -867,7 +970,6 @@ function GridBodyLayer(props) {
|
|
|
867
970
|
() => rowFindHits()?.get(colIndex()),
|
|
868
971
|
void 0
|
|
869
972
|
);
|
|
870
|
-
const cellRowKey = untrack3(rowKey);
|
|
871
973
|
const cellState = {
|
|
872
974
|
get rowIndex() {
|
|
873
975
|
return rowIndex();
|
|
@@ -878,7 +980,9 @@ function GridBodyLayer(props) {
|
|
|
878
980
|
get sourceRowIndex() {
|
|
879
981
|
return sourceRowIndex();
|
|
880
982
|
},
|
|
881
|
-
rowKey
|
|
983
|
+
get rowKey() {
|
|
984
|
+
return rowKey();
|
|
985
|
+
},
|
|
882
986
|
get findRanges() {
|
|
883
987
|
return findRanges();
|
|
884
988
|
},
|
|
@@ -987,6 +1091,7 @@ function GridBodyLayer(props) {
|
|
|
987
1091
|
hasRenderCell: column().renderCell !== void 0
|
|
988
1092
|
});
|
|
989
1093
|
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
1094
|
+
const keyedContent = untrack3(() => entry().column.renderCell !== void 0);
|
|
990
1095
|
const cellChildren = plain ? () => props.renderCellContent(currentRow, column(), cellState) : () => <>
|
|
991
1096
|
<Show2 when={dataBar()}>
|
|
992
1097
|
{(bar) => <span
|
|
@@ -1008,6 +1113,10 @@ function GridBodyLayer(props) {
|
|
|
1008
1113
|
</div>
|
|
1009
1114
|
</Show2>
|
|
1010
1115
|
</>;
|
|
1116
|
+
const cellContent = keyedContent ? () => {
|
|
1117
|
+
rowKey();
|
|
1118
|
+
return cellChildren();
|
|
1119
|
+
} : cellChildren;
|
|
1011
1120
|
return <div
|
|
1012
1121
|
role="gridcell"
|
|
1013
1122
|
aria-colindex={colIndex() + 2}
|
|
@@ -1062,7 +1171,7 @@ function GridBodyLayer(props) {
|
|
|
1062
1171
|
"z-index": isActive() ? 3 : 1
|
|
1063
1172
|
}}
|
|
1064
1173
|
>
|
|
1065
|
-
{
|
|
1174
|
+
{cellContent()}
|
|
1066
1175
|
</div>;
|
|
1067
1176
|
}}
|
|
1068
1177
|
</For2>
|
|
@@ -1232,7 +1341,7 @@ import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
1232
1341
|
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1233
1342
|
|
|
1234
1343
|
// src/editors/TextCellEditor.tsx
|
|
1235
|
-
import { Show as Show6, createRenderEffect as
|
|
1344
|
+
import { Show as Show6, createRenderEffect as createRenderEffect3, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1236
1345
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1237
1346
|
import {
|
|
1238
1347
|
fitMultilineEditor,
|
|
@@ -1242,7 +1351,7 @@ import {
|
|
|
1242
1351
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1243
1352
|
|
|
1244
1353
|
// src/primitives/topAlignedInput.ts
|
|
1245
|
-
import { createRenderEffect, onSettled, untrack as untrack5 } from "solid-js";
|
|
1354
|
+
import { createRenderEffect as createRenderEffect2, onSettled, untrack as untrack5 } from "solid-js";
|
|
1246
1355
|
import {
|
|
1247
1356
|
alignInputTextToTop,
|
|
1248
1357
|
resolveHiddenTopOf
|
|
@@ -1254,7 +1363,7 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1254
1363
|
}
|
|
1255
1364
|
};
|
|
1256
1365
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1257
|
-
|
|
1366
|
+
createRenderEffect2(read, apply, { name: "topAlignedInput" });
|
|
1258
1367
|
onSettled(() => apply(untrack5(read)));
|
|
1259
1368
|
}
|
|
1260
1369
|
|
|
@@ -1321,7 +1430,7 @@ function TextCellEditor(props) {
|
|
|
1321
1430
|
element.setSelectionRange(caret, caret);
|
|
1322
1431
|
}
|
|
1323
1432
|
};
|
|
1324
|
-
|
|
1433
|
+
createRenderEffect3(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1325
1434
|
onSettled3(() => {
|
|
1326
1435
|
const element = untrack6(() => input() ?? textarea());
|
|
1327
1436
|
if (!element) {
|
|
@@ -1505,7 +1614,7 @@ import {
|
|
|
1505
1614
|
For as For4,
|
|
1506
1615
|
Show as Show7,
|
|
1507
1616
|
createEffect as createEffect2,
|
|
1508
|
-
createRenderEffect as
|
|
1617
|
+
createRenderEffect as createRenderEffect4,
|
|
1509
1618
|
createSignal as createSignal6,
|
|
1510
1619
|
createUniqueId,
|
|
1511
1620
|
onCleanup as onCleanup5,
|
|
@@ -1736,7 +1845,7 @@ function SelectCellEditor(props) {
|
|
|
1736
1845
|
</Show7>
|
|
1737
1846
|
</>;
|
|
1738
1847
|
createPortalTokens(list, () => props.themeClassName, placement2);
|
|
1739
|
-
|
|
1848
|
+
createRenderEffect4(
|
|
1740
1849
|
() => [input(), composing() ?? shownText()],
|
|
1741
1850
|
([element, text]) => {
|
|
1742
1851
|
if (element && element.value !== text) {
|
|
@@ -1745,7 +1854,7 @@ function SelectCellEditor(props) {
|
|
|
1745
1854
|
},
|
|
1746
1855
|
{ name: "selectEditorInputText" }
|
|
1747
1856
|
);
|
|
1748
|
-
|
|
1857
|
+
createRenderEffect4(
|
|
1749
1858
|
() => [input(), shownText(), composing()],
|
|
1750
1859
|
([element, , composingText]) => {
|
|
1751
1860
|
if (!element || composingText !== null) {
|
|
@@ -2048,7 +2157,7 @@ function CellEditorLayer(props) {
|
|
|
2048
2157
|
}
|
|
2049
2158
|
|
|
2050
2159
|
// src/view/DefaultGridTopBar.tsx
|
|
2051
|
-
import { Show as Show9, createMemo as createMemo8, createRenderEffect as
|
|
2160
|
+
import { Show as Show9, createMemo as createMemo8, createRenderEffect as createRenderEffect5, createSignal as createSignal8, createUniqueId as createUniqueId2, untrack as untrack12 } from "solid-js";
|
|
2052
2161
|
var DefaultFilterIcon = () => <svg
|
|
2053
2162
|
width="14"
|
|
2054
2163
|
height="14"
|
|
@@ -2082,7 +2191,7 @@ function DefaultGridTopBar(props) {
|
|
|
2082
2191
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
2083
2192
|
const [input, setInput] = createSignal8();
|
|
2084
2193
|
const initialText = untrack12(() => props.globalFilterText);
|
|
2085
|
-
|
|
2194
|
+
createRenderEffect5(
|
|
2086
2195
|
() => [input(), props.globalFilterText],
|
|
2087
2196
|
([element, text]) => {
|
|
2088
2197
|
if (element && element.value !== text) {
|
|
@@ -2276,6 +2385,7 @@ var FEATURE_PROPS = {
|
|
|
2276
2385
|
serverSide: [
|
|
2277
2386
|
{ prop: "dataSource", isUsed: (props) => props.dataSource !== void 0 },
|
|
2278
2387
|
{ prop: "serverSideRefreshToken", isUsed: (props) => props.serverSideRefreshToken !== void 0 },
|
|
2388
|
+
{ prop: "serverSideRefetch", isUsed: (props) => props.serverSideRefetch !== void 0 },
|
|
2279
2389
|
{ prop: "onServerSideLoadError", isUsed: (props) => props.onServerSideLoadError !== void 0 },
|
|
2280
2390
|
{ prop: "onServerSideWriteError", isUsed: (props) => props.onServerSideWriteError !== void 0 },
|
|
2281
2391
|
{ prop: "showSaveStatus", isUsed: (props) => props.showSaveStatus === true }
|
|
@@ -2505,14 +2615,14 @@ var DERIVED_SUMMARY_KEYS = Object.keys({
|
|
|
2505
2615
|
function GridShell(props, features) {
|
|
2506
2616
|
const serverSnapshot = isServer && untrack13(() => props.dataSource == null);
|
|
2507
2617
|
const mountGate = createMountGate();
|
|
2508
|
-
const
|
|
2618
|
+
const frame2 = runInMountGate(mountGate, () => GridShellBody(props, features, mountGate, serverSnapshot ? "hiddenFrame" : "normal"));
|
|
2509
2619
|
const snapshot2 = <NoHydration>
|
|
2510
2620
|
{serverSnapshot ? (() => {
|
|
2511
2621
|
const snapshotGate = createMountGate();
|
|
2512
2622
|
return runInMountGate(snapshotGate, () => GridShellBody(createSnapshotProps(props), features, snapshotGate, "snapshot"));
|
|
2513
2623
|
})() : null}
|
|
2514
2624
|
</NoHydration>;
|
|
2515
|
-
return [
|
|
2625
|
+
return [frame2, snapshot2];
|
|
2516
2626
|
}
|
|
2517
2627
|
function GridShellBody(props, features, mountGate, mode) {
|
|
2518
2628
|
const serverSideFeature2 = features.serverSide;
|
|
@@ -2798,11 +2908,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2798
2908
|
query: serverSideQuerySnapshot().query,
|
|
2799
2909
|
queryKey: serverSideQuerySnapshot().queryKey,
|
|
2800
2910
|
refreshToken: props.serverSideRefreshToken,
|
|
2911
|
+
// 追加(1.5.0): 取り直しの間の見せ方('keep' = 新しい行が届くまで前の行を薄く見せる)。
|
|
2912
|
+
refetch: props.serverSideRefetch,
|
|
2801
2913
|
onLoadError: inOwnTick(props.onServerSideLoadError),
|
|
2802
2914
|
onWriteError: inOwnTick(props.onServerSideWriteError),
|
|
2803
2915
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2804
2916
|
onWriteStateChange: engine.saveStatus.handle
|
|
2805
2917
|
}));
|
|
2918
|
+
const refetchingRows = createMemo10(() => isServerSide() && serverSide !== void 0 && serverSide.refetching());
|
|
2919
|
+
const editLocked = () => readOnly() || refetchingRows();
|
|
2806
2920
|
const rowModel = createMemo10(() => {
|
|
2807
2921
|
if (!isServerSide() || !serverSide) {
|
|
2808
2922
|
return clientRowModel().rowModel;
|
|
@@ -3587,7 +3701,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3587
3701
|
uiState: ui(),
|
|
3588
3702
|
// イベントの時点の状態は store から読む(core controllers/liveUiState)。
|
|
3589
3703
|
getUiState: store.getState,
|
|
3590
|
-
readOnly:
|
|
3704
|
+
readOnly: editLocked(),
|
|
3591
3705
|
canEditCell: canEditCell(),
|
|
3592
3706
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
3593
3707
|
onCopied: (selection) => {
|
|
@@ -3622,7 +3736,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3622
3736
|
const fillHandleFeature2 = features.fillHandle;
|
|
3623
3737
|
const fill = fillHandleFeature2?.createFillHandle({
|
|
3624
3738
|
fillHandle: () => props.fillHandle,
|
|
3625
|
-
readOnly,
|
|
3739
|
+
readOnly: editLocked,
|
|
3626
3740
|
isServerSide,
|
|
3627
3741
|
rows,
|
|
3628
3742
|
rowModel,
|
|
@@ -3875,7 +3989,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3875
3989
|
getUiState: store.getState,
|
|
3876
3990
|
rowModel: rowModel(),
|
|
3877
3991
|
visibleColumns: orderedColumns(),
|
|
3878
|
-
readOnly:
|
|
3992
|
+
readOnly: editLocked(),
|
|
3879
3993
|
canEditCell: canEditCell(),
|
|
3880
3994
|
setEditorInitialValue,
|
|
3881
3995
|
dispatch,
|
|
@@ -3908,7 +4022,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3908
4022
|
dispatch,
|
|
3909
4023
|
gridRootRef,
|
|
3910
4024
|
editorActionGuardRef,
|
|
3911
|
-
readOnly:
|
|
4025
|
+
readOnly: editLocked(),
|
|
3912
4026
|
canEditCell: canEditCell(),
|
|
3913
4027
|
localeTexts: localeTexts(),
|
|
3914
4028
|
followsRow: activeRowFollowEnabled(),
|
|
@@ -3921,7 +4035,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3921
4035
|
orderedColumns: orderedColumns(),
|
|
3922
4036
|
uiState: ui(),
|
|
3923
4037
|
getUiState: store.getState,
|
|
3924
|
-
readOnly:
|
|
4038
|
+
readOnly: editLocked(),
|
|
3925
4039
|
canEditCell: canEditCell(),
|
|
3926
4040
|
handleRowsChange: handleRowsChange(),
|
|
3927
4041
|
applyServerSideCellEdits: applyServerSideCellEdits(),
|
|
@@ -3946,7 +4060,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3946
4060
|
{
|
|
3947
4061
|
rowModel: untrack13(rowModel),
|
|
3948
4062
|
columns: untrack13(orderedColumns),
|
|
3949
|
-
readOnly: untrack13(
|
|
4063
|
+
readOnly: untrack13(editLocked),
|
|
3950
4064
|
canEditCell: untrack13(canEditCell)
|
|
3951
4065
|
},
|
|
3952
4066
|
cell
|
|
@@ -4643,9 +4757,10 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4643
4757
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4644
4758
|
});
|
|
4645
4759
|
}
|
|
4646
|
-
const
|
|
4647
|
-
|
|
4648
|
-
|
|
4760
|
+
const textOf = (row) => {
|
|
4761
|
+
const value = getCellValue2(row, unbound);
|
|
4762
|
+
return column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4763
|
+
};
|
|
4649
4764
|
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4650
4765
|
const highlightFind = (content) => {
|
|
4651
4766
|
const ranges = cell.findRanges;
|
|
@@ -4661,11 +4776,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4661
4776
|
};
|
|
4662
4777
|
const formatRules = conditionalFormatFeature2 ? unbound.conditionalFormat : void 0;
|
|
4663
4778
|
if (formatRules?.dataBar?.showValue === false) {
|
|
4779
|
+
textOf(currentRow());
|
|
4664
4780
|
return null;
|
|
4665
4781
|
}
|
|
4666
4782
|
const chips = formatRules?.chips;
|
|
4667
4783
|
if (conditionalFormatFeature2 && chips) {
|
|
4668
4784
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4785
|
+
const row = currentRow();
|
|
4786
|
+
const value = getCellValue2(row, unbound);
|
|
4787
|
+
const text = textOf(row);
|
|
4669
4788
|
const chip = createMemo10(
|
|
4670
4789
|
() => resolveChipSpec2(chips, {
|
|
4671
4790
|
row,
|
|
@@ -4699,7 +4818,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4699
4818
|
{(spec) => <GridChip2 spec={spec()}>{highlightFind(spec().label ?? text)}</GridChip2>}
|
|
4700
4819
|
</Show11>;
|
|
4701
4820
|
}
|
|
4702
|
-
return <span class="ssg-cell-value">{highlightFind(
|
|
4821
|
+
return <span class="ssg-cell-value">{highlightFind(textOf(currentRow()))}</span>;
|
|
4703
4822
|
};
|
|
4704
4823
|
const pinnedPaneStyle = (side, width, hasContent) => ({
|
|
4705
4824
|
position: "sticky",
|
|
@@ -5000,6 +5119,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5000
5119
|
"ssg-root--filling": fill?.filling() ?? false,
|
|
5001
5120
|
"ssg-root--animate-rows": animateRowsActive(),
|
|
5002
5121
|
"ssg-root--dim-readonly": props.dimReadOnlyCells ?? false,
|
|
5122
|
+
// 追加(1.5.0 / serverSideRefetch="keep"): 取り直しの間に前の行を見せている(行を薄くする)。
|
|
5123
|
+
"ssg-root--refetching": refetchingRows(),
|
|
5003
5124
|
"ssg-root--fill-height": heightLayout().fillParent,
|
|
5004
5125
|
// クロスヘア(列見出し / 行番号を選択の色で染める。列の帯は ColumnHoverOverlay)。
|
|
5005
5126
|
"ssg-root--hover-cross": hoverCross()
|
|
@@ -5087,6 +5208,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5087
5208
|
aria-colcount={orderedColumns().length + 1}
|
|
5088
5209
|
aria-multiselectable={enableRangeSelection() ? "true" : void 0}
|
|
5089
5210
|
aria-readonly={readOnly() ? "true" : void 0}
|
|
5211
|
+
aria-busy={refetchingRows() ? "true" : void 0}
|
|
5090
5212
|
class={["ssg-scroll-container", { "ssg-scroll-container--custom-scrollbar": customScrollbar() }]}
|
|
5091
5213
|
style={toSolidStyle(heightLayout().scrollContainerStyle)}
|
|
5092
5214
|
>
|
|
@@ -5232,6 +5354,26 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5232
5354
|
/>
|
|
5233
5355
|
</Show11> : null}
|
|
5234
5356
|
{
|
|
5357
|
+
/* 追加(1.5.0 / serverSideRefetch="keep"): 前の行を見せたまま取り直している間、本体の見えている所を薄くする面と、
|
|
5358
|
+
列見出しの下に流れる線(大きさはスクロールバーを除いた見える範囲。測る前は CSS の left / right / bottom。React 版と同じ)。 */
|
|
5359
|
+
}
|
|
5360
|
+
<Show11 when={refetchingRows()}>
|
|
5361
|
+
<div
|
|
5362
|
+
class="ssg-refetch-veil"
|
|
5363
|
+
aria-hidden="true"
|
|
5364
|
+
style={{
|
|
5365
|
+
top: `${headerHeight()}px`,
|
|
5366
|
+
width: viewportWidth() > 0 ? `${viewportWidth()}px` : void 0,
|
|
5367
|
+
height: viewportHeight() > headerHeight() ? `${viewportHeight() - headerHeight()}px` : void 0
|
|
5368
|
+
}}
|
|
5369
|
+
/>
|
|
5370
|
+
<div
|
|
5371
|
+
class="ssg-refetch-bar"
|
|
5372
|
+
aria-hidden="true"
|
|
5373
|
+
style={{ top: `${headerHeight()}px`, width: viewportWidth() > 0 ? `${viewportWidth()}px` : void 0 }}
|
|
5374
|
+
/>
|
|
5375
|
+
</Show11>
|
|
5376
|
+
{
|
|
5235
5377
|
/* IME オンのままの直接入力の入力受け(imeDirectInput が有効なときだけ)。値 / 位置 / 変換中の見た目はコントローラが
|
|
5236
5378
|
直接扱います。Tab の順番には入れません(タブストップはシェルのまま)。 */
|
|
5237
5379
|
}
|
|
@@ -6832,17 +6974,17 @@ function createFilterManagement(inputs) {
|
|
|
6832
6974
|
let disposed = false;
|
|
6833
6975
|
onCleanup12(() => {
|
|
6834
6976
|
disposed = true;
|
|
6835
|
-
for (const
|
|
6836
|
-
cancelAnimationFrame(
|
|
6977
|
+
for (const frame2 of pendingFrames) {
|
|
6978
|
+
cancelAnimationFrame(frame2);
|
|
6837
6979
|
}
|
|
6838
6980
|
pendingFrames.clear();
|
|
6839
6981
|
});
|
|
6840
6982
|
const scheduleFrame = (callback) => {
|
|
6841
|
-
const
|
|
6842
|
-
pendingFrames.delete(
|
|
6983
|
+
const frame2 = requestAnimationFrame(() => {
|
|
6984
|
+
pendingFrames.delete(frame2);
|
|
6843
6985
|
callback();
|
|
6844
6986
|
});
|
|
6845
|
-
pendingFrames.add(
|
|
6987
|
+
pendingFrames.add(frame2);
|
|
6846
6988
|
};
|
|
6847
6989
|
const jumpToColumnFilter = (columnKey) => untrack15(() => {
|
|
6848
6990
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
@@ -7260,7 +7402,7 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7260
7402
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7261
7403
|
|
|
7262
7404
|
// src/view/GridFindBar.tsx
|
|
7263
|
-
import { createRenderEffect as
|
|
7405
|
+
import { createRenderEffect as createRenderEffect6, createSignal as createSignal14, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
7264
7406
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7265
7407
|
function GridFindBar(props) {
|
|
7266
7408
|
const texts = useFeatureLocaleText();
|
|
@@ -7271,7 +7413,7 @@ function GridFindBar(props) {
|
|
|
7271
7413
|
element?.focus();
|
|
7272
7414
|
element?.select();
|
|
7273
7415
|
});
|
|
7274
|
-
|
|
7416
|
+
createRenderEffect6(
|
|
7275
7417
|
() => [input(), props.snapshot.query],
|
|
7276
7418
|
([element, query]) => {
|
|
7277
7419
|
if (element && element.value !== query) {
|
|
@@ -7803,6 +7945,8 @@ function createServerSide(args) {
|
|
|
7803
7945
|
rowCount: () => snapshot2().rowCount,
|
|
7804
7946
|
loadError: createMemo25(() => snapshot2().loadError),
|
|
7805
7947
|
writeError: createMemo25(() => snapshot2().writeError),
|
|
7948
|
+
// 追加(1.5.0 / serverSideRefetch="keep"): 取り直しの間、前の行を見せているか。
|
|
7949
|
+
refetching: createMemo25(() => snapshot2().refetching),
|
|
7806
7950
|
isRowLoaded: controller.isRowLoaded,
|
|
7807
7951
|
requestRange,
|
|
7808
7952
|
refresh: controller.refresh,
|