@krak-stack/registry 0.1.30 → 0.1.31
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.
|
@@ -205,6 +205,10 @@ export type DataTablePaginationFeature = false | {
|
|
|
205
205
|
pageSizes?: readonly number[];
|
|
206
206
|
};
|
|
207
207
|
export interface DataTableFeatures<TData> {
|
|
208
|
+
toolbar?: false | {
|
|
209
|
+
/** Additional `MenubarMenu` controls rendered at the start of the toolbar. */
|
|
210
|
+
items: ReactNode;
|
|
211
|
+
};
|
|
208
212
|
search?: boolean;
|
|
209
213
|
sorting?: boolean;
|
|
210
214
|
pagination?: DataTablePaginationFeature;
|
|
@@ -2068,8 +2068,9 @@ var DataTableToolbar = ({
|
|
|
2068
2068
|
const model = deriveModel(store);
|
|
2069
2069
|
const selectedRows = getSelectedRows(store, model);
|
|
2070
2070
|
const grouping = features.grouping;
|
|
2071
|
+
const toolbar = features.toolbar;
|
|
2071
2072
|
const bulkActions = features.selection && features.selection.bulkActions;
|
|
2072
|
-
const hasToolbar = features.search !== false || features.sorting !== false || features.columnVisibility !== false || !!features.export || !!features.gallery || !!grouping || !!features.refresh || !!bulkActions && selectedRows.length > 0;
|
|
2073
|
+
const hasToolbar = !!toolbar || features.search !== false || features.sorting !== false || features.columnVisibility !== false || !!features.export || !!features.gallery || !!grouping || !!features.refresh || !!bulkActions && selectedRows.length > 0;
|
|
2073
2074
|
if (!hasToolbar)
|
|
2074
2075
|
return null;
|
|
2075
2076
|
const update = (next) => changeState(setStore, next);
|
|
@@ -2113,6 +2114,7 @@ var DataTableToolbar = ({
|
|
|
2113
2114
|
children: /* @__PURE__ */ jsxs8(Menubar, {
|
|
2114
2115
|
className: "h-auto w-max min-w-full justify-start bg-transparent shadow-none [&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4",
|
|
2115
2116
|
children: [
|
|
2117
|
+
toolbar && toolbar.items,
|
|
2116
2118
|
visibleBulkActions.length ? /* @__PURE__ */ jsxs8(MenubarMenu, {
|
|
2117
2119
|
children: [
|
|
2118
2120
|
/* @__PURE__ */ jsxs8(MenubarTrigger, {
|