@ishibashi0112/spreadsheet-grid-solid 1.5.0 → 1.6.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 +99 -29
- package/README.md +4 -4
- package/dist/devWarnings.d.ts +1 -0
- package/dist/features/columnGroups.d.ts +2 -0
- package/dist/features/types.d.ts +15 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2269 -1843
- package/dist/model/gridTypes.d.ts +4 -0
- package/dist/primitives/columnReorder.d.ts +1 -0
- package/dist/primitives/filterManagement.d.ts +1 -0
- package/dist/source/chunks/{toolPanelViews-HIQGRX3N.jsx → toolPanelViews-BRH5PCOI.jsx} +84 -8
- package/dist/source/index.jsx +891 -386
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BISN9iaG.js → toolPanelViews-DMEVr1KV.js} +197 -138
- package/dist/view/ColumnChooserPanel.d.ts +9 -1
- package/dist/view/ColumnFilterPopoverHost.d.ts +1 -0
- package/dist/view/ColumnMenuPopover.d.ts +6 -0
- package/dist/view/GridBodyLayer.d.ts +2 -0
- package/dist/view/GridColumnGroupHeader.d.ts +42 -0
- package/dist/view/GridHeaderRow.d.ts +4 -0
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +1 -0
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";
|
|
@@ -388,12 +388,18 @@ var HEADER_INLINE_ACTIONS_MIN_WIDTH = 120;
|
|
|
388
388
|
var SVG_NOT_FOCUSABLE = { focusable: "false" };
|
|
389
389
|
function GridHeaderRow(props) {
|
|
390
390
|
const texts = useGridLocaleText();
|
|
391
|
+
const stickyTop = () => props.stickyTop ?? 0;
|
|
391
392
|
return <div
|
|
392
393
|
data-pane={props.pane}
|
|
393
394
|
role="row"
|
|
394
|
-
aria-rowindex={1}
|
|
395
|
-
class={["ssg-header-row", props.slots.headerRow?.className]}
|
|
396
|
-
style={{
|
|
395
|
+
aria-rowindex={props.ariaRowIndex ?? 1}
|
|
396
|
+
class={["ssg-header-row", { "ssg-header-row--grouped": stickyTop() > 0 }, props.slots.headerRow?.className]}
|
|
397
|
+
style={{
|
|
398
|
+
...props.slots.headerRow?.style,
|
|
399
|
+
height: px(props.headerHeight),
|
|
400
|
+
// 追加(1.6.0 / 列見出しの多段化): グループの段の下に留める。
|
|
401
|
+
...stickyTop() > 0 ? { top: px(stickyTop()) } : {}
|
|
402
|
+
}}
|
|
397
403
|
>
|
|
398
404
|
<Show when={props.ownsRowHeader}>
|
|
399
405
|
<div
|
|
@@ -418,7 +424,9 @@ function GridHeaderRow(props) {
|
|
|
418
424
|
...props.slots.cornerCell?.style,
|
|
419
425
|
width: px(props.rowHeaderWidth),
|
|
420
426
|
"min-width": px(props.rowHeaderWidth),
|
|
421
|
-
height: px(props.headerHeight),
|
|
427
|
+
height: px(props.headerHeight + stickyTop()),
|
|
428
|
+
// 追加(1.6.0 / 列見出しの多段化): グループの段の高さぶん上へ伸ばし、中身は一番下の段に置く。
|
|
429
|
+
...stickyTop() > 0 ? { top: px(-stickyTop()), "padding-top": px(stickyTop()) } : {},
|
|
422
430
|
cursor: props.filteredRowsLength > 0 && props.visibleColumnsLength > 0 ? "pointer" : "default"
|
|
423
431
|
}}
|
|
424
432
|
>
|
|
@@ -443,6 +451,7 @@ function GridHeaderRow(props) {
|
|
|
443
451
|
const isSynthetic = () => isSyntheticColumnKey(column().key);
|
|
444
452
|
const isDetailToggleColumn = () => column().key === DETAIL_TOGGLE_COLUMN_KEY || column().key === ROW_DRAG_HANDLE_COLUMN_KEY;
|
|
445
453
|
const headerAlign = () => column().headerAlign ?? column().align;
|
|
454
|
+
const extend = () => props.getHeaderSpanRows ? props.getHeaderSpanRows(column().key) * (props.groupRowHeight ?? 0) : 0;
|
|
446
455
|
const headerContext = {
|
|
447
456
|
get colIndex() {
|
|
448
457
|
return colIndex();
|
|
@@ -502,7 +511,8 @@ function GridHeaderRow(props) {
|
|
|
502
511
|
left: px(props.leadingWidth + entry().paneLocalStart),
|
|
503
512
|
width: px(size()),
|
|
504
513
|
"min-width": px(size()),
|
|
505
|
-
height: px(props.headerHeight)
|
|
514
|
+
height: px(props.headerHeight + extend()),
|
|
515
|
+
...extend() > 0 ? { top: px(-extend()), "padding-top": px(extend()) } : {}
|
|
506
516
|
}}
|
|
507
517
|
>
|
|
508
518
|
<div
|
|
@@ -540,7 +550,7 @@ function GridHeaderRow(props) {
|
|
|
540
550
|
</span>
|
|
541
551
|
</Show>
|
|
542
552
|
</div>
|
|
543
|
-
<div class="ssg-header-actions">
|
|
553
|
+
<div class="ssg-header-actions" style={extend() > 0 ? { top: px(extend()), height: px(props.headerHeight) } : void 0}>
|
|
544
554
|
{
|
|
545
555
|
/* 列の並べ替えの grip(合成列には出さない)。ホバーで出る(CSS)。 */
|
|
546
556
|
}
|
|
@@ -599,7 +609,7 @@ function GridHeaderRow(props) {
|
|
|
599
609
|
|
|
600
610
|
// src/view/GridBodyLayer.tsx
|
|
601
611
|
import { For as For2, Show as Show2, createMemo as createMemo5, createRenderEffect, untrack as untrack3 } from "solid-js";
|
|
602
|
-
import { getCellValue, isCellEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
612
|
+
import { getCellValue, isCellEditable, isColumnEditable } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
603
613
|
import { resolveIsRowSelected } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/rowSelection";
|
|
604
614
|
import { resolveDataRowNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
605
615
|
import { shouldMarkCellOverflowTooltip } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellOverflowTooltip";
|
|
@@ -719,6 +729,8 @@ var markReusedRow = (element) => {
|
|
|
719
729
|
// src/view/GridBodyLayer.tsx
|
|
720
730
|
var NO_SELECTED_COLUMNS = [-1, -1];
|
|
721
731
|
var EMPTY_SLOT = resolveSlotProps(void 0);
|
|
732
|
+
var NO_VALUE = () => null;
|
|
733
|
+
var NO_SLOT = () => EMPTY_SLOT;
|
|
722
734
|
var joinClasses = (...parts) => {
|
|
723
735
|
let out = "";
|
|
724
736
|
for (const part of parts) {
|
|
@@ -729,10 +741,34 @@ var joinClasses = (...parts) => {
|
|
|
729
741
|
return out;
|
|
730
742
|
};
|
|
731
743
|
var isPlainCellColumn = (column) => column.cellClassName === void 0 && !column.cellNote && !hasCellValidation(column) && column.conditionalFormat?.dataBar === void 0 && column.conditionalFormat?.colorScale === void 0 && column.autoHeight !== true;
|
|
732
|
-
var cellKey = (entry) => `${entry.column.key}\0${isPlainCellColumn(entry.column) ? "plain" : "decorated"}${entry.column.renderCell ? "+render" : ""}`;
|
|
733
744
|
var CHIP_COMPACT_MAX_WIDTH = 80;
|
|
734
745
|
function GridBodyLayer(props) {
|
|
735
746
|
const texts = useGridLocaleText();
|
|
747
|
+
const cellShapes = /* @__PURE__ */ new WeakMap();
|
|
748
|
+
const cellShapeOf = (column) => {
|
|
749
|
+
const known = cellShapes.get(column);
|
|
750
|
+
if (known !== void 0 && known.renderCell === column.renderCell) {
|
|
751
|
+
return known.shape;
|
|
752
|
+
}
|
|
753
|
+
const shape = !isPlainCellColumn(column) ? "decorated" : props.isTextCellColumn(column) ? "text" : "plain";
|
|
754
|
+
cellShapes.set(column, { shape, renderCell: column.renderCell });
|
|
755
|
+
return shape;
|
|
756
|
+
};
|
|
757
|
+
const cellKey = (entry) => `${entry.column.key}\0${cellShapeOf(entry.column)}${entry.column.renderCell ? "+render" : ""}`;
|
|
758
|
+
const editPermission = createMemo5(
|
|
759
|
+
() => ({ readOnly: props.readOnly, canEditCell: props.canEditCell }),
|
|
760
|
+
{ equals: (a, b) => a.readOnly === b.readOnly && a.canEditCell === b.canEditCell }
|
|
761
|
+
);
|
|
762
|
+
const cellEnv = createMemo5(
|
|
763
|
+
() => ({
|
|
764
|
+
showCellOverflowTooltip: props.showCellOverflowTooltip,
|
|
765
|
+
bodyCellSlot: props.slots.bodyCell,
|
|
766
|
+
leadingWidth: props.leadingWidth
|
|
767
|
+
}),
|
|
768
|
+
{
|
|
769
|
+
equals: (a, b) => a.showCellOverflowTooltip === b.showCellOverflowTooltip && a.bodyCellSlot === b.bodyCellSlot && a.leadingWidth === b.leadingWidth
|
|
770
|
+
}
|
|
771
|
+
);
|
|
736
772
|
const slotKindOf = (row) => {
|
|
737
773
|
if (row.skeleton) {
|
|
738
774
|
return "skeleton";
|
|
@@ -841,7 +877,7 @@ function GridBodyLayer(props) {
|
|
|
841
877
|
},
|
|
842
878
|
{ name: "reusedRow" }
|
|
843
879
|
);
|
|
844
|
-
const sourceRowIndex = () => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex();
|
|
880
|
+
const sourceRowIndex = createMemo5(() => props.rowModel.getSourceIndex(rowIndex()) ?? rowIndex());
|
|
845
881
|
const rowSize = createMemo5(() => item().size ?? props.rowHeight);
|
|
846
882
|
const isRowChecked = createMemo5(
|
|
847
883
|
() => props.enableRowSelection ? resolveIsRowSelected(props.rowSelectionState, rowKey()) : false
|
|
@@ -891,6 +927,73 @@ function GridBodyLayer(props) {
|
|
|
891
927
|
)
|
|
892
928
|
);
|
|
893
929
|
const rowNumber = () => props.labelViewIndexes ? resolveDataRowNumber(props.labelViewIndexes, rowIndex()) : rowIndex() + 1;
|
|
930
|
+
const textCellBase = createMemo5(() => {
|
|
931
|
+
const slot = rowSlot();
|
|
932
|
+
const bodyCell = cellEnv().bodyCellSlot;
|
|
933
|
+
return {
|
|
934
|
+
className: joinClasses("ssg-body-cell", slot.className, bodyCell?.className),
|
|
935
|
+
style: bodyCell?.style || slot.style ? { ...bodyCell?.style, ...slot.style } : void 0
|
|
936
|
+
};
|
|
937
|
+
});
|
|
938
|
+
const renderTextCell = (entry) => {
|
|
939
|
+
const unbound = createMemo5(() => entry().column);
|
|
940
|
+
const column = () => unbound();
|
|
941
|
+
const colIndex = () => entry().logicalIndex;
|
|
942
|
+
const size = () => entry().paneLocalSize;
|
|
943
|
+
const isActive = () => activeCol() === colIndex();
|
|
944
|
+
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
945
|
+
const readOnlyCell = () => {
|
|
946
|
+
const env = editPermission();
|
|
947
|
+
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
948
|
+
sourceRowIndex: sourceRowIndex(),
|
|
949
|
+
rowKey: rowKey()
|
|
950
|
+
});
|
|
951
|
+
};
|
|
952
|
+
const alignTop = () => rowAutoHeight() && rowSize() > props.rowHeight && (column().verticalAlign ?? props.verticalAlign ?? "center") === "top";
|
|
953
|
+
const findRanges = createMemoWhen(
|
|
954
|
+
() => rowFindHits() !== void 0,
|
|
955
|
+
() => rowFindHits()?.get(colIndex()),
|
|
956
|
+
void 0
|
|
957
|
+
);
|
|
958
|
+
const cell = () => ({ row: rowIndex(), col: colIndex() });
|
|
959
|
+
return <div
|
|
960
|
+
role="gridcell"
|
|
961
|
+
aria-colindex={colIndex() + 2}
|
|
962
|
+
aria-selected={isSelected() ? "true" : "false"}
|
|
963
|
+
aria-readonly={readOnlyCell() ? "true" : void 0}
|
|
964
|
+
id={isActive() ? props.activeCellDomId : void 0}
|
|
965
|
+
aria-owns={editingCol() === colIndex() ? props.cellEditorDomId : void 0}
|
|
966
|
+
data-ssg-col-key={column().key}
|
|
967
|
+
data-ssg-tooltip-overflow={cellEnv().showCellOverflowTooltip ? "" : void 0}
|
|
968
|
+
class={joinClasses(
|
|
969
|
+
textCellBase().className,
|
|
970
|
+
column().align === "center" && "ssg-body-cell--align-center",
|
|
971
|
+
column().align === "right" && "ssg-body-cell--align-right",
|
|
972
|
+
alignTop() && "ssg-body-cell--valign-top",
|
|
973
|
+
readOnlyCell() && !isSelected() && "ssg-body-cell--readonly",
|
|
974
|
+
isHovered() && "ssg-body-cell--row-hovered"
|
|
975
|
+
)}
|
|
976
|
+
onPointerDown={(event) => props.onCellPointerDown(cell(), event)}
|
|
977
|
+
onPointerEnter={(event) => props.onCellPointerEnter(cell(), event)}
|
|
978
|
+
onClick={(event) => props.onCellClick(cell(), event)}
|
|
979
|
+
onDblClick={(event) => props.onCellDoubleClick(cell(), event)}
|
|
980
|
+
ref={markClickTarget}
|
|
981
|
+
style={{
|
|
982
|
+
...textCellBase().style,
|
|
983
|
+
left: px(cellEnv().leadingWidth + entry().paneLocalStart),
|
|
984
|
+
width: px(size()),
|
|
985
|
+
"min-width": px(size()),
|
|
986
|
+
height: px(rowSize()),
|
|
987
|
+
"word-break": column().wordBreak,
|
|
988
|
+
"line-break": column().lineBreak,
|
|
989
|
+
"z-index": isActive() ? 3 : 1
|
|
990
|
+
}}
|
|
991
|
+
>
|
|
992
|
+
<span class="ssg-cell-value">
|
|
993
|
+
{props.cellText(currentRow(), column(), findRanges(), rowFindCurrent)}
|
|
994
|
+
</span>
|
|
995
|
+
</div>;
|
|
996
|
+
};
|
|
894
997
|
return <div
|
|
895
998
|
ref={(element) => {
|
|
896
999
|
rowElement = element;
|
|
@@ -948,7 +1051,11 @@ function GridBodyLayer(props) {
|
|
|
948
1051
|
</Show2>
|
|
949
1052
|
<For2 each={props.entries} keyed={cellKey}>
|
|
950
1053
|
{(entry) => {
|
|
951
|
-
const
|
|
1054
|
+
const shape = untrack3(() => cellShapeOf(entry().column));
|
|
1055
|
+
if (shape === "text") {
|
|
1056
|
+
return renderTextCell(entry);
|
|
1057
|
+
}
|
|
1058
|
+
const plain = shape === "plain";
|
|
952
1059
|
const unbound = createMemo5(() => entry().column);
|
|
953
1060
|
const column = () => unbound();
|
|
954
1061
|
const colIndex = createMemo5(() => entry().logicalIndex);
|
|
@@ -956,14 +1063,13 @@ function GridBodyLayer(props) {
|
|
|
956
1063
|
const isActive = () => activeCol() === colIndex();
|
|
957
1064
|
const isEditing = () => editingCol() === colIndex();
|
|
958
1065
|
const isSelected = () => isRowSelected() || selectedColStart() >= 0 && colIndex() >= selectedColStart() && colIndex() <= selectedColEnd();
|
|
959
|
-
const readOnlyCell = () =>
|
|
960
|
-
|
|
961
|
-
rowIndex(),
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
);
|
|
1066
|
+
const readOnlyCell = () => {
|
|
1067
|
+
const env = editPermission();
|
|
1068
|
+
return !isColumnEditable(env.readOnly, unbound()) || env.canEditCell !== void 0 && !isCellEditable(env, rowIndex(), colIndex(), currentRow(), unbound(), {
|
|
1069
|
+
sourceRowIndex: sourceRowIndex(),
|
|
1070
|
+
rowKey: rowKey()
|
|
1071
|
+
});
|
|
1072
|
+
};
|
|
967
1073
|
const value = () => getCellValue(currentRow(), unbound());
|
|
968
1074
|
const findRanges = createMemoWhen(
|
|
969
1075
|
() => rowFindHits()?.has(colIndex()) === true,
|
|
@@ -1003,7 +1109,7 @@ function GridBodyLayer(props) {
|
|
|
1003
1109
|
}
|
|
1004
1110
|
};
|
|
1005
1111
|
const needsStyleContext = () => typeof column().cellClassName === "function" || !!column().cellNote;
|
|
1006
|
-
const styleContext = plain ?
|
|
1112
|
+
const styleContext = plain ? NO_VALUE : createMemoWhen(
|
|
1007
1113
|
needsStyleContext,
|
|
1008
1114
|
() => ({
|
|
1009
1115
|
row: currentRow(),
|
|
@@ -1020,7 +1126,7 @@ function GridBodyLayer(props) {
|
|
|
1020
1126
|
}),
|
|
1021
1127
|
null
|
|
1022
1128
|
);
|
|
1023
|
-
const conditionalCell = plain ?
|
|
1129
|
+
const conditionalCell = plain ? NO_SLOT : createMemoWhen(
|
|
1024
1130
|
() => column().cellClassName !== void 0,
|
|
1025
1131
|
() => {
|
|
1026
1132
|
const cellClassName = column().cellClassName;
|
|
@@ -1032,7 +1138,7 @@ function GridBodyLayer(props) {
|
|
|
1032
1138
|
resolveSlotProps(void 0)
|
|
1033
1139
|
);
|
|
1034
1140
|
const formatRules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
1035
|
-
const dataBar = plain ?
|
|
1141
|
+
const dataBar = plain ? NO_VALUE : createMemoWhen(
|
|
1036
1142
|
() => formatRules()?.dataBar !== void 0,
|
|
1037
1143
|
() => {
|
|
1038
1144
|
const feature = props.conditionalFormat;
|
|
@@ -1041,7 +1147,7 @@ function GridBodyLayer(props) {
|
|
|
1041
1147
|
},
|
|
1042
1148
|
null
|
|
1043
1149
|
);
|
|
1044
|
-
const scaleBackground = plain ?
|
|
1150
|
+
const scaleBackground = plain ? NO_VALUE : createMemoWhen(
|
|
1045
1151
|
() => formatRules()?.colorScale !== void 0,
|
|
1046
1152
|
() => {
|
|
1047
1153
|
const feature = props.conditionalFormat;
|
|
@@ -1059,12 +1165,12 @@ function GridBodyLayer(props) {
|
|
|
1059
1165
|
const rules = formatRules()?.dataBar;
|
|
1060
1166
|
return bar ? bar.negative ? rules?.negativeColor : rules?.color : void 0;
|
|
1061
1167
|
};
|
|
1062
|
-
const invalidMessage = plain ?
|
|
1168
|
+
const invalidMessage = plain ? NO_VALUE : createMemoWhen(
|
|
1063
1169
|
() => !!props.showValidationMarks && hasCellValidation(unbound()),
|
|
1064
1170
|
() => getInvalidMessage(unbound(), currentRow(), value(), texts()),
|
|
1065
1171
|
null
|
|
1066
1172
|
);
|
|
1067
|
-
const cellNote = plain ?
|
|
1173
|
+
const cellNote = plain ? NO_VALUE : createMemoWhen(
|
|
1068
1174
|
() => !!column().cellNote,
|
|
1069
1175
|
() => {
|
|
1070
1176
|
const note = column().cellNote;
|
|
@@ -1086,7 +1192,7 @@ function GridBodyLayer(props) {
|
|
|
1086
1192
|
const isAutoHeightCell = () => (autoHeightFlags() & 1) !== 0;
|
|
1087
1193
|
const alignTop = () => (autoHeightFlags() & 2) !== 0;
|
|
1088
1194
|
const markOverflowTooltip = () => shouldMarkCellOverflowTooltip({
|
|
1089
|
-
enabled:
|
|
1195
|
+
enabled: cellEnv().showCellOverflowTooltip,
|
|
1090
1196
|
isAutoHeightCell: isAutoHeightCell(),
|
|
1091
1197
|
hasRenderCell: column().renderCell !== void 0
|
|
1092
1198
|
});
|
|
@@ -1134,7 +1240,7 @@ function GridBodyLayer(props) {
|
|
|
1134
1240
|
"ssg-body-cell",
|
|
1135
1241
|
rowSlot().className,
|
|
1136
1242
|
conditionalCell().className,
|
|
1137
|
-
|
|
1243
|
+
cellEnv().bodyCellSlot?.className,
|
|
1138
1244
|
column().align === "center" && "ssg-body-cell--align-center",
|
|
1139
1245
|
column().align === "right" && "ssg-body-cell--align-right",
|
|
1140
1246
|
dataBar() !== null && "ssg-body-cell--cf-bar",
|
|
@@ -1158,11 +1264,11 @@ function GridBodyLayer(props) {
|
|
|
1158
1264
|
onDblClick={(event) => props.onCellDoubleClick(cell(), event)}
|
|
1159
1265
|
ref={markClickTarget}
|
|
1160
1266
|
style={{
|
|
1161
|
-
...
|
|
1267
|
+
...cellEnv().bodyCellSlot?.style,
|
|
1162
1268
|
...scaleBackground() !== null ? { "background-color": scaleBackground() } : null,
|
|
1163
1269
|
...rowSlot().style,
|
|
1164
1270
|
...conditionalCell().style,
|
|
1165
|
-
left: px(
|
|
1271
|
+
left: px(cellEnv().leadingWidth + entry().paneLocalStart),
|
|
1166
1272
|
width: px(size()),
|
|
1167
1273
|
"min-width": px(size()),
|
|
1168
1274
|
height: px(rowSize()),
|
|
@@ -2310,7 +2416,7 @@ function DefaultGridBottomBar(props) {
|
|
|
2310
2416
|
|
|
2311
2417
|
// src/devWarnings.ts
|
|
2312
2418
|
import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
|
|
2313
|
-
import { AUTO_HEIGHT_MAX_ROWS
|
|
2419
|
+
import { AUTO_HEIGHT_MAX_ROWS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
2314
2420
|
import { createInertExportCommands } from "@ishibashi0112/spreadsheet-grid-core/internal/engine/features";
|
|
2315
2421
|
import {
|
|
2316
2422
|
warnUnregisteredFeatureMethod,
|
|
@@ -2335,6 +2441,7 @@ var FEATURE_PROPS = {
|
|
|
2335
2441
|
{ prop: "pinnedTopRows", isUsed: (props) => (props.pinnedTopRows?.length ?? 0) > 0 },
|
|
2336
2442
|
{ prop: "pinnedBottomRows", isUsed: (props) => (props.pinnedBottomRows?.length ?? 0) > 0 }
|
|
2337
2443
|
],
|
|
2444
|
+
columnGroups: [{ prop: "columnGroups", isUsed: (props) => (props.columnGroups?.length ?? 0) > 0 }],
|
|
2338
2445
|
columnAutosize: [
|
|
2339
2446
|
{
|
|
2340
2447
|
prop: "autoSizeColumns",
|
|
@@ -2511,8 +2618,8 @@ function createShellDevWarningsInDev(args) {
|
|
|
2511
2618
|
warnOncePerGrid(
|
|
2512
2619
|
warned,
|
|
2513
2620
|
"detailMaxBody",
|
|
2514
|
-
`[SpreadsheetGrid] \u5C55\u958B\u884C\u306F\u8AD6\u7406\u5168\u9AD8(\u884C\u9AD8\u5408\u8A08 + \u5E2F\u9AD8)\u304C ${
|
|
2515
|
-
[SpreadsheetGrid] Detail rows are drawn only while the total height (rows + details) is at most ${
|
|
2621
|
+
`[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
|
|
2622
|
+
[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.`
|
|
2516
2623
|
);
|
|
2517
2624
|
}
|
|
2518
2625
|
}
|
|
@@ -2710,12 +2817,22 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2710
2817
|
);
|
|
2711
2818
|
const pinnedTopCount = () => pinnedTop()?.length ?? 0;
|
|
2712
2819
|
const pinnedBottomCount = () => pinnedBottom()?.length ?? 0;
|
|
2713
|
-
const
|
|
2820
|
+
const columnGroupsFeature2 = features.columnGroups;
|
|
2821
|
+
const columnKeys = createMemo10(() => props.columns.map((column) => column.key), {
|
|
2822
|
+
equals: (a, b) => a.length === b.length && a.every((key, index) => key === b[index])
|
|
2823
|
+
});
|
|
2824
|
+
const columnGroupTree = createMemo10(
|
|
2825
|
+
() => columnGroupsFeature2 && props.columnGroups ? columnGroupsFeature2.buildColumnGroupTree(props.columnGroups, new Set(columnKeys())) : null
|
|
2826
|
+
);
|
|
2827
|
+
const columnGroupDepth = () => columnGroupTree()?.depth ?? 0;
|
|
2828
|
+
const columnGroupRowHeight = () => Math.max(0, props.columnGroupHeaderHeight ?? columnHeaderHeight());
|
|
2829
|
+
const columnGroupHeight = () => columnGroupDepth() * columnGroupRowHeight();
|
|
2830
|
+
const headerHeight = createMemo10(() => columnGroupHeight() + columnHeaderHeight() + pinnedTopCount() * rowHeight());
|
|
2714
2831
|
const footerHeight = createMemo10(() => totalRowHeight() + pinnedBottomCount() * rowHeight());
|
|
2715
2832
|
const pinnedBelowTotal = createMemo10(
|
|
2716
2833
|
() => props.pinnedBottomRowsPlacement === "belowTotal" && pinnedBottom() !== null && totalRowEnabled()
|
|
2717
2834
|
);
|
|
2718
|
-
const stickyTopHeight = () => pinnedTopCount() > 0 ? headerHeight() : 0;
|
|
2835
|
+
const stickyTopHeight = () => pinnedTopCount() > 0 || columnGroupHeight() > 0 ? headerHeight() : 0;
|
|
2719
2836
|
const engine = createGridEngine({
|
|
2720
2837
|
features,
|
|
2721
2838
|
initialState: untrack13(() => props.initialState),
|
|
@@ -2734,6 +2851,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2734
2851
|
const viewportWidth = createMemo10(() => view().viewportWidth);
|
|
2735
2852
|
const viewportHeight = createMemo10(() => view().viewportHeight);
|
|
2736
2853
|
const viewScrollTop = createMemo10(() => view().scrollTop);
|
|
2854
|
+
const viewMaxBodyPx = createMemo10(() => view().maxBodyPx);
|
|
2737
2855
|
const viewSetters = createGridViewSetters(store);
|
|
2738
2856
|
const { setHoveredColumnIndex, setIsCornerHovered, setEditorInitialValue } = viewSetters;
|
|
2739
2857
|
const gridRootRef = { current: null };
|
|
@@ -2755,7 +2873,34 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2755
2873
|
const shell = gridRootRef.current;
|
|
2756
2874
|
return registerPopupContainer([shell, shell?.closest(".ssg-root")], getPopupContainer);
|
|
2757
2875
|
});
|
|
2758
|
-
const
|
|
2876
|
+
const closedColumnGroupKeys = createMemo10(() => ui().closedColumnGroupKeys);
|
|
2877
|
+
const collapseColumns = createMemo10(() => {
|
|
2878
|
+
const tree = columnGroupTree();
|
|
2879
|
+
const closed = closedColumnGroupKeys();
|
|
2880
|
+
return columnGroupsFeature2 && tree && tree.hasCollapsible ? { resolve: (displayColumns) => columnGroupsFeature2.resolveCollapsedColumnKeys(tree, closed, displayColumns) } : null;
|
|
2881
|
+
});
|
|
2882
|
+
const columnGroupFollow = createMemo10(() => {
|
|
2883
|
+
const tree = columnGroupTree();
|
|
2884
|
+
return columnGroupsFeature2 && tree && tree.hasCollapsible ? {
|
|
2885
|
+
collapseFor: (closedKeys) => (displayColumns) => columnGroupsFeature2.resolveCollapsedColumnKeys(tree, closedKeys, displayColumns),
|
|
2886
|
+
remap: (state, prevKeys, nextKeys) => columnGroupsFeature2.followColumnKeysAfterColumnGroupChange(tree, state, prevKeys, nextKeys)
|
|
2887
|
+
} : null;
|
|
2888
|
+
});
|
|
2889
|
+
const columnTitles = createMemo10(() => {
|
|
2890
|
+
const tree = columnGroupTree();
|
|
2891
|
+
return columnGroupsFeature2 && tree ? columnGroupsFeature2.resolveColumnGroupDistinctTitles(tree, columns()) : null;
|
|
2892
|
+
});
|
|
2893
|
+
const placeUnpinnedColumn = createMemo10(() => {
|
|
2894
|
+
const tree = columnGroupTree();
|
|
2895
|
+
return columnGroupsFeature2 && tree ? (nextColumns, columnKey) => columnGroupsFeature2.placeUnpinnedColumnInGroup(tree, nextColumns, columnKey) : null;
|
|
2896
|
+
});
|
|
2897
|
+
const columnResolution = createMemo10(
|
|
2898
|
+
() => engine.resolveColumns({
|
|
2899
|
+
...columnInputs(),
|
|
2900
|
+
collapseColumns: collapseColumns()?.resolve ?? null,
|
|
2901
|
+
columnGroupFollow: columnGroupFollow()
|
|
2902
|
+
})
|
|
2903
|
+
);
|
|
2759
2904
|
const visibleColumns = () => columnResolution().visibleColumns;
|
|
2760
2905
|
const orderedColumns = () => columnResolution().orderedColumns;
|
|
2761
2906
|
const rowGroupingActive = () => columnResolution().rowGroupingActive;
|
|
@@ -2782,6 +2927,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2782
2927
|
}),
|
|
2783
2928
|
{ name: "reconcileColumnWidths" }
|
|
2784
2929
|
);
|
|
2930
|
+
if (columnGroupsFeature2) {
|
|
2931
|
+
createEffect4(
|
|
2932
|
+
() => [props.columnGroups, columns()],
|
|
2933
|
+
([definitions, next]) => {
|
|
2934
|
+
columnGroupsFeature2.warnUnknownColumnGroupKeys(definitions, next);
|
|
2935
|
+
},
|
|
2936
|
+
{ name: "warnUnknownColumnGroupKeys" }
|
|
2937
|
+
);
|
|
2938
|
+
}
|
|
2785
2939
|
const labelRowFeature2 = features.labelRow;
|
|
2786
2940
|
const labelIsLabelRow = createMemo10(() => props.labelRow?.isLabelRow);
|
|
2787
2941
|
const labelGetLabel = createMemo10(() => props.labelRow?.getLabel);
|
|
@@ -2978,7 +3132,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2978
3132
|
detailIsExpandable: props.detailRow?.isExpandable,
|
|
2979
3133
|
detailIndexCacheRef: engine.detailIndexCache,
|
|
2980
3134
|
labelDisplay: labelDisplay(),
|
|
2981
|
-
labelRowHeight: labelRowHeightOption()
|
|
3135
|
+
labelRowHeight: labelRowHeightOption(),
|
|
3136
|
+
maxBodyPx: viewMaxBodyPx()
|
|
2982
3137
|
})
|
|
2983
3138
|
);
|
|
2984
3139
|
createShellDevWarnings({
|
|
@@ -2993,6 +3148,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
2993
3148
|
detailRowEnabled,
|
|
2994
3149
|
detailExtraCount: () => vertical().detailExtras.length,
|
|
2995
3150
|
detailActive: () => vertical().detailActive,
|
|
3151
|
+
maxBodyPx: () => viewMaxBodyPx() ?? MAX_BODY_PX,
|
|
2996
3152
|
globalFilterText,
|
|
2997
3153
|
columnFilterCount: () => Object.keys(columnFilters()).length
|
|
2998
3154
|
});
|
|
@@ -3528,7 +3684,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
3528
3684
|
keyOf: resolvedRowKeyGetter(),
|
|
3529
3685
|
setExpandedKeys: (keys) => dispatch(gridActions.setExpandedDetailRowKeys(keys))
|
|
3530
3686
|
}), "render", "detailKeysPruner");
|
|
3531
|
-
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <=
|
|
3687
|
+
const detailDrawable = createMemo10(() => vertical().baseRowMetrics.totalBodyHeight <= (viewMaxBodyPx() ?? MAX_BODY_PX));
|
|
3532
3688
|
const hasDetailCards = createMemo10(() => detailRowEnabled() && vertical().detailEntries.length > 0);
|
|
3533
3689
|
const detailRows = createDetailRowController();
|
|
3534
3690
|
connectController(detailRows, () => ({
|
|
@@ -4143,7 +4299,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4143
4299
|
closeColumnMenu: columnMenu?.close ?? noop3,
|
|
4144
4300
|
openToolPanel,
|
|
4145
4301
|
openColumnFilterPopover: filterPopover?.open ?? noop3,
|
|
4146
|
-
runAutosize: columnAutosize?.runAutosize
|
|
4302
|
+
runAutosize: columnAutosize?.runAutosize,
|
|
4303
|
+
// 列メニューで固定を外した列を同じグループの中央の列の隣へ置く(1.6.0 の実アプリの点検 G3-04。React 版と同じ)。
|
|
4304
|
+
placeUnpinnedColumn: placeUnpinnedColumn()
|
|
4147
4305
|
}), "render", "columnCommands");
|
|
4148
4306
|
const filterManagement = features.filtering?.createFilterManagement({
|
|
4149
4307
|
columns,
|
|
@@ -4158,7 +4316,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4158
4316
|
rightPaneTotalWidth: () => paneResolution().rightPaneTotalWidth,
|
|
4159
4317
|
openColumnFilterPopover: filterPopover?.open ?? noop3,
|
|
4160
4318
|
groupColumns: activeGroupColumns,
|
|
4161
|
-
localeTexts
|
|
4319
|
+
localeTexts,
|
|
4320
|
+
columnTitles
|
|
4162
4321
|
});
|
|
4163
4322
|
const columnChooserItems = createMemo10(
|
|
4164
4323
|
() => columns().map((column) => ({
|
|
@@ -4167,11 +4326,17 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4167
4326
|
visible: column.visible !== false,
|
|
4168
4327
|
pane: getColumnPane(column),
|
|
4169
4328
|
// グループ化している間のグループ元の列は表示を切り替えられない印(React 版の DF-22)。
|
|
4170
|
-
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0
|
|
4329
|
+
grouped: rowGroupingActive() && column.rowGroup === true ? true : void 0,
|
|
4330
|
+
// 列のグループ(1.6.0。パネルはグループごとにまとめて出す)。
|
|
4331
|
+
groups: columnGroupTree()?.pathByColumn.get(column.key)?.map((group) => ({ key: group.key, title: group.title || group.key }))
|
|
4171
4332
|
}))
|
|
4172
4333
|
);
|
|
4334
|
+
const clampColumnChooserDrop = createMemo10(() => {
|
|
4335
|
+
const tree = columnGroupTree();
|
|
4336
|
+
return tree && columnGroupsFeature2 ? columnGroupsFeature2.createColumnChooserDropClamp(tree, columns()) : void 0;
|
|
4337
|
+
});
|
|
4173
4338
|
const sortManagerColumns = createMemo10(
|
|
4174
|
-
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: column.title || column.key }))
|
|
4339
|
+
() => [...visibleColumns(), ...activeGroupColumns()].filter((column) => !isSyntheticColumnKey2(column.key)).map((column) => ({ key: column.key, title: columnTitles()?.get(column.key) ?? (column.title || column.key) }))
|
|
4175
4340
|
);
|
|
4176
4341
|
const showGlobalFilterRow = () => globalFilterEnabled() && globalFilterText().trim().length > 0;
|
|
4177
4342
|
const toolPanelTabs = createMemo10(
|
|
@@ -4193,6 +4358,10 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4193
4358
|
const columnMenuGroupingAvailable = createMemo10(
|
|
4194
4359
|
() => groupingFeature2 !== void 0 && !isServerSide() && !labelRowEnabled() && props.onColumnsChange !== void 0 && columns().some((column) => column.rowGroup !== void 0)
|
|
4195
4360
|
);
|
|
4361
|
+
const columnGroupDragSupport = createMemo10(() => {
|
|
4362
|
+
const tree = columnGroupTree();
|
|
4363
|
+
return columnGroupsFeature2 && tree ? { ...columnGroupsFeature2, tree } : null;
|
|
4364
|
+
});
|
|
4196
4365
|
const columnReorder = features.columnReorder?.createColumnReorder(() => ({
|
|
4197
4366
|
enabled: Boolean(props.onColumnsChange),
|
|
4198
4367
|
columns: columns(),
|
|
@@ -4206,11 +4375,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4206
4375
|
rightLeadingWidth: paneResolution().rightLeadingWidth,
|
|
4207
4376
|
applyColumnOrderAndPin: columnCommands.applyColumnOrderAndPin,
|
|
4208
4377
|
ghostSlot: slots().dragGhost,
|
|
4209
|
-
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost"
|
|
4378
|
+
motion: resolvedMotion() === "off" ? "ghost" : props.columnDragMotion ?? "ghost",
|
|
4379
|
+
// 列のグループ(1.6.0): 列はグループの中でだけ動かし、グループの見出しの掴み手でグループごと動かす。
|
|
4380
|
+
columnGroups: columnGroupDragSupport()
|
|
4210
4381
|
}));
|
|
4211
4382
|
const columnDragHandler = createMemo10(
|
|
4212
4383
|
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnDragHandlePointerDown : void 0
|
|
4213
4384
|
);
|
|
4385
|
+
const columnGroupDragHandler = createMemo10(
|
|
4386
|
+
() => columnReorder && props.onColumnsChange ? columnReorder.onColumnGroupDragHandlePointerDown : void 0
|
|
4387
|
+
);
|
|
4214
4388
|
const renderColumnDropIndicator = (pane) => columnReorder ? <div
|
|
4215
4389
|
ref={(element) => columnReorder.setIndicator(pane, element)}
|
|
4216
4390
|
class="ssg-col-drop-indicator"
|
|
@@ -4388,6 +4562,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4388
4562
|
focusGrid: () => gridRootRef.current?.focus({ preventScroll: true }),
|
|
4389
4563
|
beforeDetailRowsCollapse: detailRows.returnFocusFromCards,
|
|
4390
4564
|
startEditCell: tryStartEditCell,
|
|
4565
|
+
// 列のグループ(1.6.0): setColumnGroupOpen / getState の closedColumnGroups / エクスポートの段。
|
|
4566
|
+
columnGroupTree: columnGroupTree(),
|
|
4391
4567
|
headerHeight: headerHeight(),
|
|
4392
4568
|
verticalScaleFactor: vertical().verticalScaleFactor,
|
|
4393
4569
|
leftPaneTotalWidth: paneResolution().leftPaneTotalWidth,
|
|
@@ -4460,6 +4636,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4460
4636
|
columns: columns(),
|
|
4461
4637
|
collapsedGroupKeys: ui().collapsedGroupKeys,
|
|
4462
4638
|
includeGroupingInState: props.includeGroupingInState ?? false,
|
|
4639
|
+
// 閉じている列のグループ(開閉できるグループがあるときだけ状態に入る)。
|
|
4640
|
+
closedColumnGroupKeys: ui().closedColumnGroupKeys,
|
|
4641
|
+
columnGroupTree: columnGroupTree(),
|
|
4463
4642
|
onStateChange: inOwnTick(props.onStateChange),
|
|
4464
4643
|
onFiltersChange: inOwnTick(props.onFiltersChange),
|
|
4465
4644
|
onSortChange: inOwnTick(props.onSortChange)
|
|
@@ -4467,6 +4646,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4467
4646
|
"effect",
|
|
4468
4647
|
"stateChangeNotifier"
|
|
4469
4648
|
);
|
|
4649
|
+
connectController(
|
|
4650
|
+
engine.columnGroupOpenNotifier,
|
|
4651
|
+
() => ({
|
|
4652
|
+
closedColumnGroupKeys: ui().closedColumnGroupKeys,
|
|
4653
|
+
columnGroupTree: columnGroupTree(),
|
|
4654
|
+
onColumnGroupOpenChange: inOwnTick(props.onColumnGroupOpenChange)
|
|
4655
|
+
}),
|
|
4656
|
+
"effect",
|
|
4657
|
+
"columnGroupOpenNotifier"
|
|
4658
|
+
);
|
|
4470
4659
|
onGridMounted(() => {
|
|
4471
4660
|
const element = gridRootRef.current;
|
|
4472
4661
|
if (!element) {
|
|
@@ -4505,8 +4694,16 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4505
4694
|
selection: ui().selection
|
|
4506
4695
|
}));
|
|
4507
4696
|
const derivedSummary = createMemo10(() => {
|
|
4697
|
+
const titles = columnTitles();
|
|
4698
|
+
const base = titles ? {
|
|
4699
|
+
...slotContextBase(),
|
|
4700
|
+
columns: slotContextBase().columns.map((column) => {
|
|
4701
|
+
const title = titles.get(column.key);
|
|
4702
|
+
return title === void 0 ? column : { ...column, title };
|
|
4703
|
+
})
|
|
4704
|
+
} : slotContextBase();
|
|
4508
4705
|
const summary = buildGridDerivedSummary(
|
|
4509
|
-
filteringAvailable ?
|
|
4706
|
+
filteringAvailable ? base : { ...base, globalFilterText: "", columnFilterValues: NO_COLUMN_FILTERS },
|
|
4510
4707
|
// 件数はグループ行 / ラベル行を除くデータ行の数(slotContext.filteredRows と同じ)。分母(総データ行数)はラベル行を除く
|
|
4511
4708
|
// (ラベル行が無ければ rows の数)。サーバーサイドは rows が空なので、サーバーが返した今の条件での件数(React 版と同じ)。
|
|
4512
4709
|
leafRowCount(),
|
|
@@ -4681,6 +4878,24 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4681
4878
|
/>
|
|
4682
4879
|
</Show11>;
|
|
4683
4880
|
};
|
|
4881
|
+
const cellTextOf = (row, column) => {
|
|
4882
|
+
const value = getCellValue2(row, column);
|
|
4883
|
+
return column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
|
|
4884
|
+
};
|
|
4885
|
+
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4886
|
+
const highlightFind = (content, ranges, findCurrentIndex2) => {
|
|
4887
|
+
if (!splitFind || !ranges || ranges.length === 0) {
|
|
4888
|
+
return content;
|
|
4889
|
+
}
|
|
4890
|
+
return splitFind(content, ranges).map((segment) => {
|
|
4891
|
+
const range = segment.range;
|
|
4892
|
+
return range ? <mark class={["ssg-find-mark", { "ssg-find-mark--current": range.matchIndex === findCurrentIndex2() }]}>
|
|
4893
|
+
{segment.text}
|
|
4894
|
+
</mark> : segment.text;
|
|
4895
|
+
});
|
|
4896
|
+
};
|
|
4897
|
+
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));
|
|
4898
|
+
const cellText = (row, column, ranges, findCurrentIndex2) => highlightFind(cellTextOf(row, column), ranges, findCurrentIndex2);
|
|
4684
4899
|
const renderCellContent = (currentRow, column, cell) => {
|
|
4685
4900
|
if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
|
|
4686
4901
|
return renderRowDragHandleCell(currentRow(), cell);
|
|
@@ -4757,23 +4972,9 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4757
4972
|
setValue: (nextValue) => writeRenderedCellValue(cell.rowKey, unbound, nextValue)
|
|
4758
4973
|
});
|
|
4759
4974
|
}
|
|
4760
|
-
const textOf = (row) =>
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
};
|
|
4764
|
-
const splitFind = findFeature2?.splitTextByFindRanges;
|
|
4765
|
-
const highlightFind = (content) => {
|
|
4766
|
-
const ranges = cell.findRanges;
|
|
4767
|
-
if (!splitFind || !ranges || ranges.length === 0) {
|
|
4768
|
-
return content;
|
|
4769
|
-
}
|
|
4770
|
-
return splitFind(content, ranges).map((segment) => {
|
|
4771
|
-
const range = segment.range;
|
|
4772
|
-
return range ? <mark class={["ssg-find-mark", { "ssg-find-mark--current": range.matchIndex === cell.findCurrentIndex }]}>
|
|
4773
|
-
{segment.text}
|
|
4774
|
-
</mark> : segment.text;
|
|
4775
|
-
});
|
|
4776
|
-
};
|
|
4975
|
+
const textOf = (row) => cellTextOf(row, column);
|
|
4976
|
+
const findCurrentIndex2 = () => cell.findCurrentIndex;
|
|
4977
|
+
const highlightCellFind = (content) => highlightFind(content, cell.findRanges, findCurrentIndex2);
|
|
4777
4978
|
const formatRules = conditionalFormatFeature2 ? unbound.conditionalFormat : void 0;
|
|
4778
4979
|
if (formatRules?.dataBar?.showValue === false) {
|
|
4779
4980
|
textOf(currentRow());
|
|
@@ -4814,11 +5015,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4814
5015
|
}
|
|
4815
5016
|
})
|
|
4816
5017
|
);
|
|
4817
|
-
return <Show11 when={chip()} fallback={<span class="ssg-cell-value">{
|
|
4818
|
-
{(spec) => <GridChip2 spec={spec()}>{
|
|
5018
|
+
return <Show11 when={chip()} fallback={<span class="ssg-cell-value">{highlightCellFind(text)}</span>}>
|
|
5019
|
+
{(spec) => <GridChip2 spec={spec()}>{highlightCellFind(spec().label ?? text)}</GridChip2>}
|
|
4819
5020
|
</Show11>;
|
|
4820
5021
|
}
|
|
4821
|
-
return <span class="ssg-cell-value">{
|
|
5022
|
+
return <span class="ssg-cell-value">{highlightCellFind(textOf(currentRow()))}</span>;
|
|
4822
5023
|
};
|
|
4823
5024
|
const pinnedPaneStyle = (side, width, hasContent) => ({
|
|
4824
5025
|
position: "sticky",
|
|
@@ -4830,6 +5031,15 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4830
5031
|
"z-index": 2,
|
|
4831
5032
|
...hasContent ? side === "left" ? { "border-right": "1px solid var(--ssg-pane-border)", "box-shadow": "var(--ssg-pane-shadow-left)" } : { "border-left": "1px solid var(--ssg-pane-border)", "box-shadow": "var(--ssg-pane-shadow-right)" } : {}
|
|
4832
5033
|
});
|
|
5034
|
+
const ColumnGroupHeader = columnGroupsFeature2?.ColumnGroupHeader;
|
|
5035
|
+
const columnGroupStickyInset = createMemo10(() => ({
|
|
5036
|
+
left: paneResolution().leftPaneTotalWidth + paneResolution().centerLeadingWidth,
|
|
5037
|
+
right: paneResolution().rightPaneTotalWidth
|
|
5038
|
+
}));
|
|
5039
|
+
const getColumnHeaderSpanRows = (columnKey) => {
|
|
5040
|
+
const tree = columnGroupTree();
|
|
5041
|
+
return tree && columnGroupsFeature2 ? columnGroupsFeature2.columnHeaderSpanRows(tree, columnKey) : 0;
|
|
5042
|
+
};
|
|
4833
5043
|
const renderPane = (pane, width, leadingWidth, ownsRowHeader, entries) => {
|
|
4834
5044
|
const bodyHeight = () => headerHeight() + vertical().physicalBodyHeight;
|
|
4835
5045
|
const activeRect = () => placementRectInPane(activeCellPlacement(), pane);
|
|
@@ -4844,11 +5054,11 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4844
5054
|
rowHeaderWidth={rowHeaderWidth()}
|
|
4845
5055
|
rows={pinnedRows()}
|
|
4846
5056
|
rowHeight={rowHeight()}
|
|
4847
|
-
stickyOffset={position === "top" ? columnHeaderHeight() : pinnedBelowTotal() ? 0 : totalRowHeight()}
|
|
5057
|
+
stickyOffset={position === "top" ? columnGroupHeight() + columnHeaderHeight() : pinnedBelowTotal() ? 0 : totalRowHeight()}
|
|
4848
5058
|
bodyHeight={position === "top" || pinnedBelowTotal() ? 0 : vertical().physicalBodyHeight}
|
|
4849
5059
|
entries={entries()}
|
|
4850
5060
|
rowKeyGetter={resolvedRowKeyGetter()}
|
|
4851
|
-
ariaRowIndexStart={position === "top" ? 2 : viewRowCount() + 2 + pinnedTopCount() + (pinnedBelowTotal() ? 1 : 0)}
|
|
5061
|
+
ariaRowIndexStart={(position === "top" ? 2 : viewRowCount() + 2 + pinnedTopCount() + (pinnedBelowTotal() ? 1 : 0)) + columnGroupDepth()}
|
|
4852
5062
|
getRowClassName={props.getRowClassName}
|
|
4853
5063
|
showCellOverflowTooltip={props.showCellOverflowTooltip ?? false}
|
|
4854
5064
|
conditionalFormat={conditionalFormatFeature2}
|
|
@@ -4870,7 +5080,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4870
5080
|
cells={totalRowCells()}
|
|
4871
5081
|
label={totalRowLabel()}
|
|
4872
5082
|
labelColumnKey={totalRowLabelColumnKey()}
|
|
4873
|
-
ariaRowIndex={viewRowCount() + 2 + pinnedTopCount() + (pinnedBelowTotal() ? 0 : pinnedBottomCount())}
|
|
5083
|
+
ariaRowIndex={viewRowCount() + 2 + pinnedTopCount() + (pinnedBelowTotal() ? 0 : pinnedBottomCount()) + columnGroupDepth()}
|
|
4874
5084
|
renderCell={totalRowOptions()?.renderCell}
|
|
4875
5085
|
rowClassName={totalRowSlot().className}
|
|
4876
5086
|
rowStyle={totalRowSlot().style}
|
|
@@ -4888,11 +5098,38 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
4888
5098
|
height: px(bodyHeight() + footerHeight())
|
|
4889
5099
|
}}
|
|
4890
5100
|
>
|
|
5101
|
+
{
|
|
5102
|
+
/* 列のグループの段(1.6.0。列見出しの行の前の sticky の器)。 */
|
|
5103
|
+
}
|
|
5104
|
+
{ColumnGroupHeader ? <Show11 when={columnGroupTree()}>
|
|
5105
|
+
{(tree) => <ColumnGroupHeader
|
|
5106
|
+
pane={pane}
|
|
5107
|
+
tree={tree()}
|
|
5108
|
+
groupRowHeight={columnGroupRowHeight()}
|
|
5109
|
+
leadingWidth={leadingWidth()}
|
|
5110
|
+
entries={paneLayout()[pane].entries}
|
|
5111
|
+
renderEntries={pane === "center" ? centerRenderEntries() : void 0}
|
|
5112
|
+
closedKeys={ui().closedColumnGroupKeys}
|
|
5113
|
+
selection={selectionSnapshot()}
|
|
5114
|
+
isWholeGridSelected={isWholeGridSelected()}
|
|
5115
|
+
stickyInset={pane === "center" ? columnGroupStickyInset() : null}
|
|
5116
|
+
enableColumnResize={enableColumnResize()}
|
|
5117
|
+
slots={slots()}
|
|
5118
|
+
dispatch={dispatch}
|
|
5119
|
+
onGroupPointerDown={pointer.handleColumnGroupHeaderPointerDown}
|
|
5120
|
+
onResizePointerDown={columnCommands.handleColumnGroupResizePointerDown}
|
|
5121
|
+
onGripPointerDown={columnGroupDragHandler()}
|
|
5122
|
+
/>}
|
|
5123
|
+
</Show11> : null}
|
|
4891
5124
|
<GridHeaderRow
|
|
4892
5125
|
pane={pane}
|
|
4893
5126
|
ownsRowHeader={ownsRowHeader()}
|
|
4894
5127
|
leadingWidth={leadingWidth()}
|
|
4895
5128
|
headerHeight={columnHeaderHeight()}
|
|
5129
|
+
stickyTop={columnGroupTree() ? columnGroupHeight() : void 0}
|
|
5130
|
+
ariaRowIndex={columnGroupTree() ? columnGroupDepth() + 1 : void 0}
|
|
5131
|
+
groupRowHeight={columnGroupTree() ? columnGroupRowHeight() : void 0}
|
|
5132
|
+
getHeaderSpanRows={columnGroupTree() ? getColumnHeaderSpanRows : void 0}
|
|
4896
5133
|
rowHeaderWidth={rowHeaderWidth()}
|
|
4897
5134
|
slots={slots()}
|
|
4898
5135
|
isCornerHovered={view().isCornerHovered}
|
|
@@ -5040,7 +5277,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5040
5277
|
rows={bodyRows()}
|
|
5041
5278
|
entries={entries()}
|
|
5042
5279
|
rowModel={rowModel()}
|
|
5043
|
-
ariaRowOffset={pinnedTopCount()}
|
|
5280
|
+
ariaRowOffset={pinnedTopCount() + columnGroupDepth()}
|
|
5044
5281
|
activeCell={ui().activeCell}
|
|
5045
5282
|
editingCell={ui().editingCell}
|
|
5046
5283
|
selection={selectionSnapshot()}
|
|
@@ -5057,6 +5294,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5057
5294
|
activeCellDomId={activeCellDomId}
|
|
5058
5295
|
cellEditorDomId={cellEditorDomId}
|
|
5059
5296
|
renderCellContent={renderCellContent}
|
|
5297
|
+
isTextCellColumn={isTextCellColumn}
|
|
5298
|
+
cellText={cellText}
|
|
5060
5299
|
onRowHeaderPointerDown={pointer.handleRowHeaderPointerDown}
|
|
5061
5300
|
onRowHeaderPointerEnter={pointer.handleRowHeaderPointerEnter}
|
|
5062
5301
|
onRowHeaderPointerLeave={handleRowHeaderPointerLeave}
|
|
@@ -5204,7 +5443,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5204
5443
|
}}
|
|
5205
5444
|
role="grid"
|
|
5206
5445
|
aria-label={props.ariaLabel}
|
|
5207
|
-
aria-rowcount={viewRowCount() + 1 + pinnedTopCount() + pinnedBottomCount() + (totalRowEnabled() ? 1 : 0)}
|
|
5446
|
+
aria-rowcount={viewRowCount() + 1 + pinnedTopCount() + pinnedBottomCount() + (totalRowEnabled() ? 1 : 0) + columnGroupDepth()}
|
|
5208
5447
|
aria-colcount={orderedColumns().length + 1}
|
|
5209
5448
|
aria-multiselectable={enableRangeSelection() ? "true" : void 0}
|
|
5210
5449
|
aria-readonly={readOnly() ? "true" : void 0}
|
|
@@ -5429,6 +5668,21 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5429
5668
|
) ? () => columnCommands.handleColumnMenuGroupBy(column().key) : void 0
|
|
5430
5669
|
}
|
|
5431
5670
|
onUngroup={columnMenuGroupingAvailable() && rowGroupingActive() ? columnCommands.handleColumnMenuUngroup : void 0}
|
|
5671
|
+
columnGroupToggles={(() => {
|
|
5672
|
+
const tree = columnGroupTree();
|
|
5673
|
+
return columnGroupsFeature2 && tree ? columnGroupsFeature2.resolveColumnMenuGroupToggles(tree, ui().closedColumnGroupKeys, column().key).map((toggle) => ({
|
|
5674
|
+
key: toggle.key,
|
|
5675
|
+
open: toggle.open,
|
|
5676
|
+
label: formatLocaleText6(
|
|
5677
|
+
toggle.open ? localeTexts().collapseColumnGroup : localeTexts().expandColumnGroup,
|
|
5678
|
+
{ group: toggle.title }
|
|
5679
|
+
)
|
|
5680
|
+
})) : void 0;
|
|
5681
|
+
})()}
|
|
5682
|
+
onToggleColumnGroup={(groupKey, open) => {
|
|
5683
|
+
columnMenu.close();
|
|
5684
|
+
dispatch(gridActions.setColumnGroupOpen(groupKey, open));
|
|
5685
|
+
}}
|
|
5432
5686
|
onRequestClose={columnMenu.close}
|
|
5433
5687
|
/>}
|
|
5434
5688
|
</Show11>}
|
|
@@ -5449,6 +5703,7 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5449
5703
|
popoverSlot={slots().popover}
|
|
5450
5704
|
themeClassName={portalClassName()}
|
|
5451
5705
|
localeTexts={localeTexts()}
|
|
5706
|
+
columnTitles={columnTitles()}
|
|
5452
5707
|
/> : null}
|
|
5453
5708
|
{
|
|
5454
5709
|
/* ツールパネル(グリッドの外のポップアップ。開いている間だけ描く)。タブを切り替えると中身を作り直す(タブの中の検索の
|
|
@@ -5491,6 +5746,8 @@ function GridShellBody(props, features, mountGate, mode) {
|
|
|
5491
5746
|
items={columnChooserItems()}
|
|
5492
5747
|
canToggle={props.onColumnsChange !== void 0}
|
|
5493
5748
|
onToggleColumnVisibility={columnCommands.handleColumnChooserToggleVisibility}
|
|
5749
|
+
onToggleColumnsVisibility={columnCommands.handleColumnChooserToggleColumnsVisibility}
|
|
5750
|
+
clampDropIndex={clampColumnChooserDrop()}
|
|
5494
5751
|
onShowAllColumns={columnCommands.handleColumnChooserShowAll}
|
|
5495
5752
|
onHideAllColumns={columnCommands.handleColumnChooserHideAll}
|
|
5496
5753
|
onResetColumns={columnCommands.handleColumnChooserReset}
|
|
@@ -5603,11 +5860,234 @@ var columnAutosizeFeature = {
|
|
|
5603
5860
|
createColumnAutosize
|
|
5604
5861
|
};
|
|
5605
5862
|
|
|
5863
|
+
// src/features/columnGroups.ts
|
|
5864
|
+
import {
|
|
5865
|
+
buildColumnGroupTree,
|
|
5866
|
+
columnHeaderSpanRows,
|
|
5867
|
+
computeColumnBlockReorderedKeys,
|
|
5868
|
+
createColumnChooserDropClamp,
|
|
5869
|
+
followColumnKeysAfterColumnGroupChange,
|
|
5870
|
+
placeUnpinnedColumnInGroup,
|
|
5871
|
+
resolveColumnMenuGroupToggles,
|
|
5872
|
+
resolveColumnGroupDistinctTitles,
|
|
5873
|
+
resolveCollapsedColumnKeys,
|
|
5874
|
+
resolveColumnDragItem,
|
|
5875
|
+
resolveColumnGroupDragItem,
|
|
5876
|
+
resolveColumnGroupDropPlacement,
|
|
5877
|
+
warnUnknownColumnGroupKeys
|
|
5878
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnGroups";
|
|
5879
|
+
import { DEFAULT_COLUMN_GROUPS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5880
|
+
|
|
5881
|
+
// src/view/GridColumnGroupHeader.tsx
|
|
5882
|
+
import { For as For6, Show as Show12, createMemo as createMemo11 } from "solid-js";
|
|
5883
|
+
import {
|
|
5884
|
+
createColumnGroupResize,
|
|
5885
|
+
resolveColumnGroupCells
|
|
5886
|
+
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnGroups";
|
|
5887
|
+
import { gridActions as gridActions2 } from "@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions";
|
|
5888
|
+
import { formatLocaleText as formatLocaleText7 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
5889
|
+
import { isFromRenderHeaderControl as isFromRenderHeaderControl2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
5890
|
+
var SVG_NOT_FOCUSABLE2 = { focusable: "false" };
|
|
5891
|
+
var stopPointerDown = (event) => {
|
|
5892
|
+
event.stopPropagation();
|
|
5893
|
+
if (event.pointerType === "mouse") event.preventDefault();
|
|
5894
|
+
};
|
|
5895
|
+
var resolveResize = (entries, cell, enableColumnResize) => createColumnGroupResize(
|
|
5896
|
+
entries.slice(cell.startIndex, cell.endIndex + 1).filter((entry) => entry.column.resizable ?? enableColumnResize).map((entry) => ({
|
|
5897
|
+
key: entry.column.key,
|
|
5898
|
+
startWidth: entry.paneLocalSize,
|
|
5899
|
+
minWidth: entry.column.minWidth ?? 60,
|
|
5900
|
+
maxWidth: entry.column.maxWidth ?? Number.POSITIVE_INFINITY
|
|
5901
|
+
}))
|
|
5902
|
+
);
|
|
5903
|
+
function GridColumnGroupHeader(props) {
|
|
5904
|
+
const texts = useFeatureLocaleText();
|
|
5905
|
+
const tree = createMemo11(() => props.tree);
|
|
5906
|
+
const entries = createMemo11(() => props.entries);
|
|
5907
|
+
const allCells = createMemo11(() => resolveColumnGroupCells(tree(), entries()));
|
|
5908
|
+
const cells = createMemo11(() => {
|
|
5909
|
+
const all = allCells();
|
|
5910
|
+
const renderEntries = props.renderEntries;
|
|
5911
|
+
if (renderEntries === void 0 || all.length === 0) return all;
|
|
5912
|
+
const first = renderEntries[0];
|
|
5913
|
+
const last = renderEntries[renderEntries.length - 1];
|
|
5914
|
+
if (!first || !last) return [];
|
|
5915
|
+
const from = first.paneLocalStart;
|
|
5916
|
+
const to = last.paneLocalStart + last.paneLocalSize;
|
|
5917
|
+
const visible = all.filter((cell) => cell.start < to && cell.start + cell.size > from);
|
|
5918
|
+
return visible.length === all.length ? all : visible;
|
|
5919
|
+
});
|
|
5920
|
+
const levels = createMemo11(() => {
|
|
5921
|
+
const result = Array.from({ length: tree().depth }, () => []);
|
|
5922
|
+
for (const cell of cells()) {
|
|
5923
|
+
result[cell.level]?.push(cell);
|
|
5924
|
+
}
|
|
5925
|
+
return result.map((levelCells, level) => ({ level, cells: levelCells })).filter((entry) => entry.cells.length > 0);
|
|
5926
|
+
});
|
|
5927
|
+
return <div data-pane={props.pane} class="ssg-col-group-block" style={{ height: px(tree().depth * props.groupRowHeight) }}>
|
|
5928
|
+
<For6 each={levels()} keyed={(entry) => entry.level}>
|
|
5929
|
+
{(entry) => (
|
|
5930
|
+
// 段ごとに 1 行(3 ペインの同じ段は同じ行番号)。
|
|
5931
|
+
<div
|
|
5932
|
+
role="row"
|
|
5933
|
+
aria-rowindex={entry().level + 1}
|
|
5934
|
+
class="ssg-col-group-row"
|
|
5935
|
+
style={{ top: px(entry().level * props.groupRowHeight), height: px(props.groupRowHeight) }}
|
|
5936
|
+
>
|
|
5937
|
+
<For6 each={entry().cells} keyed={(cell) => cell.id}>
|
|
5938
|
+
{(cell) => {
|
|
5939
|
+
const group = createMemo11(() => cell().group);
|
|
5940
|
+
const definition = createMemo11(() => group().definition);
|
|
5941
|
+
const open = () => !group().collapsible || !(props.closedKeys?.has(group().key) ?? false);
|
|
5942
|
+
const align = () => definition().headerAlign ?? "left";
|
|
5943
|
+
const isSelected = () => props.isWholeGridSelected || props.selection.kind === "col" && cell().firstColIndex >= props.selection.startCol && cell().lastColIndex <= props.selection.endCol;
|
|
5944
|
+
const labelStyle = () => {
|
|
5945
|
+
const inset = props.stickyInset;
|
|
5946
|
+
if (inset === null || align() === "center") return void 0;
|
|
5947
|
+
return align() === "right" ? { position: "sticky", right: px(inset.right + 6) } : { position: "sticky", left: px(inset.left + 6) };
|
|
5948
|
+
};
|
|
5949
|
+
const title = () => group().title || group().key;
|
|
5950
|
+
const context = {
|
|
5951
|
+
get group() {
|
|
5952
|
+
return definition();
|
|
5953
|
+
},
|
|
5954
|
+
get open() {
|
|
5955
|
+
return open();
|
|
5956
|
+
},
|
|
5957
|
+
get collapsible() {
|
|
5958
|
+
return group().collapsible;
|
|
5959
|
+
},
|
|
5960
|
+
get width() {
|
|
5961
|
+
return cell().size;
|
|
5962
|
+
}
|
|
5963
|
+
};
|
|
5964
|
+
const toggleLabel = () => formatLocaleText7(open() ? texts().collapseColumnGroup : texts().expandColumnGroup, { group: title() });
|
|
5965
|
+
const resize = createMemo11(() => resolveResize(entries(), cell(), props.enableColumnResize));
|
|
5966
|
+
return <div
|
|
5967
|
+
role="columnheader"
|
|
5968
|
+
aria-colindex={cell().firstColIndex + 2}
|
|
5969
|
+
aria-colspan={cell().lastColIndex - cell().firstColIndex + 1}
|
|
5970
|
+
data-ssg-col-group={group().key}
|
|
5971
|
+
class={[
|
|
5972
|
+
"ssg-header-cell",
|
|
5973
|
+
"ssg-col-group-cell",
|
|
5974
|
+
{
|
|
5975
|
+
"ssg-header-cell--selected": isSelected(),
|
|
5976
|
+
"ssg-col-group-cell--align-center": align() === "center",
|
|
5977
|
+
"ssg-col-group-cell--align-right": align() === "right",
|
|
5978
|
+
"ssg-col-group-cell--closed": !open()
|
|
5979
|
+
},
|
|
5980
|
+
props.slots.headerCell?.className,
|
|
5981
|
+
definition().className
|
|
5982
|
+
]}
|
|
5983
|
+
style={{
|
|
5984
|
+
...props.slots.headerCell?.style,
|
|
5985
|
+
left: px(props.leadingWidth + cell().start),
|
|
5986
|
+
width: px(cell().size),
|
|
5987
|
+
"min-width": px(cell().size),
|
|
5988
|
+
height: px(props.groupRowHeight)
|
|
5989
|
+
}}
|
|
5990
|
+
onPointerDown={(event) => {
|
|
5991
|
+
if (definition().renderHeader && isFromRenderHeaderControl2(event.target, event.currentTarget, ".ssg-col-group-label")) {
|
|
5992
|
+
return;
|
|
5993
|
+
}
|
|
5994
|
+
props.onGroupPointerDown(cell().firstColIndex, cell().lastColIndex, event);
|
|
5995
|
+
}}
|
|
5996
|
+
>
|
|
5997
|
+
<div class="ssg-col-group-label" style={labelStyle()}>
|
|
5998
|
+
<span
|
|
5999
|
+
class={["ssg-col-group-title", { "ssg-col-group-title--custom": Boolean(definition().renderHeader) }]}
|
|
6000
|
+
data-ssg-tooltip={definition().renderHeader ? void 0 : title()}
|
|
6001
|
+
>
|
|
6002
|
+
{definition().renderHeader ? definition().renderHeader?.(context) : title()}
|
|
6003
|
+
</span>
|
|
6004
|
+
<Show12 when={group().collapsible}>
|
|
6005
|
+
<button
|
|
6006
|
+
type="button"
|
|
6007
|
+
tabindex={-1}
|
|
6008
|
+
aria-expanded={open() ? "true" : "false"}
|
|
6009
|
+
aria-label={toggleLabel()}
|
|
6010
|
+
data-ssg-tooltip={toggleLabel()}
|
|
6011
|
+
class={["ssg-icon-btn", "ssg-col-group-toggle", props.slots.iconButton?.className]}
|
|
6012
|
+
style={props.slots.iconButton?.style}
|
|
6013
|
+
onPointerDown={stopPointerDown}
|
|
6014
|
+
onClick={(event) => {
|
|
6015
|
+
event.stopPropagation();
|
|
6016
|
+
props.dispatch(gridActions2.setColumnGroupOpen(group().key, !open()));
|
|
6017
|
+
}}
|
|
6018
|
+
>
|
|
6019
|
+
<svg
|
|
6020
|
+
width="10"
|
|
6021
|
+
height="10"
|
|
6022
|
+
viewBox="0 0 16 16"
|
|
6023
|
+
fill="none"
|
|
6024
|
+
stroke="currentColor"
|
|
6025
|
+
stroke-width="2"
|
|
6026
|
+
aria-hidden="true"
|
|
6027
|
+
{...SVG_NOT_FOCUSABLE2}
|
|
6028
|
+
>
|
|
6029
|
+
<path
|
|
6030
|
+
d={open() ? "M10 3 5 8l5 5" : "M6 3l5 5-5 5"}
|
|
6031
|
+
stroke-linecap="round"
|
|
6032
|
+
stroke-linejoin="round"
|
|
6033
|
+
/>
|
|
6034
|
+
</svg>
|
|
6035
|
+
</button>
|
|
6036
|
+
</Show12>
|
|
6037
|
+
<Show12 when={props.onGripPointerDown}>
|
|
6038
|
+
{(handler) => <span
|
|
6039
|
+
aria-hidden="true"
|
|
6040
|
+
class="ssg-header-grip ssg-col-group-grip"
|
|
6041
|
+
data-ssg-tooltip={formatLocaleText7(texts().dragColumnGroup, { group: title() })}
|
|
6042
|
+
onPointerDown={(event) => handler()(group().key, props.pane, event)}
|
|
6043
|
+
>
|
|
6044
|
+
<svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor" aria-hidden="true" {...SVG_NOT_FOCUSABLE2}>
|
|
6045
|
+
<circle cx="2" cy="3" r="1" />
|
|
6046
|
+
<circle cx="6" cy="3" r="1" />
|
|
6047
|
+
<circle cx="2" cy="7" r="1" />
|
|
6048
|
+
<circle cx="6" cy="7" r="1" />
|
|
6049
|
+
<circle cx="2" cy="11" r="1" />
|
|
6050
|
+
<circle cx="6" cy="11" r="1" />
|
|
6051
|
+
</svg>
|
|
6052
|
+
</span>}
|
|
6053
|
+
</Show12>
|
|
6054
|
+
</div>
|
|
6055
|
+
<Show12 when={resize()}>
|
|
6056
|
+
{(value) => <div class="ssg-header-resize" onPointerDown={(event) => props.onResizePointerDown(value(), event)} />}
|
|
6057
|
+
</Show12>
|
|
6058
|
+
</div>;
|
|
6059
|
+
}}
|
|
6060
|
+
</For6>
|
|
6061
|
+
</div>
|
|
6062
|
+
)}
|
|
6063
|
+
</For6>
|
|
6064
|
+
</div>;
|
|
6065
|
+
}
|
|
6066
|
+
|
|
6067
|
+
// src/features/columnGroups.ts
|
|
6068
|
+
var columnGroupsFeature = {
|
|
6069
|
+
buildColumnGroupTree,
|
|
6070
|
+
warnUnknownColumnGroupKeys,
|
|
6071
|
+
resolveCollapsedColumnKeys,
|
|
6072
|
+
followColumnKeysAfterColumnGroupChange,
|
|
6073
|
+
placeUnpinnedColumnInGroup,
|
|
6074
|
+
resolveColumnMenuGroupToggles,
|
|
6075
|
+
resolveColumnGroupDistinctTitles,
|
|
6076
|
+
columnHeaderSpanRows,
|
|
6077
|
+
createColumnChooserDropClamp,
|
|
6078
|
+
resolveColumnDragItem,
|
|
6079
|
+
resolveColumnGroupDragItem,
|
|
6080
|
+
resolveColumnGroupDropPlacement,
|
|
6081
|
+
computeColumnBlockReorderedKeys,
|
|
6082
|
+
ColumnGroupHeader: GridColumnGroupHeader,
|
|
6083
|
+
localeText: DEFAULT_COLUMN_GROUPS_LOCALE_TEXT
|
|
6084
|
+
};
|
|
6085
|
+
|
|
5606
6086
|
// src/features/columnMenu.ts
|
|
5607
6087
|
import { DEFAULT_COLUMN_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
5608
6088
|
|
|
5609
6089
|
// src/primitives/columnMenu.ts
|
|
5610
|
-
import { createMemo as
|
|
6090
|
+
import { createMemo as createMemo12 } from "solid-js";
|
|
5611
6091
|
import {
|
|
5612
6092
|
createColumnMenuController
|
|
5613
6093
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/columnMenuController";
|
|
@@ -5619,16 +6099,16 @@ function createColumnMenu(inputs) {
|
|
|
5619
6099
|
gridRootRef: inputs.gridRootRef
|
|
5620
6100
|
}), "render", "columnMenu");
|
|
5621
6101
|
const snapshot2 = createExternalStoreSignal(controller, "columnMenuStore");
|
|
5622
|
-
const openedColumnKey =
|
|
5623
|
-
const openedColumn =
|
|
6102
|
+
const openedColumnKey = createMemo12(() => snapshot2().columnKey);
|
|
6103
|
+
const openedColumn = createMemo12(() => {
|
|
5624
6104
|
const key = openedColumnKey();
|
|
5625
6105
|
return key === null ? null : inputs.visibleColumns().find((column) => column.key === key) ?? null;
|
|
5626
6106
|
});
|
|
5627
6107
|
return {
|
|
5628
6108
|
openedColumnKey,
|
|
5629
6109
|
openedColumn,
|
|
5630
|
-
layout:
|
|
5631
|
-
isOpen:
|
|
6110
|
+
layout: createMemo12(() => snapshot2().layout),
|
|
6111
|
+
isOpen: createMemo12(() => openedColumnKey() !== null),
|
|
5632
6112
|
panelRef: controller.panelRef,
|
|
5633
6113
|
openFromButton: controller.openFromButton,
|
|
5634
6114
|
openFromButtonClick: controller.openFromButtonClick,
|
|
@@ -5639,7 +6119,7 @@ function createColumnMenu(inputs) {
|
|
|
5639
6119
|
}
|
|
5640
6120
|
|
|
5641
6121
|
// src/view/ColumnMenuPopover.tsx
|
|
5642
|
-
import { For as
|
|
6122
|
+
import { For as For7, Show as Show13, createEffect as createEffect5, createMemo as createMemo13, createSignal as createSignal10, createUniqueId as createUniqueId4, onCleanup as onCleanup9 } from "solid-js";
|
|
5643
6123
|
import { Portal as Portal2 } from "@solidjs/web";
|
|
5644
6124
|
var PINNED_ITEMS = [
|
|
5645
6125
|
{ value: void 0, label: "menuPinNone" },
|
|
@@ -5664,10 +6144,10 @@ function ColumnMenuPopover(props) {
|
|
|
5664
6144
|
props.panelRef.current = null;
|
|
5665
6145
|
}
|
|
5666
6146
|
});
|
|
5667
|
-
const layout =
|
|
6147
|
+
const layout = createMemo13(() => props.layout);
|
|
5668
6148
|
const [openSubmenu, setOpenSubmenu] = createSignal10(null);
|
|
5669
6149
|
const setOpenSubmenuKey = (key) => setOpenSubmenu(key === null ? null : { columnKey: props.columnKey, key });
|
|
5670
|
-
const isPinSubmenuOpen =
|
|
6150
|
+
const isPinSubmenuOpen = createMemo13(() => {
|
|
5671
6151
|
const current = openSubmenu();
|
|
5672
6152
|
return current !== null && current.columnKey === props.columnKey && current.key === PIN_SUBMENU_KEY;
|
|
5673
6153
|
});
|
|
@@ -5682,7 +6162,7 @@ function ColumnMenuPopover(props) {
|
|
|
5682
6162
|
{ name: "columnMenuScrollReset" }
|
|
5683
6163
|
);
|
|
5684
6164
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
5685
|
-
const submenuInline =
|
|
6165
|
+
const submenuInline = createMemo13(() => layout().maxHeight !== void 0);
|
|
5686
6166
|
const [pinSubmenu, setPinSubmenu] = createSignal10();
|
|
5687
6167
|
let pinSubmenuElement;
|
|
5688
6168
|
createPortalTokens(
|
|
@@ -5742,7 +6222,7 @@ function ColumnMenuPopover(props) {
|
|
|
5742
6222
|
props.slots?.menuItem?.className
|
|
5743
6223
|
];
|
|
5744
6224
|
const itemStyle = () => props.slots?.menuItem?.style;
|
|
5745
|
-
return <
|
|
6225
|
+
return <Show13 when={container}>
|
|
5746
6226
|
{(mount) => <Portal2 mount={mount()}>
|
|
5747
6227
|
<div
|
|
5748
6228
|
ref={(node) => {
|
|
@@ -5772,7 +6252,27 @@ function ColumnMenuPopover(props) {
|
|
|
5772
6252
|
{props.title}
|
|
5773
6253
|
</div>
|
|
5774
6254
|
|
|
5775
|
-
|
|
6255
|
+
{
|
|
6256
|
+
/* 列のグループの開閉(1.6.0 の実アプリの点検 G5-02)。 */
|
|
6257
|
+
}
|
|
6258
|
+
<Show13 when={props.onToggleColumnGroup !== void 0 && (props.columnGroupToggles?.length ?? 0) > 0}>
|
|
6259
|
+
<For7 each={props.columnGroupToggles ?? []} keyed={(toggle) => toggle.key}>
|
|
6260
|
+
{(toggle) => <button
|
|
6261
|
+
type="button"
|
|
6262
|
+
role="menuitem"
|
|
6263
|
+
onPointerEnter={closeSubmenuOnHover}
|
|
6264
|
+
onClick={() => props.onToggleColumnGroup?.(toggle().key, !toggle().open)}
|
|
6265
|
+
class={itemClass()}
|
|
6266
|
+
style={itemStyle()}
|
|
6267
|
+
>
|
|
6268
|
+
<span class="ssg-menu-icon" />
|
|
6269
|
+
<span class="ssg-menu-label">{toggle().label}</span>
|
|
6270
|
+
</button>}
|
|
6271
|
+
</For7>
|
|
6272
|
+
<div role="separator" class="ssg-menu-separator" />
|
|
6273
|
+
</Show13>
|
|
6274
|
+
|
|
6275
|
+
<Show13 when={props.canFilter}>
|
|
5776
6276
|
<button
|
|
5777
6277
|
type="button"
|
|
5778
6278
|
role="menuitem"
|
|
@@ -5785,9 +6285,9 @@ function ColumnMenuPopover(props) {
|
|
|
5785
6285
|
<span class="ssg-menu-label">{texts().menuFilter}</span>
|
|
5786
6286
|
</button>
|
|
5787
6287
|
<div role="separator" class="ssg-menu-separator" />
|
|
5788
|
-
</
|
|
6288
|
+
</Show13>
|
|
5789
6289
|
|
|
5790
|
-
<
|
|
6290
|
+
<Show13 when={props.canSort}>
|
|
5791
6291
|
<SortItem
|
|
5792
6292
|
direction="asc"
|
|
5793
6293
|
sortDirection={props.sortDirection}
|
|
@@ -5806,7 +6306,7 @@ function ColumnMenuPopover(props) {
|
|
|
5806
6306
|
class={itemClass()}
|
|
5807
6307
|
style={itemStyle()}
|
|
5808
6308
|
/>
|
|
5809
|
-
<
|
|
6309
|
+
<Show13 when={props.onOpenSortManager}>
|
|
5810
6310
|
{(open) => <button
|
|
5811
6311
|
type="button"
|
|
5812
6312
|
role="menuitem"
|
|
@@ -5818,10 +6318,10 @@ function ColumnMenuPopover(props) {
|
|
|
5818
6318
|
<span class="ssg-menu-icon" />
|
|
5819
6319
|
<span class="ssg-menu-label">{texts().menuManageSort}</span>
|
|
5820
6320
|
</button>}
|
|
5821
|
-
</
|
|
5822
|
-
</
|
|
6321
|
+
</Show13>
|
|
6322
|
+
</Show13>
|
|
5823
6323
|
|
|
5824
|
-
<
|
|
6324
|
+
<Show13 when={props.canManageFilters ? props.onOpenFilterManager : void 0}>
|
|
5825
6325
|
{(open) => <button
|
|
5826
6326
|
type="button"
|
|
5827
6327
|
role="menuitem"
|
|
@@ -5833,16 +6333,16 @@ function ColumnMenuPopover(props) {
|
|
|
5833
6333
|
<span class="ssg-menu-icon" />
|
|
5834
6334
|
<span class="ssg-menu-label">{texts().menuManageFilters}</span>
|
|
5835
6335
|
</button>}
|
|
5836
|
-
</
|
|
6336
|
+
</Show13>
|
|
5837
6337
|
|
|
5838
6338
|
{
|
|
5839
6339
|
/* 区切りは、並び替えの項目かフィルターを管理…のどちらかが出ているとき。 */
|
|
5840
6340
|
}
|
|
5841
|
-
<
|
|
6341
|
+
<Show13 when={props.canSort || props.canManageFilters && props.onOpenFilterManager !== void 0}>
|
|
5842
6342
|
<div role="separator" class="ssg-menu-separator" />
|
|
5843
|
-
</
|
|
6343
|
+
</Show13>
|
|
5844
6344
|
|
|
5845
|
-
<
|
|
6345
|
+
<Show13 when={props.onGroupByColumn}>
|
|
5846
6346
|
{(groupBy) => <button
|
|
5847
6347
|
type="button"
|
|
5848
6348
|
role="menuitem"
|
|
@@ -5854,8 +6354,8 @@ function ColumnMenuPopover(props) {
|
|
|
5854
6354
|
<span class="ssg-menu-icon" />
|
|
5855
6355
|
<span class="ssg-menu-label">{texts().menuGroupBy}</span>
|
|
5856
6356
|
</button>}
|
|
5857
|
-
</
|
|
5858
|
-
<
|
|
6357
|
+
</Show13>
|
|
6358
|
+
<Show13 when={props.onUngroup}>
|
|
5859
6359
|
{(ungroup) => <button
|
|
5860
6360
|
type="button"
|
|
5861
6361
|
role="menuitem"
|
|
@@ -5867,10 +6367,10 @@ function ColumnMenuPopover(props) {
|
|
|
5867
6367
|
<span class="ssg-menu-icon" />
|
|
5868
6368
|
<span class="ssg-menu-label">{texts().menuUngroup}</span>
|
|
5869
6369
|
</button>}
|
|
5870
|
-
</
|
|
5871
|
-
<
|
|
6370
|
+
</Show13>
|
|
6371
|
+
<Show13 when={props.onGroupByColumn !== void 0 || props.onUngroup !== void 0}>
|
|
5872
6372
|
<div role="separator" class="ssg-menu-separator" />
|
|
5873
|
-
</
|
|
6373
|
+
</Show13>
|
|
5874
6374
|
|
|
5875
6375
|
{
|
|
5876
6376
|
/* 列の固定 ›(小メニューはこの行 = position: relative を基準に置く。パネルの子孫なので外側の押下の判定にも入る)。 */
|
|
@@ -5931,7 +6431,7 @@ function ColumnMenuPopover(props) {
|
|
|
5931
6431
|
›
|
|
5932
6432
|
</span>
|
|
5933
6433
|
</button>
|
|
5934
|
-
<
|
|
6434
|
+
<Show13 when={isPinSubmenuOpen()}>
|
|
5935
6435
|
<div
|
|
5936
6436
|
ref={(node) => {
|
|
5937
6437
|
pinSubmenuElement = node;
|
|
@@ -5950,7 +6450,7 @@ function ColumnMenuPopover(props) {
|
|
|
5950
6450
|
pinButton?.focus();
|
|
5951
6451
|
}}
|
|
5952
6452
|
>
|
|
5953
|
-
<
|
|
6453
|
+
<For7 each={PINNED_ITEMS}>
|
|
5954
6454
|
{(item) => {
|
|
5955
6455
|
const isSelected = () => props.pinned === item.value;
|
|
5956
6456
|
return <button
|
|
@@ -5974,17 +6474,17 @@ function ColumnMenuPopover(props) {
|
|
|
5974
6474
|
<span class="ssg-menu-label">{texts()[item.label]}</span>
|
|
5975
6475
|
</button>;
|
|
5976
6476
|
}}
|
|
5977
|
-
</
|
|
5978
|
-
<
|
|
6477
|
+
</For7>
|
|
6478
|
+
<Show13 when={!props.canChangePinned}>
|
|
5979
6479
|
<div id={pinNoteId} role="none" class="ssg-menu-note">
|
|
5980
6480
|
{texts().menuPinUnavailable}
|
|
5981
6481
|
</div>
|
|
5982
|
-
</
|
|
6482
|
+
</Show13>
|
|
5983
6483
|
</div>
|
|
5984
|
-
</
|
|
6484
|
+
</Show13>
|
|
5985
6485
|
</div>
|
|
5986
6486
|
|
|
5987
|
-
<
|
|
6487
|
+
<Show13 when={props.onAutosizeColumn && props.onAutosizeAllColumns}>
|
|
5988
6488
|
<button
|
|
5989
6489
|
type="button"
|
|
5990
6490
|
role="menuitem"
|
|
@@ -6007,9 +6507,9 @@ function ColumnMenuPopover(props) {
|
|
|
6007
6507
|
<span class="ssg-menu-icon" />
|
|
6008
6508
|
<span class="ssg-menu-label">{texts().menuAutosizeAll}</span>
|
|
6009
6509
|
</button>
|
|
6010
|
-
</
|
|
6510
|
+
</Show13>
|
|
6011
6511
|
|
|
6012
|
-
<
|
|
6512
|
+
<Show13 when={props.onOpenColumnChooser}>
|
|
6013
6513
|
{(open) => <button
|
|
6014
6514
|
type="button"
|
|
6015
6515
|
role="menuitem"
|
|
@@ -6021,7 +6521,7 @@ function ColumnMenuPopover(props) {
|
|
|
6021
6521
|
<span class="ssg-menu-icon" />
|
|
6022
6522
|
<span class="ssg-menu-label">{texts().menuColumns}</span>
|
|
6023
6523
|
</button>}
|
|
6024
|
-
</
|
|
6524
|
+
</Show13>
|
|
6025
6525
|
|
|
6026
6526
|
<button
|
|
6027
6527
|
type="button"
|
|
@@ -6049,7 +6549,7 @@ function ColumnMenuPopover(props) {
|
|
|
6049
6549
|
</div>
|
|
6050
6550
|
</div>
|
|
6051
6551
|
</Portal2>}
|
|
6052
|
-
</
|
|
6552
|
+
</Show13>;
|
|
6053
6553
|
}
|
|
6054
6554
|
function SortItem(props) {
|
|
6055
6555
|
const active = () => props.sortDirection === props.direction;
|
|
@@ -6101,6 +6601,7 @@ function createColumnReorder(args) {
|
|
|
6101
6601
|
);
|
|
6102
6602
|
return {
|
|
6103
6603
|
onColumnDragHandlePointerDown: controller.onColumnDragHandlePointerDown,
|
|
6604
|
+
onColumnGroupDragHandlePointerDown: controller.onColumnGroupDragHandlePointerDown,
|
|
6104
6605
|
setIndicator: (pane, element) => {
|
|
6105
6606
|
if (pane === "left") {
|
|
6106
6607
|
leftIndicatorRef.current = element;
|
|
@@ -6127,9 +6628,9 @@ import {
|
|
|
6127
6628
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/conditionalFormat";
|
|
6128
6629
|
|
|
6129
6630
|
// src/view/GridChip.tsx
|
|
6130
|
-
import { Show as
|
|
6631
|
+
import { Show as Show14 } from "solid-js";
|
|
6131
6632
|
import { resolveChipTone } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/conditionalFormat";
|
|
6132
|
-
var
|
|
6633
|
+
var SVG_NOT_FOCUSABLE3 = { focusable: "false" };
|
|
6133
6634
|
var ICON_PATHS = {
|
|
6134
6635
|
neutral: () => <circle cx="6" cy="6" r="1.7" fill="currentColor" stroke="none" />,
|
|
6135
6636
|
info: () => <>
|
|
@@ -6153,7 +6654,7 @@ function GridChip(props) {
|
|
|
6153
6654
|
class={["ssg-chip", custom() ? "ssg-chip--custom" : `ssg-chip--${tone()}`]}
|
|
6154
6655
|
style={custom() ? { "--ssg-cf-chip-color": props.spec.color } : void 0}
|
|
6155
6656
|
>
|
|
6156
|
-
<
|
|
6657
|
+
<Show14 when={props.spec.icon !== false}>
|
|
6157
6658
|
<span class="ssg-chip-icon" aria-hidden="true">
|
|
6158
6659
|
<svg
|
|
6159
6660
|
viewBox="0 0 12 12"
|
|
@@ -6162,12 +6663,12 @@ function GridChip(props) {
|
|
|
6162
6663
|
stroke-width="1.6"
|
|
6163
6664
|
stroke-linecap="round"
|
|
6164
6665
|
stroke-linejoin="round"
|
|
6165
|
-
{...
|
|
6666
|
+
{...SVG_NOT_FOCUSABLE3}
|
|
6166
6667
|
>
|
|
6167
6668
|
{ICON_PATHS[tone()]()}
|
|
6168
6669
|
</svg>
|
|
6169
6670
|
</span>
|
|
6170
|
-
</
|
|
6671
|
+
</Show14>
|
|
6171
6672
|
<span class="ssg-chip-label">{props.children}</span>
|
|
6172
6673
|
</span>;
|
|
6173
6674
|
}
|
|
@@ -6189,7 +6690,7 @@ import {
|
|
|
6189
6690
|
import { DEFAULT_CONTEXT_MENU_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6190
6691
|
|
|
6191
6692
|
// src/primitives/contextMenu.ts
|
|
6192
|
-
import { createMemo as
|
|
6693
|
+
import { createMemo as createMemo14 } from "solid-js";
|
|
6193
6694
|
import {
|
|
6194
6695
|
createContextMenuController
|
|
6195
6696
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/contextMenuController";
|
|
@@ -6199,7 +6700,7 @@ function createCellContextMenu(inputs) {
|
|
|
6199
6700
|
const snapshot2 = createExternalStoreSignal(controller, "contextMenuStore");
|
|
6200
6701
|
return {
|
|
6201
6702
|
snapshot: snapshot2,
|
|
6202
|
-
isOpen:
|
|
6703
|
+
isOpen: createMemo14(() => snapshot2().state !== null),
|
|
6203
6704
|
open: controller.open,
|
|
6204
6705
|
close: controller.close,
|
|
6205
6706
|
panelRef: controller.panelRef
|
|
@@ -6207,7 +6708,7 @@ function createCellContextMenu(inputs) {
|
|
|
6207
6708
|
}
|
|
6208
6709
|
|
|
6209
6710
|
// src/view/CellContextMenuPopover.tsx
|
|
6210
|
-
import { For as
|
|
6711
|
+
import { For as For8, Match as Match2, Show as Show15, Switch as Switch2, createMemo as createMemo15, createSignal as createSignal11, onCleanup as onCleanup10 } from "solid-js";
|
|
6211
6712
|
import { Portal as Portal3 } from "@solidjs/web";
|
|
6212
6713
|
function CellContextMenuPopover(props) {
|
|
6213
6714
|
const portal = useGridPortal();
|
|
@@ -6219,8 +6720,8 @@ function CellContextMenuPopover(props) {
|
|
|
6219
6720
|
props.panelRef.current = null;
|
|
6220
6721
|
}
|
|
6221
6722
|
});
|
|
6222
|
-
const layout =
|
|
6223
|
-
const element = <
|
|
6723
|
+
const layout = createMemo15(() => props.layout);
|
|
6724
|
+
const element = <Show15 when={container}>
|
|
6224
6725
|
{(mount) => <Portal3 mount={mount()}>
|
|
6225
6726
|
<div
|
|
6226
6727
|
ref={(node) => {
|
|
@@ -6246,7 +6747,7 @@ function CellContextMenuPopover(props) {
|
|
|
6246
6747
|
...layout().maxHeight !== void 0 ? { "max-height": px(layout().maxHeight ?? 0), "overflow-y": "auto" } : null
|
|
6247
6748
|
}}
|
|
6248
6749
|
>
|
|
6249
|
-
<
|
|
6750
|
+
<For8 each={props.items}>
|
|
6250
6751
|
{(item) => <Switch2
|
|
6251
6752
|
fallback={
|
|
6252
6753
|
// action(kind 省略 or 'action')。押すと onSelect の後に閉じる。disabled は button の disabled で押せない。
|
|
@@ -6278,10 +6779,10 @@ function CellContextMenuPopover(props) {
|
|
|
6278
6779
|
{(custom) => <div role="none">{custom().render({ close: props.onRequestClose })}</div>}
|
|
6279
6780
|
</Match2>
|
|
6280
6781
|
</Switch2>}
|
|
6281
|
-
</
|
|
6782
|
+
</For8>
|
|
6282
6783
|
</div>
|
|
6283
6784
|
</Portal3>}
|
|
6284
|
-
</
|
|
6785
|
+
</Show15>;
|
|
6285
6786
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
6286
6787
|
return element;
|
|
6287
6788
|
}
|
|
@@ -6332,7 +6833,7 @@ var exportFeature = {
|
|
|
6332
6833
|
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6333
6834
|
|
|
6334
6835
|
// src/primitives/fillHandle.ts
|
|
6335
|
-
import { createMemo as
|
|
6836
|
+
import { createMemo as createMemo16 } from "solid-js";
|
|
6336
6837
|
import {
|
|
6337
6838
|
createFillHandleController
|
|
6338
6839
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
@@ -6350,11 +6851,11 @@ import {
|
|
|
6350
6851
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
6351
6852
|
function createFillHandle(inputs) {
|
|
6352
6853
|
const controller = createFillHandleController();
|
|
6353
|
-
const options =
|
|
6854
|
+
const options = createMemo16(() => {
|
|
6354
6855
|
const fillHandle = inputs.fillHandle();
|
|
6355
6856
|
return typeof fillHandle === "object" ? fillHandle : void 0;
|
|
6356
6857
|
});
|
|
6357
|
-
const enabled =
|
|
6858
|
+
const enabled = createMemo16(
|
|
6358
6859
|
() => Boolean(inputs.fillHandle()) && !inputs.readOnly() && (inputs.isServerSide() ? inputs.applyServerSideCellEdits() !== void 0 : inputs.handleRowsChange() !== void 0)
|
|
6359
6860
|
);
|
|
6360
6861
|
connectController(controller, () => {
|
|
@@ -6392,17 +6893,17 @@ function createFillHandle(inputs) {
|
|
|
6392
6893
|
};
|
|
6393
6894
|
}, "render", "fillHandle");
|
|
6394
6895
|
const snapshot2 = createExternalStoreSignal(controller, "fillHandleStore");
|
|
6395
|
-
const rowMetrics =
|
|
6396
|
-
const windowFirstRow =
|
|
6397
|
-
const windowLastRow =
|
|
6398
|
-
const detailActive =
|
|
6399
|
-
const detailExtras =
|
|
6400
|
-
const verticalScaleFactor =
|
|
6401
|
-
const paneLayout =
|
|
6402
|
-
const viewportHeight =
|
|
6403
|
-
const scrollTop =
|
|
6404
|
-
const headerHeight =
|
|
6405
|
-
const corner =
|
|
6896
|
+
const rowMetrics = createMemo16(() => inputs.vertical().rowMetrics);
|
|
6897
|
+
const windowFirstRow = createMemo16(() => inputs.vertical().windowFirstRow);
|
|
6898
|
+
const windowLastRow = createMemo16(() => inputs.vertical().windowLastRow);
|
|
6899
|
+
const detailActive = createMemo16(() => inputs.vertical().detailActive);
|
|
6900
|
+
const detailExtras = createMemo16(() => inputs.vertical().detailExtras);
|
|
6901
|
+
const verticalScaleFactor = createMemo16(() => inputs.vertical().verticalScaleFactor);
|
|
6902
|
+
const paneLayout = createMemo16(inputs.paneLayout);
|
|
6903
|
+
const viewportHeight = createMemo16(inputs.viewportHeight);
|
|
6904
|
+
const scrollTop = createMemo16(inputs.scrollTop);
|
|
6905
|
+
const headerHeight = createMemo16(inputs.headerHeight);
|
|
6906
|
+
const corner = createMemo16(() => {
|
|
6406
6907
|
const ui = inputs.uiState();
|
|
6407
6908
|
if (!enabled() || ui.editingCell || ui.dragState?.type === "selection") {
|
|
6408
6909
|
return null;
|
|
@@ -6415,7 +6916,7 @@ function createFillHandle(inputs) {
|
|
|
6415
6916
|
}
|
|
6416
6917
|
return resolveFillCornerPlacement(source, paneLayout(), rowMetrics(), windowFirstRow(), windowLastRow());
|
|
6417
6918
|
});
|
|
6418
|
-
const previewSelection =
|
|
6919
|
+
const previewSelection = createMemo16(() => {
|
|
6419
6920
|
const current = snapshot2();
|
|
6420
6921
|
if (current.status !== "dragging" || current.target === null) {
|
|
6421
6922
|
return null;
|
|
@@ -6435,7 +6936,7 @@ function createFillHandle(inputs) {
|
|
|
6435
6936
|
}
|
|
6436
6937
|
};
|
|
6437
6938
|
});
|
|
6438
|
-
const previewGeometry =
|
|
6939
|
+
const previewGeometry = createMemo16(() => {
|
|
6439
6940
|
const selection = previewSelection();
|
|
6440
6941
|
if (selection === null) {
|
|
6441
6942
|
return null;
|
|
@@ -6468,7 +6969,7 @@ function createFillHandle(inputs) {
|
|
|
6468
6969
|
}
|
|
6469
6970
|
return geometry.band ? [{ left: extent.start, top: geometry.band.top, width: extent.width, height: geometry.band.height }] : [];
|
|
6470
6971
|
};
|
|
6471
|
-
const chip =
|
|
6972
|
+
const chip = createMemo16(() => {
|
|
6472
6973
|
const current = snapshot2();
|
|
6473
6974
|
if (current.status !== "filled") {
|
|
6474
6975
|
return null;
|
|
@@ -6491,7 +6992,7 @@ function createFillHandle(inputs) {
|
|
|
6491
6992
|
controller,
|
|
6492
6993
|
snapshot: snapshot2,
|
|
6493
6994
|
// 真偽値が変わったときだけ知らせます(ルートの class の描き直しを、ボタンが消えただけでは起こさない)。
|
|
6494
|
-
filling:
|
|
6995
|
+
filling: createMemo16(() => snapshot2().status === "dragging"),
|
|
6495
6996
|
corner,
|
|
6496
6997
|
previewRects,
|
|
6497
6998
|
chip
|
|
@@ -6499,11 +7000,11 @@ function createFillHandle(inputs) {
|
|
|
6499
7000
|
}
|
|
6500
7001
|
|
|
6501
7002
|
// src/view/FillHandleLayer.tsx
|
|
6502
|
-
import { For as
|
|
7003
|
+
import { For as For9, Show as Show16, createEffect as createEffect7, createMemo as createMemo17, createSignal as createSignal12, onCleanup as onCleanup11 } from "solid-js";
|
|
6503
7004
|
import { Portal as Portal4 } from "@solidjs/web";
|
|
6504
|
-
import { formatLocaleText as
|
|
7005
|
+
import { formatLocaleText as formatLocaleText8 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6505
7006
|
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
6506
|
-
var
|
|
7007
|
+
var SVG_NOT_FOCUSABLE4 = { focusable: "false" };
|
|
6507
7008
|
function FillHandleLayer(props) {
|
|
6508
7009
|
const corner = () => {
|
|
6509
7010
|
const current = props.fill.corner();
|
|
@@ -6513,7 +7014,7 @@ function FillHandleLayer(props) {
|
|
|
6513
7014
|
const current = props.fill.chip();
|
|
6514
7015
|
return current?.pane === props.pane ? current.position : null;
|
|
6515
7016
|
};
|
|
6516
|
-
const filled =
|
|
7017
|
+
const filled = createMemo17(() => {
|
|
6517
7018
|
const snapshot2 = props.fill.snapshot();
|
|
6518
7019
|
return snapshot2.status === "filled" ? snapshot2 : null;
|
|
6519
7020
|
});
|
|
@@ -6521,7 +7022,7 @@ function FillHandleLayer(props) {
|
|
|
6521
7022
|
{
|
|
6522
7023
|
/* ドラッグ中の埋める範囲の点線。 */
|
|
6523
7024
|
}
|
|
6524
|
-
<
|
|
7025
|
+
<For9 each={props.fill.previewRects(props.pane)} keyed={false}>
|
|
6525
7026
|
{(rect) => <div
|
|
6526
7027
|
class="ssg-fill-preview"
|
|
6527
7028
|
style={{
|
|
@@ -6533,11 +7034,11 @@ function FillHandleLayer(props) {
|
|
|
6533
7034
|
}}
|
|
6534
7035
|
data-ssg-fill-preview=""
|
|
6535
7036
|
/>}
|
|
6536
|
-
</
|
|
7037
|
+
</For9>
|
|
6537
7038
|
{
|
|
6538
7039
|
/* 選択範囲の右下の四角。 */
|
|
6539
7040
|
}
|
|
6540
|
-
<
|
|
7041
|
+
<Show16 when={corner()}>
|
|
6541
7042
|
{(current) => <div
|
|
6542
7043
|
class="ssg-fill-handle"
|
|
6543
7044
|
style={{
|
|
@@ -6549,12 +7050,12 @@ function FillHandleLayer(props) {
|
|
|
6549
7050
|
aria-hidden="true"
|
|
6550
7051
|
onPointerDown={(event) => props.fill.controller.handlePointerDown(event)}
|
|
6551
7052
|
/>}
|
|
6552
|
-
</
|
|
7053
|
+
</Show16>
|
|
6553
7054
|
{
|
|
6554
7055
|
/* 埋めたあとのボタン(左上の位置)。 */
|
|
6555
7056
|
}
|
|
6556
|
-
<
|
|
6557
|
-
{(snapshot2) => <
|
|
7057
|
+
<Show16 when={filled()}>
|
|
7058
|
+
{(snapshot2) => <Show16 when={chip()}>
|
|
6558
7059
|
{(position) => <FillOptionsChip
|
|
6559
7060
|
fill={props.fill}
|
|
6560
7061
|
x={props.leadingWidth + position().x}
|
|
@@ -6562,8 +7063,8 @@ function FillHandleLayer(props) {
|
|
|
6562
7063
|
kind={snapshot2().kind}
|
|
6563
7064
|
menuOpen={snapshot2().menu !== null}
|
|
6564
7065
|
/>}
|
|
6565
|
-
</
|
|
6566
|
-
</
|
|
7066
|
+
</Show16>}
|
|
7067
|
+
</Show16>
|
|
6567
7068
|
</>;
|
|
6568
7069
|
}
|
|
6569
7070
|
function FillOptionsChip(props) {
|
|
@@ -6584,7 +7085,7 @@ function FillOptionsChip(props) {
|
|
|
6584
7085
|
class={["ssg-fill-options", { "ssg-fill-options--open": props.menuOpen }]}
|
|
6585
7086
|
style={{ position: "absolute", left: px(props.x), top: px(props.y) }}
|
|
6586
7087
|
data-ssg-fill-options=""
|
|
6587
|
-
aria-label={
|
|
7088
|
+
aria-label={formatLocaleText8(texts().fillOptionsCurrent, {
|
|
6588
7089
|
kind: props.kind === "series" ? texts().fillSeries : texts().fillCopy
|
|
6589
7090
|
})}
|
|
6590
7091
|
aria-haspopup="menu"
|
|
@@ -6606,7 +7107,7 @@ function FillOptionsChip(props) {
|
|
|
6606
7107
|
stroke-linecap="round"
|
|
6607
7108
|
stroke-linejoin="round"
|
|
6608
7109
|
aria-hidden="true"
|
|
6609
|
-
{...
|
|
7110
|
+
{...SVG_NOT_FOCUSABLE4}
|
|
6610
7111
|
>
|
|
6611
7112
|
<rect x="2.5" y="2.5" width="7" height="7" rx="1" />
|
|
6612
7113
|
<path d="M6 10.5h7.5M10 7.5l3.5 3-3.5 3" />
|
|
@@ -6650,7 +7151,7 @@ function FillOptionsMenu(props) {
|
|
|
6650
7151
|
}
|
|
6651
7152
|
event.stopPropagation();
|
|
6652
7153
|
};
|
|
6653
|
-
const element = <
|
|
7154
|
+
const element = <Show16 when={container}>
|
|
6654
7155
|
{(mount) => <Portal4 mount={mount()}>
|
|
6655
7156
|
<div
|
|
6656
7157
|
ref={(node) => {
|
|
@@ -6666,7 +7167,7 @@ function FillOptionsMenu(props) {
|
|
|
6666
7167
|
onKeyDown={handleKeyDown}
|
|
6667
7168
|
onContextMenu={(event) => event.preventDefault()}
|
|
6668
7169
|
>
|
|
6669
|
-
<
|
|
7170
|
+
<For9 each={MENU_ITEMS}>
|
|
6670
7171
|
{(item) => {
|
|
6671
7172
|
const disabled = () => item.kind === "series" && !props.seriesAvailable;
|
|
6672
7173
|
const checked = () => item.kind === props.kind;
|
|
@@ -6685,10 +7186,10 @@ function FillOptionsMenu(props) {
|
|
|
6685
7186
|
<span class="ssg-menu-label">{texts()[item.label]}</span>
|
|
6686
7187
|
</button>;
|
|
6687
7188
|
}}
|
|
6688
|
-
</
|
|
7189
|
+
</For9>
|
|
6689
7190
|
</div>
|
|
6690
7191
|
</Portal4>}
|
|
6691
|
-
</
|
|
7192
|
+
</Show16>;
|
|
6692
7193
|
createPortalTokens(panel, () => props.themeClassName, () => null);
|
|
6693
7194
|
return element;
|
|
6694
7195
|
}
|
|
@@ -6700,10 +7201,10 @@ function FillTooltip(props) {
|
|
|
6700
7201
|
subscribe: props.fill.controller.subscribePointer,
|
|
6701
7202
|
getSnapshot: props.fill.controller.getPointerSnapshot
|
|
6702
7203
|
}, "fillPointerStore");
|
|
6703
|
-
const visible =
|
|
6704
|
-
const container =
|
|
7204
|
+
const visible = createMemo17(() => pointer() !== null);
|
|
7205
|
+
const container = createMemo17(() => visible() ? portal.container() : null);
|
|
6705
7206
|
const [tooltip, setTooltip] = createSignal12();
|
|
6706
|
-
const element = <
|
|
7207
|
+
const element = <Show16 when={container()}>
|
|
6707
7208
|
{(mount) => <Portal4 mount={mount()}>
|
|
6708
7209
|
<div
|
|
6709
7210
|
ref={setTooltip}
|
|
@@ -6718,22 +7219,22 @@ function FillTooltip(props) {
|
|
|
6718
7219
|
{props.text}
|
|
6719
7220
|
</div>
|
|
6720
7221
|
</Portal4>}
|
|
6721
|
-
</
|
|
7222
|
+
</Show16>;
|
|
6722
7223
|
createPortalTokens(tooltip, () => props.themeClassName, () => null);
|
|
6723
7224
|
return element;
|
|
6724
7225
|
}
|
|
6725
7226
|
function FillHandlePortals(props) {
|
|
6726
|
-
const menu =
|
|
7227
|
+
const menu = createMemo17(() => {
|
|
6727
7228
|
const snapshot2 = props.fill.snapshot();
|
|
6728
7229
|
return snapshot2.status === "filled" && snapshot2.menu !== null ? snapshot2 : null;
|
|
6729
7230
|
});
|
|
6730
|
-
const tooltipText =
|
|
7231
|
+
const tooltipText = createMemo17(() => {
|
|
6731
7232
|
const snapshot2 = props.fill.snapshot();
|
|
6732
7233
|
return snapshot2.status === "dragging" ? snapshot2.previewText : null;
|
|
6733
7234
|
});
|
|
6734
7235
|
return <>
|
|
6735
|
-
<
|
|
6736
|
-
{(snapshot2) => <
|
|
7236
|
+
<Show16 when={menu()}>
|
|
7237
|
+
{(snapshot2) => <Show16 when={snapshot2().menu}>
|
|
6737
7238
|
{(layout) => <FillOptionsMenu
|
|
6738
7239
|
fill={props.fill}
|
|
6739
7240
|
layout={layout()}
|
|
@@ -6741,11 +7242,11 @@ function FillHandlePortals(props) {
|
|
|
6741
7242
|
seriesAvailable={snapshot2().seriesAvailable}
|
|
6742
7243
|
themeClassName={props.themeClassName}
|
|
6743
7244
|
/>}
|
|
6744
|
-
</
|
|
6745
|
-
</
|
|
6746
|
-
<
|
|
7245
|
+
</Show16>}
|
|
7246
|
+
</Show16>
|
|
7247
|
+
<Show16 when={tooltipText() !== null}>
|
|
6747
7248
|
<FillTooltip fill={props.fill} text={tooltipText() ?? ""} themeClassName={props.themeClassName} />
|
|
6748
|
-
</
|
|
7249
|
+
</Show16>
|
|
6749
7250
|
</>;
|
|
6750
7251
|
}
|
|
6751
7252
|
|
|
@@ -6765,7 +7266,7 @@ import { resolveRelativeDateFilterKey as resolveRelativeDateFilterKey2 } from "@
|
|
|
6765
7266
|
import { DEFAULT_FILTERING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
6766
7267
|
|
|
6767
7268
|
// src/primitives/filterOrder.ts
|
|
6768
|
-
import { createMemo as
|
|
7269
|
+
import { createMemo as createMemo18 } from "solid-js";
|
|
6769
7270
|
import {
|
|
6770
7271
|
createGlobalFilteredOrderRunner,
|
|
6771
7272
|
resolveSyncGlobalFilteredOrder,
|
|
@@ -6778,11 +7279,11 @@ import {
|
|
|
6778
7279
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6779
7280
|
var sameGlobalFilterKey = (a, b) => a.rows === b.rows && a.baseOrder === b.baseOrder && a.columns === b.columns && a.needle === b.needle;
|
|
6780
7281
|
function createFilterOrder(inputs) {
|
|
6781
|
-
const visibleColumns =
|
|
6782
|
-
const globalFilterColumns =
|
|
6783
|
-
const text =
|
|
6784
|
-
const needle =
|
|
6785
|
-
const key =
|
|
7282
|
+
const visibleColumns = createMemo18(() => inputs.visibleColumns());
|
|
7283
|
+
const globalFilterColumns = createMemo18(() => toGlobalFilterColumns(visibleColumns(), inputs.globalFilterMatch()));
|
|
7284
|
+
const text = createMemo18(() => inputs.globalFilterText());
|
|
7285
|
+
const needle = createMemo18(() => text().trim().toLowerCase());
|
|
7286
|
+
const key = createMemo18(
|
|
6786
7287
|
() => ({
|
|
6787
7288
|
rows: inputs.rows(),
|
|
6788
7289
|
baseOrder: inputs.baseOrder(),
|
|
@@ -6792,30 +7293,30 @@ function createFilterOrder(inputs) {
|
|
|
6792
7293
|
{ equals: sameGlobalFilterKey }
|
|
6793
7294
|
);
|
|
6794
7295
|
const enabled = () => inputs.globalFilterEnabled() && !inputs.manualFiltering();
|
|
6795
|
-
const syncResult =
|
|
7296
|
+
const syncResult = createMemo18(() => resolveSyncGlobalFilteredOrder(key(), text(), enabled()));
|
|
6796
7297
|
const runner = createGlobalFilteredOrderRunner();
|
|
6797
7298
|
connectController(runner, () => ({ ...key(), needsAsync: syncResult() === null }), "render", "globalFilter");
|
|
6798
7299
|
const snapshot2 = createExternalStoreSignal(runner, "globalFilterStore");
|
|
6799
|
-
const result =
|
|
6800
|
-
const columnFilters =
|
|
6801
|
-
const relativeDateFilterActive =
|
|
7300
|
+
const result = createMemo18(() => selectGlobalFilteredOrderResult(syncResult(), snapshot2(), key()));
|
|
7301
|
+
const columnFilters = createMemo18(() => inputs.columnFilters());
|
|
7302
|
+
const relativeDateFilterActive = createMemo18(
|
|
6802
7303
|
() => inputs.isServerSide() ? inputs.columnFilterEnabled() && columnFiltersUseRelativeDate(columnFilters()) : !inputs.manualFiltering() && columnFiltersUseRelativeDate(columnFilters())
|
|
6803
7304
|
);
|
|
6804
7305
|
connectController(inputs.dateRollover, () => ({ active: relativeDateFilterActive() }), "render", "dateRollover");
|
|
6805
7306
|
const relativeDateSnapshot = createExternalStoreSignal(inputs.dateRollover, "dateRolloverStore");
|
|
6806
|
-
const relativeDateKey =
|
|
7307
|
+
const relativeDateKey = createMemo18(
|
|
6807
7308
|
() => relativeDateFilterActive() ? resolveRelativeDateFilterKey(inputs.effectiveColumns(), columnFilters(), relativeDateSnapshot()) : ""
|
|
6808
7309
|
);
|
|
6809
7310
|
return {
|
|
6810
|
-
globalFilteredOrder:
|
|
6811
|
-
globalFilterStatus:
|
|
6812
|
-
globalFilterProgress:
|
|
7311
|
+
globalFilteredOrder: createMemo18(() => result().order),
|
|
7312
|
+
globalFilterStatus: createMemo18(() => result().status),
|
|
7313
|
+
globalFilterProgress: createMemo18(() => result().progress),
|
|
6813
7314
|
relativeDateKey
|
|
6814
7315
|
};
|
|
6815
7316
|
}
|
|
6816
7317
|
|
|
6817
7318
|
// src/primitives/filterPopover.ts
|
|
6818
|
-
import { createMemo as
|
|
7319
|
+
import { createMemo as createMemo19, createSignal as createSignal13, untrack as untrack14 } from "solid-js";
|
|
6819
7320
|
import {
|
|
6820
7321
|
createFilterPopoverController,
|
|
6821
7322
|
resolveOpenedFilterColumn
|
|
@@ -6853,15 +7354,15 @@ function createFilterPopover(inputs) {
|
|
|
6853
7354
|
}
|
|
6854
7355
|
return result.filterType;
|
|
6855
7356
|
});
|
|
6856
|
-
const groupColumns =
|
|
6857
|
-
const popoverColumns =
|
|
7357
|
+
const groupColumns = createMemo19(() => inputs.groupColumns?.() ?? NO_GROUP_COLUMNS);
|
|
7358
|
+
const popoverColumns = createMemo19(() => {
|
|
6858
7359
|
const groups = groupColumns();
|
|
6859
7360
|
return groups.length > 0 ? [...inputs.visibleColumns(), ...groups] : inputs.visibleColumns();
|
|
6860
7361
|
});
|
|
6861
7362
|
const resolveAnchorColumnKey = (columnKey) => untrack14(groupColumns).some((column) => column.key === columnKey) ? GROUP_AUTO_COLUMN_KEY : columnKey;
|
|
6862
7363
|
const snapshot2 = createExternalStoreSignal(controller, "filterPopoverStore");
|
|
6863
|
-
const state =
|
|
6864
|
-
const layout =
|
|
7364
|
+
const state = createMemo19(() => snapshot2().state);
|
|
7365
|
+
const layout = createMemo19(() => snapshot2().layout);
|
|
6865
7366
|
const [panel, setPanel] = createSignal13(null);
|
|
6866
7367
|
connectController(
|
|
6867
7368
|
controller,
|
|
@@ -6881,9 +7382,9 @@ function createFilterPopover(inputs) {
|
|
|
6881
7382
|
"effect",
|
|
6882
7383
|
"filterPopover"
|
|
6883
7384
|
);
|
|
6884
|
-
const openedColumnKey =
|
|
6885
|
-
const openedFilterType =
|
|
6886
|
-
const openedColumn =
|
|
7385
|
+
const openedColumnKey = createMemo19(() => state()?.columnKey ?? null);
|
|
7386
|
+
const openedFilterType = createMemo19(() => state()?.filterType ?? null);
|
|
7387
|
+
const openedColumn = createMemo19(() => {
|
|
6887
7388
|
openedColumnKey();
|
|
6888
7389
|
openedFilterType();
|
|
6889
7390
|
return resolveOpenedFilterColumn(popoverColumns(), untrack14(state));
|
|
@@ -6893,7 +7394,7 @@ function createFilterPopover(inputs) {
|
|
|
6893
7394
|
layout,
|
|
6894
7395
|
openedColumn,
|
|
6895
7396
|
openedFilterType,
|
|
6896
|
-
isOpen:
|
|
7397
|
+
isOpen: createMemo19(() => state() !== null),
|
|
6897
7398
|
setPanel: (element) => {
|
|
6898
7399
|
controller.panelRef.current = element;
|
|
6899
7400
|
setPanel(element);
|
|
@@ -6911,13 +7412,13 @@ function createFilterPopover(inputs) {
|
|
|
6911
7412
|
}
|
|
6912
7413
|
|
|
6913
7414
|
// src/primitives/filterManagement.ts
|
|
6914
|
-
import { createMemo as
|
|
7415
|
+
import { createMemo as createMemo20, onCleanup as onCleanup12, untrack as untrack15 } from "solid-js";
|
|
6915
7416
|
import {
|
|
6916
7417
|
createColumnFilterDescribeOptions,
|
|
6917
7418
|
describeColumnFilterValue
|
|
6918
7419
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
6919
7420
|
import { isActiveColumnFilterValue as isActiveColumnFilterValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6920
|
-
import { formatLocaleText as
|
|
7421
|
+
import { formatLocaleText as formatLocaleText9 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
6921
7422
|
import {
|
|
6922
7423
|
computeSinglePaneColumnExtent as computeSinglePaneColumnExtent2
|
|
6923
7424
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry";
|
|
@@ -6927,11 +7428,12 @@ import { isInsideDetailCardOf as isInsideDetailCardOf2 } from "@ishibashi0112/sp
|
|
|
6927
7428
|
var NO_COLUMNS2 = [];
|
|
6928
7429
|
var JUMP_FLASH_CLASS_NAME = "ssg-header-cell--jump-flash";
|
|
6929
7430
|
function createFilterManagement(inputs) {
|
|
6930
|
-
const groupColumns =
|
|
6931
|
-
const groupColumnKeys =
|
|
6932
|
-
const entries =
|
|
7431
|
+
const groupColumns = createMemo20(() => inputs.groupColumns?.() ?? NO_COLUMNS2);
|
|
7432
|
+
const groupColumnKeys = createMemo20(() => new Set(groupColumns().map((column) => column.key)));
|
|
7433
|
+
const entries = createMemo20(() => {
|
|
6933
7434
|
const columnFilters = inputs.columnFilters();
|
|
6934
7435
|
const texts = inputs.localeTexts();
|
|
7436
|
+
const titles = inputs.columnTitles?.();
|
|
6935
7437
|
const result = [];
|
|
6936
7438
|
const pushEntry = (column, isHidden, isGrouped = false) => {
|
|
6937
7439
|
const value = columnFilters[column.key];
|
|
@@ -6940,7 +7442,7 @@ function createFilterManagement(inputs) {
|
|
|
6940
7442
|
}
|
|
6941
7443
|
result.push({
|
|
6942
7444
|
columnKey: column.key,
|
|
6943
|
-
title: column.title || column.key,
|
|
7445
|
+
title: titles?.get(column.key) ?? (column.title || column.key),
|
|
6944
7446
|
// select / set の値はラベルで、数値の条件は列の valueFormatter で出します(チップのバーと共有)。
|
|
6945
7447
|
summaryText: describeColumnFilterValue(value, createColumnFilterDescribeOptions(column, texts)),
|
|
6946
7448
|
isHidden,
|
|
@@ -6961,13 +7463,14 @@ function createFilterManagement(inputs) {
|
|
|
6961
7463
|
}
|
|
6962
7464
|
return result;
|
|
6963
7465
|
});
|
|
6964
|
-
const addableColumns =
|
|
7466
|
+
const addableColumns = createMemo20(() => {
|
|
6965
7467
|
const columnFilters = inputs.columnFilters();
|
|
6966
7468
|
const texts = inputs.localeTexts();
|
|
7469
|
+
const titles = inputs.columnTitles?.();
|
|
6967
7470
|
const grouped = groupColumnKeys();
|
|
6968
7471
|
return [...inputs.visibleColumns(), ...groupColumns()].filter((column) => Boolean(column.filterType) && !isActiveColumnFilterValue2(columnFilters[column.key])).map((column) => ({
|
|
6969
7472
|
key: column.key,
|
|
6970
|
-
title: grouped.has(column.key) ?
|
|
7473
|
+
title: grouped.has(column.key) ? formatLocaleText9(texts.groupedColumnTitle, { column: column.title || column.key }) : titles?.get(column.key) ?? (column.title || column.key)
|
|
6971
7474
|
}));
|
|
6972
7475
|
});
|
|
6973
7476
|
const pendingFrames = /* @__PURE__ */ new Set();
|
|
@@ -7051,7 +7554,7 @@ function createFilterManagement(inputs) {
|
|
|
7051
7554
|
}
|
|
7052
7555
|
|
|
7053
7556
|
// src/view/ColumnFilterPopoverHost.tsx
|
|
7054
|
-
import { Show as
|
|
7557
|
+
import { Show as Show17, createMemo as createMemo21, untrack as untrack16 } from "solid-js";
|
|
7055
7558
|
import {
|
|
7056
7559
|
createFilterPopoverCommands,
|
|
7057
7560
|
createFilterPopoverDerivedResolver
|
|
@@ -7078,17 +7581,17 @@ import {
|
|
|
7078
7581
|
describeColumnFilterValue as describeColumnFilterValue2
|
|
7079
7582
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filterSummary";
|
|
7080
7583
|
import { normalizeDateFilterPresets } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
|
|
7081
|
-
import { formatLocaleText as
|
|
7584
|
+
import { formatLocaleText as formatLocaleText10 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7082
7585
|
import { getCellValue as getCellValue4 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
7083
7586
|
function ColumnFilterPopoverHost(props) {
|
|
7084
7587
|
const filterPopover = props.filterPopover;
|
|
7085
7588
|
const openedColumn = filterPopover.openedColumn;
|
|
7086
7589
|
const openedType = filterPopover.openedFilterType;
|
|
7087
|
-
const openedOptionsKey =
|
|
7590
|
+
const openedOptionsKey = createMemo21(() => {
|
|
7088
7591
|
const column = openedColumn();
|
|
7089
7592
|
return column ? String(column.key) : null;
|
|
7090
7593
|
});
|
|
7091
|
-
const optionRowsHold =
|
|
7594
|
+
const optionRowsHold = createMemo21((prev) => {
|
|
7092
7595
|
const key = openedOptionsKey();
|
|
7093
7596
|
const rows = props.rows;
|
|
7094
7597
|
if (key === null) {
|
|
@@ -7099,9 +7602,9 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7099
7602
|
}
|
|
7100
7603
|
return prev;
|
|
7101
7604
|
});
|
|
7102
|
-
const optionRows =
|
|
7103
|
-
const openedIsDateSet =
|
|
7104
|
-
const getOpenedColumnRawValueAt =
|
|
7605
|
+
const optionRows = createMemo21(() => optionRowsHold().rows);
|
|
7606
|
+
const openedIsDateSet = createMemo21(() => openedType() === "dateSet");
|
|
7607
|
+
const getOpenedColumnRawValueAt = createMemo21(() => {
|
|
7105
7608
|
const rows = optionRows();
|
|
7106
7609
|
const column = openedColumn();
|
|
7107
7610
|
const isDateSet = openedIsDateSet();
|
|
@@ -7113,7 +7616,7 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7113
7616
|
return isDateSet ? toDateSetKey(value) : value;
|
|
7114
7617
|
};
|
|
7115
7618
|
});
|
|
7116
|
-
const usesAsyncOptions =
|
|
7619
|
+
const usesAsyncOptions = createMemo21(() => {
|
|
7117
7620
|
const column = openedColumn();
|
|
7118
7621
|
return props.getFilterOptions != null && column != null && isSelectLikeFilterType(openedType()) && !(column.filterOptions && column.filterOptions.length > 0);
|
|
7119
7622
|
});
|
|
@@ -7130,12 +7633,12 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7130
7633
|
};
|
|
7131
7634
|
}, "render", "filterOptionsSource");
|
|
7132
7635
|
const asyncSnapshot = createExternalStoreSignal(asyncSource, "filterOptionsStore");
|
|
7133
|
-
const collectColumn =
|
|
7134
|
-
const numeric =
|
|
7135
|
-
const syncResult =
|
|
7636
|
+
const collectColumn = createMemo21(() => usesAsyncOptions() ? null : openedColumn());
|
|
7637
|
+
const numeric = createMemo21(() => openedType() === "numberSet");
|
|
7638
|
+
const syncResult = createMemo21(
|
|
7136
7639
|
() => resolveSyncSelectOptions(collectColumn(), optionRows().length, getOpenedColumnRawValueAt(), numeric())
|
|
7137
7640
|
);
|
|
7138
|
-
const sourceKey =
|
|
7641
|
+
const sourceKey = createMemo21(() => {
|
|
7139
7642
|
const column = collectColumn();
|
|
7140
7643
|
return column === null ? void 0 : String(column.key);
|
|
7141
7644
|
});
|
|
@@ -7148,14 +7651,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7148
7651
|
sourceKey: sourceKey()
|
|
7149
7652
|
}), "render", "filterValueCollector");
|
|
7150
7653
|
const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
|
|
7151
|
-
const optionsResult =
|
|
7654
|
+
const optionsResult = createMemo21(() => {
|
|
7152
7655
|
if (usesAsyncOptions()) {
|
|
7153
7656
|
return selectAsyncOptionsResult(asyncSnapshot(), openedColumn()?.key ?? null);
|
|
7154
7657
|
}
|
|
7155
7658
|
return syncResult() ?? selectCollectorResult(collectorSnapshot(), optionRows().length, getOpenedColumnRawValueAt(), sourceKey());
|
|
7156
7659
|
});
|
|
7157
7660
|
const resolveDerived = createFilterPopoverDerivedResolver();
|
|
7158
|
-
const derived =
|
|
7661
|
+
const derived = createMemo21(
|
|
7159
7662
|
() => resolveDerived({
|
|
7160
7663
|
openedFilterColumn: openedColumn(),
|
|
7161
7664
|
openedFilterType: openedType(),
|
|
@@ -7179,14 +7682,14 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7179
7682
|
filterTexts: props.localeTexts
|
|
7180
7683
|
}), "render", "filterPopoverCommands");
|
|
7181
7684
|
const texts = () => props.localeTexts;
|
|
7182
|
-
const currentValueText =
|
|
7685
|
+
const currentValueText = createMemo21(() => {
|
|
7183
7686
|
const column = openedColumn();
|
|
7184
7687
|
if (!column) {
|
|
7185
7688
|
return texts().filterCurrentNone;
|
|
7186
7689
|
}
|
|
7187
7690
|
const rawValue = props.columnFilters[column.key];
|
|
7188
7691
|
if (isSetColumnFilterValue(rawValue)) {
|
|
7189
|
-
return
|
|
7692
|
+
return formatLocaleText10(rawValue.mode === "exclude" ? texts().filterCurrentExcluded : texts().filterCurrentSelected, {
|
|
7190
7693
|
count: rawValue.values.length
|
|
7191
7694
|
});
|
|
7192
7695
|
}
|
|
@@ -7196,16 +7699,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7196
7699
|
const text = columnFilterValueToDraftText(rawValue);
|
|
7197
7700
|
return text.trim() ? text : texts().filterCurrentNone;
|
|
7198
7701
|
});
|
|
7199
|
-
const datePresets =
|
|
7702
|
+
const datePresets = createMemo21(() => {
|
|
7200
7703
|
const column = openedColumn();
|
|
7201
7704
|
return column ? normalizeDateFilterPresets(column.dateFilterPresets, props.localeTexts) : void 0;
|
|
7202
7705
|
});
|
|
7203
|
-
const comboSummaryText =
|
|
7706
|
+
const comboSummaryText = createMemo21(() => {
|
|
7204
7707
|
const column = openedColumn();
|
|
7205
7708
|
const value = derived().openedSetFilterValue;
|
|
7206
7709
|
return column && value && isActiveColumnFilterValue3(value) ? describeColumnFilterValue2(value, createColumnFilterDescribeOptions2(column, props.localeTexts)) : props.localeTexts.filterNone;
|
|
7207
7710
|
});
|
|
7208
|
-
const renderDateInput =
|
|
7711
|
+
const renderDateInput = createMemo21(() => {
|
|
7209
7712
|
const render = props.renderFilterDateInput;
|
|
7210
7713
|
const column = openedColumn();
|
|
7211
7714
|
if (!render || !column) {
|
|
@@ -7224,16 +7727,16 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7224
7727
|
columnKey
|
|
7225
7728
|
});
|
|
7226
7729
|
});
|
|
7227
|
-
return <
|
|
7228
|
-
{(column) => <
|
|
7229
|
-
{(layout) => <
|
|
7730
|
+
return <Show17 when={openedColumn()}>
|
|
7731
|
+
{(column) => <Show17 when={filterPopover.layout()}>
|
|
7732
|
+
{(layout) => <Show17 when={props.views()}>
|
|
7230
7733
|
{(views) => {
|
|
7231
7734
|
const ColumnFilterPopover = untrack16(views).ColumnFilterPopover;
|
|
7232
|
-
return <
|
|
7735
|
+
return <Show17 when={column().key} keyed>
|
|
7233
7736
|
{(columnKey) => <ColumnFilterPopover
|
|
7234
7737
|
popoverSlot={props.popoverSlot}
|
|
7235
7738
|
themeClassName={props.themeClassName}
|
|
7236
|
-
title={column().title || columnKey}
|
|
7739
|
+
title={props.columnTitles?.get(columnKey) ?? (column().title || columnKey)}
|
|
7237
7740
|
filterType={openedType() ?? "text"}
|
|
7238
7741
|
isServerSide={props.isServerSide && !usesAsyncOptions()}
|
|
7239
7742
|
draftValue={filterPopover.state()?.draftValue ?? ""}
|
|
@@ -7270,22 +7773,22 @@ function ColumnFilterPopoverHost(props) {
|
|
|
7270
7773
|
onSetClear={commands.clearSetFilterPopoverValue}
|
|
7271
7774
|
onSetReplaceSelection={commands.handleSetFilterReplaceSelection}
|
|
7272
7775
|
/>}
|
|
7273
|
-
</
|
|
7776
|
+
</Show17>;
|
|
7274
7777
|
}}
|
|
7275
|
-
</
|
|
7276
|
-
</
|
|
7277
|
-
</
|
|
7778
|
+
</Show17>}
|
|
7779
|
+
</Show17>}
|
|
7780
|
+
</Show17>;
|
|
7278
7781
|
}
|
|
7279
7782
|
|
|
7280
7783
|
// src/view/GridFilterChipBar.tsx
|
|
7281
|
-
import { For as
|
|
7282
|
-
import { formatLocaleText as
|
|
7784
|
+
import { For as For10, Show as Show18, createUniqueId as createUniqueId5 } from "solid-js";
|
|
7785
|
+
import { formatLocaleText as formatLocaleText11 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7283
7786
|
function GridFilterChipBar(props) {
|
|
7284
7787
|
const texts = useFeatureLocaleText();
|
|
7285
7788
|
const chipIdBase = createUniqueId5();
|
|
7286
|
-
return <
|
|
7789
|
+
return <Show18 when={props.entries.length > 0}>
|
|
7287
7790
|
<div class={["ssg-filter-chip-bar", props.slot?.className]} style={props.slot?.style}>
|
|
7288
|
-
<
|
|
7791
|
+
<For10 each={props.entries} keyed={(entry) => entry.columnKey}>
|
|
7289
7792
|
{(entry, index) => <div class={entry().isHidden ? "ssg-filter-chip ssg-filter-chip--hidden" : "ssg-filter-chip"}>
|
|
7290
7793
|
<button
|
|
7291
7794
|
type="button"
|
|
@@ -7308,7 +7811,7 @@ function GridFilterChipBar(props) {
|
|
|
7308
7811
|
class="ssg-filter-chip-clear"
|
|
7309
7812
|
disabled={!props.canFilter}
|
|
7310
7813
|
data-ssg-tooltip={texts().filterClear}
|
|
7311
|
-
aria-label={
|
|
7814
|
+
aria-label={formatLocaleText11(texts().filterClearFor, { column: entry().title })}
|
|
7312
7815
|
onClick={() => props.onClearFilter(entry().columnKey)}
|
|
7313
7816
|
>
|
|
7314
7817
|
×
|
|
@@ -7317,10 +7820,10 @@ function GridFilterChipBar(props) {
|
|
|
7317
7820
|
/* 名前の後半(操作の説明)。ボタンの中に置くと文字に混ざるので外に置きます。 */
|
|
7318
7821
|
}
|
|
7319
7822
|
<span id={`${chipIdBase}-${index()}-action`} hidden>
|
|
7320
|
-
{
|
|
7823
|
+
{formatLocaleText11(texts().filterEditFor, { column: entry().title })}
|
|
7321
7824
|
</span>
|
|
7322
7825
|
</div>}
|
|
7323
|
-
</
|
|
7826
|
+
</For10>
|
|
7324
7827
|
<button
|
|
7325
7828
|
type="button"
|
|
7326
7829
|
class="ssg-filter-chip-bar-clear-all"
|
|
@@ -7330,15 +7833,15 @@ function GridFilterChipBar(props) {
|
|
|
7330
7833
|
{texts().clearAll}
|
|
7331
7834
|
</button>
|
|
7332
7835
|
</div>
|
|
7333
|
-
</
|
|
7836
|
+
</Show18>;
|
|
7334
7837
|
}
|
|
7335
7838
|
|
|
7336
7839
|
// src/view/lazyPopups.ts
|
|
7337
|
-
import { createEffect as createEffect8, createMemo as
|
|
7840
|
+
import { createEffect as createEffect8, createMemo as createMemo22 } from "solid-js";
|
|
7338
7841
|
import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
|
|
7339
7842
|
import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
|
|
7340
7843
|
var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-D7INPNVB.jsx"));
|
|
7341
|
-
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-
|
|
7844
|
+
var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-BRH5PCOI.jsx"));
|
|
7342
7845
|
var preloadGridPopups = async () => {
|
|
7343
7846
|
await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
|
|
7344
7847
|
};
|
|
@@ -7348,7 +7851,7 @@ var reportLoadError = (error) => {
|
|
|
7348
7851
|
function createLazyModuleSignal(module, options, name) {
|
|
7349
7852
|
const loaded = createExternalStoreSignal(module, `${name}Module`);
|
|
7350
7853
|
createEffect8(
|
|
7351
|
-
|
|
7854
|
+
createMemo22(() => options.needed() && loaded() === null),
|
|
7352
7855
|
(shouldLoad) => {
|
|
7353
7856
|
if (!shouldLoad) {
|
|
7354
7857
|
return;
|
|
@@ -7367,7 +7870,7 @@ function createLazyModuleSignal(module, options, name) {
|
|
|
7367
7870
|
{ name: `${name}Load` }
|
|
7368
7871
|
);
|
|
7369
7872
|
createEffect8(
|
|
7370
|
-
|
|
7873
|
+
createMemo22(() => options.prefetch() && module.getSnapshot() === null),
|
|
7371
7874
|
(shouldPrefetch) => {
|
|
7372
7875
|
if (!shouldPrefetch) {
|
|
7373
7876
|
return;
|
|
@@ -7538,14 +8041,14 @@ import { buildGroupTree, flattenGroupTree } from "@ishibashi0112/spreadsheet-gri
|
|
|
7538
8041
|
import { DEFAULT_GROUPING_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7539
8042
|
|
|
7540
8043
|
// src/view/GridBodyGroupRow.tsx
|
|
7541
|
-
import { For as
|
|
8044
|
+
import { For as For11, Show as Show19, createMemo as createMemo23 } from "solid-js";
|
|
7542
8045
|
import { GROUP_AUTO_COLUMN_KEY as GROUP_AUTO_COLUMN_KEY3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
|
|
7543
8046
|
import {
|
|
7544
8047
|
formatTotalRowCellText,
|
|
7545
8048
|
formatTotalRowNumber,
|
|
7546
8049
|
resolveTotalRowCaption
|
|
7547
8050
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
7548
|
-
import { formatLocaleText as
|
|
8051
|
+
import { formatLocaleText as formatLocaleText12 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7549
8052
|
var GROUP_INDENT_PX = 16;
|
|
7550
8053
|
function GridBodyGroupRow(props) {
|
|
7551
8054
|
const texts = useFeatureLocaleText();
|
|
@@ -7568,7 +8071,7 @@ function GridBodyGroupRow(props) {
|
|
|
7568
8071
|
}}
|
|
7569
8072
|
onDblClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
7570
8073
|
>
|
|
7571
|
-
<
|
|
8074
|
+
<Show19 when={props.ownsRowHeader}>
|
|
7572
8075
|
<div
|
|
7573
8076
|
role={rowHeaderIsCell() ? "rowheader" : void 0}
|
|
7574
8077
|
aria-colindex={rowHeaderIsCell() ? 1 : void 0}
|
|
@@ -7593,13 +8096,13 @@ function GridBodyGroupRow(props) {
|
|
|
7593
8096
|
>
|
|
7594
8097
|
{props.showRowCheckbox ? null : props.rowIndex + 1}
|
|
7595
8098
|
</div>
|
|
7596
|
-
</
|
|
7597
|
-
<
|
|
8099
|
+
</Show19>
|
|
8100
|
+
<For11 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
7598
8101
|
{(entry) => {
|
|
7599
|
-
const unbound =
|
|
8102
|
+
const unbound = createMemo23(() => entry().column);
|
|
7600
8103
|
const column = () => unbound();
|
|
7601
8104
|
const isAutoGroupColumn = () => column().key === GROUP_AUTO_COLUMN_KEY3;
|
|
7602
|
-
const aggregate =
|
|
8105
|
+
const aggregate = createMemo23(() => {
|
|
7603
8106
|
const current = column();
|
|
7604
8107
|
if (isAutoGroupColumn() || !Object.prototype.hasOwnProperty.call(props.groupRow.aggregates, current.key)) {
|
|
7605
8108
|
return null;
|
|
@@ -7636,19 +8139,19 @@ function GridBodyGroupRow(props) {
|
|
|
7636
8139
|
"z-index": 1
|
|
7637
8140
|
}}
|
|
7638
8141
|
>
|
|
7639
|
-
<
|
|
8142
|
+
<Show19
|
|
7640
8143
|
when={isAutoGroupColumn()}
|
|
7641
|
-
fallback={<
|
|
8144
|
+
fallback={<Show19 when={aggregate()}>
|
|
7642
8145
|
{(shown) => <span
|
|
7643
8146
|
class="ssg-group-value"
|
|
7644
8147
|
data-ssg-tooltip-overflow={shown().text !== "" ? shown().caption !== void 0 ? `${shown().caption} ${shown().text}` : shown().text : void 0}
|
|
7645
8148
|
>
|
|
7646
|
-
<
|
|
8149
|
+
<Show19 when={shown().caption !== void 0 && shown().text !== ""}>
|
|
7647
8150
|
<span class="ssg-group-caption">{shown().caption}</span>
|
|
7648
|
-
</
|
|
8151
|
+
</Show19>
|
|
7649
8152
|
{shown().text}
|
|
7650
8153
|
</span>}
|
|
7651
|
-
</
|
|
8154
|
+
</Show19>}
|
|
7652
8155
|
>
|
|
7653
8156
|
<span
|
|
7654
8157
|
aria-hidden="true"
|
|
@@ -7660,7 +8163,7 @@ function GridBodyGroupRow(props) {
|
|
|
7660
8163
|
tabindex={-1}
|
|
7661
8164
|
class="ssg-group-toggle"
|
|
7662
8165
|
aria-expanded={props.isCollapsed ? "false" : "true"}
|
|
7663
|
-
aria-label={
|
|
8166
|
+
aria-label={formatLocaleText12(props.isCollapsed ? texts().expandGroup : texts().collapseGroup, {
|
|
7664
8167
|
group: groupLabel()
|
|
7665
8168
|
})}
|
|
7666
8169
|
onClick={() => props.onGroupToggle(props.groupRow.groupKey)}
|
|
@@ -7670,12 +8173,12 @@ function GridBodyGroupRow(props) {
|
|
|
7670
8173
|
</button>
|
|
7671
8174
|
<span class="ssg-group-label">{groupLabel()}</span>
|
|
7672
8175
|
<span class="ssg-group-count">
|
|
7673
|
-
{
|
|
8176
|
+
{formatLocaleText12(texts().groupRowCount, { count: formatTotalRowNumber(props.groupRow.leafCount) })}
|
|
7674
8177
|
</span>
|
|
7675
|
-
</
|
|
8178
|
+
</Show19>
|
|
7676
8179
|
</div>;
|
|
7677
8180
|
}}
|
|
7678
|
-
</
|
|
8181
|
+
</For11>
|
|
7679
8182
|
</div>;
|
|
7680
8183
|
}
|
|
7681
8184
|
|
|
@@ -7708,12 +8211,12 @@ import {
|
|
|
7708
8211
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
7709
8212
|
|
|
7710
8213
|
// src/view/GridBodyLabelRow.tsx
|
|
7711
|
-
import { Show as
|
|
8214
|
+
import { Show as Show20, createMemo as createMemo24 } from "solid-js";
|
|
7712
8215
|
var createLabelRowRenderContext = (labelRow, rowIndex, rowKey) => {
|
|
7713
|
-
const row =
|
|
7714
|
-
const sourceRowIndex =
|
|
7715
|
-
const label =
|
|
7716
|
-
const sectionRowCount =
|
|
8216
|
+
const row = createMemo24(() => labelRow().row);
|
|
8217
|
+
const sourceRowIndex = createMemo24(() => labelRow().sourceIndex);
|
|
8218
|
+
const label = createMemo24(() => labelRow().label);
|
|
8219
|
+
const sectionRowCount = createMemo24(() => labelRow().sectionRowCount);
|
|
7717
8220
|
return {
|
|
7718
8221
|
get row() {
|
|
7719
8222
|
return row();
|
|
@@ -7758,7 +8261,7 @@ function GridBodyLabelRow(props) {
|
|
|
7758
8261
|
transform: `translateY(${props.top}px)`
|
|
7759
8262
|
}}
|
|
7760
8263
|
>
|
|
7761
|
-
<
|
|
8264
|
+
<Show20 when={props.ownsRowHeader}>
|
|
7762
8265
|
<div
|
|
7763
8266
|
aria-hidden="true"
|
|
7764
8267
|
class={["ssg-header-cell", "ssg-row-header-cell", "ssg-row-header-cell--label", props.slots.rowHeaderCell?.className]}
|
|
@@ -7769,8 +8272,8 @@ function GridBodyLabelRow(props) {
|
|
|
7769
8272
|
height: px(props.rowHeight)
|
|
7770
8273
|
}}
|
|
7771
8274
|
/>
|
|
7772
|
-
</
|
|
7773
|
-
<
|
|
8275
|
+
</Show20>
|
|
8276
|
+
<Show20 when={props.renderContent}>
|
|
7774
8277
|
{(render) => <div
|
|
7775
8278
|
role="rowheader"
|
|
7776
8279
|
aria-colindex={1}
|
|
@@ -7784,24 +8287,24 @@ function GridBodyLabelRow(props) {
|
|
|
7784
8287
|
{render()(ctx)}
|
|
7785
8288
|
</div>
|
|
7786
8289
|
</div>}
|
|
7787
|
-
</
|
|
8290
|
+
</Show20>
|
|
7788
8291
|
</div>;
|
|
7789
8292
|
}
|
|
7790
8293
|
|
|
7791
8294
|
// src/view/GridStickyLabelLayer.tsx
|
|
7792
|
-
import { Show as
|
|
8295
|
+
import { Show as Show21, createMemo as createMemo25, onSettled as onSettled8 } from "solid-js";
|
|
7793
8296
|
var FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
7794
8297
|
function GridStickyLabelLayer(props) {
|
|
7795
|
-
return <
|
|
8298
|
+
return <Show21 when={props.entry}>
|
|
7796
8299
|
{(entry) => <StickyLabel layer={props} entry={entry} />}
|
|
7797
|
-
</
|
|
8300
|
+
</Show21>;
|
|
7798
8301
|
}
|
|
7799
8302
|
function StickyLabel(props) {
|
|
7800
8303
|
const layer = props.layer;
|
|
7801
|
-
const labelRow =
|
|
7802
|
-
const rowIndex =
|
|
7803
|
-
const rowKey =
|
|
7804
|
-
const height =
|
|
8304
|
+
const labelRow = createMemo25(() => props.entry().labelRow);
|
|
8305
|
+
const rowIndex = createMemo25(() => props.entry().rowIndex);
|
|
8306
|
+
const rowKey = createMemo25(() => props.entry().rowKey);
|
|
8307
|
+
const height = createMemo25(() => props.entry().height);
|
|
7805
8308
|
const ctx = createLabelRowRenderContext(labelRow, rowIndex, rowKey);
|
|
7806
8309
|
let element;
|
|
7807
8310
|
onSettled8(() => {
|
|
@@ -7856,7 +8359,7 @@ function StickyLabel(props) {
|
|
|
7856
8359
|
...props.entry().pushOffset > 0 ? { transform: `translateY(${-props.entry().pushOffset}px)` } : null
|
|
7857
8360
|
}}
|
|
7858
8361
|
>
|
|
7859
|
-
<
|
|
8362
|
+
<Show21 when={layer.ownsRowHeader}>
|
|
7860
8363
|
<div
|
|
7861
8364
|
class={["ssg-header-cell", "ssg-row-header-cell", "ssg-row-header-cell--label", layer.slots.rowHeaderCell?.className]}
|
|
7862
8365
|
style={{
|
|
@@ -7866,8 +8369,8 @@ function StickyLabel(props) {
|
|
|
7866
8369
|
height: px(height())
|
|
7867
8370
|
}}
|
|
7868
8371
|
/>
|
|
7869
|
-
</
|
|
7870
|
-
<
|
|
8372
|
+
</Show21>
|
|
8373
|
+
<Show21 when={layer.renderContent}>
|
|
7871
8374
|
{(render) => <div
|
|
7872
8375
|
class="ssg-label-row-content-holder"
|
|
7873
8376
|
style={{ left: px(layer.contentStickyLeft), width: px(layer.contentWidth), height: px(height()) }}
|
|
@@ -7876,12 +8379,12 @@ function StickyLabel(props) {
|
|
|
7876
8379
|
class={["ssg-label-row-content", layer.slots.labelRowContent?.className]}
|
|
7877
8380
|
style={layer.slots.labelRowContent?.style}
|
|
7878
8381
|
>
|
|
7879
|
-
<
|
|
8382
|
+
<Show21 when={[rowKey(), render()]} keyed>
|
|
7880
8383
|
{([, renderContent]) => renderContent(ctx)}
|
|
7881
|
-
</
|
|
8384
|
+
</Show21>
|
|
7882
8385
|
</div>
|
|
7883
8386
|
</div>}
|
|
7884
|
-
</
|
|
8387
|
+
</Show21>
|
|
7885
8388
|
</div>
|
|
7886
8389
|
</div>
|
|
7887
8390
|
);
|
|
@@ -7904,7 +8407,7 @@ import { createSaveStatusController } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
7904
8407
|
import { DEFAULT_SERVER_SIDE_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
7905
8408
|
|
|
7906
8409
|
// src/primitives/serverSide.ts
|
|
7907
|
-
import { createMemo as
|
|
8410
|
+
import { createMemo as createMemo26, untrack as untrack18 } from "solid-js";
|
|
7908
8411
|
import {
|
|
7909
8412
|
createServerSideRowModel
|
|
7910
8413
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/serverSideRowModel";
|
|
@@ -7941,38 +8444,38 @@ function createServerSide(args) {
|
|
|
7941
8444
|
};
|
|
7942
8445
|
const snapshot2 = createExternalStoreSignal(controller, "serverSideRowModelStore");
|
|
7943
8446
|
return {
|
|
7944
|
-
rowModel:
|
|
8447
|
+
rowModel: createMemo26(() => snapshot2().rowModel),
|
|
7945
8448
|
rowCount: () => snapshot2().rowCount,
|
|
7946
|
-
loadError:
|
|
7947
|
-
writeError:
|
|
8449
|
+
loadError: createMemo26(() => snapshot2().loadError),
|
|
8450
|
+
writeError: createMemo26(() => snapshot2().writeError),
|
|
7948
8451
|
// 追加(1.5.0 / serverSideRefetch="keep"): 取り直しの間、前の行を見せているか。
|
|
7949
|
-
refetching:
|
|
8452
|
+
refetching: createMemo26(() => snapshot2().refetching),
|
|
7950
8453
|
isRowLoaded: controller.isRowLoaded,
|
|
7951
8454
|
requestRange,
|
|
7952
8455
|
refresh: controller.refresh,
|
|
7953
8456
|
retryFailedBlocks: controller.retryFailedBlocks,
|
|
7954
8457
|
// 書き戻し先(dataSource.updateRows)があるか。無い間はシェルがすべてのセルを編集できないようにする。
|
|
7955
|
-
canUpdateRows:
|
|
8458
|
+
canUpdateRows: createMemo26(() => args().dataSource?.updateRows !== void 0),
|
|
7956
8459
|
applyCellEdits: controller.applyCellEdits
|
|
7957
8460
|
};
|
|
7958
8461
|
}
|
|
7959
8462
|
|
|
7960
8463
|
// src/view/GridServerSideErrorBars.tsx
|
|
7961
|
-
import { Show as
|
|
7962
|
-
import { formatLocaleText as
|
|
8464
|
+
import { Show as Show22, createSignal as createSignal15 } from "solid-js";
|
|
8465
|
+
import { formatLocaleText as formatLocaleText13 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
7963
8466
|
function GridServerSideErrorBars(props) {
|
|
7964
8467
|
const [dismissedLoadError, setDismissedLoadError] = createSignal15(null);
|
|
7965
8468
|
const [dismissedWriteError, setDismissedWriteError] = createSignal15(null);
|
|
7966
8469
|
const texts = () => props.localeTexts;
|
|
7967
8470
|
const shownLoadError = () => props.loadError !== null && props.loadError !== dismissedLoadError() ? props.loadError : null;
|
|
7968
8471
|
const shownWriteError = () => props.writeError !== null && props.writeError !== dismissedWriteError() ? props.writeError : null;
|
|
7969
|
-
return <
|
|
8472
|
+
return <Show22 when={shownLoadError() !== null || shownWriteError() !== null}>
|
|
7970
8473
|
<div class="ssg-ssrm-error-bars">
|
|
7971
|
-
<
|
|
8474
|
+
<Show22 when={shownLoadError()}>
|
|
7972
8475
|
{(loadError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7973
8476
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7974
8477
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7975
|
-
{
|
|
8478
|
+
{formatLocaleText13(texts().loadFailed, { count: loadError().failedBlockCount })}
|
|
7976
8479
|
</span>
|
|
7977
8480
|
<button type="button" class="ssg-ssrm-error-bar-retry" onClick={() => props.onRetry()}>
|
|
7978
8481
|
{texts().retry}
|
|
@@ -7986,12 +8489,12 @@ function GridServerSideErrorBars(props) {
|
|
|
7986
8489
|
×
|
|
7987
8490
|
</button>
|
|
7988
8491
|
</div>}
|
|
7989
|
-
</
|
|
7990
|
-
<
|
|
8492
|
+
</Show22>
|
|
8493
|
+
<Show22 when={shownWriteError()}>
|
|
7991
8494
|
{(writeError) => <div class={["ssg-ssrm-error-bar", props.slot?.className]} style={props.slot?.style} role="alert">
|
|
7992
8495
|
<span class="ssg-ssrm-error-bar-dot" aria-hidden="true" />
|
|
7993
8496
|
<span class="ssg-ssrm-error-bar-msg">
|
|
7994
|
-
{
|
|
8497
|
+
{formatLocaleText13(texts().saveFailed, { count: writeError().failedRowCount })}
|
|
7995
8498
|
</span>
|
|
7996
8499
|
<button
|
|
7997
8500
|
type="button"
|
|
@@ -8002,13 +8505,13 @@ function GridServerSideErrorBars(props) {
|
|
|
8002
8505
|
×
|
|
8003
8506
|
</button>
|
|
8004
8507
|
</div>}
|
|
8005
|
-
</
|
|
8508
|
+
</Show22>
|
|
8006
8509
|
</div>
|
|
8007
|
-
</
|
|
8510
|
+
</Show22>;
|
|
8008
8511
|
}
|
|
8009
8512
|
|
|
8010
8513
|
// src/view/GridBodySkeletonRow.tsx
|
|
8011
|
-
import { For as
|
|
8514
|
+
import { For as For12, Show as Show23 } from "solid-js";
|
|
8012
8515
|
var SKELETON_BAR_WIDTHS = ["62%", "46%", "78%", "54%"];
|
|
8013
8516
|
function GridBodySkeletonRow(props) {
|
|
8014
8517
|
return <div
|
|
@@ -8025,7 +8528,7 @@ function GridBodySkeletonRow(props) {
|
|
|
8025
8528
|
transform: `translateY(${props.top}px)`
|
|
8026
8529
|
}}
|
|
8027
8530
|
>
|
|
8028
|
-
<
|
|
8531
|
+
<Show23 when={props.ownsRowHeader}>
|
|
8029
8532
|
<div
|
|
8030
8533
|
role="rowheader"
|
|
8031
8534
|
aria-colindex={1}
|
|
@@ -8049,12 +8552,12 @@ function GridBodySkeletonRow(props) {
|
|
|
8049
8552
|
height: px(props.rowHeight)
|
|
8050
8553
|
}}
|
|
8051
8554
|
>
|
|
8052
|
-
<
|
|
8555
|
+
<Show23 when={props.showRowCheckbox} fallback={props.rowIndex + 1}>
|
|
8053
8556
|
<RowSelectionCheckbox slot={props.slots.checkbox} state="unchecked" disabled />
|
|
8054
|
-
</
|
|
8557
|
+
</Show23>
|
|
8055
8558
|
</div>
|
|
8056
|
-
</
|
|
8057
|
-
<
|
|
8559
|
+
</Show23>
|
|
8560
|
+
<For12 each={props.entries} keyed={(entry) => entry.logicalIndex}>
|
|
8058
8561
|
{(entry) => {
|
|
8059
8562
|
const cell = () => ({ row: props.rowIndex, col: entry().logicalIndex });
|
|
8060
8563
|
return <div
|
|
@@ -8083,7 +8586,7 @@ function GridBodySkeletonRow(props) {
|
|
|
8083
8586
|
/>
|
|
8084
8587
|
</div>;
|
|
8085
8588
|
}}
|
|
8086
|
-
</
|
|
8589
|
+
</For12>
|
|
8087
8590
|
</div>;
|
|
8088
8591
|
}
|
|
8089
8592
|
|
|
@@ -8100,7 +8603,7 @@ var serverSideFeature = {
|
|
|
8100
8603
|
import { createChangeHighlightController } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/changeHighlightController";
|
|
8101
8604
|
|
|
8102
8605
|
// src/view/CopyRangeOverlay.tsx
|
|
8103
|
-
import { Show as
|
|
8606
|
+
import { Show as Show24 } from "solid-js";
|
|
8104
8607
|
var placement = (props, rect) => ({
|
|
8105
8608
|
position: "absolute",
|
|
8106
8609
|
left: px(props.leadingWidth + rect.left),
|
|
@@ -8109,18 +8612,18 @@ var placement = (props, rect) => ({
|
|
|
8109
8612
|
height: px(rect.height)
|
|
8110
8613
|
});
|
|
8111
8614
|
function CopyRangeOverlay(props) {
|
|
8112
|
-
return <
|
|
8615
|
+
return <Show24 when={props.rect}>
|
|
8113
8616
|
{(rect) => <div
|
|
8114
8617
|
class={["ssg-copy-range-overlay", props.slot?.className]}
|
|
8115
8618
|
style={{ ...props.slot?.style, ...placement(props, rect()) }}
|
|
8116
8619
|
data-ssg-copy-range=""
|
|
8117
8620
|
/>}
|
|
8118
|
-
</
|
|
8621
|
+
</Show24>;
|
|
8119
8622
|
}
|
|
8120
8623
|
function ColumnHoverOverlay(props) {
|
|
8121
|
-
return <
|
|
8624
|
+
return <Show24 when={props.rect}>
|
|
8122
8625
|
{(rect) => <div class="ssg-col-hover-overlay" style={placement(props, rect())} data-ssg-col-hover="" />}
|
|
8123
|
-
</
|
|
8626
|
+
</Show24>;
|
|
8124
8627
|
}
|
|
8125
8628
|
|
|
8126
8629
|
// src/features/motionExtras.ts
|
|
@@ -8134,11 +8637,11 @@ var motionExtrasFeature = {
|
|
|
8134
8637
|
import { DEFAULT_PINNED_ROWS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8135
8638
|
|
|
8136
8639
|
// src/view/GridPinnedRows.tsx
|
|
8137
|
-
import { For as
|
|
8640
|
+
import { For as For13, Show as Show25, createMemo as createMemo27 } from "solid-js";
|
|
8138
8641
|
import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
|
|
8139
8642
|
import { isSyntheticColumnKey as isSyntheticColumnKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
|
|
8140
8643
|
import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
|
|
8141
|
-
import { formatLocaleText as
|
|
8644
|
+
import { formatLocaleText as formatLocaleText14 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8142
8645
|
import { getCellValue as getCellValue5 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
|
|
8143
8646
|
var noop4 = () => {
|
|
8144
8647
|
};
|
|
@@ -8147,18 +8650,18 @@ function GridPinnedRows(props) {
|
|
|
8147
8650
|
const texts = useFeatureLocaleText();
|
|
8148
8651
|
const hidden = () => !props.ownsRowHeader && props.entries.length === 0;
|
|
8149
8652
|
return <>
|
|
8150
|
-
<
|
|
8653
|
+
<Show25 when={props.bodyHeight > 0}>
|
|
8151
8654
|
<div aria-hidden="true" style={{ height: px(props.bodyHeight) }} />
|
|
8152
|
-
</
|
|
8655
|
+
</Show25>
|
|
8153
8656
|
<div
|
|
8154
8657
|
class={["ssg-pinned-rows", `ssg-pinned-rows--${props.position}`]}
|
|
8155
8658
|
style={{ [props.position]: px(props.stickyOffset), height: px(props.rows.length * props.rowHeight) }}
|
|
8156
8659
|
onPointerEnter={() => props.onPointerEnter()}
|
|
8157
8660
|
>
|
|
8158
|
-
<
|
|
8661
|
+
<For13 each={props.rows} keyed={false}>
|
|
8159
8662
|
{(row, index) => {
|
|
8160
8663
|
const rowKey = () => props.rowKeyGetter(row(), index);
|
|
8161
|
-
const rowSlot =
|
|
8664
|
+
const rowSlot = createMemo27(
|
|
8162
8665
|
() => resolveSlotProps3(
|
|
8163
8666
|
props.getRowClassName?.(row(), index, {
|
|
8164
8667
|
row: row(),
|
|
@@ -8179,7 +8682,7 @@ function GridPinnedRows(props) {
|
|
|
8179
8682
|
class={["ssg-pinned-row", rowSlot().className]}
|
|
8180
8683
|
style={{ ...rowSlot().style, height: px(props.rowHeight), top: px(index * props.rowHeight) }}
|
|
8181
8684
|
>
|
|
8182
|
-
<
|
|
8685
|
+
<Show25 when={props.ownsRowHeader}>
|
|
8183
8686
|
<div
|
|
8184
8687
|
role="rowheader"
|
|
8185
8688
|
aria-colindex={1}
|
|
@@ -8202,7 +8705,7 @@ function GridPinnedRows(props) {
|
|
|
8202
8705
|
class="ssg-pinned-row-icon"
|
|
8203
8706
|
viewBox="0 0 16 16"
|
|
8204
8707
|
role="img"
|
|
8205
|
-
aria-label={
|
|
8708
|
+
aria-label={formatLocaleText14(
|
|
8206
8709
|
props.position === "top" ? texts().pinnedTopRow : texts().pinnedBottomRow,
|
|
8207
8710
|
{ row: index + 1 }
|
|
8208
8711
|
)}
|
|
@@ -8210,14 +8713,14 @@ function GridPinnedRows(props) {
|
|
|
8210
8713
|
<path d={PIN_ICON_PATH} />
|
|
8211
8714
|
</svg>
|
|
8212
8715
|
</div>
|
|
8213
|
-
</
|
|
8214
|
-
<
|
|
8716
|
+
</Show25>
|
|
8717
|
+
<For13 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8215
8718
|
{(entry) => {
|
|
8216
|
-
const unbound =
|
|
8719
|
+
const unbound = createMemo27(() => entry().column);
|
|
8217
8720
|
const column = () => unbound();
|
|
8218
|
-
const value =
|
|
8219
|
-
const colIndex =
|
|
8220
|
-
const ctx =
|
|
8721
|
+
const value = createMemo27(() => getCellValue5(row(), unbound()));
|
|
8722
|
+
const colIndex = createMemo27(() => entry().logicalIndex);
|
|
8723
|
+
const ctx = createMemo27(
|
|
8221
8724
|
() => ({
|
|
8222
8725
|
row: row(),
|
|
8223
8726
|
rowIndex: index,
|
|
@@ -8233,19 +8736,19 @@ function GridPinnedRows(props) {
|
|
|
8233
8736
|
pinned: props.position
|
|
8234
8737
|
})
|
|
8235
8738
|
);
|
|
8236
|
-
const cellSlot =
|
|
8739
|
+
const cellSlot = createMemo27(() => {
|
|
8237
8740
|
const cellClassName = column().cellClassName;
|
|
8238
8741
|
return resolveSlotProps3(
|
|
8239
8742
|
typeof cellClassName === "function" ? cellClassName(ctx()) : cellClassName
|
|
8240
8743
|
);
|
|
8241
8744
|
});
|
|
8242
8745
|
const rules = () => props.conditionalFormat ? column().conditionalFormat : void 0;
|
|
8243
|
-
const dataBar =
|
|
8746
|
+
const dataBar = createMemo27(() => {
|
|
8244
8747
|
const feature = props.conditionalFormat;
|
|
8245
8748
|
const format = rules()?.dataBar;
|
|
8246
8749
|
return feature && format ? feature.resolveDataBar(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
8247
8750
|
});
|
|
8248
|
-
const scaleBackground =
|
|
8751
|
+
const scaleBackground = createMemo27(() => {
|
|
8249
8752
|
const feature = props.conditionalFormat;
|
|
8250
8753
|
const format = rules()?.colorScale;
|
|
8251
8754
|
return feature && format ? feature.resolveColorScaleBackground(format, value(), props.conditionalFormatStats.get(unbound().key)) : null;
|
|
@@ -8255,7 +8758,7 @@ function GridPinnedRows(props) {
|
|
|
8255
8758
|
const format = rules()?.dataBar;
|
|
8256
8759
|
return bar ? bar.negative ? format?.negativeColor : format?.color : void 0;
|
|
8257
8760
|
};
|
|
8258
|
-
const content =
|
|
8761
|
+
const content = createMemo27(() => {
|
|
8259
8762
|
const current = column();
|
|
8260
8763
|
if (isSyntheticColumnKey3(current.key)) {
|
|
8261
8764
|
return null;
|
|
@@ -8317,7 +8820,7 @@ function GridPinnedRows(props) {
|
|
|
8317
8820
|
height: px(props.rowHeight)
|
|
8318
8821
|
}}
|
|
8319
8822
|
>
|
|
8320
|
-
<
|
|
8823
|
+
<Show25 when={dataBar()}>
|
|
8321
8824
|
{(bar) => <span
|
|
8322
8825
|
class={["ssg-cf-bar", { "ssg-cf-bar--negative": bar().negative }]}
|
|
8323
8826
|
style={{
|
|
@@ -8327,14 +8830,14 @@ function GridPinnedRows(props) {
|
|
|
8327
8830
|
}}
|
|
8328
8831
|
aria-hidden="true"
|
|
8329
8832
|
/>}
|
|
8330
|
-
</
|
|
8833
|
+
</Show25>
|
|
8331
8834
|
{content()}
|
|
8332
8835
|
</div>;
|
|
8333
8836
|
}}
|
|
8334
|
-
</
|
|
8837
|
+
</For13>
|
|
8335
8838
|
</div>;
|
|
8336
8839
|
}}
|
|
8337
|
-
</
|
|
8840
|
+
</For13>
|
|
8338
8841
|
</div>
|
|
8339
8842
|
</>;
|
|
8340
8843
|
}
|
|
@@ -8349,7 +8852,7 @@ var pinnedRowsFeature = {
|
|
|
8349
8852
|
import { DEFAULT_ROW_DRAG_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8350
8853
|
|
|
8351
8854
|
// src/primitives/rowDrag.ts
|
|
8352
|
-
import { createEffect as createEffect9, createMemo as
|
|
8855
|
+
import { createEffect as createEffect9, createMemo as createMemo28, untrack as untrack19 } from "solid-js";
|
|
8353
8856
|
import {
|
|
8354
8857
|
createRowDragController
|
|
8355
8858
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/rowDragController";
|
|
@@ -8364,10 +8867,10 @@ function createRowDrag(inputs) {
|
|
|
8364
8867
|
const leftIndicatorRef = { current: null };
|
|
8365
8868
|
const centerIndicatorRef = { current: null };
|
|
8366
8869
|
const rightIndicatorRef = { current: null };
|
|
8367
|
-
const canDropAt =
|
|
8870
|
+
const canDropAt = createMemo28(() => createRowDropCheck(inputs.canDropRow(), inputs.rows(), inputs.resolveRowKey()));
|
|
8368
8871
|
const getRowDragLabel = (viewIndex) => resolveRowDragLabel(untrack19(inputs.rowModel), untrack19(inputs.visibleColumns), viewIndex, untrack19(inputs.dragRowLabel));
|
|
8369
8872
|
const getDragRow = (viewIndex) => getDragRowToken(untrack19(inputs.rowModel), viewIndex);
|
|
8370
|
-
const locateDragRow =
|
|
8873
|
+
const locateDragRow = createMemo28(() => {
|
|
8371
8874
|
const rowModel = inputs.rowModel();
|
|
8372
8875
|
const hasRowKeys = inputs.hasRowKeys();
|
|
8373
8876
|
return (token, hint) => locateDragRowToken(rowModel, hasRowKeys, token, hint);
|
|
@@ -8405,7 +8908,7 @@ function createRowDrag(inputs) {
|
|
|
8405
8908
|
}
|
|
8406
8909
|
|
|
8407
8910
|
// src/view/RowDragHandle.tsx
|
|
8408
|
-
var
|
|
8911
|
+
var SVG_NOT_FOCUSABLE5 = { focusable: "false" };
|
|
8409
8912
|
function RowDragHandle(props) {
|
|
8410
8913
|
return <span
|
|
8411
8914
|
class={["ssg-row-drag-handle", { "ssg-row-drag-handle--disabled": !props.operable }]}
|
|
@@ -8417,7 +8920,7 @@ function RowDragHandle(props) {
|
|
|
8417
8920
|
}
|
|
8418
8921
|
}}
|
|
8419
8922
|
>
|
|
8420
|
-
<svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor" aria-hidden="true" {...
|
|
8923
|
+
<svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor" aria-hidden="true" {...SVG_NOT_FOCUSABLE5}>
|
|
8421
8924
|
<circle cx="2" cy="3" r="1" />
|
|
8422
8925
|
<circle cx="6" cy="3" r="1" />
|
|
8423
8926
|
<circle cx="2" cy="7" r="1" />
|
|
@@ -8441,7 +8944,7 @@ import { resolveScrollHintOptions } from "@ishibashi0112/spreadsheet-grid-core/i
|
|
|
8441
8944
|
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8442
8945
|
|
|
8443
8946
|
// src/view/GridScrollHint.tsx
|
|
8444
|
-
import { For as
|
|
8947
|
+
import { For as For14, Show as Show26, createMemo as createMemo29, createSignal as createSignal16, createEffect as createEffect10 } from "solid-js";
|
|
8445
8948
|
import { physicalToLogicalScrollTop as physicalToLogicalScrollTop3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
8446
8949
|
import { resolveDataRowNumber as resolveDataRowNumber3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8447
8950
|
import {
|
|
@@ -8450,7 +8953,7 @@ import {
|
|
|
8450
8953
|
computeScrollHintTrackPointerScrollTop,
|
|
8451
8954
|
resolveScrollHintDetail
|
|
8452
8955
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/scrollHint";
|
|
8453
|
-
import { formatLocaleText as
|
|
8956
|
+
import { formatLocaleText as formatLocaleText15 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8454
8957
|
var SCROLL_HINT_LINGER_MS = 1e3;
|
|
8455
8958
|
var SCROLL_HINT_BUBBLE_GAP_PX = 8;
|
|
8456
8959
|
var SCROLL_HINT_GUTTER_WIDTH_PX = 14;
|
|
@@ -8467,10 +8970,10 @@ function GridScrollHint(props) {
|
|
|
8467
8970
|
let lingerTimer = null;
|
|
8468
8971
|
let dragGrab = null;
|
|
8469
8972
|
let gutter;
|
|
8470
|
-
const scrollbar =
|
|
8973
|
+
const scrollbar = createMemo29(() => props.options.scrollbar);
|
|
8471
8974
|
const trackTop = () => scrollbar() ? props.headerHeight : 0;
|
|
8472
8975
|
const trackHeight = () => Math.max(scrollbar() ? props.viewportHeight - props.headerHeight : props.viewportHeight, 0);
|
|
8473
|
-
const track =
|
|
8976
|
+
const track = createMemo29(
|
|
8474
8977
|
() => computeScrollHintTrack({
|
|
8475
8978
|
scrollTop: props.scrollTop,
|
|
8476
8979
|
contentHeight: props.headerHeight + props.physicalBodyHeight,
|
|
@@ -8478,7 +8981,7 @@ function GridScrollHint(props) {
|
|
|
8478
8981
|
trackHeight: trackHeight()
|
|
8479
8982
|
})
|
|
8480
8983
|
);
|
|
8481
|
-
const shown =
|
|
8984
|
+
const shown = createMemo29(() => track() !== null && props.rowMetrics.rowCount > 0);
|
|
8482
8985
|
createEffect10(scrollbar, (customScrollbar) => {
|
|
8483
8986
|
const element = props.scrollContainerRef.current;
|
|
8484
8987
|
if (!element) {
|
|
@@ -8547,12 +9050,12 @@ function GridScrollHint(props) {
|
|
|
8547
9050
|
);
|
|
8548
9051
|
const rulerHeight = () => Math.max(props.viewportHeight - props.headerHeight, 0);
|
|
8549
9052
|
const labelCount = () => props.labelViewIndexes?.length ?? 0;
|
|
8550
|
-
const dataRowCount =
|
|
9053
|
+
const dataRowCount = createMemo29(() => Math.max(props.rowMetrics.rowCount - labelCount(), 0));
|
|
8551
9054
|
const rowNumberOf = (viewIndex) => {
|
|
8552
9055
|
const labels = props.labelViewIndexes;
|
|
8553
9056
|
return labels && labels.length > 0 ? resolveDataRowNumber3(labels, viewIndex) : viewIndex + 1;
|
|
8554
9057
|
};
|
|
8555
|
-
const rulerTicks =
|
|
9058
|
+
const rulerTicks = createMemo29(
|
|
8556
9059
|
() => props.options.ruler ? computeScrollHintRulerTicks({
|
|
8557
9060
|
rowCount: dataRowCount(),
|
|
8558
9061
|
rulerHeight: rulerHeight(),
|
|
@@ -8562,7 +9065,7 @@ function GridScrollHint(props) {
|
|
|
8562
9065
|
const visible = () => props.options.trigger === "always" || scrollActive() || props.options.trigger === "hover" && hovered();
|
|
8563
9066
|
const rulerVisible = () => visible() || trackPointerY() !== null;
|
|
8564
9067
|
const rightInset = () => scrollbar() ? SCROLL_HINT_GUTTER_WIDTH_PX : scrollbarWidth();
|
|
8565
|
-
const topRowIndex =
|
|
9068
|
+
const topRowIndex = createMemo29(() => {
|
|
8566
9069
|
const current = track();
|
|
8567
9070
|
if (current === null) {
|
|
8568
9071
|
return 0;
|
|
@@ -8577,8 +9080,8 @@ function GridScrollHint(props) {
|
|
|
8577
9080
|
rowIndex,
|
|
8578
9081
|
rowData: props.rowModel.getRow(rowIndex)
|
|
8579
9082
|
});
|
|
8580
|
-
const detail =
|
|
8581
|
-
const jumpPreview =
|
|
9083
|
+
const detail = createMemo29(() => detailOf(topRowIndex()));
|
|
9084
|
+
const jumpPreview = createMemo29(() => {
|
|
8582
9085
|
const pointerY = trackPointerY();
|
|
8583
9086
|
const current = track();
|
|
8584
9087
|
if (!props.options.ruler || pointerY === null || dragging() || current === null) {
|
|
@@ -8645,24 +9148,24 @@ function GridScrollHint(props) {
|
|
|
8645
9148
|
setTrackPointerY(null);
|
|
8646
9149
|
}
|
|
8647
9150
|
};
|
|
8648
|
-
return <
|
|
9151
|
+
return <Show26 when={shown()}>
|
|
8649
9152
|
<div class={["ssg-scroll-hint", props.slot?.className]} style={props.slot?.style} aria-hidden="true">
|
|
8650
|
-
<
|
|
9153
|
+
<Show26 when={props.options.ruler && rulerTicks().length > 0}>
|
|
8651
9154
|
<div
|
|
8652
9155
|
class={["ssg-scroll-hint-ruler", { "ssg-scroll-hint-ruler--visible": rulerVisible() }]}
|
|
8653
9156
|
style={{ top: px(props.headerHeight), right: px(rightInset()) }}
|
|
8654
9157
|
>
|
|
8655
|
-
<
|
|
9158
|
+
<For14 each={rulerTicks()} keyed={(tick) => tick.row}>
|
|
8656
9159
|
{(tick) => <div
|
|
8657
9160
|
class="ssg-scroll-hint-ruler-tick"
|
|
8658
9161
|
style={{ top: px(Math.min(Math.max(tick().y, 6), Math.max(rulerHeight() - 6, 6))) }}
|
|
8659
9162
|
>
|
|
8660
9163
|
<span class="ssg-scroll-hint-ruler-label">{tick().label}</span>
|
|
8661
9164
|
</div>}
|
|
8662
|
-
</
|
|
9165
|
+
</For14>
|
|
8663
9166
|
</div>
|
|
8664
|
-
</
|
|
8665
|
-
<
|
|
9167
|
+
</Show26>
|
|
9168
|
+
<Show26 when={jumpPreview()}>
|
|
8666
9169
|
{(preview) => <div class="ssg-scroll-hint-jumpline" style={{ top: px(preview().lineY), right: px(rightInset()) }}>
|
|
8667
9170
|
<span
|
|
8668
9171
|
class={[
|
|
@@ -8672,17 +9175,17 @@ function GridScrollHint(props) {
|
|
|
8672
9175
|
}
|
|
8673
9176
|
]}
|
|
8674
9177
|
>
|
|
8675
|
-
{
|
|
8676
|
-
<
|
|
9178
|
+
{formatLocaleText15(texts().scrollHintJump, { row: rowNumberOf(preview().rowIndex).toLocaleString() })}
|
|
9179
|
+
<Show26 when={preview().detail !== null}>
|
|
8677
9180
|
<span class="ssg-scroll-hint-jumpline-detail">
|
|
8678
9181
|
{` ${texts().scrollHintJumpSeparator} `}
|
|
8679
9182
|
{preview().detail}
|
|
8680
9183
|
</span>
|
|
8681
|
-
</
|
|
9184
|
+
</Show26>
|
|
8682
9185
|
</span>
|
|
8683
9186
|
</div>}
|
|
8684
|
-
</
|
|
8685
|
-
<
|
|
9187
|
+
</Show26>
|
|
9188
|
+
<Show26 when={props.options.bubble}>
|
|
8686
9189
|
<div
|
|
8687
9190
|
class={["ssg-scroll-hint-bubble", { "ssg-scroll-hint-bubble--visible": visible() }]}
|
|
8688
9191
|
style={{
|
|
@@ -8691,17 +9194,17 @@ function GridScrollHint(props) {
|
|
|
8691
9194
|
}}
|
|
8692
9195
|
>
|
|
8693
9196
|
<span class="ssg-scroll-hint-bubble-main">
|
|
8694
|
-
{
|
|
9197
|
+
{formatLocaleText15(texts().scrollHintRow, { row: rowNumberOf(topRowIndex()).toLocaleString() })}
|
|
8695
9198
|
<span class="ssg-scroll-hint-bubble-total">
|
|
8696
9199
|
{" "}/ {dataRowCount().toLocaleString()}
|
|
8697
9200
|
</span>
|
|
8698
9201
|
</span>
|
|
8699
|
-
<
|
|
9202
|
+
<Show26 when={detail() !== null}>
|
|
8700
9203
|
<span class="ssg-scroll-hint-bubble-detail">{detail()}</span>
|
|
8701
|
-
</
|
|
9204
|
+
</Show26>
|
|
8702
9205
|
</div>
|
|
8703
|
-
</
|
|
8704
|
-
<
|
|
9206
|
+
</Show26>
|
|
9207
|
+
<Show26 when={scrollbar()}>
|
|
8705
9208
|
<div
|
|
8706
9209
|
ref={(element) => {
|
|
8707
9210
|
gutter = element;
|
|
@@ -8725,9 +9228,9 @@ function GridScrollHint(props) {
|
|
|
8725
9228
|
style={{ top: px(track()?.thumbTop ?? 0), height: px(track()?.thumbHeight ?? 0) }}
|
|
8726
9229
|
/>
|
|
8727
9230
|
</div>
|
|
8728
|
-
</
|
|
9231
|
+
</Show26>
|
|
8729
9232
|
</div>
|
|
8730
|
-
</
|
|
9233
|
+
</Show26>;
|
|
8731
9234
|
}
|
|
8732
9235
|
|
|
8733
9236
|
// src/features/scrollHint.ts
|
|
@@ -8741,7 +9244,7 @@ var scrollHintFeature = {
|
|
|
8741
9244
|
import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
8742
9245
|
|
|
8743
9246
|
// src/primitives/selectionAggregates.ts
|
|
8744
|
-
import { createMemo as
|
|
9247
|
+
import { createMemo as createMemo30 } from "solid-js";
|
|
8745
9248
|
import {
|
|
8746
9249
|
createSelectionAggregatesRunner,
|
|
8747
9250
|
resolveSyncSelectionAggregates,
|
|
@@ -8753,15 +9256,15 @@ import {
|
|
|
8753
9256
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8754
9257
|
function createSelectionAggregates(args) {
|
|
8755
9258
|
const stabilizeTarget = createSelectionAggregateTargetStabilizer();
|
|
8756
|
-
const target =
|
|
9259
|
+
const target = createMemo30(() => {
|
|
8757
9260
|
const current = args();
|
|
8758
9261
|
return stabilizeTarget(
|
|
8759
9262
|
current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
|
|
8760
9263
|
);
|
|
8761
9264
|
});
|
|
8762
|
-
const rowModel =
|
|
8763
|
-
const key =
|
|
8764
|
-
const syncResult =
|
|
9265
|
+
const rowModel = createMemo30(() => args().rowModel);
|
|
9266
|
+
const key = createMemo30(() => ({ rowModel: rowModel(), target: target() }));
|
|
9267
|
+
const syncResult = createMemo30(() => resolveSyncSelectionAggregates(key()));
|
|
8765
9268
|
const runner = createSelectionAggregatesRunner();
|
|
8766
9269
|
connectController(
|
|
8767
9270
|
runner,
|
|
@@ -8770,16 +9273,16 @@ function createSelectionAggregates(args) {
|
|
|
8770
9273
|
"selectionAggregates"
|
|
8771
9274
|
);
|
|
8772
9275
|
const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
|
|
8773
|
-
return
|
|
9276
|
+
return createMemo30(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
|
|
8774
9277
|
}
|
|
8775
9278
|
|
|
8776
9279
|
// src/view/GridSelectionAggregates.tsx
|
|
8777
|
-
import { For as
|
|
9280
|
+
import { For as For15, Show as Show27, createMemo as createMemo31 } from "solid-js";
|
|
8778
9281
|
import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
|
|
8779
|
-
import { formatLocaleText as
|
|
9282
|
+
import { formatLocaleText as formatLocaleText16 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8780
9283
|
function GridSelectionAggregates(props) {
|
|
8781
9284
|
const texts = useFeatureLocaleText();
|
|
8782
|
-
const chips =
|
|
9285
|
+
const chips = createMemo31(() => {
|
|
8783
9286
|
const aggregates = props.aggregates;
|
|
8784
9287
|
if (!aggregates) {
|
|
8785
9288
|
return null;
|
|
@@ -8789,7 +9292,7 @@ function GridSelectionAggregates(props) {
|
|
|
8789
9292
|
return [
|
|
8790
9293
|
{
|
|
8791
9294
|
key: "computing",
|
|
8792
|
-
text:
|
|
9295
|
+
text: formatLocaleText16(localeTexts.aggregateComputing, { percent: Math.floor(aggregates.progress * 100) })
|
|
8793
9296
|
}
|
|
8794
9297
|
];
|
|
8795
9298
|
}
|
|
@@ -8812,12 +9315,12 @@ function GridSelectionAggregates(props) {
|
|
|
8812
9315
|
}
|
|
8813
9316
|
return list;
|
|
8814
9317
|
});
|
|
8815
|
-
return <
|
|
9318
|
+
return <Show27 when={chips()}>
|
|
8816
9319
|
{(list) => <div class={["ssg-bar-aggregates", { "ssg-bar-aggregates--trailing": props.trailing }]}>
|
|
8817
9320
|
<div class="ssg-bar-aggregates-inner" title={list().map((chip) => chip.text).join(" ")}>
|
|
8818
9321
|
<div class="ssg-bar-aggregates-list">
|
|
8819
9322
|
<span class="ssg-bar-aggregates-fit" aria-hidden="true" />
|
|
8820
|
-
<
|
|
9323
|
+
<For15 each={list()} keyed={(chip) => chip.key}>
|
|
8821
9324
|
{(chip, index) => <span
|
|
8822
9325
|
class={[
|
|
8823
9326
|
"ssg-bar-chip",
|
|
@@ -8828,16 +9331,16 @@ function GridSelectionAggregates(props) {
|
|
|
8828
9331
|
]}
|
|
8829
9332
|
style={{ order: String(-index()) }}
|
|
8830
9333
|
>
|
|
8831
|
-
<
|
|
9334
|
+
<Show27 when={chip().label !== void 0} fallback={chip().text}>
|
|
8832
9335
|
{chip().label}
|
|
8833
9336
|
<b class="ssg-bar-aggregate-value">{chip().value}</b>
|
|
8834
|
-
</
|
|
9337
|
+
</Show27>
|
|
8835
9338
|
</span>}
|
|
8836
|
-
</
|
|
9339
|
+
</For15>
|
|
8837
9340
|
</div>
|
|
8838
9341
|
</div>
|
|
8839
9342
|
</div>}
|
|
8840
|
-
</
|
|
9343
|
+
</Show27>;
|
|
8841
9344
|
}
|
|
8842
9345
|
|
|
8843
9346
|
// src/features/selectionAggregates.ts
|
|
@@ -8848,7 +9351,7 @@ var selectionAggregatesFeature = {
|
|
|
8848
9351
|
};
|
|
8849
9352
|
|
|
8850
9353
|
// src/primitives/toolPanel.ts
|
|
8851
|
-
import { createMemo as
|
|
9354
|
+
import { createMemo as createMemo32 } from "solid-js";
|
|
8852
9355
|
import {
|
|
8853
9356
|
createToolPanelController,
|
|
8854
9357
|
resolveActiveToolPanelTab,
|
|
@@ -8867,7 +9370,7 @@ function createToolPanel(inputs) {
|
|
|
8867
9370
|
onSuppressedEscape: inputs.onSuppressedEscape
|
|
8868
9371
|
}), "render", "toolPanel");
|
|
8869
9372
|
const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
|
|
8870
|
-
const availableTabs =
|
|
9373
|
+
const availableTabs = createMemo32(
|
|
8871
9374
|
() => resolveAvailableToolPanelTabs({
|
|
8872
9375
|
canUseFilterTab: inputs.canUseFilterTab(),
|
|
8873
9376
|
canUseColumnsTab: inputs.canUseColumnsTab(),
|
|
@@ -8876,10 +9379,10 @@ function createToolPanel(inputs) {
|
|
|
8876
9379
|
{ equals: sameTabs }
|
|
8877
9380
|
);
|
|
8878
9381
|
return {
|
|
8879
|
-
activeTab:
|
|
9382
|
+
activeTab: createMemo32(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
|
|
8880
9383
|
availableTabs,
|
|
8881
|
-
layout:
|
|
8882
|
-
flashTick:
|
|
9384
|
+
layout: createMemo32(() => snapshot2().layout),
|
|
9385
|
+
flashTick: createMemo32(() => snapshot2().flashTick),
|
|
8883
9386
|
panelRef: controller.panelRef,
|
|
8884
9387
|
open: controller.open,
|
|
8885
9388
|
close: controller.close,
|
|
@@ -8903,7 +9406,7 @@ import {
|
|
|
8903
9406
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
|
|
8904
9407
|
|
|
8905
9408
|
// src/view/GridTotalRow.tsx
|
|
8906
|
-
import { For as
|
|
9409
|
+
import { For as For16, Show as Show28, createMemo as createMemo33 } from "solid-js";
|
|
8907
9410
|
import {
|
|
8908
9411
|
formatTotalRowCellText as formatTotalRowCellText2,
|
|
8909
9412
|
resolveTotalRowCaption as resolveTotalRowCaption2
|
|
@@ -8930,7 +9433,7 @@ function GridTotalRow(props) {
|
|
|
8930
9433
|
...props.stickyBottom > 0 ? { bottom: px(props.stickyBottom) } : null
|
|
8931
9434
|
}}
|
|
8932
9435
|
>
|
|
8933
|
-
<
|
|
9436
|
+
<Show28 when={props.ownsRowHeader}>
|
|
8934
9437
|
<div
|
|
8935
9438
|
role={rowHeaderIsCell() ? "rowheader" : void 0}
|
|
8936
9439
|
aria-colindex={rowHeaderIsCell() ? 1 : void 0}
|
|
@@ -8945,13 +9448,13 @@ function GridTotalRow(props) {
|
|
|
8945
9448
|
>
|
|
8946
9449
|
{rowHeaderText() === "" ? null : rowHeaderText()}
|
|
8947
9450
|
</div>
|
|
8948
|
-
</
|
|
8949
|
-
<
|
|
9451
|
+
</Show28>
|
|
9452
|
+
<For16 each={props.entries} keyed={(entry) => entry.column.key}>
|
|
8950
9453
|
{(entry) => {
|
|
8951
|
-
const unbound =
|
|
9454
|
+
const unbound = createMemo33(() => entry().column);
|
|
8952
9455
|
const cell = () => props.cells.get(unbound().key);
|
|
8953
9456
|
const isLabelCell = () => unbound().key === props.labelColumnKey;
|
|
8954
|
-
const content =
|
|
9457
|
+
const content = createMemo33(() => {
|
|
8955
9458
|
const total = cell();
|
|
8956
9459
|
if (total) {
|
|
8957
9460
|
const column = unbound();
|
|
@@ -9003,7 +9506,7 @@ function GridTotalRow(props) {
|
|
|
9003
9506
|
{content()}
|
|
9004
9507
|
</div>;
|
|
9005
9508
|
}}
|
|
9006
|
-
</
|
|
9509
|
+
</For16>
|
|
9007
9510
|
</div>
|
|
9008
9511
|
</>;
|
|
9009
9512
|
}
|
|
@@ -9024,6 +9527,7 @@ var fullGridFeatures = {
|
|
|
9024
9527
|
conditionalFormat: conditionalFormatFeature,
|
|
9025
9528
|
totalRow: totalRowFeature,
|
|
9026
9529
|
pinnedRows: pinnedRowsFeature,
|
|
9530
|
+
columnGroups: columnGroupsFeature,
|
|
9027
9531
|
selectionAggregates: selectionAggregatesFeature,
|
|
9028
9532
|
scrollHint: scrollHintFeature,
|
|
9029
9533
|
motionExtras: motionExtrasFeature,
|
|
@@ -9065,6 +9569,7 @@ export {
|
|
|
9065
9569
|
SpreadsheetGrid,
|
|
9066
9570
|
autoHeightFeature,
|
|
9067
9571
|
columnAutosizeFeature,
|
|
9572
|
+
columnGroupsFeature,
|
|
9068
9573
|
columnMenuFeature,
|
|
9069
9574
|
columnReorderFeature,
|
|
9070
9575
|
conditionalFormatFeature,
|