tsv2-library 1.0.61-alpha.120 → 1.0.61-alpha.121
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/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +7 -0
- package/dist/src/services/column.service.d.ts +13 -0
- package/dist/tsv2-library.es.js +169 -201
- package/dist/tsv2-library.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +7 -0
- package/src/services/column.service.ts +37 -0
- package/dist/src/components/v2/DataTable/store/dataTable.store.d.ts +0 -22
package/package.json
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ClassComponent } from '../ts-helpers';
|
|
2
2
|
|
|
3
|
+
export interface DataTableColumnConfig {
|
|
4
|
+
field: string;
|
|
5
|
+
pinned: boolean;
|
|
6
|
+
width: number | string;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
export interface CustomColumnProps {
|
|
4
11
|
tableId: string;
|
|
5
12
|
tableKey: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DataTableColumnConfig } from '@/components/v2/CustomColumn/CustomColumn.vue.d';
|
|
2
|
+
import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
const user = JSON.parse(localStorage.getItem('user') ?? '{}');
|
|
5
|
+
|
|
6
|
+
export const API = ({ headers = {}, params = {} } = {}): AxiosInstance => {
|
|
7
|
+
const BASE_URL = import.meta.env.DEV_APP_GLOBAL_SETTINGS_API;
|
|
8
|
+
|
|
9
|
+
const instance = axios.create({
|
|
10
|
+
baseURL: `${BASE_URL}/v1/global-settings`,
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-type': 'application/json',
|
|
13
|
+
'Authorization': `Bearer ${user.token}`,
|
|
14
|
+
...headers,
|
|
15
|
+
},
|
|
16
|
+
params,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return instance;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ColumnServices = {
|
|
23
|
+
getColumnSetup: (
|
|
24
|
+
tableId: string,
|
|
25
|
+
): Promise<AxiosResponse<{ data: DataTableColumnConfig[] }>> => {
|
|
26
|
+
return API().get(`/columns/${user._id}/${tableId}`);
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
editColumnSetup: (
|
|
30
|
+
tableId: string,
|
|
31
|
+
body: DataTableColumnConfig[],
|
|
32
|
+
): Promise<AxiosResponse> => {
|
|
33
|
+
return API().put(`/columns/${user._id}/${tableId}`, { data: body });
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default ColumnServices;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface DataTableStore {
|
|
2
|
-
/**
|
|
3
|
-
* Get the config object from the store.
|
|
4
|
-
*/
|
|
5
|
-
config: DataTableConfig;
|
|
6
|
-
/**
|
|
7
|
-
* Update config for specific Table.
|
|
8
|
-
*
|
|
9
|
-
* @param id The table ID
|
|
10
|
-
* @param columnsConfig The columns configuration
|
|
11
|
-
*/
|
|
12
|
-
setConfig: (id: string, columnsConfig: DataTableColumnConfig[]) => Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export type DataTableConfig = Record<string, DataTableColumnConfig[]>;
|
|
15
|
-
export interface DataTableColumnConfig {
|
|
16
|
-
field: string;
|
|
17
|
-
width: number | string;
|
|
18
|
-
fixed: boolean;
|
|
19
|
-
visible: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare const useDataTableStore: () => Promise<DataTableStore>;
|
|
22
|
-
export default useDataTableStore;
|