baaz-custom-components 5.2.6 → 5.2.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/dist/index.d.mts CHANGED
@@ -147,6 +147,7 @@ interface SelectionAction {
147
147
  id: string;
148
148
  label: string;
149
149
  icon?: React__default.ReactNode;
150
+ scope: boolean;
150
151
  }
151
152
  interface GridSelectionProps {
152
153
  selectionEnabled?: boolean;
package/dist/index.d.ts CHANGED
@@ -147,6 +147,7 @@ interface SelectionAction {
147
147
  id: string;
148
148
  label: string;
149
149
  icon?: React__default.ReactNode;
150
+ scope: boolean;
150
151
  }
151
152
  interface GridSelectionProps {
152
153
  selectionEnabled?: boolean;
package/dist/index.js CHANGED
@@ -2375,19 +2375,21 @@ function SelectionBar({
2375
2375
  " selected"
2376
2376
  ] }),
2377
2377
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-4 w-px bg-border mx-1" }),
2378
- actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2379
- "button",
2380
- {
2381
- onClick: () => onAction(action.id, selectedData),
2382
- title: action.label,
2383
- className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border border-border bg-primary/90 hover:bg-primary ease-in-out transition-colors cursor-pointer whitespace-nowrap",
2384
- children: [
2385
- action.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "shrink-0 text-muted-foreground", children: action.icon }),
2386
- action.label
2387
- ]
2388
- },
2389
- action.id
2390
- ))
2378
+ actions.map(
2379
+ (action) => action.scope && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2380
+ "button",
2381
+ {
2382
+ onClick: () => onAction(action.id, selectedData),
2383
+ title: action.label,
2384
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border border-border bg-primary/90 hover:bg-primary ease-in-out transition-colors cursor-pointer whitespace-nowrap",
2385
+ children: [
2386
+ action.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "shrink-0 text-muted-foreground", children: action.icon }),
2387
+ action.label
2388
+ ]
2389
+ },
2390
+ action.id
2391
+ )
2392
+ )
2391
2393
  ] });
2392
2394
  }
2393
2395
 
@@ -2904,9 +2906,9 @@ var Grid = (0, import_react10.forwardRef)(
2904
2906
  else onExportPdf == null ? void 0 : onExportPdf();
2905
2907
  }, [data, fileName, onExportPdf]);
2906
2908
  const handleExportExcel = (0, import_react10.useCallback)(() => {
2909
+ if (onExportExcel) return onExportExcel();
2907
2910
  const selected = getSelectedData();
2908
2911
  if (selected.length) exportExcel(selected, fileName);
2909
- else onExportExcel == null ? void 0 : onExportExcel();
2910
2912
  }, [data, fileName, onExportExcel]);
2911
2913
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full h-full flex flex-col overflow-hidden", children: [
2912
2914
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
package/dist/index.mjs CHANGED
@@ -2344,19 +2344,21 @@ function SelectionBar({
2344
2344
  " selected"
2345
2345
  ] }),
2346
2346
  /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-border mx-1" }),
2347
- actions.map((action) => /* @__PURE__ */ jsxs18(
2348
- "button",
2349
- {
2350
- onClick: () => onAction(action.id, selectedData),
2351
- title: action.label,
2352
- className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border border-border bg-primary/90 hover:bg-primary ease-in-out transition-colors cursor-pointer whitespace-nowrap",
2353
- children: [
2354
- action.icon && /* @__PURE__ */ jsx24("span", { className: "shrink-0 text-muted-foreground", children: action.icon }),
2355
- action.label
2356
- ]
2357
- },
2358
- action.id
2359
- ))
2347
+ actions.map(
2348
+ (action) => action.scope && /* @__PURE__ */ jsxs18(
2349
+ "button",
2350
+ {
2351
+ onClick: () => onAction(action.id, selectedData),
2352
+ title: action.label,
2353
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border border-border bg-primary/90 hover:bg-primary ease-in-out transition-colors cursor-pointer whitespace-nowrap",
2354
+ children: [
2355
+ action.icon && /* @__PURE__ */ jsx24("span", { className: "shrink-0 text-muted-foreground", children: action.icon }),
2356
+ action.label
2357
+ ]
2358
+ },
2359
+ action.id
2360
+ )
2361
+ )
2360
2362
  ] });
2361
2363
  }
2362
2364
 
@@ -2873,9 +2875,9 @@ var Grid = forwardRef(
2873
2875
  else onExportPdf == null ? void 0 : onExportPdf();
2874
2876
  }, [data, fileName, onExportPdf]);
2875
2877
  const handleExportExcel = useCallback2(() => {
2878
+ if (onExportExcel) return onExportExcel();
2876
2879
  const selected = getSelectedData();
2877
2880
  if (selected.length) exportExcel(selected, fileName);
2878
- else onExportExcel == null ? void 0 : onExportExcel();
2879
2881
  }, [data, fileName, onExportExcel]);
2880
2882
  return /* @__PURE__ */ jsxs20("div", { className: "w-full h-full flex flex-col overflow-hidden", children: [
2881
2883
  /* @__PURE__ */ jsx28(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baaz-custom-components",
3
- "version": "5.2.6",
3
+ "version": "5.2.8",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",