@xcelsior/ui-spreadsheets 1.0.11 → 1.0.12

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.mjs CHANGED
@@ -93,9 +93,6 @@ function HiCog(props) {
93
93
  function HiDotsVertical(props) {
94
94
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "d": "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" } }] })(props);
95
95
  }
96
- function HiDownload(props) {
97
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z", "clipRule": "evenodd" } }] })(props);
98
- }
99
96
  function HiDuplicate(props) {
100
97
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "d": "M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z" } }, { "tag": "path", "attr": { "d": "M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z" } }] })(props);
101
98
  }
@@ -284,7 +281,7 @@ var SpreadsheetCell = ({
284
281
  autoCapitalize: "off",
285
282
  spellCheck: false,
286
283
  className: cn(
287
- "w-full border border-gray-300 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500 bg-blue-50",
284
+ "w-full border border-gray-300 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500 bg-yellow-50",
288
285
  compactMode ? "px-1 py-0.5" : "px-2 py-1"
289
286
  )
290
287
  }
@@ -334,7 +331,7 @@ var SpreadsheetCell = ({
334
331
  {
335
332
  className: cn(
336
333
  "flex-1 truncate",
337
- isEditable && "cursor-text hover:bg-gray-50 px-0.5 rounded min-h-[18px] flex items-center bg-blue-50"
334
+ isEditable && "cursor-text hover:bg-gray-50 px-0.5 rounded min-h-[18px] flex items-center bg-yellow-50/50"
338
335
  ),
339
336
  title: String(value ?? ""),
340
337
  children: renderContent()
@@ -765,7 +762,7 @@ var SpreadsheetToolbar = ({
765
762
  onRedo,
766
763
  onClearSelection,
767
764
  onSave,
768
- onExport,
765
+ menuItems,
769
766
  onSettings,
770
767
  onShowShortcuts,
771
768
  hasActiveFilters,
@@ -1021,22 +1018,27 @@ var SpreadsheetToolbar = ({
1021
1018
  ]
1022
1019
  }
1023
1020
  ),
1024
- (onSettings || onShowShortcuts) && onExport && /* @__PURE__ */ jsx3("div", { className: "border-t border-gray-100 my-1" }),
1025
- onExport && /* @__PURE__ */ jsxs3(
1021
+ menuItems && menuItems.length > 0 && (onSettings || onShowShortcuts) && /* @__PURE__ */ jsx3("div", { className: "border-t border-gray-100 my-1" }),
1022
+ menuItems?.map((item) => /* @__PURE__ */ jsxs3(
1026
1023
  "button",
1027
1024
  {
1028
1025
  type: "button",
1026
+ disabled: item.disabled,
1029
1027
  onClick: () => {
1030
- onExport();
1028
+ item.onClick();
1031
1029
  setShowMoreMenu(false);
1032
1030
  },
1033
- className: "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
1031
+ className: cn(
1032
+ "w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 text-xs transition-colors",
1033
+ item.disabled && "opacity-50 cursor-not-allowed"
1034
+ ),
1034
1035
  children: [
1035
- /* @__PURE__ */ jsx3(HiDownload, { className: "h-3.5 w-3.5 text-gray-500" }),
1036
- /* @__PURE__ */ jsx3("span", { className: "text-gray-700", children: "Export" })
1036
+ item.icon && /* @__PURE__ */ jsx3("span", { className: "h-3.5 w-3.5 text-gray-500 flex items-center justify-center", children: item.icon }),
1037
+ /* @__PURE__ */ jsx3("span", { className: "text-gray-700", children: item.label })
1037
1038
  ]
1038
- }
1039
- )
1039
+ },
1040
+ item.id
1041
+ ))
1040
1042
  ] })
1041
1043
  ] })
1042
1044
  ] })
@@ -2859,6 +2861,7 @@ function Spreadsheet({
2859
2861
  rowHighlights: externalRowHighlights,
2860
2862
  cellComments: externalCellComments,
2861
2863
  rowActions,
2864
+ toolbarMenuItems,
2862
2865
  // Server-side mode props
2863
2866
  serverSide = false,
2864
2867
  totalItems,
@@ -3263,7 +3266,7 @@ function Spreadsheet({
3263
3266
  onSave: handleSave,
3264
3267
  onSettings: () => setShowSettingsModal(true),
3265
3268
  onShowShortcuts: () => setShowKeyboardShortcuts(true),
3266
- onExport: () => console.log("Export clicked")
3269
+ menuItems: toolbarMenuItems
3267
3270
  }
3268
3271
  ),
3269
3272
  /* @__PURE__ */ jsx11("div", { ref: tableRef, className: "flex-1 overflow-auto border border-gray-200 rounded", children: /* @__PURE__ */ jsx11(