@compill/admin 1.0.87 → 1.0.89

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
@@ -2555,7 +2555,7 @@ const schemes$1 = {
2555
2555
  "custom": "dark"
2556
2556
  };
2557
2557
 
2558
- function useTableProps(api, table, rowActions) {
2558
+ function useTableProps(api, table, rowActions, queryParams) {
2559
2559
  const navigate = reactRouterDom.useNavigate();
2560
2560
  const nextRouter = router.useRouter();
2561
2561
  const openLink = hooks.useOpenLink();
@@ -2611,6 +2611,7 @@ function useTableProps(api, table, rowActions) {
2611
2611
  tableProps.columns = columns;
2612
2612
  tableProps.onRowClick = onRowClickHandler;
2613
2613
  tableProps.queryKey = api.queryKey;
2614
+ tableProps.queryFilters = queryParams;
2614
2615
  tableProps.queryFn = api.search;
2615
2616
  return tableProps;
2616
2617
  }
@@ -2700,7 +2701,8 @@ function TT({
2700
2701
  }),
2701
2702
  rowActions: rowActions,
2702
2703
  api: tableApi,
2703
- subtitle: subtitle
2704
+ subtitle: subtitle,
2705
+ queryParams: screen.queryParams
2704
2706
  }), jsxRuntime.jsx(TableDialogManager, {})]
2705
2707
  })]
2706
2708
  });
@@ -2745,9 +2747,10 @@ function TableWrapper({
2745
2747
  table: table$1,
2746
2748
  subtitle,
2747
2749
  rowActions,
2748
- api
2750
+ api,
2751
+ queryParams
2749
2752
  }) {
2750
- const tableProps = useTableProps(api, table$1, rowActions);
2753
+ const tableProps = useTableProps(api, table$1, rowActions, queryParams);
2751
2754
  const _subtitle = React__default["default"].useMemo(() => {
2752
2755
  if (!subtitle) return undefined;
2753
2756
  return data => {
package/index.esm.js CHANGED
@@ -2545,7 +2545,7 @@ const schemes$1 = {
2545
2545
  "custom": "dark"
2546
2546
  };
2547
2547
 
2548
- function useTableProps(api, table, rowActions) {
2548
+ function useTableProps(api, table, rowActions, queryParams) {
2549
2549
  const navigate = useNavigate();
2550
2550
  const nextRouter = useRouter();
2551
2551
  const openLink = useOpenLink();
@@ -2601,6 +2601,7 @@ function useTableProps(api, table, rowActions) {
2601
2601
  tableProps.columns = columns;
2602
2602
  tableProps.onRowClick = onRowClickHandler;
2603
2603
  tableProps.queryKey = api.queryKey;
2604
+ tableProps.queryFilters = queryParams;
2604
2605
  tableProps.queryFn = api.search;
2605
2606
  return tableProps;
2606
2607
  }
@@ -2690,7 +2691,8 @@ function TT({
2690
2691
  }),
2691
2692
  rowActions: rowActions,
2692
2693
  api: tableApi,
2693
- subtitle: subtitle
2694
+ subtitle: subtitle,
2695
+ queryParams: screen.queryParams
2694
2696
  }), jsx(TableDialogManager, {})]
2695
2697
  })]
2696
2698
  });
@@ -2735,9 +2737,10 @@ function TableWrapper({
2735
2737
  table,
2736
2738
  subtitle,
2737
2739
  rowActions,
2738
- api
2740
+ api,
2741
+ queryParams
2739
2742
  }) {
2740
- const tableProps = useTableProps(api, table, rowActions);
2743
+ const tableProps = useTableProps(api, table, rowActions, queryParams);
2741
2744
  const _subtitle = React.useMemo(() => {
2742
2745
  if (!subtitle) return undefined;
2743
2746
  return data => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.87",
3
+ "version": "1.0.89",
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?: {