@compill/admin 1.0.87 → 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
@@ -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,7 +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.queryFn = api.search;
|
2614
|
+
tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
|
2615
2615
|
return tableProps;
|
2616
2616
|
}
|
2617
2617
|
|
@@ -2700,7 +2700,8 @@ function TT({
|
|
2700
2700
|
}),
|
2701
2701
|
rowActions: rowActions,
|
2702
2702
|
api: tableApi,
|
2703
|
-
subtitle: subtitle
|
2703
|
+
subtitle: subtitle,
|
2704
|
+
queryParams: screen.queryParams
|
2704
2705
|
}), jsxRuntime.jsx(TableDialogManager, {})]
|
2705
2706
|
})]
|
2706
2707
|
});
|
@@ -2745,9 +2746,10 @@ function TableWrapper({
|
|
2745
2746
|
table: table$1,
|
2746
2747
|
subtitle,
|
2747
2748
|
rowActions,
|
2748
|
-
api
|
2749
|
+
api,
|
2750
|
+
queryParams
|
2749
2751
|
}) {
|
2750
|
-
const tableProps = useTableProps(api, table$1, rowActions);
|
2752
|
+
const tableProps = useTableProps(api, table$1, rowActions, queryParams);
|
2751
2753
|
const _subtitle = React__default["default"].useMemo(() => {
|
2752
2754
|
if (!subtitle) return undefined;
|
2753
2755
|
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,7 +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.queryFn = api.search;
|
2604
|
+
tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
|
2605
2605
|
return tableProps;
|
2606
2606
|
}
|
2607
2607
|
|
@@ -2690,7 +2690,8 @@ function TT({
|
|
2690
2690
|
}),
|
2691
2691
|
rowActions: rowActions,
|
2692
2692
|
api: tableApi,
|
2693
|
-
subtitle: subtitle
|
2693
|
+
subtitle: subtitle,
|
2694
|
+
queryParams: screen.queryParams
|
2694
2695
|
}), jsx(TableDialogManager, {})]
|
2695
2696
|
})]
|
2696
2697
|
});
|
@@ -2735,9 +2736,10 @@ function TableWrapper({
|
|
2735
2736
|
table,
|
2736
2737
|
subtitle,
|
2737
2738
|
rowActions,
|
2738
|
-
api
|
2739
|
+
api,
|
2740
|
+
queryParams
|
2739
2741
|
}) {
|
2740
|
-
const tableProps = useTableProps(api, table, rowActions);
|
2742
|
+
const tableProps = useTableProps(api, table, rowActions, queryParams);
|
2741
2743
|
const _subtitle = React.useMemo(() => {
|
2742
2744
|
if (!subtitle) return undefined;
|
2743
2745
|
return data => {
|
package/package.json
CHANGED
@@ -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?: {
|