@xcelsior/ui-spreadsheets 1.1.2 → 1.1.3

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.js CHANGED
@@ -1121,71 +1121,56 @@ function ColumnHeaderActions({
1121
1121
  unpinnedTitle = "Pin column",
1122
1122
  className
1123
1123
  }) {
1124
- const handleClick = (e) => {
1125
- e.stopPropagation();
1126
- };
1127
- const handleKeyDown = (e) => {
1128
- e.stopPropagation();
1129
- };
1130
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1131
- "button",
1132
- {
1133
- type: "button",
1134
- className: cn("flex items-center gap-0.5", className),
1135
- onClick: handleClick,
1136
- onKeyDown: handleKeyDown,
1137
- children: [
1138
- enableFiltering && onFilterClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1139
- "button",
1140
- {
1141
- type: "button",
1142
- onClick: (e) => {
1143
- e.stopPropagation();
1144
- onFilterClick();
1145
- },
1146
- className: cn(
1147
- "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1148
- hasActiveFilter ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1149
- ),
1150
- title: filterTitle,
1151
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HiFilter, { className: "h-3 w-3" })
1152
- }
1124
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("flex items-center gap-0.5", className), children: [
1125
+ enableFiltering && onFilterClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1126
+ "button",
1127
+ {
1128
+ type: "button",
1129
+ onClick: (e) => {
1130
+ e.stopPropagation();
1131
+ onFilterClick();
1132
+ },
1133
+ className: cn(
1134
+ "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1135
+ hasActiveFilter ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1153
1136
  ),
1154
- enableHighlighting && onHighlightClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1155
- "button",
1156
- {
1157
- type: "button",
1158
- onClick: (e) => {
1159
- e.stopPropagation();
1160
- onHighlightClick();
1161
- },
1162
- className: cn(
1163
- "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1164
- hasActiveHighlight ? "text-amber-500 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1165
- ),
1166
- title: highlightTitle,
1167
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AiFillHighlight, { className: "h-3 w-3" })
1168
- }
1137
+ title: filterTitle,
1138
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HiFilter, { className: "h-3 w-3" })
1139
+ }
1140
+ ),
1141
+ enableHighlighting && onHighlightClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1142
+ "button",
1143
+ {
1144
+ type: "button",
1145
+ onClick: (e) => {
1146
+ e.stopPropagation();
1147
+ onHighlightClick();
1148
+ },
1149
+ className: cn(
1150
+ "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1151
+ hasActiveHighlight ? "text-amber-500 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1169
1152
  ),
1170
- enablePinning && onPinClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1171
- "button",
1172
- {
1173
- type: "button",
1174
- onClick: (e) => {
1175
- e.stopPropagation();
1176
- onPinClick();
1177
- },
1178
- className: cn(
1179
- "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1180
- isPinned ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1181
- ),
1182
- title: isPinned ? pinnedTitle : unpinnedTitle,
1183
- children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MdPushPin, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MdOutlinePushPin, { className: "h-3 w-3" })
1184
- }
1185
- )
1186
- ]
1187
- }
1188
- );
1153
+ title: highlightTitle,
1154
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AiFillHighlight, { className: "h-3 w-3" })
1155
+ }
1156
+ ),
1157
+ enablePinning && onPinClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1158
+ "button",
1159
+ {
1160
+ type: "button",
1161
+ onClick: (e) => {
1162
+ e.stopPropagation();
1163
+ onPinClick();
1164
+ },
1165
+ className: cn(
1166
+ "p-0.5 hover:bg-gray-200 rounded transition-opacity",
1167
+ isPinned ? "text-blue-600 opacity-100" : "text-gray-400 opacity-0 group-hover:opacity-100"
1168
+ ),
1169
+ title: isPinned ? pinnedTitle : unpinnedTitle,
1170
+ children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MdPushPin, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MdOutlinePushPin, { className: "h-3 w-3" })
1171
+ }
1172
+ )
1173
+ ] });
1189
1174
  }
1190
1175
  ColumnHeaderActions.displayName = "ColumnHeaderActions";
1191
1176
 
@@ -2230,13 +2215,14 @@ function useSpreadsheetFiltering({
2230
2215
  onSortChange,
2231
2216
  serverSide = false,
2232
2217
  controlledFilters,
2233
- controlledSortConfig
2218
+ controlledSortConfig,
2219
+ defaultSortConfig
2234
2220
  }) {
2235
2221
  const [internalFilters, setInternalFilters] = (0, import_react11.useState)(
2236
2222
  {}
2237
2223
  );
2238
2224
  const [internalSortConfig, setInternalSortConfig] = (0, import_react11.useState)(
2239
- null
2225
+ defaultSortConfig ?? null
2240
2226
  );
2241
2227
  const [activeFilterColumn, setActiveFilterColumn] = (0, import_react11.useState)(null);
2242
2228
  const filters = controlledFilters ?? internalFilters;
@@ -3364,7 +3350,8 @@ function Spreadsheet({
3364
3350
  onSortChange,
3365
3351
  serverSide,
3366
3352
  controlledFilters,
3367
- controlledSortConfig: controlledSortConfig ?? spreadsheetSettings?.defaultSort
3353
+ controlledSortConfig,
3354
+ defaultSortConfig: spreadsheetSettings.defaultSort
3368
3355
  });
3369
3356
  const {
3370
3357
  getCellHighlight,