@xcelsior/ui-spreadsheets 1.0.7 → 1.0.8
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/.turbo/turbo-build.log +22 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/CommentModals.tsx +58 -0
- package/src/components/Spreadsheet.stories.tsx +11 -0
- package/src/components/Spreadsheet.tsx +25 -1
- package/src/components/SpreadsheetCell.tsx +4 -0
- package/src/types.ts +2 -0
- package/.turbo/turbo-lint.log +0 -61
package/dist/index.mjs
CHANGED
|
@@ -111,6 +111,9 @@ function HiReply(props) {
|
|
|
111
111
|
function HiSortAscending(props) {
|
|
112
112
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "d": "M3 3a1 1 0 000 2h11a1 1 0 100-2H3zM3 7a1 1 0 000 2h5a1 1 0 000-2H3zM3 11a1 1 0 100 2h4a1 1 0 100-2H3zM13 16a1 1 0 102 0v-5.586l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 101.414 1.414L13 10.414V16z" } }] })(props);
|
|
113
113
|
}
|
|
114
|
+
function HiTrash(props) {
|
|
115
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z", "clipRule": "evenodd" } }] })(props);
|
|
116
|
+
}
|
|
114
117
|
function HiViewBoards(props) {
|
|
115
118
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "d": "M2 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V4zM8 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H9a1 1 0 01-1-1V4zM15 3a1 1 0 00-1 1v12a1 1 0 001 1h2a1 1 0 001-1V4a1 1 0 00-1-1h-2z" } }] })(props);
|
|
116
119
|
}
|
|
@@ -276,6 +279,10 @@ var SpreadsheetCell = ({
|
|
|
276
279
|
},
|
|
277
280
|
onKeyDown: handleKeyDown,
|
|
278
281
|
onBlur: () => onConfirm?.(localValue),
|
|
282
|
+
autoComplete: "off",
|
|
283
|
+
autoCorrect: "off",
|
|
284
|
+
autoCapitalize: "off",
|
|
285
|
+
spellCheck: false,
|
|
279
286
|
className: cn(
|
|
280
287
|
"w-full border border-gray-300 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500 bg-yellow-50",
|
|
281
288
|
compactMode ? "px-1 py-0.5" : "px-2 py-1"
|
|
@@ -2126,6 +2133,44 @@ function ViewCommentsModal({
|
|
|
2126
2133
|
] }) });
|
|
2127
2134
|
}
|
|
2128
2135
|
ViewCommentsModal.displayName = "ViewCommentsModal";
|
|
2136
|
+
function DeleteConfirmationModal({
|
|
2137
|
+
isOpen,
|
|
2138
|
+
title = "Delete Row",
|
|
2139
|
+
message = "Are you sure you want to delete this row? This action cannot be undone.",
|
|
2140
|
+
confirmLabel = "Delete",
|
|
2141
|
+
onConfirm,
|
|
2142
|
+
onClose
|
|
2143
|
+
}) {
|
|
2144
|
+
if (!isOpen) return null;
|
|
2145
|
+
return /* @__PURE__ */ jsx9("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxs9("div", { className: "bg-white rounded-lg shadow-xl p-6 w-96 max-w-full mx-4", children: [
|
|
2146
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-lg font-semibold mb-2", children: title }),
|
|
2147
|
+
/* @__PURE__ */ jsx9("p", { className: "text-gray-600 mb-6", children: message }),
|
|
2148
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex justify-end gap-2", children: [
|
|
2149
|
+
/* @__PURE__ */ jsx9(
|
|
2150
|
+
"button",
|
|
2151
|
+
{
|
|
2152
|
+
type: "button",
|
|
2153
|
+
onClick: onClose,
|
|
2154
|
+
className: "px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",
|
|
2155
|
+
children: "Cancel"
|
|
2156
|
+
}
|
|
2157
|
+
),
|
|
2158
|
+
/* @__PURE__ */ jsx9(
|
|
2159
|
+
"button",
|
|
2160
|
+
{
|
|
2161
|
+
type: "button",
|
|
2162
|
+
onClick: () => {
|
|
2163
|
+
onConfirm();
|
|
2164
|
+
onClose();
|
|
2165
|
+
},
|
|
2166
|
+
className: "px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors",
|
|
2167
|
+
children: confirmLabel
|
|
2168
|
+
}
|
|
2169
|
+
)
|
|
2170
|
+
] })
|
|
2171
|
+
] }) });
|
|
2172
|
+
}
|
|
2173
|
+
DeleteConfirmationModal.displayName = "DeleteConfirmationModal";
|
|
2129
2174
|
|
|
2130
2175
|
// src/components/KeyboardShortcutsModal.tsx
|
|
2131
2176
|
import React4 from "react";
|
|
@@ -2792,6 +2837,7 @@ function Spreadsheet({
|
|
|
2792
2837
|
onRowClick,
|
|
2793
2838
|
onRowDoubleClick,
|
|
2794
2839
|
onRowClone,
|
|
2840
|
+
onRowDelete,
|
|
2795
2841
|
onAddCellComment,
|
|
2796
2842
|
onRowHighlight,
|
|
2797
2843
|
showToolbar = true,
|
|
@@ -3180,6 +3226,12 @@ function Spreadsheet({
|
|
|
3180
3226
|
},
|
|
3181
3227
|
[onRowClone]
|
|
3182
3228
|
);
|
|
3229
|
+
const handleRowDelete = useCallback6(
|
|
3230
|
+
(row, rowId) => {
|
|
3231
|
+
onRowDelete?.(row, rowId);
|
|
3232
|
+
},
|
|
3233
|
+
[onRowDelete]
|
|
3234
|
+
);
|
|
3183
3235
|
const handleRowIndexHighlightClick = useCallback6(() => {
|
|
3184
3236
|
setHighlightPickerColumn(ROW_INDEX_COLUMN_ID);
|
|
3185
3237
|
}, [setHighlightPickerColumn]);
|
|
@@ -3383,6 +3435,19 @@ function Spreadsheet({
|
|
|
3383
3435
|
children: /* @__PURE__ */ jsx11(HiDuplicate, { className: "h-2.5 w-2.5 text-gray-500" })
|
|
3384
3436
|
}
|
|
3385
3437
|
),
|
|
3438
|
+
onRowDelete && /* @__PURE__ */ jsx11(
|
|
3439
|
+
"button",
|
|
3440
|
+
{
|
|
3441
|
+
type: "button",
|
|
3442
|
+
onClick: (e) => {
|
|
3443
|
+
e.stopPropagation();
|
|
3444
|
+
handleRowDelete(row, rowId);
|
|
3445
|
+
},
|
|
3446
|
+
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-red-100 rounded",
|
|
3447
|
+
title: "Delete row",
|
|
3448
|
+
children: /* @__PURE__ */ jsx11(HiTrash, { className: "h-2.5 w-2.5 text-gray-500 hover:text-red-500" })
|
|
3449
|
+
}
|
|
3450
|
+
),
|
|
3386
3451
|
enableHighlighting && /* @__PURE__ */ jsx11(
|
|
3387
3452
|
"button",
|
|
3388
3453
|
{
|