@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.
@@ -0,0 +1,22 @@
1
+
2
+ > @xcelsior/ui-spreadsheets@1.0.8 build /home/circleci/repo/packages/ui/ui-spreadsheets
3
+ > tsup && tsc --noEmit
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/circleci/repo/packages/ui/ui-spreadsheets/tsup.config.ts
9
+ CLI Target: es2020
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ ESM Build start
13
+ ESM dist/index.mjs 147.91 KB
14
+ ESM dist/index.mjs.map 4.62 MB
15
+ ESM ⚡️ Build success in 418ms
16
+ CJS dist/index.js 159.10 KB
17
+ CJS dist/index.js.map 4.61 MB
18
+ CJS ⚡️ Build success in 418ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 3997ms
21
+ DTS dist/index.d.ts 22.18 KB
22
+ DTS dist/index.d.mts 22.18 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xcelsior/ui-spreadsheets
2
2
 
3
+ ## 1.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 43355ef: add onDelete
8
+
3
9
  ## 1.0.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -253,6 +253,8 @@ interface SpreadsheetProps<T = any> {
253
253
  onRowDoubleClick?: (row: T, rowIndex: number) => void;
254
254
  /** Callback when a row is cloned/duplicated */
255
255
  onRowClone?: (row: T, rowId: string | number) => void;
256
+ /** Callback when a row is deleted */
257
+ onRowDelete?: (row: T, rowId: string | number) => void;
256
258
  /** Callback when a cell comment is added */
257
259
  onAddCellComment?: (rowId: string | number, columnId: string, comment: string) => void;
258
260
  /** Callback when row highlight is toggled */
@@ -554,7 +556,7 @@ interface SpreadsheetColumnGroupHeaderProps {
554
556
  * />
555
557
  * ```
556
558
  */
557
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onAddCellComment, onRowHighlight, showToolbar, showPagination, showRowIndex, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, defaultPageSize, pageSizeOptions, defaultZoom, autoSave, compactMode, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, cellComments: externalCellComments, rowActions, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, onPageChange, sortConfig: controlledSortConfig, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
559
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onRowDelete, onAddCellComment, onRowHighlight, showToolbar, showPagination, showRowIndex, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, defaultPageSize, pageSizeOptions, defaultZoom, autoSave, compactMode, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, cellComments: externalCellComments, rowActions, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, onPageChange, sortConfig: controlledSortConfig, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
558
560
  declare namespace Spreadsheet {
559
561
  var displayName: string;
560
562
  }
package/dist/index.d.ts CHANGED
@@ -253,6 +253,8 @@ interface SpreadsheetProps<T = any> {
253
253
  onRowDoubleClick?: (row: T, rowIndex: number) => void;
254
254
  /** Callback when a row is cloned/duplicated */
255
255
  onRowClone?: (row: T, rowId: string | number) => void;
256
+ /** Callback when a row is deleted */
257
+ onRowDelete?: (row: T, rowId: string | number) => void;
256
258
  /** Callback when a cell comment is added */
257
259
  onAddCellComment?: (rowId: string | number, columnId: string, comment: string) => void;
258
260
  /** Callback when row highlight is toggled */
@@ -554,7 +556,7 @@ interface SpreadsheetColumnGroupHeaderProps {
554
556
  * />
555
557
  * ```
556
558
  */
557
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onAddCellComment, onRowHighlight, showToolbar, showPagination, showRowIndex, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, defaultPageSize, pageSizeOptions, defaultZoom, autoSave, compactMode, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, cellComments: externalCellComments, rowActions, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, onPageChange, sortConfig: controlledSortConfig, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
559
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onRowClone, onRowDelete, onAddCellComment, onRowHighlight, showToolbar, showPagination, showRowIndex, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, defaultPageSize, pageSizeOptions, defaultZoom, autoSave, compactMode, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, cellComments: externalCellComments, rowActions, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, onPageChange, sortConfig: controlledSortConfig, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
558
560
  declare namespace Spreadsheet {
559
561
  var displayName: string;
560
562
  }
package/dist/index.js CHANGED
@@ -152,6 +152,9 @@ function HiReply(props) {
152
152
  function HiSortAscending(props) {
153
153
  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);
154
154
  }
155
+ function HiTrash(props) {
156
+ 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);
157
+ }
155
158
  function HiViewBoards(props) {
156
159
  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);
157
160
  }
@@ -317,6 +320,10 @@ var SpreadsheetCell = ({
317
320
  },
318
321
  onKeyDown: handleKeyDown,
319
322
  onBlur: () => onConfirm?.(localValue),
323
+ autoComplete: "off",
324
+ autoCorrect: "off",
325
+ autoCapitalize: "off",
326
+ spellCheck: false,
320
327
  className: cn(
321
328
  "w-full border border-gray-300 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500 bg-yellow-50",
322
329
  compactMode ? "px-1 py-0.5" : "px-2 py-1"
@@ -2167,6 +2174,44 @@ function ViewCommentsModal({
2167
2174
  ] }) });
2168
2175
  }
2169
2176
  ViewCommentsModal.displayName = "ViewCommentsModal";
2177
+ function DeleteConfirmationModal({
2178
+ isOpen,
2179
+ title = "Delete Row",
2180
+ message = "Are you sure you want to delete this row? This action cannot be undone.",
2181
+ confirmLabel = "Delete",
2182
+ onConfirm,
2183
+ onClose
2184
+ }) {
2185
+ if (!isOpen) return null;
2186
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white rounded-lg shadow-xl p-6 w-96 max-w-full mx-4", children: [
2187
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-lg font-semibold mb-2", children: title }),
2188
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-gray-600 mb-6", children: message }),
2189
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-end gap-2", children: [
2190
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2191
+ "button",
2192
+ {
2193
+ type: "button",
2194
+ onClick: onClose,
2195
+ className: "px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",
2196
+ children: "Cancel"
2197
+ }
2198
+ ),
2199
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2200
+ "button",
2201
+ {
2202
+ type: "button",
2203
+ onClick: () => {
2204
+ onConfirm();
2205
+ onClose();
2206
+ },
2207
+ className: "px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors",
2208
+ children: confirmLabel
2209
+ }
2210
+ )
2211
+ ] })
2212
+ ] }) });
2213
+ }
2214
+ DeleteConfirmationModal.displayName = "DeleteConfirmationModal";
2170
2215
 
2171
2216
  // src/components/KeyboardShortcutsModal.tsx
2172
2217
  var import_react10 = __toESM(require("react"));
@@ -2833,6 +2878,7 @@ function Spreadsheet({
2833
2878
  onRowClick,
2834
2879
  onRowDoubleClick,
2835
2880
  onRowClone,
2881
+ onRowDelete,
2836
2882
  onAddCellComment,
2837
2883
  onRowHighlight,
2838
2884
  showToolbar = true,
@@ -3221,6 +3267,12 @@ function Spreadsheet({
3221
3267
  },
3222
3268
  [onRowClone]
3223
3269
  );
3270
+ const handleRowDelete = (0, import_react15.useCallback)(
3271
+ (row, rowId) => {
3272
+ onRowDelete?.(row, rowId);
3273
+ },
3274
+ [onRowDelete]
3275
+ );
3224
3276
  const handleRowIndexHighlightClick = (0, import_react15.useCallback)(() => {
3225
3277
  setHighlightPickerColumn(ROW_INDEX_COLUMN_ID);
3226
3278
  }, [setHighlightPickerColumn]);
@@ -3424,6 +3476,19 @@ function Spreadsheet({
3424
3476
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HiDuplicate, { className: "h-2.5 w-2.5 text-gray-500" })
3425
3477
  }
3426
3478
  ),
3479
+ onRowDelete && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3480
+ "button",
3481
+ {
3482
+ type: "button",
3483
+ onClick: (e) => {
3484
+ e.stopPropagation();
3485
+ handleRowDelete(row, rowId);
3486
+ },
3487
+ className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 bg-gray-100 hover:bg-red-100 rounded",
3488
+ title: "Delete row",
3489
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HiTrash, { className: "h-2.5 w-2.5 text-gray-500 hover:text-red-500" })
3490
+ }
3491
+ ),
3427
3492
  enableHighlighting && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3428
3493
  "button",
3429
3494
  {