@compill/admin 1.0.86 → 1.0.88

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/index.cjs.js CHANGED
@@ -368,7 +368,6 @@ function Breadcrumbs(_a) {
368
368
  return jsxRuntime.jsx("div", Object.assign({
369
369
  dflex: true,
370
370
  alignItems: "center",
371
- placeContent: "center",
372
371
  trait: "typo.h5"
373
372
  }, props, {
374
373
  children: breadcrumbs.map((b, index) => jsxRuntime.jsx(BreadcrumbItem, {
@@ -417,7 +416,6 @@ function QueryBreadcrumbs(_a) {
417
416
  return jsxRuntime.jsx("div", Object.assign({
418
417
  dflex: true,
419
418
  alignItems: "center",
420
- placeContent: "center",
421
419
  trait: "typo.h5"
422
420
  }, props, {
423
421
  children: breadcrumbs.map((b, index) => jsxRuntime.jsx(BreadcrumbItem, {
@@ -2557,7 +2555,7 @@ const schemes$1 = {
2557
2555
  "custom": "dark"
2558
2556
  };
2559
2557
 
2560
- function useTableProps(api, table, rowActions) {
2558
+ function useTableProps(api, table, rowActions, queryParams) {
2561
2559
  const navigate = reactRouterDom.useNavigate();
2562
2560
  const nextRouter = router.useRouter();
2563
2561
  const openLink = hooks.useOpenLink();
@@ -2613,7 +2611,7 @@ function useTableProps(api, table, rowActions) {
2613
2611
  tableProps.columns = columns;
2614
2612
  tableProps.onRowClick = onRowClickHandler;
2615
2613
  tableProps.queryKey = api.queryKey;
2616
- tableProps.queryFn = api.search;
2614
+ tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
2617
2615
  return tableProps;
2618
2616
  }
2619
2617
 
@@ -2702,7 +2700,8 @@ function TT({
2702
2700
  }),
2703
2701
  rowActions: rowActions,
2704
2702
  api: tableApi,
2705
- subtitle: subtitle
2703
+ subtitle: subtitle,
2704
+ queryParams: screen.queryParams
2706
2705
  }), jsxRuntime.jsx(TableDialogManager, {})]
2707
2706
  })]
2708
2707
  });
@@ -2747,9 +2746,10 @@ function TableWrapper({
2747
2746
  table: table$1,
2748
2747
  subtitle,
2749
2748
  rowActions,
2750
- api
2749
+ api,
2750
+ queryParams
2751
2751
  }) {
2752
- const tableProps = useTableProps(api, table$1, rowActions);
2752
+ const tableProps = useTableProps(api, table$1, rowActions, queryParams);
2753
2753
  const _subtitle = React__default["default"].useMemo(() => {
2754
2754
  if (!subtitle) return undefined;
2755
2755
  return data => {
package/index.esm.js CHANGED
@@ -358,7 +358,6 @@ function Breadcrumbs(_a) {
358
358
  return jsx("div", Object.assign({
359
359
  dflex: true,
360
360
  alignItems: "center",
361
- placeContent: "center",
362
361
  trait: "typo.h5"
363
362
  }, props, {
364
363
  children: breadcrumbs.map((b, index) => jsx(BreadcrumbItem, {
@@ -407,7 +406,6 @@ function QueryBreadcrumbs(_a) {
407
406
  return jsx("div", Object.assign({
408
407
  dflex: true,
409
408
  alignItems: "center",
410
- placeContent: "center",
411
409
  trait: "typo.h5"
412
410
  }, props, {
413
411
  children: breadcrumbs.map((b, index) => jsx(BreadcrumbItem, {
@@ -2547,7 +2545,7 @@ const schemes$1 = {
2547
2545
  "custom": "dark"
2548
2546
  };
2549
2547
 
2550
- function useTableProps(api, table, rowActions) {
2548
+ function useTableProps(api, table, rowActions, queryParams) {
2551
2549
  const navigate = useNavigate();
2552
2550
  const nextRouter = useRouter();
2553
2551
  const openLink = useOpenLink();
@@ -2603,7 +2601,7 @@ function useTableProps(api, table, rowActions) {
2603
2601
  tableProps.columns = columns;
2604
2602
  tableProps.onRowClick = onRowClickHandler;
2605
2603
  tableProps.queryKey = api.queryKey;
2606
- tableProps.queryFn = api.search;
2604
+ tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
2607
2605
  return tableProps;
2608
2606
  }
2609
2607
 
@@ -2692,7 +2690,8 @@ function TT({
2692
2690
  }),
2693
2691
  rowActions: rowActions,
2694
2692
  api: tableApi,
2695
- subtitle: subtitle
2693
+ subtitle: subtitle,
2694
+ queryParams: screen.queryParams
2696
2695
  }), jsx(TableDialogManager, {})]
2697
2696
  })]
2698
2697
  });
@@ -2737,9 +2736,10 @@ function TableWrapper({
2737
2736
  table,
2738
2737
  subtitle,
2739
2738
  rowActions,
2740
- api
2739
+ api,
2740
+ queryParams
2741
2741
  }) {
2742
- const tableProps = useTableProps(api, table, rowActions);
2742
+ const tableProps = useTableProps(api, table, rowActions, queryParams);
2743
2743
  const _subtitle = React.useMemo(() => {
2744
2744
  if (!subtitle) return undefined;
2745
2745
  return data => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -1,3 +1,3 @@
1
1
  import { API } from "@compill/admin-api";
2
2
  import { TableRowAction, TableViewTable } from "../types/TableView";
3
- export declare function useTableProps(api: API<any>, table: TableViewTable, rowActions?: TableRowAction[] | ((item?: any) => TableRowAction[])): any;
3
+ export declare function useTableProps(api: API<any>, table: TableViewTable, rowActions?: TableRowAction[] | ((item?: any) => TableRowAction[]), queryParams?: any): any;
@@ -20,6 +20,7 @@ export type TableViewScreen = {
20
20
  deleteItem?: TableViewDeleteItem | ((item: any) => TableViewDeleteItem);
21
21
  table: TableViewTable;
22
22
  rowActions?: TableRowAction[] | ((item: any) => TableRowAction[]);
23
+ queryParams?: any;
23
24
  };
24
25
  export type TableViewConfig = {
25
26
  type: "table";
@@ -33,7 +34,7 @@ export type CustomDialog = {
33
34
  render: (props: ModalProps) => React.ReactNode;
34
35
  };
35
36
  export type TableViewEditView = CustomDialog | EditItemDialogConfig | QueryWrapperDialogConfig<any>;
36
- export type TableViewTable = Omit<TableProps, "onRowClick" | "queryKey" | "queryFn"> & {
37
+ export type TableViewTable = Omit<TableProps, "onRowClick" | "queryKey" | "queryFn" | "queryFilters"> & {
37
38
  filtersMethod?: "internal" | "nextRouter" | "reactRouter";
38
39
  initialVisibleColumns?: string[];
39
40
  onRowClick?: {