@xcelsior/ui-spreadsheets 1.1.14 → 1.1.16
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/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +659 -401
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +652 -395
- package/dist/index.mjs.map +1 -1
- package/dist/styles/globals.css +58 -0
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
- package/src/components/ActiveFiltersDisplay.tsx +257 -0
- package/src/components/Spreadsheet.tsx +39 -5
- package/src/components/SpreadsheetCell.tsx +8 -2
- package/src/components/SpreadsheetHeader.tsx +8 -2
- package/src/components/SpreadsheetToolbar.tsx +249 -203
- package/src/hooks/useSpreadsheetPinning.ts +1 -1
- package/src/index.ts +2 -0
- package/src/types.ts +10 -0
package/dist/index.mjs
CHANGED
|
@@ -151,7 +151,7 @@ import { useState as useState2, useRef, useEffect, memo } from "react";
|
|
|
151
151
|
import { useCallback, useMemo, useState } from "react";
|
|
152
152
|
var ROW_INDEX_COLUMN_ID = "__row_index__";
|
|
153
153
|
var ROW_INDEX_COLUMN_WIDTH = 80;
|
|
154
|
-
var MIN_PINNED_COLUMN_WIDTH =
|
|
154
|
+
var MIN_PINNED_COLUMN_WIDTH = 150;
|
|
155
155
|
function useSpreadsheetPinning({
|
|
156
156
|
columns,
|
|
157
157
|
columnGroups,
|
|
@@ -519,8 +519,14 @@ var SpreadsheetCell = ({
|
|
|
519
519
|
// Pinned columns must have a fixed width so sticky offsets stay correct.
|
|
520
520
|
// Enforce MIN_PINNED_COLUMN_WIDTH so header actions always fit.
|
|
521
521
|
...isPinned && {
|
|
522
|
-
width: Math.max(
|
|
523
|
-
|
|
522
|
+
width: Math.max(
|
|
523
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
524
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
525
|
+
),
|
|
526
|
+
maxWidth: Math.max(
|
|
527
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
528
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
529
|
+
)
|
|
524
530
|
},
|
|
525
531
|
...positionStyles,
|
|
526
532
|
...selectionBorderStyles
|
|
@@ -928,7 +934,198 @@ SpreadsheetFilterDropdown.displayName = "SpreadsheetFilterDropdown";
|
|
|
928
934
|
|
|
929
935
|
// src/components/SpreadsheetToolbar.tsx
|
|
930
936
|
import React3 from "react";
|
|
937
|
+
|
|
938
|
+
// src/components/ActiveFiltersDisplay.tsx
|
|
931
939
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
940
|
+
var TEXT_OPERATOR_LABELS = {
|
|
941
|
+
contains: "contains",
|
|
942
|
+
notContains: "does not contain",
|
|
943
|
+
equals: "equals",
|
|
944
|
+
notEquals: "does not equal",
|
|
945
|
+
startsWith: "starts with",
|
|
946
|
+
endsWith: "ends with",
|
|
947
|
+
isEmpty: "is empty",
|
|
948
|
+
isNotEmpty: "is not empty"
|
|
949
|
+
};
|
|
950
|
+
var NUMBER_OPERATOR_LABELS = {
|
|
951
|
+
equals: "=",
|
|
952
|
+
notEquals: "\u2260",
|
|
953
|
+
greaterThan: ">",
|
|
954
|
+
greaterThanOrEqual: "\u2265",
|
|
955
|
+
lessThan: "<",
|
|
956
|
+
lessThanOrEqual: "\u2264",
|
|
957
|
+
between: "between",
|
|
958
|
+
isEmpty: "is empty",
|
|
959
|
+
isNotEmpty: "is not empty"
|
|
960
|
+
};
|
|
961
|
+
var DATE_OPERATOR_LABELS = {
|
|
962
|
+
equals: "is",
|
|
963
|
+
notEquals: "is not",
|
|
964
|
+
before: "before",
|
|
965
|
+
after: "after",
|
|
966
|
+
between: "between",
|
|
967
|
+
today: "is today",
|
|
968
|
+
yesterday: "is yesterday",
|
|
969
|
+
thisWeek: "is this week",
|
|
970
|
+
lastWeek: "is last week",
|
|
971
|
+
thisMonth: "is this month",
|
|
972
|
+
lastMonth: "is last month",
|
|
973
|
+
thisYear: "is this year",
|
|
974
|
+
isEmpty: "is empty",
|
|
975
|
+
isNotEmpty: "is not empty"
|
|
976
|
+
};
|
|
977
|
+
function formatFilter(filter, _column) {
|
|
978
|
+
const parts = [];
|
|
979
|
+
if (filter.textCondition) {
|
|
980
|
+
const { operator, value } = filter.textCondition;
|
|
981
|
+
const label = TEXT_OPERATOR_LABELS[operator];
|
|
982
|
+
if (["isEmpty", "isNotEmpty"].includes(operator)) {
|
|
983
|
+
parts.push(label);
|
|
984
|
+
} else if (value) {
|
|
985
|
+
parts.push(`${label} "${value}"`);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
if (filter.numberCondition) {
|
|
989
|
+
const { operator, value, valueTo } = filter.numberCondition;
|
|
990
|
+
const label = NUMBER_OPERATOR_LABELS[operator];
|
|
991
|
+
if (["isEmpty", "isNotEmpty"].includes(operator)) {
|
|
992
|
+
parts.push(label);
|
|
993
|
+
} else if (operator === "between" && value !== void 0 && valueTo !== void 0) {
|
|
994
|
+
parts.push(`${label} ${value} and ${valueTo}`);
|
|
995
|
+
} else if (value !== void 0) {
|
|
996
|
+
parts.push(`${label} ${value}`);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
if (filter.dateCondition) {
|
|
1000
|
+
const { operator, value, valueTo } = filter.dateCondition;
|
|
1001
|
+
const label = DATE_OPERATOR_LABELS[operator];
|
|
1002
|
+
const noValueOperators = [
|
|
1003
|
+
"isEmpty",
|
|
1004
|
+
"isNotEmpty",
|
|
1005
|
+
"today",
|
|
1006
|
+
"yesterday",
|
|
1007
|
+
"thisWeek",
|
|
1008
|
+
"lastWeek",
|
|
1009
|
+
"thisMonth",
|
|
1010
|
+
"lastMonth",
|
|
1011
|
+
"thisYear"
|
|
1012
|
+
];
|
|
1013
|
+
if (noValueOperators.includes(operator)) {
|
|
1014
|
+
parts.push(label);
|
|
1015
|
+
} else if (operator === "between" && value && valueTo) {
|
|
1016
|
+
parts.push(`${label} ${formatDate(value)} and ${formatDate(valueTo)}`);
|
|
1017
|
+
} else if (value) {
|
|
1018
|
+
parts.push(`${label} ${formatDate(value)}`);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (filter.text) {
|
|
1022
|
+
parts.push(`contains "${filter.text}"`);
|
|
1023
|
+
}
|
|
1024
|
+
if (filter.selectedValues && filter.selectedValues.length > 0) {
|
|
1025
|
+
if (filter.selectedValues.length === 1) {
|
|
1026
|
+
parts.push(`is "${filter.selectedValues[0]}"`);
|
|
1027
|
+
} else {
|
|
1028
|
+
parts.push(`is one of ${filter.selectedValues.length} values`);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
if (filter.min !== void 0 && filter.max !== void 0) {
|
|
1032
|
+
parts.push(`between ${filter.min} and ${filter.max}`);
|
|
1033
|
+
} else if (filter.min !== void 0) {
|
|
1034
|
+
parts.push(`\u2265 ${filter.min}`);
|
|
1035
|
+
} else if (filter.max !== void 0) {
|
|
1036
|
+
parts.push(`\u2264 ${filter.max}`);
|
|
1037
|
+
}
|
|
1038
|
+
if (filter.includeBlanks) {
|
|
1039
|
+
parts.push("includes blanks");
|
|
1040
|
+
}
|
|
1041
|
+
if (filter.excludeBlanks) {
|
|
1042
|
+
parts.push("excludes blanks");
|
|
1043
|
+
}
|
|
1044
|
+
return parts.join(", ") || "filtered";
|
|
1045
|
+
}
|
|
1046
|
+
function formatDate(dateStr) {
|
|
1047
|
+
try {
|
|
1048
|
+
const date = new Date(dateStr);
|
|
1049
|
+
return date.toLocaleDateString("en-US", {
|
|
1050
|
+
month: "short",
|
|
1051
|
+
day: "numeric",
|
|
1052
|
+
year: "numeric"
|
|
1053
|
+
});
|
|
1054
|
+
} catch {
|
|
1055
|
+
return dateStr;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
var ActiveFiltersDisplay = ({
|
|
1059
|
+
filters,
|
|
1060
|
+
columns,
|
|
1061
|
+
onClearFilter,
|
|
1062
|
+
onClearAllFilters,
|
|
1063
|
+
className
|
|
1064
|
+
}) => {
|
|
1065
|
+
const activeFilters = Object.entries(filters).filter(([_, filter]) => {
|
|
1066
|
+
return filter.textCondition || filter.numberCondition || filter.dateCondition || filter.text || filter.selectedValues && filter.selectedValues.length > 0 || filter.min !== void 0 || filter.max !== void 0 || filter.includeBlanks || filter.excludeBlanks;
|
|
1067
|
+
});
|
|
1068
|
+
if (activeFilters.length === 0) {
|
|
1069
|
+
return null;
|
|
1070
|
+
}
|
|
1071
|
+
const getColumnLabel = (columnId) => {
|
|
1072
|
+
const column = columns.find((c) => c.id === columnId);
|
|
1073
|
+
return column?.label || columnId;
|
|
1074
|
+
};
|
|
1075
|
+
const getColumn = (columnId) => {
|
|
1076
|
+
return columns.find((c) => c.id === columnId);
|
|
1077
|
+
};
|
|
1078
|
+
return /* @__PURE__ */ jsxs3(
|
|
1079
|
+
"div",
|
|
1080
|
+
{
|
|
1081
|
+
className: cn(
|
|
1082
|
+
"flex flex-wrap items-center gap-2 px-4 py-2 bg-amber-50 border-b border-amber-200",
|
|
1083
|
+
className
|
|
1084
|
+
),
|
|
1085
|
+
children: [
|
|
1086
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-amber-700 mr-1", children: "Active filters:" }),
|
|
1087
|
+
activeFilters.map(([columnId, filter]) => {
|
|
1088
|
+
const column = getColumn(columnId);
|
|
1089
|
+
const filterDescription = column ? formatFilter(filter, column) : formatFilter(filter, { id: columnId, label: columnId });
|
|
1090
|
+
return /* @__PURE__ */ jsxs3(
|
|
1091
|
+
"div",
|
|
1092
|
+
{
|
|
1093
|
+
className: "inline-flex items-center gap-1.5 px-2.5 py-1 bg-white border border-amber-300 rounded-full shadow-sm",
|
|
1094
|
+
children: [
|
|
1095
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-gray-700", children: getColumnLabel(columnId) }),
|
|
1096
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs text-gray-500", children: filterDescription }),
|
|
1097
|
+
/* @__PURE__ */ jsx3(
|
|
1098
|
+
"button",
|
|
1099
|
+
{
|
|
1100
|
+
type: "button",
|
|
1101
|
+
onClick: () => onClearFilter(columnId),
|
|
1102
|
+
className: "p-0.5 hover:bg-amber-100 rounded-full transition-colors",
|
|
1103
|
+
title: `Clear filter for ${getColumnLabel(columnId)}`,
|
|
1104
|
+
children: /* @__PURE__ */ jsx3(HiX, { className: "h-3 w-3 text-amber-600 hover:text-amber-800" })
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
1107
|
+
]
|
|
1108
|
+
},
|
|
1109
|
+
columnId
|
|
1110
|
+
);
|
|
1111
|
+
}),
|
|
1112
|
+
activeFilters.length > 1 && /* @__PURE__ */ jsx3(
|
|
1113
|
+
"button",
|
|
1114
|
+
{
|
|
1115
|
+
type: "button",
|
|
1116
|
+
onClick: onClearAllFilters,
|
|
1117
|
+
className: "text-xs text-amber-700 hover:text-amber-900 underline ml-2 transition-colors",
|
|
1118
|
+
children: "Clear all"
|
|
1119
|
+
}
|
|
1120
|
+
)
|
|
1121
|
+
]
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
};
|
|
1125
|
+
ActiveFiltersDisplay.displayName = "ActiveFiltersDisplay";
|
|
1126
|
+
|
|
1127
|
+
// src/components/SpreadsheetToolbar.tsx
|
|
1128
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
932
1129
|
var SpreadsheetToolbar = ({
|
|
933
1130
|
zoom,
|
|
934
1131
|
canUndo,
|
|
@@ -952,6 +1149,11 @@ var SpreadsheetToolbar = ({
|
|
|
952
1149
|
onShowShortcuts,
|
|
953
1150
|
hasActiveFilters,
|
|
954
1151
|
onClearFilters,
|
|
1152
|
+
filters,
|
|
1153
|
+
columns,
|
|
1154
|
+
onClearFilter,
|
|
1155
|
+
showFiltersPanel,
|
|
1156
|
+
onToggleFiltersPanel,
|
|
955
1157
|
className
|
|
956
1158
|
}) => {
|
|
957
1159
|
const [showMoreMenu, setShowMoreMenu] = React3.useState(false);
|
|
@@ -1005,231 +1207,254 @@ var SpreadsheetToolbar = ({
|
|
|
1005
1207
|
return "bg-blue-50 border-blue-200 text-blue-700";
|
|
1006
1208
|
}
|
|
1007
1209
|
};
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1210
|
+
const activeFilterCount = filters ? Object.values(filters).filter(
|
|
1211
|
+
(f) => f.textCondition || f.numberCondition || f.dateCondition || f.text || f.selectedValues && f.selectedValues.length > 0 || f.min !== void 0 || f.max !== void 0 || f.includeBlanks || f.excludeBlanks
|
|
1212
|
+
).length : 0;
|
|
1213
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
|
|
1214
|
+
/* @__PURE__ */ jsxs4(
|
|
1215
|
+
"div",
|
|
1216
|
+
{
|
|
1217
|
+
className: cn(
|
|
1218
|
+
"flex flex-wrap items-center justify-between gap-2 px-4 py-2 border-b border-gray-200 bg-white",
|
|
1219
|
+
className
|
|
1220
|
+
),
|
|
1221
|
+
children: [
|
|
1222
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1223
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
|
|
1224
|
+
/* @__PURE__ */ jsx4(
|
|
1225
|
+
"button",
|
|
1226
|
+
{
|
|
1227
|
+
type: "button",
|
|
1228
|
+
onClick: onUndo,
|
|
1229
|
+
disabled: !canUndo,
|
|
1230
|
+
className: cn(
|
|
1231
|
+
buttonBaseClasses,
|
|
1232
|
+
canUndo ? "bg-gray-100 text-gray-700 hover:bg-gray-200" : "bg-gray-50 text-gray-400"
|
|
1233
|
+
),
|
|
1234
|
+
title: `Undo (${undoCount} changes)`,
|
|
1235
|
+
children: /* @__PURE__ */ jsx4(HiReply, { className: "h-4 w-4" })
|
|
1236
|
+
}
|
|
1237
|
+
),
|
|
1238
|
+
/* @__PURE__ */ jsx4(
|
|
1239
|
+
"button",
|
|
1240
|
+
{
|
|
1241
|
+
type: "button",
|
|
1242
|
+
onClick: onRedo,
|
|
1243
|
+
disabled: !canRedo,
|
|
1244
|
+
className: cn(
|
|
1245
|
+
buttonBaseClasses,
|
|
1246
|
+
canRedo ? "bg-gray-100 text-gray-700 hover:bg-gray-200" : "bg-gray-50 text-gray-400"
|
|
1247
|
+
),
|
|
1248
|
+
title: `Redo (${redoCount} changes)`,
|
|
1249
|
+
style: { transform: "scaleX(-1)" },
|
|
1250
|
+
children: /* @__PURE__ */ jsx4(HiReply, { className: "h-4 w-4" })
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1253
|
+
] }),
|
|
1254
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 px-1.5 py-1 bg-gray-100 rounded", children: [
|
|
1255
|
+
/* @__PURE__ */ jsx4(
|
|
1256
|
+
"button",
|
|
1257
|
+
{
|
|
1258
|
+
type: "button",
|
|
1259
|
+
onClick: onZoomOut,
|
|
1260
|
+
className: "p-1 hover:bg-white rounded",
|
|
1261
|
+
title: "Zoom out",
|
|
1262
|
+
children: /* @__PURE__ */ jsx4(HiZoomOut, { className: "h-4 w-4 text-gray-600" })
|
|
1263
|
+
}
|
|
1264
|
+
),
|
|
1265
|
+
/* @__PURE__ */ jsxs4(
|
|
1266
|
+
"button",
|
|
1267
|
+
{
|
|
1268
|
+
type: "button",
|
|
1269
|
+
onClick: onZoomReset,
|
|
1270
|
+
className: "px-2 py-0.5 hover:bg-white rounded text-xs min-w-[45px] text-center text-gray-600",
|
|
1271
|
+
title: "Reset zoom",
|
|
1272
|
+
children: [
|
|
1273
|
+
zoom,
|
|
1274
|
+
"%"
|
|
1275
|
+
]
|
|
1276
|
+
}
|
|
1277
|
+
),
|
|
1278
|
+
/* @__PURE__ */ jsx4(
|
|
1279
|
+
"button",
|
|
1280
|
+
{
|
|
1281
|
+
type: "button",
|
|
1282
|
+
onClick: onZoomIn,
|
|
1283
|
+
className: "p-1 hover:bg-white rounded",
|
|
1284
|
+
title: "Zoom in",
|
|
1285
|
+
children: /* @__PURE__ */ jsx4(HiZoomIn, { className: "h-4 w-4 text-gray-600" })
|
|
1286
|
+
}
|
|
1287
|
+
)
|
|
1288
|
+
] })
|
|
1289
|
+
] }),
|
|
1290
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
1291
|
+
selectedRowCount > 0 && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 px-2.5 py-1.5 bg-blue-600 text-white rounded", children: [
|
|
1292
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-xs font-medium whitespace-nowrap", children: [
|
|
1293
|
+
selectedRowCount,
|
|
1294
|
+
" row",
|
|
1295
|
+
selectedRowCount !== 1 ? "s" : "",
|
|
1296
|
+
" selected"
|
|
1297
|
+
] }),
|
|
1298
|
+
/* @__PURE__ */ jsx4(
|
|
1299
|
+
"button",
|
|
1300
|
+
{
|
|
1301
|
+
type: "button",
|
|
1302
|
+
onClick: onClearSelection,
|
|
1303
|
+
className: "p-0.5 hover:bg-blue-700 rounded",
|
|
1304
|
+
title: "Clear selection",
|
|
1305
|
+
children: /* @__PURE__ */ jsx4(HiX, { className: "h-3 w-3" })
|
|
1306
|
+
}
|
|
1307
|
+
)
|
|
1308
|
+
] }),
|
|
1309
|
+
hasActiveFilters && onToggleFiltersPanel && /* @__PURE__ */ jsxs4(
|
|
1019
1310
|
"button",
|
|
1020
1311
|
{
|
|
1021
1312
|
type: "button",
|
|
1022
|
-
onClick:
|
|
1023
|
-
disabled: !canUndo,
|
|
1313
|
+
onClick: onToggleFiltersPanel,
|
|
1024
1314
|
className: cn(
|
|
1025
|
-
|
|
1026
|
-
|
|
1315
|
+
"flex items-center gap-2 px-2.5 py-1.5 rounded transition-colors",
|
|
1316
|
+
showFiltersPanel ? "bg-amber-600 text-white hover:bg-amber-700" : "bg-amber-500 text-white hover:bg-amber-600"
|
|
1027
1317
|
),
|
|
1028
|
-
title:
|
|
1029
|
-
children:
|
|
1318
|
+
title: showFiltersPanel ? "Hide active filters" : "Show active filters",
|
|
1319
|
+
children: [
|
|
1320
|
+
/* @__PURE__ */ jsx4(HiFilter, { className: "h-3.5 w-3.5" }),
|
|
1321
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-xs font-medium whitespace-nowrap", children: [
|
|
1322
|
+
activeFilterCount,
|
|
1323
|
+
" filter",
|
|
1324
|
+
activeFilterCount !== 1 ? "s" : "",
|
|
1325
|
+
" ",
|
|
1326
|
+
"active"
|
|
1327
|
+
] }),
|
|
1328
|
+
showFiltersPanel ? /* @__PURE__ */ jsx4(HiChevronUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx4(HiChevronDown, { className: "h-3 w-3" })
|
|
1329
|
+
]
|
|
1030
1330
|
}
|
|
1031
1331
|
),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
"
|
|
1332
|
+
summary && /* @__PURE__ */ jsxs4(
|
|
1333
|
+
"div",
|
|
1034
1334
|
{
|
|
1035
|
-
type: "button",
|
|
1036
|
-
onClick: onRedo,
|
|
1037
|
-
disabled: !canRedo,
|
|
1038
1335
|
className: cn(
|
|
1039
|
-
|
|
1040
|
-
|
|
1336
|
+
"flex items-center gap-2 px-2.5 py-1.5 rounded border text-xs",
|
|
1337
|
+
getSummaryVariantClasses(summary.variant)
|
|
1041
1338
|
),
|
|
1042
|
-
title: `Redo (${redoCount} changes)`,
|
|
1043
|
-
style: { transform: "scaleX(-1)" },
|
|
1044
|
-
children: /* @__PURE__ */ jsx3(HiReply, { className: "h-4 w-4" })
|
|
1045
|
-
}
|
|
1046
|
-
)
|
|
1047
|
-
] }),
|
|
1048
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1 px-1.5 py-1 bg-gray-100 rounded", children: [
|
|
1049
|
-
/* @__PURE__ */ jsx3(
|
|
1050
|
-
"button",
|
|
1051
|
-
{
|
|
1052
|
-
type: "button",
|
|
1053
|
-
onClick: onZoomOut,
|
|
1054
|
-
className: "p-1 hover:bg-white rounded",
|
|
1055
|
-
title: "Zoom out",
|
|
1056
|
-
children: /* @__PURE__ */ jsx3(HiZoomOut, { className: "h-4 w-4 text-gray-600" })
|
|
1057
|
-
}
|
|
1058
|
-
),
|
|
1059
|
-
/* @__PURE__ */ jsxs3(
|
|
1060
|
-
"button",
|
|
1061
|
-
{
|
|
1062
|
-
type: "button",
|
|
1063
|
-
onClick: onZoomReset,
|
|
1064
|
-
className: "px-2 py-0.5 hover:bg-white rounded text-xs min-w-[45px] text-center text-gray-600",
|
|
1065
|
-
title: "Reset zoom",
|
|
1066
1339
|
children: [
|
|
1067
|
-
|
|
1068
|
-
|
|
1340
|
+
/* @__PURE__ */ jsxs4("span", { className: "font-semibold whitespace-nowrap", children: [
|
|
1341
|
+
summary.label,
|
|
1342
|
+
":"
|
|
1343
|
+
] }),
|
|
1344
|
+
/* @__PURE__ */ jsx4("span", { className: "font-bold whitespace-nowrap", children: summary.value })
|
|
1069
1345
|
]
|
|
1070
1346
|
}
|
|
1071
|
-
),
|
|
1072
|
-
/* @__PURE__ */ jsx3(
|
|
1073
|
-
"button",
|
|
1074
|
-
{
|
|
1075
|
-
type: "button",
|
|
1076
|
-
onClick: onZoomIn,
|
|
1077
|
-
className: "p-1 hover:bg-white rounded",
|
|
1078
|
-
title: "Zoom in",
|
|
1079
|
-
children: /* @__PURE__ */ jsx3(HiZoomIn, { className: "h-4 w-4 text-gray-600" })
|
|
1080
|
-
}
|
|
1081
|
-
)
|
|
1082
|
-
] })
|
|
1083
|
-
] }),
|
|
1084
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
1085
|
-
selectedRowCount > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 px-2.5 py-1.5 bg-blue-600 text-white rounded", children: [
|
|
1086
|
-
/* @__PURE__ */ jsxs3("span", { className: "text-xs font-medium whitespace-nowrap", children: [
|
|
1087
|
-
selectedRowCount,
|
|
1088
|
-
" row",
|
|
1089
|
-
selectedRowCount !== 1 ? "s" : "",
|
|
1090
|
-
" selected"
|
|
1091
|
-
] }),
|
|
1092
|
-
/* @__PURE__ */ jsx3(
|
|
1093
|
-
"button",
|
|
1094
|
-
{
|
|
1095
|
-
type: "button",
|
|
1096
|
-
onClick: onClearSelection,
|
|
1097
|
-
className: "p-0.5 hover:bg-blue-700 rounded",
|
|
1098
|
-
title: "Clear selection",
|
|
1099
|
-
children: /* @__PURE__ */ jsx3(HiX, { className: "h-3 w-3" })
|
|
1100
|
-
}
|
|
1101
1347
|
)
|
|
1102
1348
|
] }),
|
|
1103
|
-
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
|
|
1106
|
-
/* @__PURE__ */ jsx3(
|
|
1107
|
-
"button",
|
|
1349
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1350
|
+
saveStatusDisplay && /* @__PURE__ */ jsx4(
|
|
1351
|
+
"span",
|
|
1108
1352
|
{
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
children:
|
|
1353
|
+
className: cn(
|
|
1354
|
+
"text-xs flex items-center gap-1",
|
|
1355
|
+
saveStatusDisplay.className
|
|
1356
|
+
),
|
|
1357
|
+
children: saveStatusDisplay.text
|
|
1114
1358
|
}
|
|
1115
|
-
)
|
|
1116
|
-
|
|
1117
|
-
summary && /* @__PURE__ */ jsxs3(
|
|
1118
|
-
"div",
|
|
1119
|
-
{
|
|
1120
|
-
className: cn(
|
|
1121
|
-
"flex items-center gap-2 px-2.5 py-1.5 rounded border text-xs",
|
|
1122
|
-
getSummaryVariantClasses(summary.variant)
|
|
1123
|
-
),
|
|
1124
|
-
children: [
|
|
1125
|
-
/* @__PURE__ */ jsxs3("span", { className: "font-semibold whitespace-nowrap", children: [
|
|
1126
|
-
summary.label,
|
|
1127
|
-
":"
|
|
1128
|
-
] }),
|
|
1129
|
-
/* @__PURE__ */ jsx3("span", { className: "font-bold whitespace-nowrap", children: summary.value })
|
|
1130
|
-
]
|
|
1131
|
-
}
|
|
1132
|
-
)
|
|
1133
|
-
] }),
|
|
1134
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
1135
|
-
saveStatusDisplay && /* @__PURE__ */ jsx3(
|
|
1136
|
-
"span",
|
|
1137
|
-
{
|
|
1138
|
-
className: cn(
|
|
1139
|
-
"text-xs flex items-center gap-1",
|
|
1140
|
-
saveStatusDisplay.className
|
|
1141
|
-
),
|
|
1142
|
-
children: saveStatusDisplay.text
|
|
1143
|
-
}
|
|
1144
|
-
),
|
|
1145
|
-
!autoSave && onSave && /* @__PURE__ */ jsxs3(
|
|
1146
|
-
"button",
|
|
1147
|
-
{
|
|
1148
|
-
type: "button",
|
|
1149
|
-
onClick: onSave,
|
|
1150
|
-
disabled: !hasUnsavedChanges,
|
|
1151
|
-
className: cn(
|
|
1152
|
-
"px-3 py-1.5 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors flex items-center gap-1.5",
|
|
1153
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-blue-600"
|
|
1154
|
-
),
|
|
1155
|
-
children: [
|
|
1156
|
-
/* @__PURE__ */ jsx3(HiCheck, { className: "h-3.5 w-3.5" }),
|
|
1157
|
-
"Save"
|
|
1158
|
-
]
|
|
1159
|
-
}
|
|
1160
|
-
),
|
|
1161
|
-
/* @__PURE__ */ jsxs3("div", { className: "relative", ref: menuRef, children: [
|
|
1162
|
-
/* @__PURE__ */ jsxs3(
|
|
1359
|
+
),
|
|
1360
|
+
!autoSave && onSave && /* @__PURE__ */ jsxs4(
|
|
1163
1361
|
"button",
|
|
1164
1362
|
{
|
|
1165
1363
|
type: "button",
|
|
1166
|
-
onClick:
|
|
1167
|
-
|
|
1168
|
-
|
|
1364
|
+
onClick: onSave,
|
|
1365
|
+
disabled: !hasUnsavedChanges,
|
|
1366
|
+
className: cn(
|
|
1367
|
+
"px-3 py-1.5 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors flex items-center gap-1.5",
|
|
1368
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-blue-600"
|
|
1369
|
+
),
|
|
1169
1370
|
children: [
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
|
|
1371
|
+
/* @__PURE__ */ jsx4(HiCheck, { className: "h-3.5 w-3.5" }),
|
|
1372
|
+
"Save"
|
|
1172
1373
|
]
|
|
1173
1374
|
}
|
|
1174
1375
|
),
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
"button",
|
|
1178
|
-
{
|
|
1179
|
-
type: "button",
|
|
1180
|
-
onClick: () => {
|
|
1181
|
-
onSettings();
|
|
1182
|
-
setShowMoreMenu(false);
|
|
1183
|
-
},
|
|
1184
|
-
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1185
|
-
children: [
|
|
1186
|
-
/* @__PURE__ */ jsx3(HiCog, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1187
|
-
/* @__PURE__ */ jsx3("span", { className: "text-gray-700", children: "Settings" })
|
|
1188
|
-
]
|
|
1189
|
-
}
|
|
1190
|
-
),
|
|
1191
|
-
onShowShortcuts && /* @__PURE__ */ jsxs3(
|
|
1376
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative", ref: menuRef, children: [
|
|
1377
|
+
/* @__PURE__ */ jsxs4(
|
|
1192
1378
|
"button",
|
|
1193
1379
|
{
|
|
1194
1380
|
type: "button",
|
|
1195
|
-
onClick: () =>
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
},
|
|
1199
|
-
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1381
|
+
onClick: () => setShowMoreMenu(!showMoreMenu),
|
|
1382
|
+
className: "px-2.5 py-1.5 bg-gray-100 text-gray-700 rounded hover:bg-gray-200 transition-colors flex items-center gap-1.5 text-xs",
|
|
1383
|
+
title: "More actions",
|
|
1200
1384
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx4(HiDotsVertical, { className: "h-3.5 w-3.5" }),
|
|
1386
|
+
/* @__PURE__ */ jsx4("span", { className: "hidden lg:inline", children: "More" })
|
|
1203
1387
|
]
|
|
1204
1388
|
}
|
|
1205
1389
|
),
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1390
|
+
showMoreMenu && /* @__PURE__ */ jsxs4("div", { className: "absolute right-0 top-full mt-1 bg-white border border-gray-200 shadow-lg rounded py-1 min-w-[180px] z-50", children: [
|
|
1391
|
+
onSettings && /* @__PURE__ */ jsxs4(
|
|
1392
|
+
"button",
|
|
1393
|
+
{
|
|
1394
|
+
type: "button",
|
|
1395
|
+
onClick: () => {
|
|
1396
|
+
onSettings();
|
|
1397
|
+
setShowMoreMenu(false);
|
|
1398
|
+
},
|
|
1399
|
+
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1400
|
+
children: [
|
|
1401
|
+
/* @__PURE__ */ jsx4(HiCog, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1402
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: "Settings" })
|
|
1403
|
+
]
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
onShowShortcuts && /* @__PURE__ */ jsxs4(
|
|
1407
|
+
"button",
|
|
1408
|
+
{
|
|
1409
|
+
type: "button",
|
|
1410
|
+
onClick: () => {
|
|
1411
|
+
onShowShortcuts();
|
|
1412
|
+
setShowMoreMenu(false);
|
|
1413
|
+
},
|
|
1414
|
+
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1415
|
+
children: [
|
|
1416
|
+
/* @__PURE__ */ jsx4(HiOutlineQuestionMarkCircle, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1417
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: "Keyboard Shortcuts" })
|
|
1418
|
+
]
|
|
1419
|
+
}
|
|
1420
|
+
),
|
|
1421
|
+
menuItems && menuItems.length > 0 && (onSettings || onShowShortcuts) && /* @__PURE__ */ jsx4("div", { className: "border-t border-gray-100 my-1" }),
|
|
1422
|
+
menuItems?.map((item) => /* @__PURE__ */ jsxs4(
|
|
1423
|
+
"button",
|
|
1424
|
+
{
|
|
1425
|
+
type: "button",
|
|
1426
|
+
disabled: item.disabled,
|
|
1427
|
+
onClick: () => {
|
|
1428
|
+
item.onClick();
|
|
1429
|
+
setShowMoreMenu(false);
|
|
1430
|
+
},
|
|
1431
|
+
className: cn(
|
|
1432
|
+
"w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1433
|
+
item.disabled && "opacity-50 cursor-not-allowed"
|
|
1434
|
+
),
|
|
1435
|
+
children: [
|
|
1436
|
+
item.icon && /* @__PURE__ */ jsx4("span", { className: "h-3.5 w-3.5 text-gray-500 flex items-center justify-center", children: item.icon }),
|
|
1437
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: item.label })
|
|
1438
|
+
]
|
|
1215
1439
|
},
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
),
|
|
1220
|
-
children: [
|
|
1221
|
-
item.icon && /* @__PURE__ */ jsx3("span", { className: "h-3.5 w-3.5 text-gray-500 flex items-center justify-center", children: item.icon }),
|
|
1222
|
-
/* @__PURE__ */ jsx3("span", { className: "text-gray-700", children: item.label })
|
|
1223
|
-
]
|
|
1224
|
-
},
|
|
1225
|
-
item.id
|
|
1226
|
-
))
|
|
1440
|
+
item.id
|
|
1441
|
+
))
|
|
1442
|
+
] })
|
|
1227
1443
|
] })
|
|
1228
1444
|
] })
|
|
1229
|
-
]
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1445
|
+
]
|
|
1446
|
+
}
|
|
1447
|
+
),
|
|
1448
|
+
showFiltersPanel && filters && columns && onClearFilter && onClearFilters && /* @__PURE__ */ jsx4(
|
|
1449
|
+
ActiveFiltersDisplay,
|
|
1450
|
+
{
|
|
1451
|
+
filters,
|
|
1452
|
+
columns,
|
|
1453
|
+
onClearFilter,
|
|
1454
|
+
onClearAllFilters: onClearFilters
|
|
1455
|
+
}
|
|
1456
|
+
)
|
|
1457
|
+
] });
|
|
1233
1458
|
};
|
|
1234
1459
|
SpreadsheetToolbar.displayName = "SpreadsheetToolbar";
|
|
1235
1460
|
|
|
@@ -1242,7 +1467,7 @@ function MdOutlinePushPin(props) {
|
|
|
1242
1467
|
}
|
|
1243
1468
|
|
|
1244
1469
|
// src/components/ColumnHeaderActions.tsx
|
|
1245
|
-
import { jsx as
|
|
1470
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1246
1471
|
function ColumnHeaderActions({
|
|
1247
1472
|
enableFiltering = false,
|
|
1248
1473
|
enableHighlighting = false,
|
|
@@ -1259,8 +1484,8 @@ function ColumnHeaderActions({
|
|
|
1259
1484
|
unpinnedTitle = "Pin column",
|
|
1260
1485
|
className
|
|
1261
1486
|
}) {
|
|
1262
|
-
return /* @__PURE__ */
|
|
1263
|
-
enableFiltering && onFilterClick && /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("flex items-center gap-0.5", className), children: [
|
|
1488
|
+
enableFiltering && onFilterClick && /* @__PURE__ */ jsx5(
|
|
1264
1489
|
"button",
|
|
1265
1490
|
{
|
|
1266
1491
|
type: "button",
|
|
@@ -1273,10 +1498,10 @@ function ColumnHeaderActions({
|
|
|
1273
1498
|
hasActiveFilter ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1274
1499
|
),
|
|
1275
1500
|
title: filterTitle,
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1501
|
+
children: /* @__PURE__ */ jsx5(HiFilter, { className: "h-3 w-3" })
|
|
1277
1502
|
}
|
|
1278
1503
|
),
|
|
1279
|
-
enableHighlighting && onHighlightClick && /* @__PURE__ */
|
|
1504
|
+
enableHighlighting && onHighlightClick && /* @__PURE__ */ jsx5(
|
|
1280
1505
|
"button",
|
|
1281
1506
|
{
|
|
1282
1507
|
type: "button",
|
|
@@ -1289,10 +1514,10 @@ function ColumnHeaderActions({
|
|
|
1289
1514
|
hasActiveHighlight ? "text-amber-500 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1290
1515
|
),
|
|
1291
1516
|
title: highlightTitle,
|
|
1292
|
-
children: /* @__PURE__ */
|
|
1517
|
+
children: /* @__PURE__ */ jsx5(AiFillHighlight, { className: "h-3 w-3" })
|
|
1293
1518
|
}
|
|
1294
1519
|
),
|
|
1295
|
-
enablePinning && onPinClick && /* @__PURE__ */
|
|
1520
|
+
enablePinning && onPinClick && /* @__PURE__ */ jsx5(
|
|
1296
1521
|
"button",
|
|
1297
1522
|
{
|
|
1298
1523
|
type: "button",
|
|
@@ -1305,7 +1530,7 @@ function ColumnHeaderActions({
|
|
|
1305
1530
|
isPinned ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1306
1531
|
),
|
|
1307
1532
|
title: isPinned ? pinnedTitle : unpinnedTitle,
|
|
1308
|
-
children: isPinned ? /* @__PURE__ */
|
|
1533
|
+
children: isPinned ? /* @__PURE__ */ jsx5(MdPushPin, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx5(MdOutlinePushPin, { className: "h-3 w-3" })
|
|
1309
1534
|
}
|
|
1310
1535
|
)
|
|
1311
1536
|
] });
|
|
@@ -1313,7 +1538,7 @@ function ColumnHeaderActions({
|
|
|
1313
1538
|
ColumnHeaderActions.displayName = "ColumnHeaderActions";
|
|
1314
1539
|
|
|
1315
1540
|
// src/components/SpreadsheetHeader.tsx
|
|
1316
|
-
import { jsx as
|
|
1541
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1317
1542
|
var cellPaddingCompact2 = "px-1 py-0.5";
|
|
1318
1543
|
var cellPaddingNormal2 = "px-2 py-1.5";
|
|
1319
1544
|
var SpreadsheetHeader = ({
|
|
@@ -1345,7 +1570,7 @@ var SpreadsheetHeader = ({
|
|
|
1345
1570
|
positionStyles.right = `${rightOffset}px`;
|
|
1346
1571
|
}
|
|
1347
1572
|
}
|
|
1348
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsxs6(
|
|
1349
1574
|
"th",
|
|
1350
1575
|
{
|
|
1351
1576
|
onClick: column.sortable ? onClick : void 0,
|
|
@@ -1366,20 +1591,26 @@ var SpreadsheetHeader = ({
|
|
|
1366
1591
|
// Pinned columns must have a fixed width so sticky offsets stay correct.
|
|
1367
1592
|
// Enforce MIN_PINNED_COLUMN_WIDTH so header actions (pin/filter/highlight) always fit.
|
|
1368
1593
|
...isPinned && {
|
|
1369
|
-
width: Math.max(
|
|
1370
|
-
|
|
1594
|
+
width: Math.max(
|
|
1595
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
1596
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
1597
|
+
),
|
|
1598
|
+
maxWidth: Math.max(
|
|
1599
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
1600
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
1601
|
+
)
|
|
1371
1602
|
},
|
|
1372
1603
|
top: 0,
|
|
1373
1604
|
// For sticky header
|
|
1374
1605
|
...positionStyles
|
|
1375
1606
|
},
|
|
1376
1607
|
children: [
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-1", children: [
|
|
1609
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex-1 flex items-center gap-1", children: [
|
|
1379
1610
|
column.label,
|
|
1380
|
-
isSorted && /* @__PURE__ */
|
|
1611
|
+
isSorted && /* @__PURE__ */ jsx6("span", { className: "text-blue-600", children: sortDirection === "asc" ? /* @__PURE__ */ jsx6(HiChevronUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx6(HiChevronDown, { className: "h-3 w-3" }) })
|
|
1381
1612
|
] }),
|
|
1382
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ jsx6(
|
|
1383
1614
|
ColumnHeaderActions,
|
|
1384
1615
|
{
|
|
1385
1616
|
enableFiltering: column.filterable,
|
|
@@ -1402,7 +1633,7 @@ var SpreadsheetHeader = ({
|
|
|
1402
1633
|
SpreadsheetHeader.displayName = "SpreadsheetHeader";
|
|
1403
1634
|
|
|
1404
1635
|
// src/components/RowIndexColumnHeader.tsx
|
|
1405
|
-
import { jsx as
|
|
1636
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1406
1637
|
var cellPaddingCompact3 = "px-1 py-0.5";
|
|
1407
1638
|
var cellPaddingNormal3 = "px-2 py-1.5";
|
|
1408
1639
|
function RowIndexColumnHeader({
|
|
@@ -1416,7 +1647,7 @@ function RowIndexColumnHeader({
|
|
|
1416
1647
|
className
|
|
1417
1648
|
}) {
|
|
1418
1649
|
const cellPadding = compactMode ? cellPaddingCompact3 : cellPaddingNormal3;
|
|
1419
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ jsx7(
|
|
1420
1651
|
"th",
|
|
1421
1652
|
{
|
|
1422
1653
|
className: cn(
|
|
@@ -1435,9 +1666,9 @@ function RowIndexColumnHeader({
|
|
|
1435
1666
|
left: isPinned ? 0 : void 0,
|
|
1436
1667
|
backgroundColor: highlightColor || "rgb(243 244 246)"
|
|
1437
1668
|
},
|
|
1438
|
-
children: /* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1669
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center gap-1", children: [
|
|
1670
|
+
/* @__PURE__ */ jsx7("span", { children: "#" }),
|
|
1671
|
+
/* @__PURE__ */ jsx7(
|
|
1441
1672
|
ColumnHeaderActions,
|
|
1442
1673
|
{
|
|
1443
1674
|
enableHighlighting,
|
|
@@ -1640,7 +1871,7 @@ function useSpreadsheetHighlighting({
|
|
|
1640
1871
|
}
|
|
1641
1872
|
|
|
1642
1873
|
// src/components/ColorPickerPopover.tsx
|
|
1643
|
-
import { jsx as
|
|
1874
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1644
1875
|
function ColorPickerPopover({
|
|
1645
1876
|
title,
|
|
1646
1877
|
paletteType = "column",
|
|
@@ -1650,9 +1881,9 @@ function ColorPickerPopover({
|
|
|
1650
1881
|
className
|
|
1651
1882
|
}) {
|
|
1652
1883
|
const colorPalette = colors ?? [...HIGHLIGHT_COLORS[paletteType], null];
|
|
1653
|
-
return /* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ jsx8("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxs8("div", { className: cn("bg-white rounded-lg shadow-xl p-4 w-64", className), children: [
|
|
1885
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-sm font-semibold mb-3", children: title }),
|
|
1886
|
+
/* @__PURE__ */ jsx8("div", { className: "grid grid-cols-5 gap-2", children: colorPalette.map((color) => /* @__PURE__ */ jsx8(
|
|
1656
1887
|
"button",
|
|
1657
1888
|
{
|
|
1658
1889
|
type: "button",
|
|
@@ -1667,7 +1898,7 @@ function ColorPickerPopover({
|
|
|
1667
1898
|
},
|
|
1668
1899
|
color || "clear"
|
|
1669
1900
|
)) }),
|
|
1670
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsx8("div", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx8(
|
|
1671
1902
|
"button",
|
|
1672
1903
|
{
|
|
1673
1904
|
type: "button",
|
|
@@ -1682,7 +1913,7 @@ ColorPickerPopover.displayName = "ColorPickerPopover";
|
|
|
1682
1913
|
|
|
1683
1914
|
// src/components/SpreadsheetSettingsModal.tsx
|
|
1684
1915
|
import { useState as useState5, useEffect as useEffect3 } from "react";
|
|
1685
|
-
import { jsx as
|
|
1916
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1686
1917
|
var DEFAULT_SETTINGS = {
|
|
1687
1918
|
defaultPinnedColumns: [],
|
|
1688
1919
|
defaultSort: null,
|
|
@@ -1757,7 +1988,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1757
1988
|
{ id: "sorting", label: "Default Sorting", Icon: HiSortAscending },
|
|
1758
1989
|
{ id: "display", label: "Display Options", Icon: HiEye }
|
|
1759
1990
|
];
|
|
1760
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ jsxs9(
|
|
1761
1992
|
"div",
|
|
1762
1993
|
{
|
|
1763
1994
|
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
@@ -1765,7 +1996,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1765
1996
|
"aria-modal": "true",
|
|
1766
1997
|
"aria-labelledby": "settings-modal-title",
|
|
1767
1998
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsx9(
|
|
1769
2000
|
"button",
|
|
1770
2001
|
{
|
|
1771
2002
|
type: "button",
|
|
@@ -1775,55 +2006,55 @@ var SpreadsheetSettingsModal = ({
|
|
|
1775
2006
|
"aria-label": "Close settings"
|
|
1776
2007
|
}
|
|
1777
2008
|
),
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsxs9("div", { className: "bg-white rounded-lg w-[90%] max-w-[700px] max-h-[90vh] flex flex-col shadow-xl relative z-10", children: [
|
|
2010
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-6 py-5 border-b border-gray-200 flex items-center justify-between", children: [
|
|
2011
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
2012
|
+
/* @__PURE__ */ jsx9(HiCog, { className: "h-6 w-6 text-blue-600" }),
|
|
2013
|
+
/* @__PURE__ */ jsx9("h2", { id: "settings-modal-title", className: "text-xl font-bold text-gray-900", children: title })
|
|
1783
2014
|
] }),
|
|
1784
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsx9(
|
|
1785
2016
|
"button",
|
|
1786
2017
|
{
|
|
1787
2018
|
type: "button",
|
|
1788
2019
|
onClick: onClose,
|
|
1789
2020
|
className: "p-2 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700",
|
|
1790
|
-
children: /* @__PURE__ */
|
|
2021
|
+
children: /* @__PURE__ */ jsx9(HiX, { className: "h-5 w-5" })
|
|
1791
2022
|
}
|
|
1792
2023
|
)
|
|
1793
2024
|
] }),
|
|
1794
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsx9("div", { className: "flex border-b border-gray-200 px-6", children: tabs.map((tab) => /* @__PURE__ */ jsxs9(
|
|
1795
2026
|
"button",
|
|
1796
2027
|
{
|
|
1797
2028
|
type: "button",
|
|
1798
2029
|
onClick: () => setActiveTab(tab.id),
|
|
1799
2030
|
className: `px-4 py-3 flex items-center gap-2 text-sm font-medium transition-colors border-b-2 ${activeTab === tab.id ? "text-blue-600 border-blue-600" : "text-gray-500 border-transparent hover:text-gray-700"}`,
|
|
1800
2031
|
children: [
|
|
1801
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx9(tab.Icon, { className: "h-4 w-4" }),
|
|
1802
2033
|
tab.label
|
|
1803
2034
|
]
|
|
1804
2035
|
},
|
|
1805
2036
|
tab.id
|
|
1806
2037
|
)) }),
|
|
1807
|
-
/* @__PURE__ */
|
|
1808
|
-
activeTab === "columns" && /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1 overflow-auto p-6", children: [
|
|
2039
|
+
activeTab === "columns" && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2040
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-blue-50 border border-blue-200 rounded-lg mb-4 flex gap-3", children: [
|
|
2041
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 text-blue-600 shrink-0 mt-0.5" }),
|
|
2042
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2043
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm font-semibold text-gray-900 mb-1", children: "About Pinned Columns" }),
|
|
2044
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600", children: "Pinned columns stay visible while you scroll horizontally through the table." })
|
|
1814
2045
|
] })
|
|
1815
2046
|
] }),
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600 mb-4", children: "Select which columns should be pinned to the left by default." }),
|
|
2048
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2", children: [
|
|
2049
|
+
/* @__PURE__ */ jsxs9(
|
|
1819
2050
|
"button",
|
|
1820
2051
|
{
|
|
1821
2052
|
type: "button",
|
|
1822
2053
|
onClick: () => togglePinnedColumn("__row_index__"),
|
|
1823
2054
|
className: `flex items-center gap-2 p-3 rounded-lg border transition-colors text-left ${localSettings.defaultPinnedColumns.includes("__row_index__") ? "bg-blue-50 border-blue-300 text-blue-700" : "bg-gray-50 border-gray-200 text-gray-700 hover:border-blue-300"}`,
|
|
1824
2055
|
children: [
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 shrink-0" }),
|
|
2057
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm flex-1 truncate", children: "# (Row Index)" })
|
|
1827
2058
|
]
|
|
1828
2059
|
}
|
|
1829
2060
|
),
|
|
@@ -1831,15 +2062,15 @@ var SpreadsheetSettingsModal = ({
|
|
|
1831
2062
|
const isPinned = localSettings.defaultPinnedColumns.includes(
|
|
1832
2063
|
column.id
|
|
1833
2064
|
);
|
|
1834
|
-
return /* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ jsxs9(
|
|
1835
2066
|
"button",
|
|
1836
2067
|
{
|
|
1837
2068
|
type: "button",
|
|
1838
2069
|
onClick: () => togglePinnedColumn(column.id),
|
|
1839
2070
|
className: `flex items-center gap-2 p-3 rounded-lg border transition-colors text-left ${isPinned ? "bg-blue-50 border-blue-300 text-blue-700" : "bg-gray-50 border-gray-200 text-gray-700 hover:border-blue-300"}`,
|
|
1840
2071
|
children: [
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 shrink-0" }),
|
|
2073
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm flex-1 truncate", children: column.label })
|
|
1843
2074
|
]
|
|
1844
2075
|
},
|
|
1845
2076
|
column.id
|
|
@@ -1847,12 +2078,12 @@ var SpreadsheetSettingsModal = ({
|
|
|
1847
2078
|
})
|
|
1848
2079
|
] })
|
|
1849
2080
|
] }),
|
|
1850
|
-
activeTab === "sorting" && /* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
2081
|
+
activeTab === "sorting" && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2082
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600 mb-4", children: "Set the default column sorting when opening the spreadsheet." }),
|
|
2083
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
2084
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2085
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Sort Column" }),
|
|
2086
|
+
/* @__PURE__ */ jsxs9(
|
|
1856
2087
|
"select",
|
|
1857
2088
|
{
|
|
1858
2089
|
value: localSettings.defaultSort?.columnId || "",
|
|
@@ -1862,15 +2093,15 @@ var SpreadsheetSettingsModal = ({
|
|
|
1862
2093
|
),
|
|
1863
2094
|
className: "w-full p-3 text-sm bg-white border border-gray-300 rounded-lg text-gray-900 cursor-pointer focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1864
2095
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
columns.filter((col) => col.sortable !== false).map((column) => /* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx9("option", { value: "", children: "No default sorting" }),
|
|
2097
|
+
columns.filter((col) => col.sortable !== false).map((column) => /* @__PURE__ */ jsx9("option", { value: column.id, children: column.label }, column.id))
|
|
1867
2098
|
]
|
|
1868
2099
|
}
|
|
1869
2100
|
)
|
|
1870
2101
|
] }),
|
|
1871
|
-
localSettings.defaultSort && /* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
2102
|
+
localSettings.defaultSort && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2103
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Sort Direction" }),
|
|
2104
|
+
/* @__PURE__ */ jsxs9(
|
|
1874
2105
|
"select",
|
|
1875
2106
|
{
|
|
1876
2107
|
value: localSettings.defaultSort.direction,
|
|
@@ -1880,19 +2111,19 @@ var SpreadsheetSettingsModal = ({
|
|
|
1880
2111
|
),
|
|
1881
2112
|
className: "w-full p-3 text-sm bg-white border border-gray-300 rounded-lg text-gray-900 cursor-pointer focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1882
2113
|
children: [
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ jsx9("option", { value: "asc", children: "Ascending (A \u2192 Z, 0 \u2192 9)" }),
|
|
2115
|
+
/* @__PURE__ */ jsx9("option", { value: "desc", children: "Descending (Z \u2192 A, 9 \u2192 0)" })
|
|
1885
2116
|
]
|
|
1886
2117
|
}
|
|
1887
2118
|
)
|
|
1888
2119
|
] })
|
|
1889
2120
|
] })
|
|
1890
2121
|
] }),
|
|
1891
|
-
activeTab === "display" && /* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
2122
|
+
activeTab === "display" && /* @__PURE__ */ jsxs9("div", { className: "space-y-5", children: [
|
|
2123
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600", children: "Customize the display and behavior of the spreadsheet." }),
|
|
2124
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2125
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Default Page Size" }),
|
|
2126
|
+
/* @__PURE__ */ jsx9(
|
|
1896
2127
|
"select",
|
|
1897
2128
|
{
|
|
1898
2129
|
value: localSettings.defaultPageSize,
|
|
@@ -1901,20 +2132,20 @@ var SpreadsheetSettingsModal = ({
|
|
|
1901
2132
|
defaultPageSize: parseInt(e.target.value, 10)
|
|
1902
2133
|
}),
|
|
1903
2134
|
className: "w-full p-3 text-sm bg-white border border-gray-300 rounded-lg text-gray-900 cursor-pointer focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1904
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
2135
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxs9("option", { value: size, children: [
|
|
1905
2136
|
size,
|
|
1906
2137
|
" rows"
|
|
1907
2138
|
] }, size))
|
|
1908
2139
|
}
|
|
1909
2140
|
)
|
|
1910
2141
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2143
|
+
/* @__PURE__ */ jsxs9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: [
|
|
1913
2144
|
"Default Zoom Level: ",
|
|
1914
2145
|
localSettings.defaultZoom,
|
|
1915
2146
|
"%"
|
|
1916
2147
|
] }),
|
|
1917
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ jsx9(
|
|
1918
2149
|
"input",
|
|
1919
2150
|
{
|
|
1920
2151
|
type: "range",
|
|
@@ -1929,14 +2160,14 @@ var SpreadsheetSettingsModal = ({
|
|
|
1929
2160
|
className: "w-full cursor-pointer"
|
|
1930
2161
|
}
|
|
1931
2162
|
),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex justify-between mt-1 text-xs text-gray-500", children: [
|
|
2164
|
+
/* @__PURE__ */ jsx9("span", { children: "50%" }),
|
|
2165
|
+
/* @__PURE__ */ jsx9("span", { children: "150%" })
|
|
1935
2166
|
] })
|
|
1936
2167
|
] }),
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-3", children: [
|
|
2169
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-3 p-4 bg-gray-50 border border-gray-200 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: [
|
|
2170
|
+
/* @__PURE__ */ jsx9(
|
|
1940
2171
|
"input",
|
|
1941
2172
|
{
|
|
1942
2173
|
type: "checkbox",
|
|
@@ -1945,13 +2176,13 @@ var SpreadsheetSettingsModal = ({
|
|
|
1945
2176
|
className: "w-5 h-5 cursor-pointer rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
1946
2177
|
}
|
|
1947
2178
|
),
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
2180
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm font-medium text-gray-900", children: "Auto-save changes" }),
|
|
2181
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm text-gray-500 mt-0.5", children: "Automatically save changes without confirmation" })
|
|
1951
2182
|
] })
|
|
1952
2183
|
] }),
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-3 p-4 bg-gray-50 border border-gray-200 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: [
|
|
2185
|
+
/* @__PURE__ */ jsx9(
|
|
1955
2186
|
"input",
|
|
1956
2187
|
{
|
|
1957
2188
|
type: "checkbox",
|
|
@@ -1963,16 +2194,16 @@ var SpreadsheetSettingsModal = ({
|
|
|
1963
2194
|
className: "w-5 h-5 cursor-pointer rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
1964
2195
|
}
|
|
1965
2196
|
),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
2198
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm font-medium text-gray-900", children: "Compact view" }),
|
|
2199
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm text-gray-500 mt-0.5", children: "Reduce padding and spacing to show more rows on screen" })
|
|
1969
2200
|
] })
|
|
1970
2201
|
] })
|
|
1971
2202
|
] })
|
|
1972
2203
|
] })
|
|
1973
2204
|
] }),
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-6 py-4 border-t border-gray-200 flex justify-between items-center gap-3", children: [
|
|
2206
|
+
/* @__PURE__ */ jsx9(
|
|
1976
2207
|
"button",
|
|
1977
2208
|
{
|
|
1978
2209
|
type: "button",
|
|
@@ -1981,8 +2212,8 @@ var SpreadsheetSettingsModal = ({
|
|
|
1981
2212
|
children: "Reset to Defaults"
|
|
1982
2213
|
}
|
|
1983
2214
|
),
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
|
|
2216
|
+
/* @__PURE__ */ jsx9(
|
|
1986
2217
|
"button",
|
|
1987
2218
|
{
|
|
1988
2219
|
type: "button",
|
|
@@ -1991,7 +2222,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1991
2222
|
children: "Cancel"
|
|
1992
2223
|
}
|
|
1993
2224
|
),
|
|
1994
|
-
/* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ jsx9(
|
|
1995
2226
|
"button",
|
|
1996
2227
|
{
|
|
1997
2228
|
type: "button",
|
|
@@ -2011,7 +2242,7 @@ SpreadsheetSettingsModal.displayName = "SpreadsheetSettingsModal";
|
|
|
2011
2242
|
|
|
2012
2243
|
// src/components/CommentModals.tsx
|
|
2013
2244
|
import { useState as useState6, useEffect as useEffect4 } from "react";
|
|
2014
|
-
import { jsx as
|
|
2245
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2015
2246
|
function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
2016
2247
|
const [commentText, setCommentText] = useState6("");
|
|
2017
2248
|
useEffect4(() => {
|
|
@@ -2030,12 +2261,12 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2030
2261
|
setCommentText("");
|
|
2031
2262
|
onClose();
|
|
2032
2263
|
};
|
|
2033
|
-
return /* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ jsx10("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxs10("div", { className: "bg-white rounded-lg shadow-xl p-6 w-96 max-w-full mx-4", children: [
|
|
2265
|
+
/* @__PURE__ */ jsxs10("h3", { className: "text-lg font-semibold mb-4", children: [
|
|
2035
2266
|
"Add Comment",
|
|
2036
2267
|
columnLabel ? ` - ${columnLabel}` : ""
|
|
2037
2268
|
] }),
|
|
2038
|
-
/* @__PURE__ */
|
|
2269
|
+
/* @__PURE__ */ jsx10(
|
|
2039
2270
|
"textarea",
|
|
2040
2271
|
{
|
|
2041
2272
|
value: commentText,
|
|
@@ -2049,8 +2280,8 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2049
2280
|
autoFocus: true
|
|
2050
2281
|
}
|
|
2051
2282
|
),
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2 mt-4", children: [
|
|
2284
|
+
/* @__PURE__ */ jsx10(
|
|
2054
2285
|
"button",
|
|
2055
2286
|
{
|
|
2056
2287
|
type: "button",
|
|
@@ -2059,7 +2290,7 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2059
2290
|
children: "Cancel"
|
|
2060
2291
|
}
|
|
2061
2292
|
),
|
|
2062
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ jsx10(
|
|
2063
2294
|
"button",
|
|
2064
2295
|
{
|
|
2065
2296
|
type: "button",
|
|
@@ -2082,13 +2313,13 @@ function ViewCommentsModal({
|
|
|
2082
2313
|
onClose
|
|
2083
2314
|
}) {
|
|
2084
2315
|
if (!isOpen) return null;
|
|
2085
|
-
return /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ jsx10("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxs10("div", { className: "bg-white rounded-lg shadow-xl p-6 w-[480px] max-w-full mx-4 max-h-[80vh] flex flex-col", children: [
|
|
2317
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2318
|
+
/* @__PURE__ */ jsxs10("h3", { className: "text-lg font-semibold", children: [
|
|
2088
2319
|
"Comments",
|
|
2089
2320
|
columnLabel ? ` - ${columnLabel}` : ""
|
|
2090
2321
|
] }),
|
|
2091
|
-
/* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ jsx10(
|
|
2092
2323
|
"button",
|
|
2093
2324
|
{
|
|
2094
2325
|
type: "button",
|
|
@@ -2098,8 +2329,8 @@ function ViewCommentsModal({
|
|
|
2098
2329
|
}
|
|
2099
2330
|
)
|
|
2100
2331
|
] }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
comments.map((comment) => /* @__PURE__ */
|
|
2332
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-1 overflow-y-auto space-y-3", children: [
|
|
2333
|
+
comments.map((comment) => /* @__PURE__ */ jsxs10(
|
|
2103
2334
|
"div",
|
|
2104
2335
|
{
|
|
2105
2336
|
className: cn(
|
|
@@ -2107,9 +2338,9 @@ function ViewCommentsModal({
|
|
|
2107
2338
|
comment.resolved ? "bg-gray-50 border-gray-200" : "bg-yellow-50 border-yellow-200"
|
|
2108
2339
|
),
|
|
2109
2340
|
children: [
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2342
|
+
/* @__PURE__ */ jsx10("p", { className: "text-sm text-gray-700", children: comment.text }),
|
|
2343
|
+
/* @__PURE__ */ jsx10(
|
|
2113
2344
|
"button",
|
|
2114
2345
|
{
|
|
2115
2346
|
type: "button",
|
|
@@ -2122,23 +2353,23 @@ function ViewCommentsModal({
|
|
|
2122
2353
|
}
|
|
2123
2354
|
)
|
|
2124
2355
|
] }),
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
comment.author && /* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 mt-2 text-xs text-gray-500", children: [
|
|
2357
|
+
comment.author && /* @__PURE__ */ jsx10("span", { children: comment.author }),
|
|
2358
|
+
/* @__PURE__ */ jsx10("span", { children: new Date(comment.timestamp).toLocaleString() })
|
|
2128
2359
|
] })
|
|
2129
2360
|
]
|
|
2130
2361
|
},
|
|
2131
2362
|
comment.id
|
|
2132
2363
|
)),
|
|
2133
|
-
comments.length === 0 && /* @__PURE__ */
|
|
2364
|
+
comments.length === 0 && /* @__PURE__ */ jsx10("p", { className: "text-center text-gray-500 py-8", children: "No comments for this cell." })
|
|
2134
2365
|
] }),
|
|
2135
|
-
onAddComment && /* @__PURE__ */
|
|
2366
|
+
onAddComment && /* @__PURE__ */ jsx10("div", { className: "mt-4 pt-4 border-t border-gray-200", children: /* @__PURE__ */ jsx10(
|
|
2136
2367
|
"button",
|
|
2137
2368
|
{
|
|
2138
2369
|
type: "button",
|
|
2139
2370
|
onClick: onAddComment,
|
|
2140
2371
|
className: "w-full px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",
|
|
2141
|
-
children: /* @__PURE__ */
|
|
2372
|
+
children: /* @__PURE__ */ jsx10("span", { children: "+ Add Comment" })
|
|
2142
2373
|
}
|
|
2143
2374
|
) })
|
|
2144
2375
|
] }) });
|
|
@@ -2153,11 +2384,11 @@ function DeleteConfirmationModal({
|
|
|
2153
2384
|
onClose
|
|
2154
2385
|
}) {
|
|
2155
2386
|
if (!isOpen) return null;
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ jsx10("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxs10("div", { className: "bg-white rounded-lg shadow-xl p-6 w-96 max-w-full mx-4", children: [
|
|
2388
|
+
/* @__PURE__ */ jsx10("h3", { className: "text-lg font-semibold mb-2", children: title }),
|
|
2389
|
+
/* @__PURE__ */ jsx10("p", { className: "text-gray-600 mb-6", children: message }),
|
|
2390
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2", children: [
|
|
2391
|
+
/* @__PURE__ */ jsx10(
|
|
2161
2392
|
"button",
|
|
2162
2393
|
{
|
|
2163
2394
|
type: "button",
|
|
@@ -2166,7 +2397,7 @@ function DeleteConfirmationModal({
|
|
|
2166
2397
|
children: "Cancel"
|
|
2167
2398
|
}
|
|
2168
2399
|
),
|
|
2169
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ jsx10(
|
|
2170
2401
|
"button",
|
|
2171
2402
|
{
|
|
2172
2403
|
type: "button",
|
|
@@ -2185,50 +2416,50 @@ DeleteConfirmationModal.displayName = "DeleteConfirmationModal";
|
|
|
2185
2416
|
|
|
2186
2417
|
// src/components/KeyboardShortcutsModal.tsx
|
|
2187
2418
|
import React4 from "react";
|
|
2188
|
-
import { jsx as
|
|
2419
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2189
2420
|
function KeyboardShortcutsModal({
|
|
2190
2421
|
isOpen,
|
|
2191
2422
|
onClose,
|
|
2192
2423
|
shortcuts
|
|
2193
2424
|
}) {
|
|
2194
2425
|
if (!isOpen) return null;
|
|
2195
|
-
return /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsx11("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs11("div", { className: "bg-white rounded-lg shadow-xl p-6 w-full max-w-2xl max-h-[80vh] overflow-y-auto mx-4", children: [
|
|
2427
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2428
|
+
/* @__PURE__ */ jsx11("h3", { className: "text-xl font-bold text-gray-900", children: "Keyboard Shortcuts" }),
|
|
2429
|
+
/* @__PURE__ */ jsx11(
|
|
2199
2430
|
"button",
|
|
2200
2431
|
{
|
|
2201
2432
|
type: "button",
|
|
2202
2433
|
onClick: onClose,
|
|
2203
2434
|
className: "p-1 hover:bg-gray-100 rounded",
|
|
2204
|
-
children: /* @__PURE__ */
|
|
2435
|
+
children: /* @__PURE__ */ jsx11("span", { className: "text-gray-500 text-xl", children: "\u2715" })
|
|
2205
2436
|
}
|
|
2206
2437
|
)
|
|
2207
2438
|
] }),
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
|
|
2440
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "General", children: shortcuts.general.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2441
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Row Selection", children: shortcuts.rowSelection.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2442
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Editing", children: shortcuts.editing.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2443
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Cell Navigation", children: shortcuts.navigation.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2444
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Row Actions (hover over row #)", children: shortcuts.rowActions.map((action, index) => /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
|
|
2445
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-600 text-sm", children: action.label }),
|
|
2446
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-500 text-xs", children: action.description })
|
|
2216
2447
|
] }, index)) })
|
|
2217
2448
|
] })
|
|
2218
2449
|
] }) });
|
|
2219
2450
|
}
|
|
2220
2451
|
function ShortcutSection({ title, children }) {
|
|
2221
|
-
return /* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2452
|
+
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
2453
|
+
/* @__PURE__ */ jsx11("h4", { className: "text-gray-900 font-semibold mb-3", children: title }),
|
|
2454
|
+
/* @__PURE__ */ jsx11("div", { className: "space-y-2", children })
|
|
2224
2455
|
] });
|
|
2225
2456
|
}
|
|
2226
2457
|
function ShortcutRow({ label, keys }) {
|
|
2227
|
-
return /* @__PURE__ */
|
|
2228
|
-
/* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */
|
|
2230
|
-
index > 0 && /* @__PURE__ */
|
|
2231
|
-
key.includes("Click") ? /* @__PURE__ */
|
|
2458
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
|
|
2459
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-600 text-sm", children: label }),
|
|
2460
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center gap-1", children: keys.map((key, index) => /* @__PURE__ */ jsxs11(React4.Fragment, { children: [
|
|
2461
|
+
index > 0 && /* @__PURE__ */ jsx11("span", { className: "text-gray-400", children: "+" }),
|
|
2462
|
+
key.includes("Click") ? /* @__PURE__ */ jsx11("span", { className: "text-gray-500 text-xs", children: key }) : /* @__PURE__ */ jsx11("kbd", { className: "px-2 py-1 bg-gray-100 text-gray-800 rounded text-xs border border-gray-200", children: key })
|
|
2232
2463
|
] }, index)) })
|
|
2233
2464
|
] });
|
|
2234
2465
|
}
|
|
@@ -2237,7 +2468,7 @@ KeyboardShortcutsModal.displayName = "KeyboardShortcutsModal";
|
|
|
2237
2468
|
// src/components/RowContextMenu.tsx
|
|
2238
2469
|
import { useMemo as useMemo2 } from "react";
|
|
2239
2470
|
import { ContextMenu, ContextMenuItem } from "@xcelsior/design-system";
|
|
2240
|
-
import { jsx as
|
|
2471
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2241
2472
|
function RowContextMenu({
|
|
2242
2473
|
row,
|
|
2243
2474
|
rowId,
|
|
@@ -2251,10 +2482,10 @@ function RowContextMenu({
|
|
|
2251
2482
|
if (visibleItems.length === 0) {
|
|
2252
2483
|
return null;
|
|
2253
2484
|
}
|
|
2254
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsx12(
|
|
2255
2486
|
ContextMenu,
|
|
2256
2487
|
{
|
|
2257
|
-
trigger: /* @__PURE__ */
|
|
2488
|
+
trigger: /* @__PURE__ */ jsx12(
|
|
2258
2489
|
"button",
|
|
2259
2490
|
{
|
|
2260
2491
|
type: "button",
|
|
@@ -2263,7 +2494,7 @@ function RowContextMenu({
|
|
|
2263
2494
|
className
|
|
2264
2495
|
),
|
|
2265
2496
|
title: "More actions",
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2497
|
+
children: /* @__PURE__ */ jsx12(
|
|
2267
2498
|
HiDotsVertical,
|
|
2268
2499
|
{
|
|
2269
2500
|
className: cn("text-gray-500", compactMode ? "h-2.5 w-2.5" : "h-3 w-3")
|
|
@@ -2275,7 +2506,7 @@ function RowContextMenu({
|
|
|
2275
2506
|
children: visibleItems.map((item) => {
|
|
2276
2507
|
const isDisabled = item.disabled?.(row);
|
|
2277
2508
|
const variantClass = item.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "";
|
|
2278
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsxs12(
|
|
2279
2510
|
ContextMenuItem,
|
|
2280
2511
|
{
|
|
2281
2512
|
onClick: (e) => {
|
|
@@ -2285,7 +2516,7 @@ function RowContextMenu({
|
|
|
2285
2516
|
disabled: isDisabled,
|
|
2286
2517
|
className: `${variantClass} ${item.className || ""}`,
|
|
2287
2518
|
children: [
|
|
2288
|
-
item.icon && /* @__PURE__ */
|
|
2519
|
+
item.icon && /* @__PURE__ */ jsx12("span", { className: "mr-2", children: item.icon }),
|
|
2289
2520
|
item.label
|
|
2290
2521
|
]
|
|
2291
2522
|
},
|
|
@@ -3384,7 +3615,7 @@ function useSpreadsheetSelection({
|
|
|
3384
3615
|
}
|
|
3385
3616
|
|
|
3386
3617
|
// src/components/Spreadsheet.tsx
|
|
3387
|
-
import { jsx as
|
|
3618
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3388
3619
|
function Spreadsheet({
|
|
3389
3620
|
data,
|
|
3390
3621
|
columns,
|
|
@@ -3515,6 +3746,7 @@ function Spreadsheet({
|
|
|
3515
3746
|
onToggleCommentResolved
|
|
3516
3747
|
});
|
|
3517
3748
|
const [showSettingsModal, setShowSettingsModal] = useState12(false);
|
|
3749
|
+
const [showFiltersPanel, setShowFiltersPanel] = useState12(false);
|
|
3518
3750
|
const {
|
|
3519
3751
|
canUndo,
|
|
3520
3752
|
canRedo,
|
|
@@ -3561,6 +3793,23 @@ function Spreadsheet({
|
|
|
3561
3793
|
},
|
|
3562
3794
|
[controlledPageSize, controlledCurrentPage, onPageChange]
|
|
3563
3795
|
);
|
|
3796
|
+
const resetPaginationToFirstPage = useCallback7(() => {
|
|
3797
|
+
if (controlledCurrentPage === void 0) {
|
|
3798
|
+
setInternalCurrentPage(1);
|
|
3799
|
+
}
|
|
3800
|
+
onPageChange?.(1, pageSize);
|
|
3801
|
+
}, [controlledCurrentPage, onPageChange, pageSize]);
|
|
3802
|
+
const handleFilterChangeWithReset = useCallback7(
|
|
3803
|
+
(columnId, filter) => {
|
|
3804
|
+
handleFilterChange(columnId, filter);
|
|
3805
|
+
resetPaginationToFirstPage();
|
|
3806
|
+
},
|
|
3807
|
+
[handleFilterChange, resetPaginationToFirstPage]
|
|
3808
|
+
);
|
|
3809
|
+
const clearAllFiltersWithReset = useCallback7(() => {
|
|
3810
|
+
clearAllFilters();
|
|
3811
|
+
resetPaginationToFirstPage();
|
|
3812
|
+
}, [clearAllFilters, resetPaginationToFirstPage]);
|
|
3564
3813
|
useEffect6(() => {
|
|
3565
3814
|
setSpreadsheetSettings((prev) => ({
|
|
3566
3815
|
...prev,
|
|
@@ -3959,8 +4208,8 @@ function Spreadsheet({
|
|
|
3959
4208
|
);
|
|
3960
4209
|
return [...leftPinned, ...groups, ...rightPinned];
|
|
3961
4210
|
}, [columnGroups, collapsedGroups, columns, pinnedColumns]);
|
|
3962
|
-
return /* @__PURE__ */
|
|
3963
|
-
showToolbar && /* @__PURE__ */
|
|
4211
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("flex flex-col h-full bg-white", className), children: [
|
|
4212
|
+
showToolbar && /* @__PURE__ */ jsx13(
|
|
3964
4213
|
SpreadsheetToolbar,
|
|
3965
4214
|
{
|
|
3966
4215
|
zoom,
|
|
@@ -3973,7 +4222,12 @@ function Spreadsheet({
|
|
|
3973
4222
|
saveStatus,
|
|
3974
4223
|
autoSave: spreadsheetSettings.autoSave,
|
|
3975
4224
|
hasActiveFilters,
|
|
3976
|
-
onClearFilters:
|
|
4225
|
+
onClearFilters: clearAllFiltersWithReset,
|
|
4226
|
+
filters,
|
|
4227
|
+
columns,
|
|
4228
|
+
onClearFilter: (columnId) => handleFilterChangeWithReset(columnId, void 0),
|
|
4229
|
+
showFiltersPanel,
|
|
4230
|
+
onToggleFiltersPanel: () => setShowFiltersPanel(!showFiltersPanel),
|
|
3977
4231
|
onZoomIn: () => setZoom((z) => Math.min(z + 10, 200)),
|
|
3978
4232
|
onZoomOut: () => setZoom((z) => Math.max(z - 10, 50)),
|
|
3979
4233
|
onZoomReset: () => setZoom(100),
|
|
@@ -3990,16 +4244,16 @@ function Spreadsheet({
|
|
|
3990
4244
|
menuItems: toolbarMenuItems
|
|
3991
4245
|
}
|
|
3992
4246
|
),
|
|
3993
|
-
/* @__PURE__ */
|
|
4247
|
+
/* @__PURE__ */ jsx13("div", { ref: tableRef, className: "flex-1 overflow-auto border border-gray-200 rounded", children: /* @__PURE__ */ jsx13(
|
|
3994
4248
|
"div",
|
|
3995
4249
|
{
|
|
3996
4250
|
style: {
|
|
3997
4251
|
zoom: zoom / 100
|
|
3998
4252
|
},
|
|
3999
|
-
children: /* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
columnGroups && groupHeaderItems && /* @__PURE__ */
|
|
4002
|
-
/* @__PURE__ */
|
|
4253
|
+
children: /* @__PURE__ */ jsxs13("table", { className: "border-separate border-spacing-0 text-xs select-none", children: [
|
|
4254
|
+
/* @__PURE__ */ jsxs13("thead", { children: [
|
|
4255
|
+
columnGroups && groupHeaderItems && /* @__PURE__ */ jsxs13("tr", { children: [
|
|
4256
|
+
/* @__PURE__ */ jsx13(
|
|
4003
4257
|
RowIndexColumnHeader,
|
|
4004
4258
|
{
|
|
4005
4259
|
enableHighlighting,
|
|
@@ -4015,7 +4269,11 @@ function Spreadsheet({
|
|
|
4015
4269
|
if (item.type === "pinned-column") {
|
|
4016
4270
|
const col = columns.find((c) => c.id === item.columnId);
|
|
4017
4271
|
const isPinnedLeft = item.pinSide === "left";
|
|
4018
|
-
|
|
4272
|
+
const pinnedWidth = Math.max(
|
|
4273
|
+
col?.minWidth || col?.width || MIN_PINNED_COLUMN_WIDTH,
|
|
4274
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
4275
|
+
);
|
|
4276
|
+
return /* @__PURE__ */ jsx13(
|
|
4019
4277
|
"th",
|
|
4020
4278
|
{
|
|
4021
4279
|
className: cn(
|
|
@@ -4027,16 +4285,14 @@ function Spreadsheet({
|
|
|
4027
4285
|
position: "sticky",
|
|
4028
4286
|
left: isPinnedLeft ? `${getColumnLeftOffset(item.columnId)}px` : void 0,
|
|
4029
4287
|
right: !isPinnedLeft ? `${getColumnRightOffset(item.columnId)}px` : void 0,
|
|
4030
|
-
minWidth:
|
|
4031
|
-
width: Math.max(col?.minWidth || col?.width || MIN_PINNED_COLUMN_WIDTH, MIN_PINNED_COLUMN_WIDTH),
|
|
4032
|
-
maxWidth: Math.max(col?.minWidth || col?.width || MIN_PINNED_COLUMN_WIDTH, MIN_PINNED_COLUMN_WIDTH)
|
|
4288
|
+
minWidth: pinnedWidth
|
|
4033
4289
|
}
|
|
4034
4290
|
},
|
|
4035
4291
|
`pinned-group-${item.columnId}`
|
|
4036
4292
|
);
|
|
4037
4293
|
}
|
|
4038
4294
|
const { group, colSpan, isCollapsed } = item;
|
|
4039
|
-
return /* @__PURE__ */
|
|
4295
|
+
return /* @__PURE__ */ jsx13(
|
|
4040
4296
|
"th",
|
|
4041
4297
|
{
|
|
4042
4298
|
colSpan,
|
|
@@ -4048,17 +4304,17 @@ function Spreadsheet({
|
|
|
4048
4304
|
backgroundColor: group.headerColor || "rgb(243 244 246)"
|
|
4049
4305
|
},
|
|
4050
4306
|
onClick: () => group.collapsible && handleToggleGroupCollapse(group.id),
|
|
4051
|
-
children: /* @__PURE__ */
|
|
4052
|
-
group.collapsible && (isCollapsed ? /* @__PURE__ */
|
|
4053
|
-
/* @__PURE__ */
|
|
4307
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center gap-1", children: [
|
|
4308
|
+
group.collapsible && (isCollapsed ? /* @__PURE__ */ jsx13(HiChevronRight, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx13(HiChevronDown, { className: "h-3 w-3" })),
|
|
4309
|
+
/* @__PURE__ */ jsx13("span", { children: group.label })
|
|
4054
4310
|
] })
|
|
4055
4311
|
},
|
|
4056
4312
|
group.id
|
|
4057
4313
|
);
|
|
4058
4314
|
})
|
|
4059
4315
|
] }),
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
!columnGroups && /* @__PURE__ */
|
|
4316
|
+
/* @__PURE__ */ jsxs13("tr", { children: [
|
|
4317
|
+
!columnGroups && /* @__PURE__ */ jsx13(
|
|
4062
4318
|
RowIndexColumnHeader,
|
|
4063
4319
|
{
|
|
4064
4320
|
enableHighlighting,
|
|
@@ -4072,7 +4328,7 @@ function Spreadsheet({
|
|
|
4072
4328
|
),
|
|
4073
4329
|
columnRenderItems.map((item) => {
|
|
4074
4330
|
if (item.type === "collapsed-placeholder") {
|
|
4075
|
-
return /* @__PURE__ */
|
|
4331
|
+
return /* @__PURE__ */ jsx13(
|
|
4076
4332
|
"th",
|
|
4077
4333
|
{
|
|
4078
4334
|
className: "border border-gray-200 px-2 py-1 text-center text-gray-400",
|
|
@@ -4088,7 +4344,7 @@ function Spreadsheet({
|
|
|
4088
4344
|
const column = item.column;
|
|
4089
4345
|
const isPinnedLeft = isColumnPinned(column.id) && getColumnPinSide(column.id) === "left";
|
|
4090
4346
|
const isPinnedRight = isColumnPinned(column.id) && getColumnPinSide(column.id) === "right";
|
|
4091
|
-
return /* @__PURE__ */
|
|
4347
|
+
return /* @__PURE__ */ jsx13(
|
|
4092
4348
|
SpreadsheetHeader,
|
|
4093
4349
|
{
|
|
4094
4350
|
column,
|
|
@@ -4106,12 +4362,12 @@ function Spreadsheet({
|
|
|
4106
4362
|
),
|
|
4107
4363
|
onPinClick: () => handleTogglePin(column.id),
|
|
4108
4364
|
onHighlightClick: enableHighlighting ? () => setHighlightPickerColumn(column.id) : void 0,
|
|
4109
|
-
children: activeFilterColumn === column.id && /* @__PURE__ */
|
|
4365
|
+
children: activeFilterColumn === column.id && /* @__PURE__ */ jsx13(
|
|
4110
4366
|
SpreadsheetFilterDropdown,
|
|
4111
4367
|
{
|
|
4112
4368
|
column,
|
|
4113
4369
|
filter: filters[column.id],
|
|
4114
|
-
onFilterChange: (filter) =>
|
|
4370
|
+
onFilterChange: (filter) => handleFilterChangeWithReset(column.id, filter),
|
|
4115
4371
|
onClose: () => setActiveFilterColumn(null)
|
|
4116
4372
|
}
|
|
4117
4373
|
)
|
|
@@ -4121,17 +4377,17 @@ function Spreadsheet({
|
|
|
4121
4377
|
})
|
|
4122
4378
|
] })
|
|
4123
4379
|
] }),
|
|
4124
|
-
/* @__PURE__ */
|
|
4380
|
+
/* @__PURE__ */ jsx13("tbody", { children: isLoading ? /* @__PURE__ */ jsx13("tr", { children: /* @__PURE__ */ jsx13(
|
|
4125
4381
|
"td",
|
|
4126
4382
|
{
|
|
4127
4383
|
colSpan: columnRenderItems.length + 1,
|
|
4128
4384
|
className: "text-center py-8 text-gray-500",
|
|
4129
|
-
children: /* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4385
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center gap-2", children: [
|
|
4386
|
+
/* @__PURE__ */ jsx13("div", { className: "w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" }),
|
|
4131
4387
|
"Loading..."
|
|
4132
4388
|
] })
|
|
4133
4389
|
}
|
|
4134
|
-
) }) : paginatedData.length === 0 ? /* @__PURE__ */
|
|
4390
|
+
) }) : paginatedData.length === 0 ? /* @__PURE__ */ jsx13("tr", { children: /* @__PURE__ */ jsx13(
|
|
4135
4391
|
"td",
|
|
4136
4392
|
{
|
|
4137
4393
|
colSpan: columnRenderItems.length + 1,
|
|
@@ -4144,7 +4400,7 @@ function Spreadsheet({
|
|
|
4144
4400
|
const isRowHovered = hoveredRow === rowId;
|
|
4145
4401
|
const rowHighlight = getRowHighlight(rowId);
|
|
4146
4402
|
const displayIndex = rowIndex + 1 + (currentPage - 1) * pageSize;
|
|
4147
|
-
return /* @__PURE__ */
|
|
4403
|
+
return /* @__PURE__ */ jsxs13(
|
|
4148
4404
|
"tr",
|
|
4149
4405
|
{
|
|
4150
4406
|
onMouseEnter: () => setHoveredRow(rowId),
|
|
@@ -4154,7 +4410,7 @@ function Spreadsheet({
|
|
|
4154
4410
|
},
|
|
4155
4411
|
onDoubleClick: () => onRowDoubleClick?.(row, rowIndex),
|
|
4156
4412
|
children: [
|
|
4157
|
-
/* @__PURE__ */
|
|
4413
|
+
/* @__PURE__ */ jsx13(
|
|
4158
4414
|
"td",
|
|
4159
4415
|
{
|
|
4160
4416
|
onClick: (e) => handleRowSelect(rowId, e),
|
|
@@ -4175,10 +4431,10 @@ function Spreadsheet({
|
|
|
4175
4431
|
left: 0
|
|
4176
4432
|
}
|
|
4177
4433
|
},
|
|
4178
|
-
children: /* @__PURE__ */
|
|
4179
|
-
/* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
rowContextMenuItems && rowContextMenuItems.length > 0 && /* @__PURE__ */
|
|
4434
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "relative flex items-center justify-center w-full h-full", children: [
|
|
4435
|
+
/* @__PURE__ */ jsx13("span", { children: displayIndex }),
|
|
4436
|
+
/* @__PURE__ */ jsxs13("div", { className: "absolute inset-0 flex items-center justify-evenly", children: [
|
|
4437
|
+
rowContextMenuItems && rowContextMenuItems.length > 0 && /* @__PURE__ */ jsx13(
|
|
4182
4438
|
RowContextMenu,
|
|
4183
4439
|
{
|
|
4184
4440
|
row,
|
|
@@ -4187,7 +4443,7 @@ function Spreadsheet({
|
|
|
4187
4443
|
compactMode: effectiveCompactMode
|
|
4188
4444
|
}
|
|
4189
4445
|
),
|
|
4190
|
-
enableHighlighting && /* @__PURE__ */
|
|
4446
|
+
enableHighlighting && /* @__PURE__ */ jsx13(
|
|
4191
4447
|
"button",
|
|
4192
4448
|
{
|
|
4193
4449
|
type: "button",
|
|
@@ -4197,7 +4453,7 @@ function Spreadsheet({
|
|
|
4197
4453
|
},
|
|
4198
4454
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-gray-200 rounded",
|
|
4199
4455
|
title: "Highlight row",
|
|
4200
|
-
children: /* @__PURE__ */
|
|
4456
|
+
children: /* @__PURE__ */ jsx13(
|
|
4201
4457
|
AiFillHighlight,
|
|
4202
4458
|
{
|
|
4203
4459
|
className: cn(
|
|
@@ -4211,7 +4467,7 @@ function Spreadsheet({
|
|
|
4211
4467
|
enableComments && (cellHasComments(
|
|
4212
4468
|
rowId,
|
|
4213
4469
|
ROW_INDEX_COLUMN_ID
|
|
4214
|
-
) ? /* @__PURE__ */
|
|
4470
|
+
) ? /* @__PURE__ */ jsxs13(
|
|
4215
4471
|
"button",
|
|
4216
4472
|
{
|
|
4217
4473
|
type: "button",
|
|
@@ -4225,11 +4481,11 @@ function Spreadsheet({
|
|
|
4225
4481
|
className: "p-0.5 bg-amber-100 hover:bg-amber-200 rounded transition-colors flex items-center gap-0.5",
|
|
4226
4482
|
title: `${getCellUnresolvedCommentCount(rowId, ROW_INDEX_COLUMN_ID)} comment(s) - click to view`,
|
|
4227
4483
|
children: [
|
|
4228
|
-
/* @__PURE__ */
|
|
4484
|
+
/* @__PURE__ */ jsx13(FaComment, { className: "h-2.5 w-2.5 text-amber-500" }),
|
|
4229
4485
|
getCellUnresolvedCommentCount(
|
|
4230
4486
|
rowId,
|
|
4231
4487
|
ROW_INDEX_COLUMN_ID
|
|
4232
|
-
) > 0 && /* @__PURE__ */
|
|
4488
|
+
) > 0 && /* @__PURE__ */ jsx13("span", { className: "text-[9px] font-medium text-amber-600", children: getCellUnresolvedCommentCount(
|
|
4233
4489
|
rowId,
|
|
4234
4490
|
ROW_INDEX_COLUMN_ID
|
|
4235
4491
|
) > 99 ? "99+" : getCellUnresolvedCommentCount(
|
|
@@ -4238,7 +4494,7 @@ function Spreadsheet({
|
|
|
4238
4494
|
) })
|
|
4239
4495
|
]
|
|
4240
4496
|
}
|
|
4241
|
-
) : /* @__PURE__ */
|
|
4497
|
+
) : /* @__PURE__ */ jsx13(
|
|
4242
4498
|
"button",
|
|
4243
4499
|
{
|
|
4244
4500
|
type: "button",
|
|
@@ -4251,13 +4507,13 @@ function Spreadsheet({
|
|
|
4251
4507
|
},
|
|
4252
4508
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-gray-200 rounded",
|
|
4253
4509
|
title: "Add comment",
|
|
4254
|
-
children: /* @__PURE__ */
|
|
4510
|
+
children: /* @__PURE__ */ jsx13(FaRegComment, { className: "h-2.5 w-2.5 text-gray-500" })
|
|
4255
4511
|
}
|
|
4256
4512
|
)),
|
|
4257
4513
|
rowActions?.map((action) => {
|
|
4258
4514
|
if (action.visible && !action.visible(row))
|
|
4259
4515
|
return null;
|
|
4260
|
-
return /* @__PURE__ */
|
|
4516
|
+
return /* @__PURE__ */ jsx13(
|
|
4261
4517
|
"button",
|
|
4262
4518
|
{
|
|
4263
4519
|
type: "button",
|
|
@@ -4281,7 +4537,7 @@ function Spreadsheet({
|
|
|
4281
4537
|
),
|
|
4282
4538
|
columnRenderItems.map((item) => {
|
|
4283
4539
|
if (item.type === "collapsed-placeholder") {
|
|
4284
|
-
return /* @__PURE__ */
|
|
4540
|
+
return /* @__PURE__ */ jsx13(
|
|
4285
4541
|
"td",
|
|
4286
4542
|
{
|
|
4287
4543
|
className: "border border-gray-200 px-2 py-1 text-center text-gray-300",
|
|
@@ -4307,7 +4563,7 @@ function Spreadsheet({
|
|
|
4307
4563
|
const cellOrRowOrColumnHighlight = getCellHighlight(rowId, column.id) || rowHighlight?.color || getColumnHighlight(column.id);
|
|
4308
4564
|
const isColPinned = isColumnPinned(column.id);
|
|
4309
4565
|
const colPinSide = getColumnPinSide(column.id);
|
|
4310
|
-
return /* @__PURE__ */
|
|
4566
|
+
return /* @__PURE__ */ jsx13(
|
|
4311
4567
|
MemoizedSpreadsheetCell,
|
|
4312
4568
|
{
|
|
4313
4569
|
value,
|
|
@@ -4367,7 +4623,7 @@ function Spreadsheet({
|
|
|
4367
4623
|
] })
|
|
4368
4624
|
}
|
|
4369
4625
|
) }),
|
|
4370
|
-
showPagination && effectiveTotalItems > 0 && /* @__PURE__ */
|
|
4626
|
+
showPagination && effectiveTotalItems > 0 && /* @__PURE__ */ jsx13(
|
|
4371
4627
|
Pagination,
|
|
4372
4628
|
{
|
|
4373
4629
|
currentPage,
|
|
@@ -4382,7 +4638,7 @@ function Spreadsheet({
|
|
|
4382
4638
|
onPageSizeChange: handlePageSizeChange
|
|
4383
4639
|
}
|
|
4384
4640
|
),
|
|
4385
|
-
/* @__PURE__ */
|
|
4641
|
+
/* @__PURE__ */ jsx13(
|
|
4386
4642
|
AddCommentModal,
|
|
4387
4643
|
{
|
|
4388
4644
|
isOpen: commentModalCell !== null,
|
|
@@ -4393,7 +4649,7 @@ function Spreadsheet({
|
|
|
4393
4649
|
}
|
|
4394
4650
|
}
|
|
4395
4651
|
),
|
|
4396
|
-
/* @__PURE__ */
|
|
4652
|
+
/* @__PURE__ */ jsx13(
|
|
4397
4653
|
ViewCommentsModal,
|
|
4398
4654
|
{
|
|
4399
4655
|
isOpen: viewCommentsCell !== null,
|
|
@@ -4408,7 +4664,7 @@ function Spreadsheet({
|
|
|
4408
4664
|
onClose: () => setViewCommentsCell(null)
|
|
4409
4665
|
}
|
|
4410
4666
|
),
|
|
4411
|
-
highlightPickerRow !== null && /* @__PURE__ */
|
|
4667
|
+
highlightPickerRow !== null && /* @__PURE__ */ jsx13(
|
|
4412
4668
|
ColorPickerPopover,
|
|
4413
4669
|
{
|
|
4414
4670
|
title: "Highlight Row",
|
|
@@ -4417,7 +4673,7 @@ function Spreadsheet({
|
|
|
4417
4673
|
onClose: () => setHighlightPickerRow(null)
|
|
4418
4674
|
}
|
|
4419
4675
|
),
|
|
4420
|
-
highlightPickerColumn !== null && /* @__PURE__ */
|
|
4676
|
+
highlightPickerColumn !== null && /* @__PURE__ */ jsx13(
|
|
4421
4677
|
ColorPickerPopover,
|
|
4422
4678
|
{
|
|
4423
4679
|
title: highlightPickerColumn === ROW_INDEX_COLUMN_ID ? "Highlight Row Index Column" : `Highlight Column: ${columns.find((c) => c.id === highlightPickerColumn)?.label || ""}`,
|
|
@@ -4426,7 +4682,7 @@ function Spreadsheet({
|
|
|
4426
4682
|
onClose: () => setHighlightPickerColumn(null)
|
|
4427
4683
|
}
|
|
4428
4684
|
),
|
|
4429
|
-
highlightPickerCell !== null && /* @__PURE__ */
|
|
4685
|
+
highlightPickerCell !== null && /* @__PURE__ */ jsx13(
|
|
4430
4686
|
ColorPickerPopover,
|
|
4431
4687
|
{
|
|
4432
4688
|
title: "Highlight Cell",
|
|
@@ -4439,7 +4695,7 @@ function Spreadsheet({
|
|
|
4439
4695
|
onClose: () => setHighlightPickerCell(null)
|
|
4440
4696
|
}
|
|
4441
4697
|
),
|
|
4442
|
-
/* @__PURE__ */
|
|
4698
|
+
/* @__PURE__ */ jsx13(
|
|
4443
4699
|
KeyboardShortcutsModal,
|
|
4444
4700
|
{
|
|
4445
4701
|
isOpen: showKeyboardShortcuts,
|
|
@@ -4447,7 +4703,7 @@ function Spreadsheet({
|
|
|
4447
4703
|
shortcuts
|
|
4448
4704
|
}
|
|
4449
4705
|
),
|
|
4450
|
-
/* @__PURE__ */
|
|
4706
|
+
/* @__PURE__ */ jsx13(
|
|
4451
4707
|
SpreadsheetSettingsModal,
|
|
4452
4708
|
{
|
|
4453
4709
|
isOpen: showSettingsModal,
|
|
@@ -4474,6 +4730,7 @@ function Spreadsheet({
|
|
|
4474
4730
|
}
|
|
4475
4731
|
Spreadsheet.displayName = "Spreadsheet";
|
|
4476
4732
|
export {
|
|
4733
|
+
ActiveFiltersDisplay,
|
|
4477
4734
|
RowContextMenu,
|
|
4478
4735
|
Spreadsheet,
|
|
4479
4736
|
MemoizedSpreadsheetCell as SpreadsheetCell,
|