@ishibashi0112/spreadsheet-grid-solid 1.4.1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +29 -10
- package/README.md +7 -7
- package/dist/devWarnings.d.ts +1 -0
- package/dist/index.js +2539 -2377
- package/dist/primitives/reusedRow.d.ts +2 -0
- package/dist/primitives/rowSlots.d.ts +12 -0
- package/dist/primitives/serverSide.d.ts +1 -0
- package/dist/source/index.jsx +326 -77
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/view/GridBodyLayer.d.ts +2 -0
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +1 -1
package/dist/source/index.jsx
CHANGED
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/gridBarSummary";
|
|
76
76
|
import { isCheckboxChecked } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
77
77
|
import {
|
|
78
|
-
MAX_BODY_PX
|
|
78
|
+
MAX_BODY_PX,
|
|
79
79
|
physicalToLogicalScrollTop,
|
|
80
80
|
resolvePageTargetRow
|
|
81
81
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
@@ -598,8 +598,8 @@ function GridHeaderRow(props) {
|
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
// src/view/GridBodyLayer.tsx
|
|
601
|
-
import { For as For2, Show as Show2, createMemo as createMemo5, untrack as untrack3 } from "solid-js";
|
|
602
|
-
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
601
|
+
import { For as For2, Show as Show2, createMemo as createMemo5, createRenderEffect, untrack as untrack3 } from "solid-js";
|
|
602
|
+
import { getCellValue, isCellEditable, isColumnEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
603
603
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
604
604
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
605
605
|
import { shouldMarkCellOverflowTooltip } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellOverflowTooltip";
|
|
@@ -639,9 +639,88 @@ var markClickTarget = (element) => {
|
|
|
639
639
|
element.onclick = noop;
|
|
640
640
|
};
|
|
641
641
|
|
|
642
|
+
// src/primitives/rowSlots.ts
|
|
643
|
+
var PREFIX = { data: "r", skeleton: "s", keyed: "k" };
|
|
644
|
+
var assignRowSlots = (prev, rows, kindOf, reuseFreedSlots) => {
|
|
645
|
+
const slotByKey = /* @__PURE__ */ new Map();
|
|
646
|
+
if (prev) {
|
|
647
|
+
for (const item of prev.items) {
|
|
648
|
+
slotByKey.set(item.key, item.slot);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const used = /* @__PURE__ */ new Set();
|
|
652
|
+
const items = new Array(rows.length);
|
|
653
|
+
const unassigned = [];
|
|
654
|
+
for (let index = 0; index < rows.length; index += 1) {
|
|
655
|
+
const row = rows[index];
|
|
656
|
+
const kind = kindOf(row);
|
|
657
|
+
if (kind === "keyed") {
|
|
658
|
+
const slot2 = `${PREFIX.keyed}${row.key}`;
|
|
659
|
+
items[index] = { ...row, slot: slot2 };
|
|
660
|
+
used.add(slot2);
|
|
661
|
+
continue;
|
|
662
|
+
}
|
|
663
|
+
const slot = slotByKey.get(row.key);
|
|
664
|
+
if (slot !== void 0 && slot[0] === PREFIX[kind] && !used.has(slot)) {
|
|
665
|
+
items[index] = { ...row, slot };
|
|
666
|
+
used.add(slot);
|
|
667
|
+
} else {
|
|
668
|
+
unassigned.push(index);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
const freed = { [PREFIX.data]: [], [PREFIX.skeleton]: [] };
|
|
672
|
+
if (reuseFreedSlots && prev) {
|
|
673
|
+
for (const item of prev.items) {
|
|
674
|
+
if (!used.has(item.slot)) {
|
|
675
|
+
freed[item.slot[0]]?.push(item.slot);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
const taken = { [PREFIX.data]: 0, [PREFIX.skeleton]: 0 };
|
|
680
|
+
let next = prev?.next ?? 0;
|
|
681
|
+
for (const index of unassigned) {
|
|
682
|
+
const row = rows[index];
|
|
683
|
+
const prefix = PREFIX[kindOf(row)];
|
|
684
|
+
const position = taken[prefix];
|
|
685
|
+
let slot = freed[prefix][position];
|
|
686
|
+
if (slot === void 0) {
|
|
687
|
+
slot = `${prefix}${next}`;
|
|
688
|
+
next += 1;
|
|
689
|
+
} else {
|
|
690
|
+
taken[prefix] = position + 1;
|
|
691
|
+
}
|
|
692
|
+
items[index] = { ...row, slot };
|
|
693
|
+
}
|
|
694
|
+
return { items, next };
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
// src/primitives/reusedRow.ts
|
|
698
|
+
var REUSED_ROW_ATTRIBUTE = "data-ssg-reused";
|
|
699
|
+
var marked = /* @__PURE__ */ new Set();
|
|
700
|
+
var frame = null;
|
|
701
|
+
var release = () => {
|
|
702
|
+
frame = null;
|
|
703
|
+
for (const element of marked) {
|
|
704
|
+
element.removeAttribute(REUSED_ROW_ATTRIBUTE);
|
|
705
|
+
}
|
|
706
|
+
marked.clear();
|
|
707
|
+
};
|
|
708
|
+
var markReusedRow = (element) => {
|
|
709
|
+
element.setAttribute(REUSED_ROW_ATTRIBUTE, "");
|
|
710
|
+
marked.add(element);
|
|
711
|
+
if (frame !== null || typeof requestAnimationFrame !== "function") {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
frame = requestAnimationFrame(() => {
|
|
715
|
+
frame = requestAnimationFrame(release);
|
|
716
|
+
});
|
|
717
|
+
};
|
|
718
|
+
|
|
642
719
|
// src/view/GridBodyLayer.tsx
|
|
643
720
|
var NO_SELECTED_COLUMNS = [-1, -1];
|
|
644
721
|
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
722
|
+
var NO_VALUE = () => null;
|
|
723
|
+
var NO_SLOT = () => EMPTY_SLOT;
|
|
645
724
|
var joinClasses = (...parts) => {
|
|
646
725
|
let out = "";
|
|
647
726
|
for (const part of parts) {
|
|
@@ -652,11 +731,48 @@ var joinClasses = (...parts) => {
|
|
|
652
731
|
return out;
|
|
653
732
|
};
|
|
654
733
|
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
655
|
-
var cellKey = (entry) => isPlainCellColumn(entry.column) ? entry.column.key : `${entry.column.key}\0decorated`;
|
|
656
734
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
657
735
|
function GridBodyLayer(props) {
|
|
658
736
|
const texts = useGridLocaleText();
|
|
659
|
-
|
|
737
|
+
const cellShapes = /* @__PURE__ */ new WeakMap();
|
|
738
|
+
const cellShapeOf = (column) => {
|
|
739
|
+
const known = cellShapes.get(column);
|
|
740
|
+
if (known !== void 0 && known.renderCell === column.renderCell) {
|
|
741
|
+
return known.shape;
|
|
742
|
+
}
|
|
743
|
+
const shape = !isPlainCellColumn(column) ? "decorated" : props.isTextCellColumn(column) ? "text" : "plain";
|
|
744
|
+
cellShapes.set(column, { shape, renderCell: column.renderCell });
|
|
745
|
+
return shape;
|
|
746
|
+
};
|
|
747
|
+
const cellKey = (entry) => `${entry.column.key}\0${cellShapeOf(entry.column)}${entry.column.renderCell ? "+render" : ""}`;
|
|
748
|
+
const editPermission = createMemo5(
|
|
749
|
+
() => ({ readOnly: props.readOnly, canEditCell: props.canEditCell }),
|
|
750
|
+
{ equals: (a, b) => a.readOnly === b.readOnly && a.canEditCell === b.canEditCell }
|
|
751
|
+
);
|
|
752
|
+
const cellEnv = createMemo5(
|
|
753
|
+
() => ({
|
|
754
|
+
showCellOverflowTooltip: props.showCellOverflowTooltip,
|
|
755
|
+
bodyCellSlot: props.slots.bodyCell,
|
|
756
|
+
leadingWidth: props.leadingWidth
|
|
757
|
+
}),
|
|
758
|
+
{
|
|
759
|
+
equals: (a, b) => a.showCellOverflowTooltip === b.showCellOverflowTooltip && a.bodyCellSlot === b.bodyCellSlot && a.leadingWidth === b.leadingWidth
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
const slotKindOf = (row) => {
|
|
763
|
+
if (row.skeleton) {
|
|
764
|
+
return "skeleton";
|
|
765
|
+
}
|
|
766
|
+
const model = props.rowModel;
|
|
767
|
+
return model.getGroupRow?.(row.index) !== void 0 || model.getLabelRow?.(row.index) !== void 0 ? "keyed" : "data";
|
|
768
|
+
};
|
|
769
|
+
const slotted = createMemo5(
|
|
770
|
+
(prev) => {
|
|
771
|
+
const model = props.rowModel;
|
|
772
|
+
return { state: assignRowSlots(prev?.state, props.rows, slotKindOf, prev?.model === model), model };
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
return <For2 each={slotted().state.items} keyed={(item) => item.slot}>
|
|
660
776
|
{(item) => {
|
|
661
777
|
const rowIndex = createMemo5(() => item().index);
|
|
662
778
|
const SkeletonRow = untrack3(() => item().skeleton ? props.skeletonRow : void 0);
|
|
@@ -740,8 +856,18 @@ function GridBodyLayer(props) {
|
|
|
740
856
|
</Show2>
|
|
741
857
|
<Show2 when={row()}>
|
|
742
858
|
{(currentRow) => {
|
|
743
|
-
const rowKey = () => props.rowModel.getRowKey(rowIndex()) ?? rowIndex();
|
|
744
|
-
|
|
859
|
+
const rowKey = createMemo5(() => props.rowModel.getRowKey(rowIndex()) ?? rowIndex());
|
|
860
|
+
let rowElement;
|
|
861
|
+
createRenderEffect(
|
|
862
|
+
rowKey,
|
|
863
|
+
(_next, previous) => {
|
|
864
|
+
if (previous !== void 0 && rowElement) {
|
|
865
|
+
markReusedRow(rowElement);
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
{ name: "reusedRow" }
|
|
869
|
+
);
|
|
870
|
+
const sourceRowIndex = createMemo5(() => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex());
|
|
745
871
|
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
746
872
|
const isRowChecked = createMemo5(
|
|
747
873
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
@@ -791,7 +917,77 @@ function GridBodyLayer(props) {
|
|
|
791
917
|
)
|
|
792
918
|
);
|
|
793
919
|
const rowNumber = () => props.labelViewIndexes ? resolveDataRowNumber(props.labelViewIndexes, rowIndex()) : rowIndex() + 1;
|
|
920
|
+
const textCellBase = createMemo5(() => {
|
|
921
|
+
const slot = rowSlot();
|
|
922
|
+
const bodyCell = cellEnv().bodyCellSlot;
|
|
923
|
+
return {
|
|
924
|
+
className: joinClasses("ssg-body-cell", slot.className, bodyCell?.className),
|
|
925
|
+
style: bodyCell?.style || slot.style ? { ...bodyCell?.style, ...slot.style } : void 0
|
|
926
|
+
};
|
|
927
|
+
});
|
|
928
|
+
const renderTextCell = (entry) => {
|
|
929
|
+
const unbound = createMemo5(() => entry().column);
|
|
930
|
+
const column = () => unbound();
|
|
931
|
+
const colIndex = () => entry().logicalIndex;
|
|
932
|
+
const size = () => entry().paneLocalSize;
|
|
933
|
+
const isActive = () => activeCol() === colIndex();
|
|
934
|
+
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
935
|
+
const readOnlyCell = () => {
|
|
936
|
+
const env = editPermission();
|
|
937
|
+
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
938
|
+
sourceRowIndex: sourceRowIndex(),
|
|
939
|
+
rowKey: rowKey()
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
const alignTop = () => rowAutoHeight() && rowSize() > props.rowHeight && (column().verticalAlign ?? props.verticalAlign ?? "center") === "top";
|
|
943
|
+
const findRanges = createMemoWhen(
|
|
944
|
+
() => rowFindHits() !== void 0,
|
|
945
|
+
() => rowFindHits()?.get(colIndex()),
|
|
946
|
+
void 0
|
|
947
|
+
);
|
|
948
|
+
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
949
|
+
return <div
|
|
950
|
+
role="gridcell"
|
|
951
|
+
aria-colindex={colIndex() + 2}
|
|
952
|
+
aria-selected={isSelected() ? "true" : "false"}
|
|
953
|
+
aria-readonly={readOnlyCell() ? "true" : void 0}
|
|
954
|
+
id={isActive() ? props.activeCellDomId : void 0}
|
|
955
|
+
aria-owns={editingCol() === colIndex() ? props.cellEditorDomId : void 0}
|
|
956
|
+
data-ssg-col-key={column().key}
|
|
957
|
+
data-ssg-tooltip-overflow={cellEnv().showCellOverflowTooltip ? "" : void 0}
|
|
958
|
+
class={joinClasses(
|
|
959
|
+
textCellBase().className,
|
|
960
|
+
column().align === "center" && "ssg-body-cell--align-center",
|
|
961
|
+
column().align === "right" && "ssg-body-cell--align-right",
|
|
962
|
+
alignTop() && "ssg-body-cell--valign-top",
|
|
963
|
+
readOnlyCell() && !isSelected() && "ssg-body-cell--readonly",
|
|
964
|
+
isHovered() && "ssg-body-cell--row-hovered"
|
|
965
|
+
)}
|
|
966
|
+
onPointerDown={(event) => props.onCellPointerDown(cell(), event)}
|
|
967
|
+
onPointerEnter={(event) => props.onCellPointerEnter(cell(), event)}
|
|
968
|
+
onClick={(event) => props.onCellClick(cell(), event)}
|
|
969
|
+
onDblClick={(event) => props.onCellDoubleClick(cell(), event)}
|
|
970
|
+
ref={markClickTarget}
|
|
971
|
+
style={{
|
|
972
|
+
...textCellBase().style,
|
|
973
|
+
left: px(cellEnv().leadingWidth + entry().paneLocalStart),
|
|
974
|
+
width: px(size()),
|
|
975
|
+
"min-width": px(size()),
|
|
976
|
+
height: px(rowSize()),
|
|
977
|
+
"word-break": column().wordBreak,
|
|
978
|
+
"line-break": column().lineBreak,
|
|
979
|
+
"z-index": isActive() ? 3 : 1
|
|
980
|
+
}}
|
|
981
|
+
>
|
|
982
|
+
<span class="ssg-cell-value">
|
|
983
|
+
{props.cellText(currentRow(), column(), findRanges(), rowFindCurrent)}
|
|
984
|
+
</span>
|
|
985
|
+
</div>;
|
|
986
|
+
};
|
|
794
987
|
return <div
|
|
988
|
+
ref={(element) => {
|
|
989
|
+
rowElement = element;
|
|
990
|
+
}}
|
|
795
991
|
data-pane={props.pane}
|
|
796
992
|
data-row-index={rowIndex()}
|
|
797
993
|
role="row"
|
|
@@ -845,7 +1041,11 @@ function GridBodyLayer(props) {
|
|
|
845
1041
|
</Show2>
|
|
846
1042
|
<For2 each={props.entries} keyed={cellKey}>
|
|
847
1043
|
{(entry) => {
|
|
848
|
-
const
|
|
1044
|
+
const shape = untrack3(() => cellShapeOf(entry().column));
|
|
1045
|
+
if (shape === "text") {
|
|
1046
|
+
return renderTextCell(entry);
|
|
1047
|
+
}
|
|
1048
|
+
const plain = shape === "plain";
|
|
849
1049
|
const unbound = createMemo5(() => entry().column);
|
|
850
1050
|
const column = () => unbound();
|
|
851
1051
|
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
@@ -853,21 +1053,19 @@ function GridBodyLayer(props) {
|
|
|
853
1053
|
const isActive = () => activeCol() === colIndex();
|
|
854
1054
|
const isEditing = () => editingCol() === colIndex();
|
|
855
1055
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
856
|
-
const readOnlyCell = () =>
|
|
857
|
-
|
|
858
|
-
rowIndex(),
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
);
|
|
1056
|
+
const readOnlyCell = () => {
|
|
1057
|
+
const env = editPermission();
|
|
1058
|
+
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
1059
|
+
sourceRowIndex: sourceRowIndex(),
|
|
1060
|
+
rowKey: rowKey()
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
864
1063
|
const value = () => getCellValue(currentRow(), unbound());
|
|
865
1064
|
const findRanges = createMemoWhen(
|
|
866
1065
|
() => rowFindHits()?.has(colIndex()) === true,
|
|
867
1066
|
() => rowFindHits()?.get(colIndex()),
|
|
868
1067
|
void 0
|
|
869
1068
|
);
|
|
870
|
-
const cellRowKey = untrack3(rowKey);
|
|
871
1069
|
const cellState = {
|
|
872
1070
|
get rowIndex() {
|
|
873
1071
|
return rowIndex();
|
|
@@ -878,7 +1076,9 @@ function GridBodyLayer(props) {
|
|
|
878
1076
|
get sourceRowIndex() {
|
|
879
1077
|
return sourceRowIndex();
|
|
880
1078
|
},
|
|
881
|
-
rowKey
|
|
1079
|
+
get rowKey() {
|
|
1080
|
+
return rowKey();
|
|
1081
|
+
},
|
|
882
1082
|
get findRanges() {
|
|
883
1083
|
return findRanges();
|
|
884
1084
|
},
|
|
@@ -899,7 +1099,7 @@ function GridBodyLayer(props) {
|
|
|
899
1099
|
}
|
|
900
1100
|
};
|
|
901
1101
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
902
|
-
const styleContext = plain ?
|
|
1102
|
+
const styleContext = plain ? NO_VALUE : createMemoWhen(
|
|
903
1103
|
needsStyleContext,
|
|
904
1104
|
() => ({
|
|
905
1105
|
row: currentRow(),
|
|
@@ -916,7 +1116,7 @@ function GridBodyLayer(props) {
|
|
|
916
1116
|
}),
|
|
917
1117
|
null
|
|
918
1118
|
);
|
|
919
|
-
const conditionalCell = plain ?
|
|
1119
|
+
const conditionalCell = plain ? NO_SLOT : createMemoWhen(
|
|
920
1120
|
() => column().cellClassName !== void 0,
|
|
921
1121
|
() => {
|
|
922
1122
|
const cellClassName = column().cellClassName;
|
|
@@ -928,7 +1128,7 @@ function GridBodyLayer(props) {
|
|
|
928
1128
|
resolveSlotProps(void 0)
|
|
929
1129
|
);
|
|
930
1130
|
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
931
|
-
const dataBar = plain ?
|
|
1131
|
+
const dataBar = plain ? NO_VALUE : createMemoWhen(
|
|
932
1132
|
() => formatRules()?.dataBar !== void 0,
|
|
933
1133
|
() => {
|
|
934
1134
|
const feature = props.conditionalFormat;
|
|
@@ -937,7 +1137,7 @@ function GridBodyLayer(props) {
|
|
|
937
1137
|
},
|
|
938
1138
|
null
|
|
939
1139
|
);
|
|
940
|
-
const scaleBackground = plain ?
|
|
1140
|
+
const scaleBackground = plain ? NO_VALUE : createMemoWhen(
|
|
941
1141
|
() => formatRules()?.colorScale !== void 0,
|
|
942
1142
|
() => {
|
|
943
1143
|
const feature = props.conditionalFormat;
|
|
@@ -955,12 +1155,12 @@ function GridBodyLayer(props) {
|
|
|
955
1155
|
const rules = formatRules()?.dataBar;
|
|
956
1156
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
957
1157
|
};
|
|
958
|
-
const invalidMessage = plain ?
|
|
1158
|
+
const invalidMessage = plain ? NO_VALUE : createMemoWhen(
|
|
959
1159
|
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
960
1160
|
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
961
1161
|
null
|
|
962
1162
|
);
|
|
963
|
-
const cellNote = plain ?
|
|
1163
|
+
const cellNote = plain ? NO_VALUE : createMemoWhen(
|
|
964
1164
|
() => !!column().cellNote,
|
|
965
1165
|
() => {
|
|
966
1166
|
const note = column().cellNote;
|
|
@@ -982,11 +1182,12 @@ function GridBodyLayer(props) {
|
|
|
982
1182
|
const isAutoHeightCell = () => (autoHeightFlags() & 1) !== 0;
|
|
983
1183
|
const alignTop = () => (autoHeightFlags() & 2) !== 0;
|
|
984
1184
|
const markOverflowTooltip = () => shouldMarkCellOverflowTooltip({
|
|
985
|
-
enabled:
|
|
1185
|
+
enabled: cellEnv().showCellOverflowTooltip,
|
|
986
1186
|
isAutoHeightCell: isAutoHeightCell(),
|
|
987
1187
|
hasRenderCell: column().renderCell !== void 0
|
|
988
1188
|
});
|
|
989
1189
|
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
1190
|
+
const keyedContent = untrack3(() => entry().column.renderCell !== void 0);
|
|
990
1191
|
const cellChildren = plain ? () => props.renderCellContent(currentRow, column(), cellState) : () => <>
|
|
991
1192
|
<Show2 when={dataBar()}>
|
|
992
1193
|
{(bar) => <span
|
|
@@ -1008,6 +1209,10 @@ function GridBodyLayer(props) {
|
|
|
1008
1209
|
</div>
|
|
1009
1210
|
</Show2>
|
|
1010
1211
|
</>;
|
|
1212
|
+
const cellContent = keyedContent ? () => {
|
|
1213
|
+
rowKey();
|
|
1214
|
+
return cellChildren();
|
|
1215
|
+
} : cellChildren;
|
|
1011
1216
|
return <div
|
|
1012
1217
|
role="gridcell"
|
|
1013
1218
|
aria-colindex={colIndex() + 2}
|
|
@@ -1025,7 +1230,7 @@ function GridBodyLayer(props) {
|
|
|
1025
1230
|
"ssg-body-cell",
|
|
1026
1231
|
rowSlot().className,
|
|
1027
1232
|
conditionalCell().className,
|
|
1028
|
-
|
|
1233
|
+
cellEnv().bodyCellSlot?.className,
|
|
1029
1234
|
column().align === "center" && "ssg-body-cell--align-center",
|
|
1030
1235
|
column().align === "right" && "ssg-body-cell--align-right",
|
|
1031
1236
|
dataBar() !== null && "ssg-body-cell--cf-bar",
|
|
@@ -1049,11 +1254,11 @@ function GridBodyLayer(props) {
|
|
|
1049
1254
|
onDblClick={(event) => props.onCellDoubleClick(cell(), event)}
|
|
1050
1255
|
ref={markClickTarget}
|
|
1051
1256
|
style={{
|
|
1052
|
-
...
|
|
1257
|
+
...cellEnv().bodyCellSlot?.style,
|
|
1053
1258
|
...scaleBackground() !== null ? { "background-color": scaleBackground() } : null,
|
|
1054
1259
|
...rowSlot().style,
|
|
1055
1260
|
...conditionalCell().style,
|
|
1056
|
-
left: px(
|
|
1261
|
+
left: px(cellEnv().leadingWidth + entry().paneLocalStart),
|
|
1057
1262
|
width: px(size()),
|
|
1058
1263
|
"min-width": px(size()),
|
|
1059
1264
|
height: px(rowSize()),
|
|
@@ -1062,7 +1267,7 @@ function GridBodyLayer(props) {
|
|
|
1062
1267
|
"z-index": isActive() ? 3 : 1
|
|
1063
1268
|
}}
|
|
1064
1269
|
>
|
|
1065
|
-
{
|
|
1270
|
+
{cellContent()}
|
|
1066
1271
|
</div>;
|
|
1067
1272
|
}}
|
|
1068
1273
|
</For2>
|
|
@@ -1232,7 +1437,7 @@ import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
1232
1437
|
import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
1233
1438
|
|
|
1234
1439
|
// src/editors/TextCellEditor.tsx
|
|
1235
|
-
import { Show as Show6, createRenderEffect as
|
|
1440
|
+
import { Show as Show6, createRenderEffect as createRenderEffect3, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
|
|
1236
1441
|
import { handleEditorKeyDown } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
1237
1442
|
import {
|
|
1238
1443
|
fitMultilineEditor,
|
|
@@ -1242,7 +1447,7 @@ import {
|
|
|
1242
1447
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/utils/multilineEditor";
|
|
1243
1448
|
|
|
1244
1449
|
// src/primitives/topAlignedInput.ts
|
|
1245
|
-
import { createRenderEffect, onSettled, untrack as untrack5 } from "solid-js";
|
|
1450
|
+
import { createRenderEffect as createRenderEffect2, onSettled, untrack as untrack5 } from "solid-js";
|
|
1246
1451
|
import {
|
|
1247
1452
|
alignInputTextToTop,
|
|
1248
1453
|
resolveHiddenTopOf
|
|
@@ -1254,7 +1459,7 @@ function createTopAlignedInput(input, alignTop, cellHeight) {
|
|
|
1254
1459
|
}
|
|
1255
1460
|
};
|
|
1256
1461
|
const read = () => [input(), alignTop(), cellHeight()];
|
|
1257
|
-
|
|
1462
|
+
createRenderEffect2(read, apply, { name: "topAlignedInput" });
|
|
1258
1463
|
onSettled(() => apply(untrack5(read)));
|
|
1259
1464
|
}
|
|
1260
1465
|
|
|
@@ -1321,7 +1526,7 @@ function TextCellEditor(props) {
|
|
|
1321
1526
|
element.setSelectionRange(caret, caret);
|
|
1322
1527
|
}
|
|
1323
1528
|
};
|
|
1324
|
-
|
|
1529
|
+
createRenderEffect3(() => [textarea(), cellHeight(), alignTop(), draft()], fit, { name: "textEditorFit" });
|
|
1325
1530
|
onSettled3(() => {
|
|
1326
1531
|
const element = untrack6(() => input() ?? textarea());
|
|
1327
1532
|
if (!element) {
|
|
@@ -1505,7 +1710,7 @@ import {
|
|
|
1505
1710
|
For as For4,
|
|
1506
1711
|
Show as Show7,
|
|
1507
1712
|
createEffect as createEffect2,
|
|
1508
|
-
createRenderEffect as
|
|
1713
|
+
createRenderEffect as createRenderEffect4,
|
|
1509
1714
|
createSignal as createSignal6,
|
|
1510
1715
|
createUniqueId,
|
|
1511
1716
|
onCleanup as onCleanup5,
|
|
@@ -1736,7 +1941,7 @@ function SelectCellEditor(props) {
|
|
|
1736
1941
|
</Show7>
|
|
1737
1942
|
</>;
|
|
1738
1943
|
createPortalTokens(list, () => props.themeClassName, placement2);
|
|
1739
|
-
|
|
1944
|
+
createRenderEffect4(
|
|
1740
1945
|
() => [input(), composing() ?? shownText()],
|
|
1741
1946
|
([element, text]) => {
|
|
1742
1947
|
if (element && element.value !== text) {
|
|
@@ -1745,7 +1950,7 @@ function SelectCellEditor(props) {
|
|
|
1745
1950
|
},
|
|
1746
1951
|
{ name: "selectEditorInputText" }
|
|
1747
1952
|
);
|
|
1748
|
-
|
|
1953
|
+
createRenderEffect4(
|
|
1749
1954
|
() => [input(), shownText(), composing()],
|
|
1750
1955
|
([element, , composingText]) => {
|
|
1751
1956
|
if (!element || composingText !== null) {
|
|
@@ -2048,7 +2253,7 @@ function CellEditorLayer(props) {
|
|
|
2048
2253
|
}
|
|
2049
2254
|
|
|
2050
2255
|
// src/view/DefaultGridTopBar.tsx
|
|
2051
|
-
import { Show as Show9, createMemo as createMemo8, createRenderEffect as
|
|
2256
|
+
import { Show as Show9, createMemo as createMemo8, createRenderEffect as createRenderEffect5, createSignal as createSignal8, createUniqueId as createUniqueId2, untrack as untrack12 } from "solid-js";
|
|
2052
2257
|
var DefaultFilterIcon = () => <svg
|
|
2053
2258
|
width="14"
|
|
2054
2259
|
height="14"
|
|
@@ -2082,7 +2287,7 @@ function DefaultGridTopBar(props) {
|
|
|
2082
2287
|
const placeholder = () => props.globalFilterPlaceholder ?? texts().globalFilterPlaceholder;
|
|
2083
2288
|
const [input, setInput] = createSignal8();
|
|
2084
2289
|
const initialText = untrack12(() => props.globalFilterText);
|
|
2085
|
-
|
|
2290
|
+
createRenderEffect5(
|
|
2086
2291
|
() => [input(), props.globalFilterText],
|
|
2087
2292
|
([element, text]) => {
|
|
2088
2293
|
if (element && element.value !== text) {
|
|
@@ -2201,7 +2406,7 @@ function DefaultGridBottomBar(props) {
|
|
|
2201
2406
|
|
|
2202
2407
|
// src/devWarnings.ts
|
|
2203
2408
|
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
2204
|
-
import { AUTO_HEIGHT_MAX_ROWS
|
|
2409
|
+
import { AUTO_HEIGHT_MAX_ROWS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
2205
2410
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2206
2411
|
import {
|
|
2207
2412
|
warnUnregisteredFeatureMethod,
|
|
@@ -2276,6 +2481,7 @@ var FEATURE_PROPS = {
|
|
|
2276
2481
|
serverSide: [
|
|
2277
2482
|
{ prop: "dataSource", isUsed: (props) => props.dataSource !== void 0 },
|
|
2278
2483
|
{ prop: "serverSideRefreshToken", isUsed: (props) => props.serverSideRefreshToken !== void 0 },
|
|
2484
|
+
{ prop: "serverSideRefetch", isUsed: (props) => props.serverSideRefetch !== void 0 },
|
|
2279
2485
|
{ prop: "onServerSideLoadError", isUsed: (props) => props.onServerSideLoadError !== void 0 },
|
|
2280
2486
|
{ prop: "onServerSideWriteError", isUsed: (props) => props.onServerSideWriteError !== void 0 },
|
|
2281
2487
|
{ prop: "showSaveStatus", isUsed: (props) => props.showSaveStatus === true }
|
|
@@ -2401,8 +2607,8 @@ function createShellDevWarningsInDev(args) {
|
|
|
2401
2607
|
warnOncePerGrid(
|
|
2402
2608
|
warned,
|
|
2403
2609
|
"detailMaxBody",
|
|
2404
|
-
`[SpreadsheetGrid] \u5C55\u958B\u884C\u306F\u8AD6\u7406\u5168\u9AD8(\u884C\u9AD8\u5408\u8A08 + \u5E2F\u9AD8)\u304C ${
|
|
2405
|
-
[SpreadsheetGrid] Detail rows are drawn only while the total height (rows + details) is at most ${
|
|
2610
|
+
`[SpreadsheetGrid] \u5C55\u958B\u884C\u306F\u8AD6\u7406\u5168\u9AD8(\u884C\u9AD8\u5408\u8A08 + \u5E2F\u9AD8)\u304C ${args.maxBodyPx()}px \u4EE5\u5185\u306E\u3068\u304D\u3060\u3051\u63CF\u753B\u3057\u307E\u3059(\u884C\u6570\u4E0A\u9650\u8D85\u904E)\u3002\u5C55\u958B\u72B6\u614B\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059\u304C\u5E2F\u306F\u63CF\u304B\u308C\u307E\u305B\u3093\u3002
|
|
2611
|
+
[SpreadsheetGrid] Detail rows are drawn only while the total height (rows + details) is at most ${args.maxBodyPx()}px (too many rows). The expanded state is kept, but the details are not drawn.`
|
|
2406
2612
|
);
|
|
2407
2613
|
}
|
|
2408
2614
|
}
|
|
@@ -2505,14 +2711,14 @@ var DERIVED_SUMMARY_KEYS = Object.keys({
|
|
|
2505
2711
|
function GridShell(props, features) {
|
|
2506
2712
|
const serverSnapshot = isServer && untrack13(() => props.dataSource == null);
|
|
2507
2713
|
const mountGate = createMountGate();
|
|
2508
|
-
const
|
|
2714
|
+
const frame2 = runInMountGate(mountGate, () => GridShellBody(props, features, mountGate, serverSnapshot ? "hiddenFrame" : "normal"));
|
|
2509
2715
|
const snapshot2 = <NoHydration>
|
|
2510
2716
|
{serverSnapshot ? (() => {
|
|
2511
2717
|
const snapshotGate = createMountGate();
|
|
2512
2718
|
return runInMountGate(snapshotGate, () => GridShellBody(createSnapshotProps(props), features, snapshotGate, "snapshot"));
|
|
2513
2719
|
})() : null}
|
|
2514
2720
|
</NoHydration>;
|
|
2515
|
-
return [
|
|
2721
|
+
return [frame2, snapshot2];
|
|
2516
2722
|
}
|
|
2517
2723
|
function GridShellBody(props, features, mountGate, mode) {
|
|
2518
2724
|
const serverSideFeature2 = features.serverSide;
|
|
@@ -2624,6 +2830,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2624
2830
|
const viewportWidth = createMemo10(() => view().viewportWidth);
|
|
2625
2831
|
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2626
2832
|
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2833
|
+
const viewMaxBodyPx = createMemo10(() => view().maxBodyPx);
|
|
2627
2834
|
const viewSetters = createGridViewSetters(store);
|
|
2628
2835
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2629
2836
|
const gridRootRef = { current: null };
|
|
@@ -2798,11 +3005,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2798
3005
|
query: serverSideQuerySnapshot().query,
|
|
2799
3006
|
queryKey: serverSideQuerySnapshot().queryKey,
|
|
2800
3007
|
refreshToken: props.serverSideRefreshToken,
|
|
3008
|
+
// 追加(1.5.0): 取り直しの間の見せ方('keep' = 新しい行が届くまで前の行を薄く見せる)。
|
|
3009
|
+
refetch: props.serverSideRefetch,
|
|
2801
3010
|
onLoadError: inOwnTick(props.onServerSideLoadError),
|
|
2802
3011
|
onWriteError: inOwnTick(props.onServerSideWriteError),
|
|
2803
3012
|
// 書き戻しのセル単位の保存状態(pending → ok | failed)を saveStatusController へ。
|
|
2804
3013
|
onWriteStateChange: engine.saveStatus.handle
|
|
2805
3014
|
}));
|
|
3015
|
+
const refetchingRows = createMemo10(() => isServerSide() && serverSide !== void 0 && serverSide.refetching());
|
|
3016
|
+
const editLocked = () => readOnly() || refetchingRows();
|
|
2806
3017
|
const rowModel = createMemo10(() => {
|
|
2807
3018
|
if (!isServerSide() || !serverSide) {
|
|
2808
3019
|
return clientRowModel().rowModel;
|
|
@@ -2864,7 +3075,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2864
3075
|
detailIsExpandable: props.detailRow?.isExpandable,
|
|
2865
3076
|
detailIndexCacheRef: engine.detailIndexCache,
|
|
2866
3077
|
labelDisplay: labelDisplay(),
|
|
2867
|
-
labelRowHeight: labelRowHeightOption()
|
|
3078
|
+
labelRowHeight: labelRowHeightOption(),
|
|
3079
|
+
maxBodyPx: viewMaxBodyPx()
|
|
2868
3080
|
})
|
|
2869
3081
|
);
|
|
2870
3082
|
createShellDevWarnings({
|
|
@@ -2879,6 +3091,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2879
3091
|
detailRowEnabled,
|
|
2880
3092
|
detailExtraCount: () => vertical().detailExtras.length,
|
|
2881
3093
|
detailActive: () => vertical().detailActive,
|
|
3094
|
+
maxBodyPx: () => viewMaxBodyPx() ?? MAX_BODY_PX,
|
|
2882
3095
|
globalFilterText,
|
|
2883
3096
|
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2884
3097
|
});
|
|
@@ -3414,7 +3627,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3414
3627
|
keyOf: resolvedRowKeyGetter(),
|
|
3415
3628
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3416
3629
|
}), "render", "detailKeysPruner");
|
|
3417
|
-
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <=
|
|
3630
|
+
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <= (viewMaxBodyPx() ?? MAX_BODY_PX));
|
|
3418
3631
|
const hasDetailCards = createMemo10(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3419
3632
|
const detailRows = createDetailRowController();
|
|
3420
3633
|
connectController(detailRows, () => ({
|
|
@@ -3587,7 +3800,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3587
3800
|
uiState: ui(),
|
|
3588
3801
|
// イベントの時点の状態は store から読む(core controllers/liveUiState)。
|
|
3589
3802
|
getUiState: store.getState,
|
|
3590
|
-
readOnly:
|
|
3803
|
+
readOnly: editLocked(),
|
|
3591
3804
|
canEditCell: canEditCell(),
|
|
3592
3805
|
rowKeyGetter: resolvedRowKeyGetter(),
|
|
3593
3806
|
onCopied: (selection) => {
|
|
@@ -3622,7 +3835,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3622
3835
|
const fillHandleFeature2 = features.fillHandle;
|
|
3623
3836
|
const fill = fillHandleFeature2?.createFillHandle({
|
|
3624
3837
|
fillHandle: () => props.fillHandle,
|
|
3625
|
-
readOnly,
|
|
3838
|
+
readOnly: editLocked,
|
|
3626
3839
|
isServerSide,
|
|
3627
3840
|
rows,
|
|
3628
3841
|
rowModel,
|
|
@@ -3875,7 +4088,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3875
4088
|
getUiState: store.getState,
|
|
3876
4089
|
rowModel: rowModel(),
|
|
3877
4090
|
visibleColumns: orderedColumns(),
|
|
3878
|
-
readOnly:
|
|
4091
|
+
readOnly: editLocked(),
|
|
3879
4092
|
canEditCell: canEditCell(),
|
|
3880
4093
|
setEditorInitialValue,
|
|
3881
4094
|
dispatch,
|
|
@@ -3908,7 +4121,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3908
4121
|
dispatch,
|
|
3909
4122
|
gridRootRef,
|
|
3910
4123
|
editorActionGuardRef,
|
|
3911
|
-
readOnly:
|
|
4124
|
+
readOnly: editLocked(),
|
|
3912
4125
|
canEditCell: canEditCell(),
|
|
3913
4126
|
localeTexts: localeTexts(),
|
|
3914
4127
|
followsRow: activeRowFollowEnabled(),
|
|
@@ -3921,7 +4134,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3921
4134
|
orderedColumns: orderedColumns(),
|
|
3922
4135
|
uiState: ui(),
|
|
3923
4136
|
getUiState: store.getState,
|
|
3924
|
-
readOnly:
|
|
4137
|
+
readOnly: editLocked(),
|
|
3925
4138
|
canEditCell: canEditCell(),
|
|
3926
4139
|
handleRowsChange: handleRowsChange(),
|
|
3927
4140
|
applyServerSideCellEdits: applyServerSideCellEdits(),
|
|
@@ -3946,7 +4159,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3946
4159
|
{
|
|
3947
4160
|
rowModel: untrack13(rowModel),
|
|
3948
4161
|
columns: untrack13(orderedColumns),
|
|
3949
|
-
readOnly: untrack13(
|
|
4162
|
+
readOnly: untrack13(editLocked),
|
|
3950
4163
|
canEditCell: untrack13(canEditCell)
|
|
3951
4164
|
},
|
|
3952
4165
|
cell
|
|
@@ -4567,6 +4780,24 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4567
4780
|
/>
|
|
4568
4781
|
</Show11>;
|
|
4569
4782
|
};
|
|
4783
|
+
const cellTextOf = (row, column) => {
|
|
4784
|
+
const value = getCellValue2(row, column);
|
|
4785
|
+
return column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4786
|
+
};
|
|
4787
|
+
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4788
|
+
const highlightFind = (content, ranges, findCurrentIndex2) => {
|
|
4789
|
+
if (!splitFind || !ranges || ranges.length === 0) {
|
|
4790
|
+
return content;
|
|
4791
|
+
}
|
|
4792
|
+
return splitFind(content, ranges).map((segment) => {
|
|
4793
|
+
const range = segment.range;
|
|
4794
|
+
return range ? <mark class={["ssg-find-mark", { "ssg-find-mark--current": range.matchIndex === findCurrentIndex2() }]}>
|
|
4795
|
+
{segment.text}
|
|
4796
|
+
</mark> : segment.text;
|
|
4797
|
+
});
|
|
4798
|
+
};
|
|
4799
|
+
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));
|
|
4800
|
+
const cellText = (row, column, ranges, findCurrentIndex2) => highlightFind(cellTextOf(row, column), ranges, findCurrentIndex2);
|
|
4570
4801
|
const renderCellContent = (currentRow, column, cell) => {
|
|
4571
4802
|
if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
4572
4803
|
return renderRowDragHandleCell(currentRow(), cell);
|
|
@@ -4643,29 +4874,20 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4643
4874
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4644
4875
|
});
|
|
4645
4876
|
}
|
|
4646
|
-
const
|
|
4647
|
-
const
|
|
4648
|
-
const
|
|
4649
|
-
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4650
|
-
const highlightFind = (content) => {
|
|
4651
|
-
const ranges = cell.findRanges;
|
|
4652
|
-
if (!splitFind || !ranges || ranges.length === 0) {
|
|
4653
|
-
return content;
|
|
4654
|
-
}
|
|
4655
|
-
return splitFind(content, ranges).map((segment) => {
|
|
4656
|
-
const range = segment.range;
|
|
4657
|
-
return range ? <mark class={["ssg-find-mark", { "ssg-find-mark--current": range.matchIndex === cell.findCurrentIndex }]}>
|
|
4658
|
-
{segment.text}
|
|
4659
|
-
</mark> : segment.text;
|
|
4660
|
-
});
|
|
4661
|
-
};
|
|
4877
|
+
const textOf = (row) => cellTextOf(row, column);
|
|
4878
|
+
const findCurrentIndex2 = () => cell.findCurrentIndex;
|
|
4879
|
+
const highlightCellFind = (content) => highlightFind(content, cell.findRanges, findCurrentIndex2);
|
|
4662
4880
|
const formatRules = conditionalFormatFeature2 ? unbound.conditionalFormat : void 0;
|
|
4663
4881
|
if (formatRules?.dataBar?.showValue === false) {
|
|
4882
|
+
textOf(currentRow());
|
|
4664
4883
|
return null;
|
|
4665
4884
|
}
|
|
4666
4885
|
const chips = formatRules?.chips;
|
|
4667
4886
|
if (conditionalFormatFeature2 && chips) {
|
|
4668
4887
|
const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
|
|
4888
|
+
const row = currentRow();
|
|
4889
|
+
const value = getCellValue2(row, unbound);
|
|
4890
|
+
const text = textOf(row);
|
|
4669
4891
|
const chip = createMemo10(
|
|
4670
4892
|
() => resolveChipSpec2(chips, {
|
|
4671
4893
|
row,
|
|
@@ -4695,11 +4917,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4695
4917
|
}
|
|
4696
4918
|
})
|
|
4697
4919
|
);
|
|
4698
|
-
return <Show11 when={chip()} fallback={<span class="ssg-cell-value">{
|
|
4699
|
-
{(spec) => <GridChip2 spec={spec()}>{
|
|
4920
|
+
return <Show11 when={chip()} fallback={<span class="ssg-cell-value">{highlightCellFind(text)}</span>}>
|
|
4921
|
+
{(spec) => <GridChip2 spec={spec()}>{highlightCellFind(spec().label ?? text)}</GridChip2>}
|
|
4700
4922
|
</Show11>;
|
|
4701
4923
|
}
|
|
4702
|
-
return <span class="ssg-cell-value">{
|
|
4924
|
+
return <span class="ssg-cell-value">{highlightCellFind(textOf(currentRow()))}</span>;
|
|
4703
4925
|
};
|
|
4704
4926
|
const pinnedPaneStyle = (side, width, hasContent) => ({
|
|
4705
4927
|
position: "sticky",
|
|
@@ -4938,6 +5160,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4938
5160
|
activeCellDomId={activeCellDomId}
|
|
4939
5161
|
cellEditorDomId={cellEditorDomId}
|
|
4940
5162
|
renderCellContent={renderCellContent}
|
|
5163
|
+
isTextCellColumn={isTextCellColumn}
|
|
5164
|
+
cellText={cellText}
|
|
4941
5165
|
onRowHeaderPointerDown={pointer.handleRowHeaderPointerDown}
|
|
4942
5166
|
onRowHeaderPointerEnter={pointer.handleRowHeaderPointerEnter}
|
|
4943
5167
|
onRowHeaderPointerLeave={handleRowHeaderPointerLeave}
|
|
@@ -5000,6 +5224,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5000
5224
|
"ssg-root--filling": fill?.filling() ?? false,
|
|
5001
5225
|
"ssg-root--animate-rows": animateRowsActive(),
|
|
5002
5226
|
"ssg-root--dim-readonly": props.dimReadOnlyCells ?? false,
|
|
5227
|
+
// 追加(1.5.0 / serverSideRefetch="keep"): 取り直しの間に前の行を見せている(行を薄くする)。
|
|
5228
|
+
"ssg-root--refetching": refetchingRows(),
|
|
5003
5229
|
"ssg-root--fill-height": heightLayout().fillParent,
|
|
5004
5230
|
// クロスヘア(列見出し / 行番号を選択の色で染める。列の帯は ColumnHoverOverlay)。
|
|
5005
5231
|
"ssg-root--hover-cross": hoverCross()
|
|
@@ -5087,6 +5313,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5087
5313
|
aria-colcount={orderedColumns().length + 1}
|
|
5088
5314
|
aria-multiselectable={enableRangeSelection() ? "true" : void 0}
|
|
5089
5315
|
aria-readonly={readOnly() ? "true" : void 0}
|
|
5316
|
+
aria-busy={refetchingRows() ? "true" : void 0}
|
|
5090
5317
|
class={["ssg-scroll-container", { "ssg-scroll-container--custom-scrollbar": customScrollbar() }]}
|
|
5091
5318
|
style={toSolidStyle(heightLayout().scrollContainerStyle)}
|
|
5092
5319
|
>
|
|
@@ -5232,6 +5459,26 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5232
5459
|
/>
|
|
5233
5460
|
</Show11> : null}
|
|
5234
5461
|
{
|
|
5462
|
+
/* 追加(1.5.0 / serverSideRefetch="keep"): 前の行を見せたまま取り直している間、本体の見えている所を薄くする面と、
|
|
5463
|
+
列見出しの下に流れる線(大きさはスクロールバーを除いた見える範囲。測る前は CSS の left / right / bottom。React 版と同じ)。 */
|
|
5464
|
+
}
|
|
5465
|
+
<Show11 when={refetchingRows()}>
|
|
5466
|
+
<div
|
|
5467
|
+
class="ssg-refetch-veil"
|
|
5468
|
+
aria-hidden="true"
|
|
5469
|
+
style={{
|
|
5470
|
+
top: `${headerHeight()}px`,
|
|
5471
|
+
width: viewportWidth() > 0 ? `${viewportWidth()}px` : void 0,
|
|
5472
|
+
height: viewportHeight() > headerHeight() ? `${viewportHeight() - headerHeight()}px` : void 0
|
|
5473
|
+
}}
|
|
5474
|
+
/>
|
|
5475
|
+
<div
|
|
5476
|
+
class="ssg-refetch-bar"
|
|
5477
|
+
aria-hidden="true"
|
|
5478
|
+
style={{ top: `${headerHeight()}px`, width: viewportWidth() > 0 ? `${viewportWidth()}px` : void 0 }}
|
|
5479
|
+
/>
|
|
5480
|
+
</Show11>
|
|
5481
|
+
{
|
|
5235
5482
|
/* IME オンのままの直接入力の入力受け(imeDirectInput が有効なときだけ)。値 / 位置 / 変換中の見た目はコントローラが
|
|
5236
5483
|
直接扱います。Tab の順番には入れません(タブストップはシェルのまま)。 */
|
|
5237
5484
|
}
|
|
@@ -6832,17 +7079,17 @@ function createFilterManagement(inputs) {
|
|
|
6832
7079
|
let disposed = false;
|
|
6833
7080
|
onCleanup12(() => {
|
|
6834
7081
|
disposed = true;
|
|
6835
|
-
for (const
|
|
6836
|
-
cancelAnimationFrame(
|
|
7082
|
+
for (const frame2 of pendingFrames) {
|
|
7083
|
+
cancelAnimationFrame(frame2);
|
|
6837
7084
|
}
|
|
6838
7085
|
pendingFrames.clear();
|
|
6839
7086
|
});
|
|
6840
7087
|
const scheduleFrame = (callback) => {
|
|
6841
|
-
const
|
|
6842
|
-
pendingFrames.delete(
|
|
7088
|
+
const frame2 = requestAnimationFrame(() => {
|
|
7089
|
+
pendingFrames.delete(frame2);
|
|
6843
7090
|
callback();
|
|
6844
7091
|
});
|
|
6845
|
-
pendingFrames.add(
|
|
7092
|
+
pendingFrames.add(frame2);
|
|
6846
7093
|
};
|
|
6847
7094
|
const jumpToColumnFilter = (columnKey) => untrack15(() => {
|
|
6848
7095
|
const scrollElement = inputs.scrollContainerRef.current;
|
|
@@ -7260,7 +7507,7 @@ import { splitTextByFindRanges } from "@ishibashi0112/spreadsheet-grid-core/inte
|
|
|
7260
7507
|
import { DEFAULT_FIND_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7261
7508
|
|
|
7262
7509
|
// src/view/GridFindBar.tsx
|
|
7263
|
-
import { createRenderEffect as
|
|
7510
|
+
import { createRenderEffect as createRenderEffect6, createSignal as createSignal14, onSettled as onSettled7, untrack as untrack17 } from "solid-js";
|
|
7264
7511
|
import { isImeComposingKeyEvent as isImeComposingKeyEvent3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
7265
7512
|
function GridFindBar(props) {
|
|
7266
7513
|
const texts = useFeatureLocaleText();
|
|
@@ -7271,7 +7518,7 @@ function GridFindBar(props) {
|
|
|
7271
7518
|
element?.focus();
|
|
7272
7519
|
element?.select();
|
|
7273
7520
|
});
|
|
7274
|
-
|
|
7521
|
+
createRenderEffect6(
|
|
7275
7522
|
() => [input(), props.snapshot.query],
|
|
7276
7523
|
([element, query]) => {
|
|
7277
7524
|
if (element && element.value !== query) {
|
|
@@ -7803,6 +8050,8 @@ function createServerSide(args) {
|
|
|
7803
8050
|
rowCount: () => snapshot2().rowCount,
|
|
7804
8051
|
loadError: createMemo25(() => snapshot2().loadError),
|
|
7805
8052
|
writeError: createMemo25(() => snapshot2().writeError),
|
|
8053
|
+
// 追加(1.5.0 / serverSideRefetch="keep"): 取り直しの間、前の行を見せているか。
|
|
8054
|
+
refetching: createMemo25(() => snapshot2().refetching),
|
|
7806
8055
|
isRowLoaded: controller.isRowLoaded,
|
|
7807
8056
|
requestRange,
|
|
7808
8057
|
refresh: controller.refresh,
|