@xcelsior/ui-spreadsheets 1.1.14 → 1.1.15
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 +639 -399
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +632 -393
- 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 +14 -3
- package/src/components/SpreadsheetCell.tsx +8 -2
- package/src/components/SpreadsheetHeader.tsx +8 -2
- package/src/components/SpreadsheetToolbar.tsx +62 -19
- 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,253 @@ 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
|
+
" active"
|
|
1326
|
+
] }),
|
|
1327
|
+
showFiltersPanel ? /* @__PURE__ */ jsx4(HiChevronUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx4(HiChevronDown, { className: "h-3 w-3" })
|
|
1328
|
+
]
|
|
1030
1329
|
}
|
|
1031
1330
|
),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
"
|
|
1331
|
+
summary && /* @__PURE__ */ jsxs4(
|
|
1332
|
+
"div",
|
|
1034
1333
|
{
|
|
1035
|
-
type: "button",
|
|
1036
|
-
onClick: onRedo,
|
|
1037
|
-
disabled: !canRedo,
|
|
1038
1334
|
className: cn(
|
|
1039
|
-
|
|
1040
|
-
|
|
1335
|
+
"flex items-center gap-2 px-2.5 py-1.5 rounded border text-xs",
|
|
1336
|
+
getSummaryVariantClasses(summary.variant)
|
|
1041
1337
|
),
|
|
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
1338
|
children: [
|
|
1067
|
-
|
|
1068
|
-
|
|
1339
|
+
/* @__PURE__ */ jsxs4("span", { className: "font-semibold whitespace-nowrap", children: [
|
|
1340
|
+
summary.label,
|
|
1341
|
+
":"
|
|
1342
|
+
] }),
|
|
1343
|
+
/* @__PURE__ */ jsx4("span", { className: "font-bold whitespace-nowrap", children: summary.value })
|
|
1069
1344
|
]
|
|
1070
1345
|
}
|
|
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
1346
|
)
|
|
1102
1347
|
] }),
|
|
1103
|
-
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
|
|
1106
|
-
/* @__PURE__ */ jsx3(
|
|
1107
|
-
"button",
|
|
1348
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1349
|
+
saveStatusDisplay && /* @__PURE__ */ jsx4(
|
|
1350
|
+
"span",
|
|
1108
1351
|
{
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
children:
|
|
1352
|
+
className: cn(
|
|
1353
|
+
"text-xs flex items-center gap-1",
|
|
1354
|
+
saveStatusDisplay.className
|
|
1355
|
+
),
|
|
1356
|
+
children: saveStatusDisplay.text
|
|
1114
1357
|
}
|
|
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(
|
|
1358
|
+
),
|
|
1359
|
+
!autoSave && onSave && /* @__PURE__ */ jsxs4(
|
|
1163
1360
|
"button",
|
|
1164
1361
|
{
|
|
1165
1362
|
type: "button",
|
|
1166
|
-
onClick:
|
|
1167
|
-
|
|
1168
|
-
|
|
1363
|
+
onClick: onSave,
|
|
1364
|
+
disabled: !hasUnsavedChanges,
|
|
1365
|
+
className: cn(
|
|
1366
|
+
"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",
|
|
1367
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-blue-600"
|
|
1368
|
+
),
|
|
1169
1369
|
children: [
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
|
|
1370
|
+
/* @__PURE__ */ jsx4(HiCheck, { className: "h-3.5 w-3.5" }),
|
|
1371
|
+
"Save"
|
|
1172
1372
|
]
|
|
1173
1373
|
}
|
|
1174
1374
|
),
|
|
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(
|
|
1375
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative", ref: menuRef, children: [
|
|
1376
|
+
/* @__PURE__ */ jsxs4(
|
|
1192
1377
|
"button",
|
|
1193
1378
|
{
|
|
1194
1379
|
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",
|
|
1380
|
+
onClick: () => setShowMoreMenu(!showMoreMenu),
|
|
1381
|
+
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",
|
|
1382
|
+
title: "More actions",
|
|
1200
1383
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ jsx4(HiDotsVertical, { className: "h-3.5 w-3.5" }),
|
|
1385
|
+
/* @__PURE__ */ jsx4("span", { className: "hidden lg:inline", children: "More" })
|
|
1203
1386
|
]
|
|
1204
1387
|
}
|
|
1205
1388
|
),
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1389
|
+
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-20", children: [
|
|
1390
|
+
onSettings && /* @__PURE__ */ jsxs4(
|
|
1391
|
+
"button",
|
|
1392
|
+
{
|
|
1393
|
+
type: "button",
|
|
1394
|
+
onClick: () => {
|
|
1395
|
+
onSettings();
|
|
1396
|
+
setShowMoreMenu(false);
|
|
1397
|
+
},
|
|
1398
|
+
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1399
|
+
children: [
|
|
1400
|
+
/* @__PURE__ */ jsx4(HiCog, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1401
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: "Settings" })
|
|
1402
|
+
]
|
|
1403
|
+
}
|
|
1404
|
+
),
|
|
1405
|
+
onShowShortcuts && /* @__PURE__ */ jsxs4(
|
|
1406
|
+
"button",
|
|
1407
|
+
{
|
|
1408
|
+
type: "button",
|
|
1409
|
+
onClick: () => {
|
|
1410
|
+
onShowShortcuts();
|
|
1411
|
+
setShowMoreMenu(false);
|
|
1412
|
+
},
|
|
1413
|
+
className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1414
|
+
children: [
|
|
1415
|
+
/* @__PURE__ */ jsx4(HiOutlineQuestionMarkCircle, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1416
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: "Keyboard Shortcuts" })
|
|
1417
|
+
]
|
|
1418
|
+
}
|
|
1419
|
+
),
|
|
1420
|
+
menuItems && menuItems.length > 0 && (onSettings || onShowShortcuts) && /* @__PURE__ */ jsx4("div", { className: "border-t border-gray-100 my-1" }),
|
|
1421
|
+
menuItems?.map((item) => /* @__PURE__ */ jsxs4(
|
|
1422
|
+
"button",
|
|
1423
|
+
{
|
|
1424
|
+
type: "button",
|
|
1425
|
+
disabled: item.disabled,
|
|
1426
|
+
onClick: () => {
|
|
1427
|
+
item.onClick();
|
|
1428
|
+
setShowMoreMenu(false);
|
|
1429
|
+
},
|
|
1430
|
+
className: cn(
|
|
1431
|
+
"w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
|
|
1432
|
+
item.disabled && "opacity-50 cursor-not-allowed"
|
|
1433
|
+
),
|
|
1434
|
+
children: [
|
|
1435
|
+
item.icon && /* @__PURE__ */ jsx4("span", { className: "h-3.5 w-3.5 text-gray-500 flex items-center justify-center", children: item.icon }),
|
|
1436
|
+
/* @__PURE__ */ jsx4("span", { className: "text-gray-700", children: item.label })
|
|
1437
|
+
]
|
|
1215
1438
|
},
|
|
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
|
-
))
|
|
1439
|
+
item.id
|
|
1440
|
+
))
|
|
1441
|
+
] })
|
|
1227
1442
|
] })
|
|
1228
1443
|
] })
|
|
1229
|
-
]
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1444
|
+
]
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
showFiltersPanel && filters && columns && onClearFilter && onClearFilters && /* @__PURE__ */ jsx4(
|
|
1448
|
+
ActiveFiltersDisplay,
|
|
1449
|
+
{
|
|
1450
|
+
filters,
|
|
1451
|
+
columns,
|
|
1452
|
+
onClearFilter,
|
|
1453
|
+
onClearAllFilters: onClearFilters
|
|
1454
|
+
}
|
|
1455
|
+
)
|
|
1456
|
+
] });
|
|
1233
1457
|
};
|
|
1234
1458
|
SpreadsheetToolbar.displayName = "SpreadsheetToolbar";
|
|
1235
1459
|
|
|
@@ -1242,7 +1466,7 @@ function MdOutlinePushPin(props) {
|
|
|
1242
1466
|
}
|
|
1243
1467
|
|
|
1244
1468
|
// src/components/ColumnHeaderActions.tsx
|
|
1245
|
-
import { jsx as
|
|
1469
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1246
1470
|
function ColumnHeaderActions({
|
|
1247
1471
|
enableFiltering = false,
|
|
1248
1472
|
enableHighlighting = false,
|
|
@@ -1259,8 +1483,8 @@ function ColumnHeaderActions({
|
|
|
1259
1483
|
unpinnedTitle = "Pin column",
|
|
1260
1484
|
className
|
|
1261
1485
|
}) {
|
|
1262
|
-
return /* @__PURE__ */
|
|
1263
|
-
enableFiltering && onFilterClick && /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("flex items-center gap-0.5", className), children: [
|
|
1487
|
+
enableFiltering && onFilterClick && /* @__PURE__ */ jsx5(
|
|
1264
1488
|
"button",
|
|
1265
1489
|
{
|
|
1266
1490
|
type: "button",
|
|
@@ -1273,10 +1497,10 @@ function ColumnHeaderActions({
|
|
|
1273
1497
|
hasActiveFilter ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1274
1498
|
),
|
|
1275
1499
|
title: filterTitle,
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1500
|
+
children: /* @__PURE__ */ jsx5(HiFilter, { className: "h-3 w-3" })
|
|
1277
1501
|
}
|
|
1278
1502
|
),
|
|
1279
|
-
enableHighlighting && onHighlightClick && /* @__PURE__ */
|
|
1503
|
+
enableHighlighting && onHighlightClick && /* @__PURE__ */ jsx5(
|
|
1280
1504
|
"button",
|
|
1281
1505
|
{
|
|
1282
1506
|
type: "button",
|
|
@@ -1289,10 +1513,10 @@ function ColumnHeaderActions({
|
|
|
1289
1513
|
hasActiveHighlight ? "text-amber-500 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1290
1514
|
),
|
|
1291
1515
|
title: highlightTitle,
|
|
1292
|
-
children: /* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ jsx5(AiFillHighlight, { className: "h-3 w-3" })
|
|
1293
1517
|
}
|
|
1294
1518
|
),
|
|
1295
|
-
enablePinning && onPinClick && /* @__PURE__ */
|
|
1519
|
+
enablePinning && onPinClick && /* @__PURE__ */ jsx5(
|
|
1296
1520
|
"button",
|
|
1297
1521
|
{
|
|
1298
1522
|
type: "button",
|
|
@@ -1305,7 +1529,7 @@ function ColumnHeaderActions({
|
|
|
1305
1529
|
isPinned ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
|
|
1306
1530
|
),
|
|
1307
1531
|
title: isPinned ? pinnedTitle : unpinnedTitle,
|
|
1308
|
-
children: isPinned ? /* @__PURE__ */
|
|
1532
|
+
children: isPinned ? /* @__PURE__ */ jsx5(MdPushPin, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx5(MdOutlinePushPin, { className: "h-3 w-3" })
|
|
1309
1533
|
}
|
|
1310
1534
|
)
|
|
1311
1535
|
] });
|
|
@@ -1313,7 +1537,7 @@ function ColumnHeaderActions({
|
|
|
1313
1537
|
ColumnHeaderActions.displayName = "ColumnHeaderActions";
|
|
1314
1538
|
|
|
1315
1539
|
// src/components/SpreadsheetHeader.tsx
|
|
1316
|
-
import { jsx as
|
|
1540
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1317
1541
|
var cellPaddingCompact2 = "px-1 py-0.5";
|
|
1318
1542
|
var cellPaddingNormal2 = "px-2 py-1.5";
|
|
1319
1543
|
var SpreadsheetHeader = ({
|
|
@@ -1345,7 +1569,7 @@ var SpreadsheetHeader = ({
|
|
|
1345
1569
|
positionStyles.right = `${rightOffset}px`;
|
|
1346
1570
|
}
|
|
1347
1571
|
}
|
|
1348
|
-
return /* @__PURE__ */
|
|
1572
|
+
return /* @__PURE__ */ jsxs6(
|
|
1349
1573
|
"th",
|
|
1350
1574
|
{
|
|
1351
1575
|
onClick: column.sortable ? onClick : void 0,
|
|
@@ -1366,20 +1590,26 @@ var SpreadsheetHeader = ({
|
|
|
1366
1590
|
// Pinned columns must have a fixed width so sticky offsets stay correct.
|
|
1367
1591
|
// Enforce MIN_PINNED_COLUMN_WIDTH so header actions (pin/filter/highlight) always fit.
|
|
1368
1592
|
...isPinned && {
|
|
1369
|
-
width: Math.max(
|
|
1370
|
-
|
|
1593
|
+
width: Math.max(
|
|
1594
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
1595
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
1596
|
+
),
|
|
1597
|
+
maxWidth: Math.max(
|
|
1598
|
+
column.minWidth || column.width || MIN_PINNED_COLUMN_WIDTH,
|
|
1599
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
1600
|
+
)
|
|
1371
1601
|
},
|
|
1372
1602
|
top: 0,
|
|
1373
1603
|
// For sticky header
|
|
1374
1604
|
...positionStyles
|
|
1375
1605
|
},
|
|
1376
1606
|
children: [
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1607
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-1", children: [
|
|
1608
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex-1 flex items-center gap-1", children: [
|
|
1379
1609
|
column.label,
|
|
1380
|
-
isSorted && /* @__PURE__ */
|
|
1610
|
+
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
1611
|
] }),
|
|
1382
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsx6(
|
|
1383
1613
|
ColumnHeaderActions,
|
|
1384
1614
|
{
|
|
1385
1615
|
enableFiltering: column.filterable,
|
|
@@ -1402,7 +1632,7 @@ var SpreadsheetHeader = ({
|
|
|
1402
1632
|
SpreadsheetHeader.displayName = "SpreadsheetHeader";
|
|
1403
1633
|
|
|
1404
1634
|
// src/components/RowIndexColumnHeader.tsx
|
|
1405
|
-
import { jsx as
|
|
1635
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1406
1636
|
var cellPaddingCompact3 = "px-1 py-0.5";
|
|
1407
1637
|
var cellPaddingNormal3 = "px-2 py-1.5";
|
|
1408
1638
|
function RowIndexColumnHeader({
|
|
@@ -1416,7 +1646,7 @@ function RowIndexColumnHeader({
|
|
|
1416
1646
|
className
|
|
1417
1647
|
}) {
|
|
1418
1648
|
const cellPadding = compactMode ? cellPaddingCompact3 : cellPaddingNormal3;
|
|
1419
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ jsx7(
|
|
1420
1650
|
"th",
|
|
1421
1651
|
{
|
|
1422
1652
|
className: cn(
|
|
@@ -1435,9 +1665,9 @@ function RowIndexColumnHeader({
|
|
|
1435
1665
|
left: isPinned ? 0 : void 0,
|
|
1436
1666
|
backgroundColor: highlightColor || "rgb(243 244 246)"
|
|
1437
1667
|
},
|
|
1438
|
-
children: /* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1668
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center gap-1", children: [
|
|
1669
|
+
/* @__PURE__ */ jsx7("span", { children: "#" }),
|
|
1670
|
+
/* @__PURE__ */ jsx7(
|
|
1441
1671
|
ColumnHeaderActions,
|
|
1442
1672
|
{
|
|
1443
1673
|
enableHighlighting,
|
|
@@ -1640,7 +1870,7 @@ function useSpreadsheetHighlighting({
|
|
|
1640
1870
|
}
|
|
1641
1871
|
|
|
1642
1872
|
// src/components/ColorPickerPopover.tsx
|
|
1643
|
-
import { jsx as
|
|
1873
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1644
1874
|
function ColorPickerPopover({
|
|
1645
1875
|
title,
|
|
1646
1876
|
paletteType = "column",
|
|
@@ -1650,9 +1880,9 @@ function ColorPickerPopover({
|
|
|
1650
1880
|
className
|
|
1651
1881
|
}) {
|
|
1652
1882
|
const colorPalette = colors ?? [...HIGHLIGHT_COLORS[paletteType], null];
|
|
1653
|
-
return /* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1883
|
+
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: [
|
|
1884
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-sm font-semibold mb-3", children: title }),
|
|
1885
|
+
/* @__PURE__ */ jsx8("div", { className: "grid grid-cols-5 gap-2", children: colorPalette.map((color) => /* @__PURE__ */ jsx8(
|
|
1656
1886
|
"button",
|
|
1657
1887
|
{
|
|
1658
1888
|
type: "button",
|
|
@@ -1667,7 +1897,7 @@ function ColorPickerPopover({
|
|
|
1667
1897
|
},
|
|
1668
1898
|
color || "clear"
|
|
1669
1899
|
)) }),
|
|
1670
|
-
/* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ jsx8("div", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx8(
|
|
1671
1901
|
"button",
|
|
1672
1902
|
{
|
|
1673
1903
|
type: "button",
|
|
@@ -1682,7 +1912,7 @@ ColorPickerPopover.displayName = "ColorPickerPopover";
|
|
|
1682
1912
|
|
|
1683
1913
|
// src/components/SpreadsheetSettingsModal.tsx
|
|
1684
1914
|
import { useState as useState5, useEffect as useEffect3 } from "react";
|
|
1685
|
-
import { jsx as
|
|
1915
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1686
1916
|
var DEFAULT_SETTINGS = {
|
|
1687
1917
|
defaultPinnedColumns: [],
|
|
1688
1918
|
defaultSort: null,
|
|
@@ -1757,7 +1987,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1757
1987
|
{ id: "sorting", label: "Default Sorting", Icon: HiSortAscending },
|
|
1758
1988
|
{ id: "display", label: "Display Options", Icon: HiEye }
|
|
1759
1989
|
];
|
|
1760
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ jsxs9(
|
|
1761
1991
|
"div",
|
|
1762
1992
|
{
|
|
1763
1993
|
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
@@ -1765,7 +1995,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1765
1995
|
"aria-modal": "true",
|
|
1766
1996
|
"aria-labelledby": "settings-modal-title",
|
|
1767
1997
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1998
|
+
/* @__PURE__ */ jsx9(
|
|
1769
1999
|
"button",
|
|
1770
2000
|
{
|
|
1771
2001
|
type: "button",
|
|
@@ -1775,55 +2005,55 @@ var SpreadsheetSettingsModal = ({
|
|
|
1775
2005
|
"aria-label": "Close settings"
|
|
1776
2006
|
}
|
|
1777
2007
|
),
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__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: [
|
|
2009
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-6 py-5 border-b border-gray-200 flex items-center justify-between", children: [
|
|
2010
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
2011
|
+
/* @__PURE__ */ jsx9(HiCog, { className: "h-6 w-6 text-blue-600" }),
|
|
2012
|
+
/* @__PURE__ */ jsx9("h2", { id: "settings-modal-title", className: "text-xl font-bold text-gray-900", children: title })
|
|
1783
2013
|
] }),
|
|
1784
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ jsx9(
|
|
1785
2015
|
"button",
|
|
1786
2016
|
{
|
|
1787
2017
|
type: "button",
|
|
1788
2018
|
onClick: onClose,
|
|
1789
2019
|
className: "p-2 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700",
|
|
1790
|
-
children: /* @__PURE__ */
|
|
2020
|
+
children: /* @__PURE__ */ jsx9(HiX, { className: "h-5 w-5" })
|
|
1791
2021
|
}
|
|
1792
2022
|
)
|
|
1793
2023
|
] }),
|
|
1794
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ jsx9("div", { className: "flex border-b border-gray-200 px-6", children: tabs.map((tab) => /* @__PURE__ */ jsxs9(
|
|
1795
2025
|
"button",
|
|
1796
2026
|
{
|
|
1797
2027
|
type: "button",
|
|
1798
2028
|
onClick: () => setActiveTab(tab.id),
|
|
1799
2029
|
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
2030
|
children: [
|
|
1801
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ jsx9(tab.Icon, { className: "h-4 w-4" }),
|
|
1802
2032
|
tab.label
|
|
1803
2033
|
]
|
|
1804
2034
|
},
|
|
1805
2035
|
tab.id
|
|
1806
2036
|
)) }),
|
|
1807
|
-
/* @__PURE__ */
|
|
1808
|
-
activeTab === "columns" && /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1 overflow-auto p-6", children: [
|
|
2038
|
+
activeTab === "columns" && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2039
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-blue-50 border border-blue-200 rounded-lg mb-4 flex gap-3", children: [
|
|
2040
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 text-blue-600 shrink-0 mt-0.5" }),
|
|
2041
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2042
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm font-semibold text-gray-900 mb-1", children: "About Pinned Columns" }),
|
|
2043
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600", children: "Pinned columns stay visible while you scroll horizontally through the table." })
|
|
1814
2044
|
] })
|
|
1815
2045
|
] }),
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600 mb-4", children: "Select which columns should be pinned to the left by default." }),
|
|
2047
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2", children: [
|
|
2048
|
+
/* @__PURE__ */ jsxs9(
|
|
1819
2049
|
"button",
|
|
1820
2050
|
{
|
|
1821
2051
|
type: "button",
|
|
1822
2052
|
onClick: () => togglePinnedColumn("__row_index__"),
|
|
1823
2053
|
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
2054
|
children: [
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 shrink-0" }),
|
|
2056
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm flex-1 truncate", children: "# (Row Index)" })
|
|
1827
2057
|
]
|
|
1828
2058
|
}
|
|
1829
2059
|
),
|
|
@@ -1831,15 +2061,15 @@ var SpreadsheetSettingsModal = ({
|
|
|
1831
2061
|
const isPinned = localSettings.defaultPinnedColumns.includes(
|
|
1832
2062
|
column.id
|
|
1833
2063
|
);
|
|
1834
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ jsxs9(
|
|
1835
2065
|
"button",
|
|
1836
2066
|
{
|
|
1837
2067
|
type: "button",
|
|
1838
2068
|
onClick: () => togglePinnedColumn(column.id),
|
|
1839
2069
|
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
2070
|
children: [
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ jsx9(HiViewBoards, { className: "h-4 w-4 shrink-0" }),
|
|
2072
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm flex-1 truncate", children: column.label })
|
|
1843
2073
|
]
|
|
1844
2074
|
},
|
|
1845
2075
|
column.id
|
|
@@ -1847,12 +2077,12 @@ var SpreadsheetSettingsModal = ({
|
|
|
1847
2077
|
})
|
|
1848
2078
|
] })
|
|
1849
2079
|
] }),
|
|
1850
|
-
activeTab === "sorting" && /* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
2080
|
+
activeTab === "sorting" && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2081
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600 mb-4", children: "Set the default column sorting when opening the spreadsheet." }),
|
|
2082
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
2083
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2084
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Sort Column" }),
|
|
2085
|
+
/* @__PURE__ */ jsxs9(
|
|
1856
2086
|
"select",
|
|
1857
2087
|
{
|
|
1858
2088
|
value: localSettings.defaultSort?.columnId || "",
|
|
@@ -1862,15 +2092,15 @@ var SpreadsheetSettingsModal = ({
|
|
|
1862
2092
|
),
|
|
1863
2093
|
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
2094
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
columns.filter((col) => col.sortable !== false).map((column) => /* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ jsx9("option", { value: "", children: "No default sorting" }),
|
|
2096
|
+
columns.filter((col) => col.sortable !== false).map((column) => /* @__PURE__ */ jsx9("option", { value: column.id, children: column.label }, column.id))
|
|
1867
2097
|
]
|
|
1868
2098
|
}
|
|
1869
2099
|
)
|
|
1870
2100
|
] }),
|
|
1871
|
-
localSettings.defaultSort && /* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
2101
|
+
localSettings.defaultSort && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2102
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Sort Direction" }),
|
|
2103
|
+
/* @__PURE__ */ jsxs9(
|
|
1874
2104
|
"select",
|
|
1875
2105
|
{
|
|
1876
2106
|
value: localSettings.defaultSort.direction,
|
|
@@ -1880,19 +2110,19 @@ var SpreadsheetSettingsModal = ({
|
|
|
1880
2110
|
),
|
|
1881
2111
|
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
2112
|
children: [
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ jsx9("option", { value: "asc", children: "Ascending (A \u2192 Z, 0 \u2192 9)" }),
|
|
2114
|
+
/* @__PURE__ */ jsx9("option", { value: "desc", children: "Descending (Z \u2192 A, 9 \u2192 0)" })
|
|
1885
2115
|
]
|
|
1886
2116
|
}
|
|
1887
2117
|
)
|
|
1888
2118
|
] })
|
|
1889
2119
|
] })
|
|
1890
2120
|
] }),
|
|
1891
|
-
activeTab === "display" && /* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
2121
|
+
activeTab === "display" && /* @__PURE__ */ jsxs9("div", { className: "space-y-5", children: [
|
|
2122
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600", children: "Customize the display and behavior of the spreadsheet." }),
|
|
2123
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2124
|
+
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: "Default Page Size" }),
|
|
2125
|
+
/* @__PURE__ */ jsx9(
|
|
1896
2126
|
"select",
|
|
1897
2127
|
{
|
|
1898
2128
|
value: localSettings.defaultPageSize,
|
|
@@ -1901,20 +2131,20 @@ var SpreadsheetSettingsModal = ({
|
|
|
1901
2131
|
defaultPageSize: parseInt(e.target.value, 10)
|
|
1902
2132
|
}),
|
|
1903
2133
|
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__ */
|
|
2134
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxs9("option", { value: size, children: [
|
|
1905
2135
|
size,
|
|
1906
2136
|
" rows"
|
|
1907
2137
|
] }, size))
|
|
1908
2138
|
}
|
|
1909
2139
|
)
|
|
1910
2140
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2142
|
+
/* @__PURE__ */ jsxs9("label", { className: "block text-sm font-medium text-gray-900 mb-2", children: [
|
|
1913
2143
|
"Default Zoom Level: ",
|
|
1914
2144
|
localSettings.defaultZoom,
|
|
1915
2145
|
"%"
|
|
1916
2146
|
] }),
|
|
1917
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ jsx9(
|
|
1918
2148
|
"input",
|
|
1919
2149
|
{
|
|
1920
2150
|
type: "range",
|
|
@@ -1929,14 +2159,14 @@ var SpreadsheetSettingsModal = ({
|
|
|
1929
2159
|
className: "w-full cursor-pointer"
|
|
1930
2160
|
}
|
|
1931
2161
|
),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
2162
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex justify-between mt-1 text-xs text-gray-500", children: [
|
|
2163
|
+
/* @__PURE__ */ jsx9("span", { children: "50%" }),
|
|
2164
|
+
/* @__PURE__ */ jsx9("span", { children: "150%" })
|
|
1935
2165
|
] })
|
|
1936
2166
|
] }),
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-3", children: [
|
|
2168
|
+
/* @__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: [
|
|
2169
|
+
/* @__PURE__ */ jsx9(
|
|
1940
2170
|
"input",
|
|
1941
2171
|
{
|
|
1942
2172
|
type: "checkbox",
|
|
@@ -1945,13 +2175,13 @@ var SpreadsheetSettingsModal = ({
|
|
|
1945
2175
|
className: "w-5 h-5 cursor-pointer rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
1946
2176
|
}
|
|
1947
2177
|
),
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
2179
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm font-medium text-gray-900", children: "Auto-save changes" }),
|
|
2180
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm text-gray-500 mt-0.5", children: "Automatically save changes without confirmation" })
|
|
1951
2181
|
] })
|
|
1952
2182
|
] }),
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__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: [
|
|
2184
|
+
/* @__PURE__ */ jsx9(
|
|
1955
2185
|
"input",
|
|
1956
2186
|
{
|
|
1957
2187
|
type: "checkbox",
|
|
@@ -1963,16 +2193,16 @@ var SpreadsheetSettingsModal = ({
|
|
|
1963
2193
|
className: "w-5 h-5 cursor-pointer rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
1964
2194
|
}
|
|
1965
2195
|
),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
2197
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm font-medium text-gray-900", children: "Compact view" }),
|
|
2198
|
+
/* @__PURE__ */ jsx9("div", { className: "text-sm text-gray-500 mt-0.5", children: "Reduce padding and spacing to show more rows on screen" })
|
|
1969
2199
|
] })
|
|
1970
2200
|
] })
|
|
1971
2201
|
] })
|
|
1972
2202
|
] })
|
|
1973
2203
|
] }),
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-6 py-4 border-t border-gray-200 flex justify-between items-center gap-3", children: [
|
|
2205
|
+
/* @__PURE__ */ jsx9(
|
|
1976
2206
|
"button",
|
|
1977
2207
|
{
|
|
1978
2208
|
type: "button",
|
|
@@ -1981,8 +2211,8 @@ var SpreadsheetSettingsModal = ({
|
|
|
1981
2211
|
children: "Reset to Defaults"
|
|
1982
2212
|
}
|
|
1983
2213
|
),
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
|
|
2215
|
+
/* @__PURE__ */ jsx9(
|
|
1986
2216
|
"button",
|
|
1987
2217
|
{
|
|
1988
2218
|
type: "button",
|
|
@@ -1991,7 +2221,7 @@ var SpreadsheetSettingsModal = ({
|
|
|
1991
2221
|
children: "Cancel"
|
|
1992
2222
|
}
|
|
1993
2223
|
),
|
|
1994
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ jsx9(
|
|
1995
2225
|
"button",
|
|
1996
2226
|
{
|
|
1997
2227
|
type: "button",
|
|
@@ -2011,7 +2241,7 @@ SpreadsheetSettingsModal.displayName = "SpreadsheetSettingsModal";
|
|
|
2011
2241
|
|
|
2012
2242
|
// src/components/CommentModals.tsx
|
|
2013
2243
|
import { useState as useState6, useEffect as useEffect4 } from "react";
|
|
2014
|
-
import { jsx as
|
|
2244
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2015
2245
|
function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
2016
2246
|
const [commentText, setCommentText] = useState6("");
|
|
2017
2247
|
useEffect4(() => {
|
|
@@ -2030,12 +2260,12 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2030
2260
|
setCommentText("");
|
|
2031
2261
|
onClose();
|
|
2032
2262
|
};
|
|
2033
|
-
return /* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2263
|
+
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: [
|
|
2264
|
+
/* @__PURE__ */ jsxs10("h3", { className: "text-lg font-semibold mb-4", children: [
|
|
2035
2265
|
"Add Comment",
|
|
2036
2266
|
columnLabel ? ` - ${columnLabel}` : ""
|
|
2037
2267
|
] }),
|
|
2038
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx10(
|
|
2039
2269
|
"textarea",
|
|
2040
2270
|
{
|
|
2041
2271
|
value: commentText,
|
|
@@ -2049,8 +2279,8 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2049
2279
|
autoFocus: true
|
|
2050
2280
|
}
|
|
2051
2281
|
),
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2 mt-4", children: [
|
|
2283
|
+
/* @__PURE__ */ jsx10(
|
|
2054
2284
|
"button",
|
|
2055
2285
|
{
|
|
2056
2286
|
type: "button",
|
|
@@ -2059,7 +2289,7 @@ function AddCommentModal({ isOpen, columnLabel, onAdd, onClose }) {
|
|
|
2059
2289
|
children: "Cancel"
|
|
2060
2290
|
}
|
|
2061
2291
|
),
|
|
2062
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx10(
|
|
2063
2293
|
"button",
|
|
2064
2294
|
{
|
|
2065
2295
|
type: "button",
|
|
@@ -2082,13 +2312,13 @@ function ViewCommentsModal({
|
|
|
2082
2312
|
onClose
|
|
2083
2313
|
}) {
|
|
2084
2314
|
if (!isOpen) return null;
|
|
2085
|
-
return /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2315
|
+
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: [
|
|
2316
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2317
|
+
/* @__PURE__ */ jsxs10("h3", { className: "text-lg font-semibold", children: [
|
|
2088
2318
|
"Comments",
|
|
2089
2319
|
columnLabel ? ` - ${columnLabel}` : ""
|
|
2090
2320
|
] }),
|
|
2091
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ jsx10(
|
|
2092
2322
|
"button",
|
|
2093
2323
|
{
|
|
2094
2324
|
type: "button",
|
|
@@ -2098,8 +2328,8 @@ function ViewCommentsModal({
|
|
|
2098
2328
|
}
|
|
2099
2329
|
)
|
|
2100
2330
|
] }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
comments.map((comment) => /* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-1 overflow-y-auto space-y-3", children: [
|
|
2332
|
+
comments.map((comment) => /* @__PURE__ */ jsxs10(
|
|
2103
2333
|
"div",
|
|
2104
2334
|
{
|
|
2105
2335
|
className: cn(
|
|
@@ -2107,9 +2337,9 @@ function ViewCommentsModal({
|
|
|
2107
2337
|
comment.resolved ? "bg-gray-50 border-gray-200" : "bg-yellow-50 border-yellow-200"
|
|
2108
2338
|
),
|
|
2109
2339
|
children: [
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2341
|
+
/* @__PURE__ */ jsx10("p", { className: "text-sm text-gray-700", children: comment.text }),
|
|
2342
|
+
/* @__PURE__ */ jsx10(
|
|
2113
2343
|
"button",
|
|
2114
2344
|
{
|
|
2115
2345
|
type: "button",
|
|
@@ -2122,23 +2352,23 @@ function ViewCommentsModal({
|
|
|
2122
2352
|
}
|
|
2123
2353
|
)
|
|
2124
2354
|
] }),
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
comment.author && /* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2355
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 mt-2 text-xs text-gray-500", children: [
|
|
2356
|
+
comment.author && /* @__PURE__ */ jsx10("span", { children: comment.author }),
|
|
2357
|
+
/* @__PURE__ */ jsx10("span", { children: new Date(comment.timestamp).toLocaleString() })
|
|
2128
2358
|
] })
|
|
2129
2359
|
]
|
|
2130
2360
|
},
|
|
2131
2361
|
comment.id
|
|
2132
2362
|
)),
|
|
2133
|
-
comments.length === 0 && /* @__PURE__ */
|
|
2363
|
+
comments.length === 0 && /* @__PURE__ */ jsx10("p", { className: "text-center text-gray-500 py-8", children: "No comments for this cell." })
|
|
2134
2364
|
] }),
|
|
2135
|
-
onAddComment && /* @__PURE__ */
|
|
2365
|
+
onAddComment && /* @__PURE__ */ jsx10("div", { className: "mt-4 pt-4 border-t border-gray-200", children: /* @__PURE__ */ jsx10(
|
|
2136
2366
|
"button",
|
|
2137
2367
|
{
|
|
2138
2368
|
type: "button",
|
|
2139
2369
|
onClick: onAddComment,
|
|
2140
2370
|
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__ */
|
|
2371
|
+
children: /* @__PURE__ */ jsx10("span", { children: "+ Add Comment" })
|
|
2142
2372
|
}
|
|
2143
2373
|
) })
|
|
2144
2374
|
] }) });
|
|
@@ -2153,11 +2383,11 @@ function DeleteConfirmationModal({
|
|
|
2153
2383
|
onClose
|
|
2154
2384
|
}) {
|
|
2155
2385
|
if (!isOpen) return null;
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2386
|
+
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: [
|
|
2387
|
+
/* @__PURE__ */ jsx10("h3", { className: "text-lg font-semibold mb-2", children: title }),
|
|
2388
|
+
/* @__PURE__ */ jsx10("p", { className: "text-gray-600 mb-6", children: message }),
|
|
2389
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2", children: [
|
|
2390
|
+
/* @__PURE__ */ jsx10(
|
|
2161
2391
|
"button",
|
|
2162
2392
|
{
|
|
2163
2393
|
type: "button",
|
|
@@ -2166,7 +2396,7 @@ function DeleteConfirmationModal({
|
|
|
2166
2396
|
children: "Cancel"
|
|
2167
2397
|
}
|
|
2168
2398
|
),
|
|
2169
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ jsx10(
|
|
2170
2400
|
"button",
|
|
2171
2401
|
{
|
|
2172
2402
|
type: "button",
|
|
@@ -2185,50 +2415,50 @@ DeleteConfirmationModal.displayName = "DeleteConfirmationModal";
|
|
|
2185
2415
|
|
|
2186
2416
|
// src/components/KeyboardShortcutsModal.tsx
|
|
2187
2417
|
import React4 from "react";
|
|
2188
|
-
import { jsx as
|
|
2418
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2189
2419
|
function KeyboardShortcutsModal({
|
|
2190
2420
|
isOpen,
|
|
2191
2421
|
onClose,
|
|
2192
2422
|
shortcuts
|
|
2193
2423
|
}) {
|
|
2194
2424
|
if (!isOpen) return null;
|
|
2195
|
-
return /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2425
|
+
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: [
|
|
2426
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2427
|
+
/* @__PURE__ */ jsx11("h3", { className: "text-xl font-bold text-gray-900", children: "Keyboard Shortcuts" }),
|
|
2428
|
+
/* @__PURE__ */ jsx11(
|
|
2199
2429
|
"button",
|
|
2200
2430
|
{
|
|
2201
2431
|
type: "button",
|
|
2202
2432
|
onClick: onClose,
|
|
2203
2433
|
className: "p-1 hover:bg-gray-100 rounded",
|
|
2204
|
-
children: /* @__PURE__ */
|
|
2434
|
+
children: /* @__PURE__ */ jsx11("span", { className: "text-gray-500 text-xl", children: "\u2715" })
|
|
2205
2435
|
}
|
|
2206
2436
|
)
|
|
2207
2437
|
] }),
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
|
|
2439
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "General", children: shortcuts.general.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2440
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Row Selection", children: shortcuts.rowSelection.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2441
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Editing", children: shortcuts.editing.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2442
|
+
/* @__PURE__ */ jsx11(ShortcutSection, { title: "Cell Navigation", children: shortcuts.navigation.map((shortcut, index) => /* @__PURE__ */ jsx11(ShortcutRow, { label: shortcut.label, keys: shortcut.keys }, index)) }),
|
|
2443
|
+
/* @__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: [
|
|
2444
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-600 text-sm", children: action.label }),
|
|
2445
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-500 text-xs", children: action.description })
|
|
2216
2446
|
] }, index)) })
|
|
2217
2447
|
] })
|
|
2218
2448
|
] }) });
|
|
2219
2449
|
}
|
|
2220
2450
|
function ShortcutSection({ title, children }) {
|
|
2221
|
-
return /* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
2452
|
+
/* @__PURE__ */ jsx11("h4", { className: "text-gray-900 font-semibold mb-3", children: title }),
|
|
2453
|
+
/* @__PURE__ */ jsx11("div", { className: "space-y-2", children })
|
|
2224
2454
|
] });
|
|
2225
2455
|
}
|
|
2226
2456
|
function ShortcutRow({ label, keys }) {
|
|
2227
|
-
return /* @__PURE__ */
|
|
2228
|
-
/* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */
|
|
2230
|
-
index > 0 && /* @__PURE__ */
|
|
2231
|
-
key.includes("Click") ? /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
|
|
2458
|
+
/* @__PURE__ */ jsx11("span", { className: "text-gray-600 text-sm", children: label }),
|
|
2459
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center gap-1", children: keys.map((key, index) => /* @__PURE__ */ jsxs11(React4.Fragment, { children: [
|
|
2460
|
+
index > 0 && /* @__PURE__ */ jsx11("span", { className: "text-gray-400", children: "+" }),
|
|
2461
|
+
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
2462
|
] }, index)) })
|
|
2233
2463
|
] });
|
|
2234
2464
|
}
|
|
@@ -2237,7 +2467,7 @@ KeyboardShortcutsModal.displayName = "KeyboardShortcutsModal";
|
|
|
2237
2467
|
// src/components/RowContextMenu.tsx
|
|
2238
2468
|
import { useMemo as useMemo2 } from "react";
|
|
2239
2469
|
import { ContextMenu, ContextMenuItem } from "@xcelsior/design-system";
|
|
2240
|
-
import { jsx as
|
|
2470
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2241
2471
|
function RowContextMenu({
|
|
2242
2472
|
row,
|
|
2243
2473
|
rowId,
|
|
@@ -2251,10 +2481,10 @@ function RowContextMenu({
|
|
|
2251
2481
|
if (visibleItems.length === 0) {
|
|
2252
2482
|
return null;
|
|
2253
2483
|
}
|
|
2254
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ jsx12(
|
|
2255
2485
|
ContextMenu,
|
|
2256
2486
|
{
|
|
2257
|
-
trigger: /* @__PURE__ */
|
|
2487
|
+
trigger: /* @__PURE__ */ jsx12(
|
|
2258
2488
|
"button",
|
|
2259
2489
|
{
|
|
2260
2490
|
type: "button",
|
|
@@ -2263,7 +2493,7 @@ function RowContextMenu({
|
|
|
2263
2493
|
className
|
|
2264
2494
|
),
|
|
2265
2495
|
title: "More actions",
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2496
|
+
children: /* @__PURE__ */ jsx12(
|
|
2267
2497
|
HiDotsVertical,
|
|
2268
2498
|
{
|
|
2269
2499
|
className: cn("text-gray-500", compactMode ? "h-2.5 w-2.5" : "h-3 w-3")
|
|
@@ -2275,7 +2505,7 @@ function RowContextMenu({
|
|
|
2275
2505
|
children: visibleItems.map((item) => {
|
|
2276
2506
|
const isDisabled = item.disabled?.(row);
|
|
2277
2507
|
const variantClass = item.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "";
|
|
2278
|
-
return /* @__PURE__ */
|
|
2508
|
+
return /* @__PURE__ */ jsxs12(
|
|
2279
2509
|
ContextMenuItem,
|
|
2280
2510
|
{
|
|
2281
2511
|
onClick: (e) => {
|
|
@@ -2285,7 +2515,7 @@ function RowContextMenu({
|
|
|
2285
2515
|
disabled: isDisabled,
|
|
2286
2516
|
className: `${variantClass} ${item.className || ""}`,
|
|
2287
2517
|
children: [
|
|
2288
|
-
item.icon && /* @__PURE__ */
|
|
2518
|
+
item.icon && /* @__PURE__ */ jsx12("span", { className: "mr-2", children: item.icon }),
|
|
2289
2519
|
item.label
|
|
2290
2520
|
]
|
|
2291
2521
|
},
|
|
@@ -3384,7 +3614,7 @@ function useSpreadsheetSelection({
|
|
|
3384
3614
|
}
|
|
3385
3615
|
|
|
3386
3616
|
// src/components/Spreadsheet.tsx
|
|
3387
|
-
import { jsx as
|
|
3617
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3388
3618
|
function Spreadsheet({
|
|
3389
3619
|
data,
|
|
3390
3620
|
columns,
|
|
@@ -3515,6 +3745,7 @@ function Spreadsheet({
|
|
|
3515
3745
|
onToggleCommentResolved
|
|
3516
3746
|
});
|
|
3517
3747
|
const [showSettingsModal, setShowSettingsModal] = useState12(false);
|
|
3748
|
+
const [showFiltersPanel, setShowFiltersPanel] = useState12(false);
|
|
3518
3749
|
const {
|
|
3519
3750
|
canUndo,
|
|
3520
3751
|
canRedo,
|
|
@@ -3959,8 +4190,8 @@ function Spreadsheet({
|
|
|
3959
4190
|
);
|
|
3960
4191
|
return [...leftPinned, ...groups, ...rightPinned];
|
|
3961
4192
|
}, [columnGroups, collapsedGroups, columns, pinnedColumns]);
|
|
3962
|
-
return /* @__PURE__ */
|
|
3963
|
-
showToolbar && /* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("flex flex-col h-full bg-white", className), children: [
|
|
4194
|
+
showToolbar && /* @__PURE__ */ jsx13(
|
|
3964
4195
|
SpreadsheetToolbar,
|
|
3965
4196
|
{
|
|
3966
4197
|
zoom,
|
|
@@ -3974,6 +4205,11 @@ function Spreadsheet({
|
|
|
3974
4205
|
autoSave: spreadsheetSettings.autoSave,
|
|
3975
4206
|
hasActiveFilters,
|
|
3976
4207
|
onClearFilters: clearAllFilters,
|
|
4208
|
+
filters,
|
|
4209
|
+
columns,
|
|
4210
|
+
onClearFilter: (columnId) => handleFilterChange(columnId, void 0),
|
|
4211
|
+
showFiltersPanel,
|
|
4212
|
+
onToggleFiltersPanel: () => setShowFiltersPanel(!showFiltersPanel),
|
|
3977
4213
|
onZoomIn: () => setZoom((z) => Math.min(z + 10, 200)),
|
|
3978
4214
|
onZoomOut: () => setZoom((z) => Math.max(z - 10, 50)),
|
|
3979
4215
|
onZoomReset: () => setZoom(100),
|
|
@@ -3990,16 +4226,16 @@ function Spreadsheet({
|
|
|
3990
4226
|
menuItems: toolbarMenuItems
|
|
3991
4227
|
}
|
|
3992
4228
|
),
|
|
3993
|
-
/* @__PURE__ */
|
|
4229
|
+
/* @__PURE__ */ jsx13("div", { ref: tableRef, className: "flex-1 overflow-auto border border-gray-200 rounded", children: /* @__PURE__ */ jsx13(
|
|
3994
4230
|
"div",
|
|
3995
4231
|
{
|
|
3996
4232
|
style: {
|
|
3997
4233
|
zoom: zoom / 100
|
|
3998
4234
|
},
|
|
3999
|
-
children: /* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
columnGroups && groupHeaderItems && /* @__PURE__ */
|
|
4002
|
-
/* @__PURE__ */
|
|
4235
|
+
children: /* @__PURE__ */ jsxs13("table", { className: "border-separate border-spacing-0 text-xs select-none", children: [
|
|
4236
|
+
/* @__PURE__ */ jsxs13("thead", { children: [
|
|
4237
|
+
columnGroups && groupHeaderItems && /* @__PURE__ */ jsxs13("tr", { children: [
|
|
4238
|
+
/* @__PURE__ */ jsx13(
|
|
4003
4239
|
RowIndexColumnHeader,
|
|
4004
4240
|
{
|
|
4005
4241
|
enableHighlighting,
|
|
@@ -4015,7 +4251,11 @@ function Spreadsheet({
|
|
|
4015
4251
|
if (item.type === "pinned-column") {
|
|
4016
4252
|
const col = columns.find((c) => c.id === item.columnId);
|
|
4017
4253
|
const isPinnedLeft = item.pinSide === "left";
|
|
4018
|
-
|
|
4254
|
+
const pinnedWidth = Math.max(
|
|
4255
|
+
col?.minWidth || col?.width || MIN_PINNED_COLUMN_WIDTH,
|
|
4256
|
+
MIN_PINNED_COLUMN_WIDTH
|
|
4257
|
+
);
|
|
4258
|
+
return /* @__PURE__ */ jsx13(
|
|
4019
4259
|
"th",
|
|
4020
4260
|
{
|
|
4021
4261
|
className: cn(
|
|
@@ -4027,16 +4267,14 @@ function Spreadsheet({
|
|
|
4027
4267
|
position: "sticky",
|
|
4028
4268
|
left: isPinnedLeft ? `${getColumnLeftOffset(item.columnId)}px` : void 0,
|
|
4029
4269
|
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)
|
|
4270
|
+
minWidth: pinnedWidth
|
|
4033
4271
|
}
|
|
4034
4272
|
},
|
|
4035
4273
|
`pinned-group-${item.columnId}`
|
|
4036
4274
|
);
|
|
4037
4275
|
}
|
|
4038
4276
|
const { group, colSpan, isCollapsed } = item;
|
|
4039
|
-
return /* @__PURE__ */
|
|
4277
|
+
return /* @__PURE__ */ jsx13(
|
|
4040
4278
|
"th",
|
|
4041
4279
|
{
|
|
4042
4280
|
colSpan,
|
|
@@ -4048,17 +4286,17 @@ function Spreadsheet({
|
|
|
4048
4286
|
backgroundColor: group.headerColor || "rgb(243 244 246)"
|
|
4049
4287
|
},
|
|
4050
4288
|
onClick: () => group.collapsible && handleToggleGroupCollapse(group.id),
|
|
4051
|
-
children: /* @__PURE__ */
|
|
4052
|
-
group.collapsible && (isCollapsed ? /* @__PURE__ */
|
|
4053
|
-
/* @__PURE__ */
|
|
4289
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center gap-1", children: [
|
|
4290
|
+
group.collapsible && (isCollapsed ? /* @__PURE__ */ jsx13(HiChevronRight, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx13(HiChevronDown, { className: "h-3 w-3" })),
|
|
4291
|
+
/* @__PURE__ */ jsx13("span", { children: group.label })
|
|
4054
4292
|
] })
|
|
4055
4293
|
},
|
|
4056
4294
|
group.id
|
|
4057
4295
|
);
|
|
4058
4296
|
})
|
|
4059
4297
|
] }),
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
!columnGroups && /* @__PURE__ */
|
|
4298
|
+
/* @__PURE__ */ jsxs13("tr", { children: [
|
|
4299
|
+
!columnGroups && /* @__PURE__ */ jsx13(
|
|
4062
4300
|
RowIndexColumnHeader,
|
|
4063
4301
|
{
|
|
4064
4302
|
enableHighlighting,
|
|
@@ -4072,7 +4310,7 @@ function Spreadsheet({
|
|
|
4072
4310
|
),
|
|
4073
4311
|
columnRenderItems.map((item) => {
|
|
4074
4312
|
if (item.type === "collapsed-placeholder") {
|
|
4075
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ jsx13(
|
|
4076
4314
|
"th",
|
|
4077
4315
|
{
|
|
4078
4316
|
className: "border border-gray-200 px-2 py-1 text-center text-gray-400",
|
|
@@ -4088,7 +4326,7 @@ function Spreadsheet({
|
|
|
4088
4326
|
const column = item.column;
|
|
4089
4327
|
const isPinnedLeft = isColumnPinned(column.id) && getColumnPinSide(column.id) === "left";
|
|
4090
4328
|
const isPinnedRight = isColumnPinned(column.id) && getColumnPinSide(column.id) === "right";
|
|
4091
|
-
return /* @__PURE__ */
|
|
4329
|
+
return /* @__PURE__ */ jsx13(
|
|
4092
4330
|
SpreadsheetHeader,
|
|
4093
4331
|
{
|
|
4094
4332
|
column,
|
|
@@ -4106,7 +4344,7 @@ function Spreadsheet({
|
|
|
4106
4344
|
),
|
|
4107
4345
|
onPinClick: () => handleTogglePin(column.id),
|
|
4108
4346
|
onHighlightClick: enableHighlighting ? () => setHighlightPickerColumn(column.id) : void 0,
|
|
4109
|
-
children: activeFilterColumn === column.id && /* @__PURE__ */
|
|
4347
|
+
children: activeFilterColumn === column.id && /* @__PURE__ */ jsx13(
|
|
4110
4348
|
SpreadsheetFilterDropdown,
|
|
4111
4349
|
{
|
|
4112
4350
|
column,
|
|
@@ -4121,17 +4359,17 @@ function Spreadsheet({
|
|
|
4121
4359
|
})
|
|
4122
4360
|
] })
|
|
4123
4361
|
] }),
|
|
4124
|
-
/* @__PURE__ */
|
|
4362
|
+
/* @__PURE__ */ jsx13("tbody", { children: isLoading ? /* @__PURE__ */ jsx13("tr", { children: /* @__PURE__ */ jsx13(
|
|
4125
4363
|
"td",
|
|
4126
4364
|
{
|
|
4127
4365
|
colSpan: columnRenderItems.length + 1,
|
|
4128
4366
|
className: "text-center py-8 text-gray-500",
|
|
4129
|
-
children: /* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4367
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center gap-2", children: [
|
|
4368
|
+
/* @__PURE__ */ jsx13("div", { className: "w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" }),
|
|
4131
4369
|
"Loading..."
|
|
4132
4370
|
] })
|
|
4133
4371
|
}
|
|
4134
|
-
) }) : paginatedData.length === 0 ? /* @__PURE__ */
|
|
4372
|
+
) }) : paginatedData.length === 0 ? /* @__PURE__ */ jsx13("tr", { children: /* @__PURE__ */ jsx13(
|
|
4135
4373
|
"td",
|
|
4136
4374
|
{
|
|
4137
4375
|
colSpan: columnRenderItems.length + 1,
|
|
@@ -4144,7 +4382,7 @@ function Spreadsheet({
|
|
|
4144
4382
|
const isRowHovered = hoveredRow === rowId;
|
|
4145
4383
|
const rowHighlight = getRowHighlight(rowId);
|
|
4146
4384
|
const displayIndex = rowIndex + 1 + (currentPage - 1) * pageSize;
|
|
4147
|
-
return /* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ jsxs13(
|
|
4148
4386
|
"tr",
|
|
4149
4387
|
{
|
|
4150
4388
|
onMouseEnter: () => setHoveredRow(rowId),
|
|
@@ -4154,7 +4392,7 @@ function Spreadsheet({
|
|
|
4154
4392
|
},
|
|
4155
4393
|
onDoubleClick: () => onRowDoubleClick?.(row, rowIndex),
|
|
4156
4394
|
children: [
|
|
4157
|
-
/* @__PURE__ */
|
|
4395
|
+
/* @__PURE__ */ jsx13(
|
|
4158
4396
|
"td",
|
|
4159
4397
|
{
|
|
4160
4398
|
onClick: (e) => handleRowSelect(rowId, e),
|
|
@@ -4175,10 +4413,10 @@ function Spreadsheet({
|
|
|
4175
4413
|
left: 0
|
|
4176
4414
|
}
|
|
4177
4415
|
},
|
|
4178
|
-
children: /* @__PURE__ */
|
|
4179
|
-
/* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
rowContextMenuItems && rowContextMenuItems.length > 0 && /* @__PURE__ */
|
|
4416
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "relative flex items-center justify-center w-full h-full", children: [
|
|
4417
|
+
/* @__PURE__ */ jsx13("span", { children: displayIndex }),
|
|
4418
|
+
/* @__PURE__ */ jsxs13("div", { className: "absolute inset-0 flex items-center justify-evenly", children: [
|
|
4419
|
+
rowContextMenuItems && rowContextMenuItems.length > 0 && /* @__PURE__ */ jsx13(
|
|
4182
4420
|
RowContextMenu,
|
|
4183
4421
|
{
|
|
4184
4422
|
row,
|
|
@@ -4187,7 +4425,7 @@ function Spreadsheet({
|
|
|
4187
4425
|
compactMode: effectiveCompactMode
|
|
4188
4426
|
}
|
|
4189
4427
|
),
|
|
4190
|
-
enableHighlighting && /* @__PURE__ */
|
|
4428
|
+
enableHighlighting && /* @__PURE__ */ jsx13(
|
|
4191
4429
|
"button",
|
|
4192
4430
|
{
|
|
4193
4431
|
type: "button",
|
|
@@ -4197,7 +4435,7 @@ function Spreadsheet({
|
|
|
4197
4435
|
},
|
|
4198
4436
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-gray-200 rounded",
|
|
4199
4437
|
title: "Highlight row",
|
|
4200
|
-
children: /* @__PURE__ */
|
|
4438
|
+
children: /* @__PURE__ */ jsx13(
|
|
4201
4439
|
AiFillHighlight,
|
|
4202
4440
|
{
|
|
4203
4441
|
className: cn(
|
|
@@ -4211,7 +4449,7 @@ function Spreadsheet({
|
|
|
4211
4449
|
enableComments && (cellHasComments(
|
|
4212
4450
|
rowId,
|
|
4213
4451
|
ROW_INDEX_COLUMN_ID
|
|
4214
|
-
) ? /* @__PURE__ */
|
|
4452
|
+
) ? /* @__PURE__ */ jsxs13(
|
|
4215
4453
|
"button",
|
|
4216
4454
|
{
|
|
4217
4455
|
type: "button",
|
|
@@ -4225,11 +4463,11 @@ function Spreadsheet({
|
|
|
4225
4463
|
className: "p-0.5 bg-amber-100 hover:bg-amber-200 rounded transition-colors flex items-center gap-0.5",
|
|
4226
4464
|
title: `${getCellUnresolvedCommentCount(rowId, ROW_INDEX_COLUMN_ID)} comment(s) - click to view`,
|
|
4227
4465
|
children: [
|
|
4228
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ jsx13(FaComment, { className: "h-2.5 w-2.5 text-amber-500" }),
|
|
4229
4467
|
getCellUnresolvedCommentCount(
|
|
4230
4468
|
rowId,
|
|
4231
4469
|
ROW_INDEX_COLUMN_ID
|
|
4232
|
-
) > 0 && /* @__PURE__ */
|
|
4470
|
+
) > 0 && /* @__PURE__ */ jsx13("span", { className: "text-[9px] font-medium text-amber-600", children: getCellUnresolvedCommentCount(
|
|
4233
4471
|
rowId,
|
|
4234
4472
|
ROW_INDEX_COLUMN_ID
|
|
4235
4473
|
) > 99 ? "99+" : getCellUnresolvedCommentCount(
|
|
@@ -4238,7 +4476,7 @@ function Spreadsheet({
|
|
|
4238
4476
|
) })
|
|
4239
4477
|
]
|
|
4240
4478
|
}
|
|
4241
|
-
) : /* @__PURE__ */
|
|
4479
|
+
) : /* @__PURE__ */ jsx13(
|
|
4242
4480
|
"button",
|
|
4243
4481
|
{
|
|
4244
4482
|
type: "button",
|
|
@@ -4251,13 +4489,13 @@ function Spreadsheet({
|
|
|
4251
4489
|
},
|
|
4252
4490
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-gray-200 rounded",
|
|
4253
4491
|
title: "Add comment",
|
|
4254
|
-
children: /* @__PURE__ */
|
|
4492
|
+
children: /* @__PURE__ */ jsx13(FaRegComment, { className: "h-2.5 w-2.5 text-gray-500" })
|
|
4255
4493
|
}
|
|
4256
4494
|
)),
|
|
4257
4495
|
rowActions?.map((action) => {
|
|
4258
4496
|
if (action.visible && !action.visible(row))
|
|
4259
4497
|
return null;
|
|
4260
|
-
return /* @__PURE__ */
|
|
4498
|
+
return /* @__PURE__ */ jsx13(
|
|
4261
4499
|
"button",
|
|
4262
4500
|
{
|
|
4263
4501
|
type: "button",
|
|
@@ -4281,7 +4519,7 @@ function Spreadsheet({
|
|
|
4281
4519
|
),
|
|
4282
4520
|
columnRenderItems.map((item) => {
|
|
4283
4521
|
if (item.type === "collapsed-placeholder") {
|
|
4284
|
-
return /* @__PURE__ */
|
|
4522
|
+
return /* @__PURE__ */ jsx13(
|
|
4285
4523
|
"td",
|
|
4286
4524
|
{
|
|
4287
4525
|
className: "border border-gray-200 px-2 py-1 text-center text-gray-300",
|
|
@@ -4307,7 +4545,7 @@ function Spreadsheet({
|
|
|
4307
4545
|
const cellOrRowOrColumnHighlight = getCellHighlight(rowId, column.id) || rowHighlight?.color || getColumnHighlight(column.id);
|
|
4308
4546
|
const isColPinned = isColumnPinned(column.id);
|
|
4309
4547
|
const colPinSide = getColumnPinSide(column.id);
|
|
4310
|
-
return /* @__PURE__ */
|
|
4548
|
+
return /* @__PURE__ */ jsx13(
|
|
4311
4549
|
MemoizedSpreadsheetCell,
|
|
4312
4550
|
{
|
|
4313
4551
|
value,
|
|
@@ -4367,7 +4605,7 @@ function Spreadsheet({
|
|
|
4367
4605
|
] })
|
|
4368
4606
|
}
|
|
4369
4607
|
) }),
|
|
4370
|
-
showPagination && effectiveTotalItems > 0 && /* @__PURE__ */
|
|
4608
|
+
showPagination && effectiveTotalItems > 0 && /* @__PURE__ */ jsx13(
|
|
4371
4609
|
Pagination,
|
|
4372
4610
|
{
|
|
4373
4611
|
currentPage,
|
|
@@ -4382,7 +4620,7 @@ function Spreadsheet({
|
|
|
4382
4620
|
onPageSizeChange: handlePageSizeChange
|
|
4383
4621
|
}
|
|
4384
4622
|
),
|
|
4385
|
-
/* @__PURE__ */
|
|
4623
|
+
/* @__PURE__ */ jsx13(
|
|
4386
4624
|
AddCommentModal,
|
|
4387
4625
|
{
|
|
4388
4626
|
isOpen: commentModalCell !== null,
|
|
@@ -4393,7 +4631,7 @@ function Spreadsheet({
|
|
|
4393
4631
|
}
|
|
4394
4632
|
}
|
|
4395
4633
|
),
|
|
4396
|
-
/* @__PURE__ */
|
|
4634
|
+
/* @__PURE__ */ jsx13(
|
|
4397
4635
|
ViewCommentsModal,
|
|
4398
4636
|
{
|
|
4399
4637
|
isOpen: viewCommentsCell !== null,
|
|
@@ -4408,7 +4646,7 @@ function Spreadsheet({
|
|
|
4408
4646
|
onClose: () => setViewCommentsCell(null)
|
|
4409
4647
|
}
|
|
4410
4648
|
),
|
|
4411
|
-
highlightPickerRow !== null && /* @__PURE__ */
|
|
4649
|
+
highlightPickerRow !== null && /* @__PURE__ */ jsx13(
|
|
4412
4650
|
ColorPickerPopover,
|
|
4413
4651
|
{
|
|
4414
4652
|
title: "Highlight Row",
|
|
@@ -4417,7 +4655,7 @@ function Spreadsheet({
|
|
|
4417
4655
|
onClose: () => setHighlightPickerRow(null)
|
|
4418
4656
|
}
|
|
4419
4657
|
),
|
|
4420
|
-
highlightPickerColumn !== null && /* @__PURE__ */
|
|
4658
|
+
highlightPickerColumn !== null && /* @__PURE__ */ jsx13(
|
|
4421
4659
|
ColorPickerPopover,
|
|
4422
4660
|
{
|
|
4423
4661
|
title: highlightPickerColumn === ROW_INDEX_COLUMN_ID ? "Highlight Row Index Column" : `Highlight Column: ${columns.find((c) => c.id === highlightPickerColumn)?.label || ""}`,
|
|
@@ -4426,7 +4664,7 @@ function Spreadsheet({
|
|
|
4426
4664
|
onClose: () => setHighlightPickerColumn(null)
|
|
4427
4665
|
}
|
|
4428
4666
|
),
|
|
4429
|
-
highlightPickerCell !== null && /* @__PURE__ */
|
|
4667
|
+
highlightPickerCell !== null && /* @__PURE__ */ jsx13(
|
|
4430
4668
|
ColorPickerPopover,
|
|
4431
4669
|
{
|
|
4432
4670
|
title: "Highlight Cell",
|
|
@@ -4439,7 +4677,7 @@ function Spreadsheet({
|
|
|
4439
4677
|
onClose: () => setHighlightPickerCell(null)
|
|
4440
4678
|
}
|
|
4441
4679
|
),
|
|
4442
|
-
/* @__PURE__ */
|
|
4680
|
+
/* @__PURE__ */ jsx13(
|
|
4443
4681
|
KeyboardShortcutsModal,
|
|
4444
4682
|
{
|
|
4445
4683
|
isOpen: showKeyboardShortcuts,
|
|
@@ -4447,7 +4685,7 @@ function Spreadsheet({
|
|
|
4447
4685
|
shortcuts
|
|
4448
4686
|
}
|
|
4449
4687
|
),
|
|
4450
|
-
/* @__PURE__ */
|
|
4688
|
+
/* @__PURE__ */ jsx13(
|
|
4451
4689
|
SpreadsheetSettingsModal,
|
|
4452
4690
|
{
|
|
4453
4691
|
isOpen: showSettingsModal,
|
|
@@ -4474,6 +4712,7 @@ function Spreadsheet({
|
|
|
4474
4712
|
}
|
|
4475
4713
|
Spreadsheet.displayName = "Spreadsheet";
|
|
4476
4714
|
export {
|
|
4715
|
+
ActiveFiltersDisplay,
|
|
4477
4716
|
RowContextMenu,
|
|
4478
4717
|
Spreadsheet,
|
|
4479
4718
|
MemoizedSpreadsheetCell as SpreadsheetCell,
|