@omnitend/dashboard-for-laravel 0.33.0 → 0.33.1
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/components/extended/DXTable.vue.d.ts +22 -0
- package/dist/dashboard-for-laravel.js +968 -965
- package/dist/dashboard-for-laravel.js.map +1 -1
- package/dist/dashboard-for-laravel.umd.cjs +5 -5
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/docs/public/api-reference.json +8 -2
- package/docs/public/docs-map.md +1 -1
- package/package.json +1 -1
- package/resources/js/components/extended/DXTable.vue +49 -6
|
@@ -3,6 +3,25 @@ export interface FilterOption {
|
|
|
3
3
|
value: string;
|
|
4
4
|
text: string;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Adapts the built-in `apiUrl` provider's request/response to a backend whose
|
|
8
|
+
* convention differs from dfl's (spatie query-builder params, an envelope
|
|
9
|
+
* without the `{data, pagination}` shape). The sanctioned replacement for the
|
|
10
|
+
* axios-interceptor bridges #132 removed the route for: `request` maps the
|
|
11
|
+
* outgoing params (its return is what goes on the wire); `response` maps the
|
|
12
|
+
* body back, receiving the ORIGINAL dfl-shape params (`page`, `perPage`, …)
|
|
13
|
+
* so it can synthesize paginator metadata a foreign envelope lacks.
|
|
14
|
+
*/
|
|
15
|
+
export interface DXTableApiAdapter {
|
|
16
|
+
request?: (params: Record<string, any>) => Record<string, any>;
|
|
17
|
+
response?: (body: any, context: {
|
|
18
|
+
params: Record<string, any>;
|
|
19
|
+
}) => {
|
|
20
|
+
data: any[];
|
|
21
|
+
pagination?: PaginationData;
|
|
22
|
+
filterValues?: Record<string, string[]>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
6
25
|
export interface TableField {
|
|
7
26
|
key: string;
|
|
8
27
|
label?: string;
|
|
@@ -109,6 +128,9 @@ export interface Props<TItem = any> {
|
|
|
109
128
|
provider?: BTableProvider<TItem>;
|
|
110
129
|
/** API endpoint URL for auto-provider mode (alternative to provider function) */
|
|
111
130
|
apiUrl?: string;
|
|
131
|
+
/** Adapts the built-in provider's request params / response body to a
|
|
132
|
+
* backend convention that differs from dfl's (see DXTableApiAdapter). */
|
|
133
|
+
apiAdapter?: DXTableApiAdapter;
|
|
112
134
|
/** Table field definitions */
|
|
113
135
|
fields: TableField[];
|
|
114
136
|
/** Sort configuration (v-model support) */
|