@ishibashi0112/spreadsheet-grid-solid 1.8.0 → 1.10.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 +220 -31
- package/README.md +6 -6
- package/dist/devWarnings.d.ts +7 -0
- package/dist/editors/CellEditorLayer.d.ts +2 -0
- package/dist/editors/DateCellEditor.d.ts +2 -1
- package/dist/editors/NumberCellEditor.d.ts +2 -1
- package/dist/editors/SearchSelectCellEditor.d.ts +1 -0
- package/dist/editors/SelectCellEditor.d.ts +1 -0
- package/dist/editors/TextCellEditor.d.ts +1 -0
- package/dist/features/excelShortcuts.d.ts +2 -0
- package/dist/features/newRow.d.ts +2 -0
- package/dist/features/treeData.d.ts +2 -0
- package/dist/features/types.d.ts +10 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3353 -2907
- package/dist/model/gridTypes.d.ts +2 -0
- package/dist/source/index.jsx +1040 -357
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/themes/astryx.css +3 -0
- package/dist/themes/heroui.css +3 -0
- package/dist/themes/mantine.css +3 -0
- package/dist/themes/shadcn.css +3 -0
- package/dist/view/GridBodyLayer.d.ts +16 -1
- package/dist/view/GridTreeCell.d.ts +16 -0
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +2 -1
package/dist/source/index.jsx
CHANGED
|
@@ -30,10 +30,15 @@ import {
|
|
|
30
30
|
import { merge } from "solid-js";
|
|
31
31
|
|
|
32
32
|
// src/SpreadsheetGrid.tsx
|
|
33
|
-
import { For as For5, Match, NoHydration, Show as
|
|
33
|
+
import { For as For5, Match, NoHydration, Show as Show12, Switch, createEffect as createEffect4, createMemo as createMemo10, createSignal as createSignal9, createUniqueId as createUniqueId3, isHydrating, latest as latest2, onCleanup as onCleanup8, runWithOwner as runWithOwner3, untrack as untrack13 } from "solid-js";
|
|
34
34
|
import { isServer } from "@solidjs/web";
|
|
35
35
|
import { createGridEngine } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/createGridEngine";
|
|
36
36
|
import { gridActions } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
37
|
+
import { isCopiedRangeCurrent } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridStore";
|
|
38
|
+
import {
|
|
39
|
+
resolveExcelShortcuts as resolveExcelShortcuts2,
|
|
40
|
+
usesExcelShortcutCommands as usesExcelShortcutCommands2
|
|
41
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/excelShortcuts";
|
|
37
42
|
import { buildSelectionSnapshot, selectGlobalFilter } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridSelectors";
|
|
38
43
|
import {
|
|
39
44
|
buildColumnMeasurements,
|
|
@@ -85,7 +90,7 @@ import {
|
|
|
85
90
|
isControlColumnKey,
|
|
86
91
|
isDetailRowExpandable,
|
|
87
92
|
isInsideDetailCardOf,
|
|
88
|
-
isSyntheticColumnKey as
|
|
93
|
+
isSyntheticColumnKey as isSyntheticColumnKey3,
|
|
89
94
|
resolveFirstDataColIndex
|
|
90
95
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
91
96
|
import { resolveDataRowNumber as resolveDataRowNumber2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
@@ -100,7 +105,13 @@ import {
|
|
|
100
105
|
resolvePopupContainer
|
|
101
106
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/popupContainer";
|
|
102
107
|
import { createCellCommands, writeCellValueTo } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/cellCommands";
|
|
103
|
-
import { getCellValue as getCellValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
108
|
+
import { getCellValue as getCellValue2, resolveCanEditCellContext } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
109
|
+
import {
|
|
110
|
+
getSelectableRowCount,
|
|
111
|
+
NEW_ROW_KEY,
|
|
112
|
+
peekEditRow,
|
|
113
|
+
resolveFirstEditableColIndex
|
|
114
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/newRow";
|
|
104
115
|
import { IME_INPUT_ATTRIBUTE, isImeComposingKeyEvent as isImeComposingKeyEvent2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
105
116
|
import {
|
|
106
117
|
createKeyboardController,
|
|
@@ -112,7 +123,10 @@ import {
|
|
|
112
123
|
createClipboardController
|
|
113
124
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/clipboardController";
|
|
114
125
|
import { createPointerInteractionsController } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/pointerInteractionsController";
|
|
115
|
-
import {
|
|
126
|
+
import {
|
|
127
|
+
createHistoryController,
|
|
128
|
+
createHistoryRowLocator
|
|
129
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/historyController";
|
|
116
130
|
import {
|
|
117
131
|
createScrollScaleAnchor,
|
|
118
132
|
createViewportSyncController
|
|
@@ -612,6 +626,7 @@ import { For as For2, Show as Show2, createMemo as createMemo5, createRenderEffe
|
|
|
612
626
|
import { getCellValue, isCellEditable, isColumnEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
613
627
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
614
628
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
629
|
+
import { isSyntheticColumnKey as isSyntheticColumnKey2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
615
630
|
import { shouldMarkCellOverflowTooltip } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellOverflowTooltip";
|
|
616
631
|
import { getInvalidMessage, hasCellValidation } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/validation";
|
|
617
632
|
import { normalizeCellNote, resolveCellTooltipText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellNote";
|
|
@@ -728,6 +743,7 @@ var markReusedRow = (element) => {
|
|
|
728
743
|
};
|
|
729
744
|
|
|
730
745
|
// src/view/GridBodyLayer.tsx
|
|
746
|
+
var sameTreeRow = (a, b) => a === b || a !== void 0 && b !== void 0 && a.level === b.level && a.hasChildren === b.hasChildren && a.open === b.open && a.posInSet === b.posInSet && a.setSize === b.setSize && a.matched === b.matched && a.aggregates === b.aggregates;
|
|
731
747
|
var sameUnsavedTexts = (a, b) => {
|
|
732
748
|
if (a === b) {
|
|
733
749
|
return true;
|
|
@@ -746,6 +762,9 @@ var NO_SELECTED_COLUMNS = [-1, -1];
|
|
|
746
762
|
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
747
763
|
var NO_VALUE = () => null;
|
|
748
764
|
var NO_SLOT = () => EMPTY_SLOT;
|
|
765
|
+
var NO_FALSE = () => false;
|
|
766
|
+
var EMPTY_NEW_ROW = /* @__PURE__ */ Object.freeze({});
|
|
767
|
+
var renderNewRowPlaceholder = (text) => text === null ? null : <span class="ssg-new-row-placeholder">{text}</span>;
|
|
749
768
|
var joinClasses = (...parts) => {
|
|
750
769
|
let out = "";
|
|
751
770
|
for (const part of parts) {
|
|
@@ -756,11 +775,15 @@ var joinClasses = (...parts) => {
|
|
|
756
775
|
return out;
|
|
757
776
|
};
|
|
758
777
|
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
778
|
+
var treeStyleOf = (treeRow, aggregate) => treeRow ? { tree: { level: treeRow.level, hasChildren: treeRow.hasChildren, open: treeRow.open, aggregate } } : null;
|
|
759
779
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
760
780
|
function GridBodyLayer(props) {
|
|
761
781
|
const texts = useGridLocaleText();
|
|
762
782
|
const cellShapes = /* @__PURE__ */ new WeakMap();
|
|
763
783
|
const cellShapeOf = (column) => {
|
|
784
|
+
if (props.treeColumnKey !== void 0 && (column.key === props.treeColumnKey || column.aggFunc != null)) {
|
|
785
|
+
return isPlainCellColumn(column) ? "plain" : "decorated";
|
|
786
|
+
}
|
|
764
787
|
const known = cellShapes.get(column);
|
|
765
788
|
if (known !== void 0 && known.renderCell === column.renderCell) {
|
|
766
789
|
return known.shape;
|
|
@@ -788,6 +811,9 @@ function GridBodyLayer(props) {
|
|
|
788
811
|
if (row.skeleton) {
|
|
789
812
|
return "skeleton";
|
|
790
813
|
}
|
|
814
|
+
if (row.newRow === true) {
|
|
815
|
+
return "keyed";
|
|
816
|
+
}
|
|
791
817
|
const model = props.rowModel;
|
|
792
818
|
return model.getGroupRow?.(row.index) !== void 0 || model.getLabelRow?.(row.index) !== void 0 ? "keyed" : "data";
|
|
793
819
|
};
|
|
@@ -798,6 +824,7 @@ function GridBodyLayer(props) {
|
|
|
798
824
|
}
|
|
799
825
|
);
|
|
800
826
|
const trackingOn = createMemo5(() => props.unsavedTracking !== void 0);
|
|
827
|
+
const treeKey = createMemo5(() => props.treeColumnKey);
|
|
801
828
|
return <For2 each={slotted().state.items} keyed={(item) => item.slot}>
|
|
802
829
|
{(item) => {
|
|
803
830
|
const rowIndex = createMemo5(() => item().index);
|
|
@@ -823,7 +850,10 @@ function GridBodyLayer(props) {
|
|
|
823
850
|
slots={props.slots}
|
|
824
851
|
/>;
|
|
825
852
|
}
|
|
826
|
-
const
|
|
853
|
+
const isEntry = untrack3(() => item().newRow === true);
|
|
854
|
+
const newRowState = isEntry ? createMemo5(() => props.newRowDraft?.draft !== void 0 ? "draft" : "empty") : void 0;
|
|
855
|
+
const newRowBlank = newRowState ? () => newRowState() === "empty" : NO_FALSE;
|
|
856
|
+
const row = isEntry ? () => props.newRowLayer ? props.newRowDraft?.draft ?? EMPTY_NEW_ROW : void 0 : () => props.rowModel.getRow(rowIndex());
|
|
827
857
|
const groupRow = createMemo5(() => props.grouping ? props.rowModel.getGroupRow?.(rowIndex()) : void 0);
|
|
828
858
|
const labelRow = createMemo5(
|
|
829
859
|
() => props.labelRowLayer ? props.rowModel.getLabelRow?.(rowIndex()) : void 0
|
|
@@ -882,28 +912,35 @@ function GridBodyLayer(props) {
|
|
|
882
912
|
</Show2>
|
|
883
913
|
<Show2 when={row()}>
|
|
884
914
|
{(currentRow) => {
|
|
885
|
-
const rowKey = createMemo5(() =>
|
|
915
|
+
const rowKey = createMemo5(() => {
|
|
916
|
+
if (isEntry) {
|
|
917
|
+
void props.newRowDraft;
|
|
918
|
+
}
|
|
919
|
+
return props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
920
|
+
});
|
|
886
921
|
let rowElement;
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
922
|
+
if (!isEntry) {
|
|
923
|
+
createRenderEffect(
|
|
924
|
+
rowKey,
|
|
925
|
+
(_next, previous) => {
|
|
926
|
+
if (previous !== void 0 && rowElement) {
|
|
927
|
+
markReusedRow(rowElement);
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
{ name: "reusedRow" }
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
const sourceRowIndex = isEntry ? () => -1 : createMemo5(() => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex());
|
|
897
934
|
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
898
935
|
const isRowChecked = createMemo5(
|
|
899
|
-
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
936
|
+
() => props.enableRowSelection && !isEntry ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
900
937
|
);
|
|
901
938
|
const isRowSelected = createMemo5(
|
|
902
|
-
() => props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
939
|
+
() => !isEntry && props.selection.kind === "row" && rowIndex() >= props.selection.startRow && rowIndex() <= props.selection.endRow
|
|
903
940
|
);
|
|
904
941
|
const selectedColRange = createMemo5(() => {
|
|
905
942
|
const selection = props.selection;
|
|
906
|
-
if (selection.kind === "col") {
|
|
943
|
+
if (selection.kind === "col" && !isEntry) {
|
|
907
944
|
return [selection.startCol, selection.endCol];
|
|
908
945
|
}
|
|
909
946
|
if (selection.kind === "cell" && rowIndex() >= selection.startRow && rowIndex() <= selection.endRow) {
|
|
@@ -932,7 +969,7 @@ function GridBodyLayer(props) {
|
|
|
932
969
|
const rowAutoHeight = createMemo5(() => !!props.autoHeight);
|
|
933
970
|
const isHovered = createMemo5(() => props.hoveredRowIndex === rowIndex());
|
|
934
971
|
const rowSlot = createMemo5(
|
|
935
|
-
() => resolveSlotProps(
|
|
972
|
+
() => newRowBlank() ? EMPTY_SLOT : resolveSlotProps(
|
|
936
973
|
props.getRowClassName?.(currentRow(), rowIndex(), {
|
|
937
974
|
row: currentRow(),
|
|
938
975
|
rowIndex: rowIndex(),
|
|
@@ -943,8 +980,9 @@ function GridBodyLayer(props) {
|
|
|
943
980
|
)
|
|
944
981
|
);
|
|
945
982
|
const rowNumber = () => props.labelViewIndexes ? resolveDataRowNumber(props.labelViewIndexes, rowIndex()) : rowIndex() + 1;
|
|
983
|
+
const rowTracking = isEntry ? NO_FALSE : trackingOn;
|
|
946
984
|
const rowUnsavedTexts = createMemoWhen(
|
|
947
|
-
|
|
985
|
+
rowTracking,
|
|
948
986
|
() => {
|
|
949
987
|
const marks = props.unsavedTracking;
|
|
950
988
|
const saved = marks?.getUnsavedCells(rowKey());
|
|
@@ -965,8 +1003,24 @@ function GridBodyLayer(props) {
|
|
|
965
1003
|
sameUnsavedTexts
|
|
966
1004
|
);
|
|
967
1005
|
const rowUnsaved = () => rowUnsavedTexts() !== void 0;
|
|
968
|
-
const
|
|
969
|
-
const
|
|
1006
|
+
const closedTreeUnsaved = () => props.closedTreeUnsaved?.has(rowKey()) === true;
|
|
1007
|
+
const rowAdded = () => props.unsavedTracking?.isAddedRow?.(rowKey()) === true;
|
|
1008
|
+
const rowHeaderDescription = () => {
|
|
1009
|
+
const parts = [
|
|
1010
|
+
rowAdded() ? props.unsavedTracking?.addedRowDescription : void 0,
|
|
1011
|
+
rowUnsaved() ? props.unsavedTracking?.rowDescription : void 0,
|
|
1012
|
+
closedTreeUnsaved() ? props.unsavedTracking?.closedTreeDescription : void 0
|
|
1013
|
+
].filter((part) => part !== void 0 && part !== "");
|
|
1014
|
+
return parts.length === 0 ? void 0 : parts.join(" / ");
|
|
1015
|
+
};
|
|
1016
|
+
const treeRow = createMemoWhen(
|
|
1017
|
+
() => !isEntry && props.treeColumnKey !== void 0,
|
|
1018
|
+
() => props.rowModel.getTreeRow?.(rowIndex()),
|
|
1019
|
+
void 0,
|
|
1020
|
+
sameTreeRow
|
|
1021
|
+
);
|
|
1022
|
+
const unsavedTextOf = (columnKey) => untrack3(rowTracking) ? () => rowUnsavedTexts()?.get(columnKey) ?? null : NO_VALUE;
|
|
1023
|
+
const unsavedMarkOf = (unsavedText) => untrack3(rowTracking) ? () => unsavedText() !== null ? <span class="ssg-unsaved-mark" aria-hidden="true" /> : null : null;
|
|
970
1024
|
const textCellBase = createMemo5(() => {
|
|
971
1025
|
const slot = rowSlot();
|
|
972
1026
|
const bodyCell = cellEnv().bodyCellSlot;
|
|
@@ -1043,10 +1097,12 @@ function GridBodyLayer(props) {
|
|
|
1043
1097
|
const cells = () => <For2 each={props.entries} keyed={cellKey}>
|
|
1044
1098
|
{(entry) => {
|
|
1045
1099
|
const shape = untrack3(() => cellShapeOf(entry().column));
|
|
1046
|
-
if (shape === "text") {
|
|
1100
|
+
if (shape === "text" && !isEntry) {
|
|
1047
1101
|
return renderTextCell(entry);
|
|
1048
1102
|
}
|
|
1049
|
-
const plain = shape
|
|
1103
|
+
const plain = shape !== "decorated";
|
|
1104
|
+
const newRowSynthetic = isEntry && untrack3(() => isSyntheticColumnKey2(entry().column.key));
|
|
1105
|
+
const decorOff = newRowSynthetic ? () => true : newRowBlank;
|
|
1050
1106
|
const unbound = createMemo5(() => entry().column);
|
|
1051
1107
|
const column = () => unbound();
|
|
1052
1108
|
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
@@ -1056,12 +1112,20 @@ function GridBodyLayer(props) {
|
|
|
1056
1112
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
1057
1113
|
const readOnlyCell = () => {
|
|
1058
1114
|
const env = editPermission();
|
|
1059
|
-
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
1115
|
+
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !newRowBlank() && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
1060
1116
|
sourceRowIndex: sourceRowIndex(),
|
|
1061
1117
|
rowKey: rowKey()
|
|
1062
1118
|
});
|
|
1063
1119
|
};
|
|
1064
1120
|
const value = () => getCellValue(currentRow(), unbound());
|
|
1121
|
+
const treeAggregates = () => {
|
|
1122
|
+
const aggregates = treeRow()?.aggregates;
|
|
1123
|
+
return aggregates !== void 0 && Object.prototype.hasOwnProperty.call(aggregates, column().key) ? aggregates : void 0;
|
|
1124
|
+
};
|
|
1125
|
+
const shownValue = () => {
|
|
1126
|
+
const aggregates = treeAggregates();
|
|
1127
|
+
return aggregates !== void 0 ? aggregates[column().key] : value();
|
|
1128
|
+
};
|
|
1065
1129
|
const findRanges = createMemoWhen(
|
|
1066
1130
|
() => rowFindHits()?.has(colIndex()) === true,
|
|
1067
1131
|
() => rowFindHits()?.get(colIndex()),
|
|
@@ -1086,6 +1150,9 @@ function GridBodyLayer(props) {
|
|
|
1086
1150
|
get findCurrentIndex() {
|
|
1087
1151
|
return rowFindCurrent();
|
|
1088
1152
|
},
|
|
1153
|
+
get treeRow() {
|
|
1154
|
+
return treeRow();
|
|
1155
|
+
},
|
|
1089
1156
|
get isActive() {
|
|
1090
1157
|
return isActive();
|
|
1091
1158
|
},
|
|
@@ -1101,23 +1168,25 @@ function GridBodyLayer(props) {
|
|
|
1101
1168
|
};
|
|
1102
1169
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
1103
1170
|
const styleContext = plain ? NO_VALUE : createMemoWhen(
|
|
1104
|
-
needsStyleContext,
|
|
1171
|
+
() => !decorOff() && needsStyleContext(),
|
|
1105
1172
|
() => ({
|
|
1106
1173
|
row: currentRow(),
|
|
1107
1174
|
rowIndex: rowIndex(),
|
|
1108
1175
|
sourceRowIndex: sourceRowIndex(),
|
|
1109
1176
|
rowKey: rowKey(),
|
|
1110
1177
|
colIndex: colIndex(),
|
|
1111
|
-
value:
|
|
1178
|
+
value: shownValue(),
|
|
1112
1179
|
column: column(),
|
|
1113
1180
|
isActive: isActive(),
|
|
1114
1181
|
isSelected: isSelected(),
|
|
1115
1182
|
isEditing: isEditing(),
|
|
1116
|
-
readOnly: readOnlyCell()
|
|
1183
|
+
readOnly: readOnlyCell(),
|
|
1184
|
+
// 追加(1.9.0 の点検 案 A): ツリーデータの行のセルのときだけ、深さ・子の有無・開閉と集計のセルか(React 版と同じ)。
|
|
1185
|
+
...treeStyleOf(treeRow(), treeAggregates() !== void 0)
|
|
1117
1186
|
}),
|
|
1118
1187
|
null
|
|
1119
1188
|
);
|
|
1120
|
-
const conditionalCell = plain ? NO_SLOT : createMemoWhen(
|
|
1189
|
+
const conditionalCell = plain || newRowSynthetic ? NO_SLOT : createMemoWhen(
|
|
1121
1190
|
() => column().cellClassName !== void 0,
|
|
1122
1191
|
() => {
|
|
1123
1192
|
const cellClassName = column().cellClassName;
|
|
@@ -1128,13 +1197,13 @@ function GridBodyLayer(props) {
|
|
|
1128
1197
|
},
|
|
1129
1198
|
resolveSlotProps(void 0)
|
|
1130
1199
|
);
|
|
1131
|
-
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
1200
|
+
const formatRules = () => props.conditionalFormat && !decorOff() ? column().conditionalFormat : void 0;
|
|
1132
1201
|
const dataBar = plain ? NO_VALUE : createMemoWhen(
|
|
1133
1202
|
() => formatRules()?.dataBar !== void 0,
|
|
1134
1203
|
() => {
|
|
1135
1204
|
const feature = props.conditionalFormat;
|
|
1136
1205
|
const rules = formatRules();
|
|
1137
|
-
return feature && rules?.dataBar ? feature.resolveDataBar(rules.dataBar, value(), props.conditionalFormatStats.get(column().key)) : null;
|
|
1206
|
+
return feature && rules?.dataBar && treeAggregates() === void 0 ? feature.resolveDataBar(rules.dataBar, value(), props.conditionalFormatStats.get(column().key)) : null;
|
|
1138
1207
|
},
|
|
1139
1208
|
null
|
|
1140
1209
|
);
|
|
@@ -1143,7 +1212,7 @@ function GridBodyLayer(props) {
|
|
|
1143
1212
|
() => {
|
|
1144
1213
|
const feature = props.conditionalFormat;
|
|
1145
1214
|
const rules = formatRules();
|
|
1146
|
-
return feature && rules?.colorScale ? feature.resolveColorScaleBackground(
|
|
1215
|
+
return feature && rules?.colorScale && treeAggregates() === void 0 ? feature.resolveColorScaleBackground(
|
|
1147
1216
|
rules.colorScale,
|
|
1148
1217
|
value(),
|
|
1149
1218
|
props.conditionalFormatStats.get(column().key)
|
|
@@ -1157,12 +1226,12 @@ function GridBodyLayer(props) {
|
|
|
1157
1226
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
1158
1227
|
};
|
|
1159
1228
|
const invalidMessage = plain ? NO_VALUE : createMemoWhen(
|
|
1160
|
-
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
1161
|
-
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
1229
|
+
() => !decorOff() && !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
1230
|
+
() => treeAggregates() !== void 0 ? null : getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
1162
1231
|
null
|
|
1163
1232
|
);
|
|
1164
1233
|
const cellNote = plain ? NO_VALUE : createMemoWhen(
|
|
1165
|
-
() => !!column().cellNote,
|
|
1234
|
+
() => !decorOff() && !!column().cellNote,
|
|
1166
1235
|
() => {
|
|
1167
1236
|
const note = column().cellNote;
|
|
1168
1237
|
const context = styleContext();
|
|
@@ -1212,10 +1281,11 @@ function GridBodyLayer(props) {
|
|
|
1212
1281
|
</div>
|
|
1213
1282
|
</Show2>
|
|
1214
1283
|
</>;
|
|
1215
|
-
const
|
|
1284
|
+
const dataContent = keyedContent ? () => {
|
|
1216
1285
|
rowKey();
|
|
1217
1286
|
return cellChildren();
|
|
1218
1287
|
} : cellChildren;
|
|
1288
|
+
const cellContent = !isEntry ? dataContent : newRowSynthetic ? NO_VALUE : () => newRowBlank() ? renderNewRowPlaceholder(isEditing() ? null : props.newRowLayer?.placeholder(column()) ?? null) : dataContent();
|
|
1219
1289
|
return <div
|
|
1220
1290
|
role="gridcell"
|
|
1221
1291
|
aria-colindex={colIndex() + 2}
|
|
@@ -1231,6 +1301,7 @@ function GridBodyLayer(props) {
|
|
|
1231
1301
|
data-ssg-tooltip-overflow={markOverflowTooltip() ? "" : void 0}
|
|
1232
1302
|
class={joinClasses(
|
|
1233
1303
|
"ssg-body-cell",
|
|
1304
|
+
treeRow() !== void 0 && column().key === props.treeColumnKey && "ssg-tree-cell",
|
|
1234
1305
|
rowSlot().className,
|
|
1235
1306
|
conditionalCell().className,
|
|
1236
1307
|
cellEnv().bodyCellSlot?.className,
|
|
@@ -1242,13 +1313,15 @@ function GridBodyLayer(props) {
|
|
|
1242
1313
|
isAutoHeightCell() && "ssg-body-cell--autoheight",
|
|
1243
1314
|
alignTop() && "ssg-body-cell--valign-top",
|
|
1244
1315
|
readOnlyCell() && !isSelected() && "ssg-body-cell--readonly",
|
|
1316
|
+
// 追加(1.9.0 の点検 案 A「今の見た目 + 目印のクラス」): 子を持つ行の集計のセル(公開の契約)。
|
|
1317
|
+
treeAggregates() !== void 0 && "ssg-body-cell--tree-aggregate",
|
|
1245
1318
|
invalidMessage() !== null && "ssg-body-cell--invalid",
|
|
1246
1319
|
cellNote() !== null && "ssg-body-cell--has-note",
|
|
1247
1320
|
unsavedText() !== null && "ssg-body-cell--unsaved",
|
|
1248
1321
|
isHovered() && "ssg-body-cell--row-hovered"
|
|
1249
1322
|
)}
|
|
1250
1323
|
onPointerDown={(event) => {
|
|
1251
|
-
if (event.target instanceof Element && event.target.closest(".ssg-detail-toggle")) {
|
|
1324
|
+
if (event.target instanceof Element && event.target.closest(".ssg-detail-toggle, .ssg-tree-toggle")) {
|
|
1252
1325
|
return;
|
|
1253
1326
|
}
|
|
1254
1327
|
props.onCellPointerDown(cell(), event);
|
|
@@ -1276,6 +1349,11 @@ function GridBodyLayer(props) {
|
|
|
1276
1349
|
</div>;
|
|
1277
1350
|
}}
|
|
1278
1351
|
</For2>;
|
|
1352
|
+
const switchedCells = createMemo5(() => {
|
|
1353
|
+
trackingOn();
|
|
1354
|
+
treeKey();
|
|
1355
|
+
return untrack3(cells);
|
|
1356
|
+
});
|
|
1279
1357
|
return <div
|
|
1280
1358
|
ref={(element) => {
|
|
1281
1359
|
rowElement = element;
|
|
@@ -1284,14 +1362,25 @@ function GridBodyLayer(props) {
|
|
|
1284
1362
|
data-row-index={rowIndex()}
|
|
1285
1363
|
role="row"
|
|
1286
1364
|
aria-rowindex={rowIndex() + 2 + props.ariaRowOffset}
|
|
1287
|
-
aria-selected={props.enableRowSelection ? isRowChecked() ? "true" : "false" : void 0}
|
|
1365
|
+
aria-selected={props.enableRowSelection && !isEntry ? isRowChecked() ? "true" : "false" : void 0}
|
|
1288
1366
|
data-row-key={String(rowKey())}
|
|
1367
|
+
data-ssg-new-row={newRowState?.()}
|
|
1368
|
+
aria-level={treeRow() !== void 0 ? treeRow().level + 1 : void 0}
|
|
1369
|
+
aria-expanded={treeRow()?.hasChildren ? treeRow().open ? "true" : "false" : void 0}
|
|
1370
|
+
aria-posinset={treeRow()?.posInSet}
|
|
1371
|
+
aria-setsize={treeRow()?.setSize}
|
|
1372
|
+
data-ssg-tree-level={treeRow()?.level}
|
|
1289
1373
|
class={joinClasses(
|
|
1290
1374
|
"ssg-body-row",
|
|
1291
1375
|
rowSlot().className,
|
|
1292
1376
|
props.slots.bodyRow?.className,
|
|
1293
1377
|
isRowChecked() && "ssg-body-row--checked",
|
|
1294
|
-
rowUnsaved() && "ssg-body-row--unsaved"
|
|
1378
|
+
rowUnsaved() && "ssg-body-row--unsaved",
|
|
1379
|
+
// 追加(1.10.0): グリッドで足した行。
|
|
1380
|
+
rowAdded() && "ssg-body-row--added",
|
|
1381
|
+
treeRow()?.matched === false && "ssg-body-row--tree-unmatched",
|
|
1382
|
+
// 追加(1.10.0): 入力行(公開の契約。状態は data-ssg-new-row)。
|
|
1383
|
+
isEntry && "ssg-body-row--new"
|
|
1295
1384
|
)}
|
|
1296
1385
|
style={{
|
|
1297
1386
|
...props.slots.bodyRow?.style,
|
|
@@ -1304,7 +1393,7 @@ function GridBodyLayer(props) {
|
|
|
1304
1393
|
<div
|
|
1305
1394
|
role="rowheader"
|
|
1306
1395
|
aria-colindex={1}
|
|
1307
|
-
aria-description={
|
|
1396
|
+
aria-description={rowHeaderDescription()}
|
|
1308
1397
|
onPointerDown={(event) => props.onRowHeaderPointerDown(rowIndex(), event)}
|
|
1309
1398
|
onPointerEnter={(event) => props.onRowHeaderPointerEnter(rowIndex(), event)}
|
|
1310
1399
|
onPointerLeave={() => props.onRowHeaderPointerLeave(rowIndex())}
|
|
@@ -1312,9 +1401,13 @@ function GridBodyLayer(props) {
|
|
|
1312
1401
|
"ssg-header-cell ssg-row-header-cell",
|
|
1313
1402
|
rowSlot().className,
|
|
1314
1403
|
props.slots.rowHeaderCell?.className,
|
|
1315
|
-
props.enableRowSelection && "ssg-row-header-cell--checkbox",
|
|
1316
|
-
|
|
1317
|
-
|
|
1404
|
+
props.enableRowSelection && !isEntry && "ssg-row-header-cell--checkbox",
|
|
1405
|
+
// 追加(1.10.0): 入力行の行番号(* / 下書きは ✎)。
|
|
1406
|
+
isEntry && "ssg-row-header-cell--new",
|
|
1407
|
+
(rowUnsaved() || closedTreeUnsaved()) && "ssg-row-header-cell--unsaved",
|
|
1408
|
+
// 追加(1.10.0): グリッドで足した行の行番号(左の縦の線)。
|
|
1409
|
+
rowAdded() && "ssg-row-header-cell--added",
|
|
1410
|
+
(props.isWholeGridSelected && !isEntry || isRowSelected()) && "ssg-header-cell--selected",
|
|
1318
1411
|
isHovered() && "ssg-header-cell--hovered"
|
|
1319
1412
|
)}
|
|
1320
1413
|
style={{
|
|
@@ -1325,18 +1418,24 @@ function GridBodyLayer(props) {
|
|
|
1325
1418
|
height: px(rowSize())
|
|
1326
1419
|
}}
|
|
1327
1420
|
>
|
|
1328
|
-
|
|
1329
|
-
|
|
1421
|
+
{newRowState ? (
|
|
1422
|
+
// 追加(1.10.0): 入力行の行番号は印(* / ✎)なので、読み上げの名前を見えない文字で添える(E4-08)。
|
|
1423
|
+
<>
|
|
1424
|
+
<span aria-hidden="true">{newRowState() === "draft" ? "\u270E" : "\uFF0A"}</span>
|
|
1425
|
+
<span class="ssg-visually-hidden">
|
|
1426
|
+
{newRowState() === "draft" ? props.newRowLayer?.draftHeader : props.newRowLayer?.header}
|
|
1427
|
+
</span>
|
|
1428
|
+
</>
|
|
1429
|
+
) : <Show2 when={props.enableRowSelection} fallback={rowNumber()}>
|
|
1430
|
+
<RowSelectionCheckbox
|
|
1330
1431
|
slot={props.slots.checkbox}
|
|
1331
1432
|
label={formatLocaleText2(texts().selectRow, { row: rowNumber() })}
|
|
1332
1433
|
state={isRowChecked() ? "checked" : "unchecked"}
|
|
1333
1434
|
/>
|
|
1334
|
-
|
|
1435
|
+
</Show2>}
|
|
1335
1436
|
</div>
|
|
1336
1437
|
</Show2>
|
|
1337
|
-
|
|
1338
|
-
{cells()}
|
|
1339
|
-
</Show2>
|
|
1438
|
+
{switchedCells()}
|
|
1340
1439
|
</div>;
|
|
1341
1440
|
}}
|
|
1342
1441
|
</Show2>
|
|
@@ -1650,7 +1749,8 @@ function TextCellEditor(props) {
|
|
|
1650
1749
|
onCommit: props.onCommit,
|
|
1651
1750
|
onCancel: props.onCancel,
|
|
1652
1751
|
onRejected: setError,
|
|
1653
|
-
enterMove: props.enterMove
|
|
1752
|
+
enterMove: props.enterMove,
|
|
1753
|
+
onCommitToSelection: props.onCommitToSelection
|
|
1654
1754
|
})}
|
|
1655
1755
|
onBlur={(event) => commitOnBlur(event.currentTarget.value)}
|
|
1656
1756
|
aria-label={props.ariaLabel}
|
|
@@ -1752,7 +1852,8 @@ function NumberCellEditor(props) {
|
|
|
1752
1852
|
onCommit: props.onCommit,
|
|
1753
1853
|
onCancel: props.onCancel,
|
|
1754
1854
|
onRejected: setError,
|
|
1755
|
-
enterMove: props.enterMove
|
|
1855
|
+
enterMove: props.enterMove,
|
|
1856
|
+
onCommitToSelection: props.onCommitToSelection
|
|
1756
1857
|
})}
|
|
1757
1858
|
onBlur={(event) => {
|
|
1758
1859
|
if (disposed) {
|
|
@@ -1798,6 +1899,7 @@ import {
|
|
|
1798
1899
|
import { withAnchorVisibility } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
1799
1900
|
import { revealOverflowTitle } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/overflowTitle";
|
|
1800
1901
|
import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
1902
|
+
import { isCommitToSelectionKey } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1801
1903
|
function SelectCellEditor(props) {
|
|
1802
1904
|
const texts = useGridLocaleText();
|
|
1803
1905
|
const portal = useGridPortal();
|
|
@@ -1905,6 +2007,20 @@ function SelectCellEditor(props) {
|
|
|
1905
2007
|
}
|
|
1906
2008
|
return;
|
|
1907
2009
|
}
|
|
2010
|
+
const toSelection = props.onCommitToSelection;
|
|
2011
|
+
if (toSelection !== void 0 && isCommitToSelectionKey(event)) {
|
|
2012
|
+
event.preventDefault();
|
|
2013
|
+
const option = props.options[currentHighlight];
|
|
2014
|
+
if (!option) {
|
|
2015
|
+
props.onCancel();
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
const result = toSelection(option.value);
|
|
2019
|
+
if (result && result.status === "rejected") {
|
|
2020
|
+
setError(result.message);
|
|
2021
|
+
}
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
1908
2024
|
handleSelectEditorKeyDown(toEditorKeyEvent(event), {
|
|
1909
2025
|
optionCount: props.options.length,
|
|
1910
2026
|
enterMove: props.enterMove,
|
|
@@ -2079,12 +2195,12 @@ function DateCellEditor(props) {
|
|
|
2079
2195
|
}
|
|
2080
2196
|
setShift(resolveShiftIntoView(element));
|
|
2081
2197
|
});
|
|
2082
|
-
const commitDraft = (value, direction) => {
|
|
2198
|
+
const commitDraft = (value, direction, commit = props.onCommit) => {
|
|
2083
2199
|
if (!textMode) {
|
|
2084
|
-
return
|
|
2200
|
+
return commit(value, direction);
|
|
2085
2201
|
}
|
|
2086
2202
|
const normalized = readTypedDateCommitValue(value);
|
|
2087
|
-
return normalized === null ? { status: "rejected", message: texts().enterDate } :
|
|
2203
|
+
return normalized === null ? { status: "rejected", message: texts().enterDate } : commit(normalized, direction);
|
|
2088
2204
|
};
|
|
2089
2205
|
props.onRegisterFlush?.(() => {
|
|
2090
2206
|
untrack9(() => {
|
|
@@ -2106,6 +2222,11 @@ function DateCellEditor(props) {
|
|
|
2106
2222
|
onCancel: props.onCancel,
|
|
2107
2223
|
onRejected: setError,
|
|
2108
2224
|
enterMove: props.enterMove,
|
|
2225
|
+
// 追加(1.10.0 / Excel のキー): 一括入力も文字の欄は日付として読んでから。
|
|
2226
|
+
onCommitToSelection: props.onCommitToSelection === void 0 ? void 0 : (value) => {
|
|
2227
|
+
const toSelection = props.onCommitToSelection;
|
|
2228
|
+
return toSelection === void 0 ? void 0 : commitDraft(value, void 0, (committed) => toSelection(committed));
|
|
2229
|
+
},
|
|
2109
2230
|
// 日付の入力欄では Home / End でもグリッドがスクロールしていたので止めます(文字の欄ではカーソルの移動なので止めない)。
|
|
2110
2231
|
blockHomeEnd: !textMode
|
|
2111
2232
|
})}
|
|
@@ -2251,6 +2372,9 @@ function CellEditorLayer(props) {
|
|
|
2251
2372
|
},
|
|
2252
2373
|
onCommit: (value, direction, option, forwardText) => props.onCommit(value, direction, option, forwardText),
|
|
2253
2374
|
onCancel: () => props.onCancel(),
|
|
2375
|
+
get onCommitToSelection() {
|
|
2376
|
+
return props.onCommitToSelection;
|
|
2377
|
+
},
|
|
2254
2378
|
onRegisterFlush: (flush) => props.onRegisterFlush?.(flush)
|
|
2255
2379
|
};
|
|
2256
2380
|
const initialValue = untrack11(props.initialValue);
|
|
@@ -2336,16 +2460,16 @@ function CellEditorLayer(props) {
|
|
|
2336
2460
|
};
|
|
2337
2461
|
return <Show8 when={props.rect !== null ? props.sessionId : null} keyed>
|
|
2338
2462
|
{(sessionId) => <div
|
|
2339
|
-
class={["ssg-cell-editor", props.slots.cellEditor?.className]}
|
|
2463
|
+
class={["ssg-cell-editor", props.leadingInset && "ssg-cell-editor--tree-inset", props.slots.cellEditor?.className]}
|
|
2340
2464
|
role={props.session ? "group" : void 0}
|
|
2341
2465
|
aria-label={props.session ? editLabel() : void 0}
|
|
2342
2466
|
id={props.session ? props.domId : void 0}
|
|
2343
2467
|
style={{
|
|
2344
2468
|
...props.slots.cellEditor?.style,
|
|
2345
2469
|
position: "absolute",
|
|
2346
|
-
left: px(props.leadingWidth + (props.rect?.left ?? 0)),
|
|
2470
|
+
left: props.leadingInset ? `calc(${px(props.leadingWidth + (props.rect?.left ?? 0))} + ${props.leadingInset})` : px(props.leadingWidth + (props.rect?.left ?? 0)),
|
|
2347
2471
|
top: px(props.headerHeight + (props.rect?.top ?? 0) - props.baseOffset),
|
|
2348
|
-
width: px(props.rect?.width ?? 0),
|
|
2472
|
+
width: props.leadingInset ? `calc(${px(props.rect?.width ?? 0)} - ${props.leadingInset})` : px(props.rect?.width ?? 0),
|
|
2349
2473
|
height: px(props.rect?.height ?? 0)
|
|
2350
2474
|
}}
|
|
2351
2475
|
>
|
|
@@ -2513,10 +2637,38 @@ function DefaultGridBottomBar(props) {
|
|
|
2513
2637
|
</div>;
|
|
2514
2638
|
}
|
|
2515
2639
|
|
|
2640
|
+
// src/view/CopyRangeOverlay.tsx
|
|
2641
|
+
import { Show as Show11 } from "solid-js";
|
|
2642
|
+
var placement = (props, rect) => ({
|
|
2643
|
+
position: "absolute",
|
|
2644
|
+
left: px(props.leadingWidth + rect.left),
|
|
2645
|
+
top: px(props.headerHeight + rect.top - props.baseOffset),
|
|
2646
|
+
width: px(rect.width),
|
|
2647
|
+
height: px(rect.height)
|
|
2648
|
+
});
|
|
2649
|
+
function CopyRangeOverlay(props) {
|
|
2650
|
+
return <Show11 when={props.rect}>
|
|
2651
|
+
{(rect) => <div
|
|
2652
|
+
class={["ssg-copy-range-overlay", props.slot?.className]}
|
|
2653
|
+
style={{ ...props.slot?.style, ...placement(props, rect()) }}
|
|
2654
|
+
data-ssg-copy-range=""
|
|
2655
|
+
/>}
|
|
2656
|
+
</Show11>;
|
|
2657
|
+
}
|
|
2658
|
+
function ColumnHoverOverlay(props) {
|
|
2659
|
+
return <Show11 when={props.rect}>
|
|
2660
|
+
{(rect) => <div class="ssg-col-hover-overlay" style={placement(props, rect())} data-ssg-col-hover="" />}
|
|
2661
|
+
</Show11>;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2516
2664
|
// src/devWarnings.ts
|
|
2517
2665
|
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
2518
2666
|
import { AUTO_HEIGHT_MAX_ROWS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
2519
2667
|
import { isSearchSelectEditor as isSearchSelectEditor2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectEditorState";
|
|
2668
|
+
import {
|
|
2669
|
+
resolveExcelShortcuts,
|
|
2670
|
+
usesExcelShortcutCommands
|
|
2671
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/excelShortcuts";
|
|
2520
2672
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2521
2673
|
import {
|
|
2522
2674
|
warnUnregisteredFeatureMethod,
|
|
@@ -2546,9 +2698,22 @@ var FEATURE_PROPS = {
|
|
|
2546
2698
|
],
|
|
2547
2699
|
// 変更の追跡(React 版と同じ)。
|
|
2548
2700
|
changeTracking: [
|
|
2549
|
-
{
|
|
2701
|
+
{
|
|
2702
|
+
prop: "trackChanges",
|
|
2703
|
+
// 変更(1.10.0): オブジェクトの形({ rows: true } / {})も指定したことになります。
|
|
2704
|
+
isUsed: (props) => props.trackChanges === true || typeof props.trackChanges === "object" && props.trackChanges !== null
|
|
2705
|
+
},
|
|
2550
2706
|
{ prop: "onChangesChange", isUsed: (props) => props.onChangesChange !== void 0 }
|
|
2551
2707
|
],
|
|
2708
|
+
// 追加(1.10.0 / Excel のキー): 切り取り以外のキーを効かせたとき(切り取りは本体なので、既定の省略では警告しない)。
|
|
2709
|
+
excelShortcuts: [
|
|
2710
|
+
{
|
|
2711
|
+
prop: "excelShortcuts",
|
|
2712
|
+
isUsed: (props) => usesExcelShortcutCommands(resolveExcelShortcuts(props.excelShortcuts))
|
|
2713
|
+
}
|
|
2714
|
+
],
|
|
2715
|
+
// 追加(1.10.0 / 入力行)。
|
|
2716
|
+
newRow: [{ prop: "newRow", isUsed: (props) => props.newRow !== void 0 && props.newRow !== false }],
|
|
2552
2717
|
totalRow: [{ prop: "totalRow", isUsed: (props) => props.totalRow !== void 0 && props.totalRow !== false }],
|
|
2553
2718
|
pinnedRows: [
|
|
2554
2719
|
{ prop: "pinnedTopRows", isUsed: (props) => (props.pinnedTopRows?.length ?? 0) > 0 },
|
|
@@ -2612,6 +2777,11 @@ var FEATURE_PROPS = {
|
|
|
2612
2777
|
],
|
|
2613
2778
|
autoHeight: [{ prop: "autoHeight", isUsed: (props) => props.autoHeight === true }],
|
|
2614
2779
|
labelRow: [{ prop: "labelRow", isUsed: (props) => props.labelRow !== void 0 }],
|
|
2780
|
+
// ツリーデータ(React 版と同じ)。
|
|
2781
|
+
treeData: [
|
|
2782
|
+
{ prop: "treeData", isUsed: (props) => props.treeData !== void 0 },
|
|
2783
|
+
{ prop: "onTreeRowOpenChange", isUsed: (props) => props.onTreeRowOpenChange !== void 0 }
|
|
2784
|
+
],
|
|
2615
2785
|
// 列の rowGroup。サーバーサイドで動くとき(dataSource と serverSide の機能がある)は grouping を入れても効かない(別に
|
|
2616
2786
|
// 警告が出る)ので勧めない。serverSide の機能が無ければ dataSource は外されて clientSide になるので警告する。
|
|
2617
2787
|
grouping: [
|
|
@@ -2757,6 +2927,42 @@ function createShellDevWarningsInDev(args) {
|
|
|
2757
2927
|
);
|
|
2758
2928
|
}
|
|
2759
2929
|
});
|
|
2930
|
+
const newRowWarned = /* @__PURE__ */ new Set();
|
|
2931
|
+
createChangeEffect(
|
|
2932
|
+
() => {
|
|
2933
|
+
const reason = args.newRowUnavailable();
|
|
2934
|
+
return reason === null || typeof reason === "string" ? reason : `missing:${reason.missing}`;
|
|
2935
|
+
},
|
|
2936
|
+
(reason) => {
|
|
2937
|
+
if (reason === "serverSide") {
|
|
2938
|
+
warnOncePerGrid(
|
|
2939
|
+
newRowWarned,
|
|
2940
|
+
"newRowServerSide",
|
|
2941
|
+
"[SpreadsheetGrid] newRow \u306F serverSide(dataSource)\u3067\u306F\u4F7F\u3048\u307E\u305B\u3093(\u5165\u529B\u884C\u306F\u51FA\u307E\u305B\u3093\u3002\u884C\u306F\u30B5\u30FC\u30D0\u30FC\u306B\u8DB3\u3057\u3066\u304B\u3089\u53D6\u308A\u76F4\u3057\u307E\u3059)\u3002\n[SpreadsheetGrid] newRow does not work with serverSide (dataSource). No entry row is shown; add rows on the server and refetch."
|
|
2942
|
+
);
|
|
2943
|
+
} else if (reason === "rowGroup") {
|
|
2944
|
+
warnOncePerGrid(
|
|
2945
|
+
newRowWarned,
|
|
2946
|
+
"newRowRowGroup",
|
|
2947
|
+
"[SpreadsheetGrid] newRow \u306F\u884C\u306E\u30B0\u30EB\u30FC\u30D7\u5316(rowGroup)\u3068\u4E00\u7DD2\u306B\u306F\u4F7F\u3048\u307E\u305B\u3093(\u5165\u529B\u884C\u306F\u51FA\u307E\u305B\u3093)\u3002\n[SpreadsheetGrid] newRow does not work together with row grouping (rowGroup). No entry row is shown."
|
|
2948
|
+
);
|
|
2949
|
+
} else if (reason !== null) {
|
|
2950
|
+
const missing = reason.slice("missing:".length);
|
|
2951
|
+
warnOncePerGrid(
|
|
2952
|
+
newRowWarned,
|
|
2953
|
+
"newRowMissing",
|
|
2954
|
+
`[SpreadsheetGrid] newRow \u306B\u306F ${missing} \u304C\u8981\u308A\u307E\u3059(\u6307\u5B9A\u3059\u308B\u307E\u3067\u5165\u529B\u884C\u306F\u51FA\u307E\u305B\u3093)\u3002
|
|
2955
|
+
[SpreadsheetGrid] newRow needs ${missing}. No entry row is shown until you set it.`
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
);
|
|
2960
|
+
const treeDataWarned = /* @__PURE__ */ new Set();
|
|
2961
|
+
createChangeEffect(args.treeDataWarnings, (warnings) => {
|
|
2962
|
+
for (const warning of warnings) {
|
|
2963
|
+
warnOncePerGrid(treeDataWarned, warning.id, warning.message);
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2760
2966
|
if (!args.filteringAvailable) {
|
|
2761
2967
|
createChangeEffect(
|
|
2762
2968
|
() => args.globalFilterText().trim() !== "" || args.columnFilterCount() > 0,
|
|
@@ -2797,11 +3003,13 @@ var warnHandleCallBeforeMount = (warned, method) => {
|
|
|
2797
3003
|
// src/SpreadsheetGrid.tsx
|
|
2798
3004
|
var EMPTY_ROWS = [];
|
|
2799
3005
|
var NEVER_EDITABLE = () => false;
|
|
3006
|
+
var NO_TREE_DATA_WARNINGS = [];
|
|
2800
3007
|
var NO_COLUMNS = [];
|
|
2801
3008
|
var NO_COLUMN_FILTERS = {};
|
|
2802
3009
|
var renderDetailToggleCell = () => null;
|
|
2803
3010
|
var noop3 = () => {
|
|
2804
3011
|
};
|
|
3012
|
+
var isTrackChangesOn = (value) => value === true || typeof value === "object" && value !== null;
|
|
2805
3013
|
var applyHandleRef = (ref, handle) => {
|
|
2806
3014
|
if (typeof ref === "function") {
|
|
2807
3015
|
runWithOwner3(null, () => untrack13(() => ref(handle)));
|
|
@@ -2868,6 +3076,11 @@ function GridShell(props, features) {
|
|
|
2868
3076
|
function GridShellBody(props, features, mountGate, mode) {
|
|
2869
3077
|
const serverSideFeature2 = features.serverSide;
|
|
2870
3078
|
const isServerSide = createMemo10(() => props.dataSource != null);
|
|
3079
|
+
const treeDataParts = features.treeData;
|
|
3080
|
+
const treeDataActive = createMemo10(
|
|
3081
|
+
() => props.treeData != null && treeDataParts !== void 0 && !isServerSide() && props.rowKeyGetter != null
|
|
3082
|
+
);
|
|
3083
|
+
const treeColumnKey = createMemo10(() => treeDataActive() ? props.treeData?.column : void 0);
|
|
2871
3084
|
const { wrap: inOwnTick, call: callInOwnTick } = createUserCallbacks();
|
|
2872
3085
|
const [hydrated, setHydrated] = createSignal9(mode === "snapshot" || !isServer && !isHydrating(), { name: "hydrated" });
|
|
2873
3086
|
if (!untrack13(hydrated)) {
|
|
@@ -2926,6 +3139,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2926
3139
|
isServerSide: isServerSide(),
|
|
2927
3140
|
// 行ドラッグ(機能 rowDrag)。機能が無い構成では createSpreadsheetGrid が false にする。
|
|
2928
3141
|
enableRowDrag: props.enableRowDrag ?? false,
|
|
3142
|
+
// 追加(1.9.0 / ツリーデータ): ツリーデータのときは行グルーピングと行ドラッグを効かせません。
|
|
3143
|
+
treeDataActive: treeDataActive(),
|
|
2929
3144
|
hasRowsChange: props.onRowsChange != null,
|
|
2930
3145
|
detailToggleColumnActive: detailToggleColumnActive(),
|
|
2931
3146
|
renderDetailToggleCell
|
|
@@ -2986,6 +3201,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2986
3201
|
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2987
3202
|
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2988
3203
|
const viewMaxBodyPx = createMemo10(() => view().maxBodyPx);
|
|
3204
|
+
const newRowDraft = createMemo10(() => view().newRowDraft ?? null);
|
|
2989
3205
|
const viewSetters = createGridViewSetters(store);
|
|
2990
3206
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2991
3207
|
const gridRootRef = { current: null };
|
|
@@ -3071,7 +3287,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3071
3287
|
);
|
|
3072
3288
|
}
|
|
3073
3289
|
const labelRowFeature2 = features.labelRow;
|
|
3074
|
-
const labelIsLabelRow = createMemo10(() => props.labelRow?.isLabelRow);
|
|
3290
|
+
const labelIsLabelRow = createMemo10(() => treeDataActive() ? void 0 : props.labelRow?.isLabelRow);
|
|
3075
3291
|
const labelGetLabel = createMemo10(() => props.labelRow?.getLabel);
|
|
3076
3292
|
const labelRender = createMemo10(() => props.labelRow?.render);
|
|
3077
3293
|
const labelRowClassName = createMemo10(() => props.labelRow?.className);
|
|
@@ -3144,13 +3360,36 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3144
3360
|
rowDragAvailable: columnResolution().rowDragAvailable,
|
|
3145
3361
|
manualFiltering: manualFiltering(),
|
|
3146
3362
|
manualSorting: manualSorting(),
|
|
3147
|
-
relativeDateKey: relativeDateKey()
|
|
3363
|
+
relativeDateKey: relativeDateKey(),
|
|
3364
|
+
// 追加(1.9.0 / ツリーデータ): 全体を並べず、絞り込んだ行を rows の順で返します(きょうだいの中で並べるのは木の段)。
|
|
3365
|
+
treeActive: treeDataActive()
|
|
3148
3366
|
})
|
|
3149
3367
|
);
|
|
3150
3368
|
const filterConditionsActive = () => globalFilterText().trim().length > 0 || Object.keys(columnFilters()).length > 0;
|
|
3151
3369
|
const manualFilterActive = () => manualFiltering() && filterConditionsActive();
|
|
3152
3370
|
const rowDragAvailable = () => columnResolution().rowDragAvailable;
|
|
3153
3371
|
const rowDragOperable = () => orderResolution().rowDragOperable;
|
|
3372
|
+
const treeFilterSignature = createMemo10(
|
|
3373
|
+
() => treeDataActive() ? engine.rowPipeline.resolveTreeFilterSignature({
|
|
3374
|
+
manualFiltering: manualFiltering() || !filteringAvailable,
|
|
3375
|
+
globalText: globalFilterEnabled() ? globalFilterText() : "",
|
|
3376
|
+
columnFilters: columnFilters(),
|
|
3377
|
+
relativeDateKey: relativeDateKey(),
|
|
3378
|
+
pending: globalFilterStatus() === "filtering"
|
|
3379
|
+
}) : null
|
|
3380
|
+
);
|
|
3381
|
+
const treeOpenState = createMemo10(() => ui().treeOpen);
|
|
3382
|
+
const treeInputs = createMemo10(() => {
|
|
3383
|
+
const options = props.treeData;
|
|
3384
|
+
return treeDataActive() && options ? {
|
|
3385
|
+
getParentKey: options.getParentKey,
|
|
3386
|
+
column: options.column,
|
|
3387
|
+
defaultOpenDepth: options.defaultOpenDepth ?? "all",
|
|
3388
|
+
filterSignature: treeFilterSignature(),
|
|
3389
|
+
sortColumns: filterSortColumns(),
|
|
3390
|
+
treeOpen: treeOpenState()
|
|
3391
|
+
} : null;
|
|
3392
|
+
});
|
|
3154
3393
|
const clientRowModel = createMemo10(
|
|
3155
3394
|
() => engine.rowPipeline.resolveClientSideRowModel({
|
|
3156
3395
|
rows: rows(),
|
|
@@ -3167,9 +3406,12 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3167
3406
|
sort: ui().sort,
|
|
3168
3407
|
// 手動ソートでは並べ替えていない(グループ / ラベル行の並びも同じ。React 版と同じ)。
|
|
3169
3408
|
sortActive: !manualSorting() && ui().sort.length > 0,
|
|
3170
|
-
manualSorting: manualSorting()
|
|
3409
|
+
manualSorting: manualSorting(),
|
|
3410
|
+
// 追加(1.9.0 / ツリーデータ)
|
|
3411
|
+
tree: treeInputs()
|
|
3171
3412
|
})
|
|
3172
3413
|
);
|
|
3414
|
+
const treeStage = createMemo10(() => treeDataActive() ? clientRowModel().tree : null);
|
|
3173
3415
|
const liveServerSideQuery = createMemo10(
|
|
3174
3416
|
() => engine.rowPipeline.resolveServerSideQuery({
|
|
3175
3417
|
isServerSide: isServerSide(),
|
|
@@ -3205,7 +3447,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3205
3447
|
}));
|
|
3206
3448
|
const refetchingRows = createMemo10(() => isServerSide() && serverSide !== void 0 && serverSide.refetching());
|
|
3207
3449
|
const editLocked = () => readOnly() || refetchingRows();
|
|
3208
|
-
const
|
|
3450
|
+
const baseRowModel = createMemo10(() => {
|
|
3209
3451
|
if (!isServerSide() || !serverSide) {
|
|
3210
3452
|
return clientRowModel().rowModel;
|
|
3211
3453
|
}
|
|
@@ -3214,9 +3456,35 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3214
3456
|
const getLabel = labelGetLabel();
|
|
3215
3457
|
return isLabelRow && getLabel && labelRowFeature2 ? labelRowFeature2.wrapRowModelWithLabelRows(base, isLabelRow, getLabel) : base;
|
|
3216
3458
|
});
|
|
3217
|
-
const
|
|
3218
|
-
|
|
3459
|
+
const newRowParts = features.newRow;
|
|
3460
|
+
const newRowGiven = () => props.newRow !== void 0 && props.newRow !== false;
|
|
3461
|
+
const newRowHasRowGroup = () => !isServerSide() && clientRowModel().groupedDisplay != null;
|
|
3462
|
+
const newRowActive = createMemo10(
|
|
3463
|
+
() => newRowGiven() && newRowParts !== void 0 && !isServerSide() && props.onRowsChange != null && props.createRow !== void 0 && props.rowKeyGetter !== void 0 && !readOnly() && !newRowHasRowGroup()
|
|
3219
3464
|
);
|
|
3465
|
+
const rowModel = createMemo10(() => engine.newRow.wrapRowModel(baseRowModel(), newRowActive()));
|
|
3466
|
+
const newRowLayer = createMemo10(() => {
|
|
3467
|
+
if (!newRowActive() || newRowParts === void 0) {
|
|
3468
|
+
return void 0;
|
|
3469
|
+
}
|
|
3470
|
+
const texts = localeTexts();
|
|
3471
|
+
const placeholderOption = typeof props.newRow === "object" ? props.newRow.placeholder : void 0;
|
|
3472
|
+
const columnsNow = orderedColumns();
|
|
3473
|
+
const firstEditableKey = columnsNow[resolveFirstEditableColIndex(columnsNow, readOnly())]?.key;
|
|
3474
|
+
return {
|
|
3475
|
+
header: texts.newRowHeader,
|
|
3476
|
+
draftHeader: texts.newRowDraftHeader,
|
|
3477
|
+
placeholder: (column) => newRowParts.resolveNewRowPlaceholder(placeholderOption, texts.newRowPlaceholder, column, firstEditableKey)
|
|
3478
|
+
};
|
|
3479
|
+
});
|
|
3480
|
+
const canEditCell = createMemo10(() => {
|
|
3481
|
+
if (isServerSide() && !(serverSide?.canUpdateRows() ?? false)) {
|
|
3482
|
+
return NEVER_EDITABLE;
|
|
3483
|
+
}
|
|
3484
|
+
return treeStage() !== null && aggColumns().length > 0 && treeColumnKey() !== void 0 ? engine.rowPipeline.resolveTreeCanEditCell(
|
|
3485
|
+
props.canEditCell
|
|
3486
|
+
) : props.canEditCell;
|
|
3487
|
+
});
|
|
3220
3488
|
const applyServerSideCellEdits = createMemo10(
|
|
3221
3489
|
() => isServerSide() && serverSide?.canUpdateRows() ? serverSide.applyCellEdits : void 0
|
|
3222
3490
|
);
|
|
@@ -3226,14 +3494,18 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3226
3494
|
const groupTree = () => clientRowModel().groupTree;
|
|
3227
3495
|
const labelDisplay = () => clientRowModel().labelDisplay;
|
|
3228
3496
|
const labelViewIndexes = createMemo10(() => labelDisplay()?.labelViewIndexes);
|
|
3229
|
-
const leafRowCount = createMemo10(
|
|
3230
|
-
|
|
3231
|
-
|
|
3497
|
+
const leafRowCount = createMemo10(() => {
|
|
3498
|
+
const tree = treeStage();
|
|
3499
|
+
if (tree) {
|
|
3500
|
+
return tree.visibility.matchedCount;
|
|
3501
|
+
}
|
|
3502
|
+
return clientRowModel().groupedDisplay || clientRowModel().labelDisplay ? order().length : newRowActive() ? viewRowCount() - 1 : viewRowCount();
|
|
3503
|
+
});
|
|
3232
3504
|
const handleGroupToggle = (groupKey) => dispatch(gridActions.toggleGroupCollapsed(groupKey));
|
|
3233
3505
|
const groupingFeature2 = features.grouping;
|
|
3234
3506
|
const orderArray = createMemo10(() => order());
|
|
3235
3507
|
const getFilteredRows = createMemo10(() => {
|
|
3236
|
-
const currentOrder = orderArray();
|
|
3508
|
+
const currentOrder = treeStage()?.visibility.matchedOrder ?? orderArray();
|
|
3237
3509
|
const currentRows = rows();
|
|
3238
3510
|
let cache = null;
|
|
3239
3511
|
return () => cache ??= Array.from(currentOrder, (sourceIndex) => currentRows[sourceIndex]);
|
|
@@ -3285,7 +3557,47 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3285
3557
|
maxBodyPx: () => viewMaxBodyPx() ?? MAX_BODY_PX,
|
|
3286
3558
|
globalFilterText,
|
|
3287
3559
|
columnFilterCount: () => Object.keys(columnFilters()).length,
|
|
3288
|
-
trackChangesUnavailable: () => !(props.trackChanges
|
|
3560
|
+
trackChangesUnavailable: () => !isTrackChangesOn(props.trackChanges) || features.changeTracking === void 0 ? null : isServerSide() ? "serverSide" : props.rowKeyGetter === void 0 ? "rowKeyGetter" : props.onRowsChange == null ? "onRowsChange" : null,
|
|
3561
|
+
// 追加(1.10.0 / 入力行): 入力行が出ない理由(機能があり newRow を指定したときだけ。React 版と同じ条件と文言)。
|
|
3562
|
+
newRowUnavailable: () => {
|
|
3563
|
+
if (!newRowGiven() || newRowParts === void 0) {
|
|
3564
|
+
return null;
|
|
3565
|
+
}
|
|
3566
|
+
if (isServerSide()) {
|
|
3567
|
+
return "serverSide";
|
|
3568
|
+
}
|
|
3569
|
+
if (newRowHasRowGroup()) {
|
|
3570
|
+
return "rowGroup";
|
|
3571
|
+
}
|
|
3572
|
+
const missing = [
|
|
3573
|
+
props.onRowsChange == null ? "onRowsChange" : null,
|
|
3574
|
+
props.createRow === void 0 ? "createRow" : null,
|
|
3575
|
+
props.rowKeyGetter === void 0 ? "rowKeyGetter" : null
|
|
3576
|
+
].filter((name) => name !== null).join(" / ");
|
|
3577
|
+
return missing === "" ? null : { missing };
|
|
3578
|
+
},
|
|
3579
|
+
// 追加(1.9.0 / ツリーデータ): 一緒に使えないもの・効かない理由と、木の形の問題(親のキーが rows に無い行・循環・同じキーの行)。
|
|
3580
|
+
treeDataWarnings: () => {
|
|
3581
|
+
const parts = treeDataParts;
|
|
3582
|
+
if (!parts || props.treeData == null) {
|
|
3583
|
+
return NO_TREE_DATA_WARNINGS;
|
|
3584
|
+
}
|
|
3585
|
+
const problems = parts.resolveTreeDataProblems({
|
|
3586
|
+
isServerSide: isServerSide(),
|
|
3587
|
+
hasRowKeyGetter: props.rowKeyGetter != null,
|
|
3588
|
+
hasRowGroup: props.columns.some((column) => column.rowGroup === true),
|
|
3589
|
+
hasLabelRow: props.labelRow?.isLabelRow != null,
|
|
3590
|
+
hasRowDrag: props.enableRowDrag ?? false,
|
|
3591
|
+
// 追加(1.9.0 の点検 T4-02 / T5-07): treeData.column の列が columns にあるか。
|
|
3592
|
+
hasTreeColumn: props.columns.some((column) => column.key === props.treeData?.column)
|
|
3593
|
+
});
|
|
3594
|
+
const warnings = problems.map((problem) => ({
|
|
3595
|
+
id: `treeData:${problem}`,
|
|
3596
|
+
message: parts.describeTreeDataProblem(problem, props.treeData?.column)
|
|
3597
|
+
}));
|
|
3598
|
+
const structure = treeStage()?.structure;
|
|
3599
|
+
return structure ? [...warnings, ...parts.describeTreeStructureProblems(structure)] : warnings;
|
|
3600
|
+
}
|
|
3289
3601
|
});
|
|
3290
3602
|
const stickyLabelIndexes = createMemo10(() => {
|
|
3291
3603
|
const indexes = labelViewIndexes();
|
|
@@ -3339,7 +3651,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3339
3651
|
() => totalRowEnabled() ? engine.resolveTotalRowCells({
|
|
3340
3652
|
rows: rows(),
|
|
3341
3653
|
// サーバーサイドは values だけ(rows が無いので集計しない。React 版と同じ)。
|
|
3342
|
-
|
|
3654
|
+
// 変更(1.9.0 / ツリーデータ): ツリーデータのときは当たった末端の行だけ(親の集計と二重に数えない)。
|
|
3655
|
+
order: isServerSide() ? null : treeStage()?.visibility.matchedLeafOrder ?? order(),
|
|
3343
3656
|
columns: orderedColumns(),
|
|
3344
3657
|
values: totalRowOptions()?.values
|
|
3345
3658
|
}) : EMPTY_TOTAL_ROW_CELLS
|
|
@@ -3352,15 +3665,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3352
3665
|
if (!totalRowEnabled() || !totalRowFeature2) {
|
|
3353
3666
|
return void 0;
|
|
3354
3667
|
}
|
|
3355
|
-
const { formatTotalRowCellText:
|
|
3668
|
+
const { formatTotalRowCellText: formatTotalRowCellText5, resolveTotalRowCaption: resolveTotalRowCaption5 } = totalRowFeature2;
|
|
3356
3669
|
const cells2 = totalRowCells();
|
|
3357
3670
|
const labelColumnKey = totalRowLabelColumnKey();
|
|
3358
3671
|
const texts = /* @__PURE__ */ new Map();
|
|
3359
3672
|
for (const column of orderedColumns()) {
|
|
3360
3673
|
const cell = cells2.get(column.key);
|
|
3361
3674
|
if (cell) {
|
|
3362
|
-
const text =
|
|
3363
|
-
texts.set(column.key, { text, caption: text !== "" ?
|
|
3675
|
+
const text = formatTotalRowCellText5(column, cell);
|
|
3676
|
+
texts.set(column.key, { text, caption: text !== "" ? resolveTotalRowCaption5(cell.kind, localeTexts()) : void 0 });
|
|
3364
3677
|
} else if (column.key === labelColumnKey) {
|
|
3365
3678
|
texts.set(column.key, { text: totalRowLabel() });
|
|
3366
3679
|
}
|
|
@@ -3409,8 +3722,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3409
3722
|
const spec = chipFeature.resolveChipSpec(chips, {
|
|
3410
3723
|
row,
|
|
3411
3724
|
rowIndex: viewIndex,
|
|
3412
|
-
|
|
3413
|
-
|
|
3725
|
+
// 変更(1.10.0 / 入力行): 入力行の下書きの行は sourceRowIndex が -1、rowKey はその行の rowKeyGetter の値(React 版と同じ)。
|
|
3726
|
+
...resolveCanEditCellContext(model, viewIndex),
|
|
3414
3727
|
colIndex,
|
|
3415
3728
|
value,
|
|
3416
3729
|
column,
|
|
@@ -3429,7 +3742,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3429
3742
|
dispatch,
|
|
3430
3743
|
totalRowTexts: totalRowAutosizeTexts(),
|
|
3431
3744
|
chipOf: autosizeChipOf(),
|
|
3432
|
-
pinnedRows: pinnedAutosizeRows()
|
|
3745
|
+
pinnedRows: pinnedAutosizeRows(),
|
|
3746
|
+
// 追加(1.9.0 / ツリーデータ): 木の列は字下げと開閉の印の幅も足します(見えている行の一番深い字下げ)。
|
|
3747
|
+
cellLeadingWidth: engine.rowPipeline.resolveTreeAutosizeLeadingWidth(treeStage(), treeColumnKey()),
|
|
3748
|
+
// 子を持つ行の集計のセルは集計の文字で測ります(React 版と同じ)。
|
|
3749
|
+
aggregateTextOf: engine.rowPipeline.resolveTreeAutosizeAggregateText(treeStage(), localeTexts())
|
|
3433
3750
|
}));
|
|
3434
3751
|
const isAutosizing = () => columnAutosize?.isAutosizing() ?? false;
|
|
3435
3752
|
connectController(
|
|
@@ -3470,10 +3787,22 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3470
3787
|
const model = rowModel();
|
|
3471
3788
|
const serverSideActive = isServerSide();
|
|
3472
3789
|
const items = [];
|
|
3790
|
+
const entryIndex = model.newRow?.index ?? -1;
|
|
3473
3791
|
for (const virtualRow of virtualRows) {
|
|
3474
3792
|
if (!virtualRowIndexes.has(virtualRow.index)) {
|
|
3475
3793
|
continue;
|
|
3476
3794
|
}
|
|
3795
|
+
if (virtualRow.index === entryIndex) {
|
|
3796
|
+
items.push({
|
|
3797
|
+
index: virtualRow.index,
|
|
3798
|
+
start: virtualRow.start,
|
|
3799
|
+
size: virtualRow.size,
|
|
3800
|
+
key: String(NEW_ROW_KEY),
|
|
3801
|
+
skeleton: false,
|
|
3802
|
+
newRow: true
|
|
3803
|
+
});
|
|
3804
|
+
continue;
|
|
3805
|
+
}
|
|
3477
3806
|
const skeleton = serverSideActive && model.getRow(virtualRow.index) === void 0 && model.getLabelRow?.(virtualRow.index) === void 0;
|
|
3478
3807
|
items.push({
|
|
3479
3808
|
index: virtualRow.index,
|
|
@@ -3635,6 +3964,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3635
3964
|
const placement2 = editingCellPlacement();
|
|
3636
3965
|
return column !== void 0 && placement2 !== null && autoHeightActive() && placement2.rect.height > rowHeight() && (column.verticalAlign ?? props.verticalAlign ?? (column.autoHeight === true ? "top" : "center")) === "top";
|
|
3637
3966
|
});
|
|
3967
|
+
const editorLeadingInset = createMemo10(() => {
|
|
3968
|
+
const editing = ui().editingCell;
|
|
3969
|
+
const columnKey = treeColumnKey();
|
|
3970
|
+
if (!editing || columnKey === void 0 || !treeStage() || orderedColumns()[editing.col]?.key !== columnKey) {
|
|
3971
|
+
return void 0;
|
|
3972
|
+
}
|
|
3973
|
+
const level = rowModel().getTreeRow?.(editing.row)?.level;
|
|
3974
|
+
return level !== void 0 ? `calc(var(--ssg-cell-pad-x) + var(--ssg-tree-indent) * ${level} + 18px)` : void 0;
|
|
3975
|
+
});
|
|
3638
3976
|
const selectionExtents = createMemo10(() => resolveSelectionExtents(ui().selection, paneLayout(), viewRowCount()));
|
|
3639
3977
|
const selectionBand = createMemo10(
|
|
3640
3978
|
() => resolveSelectionBand(selectionExtents(), vertical().windowFirstRow, vertical().windowLastRow, vertical().rowMetrics)
|
|
@@ -3655,11 +3993,17 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3655
3993
|
const motionExtrasFeature2 = features.motionExtras;
|
|
3656
3994
|
const copiedSelection = createMemo10(() => {
|
|
3657
3995
|
const copied = view().copiedRange;
|
|
3658
|
-
if (!motionExtrasFeature2 || !(props.showCopyRange ?? true)
|
|
3996
|
+
if (!copied || copied.cut === void 0 && (!motionExtrasFeature2 || !(props.showCopyRange ?? true))) {
|
|
3659
3997
|
return null;
|
|
3660
3998
|
}
|
|
3661
3999
|
const state = ui();
|
|
3662
|
-
return
|
|
4000
|
+
return isCopiedRangeCurrent(copied, {
|
|
4001
|
+
sort: state.sort,
|
|
4002
|
+
filters: state.filters,
|
|
4003
|
+
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
4004
|
+
viewRowCount: viewRowCount(),
|
|
4005
|
+
columns: orderedColumnKeys()
|
|
4006
|
+
}) ? copied.selection : null;
|
|
3663
4007
|
});
|
|
3664
4008
|
const copiedExtents = createMemo10(() => resolveSelectionExtents(copiedSelection(), paneLayout(), viewRowCount()));
|
|
3665
4009
|
const copiedBand = createMemo10(
|
|
@@ -3781,9 +4125,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3781
4125
|
}
|
|
3782
4126
|
return void 0;
|
|
3783
4127
|
});
|
|
3784
|
-
const filteredDataRows = createMemo10(
|
|
3785
|
-
(
|
|
3786
|
-
|
|
4128
|
+
const filteredDataRows = createMemo10(() => {
|
|
4129
|
+
if (isServerSide()) {
|
|
4130
|
+
return null;
|
|
4131
|
+
}
|
|
4132
|
+
const visibility = treeStage()?.visibility;
|
|
4133
|
+
if (visibility) {
|
|
4134
|
+
return visibility.filtering && visibility.matchedCount < rows().length ? { rows: rows(), order: visibility.matchedOrder, rowKeyGetter: resolvedRowKeyGetter() } : null;
|
|
4135
|
+
}
|
|
4136
|
+
return order().length < baseOrder().length ? { rows: rows(), order: order(), rowKeyGetter: resolvedRowKeyGetter() } : null;
|
|
4137
|
+
});
|
|
3787
4138
|
const countSelectedRowsInOrder = createSelectedRowsInOrderCounter();
|
|
3788
4139
|
const selectAllRowsState = createMemo10(() => {
|
|
3789
4140
|
const filtered = filteredDataRows();
|
|
@@ -3964,9 +4315,13 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3964
4315
|
const changeTrackingParts = features.changeTracking;
|
|
3965
4316
|
const changeTracker = engine.changeTracker;
|
|
3966
4317
|
const changeTrackingActive = createMemo10(
|
|
3967
|
-
() => (props.trackChanges
|
|
4318
|
+
() => isTrackChangesOn(props.trackChanges) && changeTrackingParts !== void 0 && !isServerSide() && props.rowKeyGetter !== void 0 && props.onRowsChange != null
|
|
4319
|
+
);
|
|
4320
|
+
const trackRowChanges = createMemo10(
|
|
4321
|
+
() => changeTrackingActive() && typeof props.trackChanges === "object" && props.trackChanges.rows === true
|
|
3968
4322
|
);
|
|
3969
4323
|
const history = createHistoryController();
|
|
4324
|
+
const historyRowLocator = createMemo10(() => createHistoryRowLocator(rowModel(), treeStage()));
|
|
3970
4325
|
connectController(history, () => ({
|
|
3971
4326
|
rows: rows(),
|
|
3972
4327
|
selection: ui().selection,
|
|
@@ -3984,14 +4339,21 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3984
4339
|
},
|
|
3985
4340
|
rowKeyGetter: props.rowKeyGetter,
|
|
3986
4341
|
// 追加(1.8.0): グリッドの変更を変更の追跡へ(効いていなければ渡さない)。
|
|
3987
|
-
onGridRowsChange: changeTrackingActive() ? changeTracker.noteGridRowsChange : void 0
|
|
4342
|
+
onGridRowsChange: changeTrackingActive() ? changeTracker.noteGridRowsChange : void 0,
|
|
4343
|
+
// 追加(1.9.0 の点検): 元に戻した後のアクティブセルと選択を行のキーで付け替える(React 版と同じ)。
|
|
4344
|
+
rowLocator: historyRowLocator(),
|
|
4345
|
+
// 追加(1.9.0 の点検 T6-02): 元に戻したアクティブセルは行のキーで付け替えるので、並びに付いていく仕組みに教える(React 版と同じ)。
|
|
4346
|
+
noteFollowMove: engine.activeRowFollow.noteFollowMove,
|
|
4347
|
+
// 追加(1.10.0 の別視点のレビュー RA-6): 元に戻す / やり直すの前に入力行の下書きを行にする(React 版と同じ)。
|
|
4348
|
+
beforeRestore: newRowActive() ? engine.newRow.commitDraft : void 0
|
|
3988
4349
|
}), "render", "history");
|
|
3989
4350
|
connectController(changeTracker, () => ({
|
|
3990
4351
|
enabled: changeTrackingActive(),
|
|
3991
4352
|
rows: rows(),
|
|
3992
4353
|
columns: columns(),
|
|
3993
4354
|
rowKeyGetter: props.rowKeyGetter,
|
|
3994
|
-
applyRows: props.onRowsChange ? history.applyRows : void 0
|
|
4355
|
+
applyRows: props.onRowsChange ? history.applyRows : void 0,
|
|
4356
|
+
trackRows: trackRowChanges()
|
|
3995
4357
|
}), "render", "changeTracker");
|
|
3996
4358
|
const changeSnapshot = createExternalStoreSignal(changeTracker, "changeTrackerStore");
|
|
3997
4359
|
connectController(
|
|
@@ -4004,8 +4366,21 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4004
4366
|
"changeNotifier"
|
|
4005
4367
|
);
|
|
4006
4368
|
const unsavedChanges = createMemo10(
|
|
4007
|
-
() =>
|
|
4008
|
-
|
|
4369
|
+
() => {
|
|
4370
|
+
if (!changeTrackingActive()) {
|
|
4371
|
+
return null;
|
|
4372
|
+
}
|
|
4373
|
+
const snapshot2 = changeSnapshot();
|
|
4374
|
+
return trackRowChanges() ? {
|
|
4375
|
+
rowCount: snapshot2.rowCount,
|
|
4376
|
+
cellCount: snapshot2.cellCount,
|
|
4377
|
+
addedCount: snapshot2.addedCount,
|
|
4378
|
+
removedCount: snapshot2.removedCount
|
|
4379
|
+
} : { rowCount: snapshot2.rowCount, cellCount: snapshot2.cellCount };
|
|
4380
|
+
},
|
|
4381
|
+
{
|
|
4382
|
+
equals: (a, b) => a === b || a !== null && b !== null && a.rowCount === b.rowCount && a.cellCount === b.cellCount && a.addedCount === b.addedCount && a.removedCount === b.removedCount
|
|
4383
|
+
}
|
|
4009
4384
|
);
|
|
4010
4385
|
const unsavedTracking = createMemo10(() => {
|
|
4011
4386
|
const parts = changeTrackingParts;
|
|
@@ -4018,9 +4393,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4018
4393
|
getUnsavedCells: changeTracker.getUnsavedCells,
|
|
4019
4394
|
trackedColumns: changeTracker.getTrackedColumns(),
|
|
4020
4395
|
describeCell: (column, row, savedValue) => parts.describeUnsavedCell(column, row, savedValue, texts),
|
|
4021
|
-
rowDescription: texts.unsavedRow
|
|
4396
|
+
rowDescription: texts.unsavedRow,
|
|
4397
|
+
closedTreeDescription: texts.unsavedInClosedTreeRow,
|
|
4398
|
+
// 追加(1.10.0): グリッドで足した行(行を追っているときだけ)。
|
|
4399
|
+
isAddedRow: trackRowChanges() ? changeTracker.isAddedRow : void 0,
|
|
4400
|
+
addedRowDescription: texts.unsavedAddedRow
|
|
4022
4401
|
};
|
|
4023
4402
|
});
|
|
4403
|
+
const closedTreeUnsaved = createMemo10(
|
|
4404
|
+
() => changeTrackingActive() && treeStage() && (changeSnapshot().rowCount > 0 || changeSnapshot().addedCount > 0) ? engine.rowPipeline.getClosedTreeAncestorKeys(treeOpenState(), changeTracker.getUnsavedRowKeys()) : null
|
|
4405
|
+
);
|
|
4024
4406
|
const resolveRevertItems = () => {
|
|
4025
4407
|
const parts = changeTrackingParts;
|
|
4026
4408
|
if (!untrack13(changeTrackingActive) || untrack13(readOnly) || !parts) {
|
|
@@ -4043,9 +4425,44 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4043
4425
|
});
|
|
4044
4426
|
};
|
|
4045
4427
|
const handleRowsChange = () => props.onRowsChange ? history.handleRowsChange : void 0;
|
|
4428
|
+
connectController(engine.newRow, () => {
|
|
4429
|
+
rowModel();
|
|
4430
|
+
void ui().activeCell;
|
|
4431
|
+
void ui().editingCell;
|
|
4432
|
+
return {
|
|
4433
|
+
active: newRowActive(),
|
|
4434
|
+
rows: rows(),
|
|
4435
|
+
createRow: props.createRow,
|
|
4436
|
+
rowKeyGetter: props.rowKeyGetter,
|
|
4437
|
+
handleRowsChange: handleRowsChange(),
|
|
4438
|
+
getUiState: store.getState,
|
|
4439
|
+
dispatch,
|
|
4440
|
+
getViewState: store.getViewState,
|
|
4441
|
+
setViewState: store.setViewState,
|
|
4442
|
+
gridRootRef,
|
|
4443
|
+
scrollContainerRef
|
|
4444
|
+
};
|
|
4445
|
+
}, "render", "newRow");
|
|
4446
|
+
connectController(
|
|
4447
|
+
{ update: (args) => engine.newRow.notifyDraft(args.callback) },
|
|
4448
|
+
() => {
|
|
4449
|
+
newRowDraft();
|
|
4450
|
+
const option = props.newRow;
|
|
4451
|
+
return { callback: inOwnTick(typeof option === "object" ? option.onDraftChange : void 0) };
|
|
4452
|
+
},
|
|
4453
|
+
"effect",
|
|
4454
|
+
"newRowDraftNotifier"
|
|
4455
|
+
);
|
|
4046
4456
|
const cells = createCellCommands();
|
|
4047
4457
|
const { selectEntireGrid, clearSelectedCells, tryStartEdit: tryStartEditCell } = cells;
|
|
4048
4458
|
const orderedColumnKeys = createMemo10(() => orderedColumns().map((column) => column.key).join("\0"));
|
|
4459
|
+
const resolvedExcelShortcuts = createMemo10(() => resolveExcelShortcuts2(props.excelShortcuts));
|
|
4460
|
+
const excelShortcutCommandsEnabled = createMemo10(
|
|
4461
|
+
() => features.excelShortcuts !== void 0 && usesExcelShortcutCommands2(resolvedExcelShortcuts())
|
|
4462
|
+
);
|
|
4463
|
+
const fillSelectionEnabled = createMemo10(
|
|
4464
|
+
() => features.excelShortcuts !== void 0 && resolvedExcelShortcuts().fillSelection
|
|
4465
|
+
);
|
|
4049
4466
|
const clipboard = createClipboardController();
|
|
4050
4467
|
connectController(clipboard, () => ({
|
|
4051
4468
|
rows: rows(),
|
|
@@ -4058,7 +4475,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4058
4475
|
readOnly: editLocked(),
|
|
4059
4476
|
canEditCell: canEditCell(),
|
|
4060
4477
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
4061
|
-
|
|
4478
|
+
// 変更(1.10.0 / Excel のキー): 切り取りのときは元のセルの控え(cut)も入れます。
|
|
4479
|
+
onCopied: (selection, cut) => {
|
|
4062
4480
|
const state = store.getState();
|
|
4063
4481
|
store.setViewState({
|
|
4064
4482
|
copiedRange: {
|
|
@@ -4069,10 +4487,24 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4069
4487
|
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
4070
4488
|
viewRowCount: untrack13(viewRowCount),
|
|
4071
4489
|
columns: untrack13(orderedColumnKeys)
|
|
4072
|
-
}
|
|
4490
|
+
},
|
|
4491
|
+
...cut === void 0 ? {} : { cut }
|
|
4073
4492
|
}
|
|
4074
4493
|
});
|
|
4075
4494
|
},
|
|
4495
|
+
// 追加(1.10.0 / Excel のキー): 切り取りが生きているか(点線を描く条件と同じ = 今の見え方のまま)。
|
|
4496
|
+
getLiveCopiedRange: () => {
|
|
4497
|
+
const copied = store.getViewState().copiedRange;
|
|
4498
|
+
const state = store.getState();
|
|
4499
|
+
return copied !== null && isCopiedRangeCurrent(copied, {
|
|
4500
|
+
sort: state.sort,
|
|
4501
|
+
filters: state.filters,
|
|
4502
|
+
collapsedGroupKeys: state.collapsedGroupKeys,
|
|
4503
|
+
viewRowCount: untrack13(viewRowCount),
|
|
4504
|
+
columns: untrack13(orderedColumnKeys)
|
|
4505
|
+
}) ? copied : null;
|
|
4506
|
+
},
|
|
4507
|
+
onCutPasted: () => store.setViewState({ copiedRange: null }),
|
|
4076
4508
|
createRow: props.createRow,
|
|
4077
4509
|
createOverflowColumn: props.createOverflowColumn,
|
|
4078
4510
|
onPasteSkipped: inOwnTick(props.onPasteSkipped),
|
|
@@ -4085,7 +4517,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4085
4517
|
dispatch
|
|
4086
4518
|
}), "render", "clipboard");
|
|
4087
4519
|
const isWholeGridSelected = createMemo10(
|
|
4088
|
-
() => computeIsWholeGridSelected(ui().selection,
|
|
4520
|
+
() => computeIsWholeGridSelected(ui().selection, getSelectableRowCount(rowModel()), visibleColumns().length)
|
|
4089
4521
|
);
|
|
4090
4522
|
const fillHandleFeature2 = features.fillHandle;
|
|
4091
4523
|
const fill = fillHandleFeature2?.createFillHandle({
|
|
@@ -4126,19 +4558,41 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4126
4558
|
const FindBar = findFeature2?.FindBar;
|
|
4127
4559
|
const findIndex = createMemo10(() => findSnapshot().index);
|
|
4128
4560
|
const findCurrentIndex = createMemo10(() => findSnapshot().currentIndex);
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4561
|
+
const findTreeRowModel = createMemo10(() => treeStage() ? engine.rowPipeline.getTreeAllOpenRowModel() : null);
|
|
4562
|
+
const findToViewRow = createMemo10(() => {
|
|
4563
|
+
const stage = treeStage();
|
|
4564
|
+
const allOpen = stage ? engine.rowPipeline.getTreeAllOpenDisplay() : null;
|
|
4565
|
+
if (!stage || !allOpen) {
|
|
4566
|
+
return void 0;
|
|
4567
|
+
}
|
|
4568
|
+
const { viewIndexOf } = stage.display;
|
|
4569
|
+
return (rowIndex) => viewIndexOf[allOpen.order[rowIndex] ?? -1] ?? -1;
|
|
4570
|
+
});
|
|
4571
|
+
connectController(engine.find, () => {
|
|
4572
|
+
const treeRowModel = findTreeRowModel();
|
|
4573
|
+
return {
|
|
4574
|
+
enabled: findEnabled(),
|
|
4575
|
+
rowModel: treeRowModel ?? rowModel(),
|
|
4576
|
+
columns: orderedColumns(),
|
|
4577
|
+
caseSensitive: findOptions()?.caseSensitive ?? false,
|
|
4578
|
+
// 条件付き書式の機能が無ければチップもデータバーも描かれないので、値の文字を探す(React 版 1.0.2 / QB-1)。
|
|
4579
|
+
conditionalFormat: conditionalFormatFeature2 !== void 0,
|
|
4580
|
+
toViewRow: findToViewRow(),
|
|
4581
|
+
// カレントのヒットへ: クリックと同じ 1 セルの選択 + 見える位置へのスクロール(命令的 API と同じ経路)。
|
|
4582
|
+
// 変更(1.9.0 の点検 T3-02 / T6-09): 打っている途中の移動('query')で開いた親は、次の文字の移動で閉じ直す(React 版と同じ)。
|
|
4583
|
+
onNavigate: (rowIndex, colIndex, cause) => {
|
|
4584
|
+
if (treeRowModel) {
|
|
4585
|
+
const rowKey = treeRowModel.getRowKey(rowIndex);
|
|
4586
|
+
if (rowKey !== void 0) {
|
|
4587
|
+
engine.gridApi.revealCell(rowKey, colIndex, cause === "query");
|
|
4588
|
+
}
|
|
4589
|
+
return;
|
|
4590
|
+
}
|
|
4591
|
+
engine.gridApi.handle.selectCell(rowIndex, colIndex, { scrollIntoView: true });
|
|
4592
|
+
},
|
|
4593
|
+
onChange: inOwnTick(props.onFindChange)
|
|
4594
|
+
};
|
|
4595
|
+
}, "render", "find");
|
|
4142
4596
|
const openFindFromShortcut = () => engine.find.open();
|
|
4143
4597
|
const closeFindAndRefocus = () => {
|
|
4144
4598
|
engine.find.close();
|
|
@@ -4174,7 +4628,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4174
4628
|
const openColumnMenuForCell = (col) => {
|
|
4175
4629
|
const column = untrack13(orderedColumns)[col];
|
|
4176
4630
|
const root = gridRootRef.current;
|
|
4177
|
-
if (!columnMenu || !column || !root ||
|
|
4631
|
+
if (!columnMenu || !column || !root || isSyntheticColumnKey3(column.key)) {
|
|
4178
4632
|
return false;
|
|
4179
4633
|
}
|
|
4180
4634
|
const header = Array.from(root.querySelectorAll(".ssg-header-cell[data-ssg-col-key]")).find(
|
|
@@ -4350,6 +4804,12 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4350
4804
|
setEditorInitialValue,
|
|
4351
4805
|
dispatch,
|
|
4352
4806
|
handleCopy: clipboard.handleCopy,
|
|
4807
|
+
// 追加(1.10.0 / Excel のキー): Ctrl / ⌘ + X の切り取り(excelShortcuts で外したときは渡さない)と、ほかの 6 つ(機能)。
|
|
4808
|
+
handleCut: resolvedExcelShortcuts().cut ? clipboard.handleCut : void 0,
|
|
4809
|
+
// 追加(1.10.0 / 入力行): 編集していない入力行の Escape は下書きを捨てる。
|
|
4810
|
+
onEscapeNewRow: newRowActive() ? engine.newRow.discardAt : void 0,
|
|
4811
|
+
onTabPastNewRowDraft: newRowActive() ? engine.newRow.commitFromLastColumn : void 0,
|
|
4812
|
+
onShortcutKeyDown: excelShortcutCommandsEnabled() ? engine.excelShortcuts.handleKeyDown : void 0,
|
|
4353
4813
|
openFind: findShortcut() ? openFindFromShortcut : void 0,
|
|
4354
4814
|
handleCellDoubleClick: tryStartEditCell,
|
|
4355
4815
|
isWholeGridSelected: isWholeGridSelected(),
|
|
@@ -4365,7 +4825,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4365
4825
|
openColumnMenu: columnMenuEnabled() ? openColumnMenuForCell : void 0,
|
|
4366
4826
|
openContextMenu: contextMenuActive() ? openContextMenuFromKeyboard : void 0,
|
|
4367
4827
|
// 最終列の Tab: その行のカードが開いていればカードの最初の要素へ、無ければ表の直後の目印から既定の Tab(段階 2 C-N2 / F-10)。
|
|
4368
|
-
onTabPastLastColumn: detailRows.handleTabPastLastColumn
|
|
4828
|
+
onTabPastLastColumn: detailRows.handleTabPastLastColumn,
|
|
4829
|
+
// 追加(1.9.0 / ツリーデータ): 木の列のセルの Alt+Shift+↓ / ↑ で開く / 閉じる。
|
|
4830
|
+
onToggleTreeRow: treeStage() ? engine.gridApi.toggleTreeCell : void 0
|
|
4369
4831
|
}), "render", "keyboard");
|
|
4370
4832
|
connectController(edit, () => ({
|
|
4371
4833
|
uiState: ui(),
|
|
@@ -4400,6 +4862,22 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4400
4862
|
startEditWithValue: edit.startEditWithValue,
|
|
4401
4863
|
dispatch
|
|
4402
4864
|
}), "render", "cells");
|
|
4865
|
+
connectController(engine.excelShortcuts, () => ({
|
|
4866
|
+
rows: rows(),
|
|
4867
|
+
rowModel: rowModel(),
|
|
4868
|
+
orderedColumns: orderedColumns(),
|
|
4869
|
+
uiState: ui(),
|
|
4870
|
+
getUiState: store.getState,
|
|
4871
|
+
readOnly: editLocked(),
|
|
4872
|
+
canEditCell: canEditCell(),
|
|
4873
|
+
handleRowsChange: handleRowsChange(),
|
|
4874
|
+
applyServerSideCellEdits: applyServerSideCellEdits(),
|
|
4875
|
+
dispatch,
|
|
4876
|
+
shortcuts: resolvedExcelShortcuts(),
|
|
4877
|
+
localeTexts: localeTexts(),
|
|
4878
|
+
commitEdit: (value) => edit.commitEdit(value),
|
|
4879
|
+
endEdit: edit.cancelEdit
|
|
4880
|
+
}), "render", "excelShortcuts");
|
|
4403
4881
|
const imeDirectInputEnabled = createMemo10(() => (props.imeDirectInput ?? false) && imeFeature !== void 0);
|
|
4404
4882
|
connectController(
|
|
4405
4883
|
engine.imeInput,
|
|
@@ -4538,7 +5016,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4538
5016
|
return tree && columnGroupsFeature2 ? columnGroupsFeature2.createColumnChooserDropClamp(tree, columns()) : void 0;
|
|
4539
5017
|
});
|
|
4540
5018
|
const sortManagerColumns = createMemo10(
|
|
4541
|
-
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !
|
|
5019
|
+
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey3(column.key)).map((column) => ({ key: column.key, title: columnTitles()?.get(column.key) ?? (column.title || column.key) }))
|
|
4542
5020
|
);
|
|
4543
5021
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
4544
5022
|
const toolPanelTabs = createMemo10(
|
|
@@ -4713,12 +5191,12 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4713
5191
|
hasRowKeys: () => props.rowKeyGetter !== void 0,
|
|
4714
5192
|
dragRowLabel: () => localeTexts().dragRowLabel
|
|
4715
5193
|
});
|
|
4716
|
-
const renderRowDropIndicator = (pane, cap) => rowDrag ? <
|
|
5194
|
+
const renderRowDropIndicator = (pane, cap) => rowDrag ? <Show12 when={rowDragAvailable()}>
|
|
4717
5195
|
<div
|
|
4718
5196
|
ref={(element) => rowDrag.setIndicator(pane, element)}
|
|
4719
5197
|
class={["ssg-row-drop-indicator", { "ssg-row-drop-indicator--cap": cap() }]}
|
|
4720
5198
|
/>
|
|
4721
|
-
</
|
|
5199
|
+
</Show12> : null;
|
|
4722
5200
|
const handleCornerHeaderPointerDown = (event) => {
|
|
4723
5201
|
event.preventDefault();
|
|
4724
5202
|
if (event.button !== 0) {
|
|
@@ -4746,9 +5224,24 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4746
5224
|
const handleColumnHeaderPointerLeave = (colIndex) => {
|
|
4747
5225
|
setHoveredColumnIndex((current) => current === colIndex ? null : current);
|
|
4748
5226
|
};
|
|
5227
|
+
const treeApi = createMemo10(() => {
|
|
5228
|
+
const stage = treeStage();
|
|
5229
|
+
const columnKey = treeColumnKey();
|
|
5230
|
+
return stage && columnKey !== void 0 ? {
|
|
5231
|
+
stage,
|
|
5232
|
+
columnKey,
|
|
5233
|
+
filterSignature: treeFilterSignature(),
|
|
5234
|
+
getClosedRowKeys: engine.rowPipeline.getClosedTreeRowKeys,
|
|
5235
|
+
getOpenResolver: engine.rowPipeline.getTreeOpenResolver,
|
|
5236
|
+
getAllOpenDisplay: engine.rowPipeline.getTreeAllOpenDisplay,
|
|
5237
|
+
notifyOpenChange: engine.treeRowOpenNotifier.push
|
|
5238
|
+
} : void 0;
|
|
5239
|
+
});
|
|
4749
5240
|
connectController(engine.gridApi, () => ({
|
|
4750
5241
|
scrollContainerRef,
|
|
4751
5242
|
dispatch,
|
|
5243
|
+
// 追加(1.10.0 / 入力行): focusNewRow() が移る最初の編集できる列を決める。
|
|
5244
|
+
readOnly: editLocked(),
|
|
4752
5245
|
rowModel: rowModel(),
|
|
4753
5246
|
viewRowCount: viewRowCount(),
|
|
4754
5247
|
leafRowCount: leafRowCount(),
|
|
@@ -4802,6 +5295,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4802
5295
|
// 追加(1.8.0): 変更の追跡(getChanges / markChangesSaved / revertChanges の委譲先)。
|
|
4803
5296
|
changeTracker,
|
|
4804
5297
|
changeTrackingActive: changeTrackingActive(),
|
|
5298
|
+
// 追加(1.9.0 / ツリーデータ): 木の開閉のハンドル・getState の closedTreeRows・エクスポートの深さ・検索の移動。
|
|
5299
|
+
treeData: treeApi(),
|
|
4805
5300
|
detailRowEnabled: detailRowEnabled(),
|
|
4806
5301
|
detailIsExpandable: props.detailRow?.isExpandable,
|
|
4807
5302
|
detailIndexCacheRef: engine.detailIndexCache,
|
|
@@ -4820,6 +5315,13 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4820
5315
|
},
|
|
4821
5316
|
{ name: "gridApiBottomPin" }
|
|
4822
5317
|
);
|
|
5318
|
+
createEffect4(
|
|
5319
|
+
() => rowModel(),
|
|
5320
|
+
outsideGraphApply(() => {
|
|
5321
|
+
engine.gridApi.flushPendingReveal();
|
|
5322
|
+
}),
|
|
5323
|
+
{ name: "gridApiReveal" }
|
|
5324
|
+
);
|
|
4823
5325
|
const handleCallBeforeMountWarned = { current: false };
|
|
4824
5326
|
applyHandleRef(untrack13(() => props.ref), exposeHandle(engine.gridApi.handle, (method) => {
|
|
4825
5327
|
if (mountGate.done) {
|
|
@@ -4831,6 +5333,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4831
5333
|
warnHandleCallBeforeMount(handleCallBeforeMountWarned, method);
|
|
4832
5334
|
}
|
|
4833
5335
|
}));
|
|
5336
|
+
const treeClosedRowKeys = createMemo10(
|
|
5337
|
+
() => treeStage() ? engine.rowPipeline.getClosedTreeRowKeys(treeOpenState()) : null
|
|
5338
|
+
);
|
|
4834
5339
|
connectController(
|
|
4835
5340
|
engine.stateChangeNotifier,
|
|
4836
5341
|
() => ({
|
|
@@ -4844,6 +5349,10 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4844
5349
|
// 閉じている列のグループ(開閉できるグループがあるときだけ状態に入る)。
|
|
4845
5350
|
closedColumnGroupKeys: ui().closedColumnGroupKeys,
|
|
4846
5351
|
columnGroupTree: columnGroupTree(),
|
|
5352
|
+
// 追加(1.9.0 / ツリーデータ): 閉じている親の行のキー(ツリーデータのときだけ状態に入る)。ツリーデータでない表では
|
|
5353
|
+
// 段の memo を読みません(読むとこの effect がほかの通知の effect の後ろに回り、onColumnGroupOpenChange との順番が
|
|
5354
|
+
// React 版と変わっていた)。
|
|
5355
|
+
closedTreeRows: treeDataActive() ? treeClosedRowKeys() : null,
|
|
4847
5356
|
onStateChange: inOwnTick(props.onStateChange),
|
|
4848
5357
|
onFiltersChange: inOwnTick(props.onFiltersChange),
|
|
4849
5358
|
onSortChange: inOwnTick(props.onSortChange)
|
|
@@ -4861,6 +5370,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4861
5370
|
"effect",
|
|
4862
5371
|
"columnGroupOpenNotifier"
|
|
4863
5372
|
);
|
|
5373
|
+
connectController(
|
|
5374
|
+
engine.treeRowOpenNotifier,
|
|
5375
|
+
() => {
|
|
5376
|
+
treeOpenState();
|
|
5377
|
+
return { onTreeRowOpenChange: inOwnTick(props.onTreeRowOpenChange) };
|
|
5378
|
+
},
|
|
5379
|
+
"effect",
|
|
5380
|
+
"treeRowOpenNotifier"
|
|
5381
|
+
);
|
|
4864
5382
|
onGridMounted(() => {
|
|
4865
5383
|
const element = gridRootRef.current;
|
|
4866
5384
|
if (!element) {
|
|
@@ -4958,10 +5476,10 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4958
5476
|
});
|
|
4959
5477
|
const showTopBarSummary = () => props.showTopBarSummary ?? true;
|
|
4960
5478
|
const showTopBarFilter = () => (props.showTopBarFilter ?? true) && globalFilterEnabled();
|
|
4961
|
-
const topBar = () => <
|
|
4962
|
-
<
|
|
5479
|
+
const topBar = () => <Show12 when={props.showTopBar ?? true}>
|
|
5480
|
+
<Show12
|
|
4963
5481
|
when={renderTopBarFn() !== void 0}
|
|
4964
|
-
fallback={<
|
|
5482
|
+
fallback={<Show12 when={showTopBarSummary() || showTopBarFilter()}>
|
|
4965
5483
|
<DefaultGridTopBar
|
|
4966
5484
|
slot={slots().toolbar}
|
|
4967
5485
|
derivedSummary={derivedSummary()}
|
|
@@ -4975,13 +5493,13 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4975
5493
|
onFilterSummaryClick={columnFilterEnabled() && toolPanel ? toggleFilterManager : void 0}
|
|
4976
5494
|
filterPanelOpen={toolPanel?.activeTab() === "filter"}
|
|
4977
5495
|
/>
|
|
4978
|
-
</
|
|
5496
|
+
</Show12>}
|
|
4979
5497
|
>
|
|
4980
5498
|
{customTopBar()}
|
|
4981
|
-
</
|
|
4982
|
-
</
|
|
4983
|
-
const bottomBar = () => <
|
|
4984
|
-
<
|
|
5499
|
+
</Show12>
|
|
5500
|
+
</Show12>;
|
|
5501
|
+
const bottomBar = () => <Show12 when={props.showBottomBar ?? true}>
|
|
5502
|
+
<Show12
|
|
4985
5503
|
when={renderBottomBarFn() !== void 0}
|
|
4986
5504
|
fallback={<DefaultGridBottomBar
|
|
4987
5505
|
slot={slots().statusBar}
|
|
@@ -4993,15 +5511,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4993
5511
|
/>}
|
|
4994
5512
|
>
|
|
4995
5513
|
{customBottomBar()}
|
|
4996
|
-
</
|
|
4997
|
-
</
|
|
5514
|
+
</Show12>
|
|
5515
|
+
</Show12>;
|
|
4998
5516
|
const editorSession = createMemo10((previous) => {
|
|
4999
5517
|
const cell = ui().editingCell;
|
|
5000
5518
|
if (cell === null) {
|
|
5001
5519
|
return null;
|
|
5002
5520
|
}
|
|
5003
5521
|
const model = rowModel();
|
|
5004
|
-
|
|
5522
|
+
newRowDraft();
|
|
5523
|
+
if (peekEditRow(model, cell.row) === void 0) {
|
|
5005
5524
|
return previous ?? { id: 1, identity: null };
|
|
5006
5525
|
}
|
|
5007
5526
|
const identity = {
|
|
@@ -5035,15 +5554,17 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5035
5554
|
}
|
|
5036
5555
|
const column = orderedColumns()[cell.col];
|
|
5037
5556
|
const model = rowModel();
|
|
5038
|
-
|
|
5557
|
+
newRowDraft();
|
|
5558
|
+
const row = peekEditRow(model, cell.row);
|
|
5039
5559
|
if (!column || !row) {
|
|
5040
5560
|
return null;
|
|
5041
5561
|
}
|
|
5562
|
+
const { sourceRowIndex, rowKey } = resolveCanEditCellContext(model, cell.row);
|
|
5042
5563
|
return {
|
|
5043
5564
|
row,
|
|
5044
5565
|
rowIndex: cell.row,
|
|
5045
|
-
sourceRowIndex
|
|
5046
|
-
rowKey
|
|
5566
|
+
sourceRowIndex,
|
|
5567
|
+
rowKey,
|
|
5047
5568
|
colIndex: cell.col,
|
|
5048
5569
|
column,
|
|
5049
5570
|
value: getCellValue2(row, column)
|
|
@@ -5078,13 +5599,13 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5078
5599
|
const isRowDraggable = props.isRowDraggable;
|
|
5079
5600
|
return !isRowDraggable || isRowDraggable(row, { rowKey: cell.rowKey, sourceRowIndex: cell.sourceRowIndex });
|
|
5080
5601
|
});
|
|
5081
|
-
return <
|
|
5602
|
+
return <Show12 when={draggable()}>
|
|
5082
5603
|
<RowDragHandle2
|
|
5083
5604
|
operable={rowDragOperable()}
|
|
5084
5605
|
tooltip={rowDragOperable() ? rowDragTexts().dragRow : rowDragTexts().dragRowDisabled}
|
|
5085
5606
|
onPointerDown={(event) => rowDrag.onRowDragHandlePointerDown(untrack13(() => cell.rowIndex), event)}
|
|
5086
5607
|
/>
|
|
5087
|
-
</
|
|
5608
|
+
</Show12>;
|
|
5088
5609
|
};
|
|
5089
5610
|
const cellTextOf = (row, column) => {
|
|
5090
5611
|
const value = getCellValue2(row, column);
|
|
@@ -5104,7 +5625,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5104
5625
|
};
|
|
5105
5626
|
const isTextCellColumn = (column) => column.key !== ROW_DRAG_HANDLE_COLUMN_KEY2 && !column.renderCell && column.editor?.type !== "checkbox" && !(conditionalFormatFeature2 && (column.conditionalFormat?.chips !== void 0 || column.conditionalFormat?.dataBar?.showValue === false));
|
|
5106
5627
|
const cellText = (row, column, ranges, findCurrentIndex2) => highlightFind(cellTextOf(row, column), ranges, findCurrentIndex2);
|
|
5107
|
-
const
|
|
5628
|
+
const renderDefaultCellContent = (currentRow, column, cell, treeAggregate) => {
|
|
5108
5629
|
if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
5109
5630
|
return renderRowDragHandleCell(currentRow(), cell);
|
|
5110
5631
|
}
|
|
@@ -5140,11 +5661,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5140
5661
|
const indexes = labelViewIndexes();
|
|
5141
5662
|
return indexes ? resolveDataRowNumber2(indexes, cell.rowIndex) : cell.rowIndex + 1;
|
|
5142
5663
|
};
|
|
5143
|
-
return <
|
|
5664
|
+
return <Show12 when={expandable()}>
|
|
5144
5665
|
<DetailToggleButton detail={detail} rowNumber={rowNumber()} onPress={edit.endEditLeftOpen} />
|
|
5145
|
-
</
|
|
5666
|
+
</Show12>;
|
|
5146
5667
|
}
|
|
5147
|
-
|
|
5668
|
+
const context = {
|
|
5148
5669
|
get row() {
|
|
5149
5670
|
return currentRow();
|
|
5150
5671
|
},
|
|
@@ -5162,7 +5683,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5162
5683
|
return detailRowEnabled() ? detail : void 0;
|
|
5163
5684
|
},
|
|
5164
5685
|
get value() {
|
|
5165
|
-
return cellValue();
|
|
5686
|
+
return treeAggregate?.has() ? treeAggregate.value() : cellValue();
|
|
5166
5687
|
},
|
|
5167
5688
|
column,
|
|
5168
5689
|
get isActive() {
|
|
@@ -5178,7 +5699,23 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5178
5699
|
return cell.readOnly;
|
|
5179
5700
|
},
|
|
5180
5701
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
5181
|
-
}
|
|
5702
|
+
};
|
|
5703
|
+
if (treeColumnKey() !== void 0) {
|
|
5704
|
+
Object.defineProperty(context, "tree", {
|
|
5705
|
+
enumerable: true,
|
|
5706
|
+
get: () => {
|
|
5707
|
+
const tree = cell.treeRow;
|
|
5708
|
+
return tree ? {
|
|
5709
|
+
level: tree.level,
|
|
5710
|
+
hasChildren: tree.hasChildren,
|
|
5711
|
+
open: tree.open,
|
|
5712
|
+
aggregate: treeAggregate?.has() ?? false,
|
|
5713
|
+
setOpen: (open) => engine.gridApi.handle.setTreeRowOpen(cell.rowKey, open)
|
|
5714
|
+
} : void 0;
|
|
5715
|
+
}
|
|
5716
|
+
});
|
|
5717
|
+
}
|
|
5718
|
+
return column.renderCell(context);
|
|
5182
5719
|
}
|
|
5183
5720
|
const textOf = (row) => cellTextOf(row, column);
|
|
5184
5721
|
const findCurrentIndex2 = () => cell.findCurrentIndex;
|
|
@@ -5223,12 +5760,53 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5223
5760
|
}
|
|
5224
5761
|
})
|
|
5225
5762
|
);
|
|
5226
|
-
return <
|
|
5763
|
+
return <Show12 when={chip()} fallback={<span class="ssg-cell-value">{highlightCellFind(text)}</span>}>
|
|
5227
5764
|
{(spec) => <GridChip2 spec={spec()}>{highlightCellFind(spec().label ?? text)}</GridChip2>}
|
|
5228
|
-
</
|
|
5765
|
+
</Show12>;
|
|
5229
5766
|
}
|
|
5230
5767
|
return <span class="ssg-cell-value">{highlightCellFind(textOf(currentRow()))}</span>;
|
|
5231
5768
|
};
|
|
5769
|
+
const renderCellContent = (currentRow, column, cell) => {
|
|
5770
|
+
const treeKey = treeColumnKey();
|
|
5771
|
+
const parts = treeDataParts;
|
|
5772
|
+
if (treeKey === void 0 || !parts || column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
5773
|
+
return renderDefaultCellContent(currentRow, column, cell);
|
|
5774
|
+
}
|
|
5775
|
+
let content;
|
|
5776
|
+
if (column.aggFunc != null) {
|
|
5777
|
+
const has = createMemo10(() => {
|
|
5778
|
+
const aggregates = cell.treeRow?.aggregates;
|
|
5779
|
+
return aggregates !== void 0 && Object.prototype.hasOwnProperty.call(aggregates, column.key);
|
|
5780
|
+
});
|
|
5781
|
+
const value = createMemo10(() => cell.treeRow?.aggregates?.[column.key]);
|
|
5782
|
+
const aggregate = { has, value };
|
|
5783
|
+
const TreeAggregateValue = parts.TreeAggregateValue;
|
|
5784
|
+
content = column.renderCell ? renderDefaultCellContent(currentRow, column, cell, aggregate) : <Show12 when={has()} fallback={renderDefaultCellContent(currentRow, column, cell)}>
|
|
5785
|
+
<TreeAggregateValue column={column} value={value()} />
|
|
5786
|
+
</Show12>;
|
|
5787
|
+
} else {
|
|
5788
|
+
content = renderDefaultCellContent(currentRow, column, cell);
|
|
5789
|
+
}
|
|
5790
|
+
if (column.key !== treeKey) {
|
|
5791
|
+
return content;
|
|
5792
|
+
}
|
|
5793
|
+
const TreeCellPrefix = parts.TreeCellPrefix;
|
|
5794
|
+
const rowLabel = () => cellTextOf(currentRow(), column);
|
|
5795
|
+
return <>
|
|
5796
|
+
<Show12 when={cell.treeRow}>
|
|
5797
|
+
{(tree) => <TreeCellPrefix
|
|
5798
|
+
level={tree().level}
|
|
5799
|
+
hasChildren={tree().hasChildren}
|
|
5800
|
+
open={tree().open}
|
|
5801
|
+
rowLabel={rowLabel()}
|
|
5802
|
+
rowNumber={cell.rowIndex + 1}
|
|
5803
|
+
onToggle={(open) => engine.gridApi.handle.setTreeRowOpen(cell.rowKey, open)}
|
|
5804
|
+
onPress={edit.endEditLeftOpen}
|
|
5805
|
+
/>}
|
|
5806
|
+
</Show12>
|
|
5807
|
+
{content}
|
|
5808
|
+
</>;
|
|
5809
|
+
};
|
|
5232
5810
|
const pinnedPaneStyle = (side, width, hasContent) => ({
|
|
5233
5811
|
position: "sticky",
|
|
5234
5812
|
...side === "left" ? { left: "0" } : { right: "0" },
|
|
@@ -5253,7 +5831,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5253
5831
|
const activeRect = () => placementRectInPane(activeCellPlacement(), pane);
|
|
5254
5832
|
const editorRect = () => placementRectInPane(editingCellPlacement(), pane);
|
|
5255
5833
|
const clearHoveredRow = () => applyHoveredRowChange(null);
|
|
5256
|
-
const renderPinnedRows = (position) => PinnedRows ? <
|
|
5834
|
+
const renderPinnedRows = (position) => PinnedRows ? <Show12 when={position === "top" ? pinnedTop() : pinnedBottom()}>
|
|
5257
5835
|
{(pinnedRows) => <PinnedRows
|
|
5258
5836
|
pane={pane}
|
|
5259
5837
|
position={position}
|
|
@@ -5274,8 +5852,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5274
5852
|
slots={slots()}
|
|
5275
5853
|
onPointerEnter={clearHoveredRow}
|
|
5276
5854
|
/>}
|
|
5277
|
-
</
|
|
5278
|
-
const renderTotalRow = () => TotalRow ? <
|
|
5855
|
+
</Show12> : null;
|
|
5856
|
+
const renderTotalRow = () => TotalRow ? <Show12 when={totalRowEnabled()}>
|
|
5279
5857
|
<TotalRow
|
|
5280
5858
|
pane={pane}
|
|
5281
5859
|
ownsRowHeader={ownsRowHeader()}
|
|
@@ -5295,7 +5873,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5295
5873
|
slots={slots()}
|
|
5296
5874
|
onPointerEnter={clearHoveredRow}
|
|
5297
5875
|
/>
|
|
5298
|
-
</
|
|
5876
|
+
</Show12> : null;
|
|
5299
5877
|
return <div
|
|
5300
5878
|
style={{
|
|
5301
5879
|
position: "relative",
|
|
@@ -5309,7 +5887,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5309
5887
|
{
|
|
5310
5888
|
/* 列のグループの段(1.6.0。列見出しの行の前の sticky の器)。 */
|
|
5311
5889
|
}
|
|
5312
|
-
{ColumnGroupHeader ? <
|
|
5890
|
+
{ColumnGroupHeader ? <Show12 when={columnGroupTree()}>
|
|
5313
5891
|
{(tree) => <ColumnGroupHeader
|
|
5314
5892
|
pane={pane}
|
|
5315
5893
|
tree={tree()}
|
|
@@ -5328,7 +5906,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5328
5906
|
onResizePointerDown={columnCommands.handleColumnGroupResizePointerDown}
|
|
5329
5907
|
onGripPointerDown={columnGroupDragHandler()}
|
|
5330
5908
|
/>}
|
|
5331
|
-
</
|
|
5909
|
+
</Show12> : null}
|
|
5332
5910
|
<GridHeaderRow
|
|
5333
5911
|
pane={pane}
|
|
5334
5912
|
ownsRowHeader={ownsRowHeader()}
|
|
@@ -5404,20 +5982,20 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5404
5982
|
headerHeight={headerHeight()}
|
|
5405
5983
|
leadingWidth={leadingWidth()}
|
|
5406
5984
|
baseOffset={vertical().overlayBaseOffset}
|
|
5985
|
+
/>}
|
|
5986
|
+
</For5>
|
|
5987
|
+
<For5 each={copyRectsForPane(pane)} keyed={false}>
|
|
5988
|
+
{(rect) => <CopyRangeOverlay
|
|
5989
|
+
slot={slots().copyRangeOverlay}
|
|
5990
|
+
rect={rect()}
|
|
5991
|
+
headerHeight={headerHeight()}
|
|
5992
|
+
leadingWidth={leadingWidth()}
|
|
5993
|
+
baseOffset={vertical().overlayBaseOffset}
|
|
5407
5994
|
/>}
|
|
5408
5995
|
</For5>
|
|
5409
5996
|
{motionExtrasFeature2 ? (() => {
|
|
5410
|
-
const {
|
|
5997
|
+
const { ColumnHoverOverlay: ColumnHoverOverlay2 } = motionExtrasFeature2;
|
|
5411
5998
|
return <>
|
|
5412
|
-
<For5 each={copyRectsForPane(pane)} keyed={false}>
|
|
5413
|
-
{(rect) => <CopyRangeOverlay2
|
|
5414
|
-
slot={slots().copyRangeOverlay}
|
|
5415
|
-
rect={rect()}
|
|
5416
|
-
headerHeight={headerHeight()}
|
|
5417
|
-
leadingWidth={leadingWidth()}
|
|
5418
|
-
baseOffset={vertical().overlayBaseOffset}
|
|
5419
|
-
/>}
|
|
5420
|
-
</For5>
|
|
5421
5999
|
<ColumnHoverOverlay2
|
|
5422
6000
|
rect={columnHoverRectForPane(pane)}
|
|
5423
6001
|
headerHeight={headerHeight()}
|
|
@@ -5458,12 +6036,14 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5458
6036
|
onCommit={(value, direction, option, forwardText) => edit.commitEdit(value, direction, option, forwardText)}
|
|
5459
6037
|
SearchSelectEditor={features.selectSearch?.SearchSelectCellEditor}
|
|
5460
6038
|
onCancel={edit.cancelEdit}
|
|
6039
|
+
onCommitToSelection={fillSelectionEnabled() ? engine.excelShortcuts.commitToSelection : void 0}
|
|
5461
6040
|
onRegisterFlush={edit.registerDraftFlush}
|
|
5462
6041
|
onRegisterLateCommit={edit.registerLateCommitReceiver}
|
|
5463
6042
|
align={editingColumn()?.align}
|
|
5464
6043
|
enterMove={props.editorEnterMove}
|
|
5465
6044
|
domId={cellEditorDomId}
|
|
5466
6045
|
alignTop={editorAlignTop()}
|
|
6046
|
+
leadingInset={editorLeadingInset()}
|
|
5467
6047
|
/>
|
|
5468
6048
|
<GridBodyLayer
|
|
5469
6049
|
pane={pane}
|
|
@@ -5475,6 +6055,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5475
6055
|
conditionalFormat={conditionalFormatFeature2}
|
|
5476
6056
|
conditionalFormatStats={conditionalFormatStats()}
|
|
5477
6057
|
unsavedTracking={unsavedTracking()}
|
|
6058
|
+
closedTreeUnsaved={closedTreeUnsaved()}
|
|
5478
6059
|
findIndex={findIndex()}
|
|
5479
6060
|
findCurrentIndex={findCurrentIndex()}
|
|
5480
6061
|
grouping={groupingFeature2}
|
|
@@ -5483,6 +6064,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5483
6064
|
labelRowLayer={pane === "center" ? labelRowLayerCenter() : labelRowLayerBand()}
|
|
5484
6065
|
skeletonRow={isServerSide() ? serverSideFeature2?.BodySkeletonRow : void 0}
|
|
5485
6066
|
labelViewIndexes={labelViewIndexes()}
|
|
6067
|
+
newRowLayer={newRowLayer()}
|
|
6068
|
+
newRowDraft={newRowDraft()}
|
|
5486
6069
|
rowHeaderWidth={rowHeaderWidth()}
|
|
5487
6070
|
rows={bodyRows()}
|
|
5488
6071
|
entries={entries()}
|
|
@@ -5505,6 +6088,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5505
6088
|
cellEditorDomId={cellEditorDomId}
|
|
5506
6089
|
renderCellContent={renderCellContent}
|
|
5507
6090
|
isTextCellColumn={isTextCellColumn}
|
|
6091
|
+
treeColumnKey={treeStage() ? treeColumnKey() : void 0}
|
|
5508
6092
|
cellText={cellText}
|
|
5509
6093
|
onRowHeaderPointerDown={pointer.handleRowHeaderPointerDown}
|
|
5510
6094
|
onRowHeaderPointerEnter={pointer.handleRowHeaderPointerEnter}
|
|
@@ -5536,10 +6120,10 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5536
6120
|
{
|
|
5537
6121
|
/* 下端の行(本体ぶんの空きの直後 = 箱の下端の sticky の行)。既定は下の固定行 → 合計行、'belowTotal' は合計行 → 固定行。 */
|
|
5538
6122
|
}
|
|
5539
|
-
<
|
|
6123
|
+
<Show12 when={pinnedBelowTotal()} fallback={[renderPinnedRows("bottom"), renderTotalRow()]}>
|
|
5540
6124
|
{renderTotalRow()}
|
|
5541
6125
|
{renderPinnedRows("bottom")}
|
|
5542
|
-
</
|
|
6126
|
+
</Show12>
|
|
5543
6127
|
{
|
|
5544
6128
|
/* 中央ペインのドロップの縦線(左右のペインは、固定列が 0 本でも線を出せるよう外側の器に置く。React 版と同じ)。 */
|
|
5545
6129
|
}
|
|
@@ -5587,7 +6171,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5587
6171
|
{
|
|
5588
6172
|
/* フィルターのチップのバー(showFilterChipBar)。適用中の列フィルターをチップで並べる(0 件なら出さない)。 */
|
|
5589
6173
|
}
|
|
5590
|
-
{filterManagement && filteringFeature2 ? <
|
|
6174
|
+
{filterManagement && filteringFeature2 ? <Show12 when={props.showFilterChipBar}>
|
|
5591
6175
|
<filteringFeature2.FilterChipBar
|
|
5592
6176
|
slot={slots().filterChipBar}
|
|
5593
6177
|
entries={filterManagement.entries()}
|
|
@@ -5596,7 +6180,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5596
6180
|
onClearFilter={columnCommands.handleFilterManagerClearFilter}
|
|
5597
6181
|
onClearAllFilters={columnCommands.handleFilterManagerClearAll}
|
|
5598
6182
|
/>
|
|
5599
|
-
</
|
|
6183
|
+
</Show12> : null}
|
|
5600
6184
|
<div
|
|
5601
6185
|
ref={(element) => {
|
|
5602
6186
|
gridRootRef.current = element;
|
|
@@ -5651,7 +6235,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5651
6235
|
edit.endEditLeftOpen();
|
|
5652
6236
|
}
|
|
5653
6237
|
}}
|
|
5654
|
-
role="grid"
|
|
6238
|
+
role={treeStage() ? "treegrid" : "grid"}
|
|
5655
6239
|
aria-label={props.ariaLabel}
|
|
5656
6240
|
aria-rowcount={viewRowCount() + 1 + pinnedTopCount() + pinnedBottomCount() + (totalRowEnabled() ? 1 : 0) + columnGroupDepth()}
|
|
5657
6241
|
aria-colcount={orderedColumns().length + 1}
|
|
@@ -5675,7 +6259,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5675
6259
|
}}
|
|
5676
6260
|
style={pinnedPaneStyle("left", paneResolution().leftPaneTotalWidth, paneLayout().left.entries.length > 0)}
|
|
5677
6261
|
>
|
|
5678
|
-
<
|
|
6262
|
+
<Show12 when={paneResolution().hasLeftPane}>
|
|
5679
6263
|
{renderPane(
|
|
5680
6264
|
"left",
|
|
5681
6265
|
() => paneResolution().leftPaneTotalWidth,
|
|
@@ -5683,7 +6267,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5683
6267
|
() => true,
|
|
5684
6268
|
() => paneLayout().left.entries
|
|
5685
6269
|
)}
|
|
5686
|
-
</
|
|
6270
|
+
</Show12>
|
|
5687
6271
|
{renderColumnDropIndicator("left")}
|
|
5688
6272
|
</div>
|
|
5689
6273
|
<div
|
|
@@ -5710,7 +6294,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5710
6294
|
}}
|
|
5711
6295
|
style={pinnedPaneStyle("right", paneResolution().rightPaneTotalWidth, paneLayout().right.entries.length > 0)}
|
|
5712
6296
|
>
|
|
5713
|
-
<
|
|
6297
|
+
<Show12 when={paneResolution().hasRightPane}>
|
|
5714
6298
|
{renderPane(
|
|
5715
6299
|
"right",
|
|
5716
6300
|
() => paneResolution().rightPaneTotalWidth,
|
|
@@ -5718,15 +6302,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5718
6302
|
() => false,
|
|
5719
6303
|
() => paneLayout().right.entries
|
|
5720
6304
|
)}
|
|
5721
|
-
</
|
|
6305
|
+
</Show12>
|
|
5722
6306
|
{renderColumnDropIndicator("right")}
|
|
5723
6307
|
</div>
|
|
5724
6308
|
</div>
|
|
5725
|
-
<
|
|
6309
|
+
<Show12 when={viewRowCount() === 0 && hydrated()}>
|
|
5726
6310
|
<div class={["ssg-empty-state", slots().emptyState?.className]} style={slots().emptyState?.style}>
|
|
5727
6311
|
{emptyStateText()}
|
|
5728
6312
|
</div>
|
|
5729
|
-
</
|
|
6313
|
+
</Show12>
|
|
5730
6314
|
</div>
|
|
5731
6315
|
<span
|
|
5732
6316
|
ref={(element) => {
|
|
@@ -5737,7 +6321,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5737
6321
|
aria-hidden={hasDetailCards() ? void 0 : "true"}
|
|
5738
6322
|
onFocus={(event) => detailRows.handleTableExitFocus(event.relatedTarget)}
|
|
5739
6323
|
/>
|
|
5740
|
-
<
|
|
6324
|
+
<Show12 when={scrollHintFeature2 !== void 0 && activeScrollHint()}>
|
|
5741
6325
|
{(options) => {
|
|
5742
6326
|
const ScrollHint = scrollHintFeature2.ScrollHint;
|
|
5743
6327
|
return <ScrollHint
|
|
@@ -5754,19 +6338,19 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5754
6338
|
labelViewIndexes={labelViewIndexes()}
|
|
5755
6339
|
/>;
|
|
5756
6340
|
}}
|
|
5757
|
-
</
|
|
6341
|
+
</Show12>
|
|
5758
6342
|
{
|
|
5759
6343
|
/* 列幅の自動調整の計測中の overlay(遅れて出す。pointer-events: none で操作は素通し)。 */
|
|
5760
6344
|
}
|
|
5761
|
-
<
|
|
6345
|
+
<Show12 when={isAutosizing()}>
|
|
5762
6346
|
<div class="ssg-autosize-overlay">
|
|
5763
6347
|
<span class="ssg-autosize-pill">{localeTexts().sizingColumns}</span>
|
|
5764
6348
|
</div>
|
|
5765
|
-
</
|
|
6349
|
+
</Show12>
|
|
5766
6350
|
{
|
|
5767
6351
|
/* グローバルフィルターの適用中の overlay(しきい値を超える表の時間分割の間だけ。pointer-events: none)。 */
|
|
5768
6352
|
}
|
|
5769
|
-
<
|
|
6353
|
+
<Show12 when={globalFilterStatus() === "filtering"}>
|
|
5770
6354
|
<div class="ssg-filter-overlay">
|
|
5771
6355
|
<span class="ssg-filter-overlay-chip" role="status" aria-live="polite">
|
|
5772
6356
|
<span class="ssg-filter-spinner" aria-hidden="true" />
|
|
@@ -5775,11 +6359,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5775
6359
|
</span>
|
|
5776
6360
|
</span>
|
|
5777
6361
|
</div>
|
|
5778
|
-
</
|
|
6362
|
+
</Show12>
|
|
5779
6363
|
{
|
|
5780
6364
|
/* セル内検索のバー(右上に浮く。見出しの直下)。開いているときだけ描きます。 */
|
|
5781
6365
|
}
|
|
5782
|
-
<
|
|
6366
|
+
<Show12 when={findSnapshot().open}>
|
|
5783
6367
|
{FindBar && <FindBar
|
|
5784
6368
|
snapshot={findSnapshot()}
|
|
5785
6369
|
headerHeight={headerHeight()}
|
|
@@ -5789,11 +6373,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5789
6373
|
onClose={closeFindAndRefocus}
|
|
5790
6374
|
slot={slots().findBar}
|
|
5791
6375
|
/>}
|
|
5792
|
-
</
|
|
6376
|
+
</Show12>
|
|
5793
6377
|
{
|
|
5794
6378
|
/* サーバーサイドのエラーバー(取得の失敗の再試行 / 保存の失敗。機能 features/serverSide の部品)。 */
|
|
5795
6379
|
}
|
|
5796
|
-
{serverSide && serverSideFeature2 ? <
|
|
6380
|
+
{serverSide && serverSideFeature2 ? <Show12 when={isServerSide()}>
|
|
5797
6381
|
<serverSideFeature2.ErrorBars
|
|
5798
6382
|
loadError={serverSide.loadError()}
|
|
5799
6383
|
writeError={serverSide.writeError()}
|
|
@@ -5801,12 +6385,12 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5801
6385
|
slot={slots().errorBar}
|
|
5802
6386
|
localeTexts={localeTexts()}
|
|
5803
6387
|
/>
|
|
5804
|
-
</
|
|
6388
|
+
</Show12> : null}
|
|
5805
6389
|
{
|
|
5806
6390
|
/* 追加(1.5.0 / serverSideRefetch="keep"): 前の行を見せたまま取り直している間、本体の見えている所を薄くする面と、
|
|
5807
6391
|
列見出しの下に流れる線(大きさはスクロールバーを除いた見える範囲。測る前は CSS の left / right / bottom。React 版と同じ)。 */
|
|
5808
6392
|
}
|
|
5809
|
-
<
|
|
6393
|
+
<Show12 when={refetchingRows()}>
|
|
5810
6394
|
<div
|
|
5811
6395
|
class="ssg-refetch-veil"
|
|
5812
6396
|
aria-hidden="true"
|
|
@@ -5821,12 +6405,12 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5821
6405
|
aria-hidden="true"
|
|
5822
6406
|
style={{ top: `${headerHeight()}px`, width: viewportWidth() > 0 ? `${viewportWidth()}px` : void 0 }}
|
|
5823
6407
|
/>
|
|
5824
|
-
</
|
|
6408
|
+
</Show12>
|
|
5825
6409
|
{
|
|
5826
6410
|
/* IME オンのままの直接入力の入力受け(imeDirectInput が有効なときだけ)。値 / 位置 / 変換中の見た目はコントローラが
|
|
5827
6411
|
直接扱います。Tab の順番には入れません(タブストップはシェルのまま)。 */
|
|
5828
6412
|
}
|
|
5829
|
-
<
|
|
6413
|
+
<Show12 when={imeDirectInputEnabled()}>
|
|
5830
6414
|
<input
|
|
5831
6415
|
ref={(element) => engine.imeInput.attach(element)}
|
|
5832
6416
|
{...{ [IME_INPUT_ATTRIBUTE]: "" }}
|
|
@@ -5839,14 +6423,14 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5839
6423
|
spellcheck="false"
|
|
5840
6424
|
aria-label={localeTexts().cellInput}
|
|
5841
6425
|
/>
|
|
5842
|
-
</
|
|
6426
|
+
</Show12>
|
|
5843
6427
|
</div>
|
|
5844
6428
|
{bottomBar()}
|
|
5845
6429
|
{
|
|
5846
6430
|
/* 列メニュー(グリッドの外のポップアップ)。 */
|
|
5847
6431
|
}
|
|
5848
|
-
{columnMenu && columnMenuFeature2 ? <
|
|
5849
|
-
{(column) => <
|
|
6432
|
+
{columnMenu && columnMenuFeature2 ? <Show12 when={columnMenu.openedColumn()}>
|
|
6433
|
+
{(column) => <Show12 when={columnMenu.layout()}>
|
|
5850
6434
|
{(layout) => <columnMenuFeature2.ColumnMenuPopover
|
|
5851
6435
|
slots={slots()}
|
|
5852
6436
|
themeClassName={portalClassName()}
|
|
@@ -5874,7 +6458,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5874
6458
|
// 表に出ている最後のデータ列は出さない(自動グループ列だけが残ると列メニューが無くなり、「グループ化を外す」へ
|
|
5875
6459
|
// 戻れない。React 版と同じ)。
|
|
5876
6460
|
columnMenuGroupingAvailable() && column().aggFunc == null && column().rowGroup !== true && visibleColumns().some(
|
|
5877
|
-
(candidate) => candidate.key !== column().key && candidate.rowGroup !== true && !
|
|
6461
|
+
(candidate) => candidate.key !== column().key && candidate.rowGroup !== true && !isSyntheticColumnKey3(candidate.key)
|
|
5878
6462
|
) ? () => columnCommands.handleColumnMenuGroupBy(column().key) : void 0
|
|
5879
6463
|
}
|
|
5880
6464
|
onUngroup={columnMenuGroupingAvailable() && rowGroupingActive() ? columnCommands.handleColumnMenuUngroup : void 0}
|
|
@@ -5895,8 +6479,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5895
6479
|
}}
|
|
5896
6480
|
onRequestClose={columnMenu.close}
|
|
5897
6481
|
/>}
|
|
5898
|
-
</
|
|
5899
|
-
</
|
|
6482
|
+
</Show12>}
|
|
6483
|
+
</Show12> : null}
|
|
5900
6484
|
{
|
|
5901
6485
|
/* 列フィルターのポップオーバー(グリッドの外のポップアップ。閉じている間は何も描かない)。 */
|
|
5902
6486
|
}
|
|
@@ -5919,9 +6503,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5919
6503
|
/* ツールパネル(グリッドの外のポップアップ。開いている間だけ描く)。タブを切り替えると中身を作り直す(タブの中の検索の
|
|
5920
6504
|
文字などは戻る。React 版と同じ)。 */
|
|
5921
6505
|
}
|
|
5922
|
-
{toolPanel && toolPanelViews ? <
|
|
5923
|
-
{(tab) => <
|
|
5924
|
-
{(layout) => <
|
|
6506
|
+
{toolPanel && toolPanelViews ? <Show12 when={toolPanel.activeTab()}>
|
|
6507
|
+
{(tab) => <Show12 when={toolPanel.layout()}>
|
|
6508
|
+
{(layout) => <Show12 when={toolPanelViews()}>
|
|
5925
6509
|
{(views) => {
|
|
5926
6510
|
const { ToolPanel, FilterManagementPanel, ColumnChooserPanel, SortManagementPanel } = untrack13(views);
|
|
5927
6511
|
return <ToolPanel
|
|
@@ -5980,13 +6564,13 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5980
6564
|
</Switch>
|
|
5981
6565
|
</ToolPanel>;
|
|
5982
6566
|
}}
|
|
5983
|
-
</
|
|
5984
|
-
</
|
|
5985
|
-
</
|
|
6567
|
+
</Show12>}
|
|
6568
|
+
</Show12>}
|
|
6569
|
+
</Show12> : null}
|
|
5986
6570
|
{
|
|
5987
6571
|
/* セル / 行番号の右クリックメニュー(グリッドの外のポップアップ)。 */
|
|
5988
6572
|
}
|
|
5989
|
-
{contextMenu && contextMenuFeature2 ? <
|
|
6573
|
+
{contextMenu && contextMenuFeature2 ? <Show12 when={contextMenuView()}>
|
|
5990
6574
|
{(open) => <contextMenuFeature2.CellContextMenuPopover
|
|
5991
6575
|
items={open().items}
|
|
5992
6576
|
layout={open().layout}
|
|
@@ -5996,7 +6580,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5996
6580
|
themeClassName={portalClassName()}
|
|
5997
6581
|
slots={slots()}
|
|
5998
6582
|
/>}
|
|
5999
|
-
</
|
|
6583
|
+
</Show12> : null}
|
|
6000
6584
|
{
|
|
6001
6585
|
/* フィルハンドルの埋めたあとのメニュー / ドラッグ中の値のツールチップ(グリッドの外のポップアップ)。 */
|
|
6002
6586
|
}
|
|
@@ -6089,7 +6673,7 @@ import {
|
|
|
6089
6673
|
import { DEFAULT_COLUMN_GROUPS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6090
6674
|
|
|
6091
6675
|
// src/view/GridColumnGroupHeader.tsx
|
|
6092
|
-
import { For as For6, Show as
|
|
6676
|
+
import { For as For6, Show as Show13, createMemo as createMemo11 } from "solid-js";
|
|
6093
6677
|
import {
|
|
6094
6678
|
createColumnGroupResize,
|
|
6095
6679
|
resolveColumnGroupCells
|
|
@@ -6211,7 +6795,7 @@ function GridColumnGroupHeader(props) {
|
|
|
6211
6795
|
>
|
|
6212
6796
|
{definition().renderHeader ? definition().renderHeader?.(context) : title()}
|
|
6213
6797
|
</span>
|
|
6214
|
-
<
|
|
6798
|
+
<Show13 when={group().collapsible}>
|
|
6215
6799
|
<button
|
|
6216
6800
|
type="button"
|
|
6217
6801
|
tabindex={-1}
|
|
@@ -6243,8 +6827,8 @@ function GridColumnGroupHeader(props) {
|
|
|
6243
6827
|
/>
|
|
6244
6828
|
</svg>
|
|
6245
6829
|
</button>
|
|
6246
|
-
</
|
|
6247
|
-
<
|
|
6830
|
+
</Show13>
|
|
6831
|
+
<Show13 when={props.onGripPointerDown}>
|
|
6248
6832
|
{(handler) => <span
|
|
6249
6833
|
aria-hidden="true"
|
|
6250
6834
|
class="ssg-header-grip ssg-col-group-grip"
|
|
@@ -6260,11 +6844,11 @@ function GridColumnGroupHeader(props) {
|
|
|
6260
6844
|
<circle cx="6" cy="11" r="1" />
|
|
6261
6845
|
</svg>
|
|
6262
6846
|
</span>}
|
|
6263
|
-
</
|
|
6847
|
+
</Show13>
|
|
6264
6848
|
</div>
|
|
6265
|
-
<
|
|
6849
|
+
<Show13 when={resize()}>
|
|
6266
6850
|
{(value) => <div class="ssg-header-resize" onPointerDown={(event) => props.onResizePointerDown(value(), event)} />}
|
|
6267
|
-
</
|
|
6851
|
+
</Show13>
|
|
6268
6852
|
</div>;
|
|
6269
6853
|
}}
|
|
6270
6854
|
</For6>
|
|
@@ -6329,7 +6913,7 @@ function createColumnMenu(inputs) {
|
|
|
6329
6913
|
}
|
|
6330
6914
|
|
|
6331
6915
|
// src/view/ColumnMenuPopover.tsx
|
|
6332
|
-
import { For as For7, Show as
|
|
6916
|
+
import { For as For7, Show as Show14, createEffect as createEffect5, createMemo as createMemo13, createSignal as createSignal10, createUniqueId as createUniqueId4, onCleanup as onCleanup9 } from "solid-js";
|
|
6333
6917
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
6334
6918
|
var PINNED_ITEMS = [
|
|
6335
6919
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -6432,7 +7016,7 @@ function ColumnMenuPopover(props) {
|
|
|
6432
7016
|
props.slots?.menuItem?.className
|
|
6433
7017
|
];
|
|
6434
7018
|
const itemStyle = () => props.slots?.menuItem?.style;
|
|
6435
|
-
return <
|
|
7019
|
+
return <Show14 when={container}>
|
|
6436
7020
|
{(mount) => <Portal2 mount={mount()}>
|
|
6437
7021
|
<div
|
|
6438
7022
|
ref={(node) => {
|
|
@@ -6465,7 +7049,7 @@ function ColumnMenuPopover(props) {
|
|
|
6465
7049
|
{
|
|
6466
7050
|
/* 列のグループの開閉(1.6.0 の実アプリの点検 G5-02)。 */
|
|
6467
7051
|
}
|
|
6468
|
-
<
|
|
7052
|
+
<Show14 when={props.onToggleColumnGroup !== void 0 && (props.columnGroupToggles?.length ?? 0) > 0}>
|
|
6469
7053
|
<For7 each={props.columnGroupToggles ?? []} keyed={(toggle) => toggle.key}>
|
|
6470
7054
|
{(toggle) => <button
|
|
6471
7055
|
type="button"
|
|
@@ -6480,9 +7064,9 @@ function ColumnMenuPopover(props) {
|
|
|
6480
7064
|
</button>}
|
|
6481
7065
|
</For7>
|
|
6482
7066
|
<div role="separator" class="ssg-menu-separator" />
|
|
6483
|
-
</
|
|
7067
|
+
</Show14>
|
|
6484
7068
|
|
|
6485
|
-
<
|
|
7069
|
+
<Show14 when={props.canFilter}>
|
|
6486
7070
|
<button
|
|
6487
7071
|
type="button"
|
|
6488
7072
|
role="menuitem"
|
|
@@ -6495,9 +7079,9 @@ function ColumnMenuPopover(props) {
|
|
|
6495
7079
|
<span class="ssg-menu-label">{texts().menuFilter}</span>
|
|
6496
7080
|
</button>
|
|
6497
7081
|
<div role="separator" class="ssg-menu-separator" />
|
|
6498
|
-
</
|
|
7082
|
+
</Show14>
|
|
6499
7083
|
|
|
6500
|
-
<
|
|
7084
|
+
<Show14 when={props.canSort}>
|
|
6501
7085
|
<SortItem
|
|
6502
7086
|
direction="asc"
|
|
6503
7087
|
sortDirection={props.sortDirection}
|
|
@@ -6516,7 +7100,7 @@ function ColumnMenuPopover(props) {
|
|
|
6516
7100
|
class={itemClass()}
|
|
6517
7101
|
style={itemStyle()}
|
|
6518
7102
|
/>
|
|
6519
|
-
<
|
|
7103
|
+
<Show14 when={props.onOpenSortManager}>
|
|
6520
7104
|
{(open) => <button
|
|
6521
7105
|
type="button"
|
|
6522
7106
|
role="menuitem"
|
|
@@ -6528,10 +7112,10 @@ function ColumnMenuPopover(props) {
|
|
|
6528
7112
|
<span class="ssg-menu-icon" />
|
|
6529
7113
|
<span class="ssg-menu-label">{texts().menuManageSort}</span>
|
|
6530
7114
|
</button>}
|
|
6531
|
-
</
|
|
6532
|
-
</
|
|
7115
|
+
</Show14>
|
|
7116
|
+
</Show14>
|
|
6533
7117
|
|
|
6534
|
-
<
|
|
7118
|
+
<Show14 when={props.canManageFilters ? props.onOpenFilterManager : void 0}>
|
|
6535
7119
|
{(open) => <button
|
|
6536
7120
|
type="button"
|
|
6537
7121
|
role="menuitem"
|
|
@@ -6543,16 +7127,16 @@ function ColumnMenuPopover(props) {
|
|
|
6543
7127
|
<span class="ssg-menu-icon" />
|
|
6544
7128
|
<span class="ssg-menu-label">{texts().menuManageFilters}</span>
|
|
6545
7129
|
</button>}
|
|
6546
|
-
</
|
|
7130
|
+
</Show14>
|
|
6547
7131
|
|
|
6548
7132
|
{
|
|
6549
7133
|
/* 区切りは、並び替えの項目かフィルターを管理…のどちらかが出ているとき。 */
|
|
6550
7134
|
}
|
|
6551
|
-
<
|
|
7135
|
+
<Show14 when={props.canSort || props.canManageFilters && props.onOpenFilterManager !== void 0}>
|
|
6552
7136
|
<div role="separator" class="ssg-menu-separator" />
|
|
6553
|
-
</
|
|
7137
|
+
</Show14>
|
|
6554
7138
|
|
|
6555
|
-
<
|
|
7139
|
+
<Show14 when={props.onGroupByColumn}>
|
|
6556
7140
|
{(groupBy) => <button
|
|
6557
7141
|
type="button"
|
|
6558
7142
|
role="menuitem"
|
|
@@ -6564,8 +7148,8 @@ function ColumnMenuPopover(props) {
|
|
|
6564
7148
|
<span class="ssg-menu-icon" />
|
|
6565
7149
|
<span class="ssg-menu-label">{texts().menuGroupBy}</span>
|
|
6566
7150
|
</button>}
|
|
6567
|
-
</
|
|
6568
|
-
<
|
|
7151
|
+
</Show14>
|
|
7152
|
+
<Show14 when={props.onUngroup}>
|
|
6569
7153
|
{(ungroup) => <button
|
|
6570
7154
|
type="button"
|
|
6571
7155
|
role="menuitem"
|
|
@@ -6577,10 +7161,10 @@ function ColumnMenuPopover(props) {
|
|
|
6577
7161
|
<span class="ssg-menu-icon" />
|
|
6578
7162
|
<span class="ssg-menu-label">{texts().menuUngroup}</span>
|
|
6579
7163
|
</button>}
|
|
6580
|
-
</
|
|
6581
|
-
<
|
|
7164
|
+
</Show14>
|
|
7165
|
+
<Show14 when={props.onGroupByColumn !== void 0 || props.onUngroup !== void 0}>
|
|
6582
7166
|
<div role="separator" class="ssg-menu-separator" />
|
|
6583
|
-
</
|
|
7167
|
+
</Show14>
|
|
6584
7168
|
|
|
6585
7169
|
{
|
|
6586
7170
|
/* 列の固定 ›(小メニューはこの行 = position: relative を基準に置く。パネルの子孫なので外側の押下の判定にも入る)。 */
|
|
@@ -6641,7 +7225,7 @@ function ColumnMenuPopover(props) {
|
|
|
6641
7225
|
›
|
|
6642
7226
|
</span>
|
|
6643
7227
|
</button>
|
|
6644
|
-
<
|
|
7228
|
+
<Show14 when={isPinSubmenuOpen()}>
|
|
6645
7229
|
<div
|
|
6646
7230
|
ref={(node) => {
|
|
6647
7231
|
pinSubmenuElement = node;
|
|
@@ -6685,16 +7269,16 @@ function ColumnMenuPopover(props) {
|
|
|
6685
7269
|
</button>;
|
|
6686
7270
|
}}
|
|
6687
7271
|
</For7>
|
|
6688
|
-
<
|
|
7272
|
+
<Show14 when={!props.canChangePinned}>
|
|
6689
7273
|
<div id={pinNoteId} role="none" class="ssg-menu-note">
|
|
6690
7274
|
{texts().menuPinUnavailable}
|
|
6691
7275
|
</div>
|
|
6692
|
-
</
|
|
7276
|
+
</Show14>
|
|
6693
7277
|
</div>
|
|
6694
|
-
</
|
|
7278
|
+
</Show14>
|
|
6695
7279
|
</div>
|
|
6696
7280
|
|
|
6697
|
-
<
|
|
7281
|
+
<Show14 when={props.onAutosizeColumn && props.onAutosizeAllColumns}>
|
|
6698
7282
|
<button
|
|
6699
7283
|
type="button"
|
|
6700
7284
|
role="menuitem"
|
|
@@ -6717,9 +7301,9 @@ function ColumnMenuPopover(props) {
|
|
|
6717
7301
|
<span class="ssg-menu-icon" />
|
|
6718
7302
|
<span class="ssg-menu-label">{texts().menuAutosizeAll}</span>
|
|
6719
7303
|
</button>
|
|
6720
|
-
</
|
|
7304
|
+
</Show14>
|
|
6721
7305
|
|
|
6722
|
-
<
|
|
7306
|
+
<Show14 when={props.onOpenColumnChooser}>
|
|
6723
7307
|
{(open) => <button
|
|
6724
7308
|
type="button"
|
|
6725
7309
|
role="menuitem"
|
|
@@ -6731,7 +7315,7 @@ function ColumnMenuPopover(props) {
|
|
|
6731
7315
|
<span class="ssg-menu-icon" />
|
|
6732
7316
|
<span class="ssg-menu-label">{texts().menuColumns}</span>
|
|
6733
7317
|
</button>}
|
|
6734
|
-
</
|
|
7318
|
+
</Show14>
|
|
6735
7319
|
|
|
6736
7320
|
<button
|
|
6737
7321
|
type="button"
|
|
@@ -6759,7 +7343,7 @@ function ColumnMenuPopover(props) {
|
|
|
6759
7343
|
</div>
|
|
6760
7344
|
</div>
|
|
6761
7345
|
</Portal2>}
|
|
6762
|
-
</
|
|
7346
|
+
</Show14>;
|
|
6763
7347
|
}
|
|
6764
7348
|
function SortItem(props) {
|
|
6765
7349
|
const active = () => props.sortDirection === props.direction;
|
|
@@ -6838,7 +7422,7 @@ import {
|
|
|
6838
7422
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/conditionalFormat";
|
|
6839
7423
|
|
|
6840
7424
|
// src/view/GridChip.tsx
|
|
6841
|
-
import { Show as
|
|
7425
|
+
import { Show as Show15 } from "solid-js";
|
|
6842
7426
|
import { resolveChipTone } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/conditionalFormat";
|
|
6843
7427
|
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
6844
7428
|
var ICON_PATHS = {
|
|
@@ -6864,7 +7448,7 @@ function GridChip(props) {
|
|
|
6864
7448
|
class={["ssg-chip", custom() ? "ssg-chip--custom" : `ssg-chip--${tone()}`]}
|
|
6865
7449
|
style={custom() ? { "--ssg-cf-chip-color": props.spec.color } : void 0}
|
|
6866
7450
|
>
|
|
6867
|
-
<
|
|
7451
|
+
<Show15 when={props.spec.icon !== false}>
|
|
6868
7452
|
<span class="ssg-chip-icon" aria-hidden="true">
|
|
6869
7453
|
<svg
|
|
6870
7454
|
viewBox="0 0 12 12"
|
|
@@ -6878,7 +7462,7 @@ function GridChip(props) {
|
|
|
6878
7462
|
{ICON_PATHS[tone()]()}
|
|
6879
7463
|
</svg>
|
|
6880
7464
|
</span>
|
|
6881
|
-
</
|
|
7465
|
+
</Show15>
|
|
6882
7466
|
<span class="ssg-chip-label">{props.children}</span>
|
|
6883
7467
|
</span>;
|
|
6884
7468
|
}
|
|
@@ -6918,7 +7502,7 @@ function createCellContextMenu(inputs) {
|
|
|
6918
7502
|
}
|
|
6919
7503
|
|
|
6920
7504
|
// src/view/CellContextMenuPopover.tsx
|
|
6921
|
-
import { For as For8, Match as Match2, Show as
|
|
7505
|
+
import { For as For8, Match as Match2, Show as Show16, Switch as Switch2, createMemo as createMemo15, createSignal as createSignal11, onCleanup as onCleanup10 } from "solid-js";
|
|
6922
7506
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
6923
7507
|
function CellContextMenuPopover(props) {
|
|
6924
7508
|
const portal = useGridPortal();
|
|
@@ -6931,7 +7515,7 @@ function CellContextMenuPopover(props) {
|
|
|
6931
7515
|
}
|
|
6932
7516
|
});
|
|
6933
7517
|
const layout = createMemo15(() => props.layout);
|
|
6934
|
-
const element = <
|
|
7518
|
+
const element = <Show16 when={container}>
|
|
6935
7519
|
{(mount) => <Portal3 mount={mount()}>
|
|
6936
7520
|
<div
|
|
6937
7521
|
ref={(node) => {
|
|
@@ -6992,7 +7576,7 @@ function CellContextMenuPopover(props) {
|
|
|
6992
7576
|
</For8>
|
|
6993
7577
|
</div>
|
|
6994
7578
|
</Portal3>}
|
|
6995
|
-
</
|
|
7579
|
+
</Show16>;
|
|
6996
7580
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
6997
7581
|
return element;
|
|
6998
7582
|
}
|
|
@@ -7210,7 +7794,7 @@ function createFillHandle(inputs) {
|
|
|
7210
7794
|
}
|
|
7211
7795
|
|
|
7212
7796
|
// src/view/FillHandleLayer.tsx
|
|
7213
|
-
import { For as For9, Show as
|
|
7797
|
+
import { For as For9, Show as Show17, createEffect as createEffect7, createMemo as createMemo17, createSignal as createSignal12, onCleanup as onCleanup11 } from "solid-js";
|
|
7214
7798
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
7215
7799
|
import { formatLocaleText as formatLocaleText8 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7216
7800
|
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
@@ -7248,7 +7832,7 @@ function FillHandleLayer(props) {
|
|
|
7248
7832
|
{
|
|
7249
7833
|
/* 選択範囲の右下の四角。 */
|
|
7250
7834
|
}
|
|
7251
|
-
<
|
|
7835
|
+
<Show17 when={corner()}>
|
|
7252
7836
|
{(current) => <div
|
|
7253
7837
|
class="ssg-fill-handle"
|
|
7254
7838
|
style={{
|
|
@@ -7260,12 +7844,12 @@ function FillHandleLayer(props) {
|
|
|
7260
7844
|
aria-hidden="true"
|
|
7261
7845
|
onPointerDown={(event) => props.fill.controller.handlePointerDown(event)}
|
|
7262
7846
|
/>}
|
|
7263
|
-
</
|
|
7847
|
+
</Show17>
|
|
7264
7848
|
{
|
|
7265
7849
|
/* 埋めたあとのボタン(左上の位置)。 */
|
|
7266
7850
|
}
|
|
7267
|
-
<
|
|
7268
|
-
{(snapshot2) => <
|
|
7851
|
+
<Show17 when={filled()}>
|
|
7852
|
+
{(snapshot2) => <Show17 when={chip()}>
|
|
7269
7853
|
{(position) => <FillOptionsChip
|
|
7270
7854
|
fill={props.fill}
|
|
7271
7855
|
x={props.leadingWidth + position().x}
|
|
@@ -7273,8 +7857,8 @@ function FillHandleLayer(props) {
|
|
|
7273
7857
|
kind={snapshot2().kind}
|
|
7274
7858
|
menuOpen={snapshot2().menu !== null}
|
|
7275
7859
|
/>}
|
|
7276
|
-
</
|
|
7277
|
-
</
|
|
7860
|
+
</Show17>}
|
|
7861
|
+
</Show17>
|
|
7278
7862
|
</>;
|
|
7279
7863
|
}
|
|
7280
7864
|
function FillOptionsChip(props) {
|
|
@@ -7361,7 +7945,7 @@ function FillOptionsMenu(props) {
|
|
|
7361
7945
|
}
|
|
7362
7946
|
event.stopPropagation();
|
|
7363
7947
|
};
|
|
7364
|
-
const element = <
|
|
7948
|
+
const element = <Show17 when={container}>
|
|
7365
7949
|
{(mount) => <Portal4 mount={mount()}>
|
|
7366
7950
|
<div
|
|
7367
7951
|
ref={(node) => {
|
|
@@ -7399,7 +7983,7 @@ function FillOptionsMenu(props) {
|
|
|
7399
7983
|
</For9>
|
|
7400
7984
|
</div>
|
|
7401
7985
|
</Portal4>}
|
|
7402
|
-
</
|
|
7986
|
+
</Show17>;
|
|
7403
7987
|
createPortalTokens(panel, () => props.themeClassName, () => null);
|
|
7404
7988
|
return element;
|
|
7405
7989
|
}
|
|
@@ -7414,7 +7998,7 @@ function FillTooltip(props) {
|
|
|
7414
7998
|
const visible = createMemo17(() => pointer() !== null);
|
|
7415
7999
|
const container = createMemo17(() => visible() ? portal.container() : null);
|
|
7416
8000
|
const [tooltip, setTooltip] = createSignal12();
|
|
7417
|
-
const element = <
|
|
8001
|
+
const element = <Show17 when={container()}>
|
|
7418
8002
|
{(mount) => <Portal4 mount={mount()}>
|
|
7419
8003
|
<div
|
|
7420
8004
|
ref={setTooltip}
|
|
@@ -7429,7 +8013,7 @@ function FillTooltip(props) {
|
|
|
7429
8013
|
{props.text}
|
|
7430
8014
|
</div>
|
|
7431
8015
|
</Portal4>}
|
|
7432
|
-
</
|
|
8016
|
+
</Show17>;
|
|
7433
8017
|
createPortalTokens(tooltip, () => props.themeClassName, () => null);
|
|
7434
8018
|
return element;
|
|
7435
8019
|
}
|
|
@@ -7443,8 +8027,8 @@ function FillHandlePortals(props) {
|
|
|
7443
8027
|
return snapshot2.status === "dragging" ? snapshot2.previewText : null;
|
|
7444
8028
|
});
|
|
7445
8029
|
return <>
|
|
7446
|
-
<
|
|
7447
|
-
{(snapshot2) => <
|
|
8030
|
+
<Show17 when={menu()}>
|
|
8031
|
+
{(snapshot2) => <Show17 when={snapshot2().menu}>
|
|
7448
8032
|
{(layout) => <FillOptionsMenu
|
|
7449
8033
|
fill={props.fill}
|
|
7450
8034
|
layout={layout()}
|
|
@@ -7452,11 +8036,11 @@ function FillHandlePortals(props) {
|
|
|
7452
8036
|
seriesAvailable={snapshot2().seriesAvailable}
|
|
7453
8037
|
themeClassName={props.themeClassName}
|
|
7454
8038
|
/>}
|
|
7455
|
-
</
|
|
7456
|
-
</
|
|
7457
|
-
<
|
|
8039
|
+
</Show17>}
|
|
8040
|
+
</Show17>
|
|
8041
|
+
<Show17 when={tooltipText() !== null}>
|
|
7458
8042
|
<FillTooltip fill={props.fill} text={tooltipText() ?? ""} themeClassName={props.themeClassName} />
|
|
7459
|
-
</
|
|
8043
|
+
</Show17>
|
|
7460
8044
|
</>;
|
|
7461
8045
|
}
|
|
7462
8046
|
|
|
@@ -7764,7 +8348,7 @@ function createFilterManagement(inputs) {
|
|
|
7764
8348
|
}
|
|
7765
8349
|
|
|
7766
8350
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
7767
|
-
import { Show as
|
|
8351
|
+
import { Show as Show18, createMemo as createMemo21, untrack as untrack16 } from "solid-js";
|
|
7768
8352
|
import {
|
|
7769
8353
|
createFilterPopoverCommands,
|
|
7770
8354
|
createFilterPopoverDerivedResolver
|
|
@@ -7937,12 +8521,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7937
8521
|
columnKey
|
|
7938
8522
|
});
|
|
7939
8523
|
});
|
|
7940
|
-
return <
|
|
7941
|
-
{(column) => <
|
|
7942
|
-
{(layout) => <
|
|
8524
|
+
return <Show18 when={openedColumn()}>
|
|
8525
|
+
{(column) => <Show18 when={filterPopover.layout()}>
|
|
8526
|
+
{(layout) => <Show18 when={props.views()}>
|
|
7943
8527
|
{(views) => {
|
|
7944
8528
|
const ColumnFilterPopover = untrack16(views).ColumnFilterPopover;
|
|
7945
|
-
return <
|
|
8529
|
+
return <Show18 when={column().key} keyed>
|
|
7946
8530
|
{(columnKey) => <ColumnFilterPopover
|
|
7947
8531
|
popoverSlot={props.popoverSlot}
|
|
7948
8532
|
themeClassName={props.themeClassName}
|
|
@@ -7983,20 +8567,20 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7983
8567
|
onSetClear={commands.clearSetFilterPopoverValue}
|
|
7984
8568
|
onSetReplaceSelection={commands.handleSetFilterReplaceSelection}
|
|
7985
8569
|
/>}
|
|
7986
|
-
</
|
|
8570
|
+
</Show18>;
|
|
7987
8571
|
}}
|
|
7988
|
-
</
|
|
7989
|
-
</
|
|
7990
|
-
</
|
|
8572
|
+
</Show18>}
|
|
8573
|
+
</Show18>}
|
|
8574
|
+
</Show18>;
|
|
7991
8575
|
}
|
|
7992
8576
|
|
|
7993
8577
|
// src/view/GridFilterChipBar.tsx
|
|
7994
|
-
import { For as For10, Show as
|
|
8578
|
+
import { For as For10, Show as Show19, createUniqueId as createUniqueId5 } from "solid-js";
|
|
7995
8579
|
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7996
8580
|
function GridFilterChipBar(props) {
|
|
7997
8581
|
const texts = useFeatureLocaleText();
|
|
7998
8582
|
const chipIdBase = createUniqueId5();
|
|
7999
|
-
return <
|
|
8583
|
+
return <Show19 when={props.entries.length > 0}>
|
|
8000
8584
|
<div class={["ssg-filter-chip-bar", props.slot?.className]} style={props.slot?.style}>
|
|
8001
8585
|
<For10 each={props.entries} keyed={(entry) => entry.columnKey}>
|
|
8002
8586
|
{(entry, index) => <div class={entry().isHidden ? "ssg-filter-chip ssg-filter-chip--hidden" : "ssg-filter-chip"}>
|
|
@@ -8043,7 +8627,7 @@ function GridFilterChipBar(props) {
|
|
|
8043
8627
|
{texts().clearAll}
|
|
8044
8628
|
</button>
|
|
8045
8629
|
</div>
|
|
8046
|
-
</
|
|
8630
|
+
</Show19>;
|
|
8047
8631
|
}
|
|
8048
8632
|
|
|
8049
8633
|
// src/view/lazyPopups.ts
|
|
@@ -8251,7 +8835,7 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
8251
8835
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8252
8836
|
|
|
8253
8837
|
// src/view/GridBodyGroupRow.tsx
|
|
8254
|
-
import { For as For11, Show as
|
|
8838
|
+
import { For as For11, Show as Show20, createMemo as createMemo23 } from "solid-js";
|
|
8255
8839
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
8256
8840
|
import {
|
|
8257
8841
|
formatTotalRowCellText,
|
|
@@ -8281,7 +8865,7 @@ function GridBodyGroupRow(props) {
|
|
|
8281
8865
|
}}
|
|
8282
8866
|
onDblClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
8283
8867
|
>
|
|
8284
|
-
<
|
|
8868
|
+
<Show20 when={props.ownsRowHeader}>
|
|
8285
8869
|
<div
|
|
8286
8870
|
role={rowHeaderIsCell() ? "rowheader" : void 0}
|
|
8287
8871
|
aria-colindex={rowHeaderIsCell() ? 1 : void 0}
|
|
@@ -8306,7 +8890,7 @@ function GridBodyGroupRow(props) {
|
|
|
8306
8890
|
>
|
|
8307
8891
|
{props.showRowCheckbox ? null : props.rowIndex + 1}
|
|
8308
8892
|
</div>
|
|
8309
|
-
</
|
|
8893
|
+
</Show20>
|
|
8310
8894
|
<For11 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8311
8895
|
{(entry) => {
|
|
8312
8896
|
const unbound = createMemo23(() => entry().column);
|
|
@@ -8349,19 +8933,19 @@ function GridBodyGroupRow(props) {
|
|
|
8349
8933
|
"z-index": 1
|
|
8350
8934
|
}}
|
|
8351
8935
|
>
|
|
8352
|
-
<
|
|
8936
|
+
<Show20
|
|
8353
8937
|
when={isAutoGroupColumn()}
|
|
8354
|
-
fallback={<
|
|
8938
|
+
fallback={<Show20 when={aggregate()}>
|
|
8355
8939
|
{(shown) => <span
|
|
8356
8940
|
class="ssg-group-value"
|
|
8357
8941
|
data-ssg-tooltip-overflow={shown().text !== "" ? shown().caption !== void 0 ? `${shown().caption} ${shown().text}` : shown().text : void 0}
|
|
8358
8942
|
>
|
|
8359
|
-
<
|
|
8943
|
+
<Show20 when={shown().caption !== void 0 && shown().text !== ""}>
|
|
8360
8944
|
<span class="ssg-group-caption">{shown().caption}</span>
|
|
8361
|
-
</
|
|
8945
|
+
</Show20>
|
|
8362
8946
|
{shown().text}
|
|
8363
8947
|
</span>}
|
|
8364
|
-
</
|
|
8948
|
+
</Show20>}
|
|
8365
8949
|
>
|
|
8366
8950
|
<span
|
|
8367
8951
|
aria-hidden="true"
|
|
@@ -8385,7 +8969,7 @@ function GridBodyGroupRow(props) {
|
|
|
8385
8969
|
<span class="ssg-group-count">
|
|
8386
8970
|
{formatLocaleText12(texts().groupRowCount, { count: formatTotalRowNumber(props.groupRow.leafCount) })}
|
|
8387
8971
|
</span>
|
|
8388
|
-
</
|
|
8972
|
+
</Show20>
|
|
8389
8973
|
</div>;
|
|
8390
8974
|
}}
|
|
8391
8975
|
</For11>
|
|
@@ -8421,7 +9005,7 @@ import {
|
|
|
8421
9005
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8422
9006
|
|
|
8423
9007
|
// src/view/GridBodyLabelRow.tsx
|
|
8424
|
-
import { Show as
|
|
9008
|
+
import { Show as Show21, createMemo as createMemo24 } from "solid-js";
|
|
8425
9009
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
8426
9010
|
const row = createMemo24(() => labelRow().row);
|
|
8427
9011
|
const sourceRowIndex = createMemo24(() => labelRow().sourceIndex);
|
|
@@ -8471,7 +9055,7 @@ function GridBodyLabelRow(props) {
|
|
|
8471
9055
|
transform: `translateY(${props.top}px)`
|
|
8472
9056
|
}}
|
|
8473
9057
|
>
|
|
8474
|
-
<
|
|
9058
|
+
<Show21 when={props.ownsRowHeader}>
|
|
8475
9059
|
<div
|
|
8476
9060
|
aria-hidden="true"
|
|
8477
9061
|
class={["ssg-header-cell", "ssg-row-header-cell", "ssg-row-header-cell--label", props.slots.rowHeaderCell?.className]}
|
|
@@ -8482,8 +9066,8 @@ function GridBodyLabelRow(props) {
|
|
|
8482
9066
|
height: px(props.rowHeight)
|
|
8483
9067
|
}}
|
|
8484
9068
|
/>
|
|
8485
|
-
</
|
|
8486
|
-
<
|
|
9069
|
+
</Show21>
|
|
9070
|
+
<Show21 when={props.renderContent}>
|
|
8487
9071
|
{(render) => <div
|
|
8488
9072
|
role="rowheader"
|
|
8489
9073
|
aria-colindex={1}
|
|
@@ -8497,17 +9081,17 @@ function GridBodyLabelRow(props) {
|
|
|
8497
9081
|
{render()(ctx)}
|
|
8498
9082
|
</div>
|
|
8499
9083
|
</div>}
|
|
8500
|
-
</
|
|
9084
|
+
</Show21>
|
|
8501
9085
|
</div>;
|
|
8502
9086
|
}
|
|
8503
9087
|
|
|
8504
9088
|
// src/view/GridStickyLabelLayer.tsx
|
|
8505
|
-
import { Show as
|
|
9089
|
+
import { Show as Show22, createMemo as createMemo25, onSettled as onSettled8 } from "solid-js";
|
|
8506
9090
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
8507
9091
|
function GridStickyLabelLayer(props) {
|
|
8508
|
-
return <
|
|
9092
|
+
return <Show22 when={props.entry}>
|
|
8509
9093
|
{(entry) => <StickyLabel layer={props} entry={entry} />}
|
|
8510
|
-
</
|
|
9094
|
+
</Show22>;
|
|
8511
9095
|
}
|
|
8512
9096
|
function StickyLabel(props) {
|
|
8513
9097
|
const layer = props.layer;
|
|
@@ -8569,7 +9153,7 @@ function StickyLabel(props) {
|
|
|
8569
9153
|
...props.entry().pushOffset > 0 ? { transform: `translateY(${-props.entry().pushOffset}px)` } : null
|
|
8570
9154
|
}}
|
|
8571
9155
|
>
|
|
8572
|
-
<
|
|
9156
|
+
<Show22 when={layer.ownsRowHeader}>
|
|
8573
9157
|
<div
|
|
8574
9158
|
class={["ssg-header-cell", "ssg-row-header-cell", "ssg-row-header-cell--label", layer.slots.rowHeaderCell?.className]}
|
|
8575
9159
|
style={{
|
|
@@ -8579,8 +9163,8 @@ function StickyLabel(props) {
|
|
|
8579
9163
|
height: px(height())
|
|
8580
9164
|
}}
|
|
8581
9165
|
/>
|
|
8582
|
-
</
|
|
8583
|
-
<
|
|
9166
|
+
</Show22>
|
|
9167
|
+
<Show22 when={layer.renderContent}>
|
|
8584
9168
|
{(render) => <div
|
|
8585
9169
|
class="ssg-label-row-content-holder"
|
|
8586
9170
|
style={{ left: px(layer.contentStickyLeft), width: px(layer.contentWidth), height: px(height()) }}
|
|
@@ -8589,12 +9173,12 @@ function StickyLabel(props) {
|
|
|
8589
9173
|
class={["ssg-label-row-content", layer.slots.labelRowContent?.className]}
|
|
8590
9174
|
style={layer.slots.labelRowContent?.style}
|
|
8591
9175
|
>
|
|
8592
|
-
<
|
|
9176
|
+
<Show22 when={[rowKey(), render()]} keyed>
|
|
8593
9177
|
{([, renderContent]) => renderContent(ctx)}
|
|
8594
|
-
</
|
|
9178
|
+
</Show22>
|
|
8595
9179
|
</div>
|
|
8596
9180
|
</div>}
|
|
8597
|
-
</
|
|
9181
|
+
</Show22>
|
|
8598
9182
|
</div>
|
|
8599
9183
|
</div>
|
|
8600
9184
|
);
|
|
@@ -8671,7 +9255,7 @@ function createServerSide(args) {
|
|
|
8671
9255
|
}
|
|
8672
9256
|
|
|
8673
9257
|
// src/view/GridServerSideErrorBars.tsx
|
|
8674
|
-
import { Show as
|
|
9258
|
+
import { Show as Show23, createSignal as createSignal15 } from "solid-js";
|
|
8675
9259
|
import { formatLocaleText as formatLocaleText13 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8676
9260
|
function GridServerSideErrorBars(props) {
|
|
8677
9261
|
const [dismissedLoadError, setDismissedLoadError] = createSignal15(null);
|
|
@@ -8679,9 +9263,9 @@ function GridServerSideErrorBars(props) {
|
|
|
8679
9263
|
const texts = () => props.localeTexts;
|
|
8680
9264
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
8681
9265
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
8682
|
-
return <
|
|
9266
|
+
return <Show23 when={shownLoadError() !== null || shownWriteError() !== null}>
|
|
8683
9267
|
<div class="ssg-ssrm-error-bars">
|
|
8684
|
-
<
|
|
9268
|
+
<Show23 when={shownLoadError()}>
|
|
8685
9269
|
{(loadError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
8686
9270
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
8687
9271
|
<span class="ssg-ssrm-error-bar-msg">
|
|
@@ -8699,8 +9283,8 @@ function GridServerSideErrorBars(props) {
|
|
|
8699
9283
|
×
|
|
8700
9284
|
</button>
|
|
8701
9285
|
</div>}
|
|
8702
|
-
</
|
|
8703
|
-
<
|
|
9286
|
+
</Show23>
|
|
9287
|
+
<Show23 when={shownWriteError()}>
|
|
8704
9288
|
{(writeError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
8705
9289
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
8706
9290
|
<span class="ssg-ssrm-error-bar-msg">
|
|
@@ -8715,13 +9299,13 @@ function GridServerSideErrorBars(props) {
|
|
|
8715
9299
|
×
|
|
8716
9300
|
</button>
|
|
8717
9301
|
</div>}
|
|
8718
|
-
</
|
|
9302
|
+
</Show23>
|
|
8719
9303
|
</div>
|
|
8720
|
-
</
|
|
9304
|
+
</Show23>;
|
|
8721
9305
|
}
|
|
8722
9306
|
|
|
8723
9307
|
// src/view/GridBodySkeletonRow.tsx
|
|
8724
|
-
import { For as For12, Show as
|
|
9308
|
+
import { For as For12, Show as Show24 } from "solid-js";
|
|
8725
9309
|
var SKELETON_BAR_WIDTHS = ["62%", "46%", "78%", "54%"];
|
|
8726
9310
|
function GridBodySkeletonRow(props) {
|
|
8727
9311
|
return <div
|
|
@@ -8738,7 +9322,7 @@ function GridBodySkeletonRow(props) {
|
|
|
8738
9322
|
transform: `translateY(${props.top}px)`
|
|
8739
9323
|
}}
|
|
8740
9324
|
>
|
|
8741
|
-
<
|
|
9325
|
+
<Show24 when={props.ownsRowHeader}>
|
|
8742
9326
|
<div
|
|
8743
9327
|
role="rowheader"
|
|
8744
9328
|
aria-colindex={1}
|
|
@@ -8762,11 +9346,11 @@ function GridBodySkeletonRow(props) {
|
|
|
8762
9346
|
height: px(props.rowHeight)
|
|
8763
9347
|
}}
|
|
8764
9348
|
>
|
|
8765
|
-
<
|
|
9349
|
+
<Show24 when={props.showRowCheckbox} fallback={props.rowIndex + 1}>
|
|
8766
9350
|
<RowSelectionCheckbox slot={props.slots.checkbox} state="unchecked" disabled />
|
|
8767
|
-
</
|
|
9351
|
+
</Show24>
|
|
8768
9352
|
</div>
|
|
8769
|
-
</
|
|
9353
|
+
</Show24>
|
|
8770
9354
|
<For12 each={props.entries} keyed={(entry) => entry.logicalIndex}>
|
|
8771
9355
|
{(entry) => {
|
|
8772
9356
|
const cell = () => ({ row: props.rowIndex, col: entry().logicalIndex });
|
|
@@ -8811,32 +9395,6 @@ var serverSideFeature = {
|
|
|
8811
9395
|
|
|
8812
9396
|
// src/features/motionExtras.ts
|
|
8813
9397
|
import { createChangeHighlightController } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/changeHighlightController";
|
|
8814
|
-
|
|
8815
|
-
// src/view/CopyRangeOverlay.tsx
|
|
8816
|
-
import { Show as Show24 } from "solid-js";
|
|
8817
|
-
var placement = (props, rect) => ({
|
|
8818
|
-
position: "absolute",
|
|
8819
|
-
left: px(props.leadingWidth + rect.left),
|
|
8820
|
-
top: px(props.headerHeight + rect.top - props.baseOffset),
|
|
8821
|
-
width: px(rect.width),
|
|
8822
|
-
height: px(rect.height)
|
|
8823
|
-
});
|
|
8824
|
-
function CopyRangeOverlay(props) {
|
|
8825
|
-
return <Show24 when={props.rect}>
|
|
8826
|
-
{(rect) => <div
|
|
8827
|
-
class={["ssg-copy-range-overlay", props.slot?.className]}
|
|
8828
|
-
style={{ ...props.slot?.style, ...placement(props, rect()) }}
|
|
8829
|
-
data-ssg-copy-range=""
|
|
8830
|
-
/>}
|
|
8831
|
-
</Show24>;
|
|
8832
|
-
}
|
|
8833
|
-
function ColumnHoverOverlay(props) {
|
|
8834
|
-
return <Show24 when={props.rect}>
|
|
8835
|
-
{(rect) => <div class="ssg-col-hover-overlay" style={placement(props, rect())} data-ssg-col-hover="" />}
|
|
8836
|
-
</Show24>;
|
|
8837
|
-
}
|
|
8838
|
-
|
|
8839
|
-
// src/features/motionExtras.ts
|
|
8840
9398
|
var motionExtrasFeature = {
|
|
8841
9399
|
createChangeHighlightController,
|
|
8842
9400
|
CopyRangeOverlay,
|
|
@@ -8849,7 +9407,7 @@ import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid
|
|
|
8849
9407
|
// src/view/GridPinnedRows.tsx
|
|
8850
9408
|
import { For as For13, Show as Show25, createMemo as createMemo27 } from "solid-js";
|
|
8851
9409
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
8852
|
-
import { isSyntheticColumnKey as
|
|
9410
|
+
import { isSyntheticColumnKey as isSyntheticColumnKey4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
8853
9411
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
8854
9412
|
import { formatLocaleText as formatLocaleText14 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8855
9413
|
import { getCellValue as getCellValue5 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
@@ -8970,12 +9528,12 @@ function GridPinnedRows(props) {
|
|
|
8970
9528
|
};
|
|
8971
9529
|
const content = createMemo27(() => {
|
|
8972
9530
|
const current = column();
|
|
8973
|
-
if (
|
|
9531
|
+
if (isSyntheticColumnKey4(current.key)) {
|
|
8974
9532
|
return null;
|
|
8975
9533
|
}
|
|
8976
9534
|
const context = ctx();
|
|
8977
9535
|
if (current.renderCell) {
|
|
8978
|
-
return current.renderCell({ ...context, setValue: noop4 });
|
|
9536
|
+
return current.renderCell({ ...context, tree: void 0, setValue: noop4 });
|
|
8979
9537
|
}
|
|
8980
9538
|
if (current.editor?.type === "checkbox") {
|
|
8981
9539
|
return <CheckboxCell
|
|
@@ -9095,7 +9653,9 @@ function createRowDrag(inputs) {
|
|
|
9095
9653
|
getRowDragLabel,
|
|
9096
9654
|
getDragRow,
|
|
9097
9655
|
locateDragRow: locateDragRow(),
|
|
9098
|
-
canDropAt: canDropAt()
|
|
9656
|
+
canDropAt: canDropAt(),
|
|
9657
|
+
// 追加(1.10.0 / 入力行): 入力行の下へは落とせない(落とせる最後のスロット = 入力行の上。React 版と同じ)。
|
|
9658
|
+
maxDropSlot: inputs.rowModel().newRow?.index
|
|
9099
9659
|
}),
|
|
9100
9660
|
"effect",
|
|
9101
9661
|
"rowDrag"
|
|
@@ -9473,6 +10033,7 @@ import {
|
|
|
9473
10033
|
createSearchSelectEditorController
|
|
9474
10034
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/searchSelectEditorController";
|
|
9475
10035
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
10036
|
+
import { isCommitToSelectionKey as isCommitToSelectionKey2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
9476
10037
|
function MatchedText(props) {
|
|
9477
10038
|
const parts = createMemo30(() => splitSelectSearchText(props.text, props.range));
|
|
9478
10039
|
return <For15 each={parts()} keyed={false}>
|
|
@@ -9491,8 +10052,11 @@ function SearchSelectCellEditor(props) {
|
|
|
9491
10052
|
const listId = createUniqueId6();
|
|
9492
10053
|
const pointerMoved = createPointerMoveFilter2();
|
|
9493
10054
|
const [error, setError] = createSignal17(null);
|
|
10055
|
+
let commitToSelectionPending = false;
|
|
9494
10056
|
const commitWithResult = (committed, direction, option, forwardText) => {
|
|
9495
|
-
const
|
|
10057
|
+
const toSelection = commitToSelectionPending ? props.onCommitToSelection : void 0;
|
|
10058
|
+
commitToSelectionPending = false;
|
|
10059
|
+
const result = toSelection !== void 0 ? toSelection(committed) : props.onCommit(committed, direction, option, forwardText);
|
|
9496
10060
|
if (result && result.status === "rejected") {
|
|
9497
10061
|
setError(result.message);
|
|
9498
10062
|
}
|
|
@@ -9601,6 +10165,11 @@ function SearchSelectCellEditor(props) {
|
|
|
9601
10165
|
return;
|
|
9602
10166
|
}
|
|
9603
10167
|
const before = controller.getSnapshot().highlight;
|
|
10168
|
+
if (props.onCommitToSelection !== void 0 && isCommitToSelectionKey2(event)) {
|
|
10169
|
+
commitToSelectionPending = true;
|
|
10170
|
+
} else if (controller.getSnapshot().status !== "loading") {
|
|
10171
|
+
commitToSelectionPending = false;
|
|
10172
|
+
}
|
|
9604
10173
|
if (controller.keyDown(toEditorKeyEvent(event), props.enterMove) && controller.getSnapshot().highlight !== before) {
|
|
9605
10174
|
setError(null);
|
|
9606
10175
|
reveal(untrack20(scroller), untrack20(viewportHeight));
|
|
@@ -9774,11 +10343,119 @@ var changeTrackingFeature = {
|
|
|
9774
10343
|
localeText: DEFAULT_CHANGE_TRACKING_LOCALE_TEXT
|
|
9775
10344
|
};
|
|
9776
10345
|
|
|
10346
|
+
// src/features/excelShortcuts.ts
|
|
10347
|
+
import { createExcelShortcutCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/excelShortcutCommands";
|
|
10348
|
+
var excelShortcutsFeature = {
|
|
10349
|
+
createExcelShortcutCommands
|
|
10350
|
+
};
|
|
10351
|
+
|
|
10352
|
+
// src/features/newRow.ts
|
|
10353
|
+
import { createNewRowController } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/newRowController";
|
|
10354
|
+
import { resolveNewRowPlaceholder } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/newRow";
|
|
10355
|
+
import { DEFAULT_NEW_ROW_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
10356
|
+
var newRowFeature = {
|
|
10357
|
+
createNewRowController,
|
|
10358
|
+
resolveNewRowPlaceholder,
|
|
10359
|
+
localeText: DEFAULT_NEW_ROW_LOCALE_TEXT
|
|
10360
|
+
};
|
|
10361
|
+
|
|
10362
|
+
// src/features/treeData.ts
|
|
10363
|
+
import {
|
|
10364
|
+
collectTreeAncestors,
|
|
10365
|
+
describeTreeDataProblem,
|
|
10366
|
+
describeTreeStructureProblems,
|
|
10367
|
+
followTreeRowsAfterToggle,
|
|
10368
|
+
resolveTreeDataProblems
|
|
10369
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/treeData";
|
|
10370
|
+
import { createTreeStage } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/treeStage";
|
|
10371
|
+
import { DEFAULT_TREE_DATA_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
10372
|
+
|
|
10373
|
+
// src/view/GridTreeCell.tsx
|
|
10374
|
+
import { createMemo as createMemo31, Show as Show28 } from "solid-js";
|
|
10375
|
+
import { formatLocaleText as formatLocaleText16 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
10376
|
+
import {
|
|
10377
|
+
formatTotalRowCellText as formatTotalRowCellText2,
|
|
10378
|
+
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
10379
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
10380
|
+
function GridTreeCellPrefix(props) {
|
|
10381
|
+
const texts = useFeatureLocaleText();
|
|
10382
|
+
const label = createMemo31(() => {
|
|
10383
|
+
const name = props.rowLabel.trim();
|
|
10384
|
+
return formatLocaleText16(props.open ? texts().collapseTreeRow : texts().expandTreeRow, {
|
|
10385
|
+
row: name !== "" ? name : formatLocaleText16(texts().treeRowNumber, { row: props.rowNumber })
|
|
10386
|
+
});
|
|
10387
|
+
});
|
|
10388
|
+
return <>
|
|
10389
|
+
<Show28 when={props.level > 0}>
|
|
10390
|
+
<span
|
|
10391
|
+
aria-hidden="true"
|
|
10392
|
+
class="ssg-tree-indent"
|
|
10393
|
+
style={{ width: `calc(var(--ssg-tree-indent) * ${props.level})` }}
|
|
10394
|
+
/>
|
|
10395
|
+
</Show28>
|
|
10396
|
+
<Show28 when={props.hasChildren} fallback={<span aria-hidden="true" class="ssg-tree-spacer" />}>
|
|
10397
|
+
<button
|
|
10398
|
+
type="button"
|
|
10399
|
+
tabindex={-1}
|
|
10400
|
+
class="ssg-tree-toggle"
|
|
10401
|
+
aria-expanded={props.open ? "true" : "false"}
|
|
10402
|
+
aria-label={label()}
|
|
10403
|
+
data-ssg-tooltip={label()}
|
|
10404
|
+
onClick={() => props.onToggle(!props.open)}
|
|
10405
|
+
onPointerDown={(event) => {
|
|
10406
|
+
if (event.button !== 0) {
|
|
10407
|
+
return;
|
|
10408
|
+
}
|
|
10409
|
+
event.preventDefault();
|
|
10410
|
+
event.currentTarget.closest(".ssg-shell")?.focus({ preventScroll: true });
|
|
10411
|
+
props.onPress?.();
|
|
10412
|
+
}}
|
|
10413
|
+
onDblClick={(event) => event.stopPropagation()}
|
|
10414
|
+
>
|
|
10415
|
+
{props.open ? "\u25BE" : "\u25B8"}
|
|
10416
|
+
</button>
|
|
10417
|
+
</Show28>
|
|
10418
|
+
</>;
|
|
10419
|
+
}
|
|
10420
|
+
function GridTreeAggregateValue(props) {
|
|
10421
|
+
const texts = useFeatureLocaleText();
|
|
10422
|
+
const shown = createMemo31(() => {
|
|
10423
|
+
const column = props.column;
|
|
10424
|
+
const kind = typeof column.aggFunc === "string" ? column.aggFunc : "custom";
|
|
10425
|
+
const text = formatTotalRowCellText2(column, { value: props.value, kind });
|
|
10426
|
+
return text === "" ? null : { text, caption: resolveTotalRowCaption2(kind, texts()) };
|
|
10427
|
+
});
|
|
10428
|
+
return <Show28 when={shown()}>
|
|
10429
|
+
{(current) => <span
|
|
10430
|
+
class="ssg-group-value ssg-tree-aggregate"
|
|
10431
|
+
data-ssg-tooltip-overflow={current().caption !== void 0 ? `${current().caption} ${current().text}` : current().text}
|
|
10432
|
+
>
|
|
10433
|
+
<Show28 when={current().caption !== void 0}>
|
|
10434
|
+
<span class="ssg-group-caption">{current().caption}</span>
|
|
10435
|
+
</Show28>
|
|
10436
|
+
{current().text}
|
|
10437
|
+
</span>}
|
|
10438
|
+
</Show28>;
|
|
10439
|
+
}
|
|
10440
|
+
|
|
10441
|
+
// src/features/treeData.ts
|
|
10442
|
+
var treeDataFeature = {
|
|
10443
|
+
createTreeStage,
|
|
10444
|
+
collectTreeAncestors,
|
|
10445
|
+
followTreeRowsAfterToggle,
|
|
10446
|
+
resolveTreeDataProblems,
|
|
10447
|
+
describeTreeDataProblem,
|
|
10448
|
+
describeTreeStructureProblems,
|
|
10449
|
+
TreeCellPrefix: GridTreeCellPrefix,
|
|
10450
|
+
TreeAggregateValue: GridTreeAggregateValue,
|
|
10451
|
+
localeText: DEFAULT_TREE_DATA_LOCALE_TEXT
|
|
10452
|
+
};
|
|
10453
|
+
|
|
9777
10454
|
// src/features/selectionAggregates.ts
|
|
9778
10455
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
9779
10456
|
|
|
9780
10457
|
// src/primitives/selectionAggregates.ts
|
|
9781
|
-
import { createMemo as
|
|
10458
|
+
import { createMemo as createMemo32 } from "solid-js";
|
|
9782
10459
|
import {
|
|
9783
10460
|
createSelectionAggregatesRunner,
|
|
9784
10461
|
resolveSyncSelectionAggregates,
|
|
@@ -9790,15 +10467,15 @@ import {
|
|
|
9790
10467
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
9791
10468
|
function createSelectionAggregates(args) {
|
|
9792
10469
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
9793
|
-
const target =
|
|
10470
|
+
const target = createMemo32(() => {
|
|
9794
10471
|
const current = args();
|
|
9795
10472
|
return stabilizeTarget(
|
|
9796
10473
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
9797
10474
|
);
|
|
9798
10475
|
});
|
|
9799
|
-
const rowModel =
|
|
9800
|
-
const key =
|
|
9801
|
-
const syncResult =
|
|
10476
|
+
const rowModel = createMemo32(() => args().rowModel);
|
|
10477
|
+
const key = createMemo32(() => ({ rowModel: rowModel(), target: target() }));
|
|
10478
|
+
const syncResult = createMemo32(() => resolveSyncSelectionAggregates(key()));
|
|
9802
10479
|
const runner = createSelectionAggregatesRunner();
|
|
9803
10480
|
connectController(
|
|
9804
10481
|
runner,
|
|
@@ -9807,16 +10484,16 @@ function createSelectionAggregates(args) {
|
|
|
9807
10484
|
"selectionAggregates"
|
|
9808
10485
|
);
|
|
9809
10486
|
const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
9810
|
-
return
|
|
10487
|
+
return createMemo32(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
|
|
9811
10488
|
}
|
|
9812
10489
|
|
|
9813
10490
|
// src/view/GridSelectionAggregates.tsx
|
|
9814
|
-
import { For as For16, Show as
|
|
10491
|
+
import { For as For16, Show as Show29, createMemo as createMemo33 } from "solid-js";
|
|
9815
10492
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
9816
|
-
import { formatLocaleText as
|
|
10493
|
+
import { formatLocaleText as formatLocaleText17 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
9817
10494
|
function GridSelectionAggregates(props) {
|
|
9818
10495
|
const texts = useFeatureLocaleText();
|
|
9819
|
-
const chips =
|
|
10496
|
+
const chips = createMemo33(() => {
|
|
9820
10497
|
const aggregates = props.aggregates;
|
|
9821
10498
|
if (!aggregates) {
|
|
9822
10499
|
return null;
|
|
@@ -9826,7 +10503,7 @@ function GridSelectionAggregates(props) {
|
|
|
9826
10503
|
return [
|
|
9827
10504
|
{
|
|
9828
10505
|
key: "computing",
|
|
9829
|
-
text:
|
|
10506
|
+
text: formatLocaleText17(localeTexts.aggregateComputing, { percent: Math.floor(aggregates.progress * 100) })
|
|
9830
10507
|
}
|
|
9831
10508
|
];
|
|
9832
10509
|
}
|
|
@@ -9849,7 +10526,7 @@ function GridSelectionAggregates(props) {
|
|
|
9849
10526
|
}
|
|
9850
10527
|
return list;
|
|
9851
10528
|
});
|
|
9852
|
-
return <
|
|
10529
|
+
return <Show29 when={chips()}>
|
|
9853
10530
|
{(list) => <div class={["ssg-bar-aggregates", { "ssg-bar-aggregates--trailing": props.trailing }]}>
|
|
9854
10531
|
<div class="ssg-bar-aggregates-inner" title={list().map((chip) => chip.text).join(" ")}>
|
|
9855
10532
|
<div class="ssg-bar-aggregates-list">
|
|
@@ -9865,16 +10542,16 @@ function GridSelectionAggregates(props) {
|
|
|
9865
10542
|
]}
|
|
9866
10543
|
style={{ order: String(-index()) }}
|
|
9867
10544
|
>
|
|
9868
|
-
<
|
|
10545
|
+
<Show29 when={chip().label !== void 0} fallback={chip().text}>
|
|
9869
10546
|
{chip().label}
|
|
9870
10547
|
<b class="ssg-bar-aggregate-value">{chip().value}</b>
|
|
9871
|
-
</
|
|
10548
|
+
</Show29>
|
|
9872
10549
|
</span>}
|
|
9873
10550
|
</For16>
|
|
9874
10551
|
</div>
|
|
9875
10552
|
</div>
|
|
9876
10553
|
</div>}
|
|
9877
|
-
</
|
|
10554
|
+
</Show29>;
|
|
9878
10555
|
}
|
|
9879
10556
|
|
|
9880
10557
|
// src/features/selectionAggregates.ts
|
|
@@ -9885,7 +10562,7 @@ var selectionAggregatesFeature = {
|
|
|
9885
10562
|
};
|
|
9886
10563
|
|
|
9887
10564
|
// src/primitives/toolPanel.ts
|
|
9888
|
-
import { createMemo as
|
|
10565
|
+
import { createMemo as createMemo34 } from "solid-js";
|
|
9889
10566
|
import {
|
|
9890
10567
|
createToolPanelController,
|
|
9891
10568
|
resolveActiveToolPanelTab,
|
|
@@ -9904,7 +10581,7 @@ function createToolPanel(inputs) {
|
|
|
9904
10581
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
9905
10582
|
}), "render", "toolPanel");
|
|
9906
10583
|
const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
|
|
9907
|
-
const availableTabs =
|
|
10584
|
+
const availableTabs = createMemo34(
|
|
9908
10585
|
() => resolveAvailableToolPanelTabs({
|
|
9909
10586
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
9910
10587
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -9913,10 +10590,10 @@ function createToolPanel(inputs) {
|
|
|
9913
10590
|
{ equals: sameTabs }
|
|
9914
10591
|
);
|
|
9915
10592
|
return {
|
|
9916
|
-
activeTab:
|
|
10593
|
+
activeTab: createMemo34(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
|
|
9917
10594
|
availableTabs,
|
|
9918
|
-
layout:
|
|
9919
|
-
flashTick:
|
|
10595
|
+
layout: createMemo34(() => snapshot2().layout),
|
|
10596
|
+
flashTick: createMemo34(() => snapshot2().flashTick),
|
|
9920
10597
|
panelRef: controller.panelRef,
|
|
9921
10598
|
open: controller.open,
|
|
9922
10599
|
close: controller.close,
|
|
@@ -9934,16 +10611,16 @@ var toolPanelFeature = {
|
|
|
9934
10611
|
// src/features/totalRow.ts
|
|
9935
10612
|
import {
|
|
9936
10613
|
createTotalRowCellsResolver,
|
|
9937
|
-
formatTotalRowCellText as
|
|
9938
|
-
resolveTotalRowCaption as
|
|
10614
|
+
formatTotalRowCellText as formatTotalRowCellText4,
|
|
10615
|
+
resolveTotalRowCaption as resolveTotalRowCaption4,
|
|
9939
10616
|
resolveTotalRowLabelColumnKey
|
|
9940
10617
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
9941
10618
|
|
|
9942
10619
|
// src/view/GridTotalRow.tsx
|
|
9943
|
-
import { For as For17, Show as
|
|
10620
|
+
import { For as For17, Show as Show30, createMemo as createMemo35 } from "solid-js";
|
|
9944
10621
|
import {
|
|
9945
|
-
formatTotalRowCellText as
|
|
9946
|
-
resolveTotalRowCaption as
|
|
10622
|
+
formatTotalRowCellText as formatTotalRowCellText3,
|
|
10623
|
+
resolveTotalRowCaption as resolveTotalRowCaption3
|
|
9947
10624
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
9948
10625
|
function GridTotalRow(props) {
|
|
9949
10626
|
const texts = useGridLocaleText();
|
|
@@ -9967,7 +10644,7 @@ function GridTotalRow(props) {
|
|
|
9967
10644
|
...props.stickyBottom > 0 ? { bottom: px(props.stickyBottom) } : null
|
|
9968
10645
|
}}
|
|
9969
10646
|
>
|
|
9970
|
-
<
|
|
10647
|
+
<Show30 when={props.ownsRowHeader}>
|
|
9971
10648
|
<div
|
|
9972
10649
|
role={rowHeaderIsCell() ? "rowheader" : void 0}
|
|
9973
10650
|
aria-colindex={rowHeaderIsCell() ? 1 : void 0}
|
|
@@ -9982,18 +10659,18 @@ function GridTotalRow(props) {
|
|
|
9982
10659
|
>
|
|
9983
10660
|
{rowHeaderText() === "" ? null : rowHeaderText()}
|
|
9984
10661
|
</div>
|
|
9985
|
-
</
|
|
10662
|
+
</Show30>
|
|
9986
10663
|
<For17 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
9987
10664
|
{(entry) => {
|
|
9988
|
-
const unbound =
|
|
10665
|
+
const unbound = createMemo35(() => entry().column);
|
|
9989
10666
|
const cell = () => props.cells.get(unbound().key);
|
|
9990
10667
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
9991
|
-
const content =
|
|
10668
|
+
const content = createMemo35(() => {
|
|
9992
10669
|
const total = cell();
|
|
9993
10670
|
if (total) {
|
|
9994
10671
|
const column = unbound();
|
|
9995
|
-
const text =
|
|
9996
|
-
const caption =
|
|
10672
|
+
const text = formatTotalRowCellText3(column, total);
|
|
10673
|
+
const caption = resolveTotalRowCaption3(total.kind, texts());
|
|
9997
10674
|
const renderCell = props.renderCell;
|
|
9998
10675
|
if (renderCell) {
|
|
9999
10676
|
return renderCell({
|
|
@@ -10049,8 +10726,8 @@ function GridTotalRow(props) {
|
|
|
10049
10726
|
var totalRowFeature = {
|
|
10050
10727
|
createTotalRowCellsResolver,
|
|
10051
10728
|
TotalRow: GridTotalRow,
|
|
10052
|
-
formatTotalRowCellText:
|
|
10053
|
-
resolveTotalRowCaption:
|
|
10729
|
+
formatTotalRowCellText: formatTotalRowCellText4,
|
|
10730
|
+
resolveTotalRowCaption: resolveTotalRowCaption4,
|
|
10054
10731
|
resolveTotalRowLabelColumnKey
|
|
10055
10732
|
};
|
|
10056
10733
|
|
|
@@ -10069,6 +10746,9 @@ var fullGridFeatures = {
|
|
|
10069
10746
|
imeDirectInput: imeDirectInputFeature,
|
|
10070
10747
|
selectSearch: selectSearchFeature,
|
|
10071
10748
|
changeTracking: changeTrackingFeature,
|
|
10749
|
+
excelShortcuts: excelShortcutsFeature,
|
|
10750
|
+
newRow: newRowFeature,
|
|
10751
|
+
treeData: treeDataFeature,
|
|
10072
10752
|
columnAutosize: columnAutosizeFeature,
|
|
10073
10753
|
columnReorder: columnReorderFeature,
|
|
10074
10754
|
rowDrag: rowDragFeature,
|
|
@@ -10112,6 +10792,7 @@ export {
|
|
|
10112
10792
|
conditionalFormatFeature,
|
|
10113
10793
|
contextMenuFeature,
|
|
10114
10794
|
createSpreadsheetGrid,
|
|
10795
|
+
excelShortcutsFeature,
|
|
10115
10796
|
exportFeature,
|
|
10116
10797
|
fillHandleFeature,
|
|
10117
10798
|
filteringFeature,
|
|
@@ -10120,6 +10801,7 @@ export {
|
|
|
10120
10801
|
imeDirectInputFeature,
|
|
10121
10802
|
labelRowFeature,
|
|
10122
10803
|
motionExtrasFeature,
|
|
10804
|
+
newRowFeature,
|
|
10123
10805
|
numberFormatter,
|
|
10124
10806
|
numberParser,
|
|
10125
10807
|
pinnedRowsFeature,
|
|
@@ -10132,5 +10814,6 @@ export {
|
|
|
10132
10814
|
serverSideFeature,
|
|
10133
10815
|
standardFeatures,
|
|
10134
10816
|
toolPanelFeature,
|
|
10135
|
-
totalRowFeature
|
|
10817
|
+
totalRowFeature,
|
|
10818
|
+
treeDataFeature
|
|
10136
10819
|
};
|