tsv2-library 1.0.61-alpha.105 → 1.0.61-alpha.108

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tsv2-library",
3
3
  "author": "fixedassetv2-fe",
4
- "version": "1.0.61-alpha.105",
4
+ "version": "1.0.61-alpha.108",
5
5
  "license": "ISC",
6
6
  "homepage": "https://github.com/fixedassetv2-fe/tsv2-library#readme",
7
7
  "repository": {
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@googlemaps/js-api-loader": "^2.0.2",
42
+ "@googlemaps/markerclusterer": "^2.6.2",
42
43
  "@types/google.maps": "^3.58.1",
43
44
  "@types/lodash": "^4.17.7",
44
45
  "@vueuse/core": "^10.7.2",
@@ -151,6 +151,10 @@ export type TableColumn = {
151
151
  * Make the column cannot reordered by disabled dragability.
152
152
  */
153
153
  dragable?: boolean;
154
+ /**
155
+ * Whether the column is pinned to the left of the table.
156
+ */
157
+ pinned?: boolean;
154
158
  fixed?: boolean;
155
159
  visible?: boolean;
156
160
  /**
@@ -74,3 +74,22 @@ export interface MapFocusConfig {
74
74
  featureType: google.maps.FeatureType;
75
75
  featureStyleOptions: google.maps.FeatureStyleOptions;
76
76
  }
77
+
78
+ export interface DialogCoordinateProps {
79
+ value?: LatLngValue;
80
+ center?: [number, number];
81
+ zoom?: number;
82
+ mode?: InputMapMode;
83
+ colorScheme?: 'LIGHT' | 'DARK';
84
+ mapOptions?: google.maps.MapOptions;
85
+ customMarkers?: CustomMarker[];
86
+ inputMarkerConfig?: MarkerConfig;
87
+ type: 'input' | 'detail';
88
+ }
89
+
90
+ export interface CustomMarker {
91
+ lat: number;
92
+ lng: number;
93
+ title?: string;
94
+ desc?: string;
95
+ }
@@ -79,8 +79,11 @@ export type TSVueIcons =
79
79
  | 'image-add'
80
80
  | 'indeterminate-circle-fill'
81
81
  | 'info'
82
+ | 'layout-grid-line'
82
83
  | 'link-unlink-m'
83
84
  | 'list-settings-line'
85
+ | 'list-check'
86
+ | 'list-check-2'
84
87
  | 'loader-4'
85
88
  | 'logout-box-r-line'
86
89
  | 'mail-open-line'
@@ -99,6 +102,8 @@ export type TSVueIcons =
99
102
  | 'phone-line'
100
103
  | 'printer'
101
104
  | 'price-tag-3-line'
105
+ | 'pushpin-2-line'
106
+ | 'pushpin-fill'
102
107
  | 'qr'
103
108
  | 'qr-scan-line'
104
109
  | 'recycle-bin'
@@ -137,6 +137,7 @@ export default {
137
137
  // Position
138
138
  'absolute top-0 left-0',
139
139
  'mt-2',
140
+ '!z-[2222]',
140
141
 
141
142
  'max-w-[30vw]',
142
143
 
@@ -2,6 +2,8 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios';
2
2
  import {
3
3
  GetAllAssetsQueryParams,
4
4
  GetAssetDetailParams,
5
+ GetAssetMapParams,
6
+ GetAssetMapResponse,
5
7
  GetAvailableAssetsQueryParams,
6
8
  GetLinkedAssetFamiliesResponse,
7
9
  } from '@/dto/assets.dto';
@@ -11,17 +13,19 @@ import { buildBodyParams } from '@/utils';
11
13
  export interface ServiceOptions {
12
14
  headers?: Record<string, unknown>;
13
15
  params?: Record<string, unknown>;
16
+ usePrefix?: boolean;
14
17
  }
15
18
 
16
19
  export const API = ({
17
20
  headers = {},
18
21
  params = {},
22
+ usePrefix = true,
19
23
  }: ServiceOptions = {}): AxiosInstance => {
20
24
  const user = JSON.parse(localStorage.getItem('user') ?? '{}');
21
25
  const BASE_URL = import.meta.env.VITE_APP_TAGSAMURAI_API;
22
26
 
23
27
  const instance = axios.create({
24
- baseURL: `${BASE_URL}/assets/v2/assets`,
28
+ baseURL: `${BASE_URL}/assets/v2${usePrefix ? '/assets' : ''}`,
25
29
  headers: {
26
30
  'Content-type': 'application/json',
27
31
  'Authorization': `Bearer ${user.token}`,
@@ -33,6 +37,20 @@ export const API = ({
33
37
  return instance;
34
38
  };
35
39
 
40
+ const postAssetList = (
41
+ params?: GetAllAssetsQueryParams,
42
+ ): Promise<AxiosResponse> => {
43
+ const body = buildBodyParams(params);
44
+ return API().post('/list', body);
45
+ };
46
+
47
+ const postAssetOption = (
48
+ params?: GetAllAssetsQueryParams,
49
+ ): Promise<AxiosResponse> => {
50
+ const body = buildBodyParams(params);
51
+ return API().post('/list/options', body);
52
+ };
53
+
36
54
  const getAllAssets = (
37
55
  params: GetAllAssetsQueryParams,
38
56
  ): Promise<AxiosResponse> => {
@@ -104,8 +122,28 @@ const matchAssetWithTag = (
104
122
  return API({ params }).get('/by-id');
105
123
  };
106
124
 
125
+ const getAssetMaps = (
126
+ params?: GetAssetMapParams,
127
+ ): Promise<AxiosResponse<GetAssetMapResponse>> => {
128
+ let abortController: AbortController | null = null;
129
+
130
+ // Cancel previous request
131
+ if (abortController) {
132
+ (abortController as AbortController).abort();
133
+ }
134
+
135
+ abortController = new AbortController();
136
+
137
+ return API({
138
+ usePrefix: false,
139
+ params: params as Record<string, unknown>,
140
+ }).get('/asset-maps', { signal: abortController.signal });
141
+ };
142
+
107
143
  export default {
108
144
  getAllAssets,
145
+ postAssetList,
146
+ postAssetOption,
109
147
  getAvailableAssets,
110
148
  postAssetAvailableList,
111
149
  getAssetsById,
@@ -115,4 +153,5 @@ export default {
115
153
  getUnlinkedAssets,
116
154
  getOptions,
117
155
  scanAsset,
156
+ getAssetMaps,
118
157
  };