tsv2-library 1.0.61-alpha.11 → 1.0.61-alpha.110
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/loading-0-1a7cddc8.js +4 -0
- package/dist/loading-1-892eee7c.js +4 -0
- package/dist/loading-2-bf39c889.js +4 -0
- package/dist/loading-3-f1ea4b15.js +4 -0
- package/dist/node_modules/@googlemaps/js-api-loader/src/deprecated.d.ts +7 -0
- package/dist/node_modules/@googlemaps/js-api-loader/src/index.d.ts +52 -0
- package/dist/node_modules/@googlemaps/js-api-loader/src/messages.d.ts +9 -0
- package/dist/src/build-entry.d.ts +4 -2830
- package/dist/src/components/v2/AssetInfo/AssetInfo.vue.d.ts +4 -4
- package/dist/src/components/v2/ButtonScan/ButtonScan.vue.d.ts +6 -0
- package/dist/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +7 -1
- package/dist/src/components/v2/DataTable/DataTable.vue.d.ts +13 -0
- package/dist/src/components/v2/DialogAssetNameDetail/DialogAssetNameDetail.vue.d.ts +3 -1
- package/dist/src/components/v2/DialogCoordinate/AssetList.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/AssetListFilter.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +95 -0
- package/dist/src/components/v2/DialogCoordinate/FullscreenToggle.vue.d.ts +4 -0
- package/dist/src/components/v2/DialogCoordinate/MapSearch.vue.d.ts +15 -0
- package/dist/src/components/v2/DialogCoordinate/services/googleMapsService.d.ts +10 -0
- package/dist/src/components/v2/DialogCoordinate/services/openStreetMapService.d.ts +59 -0
- package/dist/src/components/v2/DialogReportDamage/DialogReportDamage.vue.d.ts +8 -0
- package/dist/src/components/v2/DialogReportMissing/DialogReportMissing.vue.d.ts +17 -0
- package/dist/src/components/v2/DialogSelectAsset/DialogSelectAsset.vue.d.ts +13 -9
- package/dist/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +9 -1
- package/dist/src/components/v2/DisposalReport/DisposalReportTable.vue.d.ts +16 -0
- package/dist/src/components/v2/FileUpload/FileUpload.vue.d.ts +4 -0
- package/dist/src/components/v2/Form/Form.vue.d.ts +2 -0
- package/dist/src/components/v2/HardwareSync/HardwareSync.vue.d.ts +2 -2
- package/dist/src/components/v2/Icon/Icon.vue.d.ts +7 -0
- package/dist/src/components/v2/ImageCompressor/BackgroundImageCropper.vue.d.ts +1 -1
- package/dist/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +64 -0
- package/dist/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +5 -0
- package/dist/src/components/v2/InputCurrencyReference/InputCurrencyReference.vue.d.ts +30 -0
- package/dist/src/components/v2/InputText/InputText.vue.d.ts +6 -0
- package/dist/src/components/v2/LazyLoadTrigger/LazyLoadTrigger.vue.d.ts +4 -0
- package/dist/src/components/v2/Tree/Tree.vue.d.ts +4 -0
- package/dist/src/components/v2/index.d.ts +4 -1
- package/dist/src/dto/assets.dto.d.ts +16 -0
- package/dist/src/dto/missing.dto.d.ts +3 -0
- package/dist/src/dto/tagTransaction.dto.d.ts +9 -0
- package/dist/src/presets/multiselect/index.js +1 -0
- package/dist/src/presets/toast/index.js +1 -1
- package/dist/src/services/assets.service.d.ts +7 -2
- package/dist/src/services/deviceIOT.service.d.ts +1 -0
- package/dist/src/services/tagTransaction.service.d.ts +1 -1
- package/dist/src/services/tree.service.d.ts +1 -0
- package/dist/src/types/assets.type.d.ts +31 -11
- package/dist/src/utils/changelog.util.d.ts +69 -0
- package/dist/src/utils/createVueControl.d.ts +8 -0
- package/dist/src/utils/customMarker.util.d.ts +45 -0
- package/dist/src/utils/debounce.util.d.ts +1 -0
- package/dist/src/utils/exportToExcel.util.d.ts +1 -0
- package/dist/src/utils/getImageURL.util.d.ts +11 -2
- package/dist/src/utils/googleMapLoader.util.d.ts +1 -0
- package/dist/src/utils/index.d.ts +7 -3
- package/dist/src/utils/json.util.d.ts +17 -0
- package/dist/src/utils/request.util.d.ts +17 -0
- package/dist/src/utils/role.util.d.ts +19 -1
- package/dist/style.css +1 -1
- package/dist/tsv2-library.es.js +65335 -67105
- package/dist/tsv2-library.umd.js +47 -609
- package/package.json +6 -1
- package/src/components/v2/ButtonScan/ButtonScan.vue.d.ts +6 -0
- package/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +7 -1
- package/src/components/v2/DataTable/DataTable.vue.d.ts +13 -0
- package/src/components/v2/DialogAssetNameDetail/DialogAssetNameDetail.vue.d.ts +3 -1
- package/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +95 -0
- package/src/components/v2/DialogSelectAsset/DialogSelectAsset.vue.d.ts +13 -9
- package/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +9 -1
- package/src/components/v2/FileUpload/FileUpload.vue.d.ts +4 -0
- package/src/components/v2/Form/Form.vue.d.ts +2 -0
- package/src/components/v2/Icon/Icon.vue.d.ts +7 -0
- package/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +64 -0
- package/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +5 -0
- package/src/components/v2/InputCurrencyReference/InputCurrencyReference.vue.d.ts +30 -0
- package/src/components/v2/InputText/InputText.vue.d.ts +6 -0
- package/src/components/v2/Tree/Tree.vue.d.ts +4 -0
- package/src/presets/multiselect/index.js +1 -0
- package/src/presets/toast/index.js +1 -1
- package/src/services/assets.service.ts +49 -1
- package/src/services/deviceIOT.service.ts +8 -0
- package/src/services/tagTransaction.service.ts +2 -2
- package/src/services/tracking.service.ts +1 -1
- package/src/services/tree.service.ts +1 -0
- package/dist/loading-0-7762a473.js +0 -4
- package/dist/loading-1-55418796.js +0 -4
- package/dist/loading-2-b6abf641.js +0 -4
- package/dist/loading-3-705786b6.js +0 -4
|
@@ -95,6 +95,10 @@ export interface TreeProps {
|
|
|
95
95
|
* Disable node 'All' selection
|
|
96
96
|
*/
|
|
97
97
|
disableNodeAll?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Disable level 2 (All > Level 1 > Level 2)
|
|
100
|
+
*/
|
|
101
|
+
disableSubChildren?: boolean;
|
|
98
102
|
/**
|
|
99
103
|
* Include node All key (-1) on Checkbox Selection
|
|
100
104
|
*
|
|
@@ -36,6 +36,7 @@ import TSDialog from './Dialog/Dialog.vue';
|
|
|
36
36
|
import TSDialogApprovalList from './DialogApprovalList/DialogApprovalList.vue';
|
|
37
37
|
import TSDialogAssetNameDetail from './DialogAssetNameDetail/DialogAssetNameDetail.vue';
|
|
38
38
|
import TSDialogConfirm from './DialogConfirm/DialogConfirm.vue';
|
|
39
|
+
import TSDialogCoordinate from './DialogCoordinate/DialogCoordinate.vue';
|
|
39
40
|
import TSDialogForm from './DialogForm/DialogForm.vue';
|
|
40
41
|
import TSDialogLinkedAsset from './DialogLinkedAsset/DialogLinkedAsset.vue';
|
|
41
42
|
import TSDialogPrintQR from './DialogPrintQR/DialogPrintQR.vue';
|
|
@@ -54,6 +55,8 @@ import TSImageCompressor from './ImageCompressor/ImageCompressor.vue';
|
|
|
54
55
|
import TSInlineMessage from './InlineMessage/InlineMessage.vue';
|
|
55
56
|
import TSInputBadge from './InputBadge/InputBadge.vue';
|
|
56
57
|
import TSInputCurrency from './InputCurrency/InputCurrency.vue';
|
|
58
|
+
import TSInputCurrencyReference from './InputCurrencyReference/InputCurrencyReference.vue';
|
|
59
|
+
import TSInputCoordinate from './InputCoordinate/InputCoordinate.vue';
|
|
57
60
|
import TSInputEmail from './InputEmail/InputEmail.vue';
|
|
58
61
|
import TSInputNumber from './InputNumber/InputNumber.vue';
|
|
59
62
|
import TSInputOTP from './InputOTP/InputOTP.vue';
|
|
@@ -81,4 +84,4 @@ import TSTree from './Tree/Tree.vue';
|
|
|
81
84
|
import TSTreeSearchInput from './TreeSearchInput/TreeSearchInput.vue';
|
|
82
85
|
import TSUserWithIcon from './UserWithIcon/UserWithIcon.vue';
|
|
83
86
|
import TSValidatorMessage from './ValidatorMessage/ValidatorMessage.vue';
|
|
84
|
-
export { DialogTransferLog, DialogDamageLog, DialogMissingLog, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDataTable, TSDatePicker, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputSearch, TSInputText, TSInputTextArea, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, };
|
|
87
|
+
export { DialogTransferLog, DialogDamageLog, DialogMissingLog, TSAssetInfo, TSApproverInfo, TSBadge, TSBadgeGroup, TSBreadcrumb, TSButton, TSButtonAddByScan, TSButtonBulkAction, TSButtonCopy, TSButtonDownload, TSButtonFilter, TSButtonLogHistory, TSButtonRadio, TSButtonViewLog, TSButtonScan, TSButtonSearch, TSButtonSearchByScan, TSButtonSelectTree, TSButtonSelectUser, TSButtonSync, TSButtonToggle, TSCalendar, TSCard, TSCarousel, TSCheckbox, TSCustomColumn, TSDataTable, TSDatePicker, TSDayPicker, TSDialog, TSDialogApprovalList, TSDialogAssetNameDetail, TSDialogConfirm, TSDialogCoordinate, TSDialogForm, TSDialogLinkedAsset, TSDialogPrintQR, TSDialogReportDamage, TSDialogReportMissing, TSDialogReportTag, TSDialogSelectTree, TSDialogSelectAsset, TSDialogSelectUser, TSDisposalReport, TSDropdown, TSFilterContainer, TSFileUpload, TSForm, TSIcon, TSImage, TSImageCompressor, TSInlineMessage, TSInputBadge, TSInputCurrency, TSInputCurrencyReference, TSInputCoordinate, TSInputEmail, TSInputNumber, TSInputOTP, TSInputPassword, TSInputPhoneNumber, TSInputRangeNumber, TSInputSearch, TSInputText, TSInputTextArea, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetMap } from '../types/assets.type';
|
|
1
2
|
import { DataTableParams } from '../types/dataTable.type';
|
|
2
3
|
import { DialogSelectAssetFilterModels } from '../components/v2/DialogSelectAsset/DialogSelectAsset.vue.d';
|
|
3
4
|
export type DialogSelectAssetFilterQueryParams = Partial<Record<keyof DialogSelectAssetFilterModels, string>>;
|
|
@@ -6,6 +7,8 @@ export type GetAllAssetsQueryParams = DataTableParams & DialogSelectAssetFilterQ
|
|
|
6
7
|
search?: string;
|
|
7
8
|
excludeId?: string;
|
|
8
9
|
tag?: string;
|
|
10
|
+
maintenanceAuditStatus?: string[];
|
|
11
|
+
coordinate?: boolean;
|
|
9
12
|
};
|
|
10
13
|
export type GetAvailableAssetsQueryParams = DataTableParams & DialogSelectAssetFilterQueryParams & {
|
|
11
14
|
search?: string;
|
|
@@ -13,6 +16,7 @@ export type GetAvailableAssetsQueryParams = DataTableParams & DialogSelectAssetF
|
|
|
13
16
|
tag?: string;
|
|
14
17
|
mode?: string;
|
|
15
18
|
asset?: string;
|
|
19
|
+
maintenanceAuditStatus?: string[];
|
|
16
20
|
};
|
|
17
21
|
export type GetAssetDetailParams = DataTableParams & {
|
|
18
22
|
tag?: string;
|
|
@@ -22,6 +26,18 @@ export interface GetLinkedAssetFamiliesResponse {
|
|
|
22
26
|
message: string;
|
|
23
27
|
data: Datum[];
|
|
24
28
|
}
|
|
29
|
+
export interface GetAssetMapResponse {
|
|
30
|
+
status: number;
|
|
31
|
+
message: string;
|
|
32
|
+
data: AssetMap[];
|
|
33
|
+
}
|
|
34
|
+
export interface GetAssetMapParams {
|
|
35
|
+
east?: number;
|
|
36
|
+
west?: number;
|
|
37
|
+
north?: number;
|
|
38
|
+
south?: number;
|
|
39
|
+
search?: string;
|
|
40
|
+
}
|
|
25
41
|
interface Datum {
|
|
26
42
|
_id: string;
|
|
27
43
|
parent: Parent;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import { GetAllAssetsQueryParams, GetAssetDetailParams, GetAvailableAssetsQueryParams, GetLinkedAssetFamiliesResponse } from '../dto/assets.dto';
|
|
2
|
+
import { GetAllAssetsQueryParams, GetAssetDetailParams, GetAssetMapParams, GetAssetMapResponse, GetAvailableAssetsQueryParams, GetLinkedAssetFamiliesResponse } from '../dto/assets.dto';
|
|
3
3
|
import { AssetOptionField } from '../components/v2/DialogSelectAsset/DialogSelectAsset.vue.d';
|
|
4
4
|
export interface ServiceOptions {
|
|
5
5
|
headers?: Record<string, unknown>;
|
|
6
6
|
params?: Record<string, unknown>;
|
|
7
|
+
usePrefix?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const API: ({ headers, params, }?: ServiceOptions) => AxiosInstance;
|
|
9
|
+
export declare const API: ({ headers, params, usePrefix, }?: ServiceOptions) => AxiosInstance;
|
|
9
10
|
declare const _default: {
|
|
10
11
|
getAllAssets: (params: GetAllAssetsQueryParams) => Promise<AxiosResponse<any, any>>;
|
|
12
|
+
postAssetList: (params?: GetAllAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any>>;
|
|
13
|
+
postAssetOption: (params?: GetAllAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any>>;
|
|
11
14
|
getAvailableAssets: (params: GetAvailableAssetsQueryParams) => Promise<AxiosResponse<any, any>>;
|
|
15
|
+
postAssetAvailableList: (params?: GetAllAssetsQueryParams | GetAvailableAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any>>;
|
|
12
16
|
getAssetsById: (_id: string, params: GetAvailableAssetsQueryParams) => Promise<AxiosResponse<any, any>>;
|
|
13
17
|
getAssetDetail: (id: string, params?: GetAssetDetailParams | undefined) => Promise<AxiosResponse<any, any>>;
|
|
14
18
|
matchAssetWithTag: (id: string, tag?: string | undefined) => Promise<AxiosResponse<any, any>>;
|
|
@@ -20,5 +24,6 @@ declare const _default: {
|
|
|
20
24
|
mode?: string | undefined;
|
|
21
25
|
}) | undefined) => Promise<AxiosResponse<any, any>>;
|
|
22
26
|
scanAsset: (tag: string) => Promise<AxiosResponse<any, any>>;
|
|
27
|
+
getAssetMaps: (params?: GetAssetMapParams | undefined) => Promise<AxiosResponse<GetAssetMapResponse, any>>;
|
|
23
28
|
};
|
|
24
29
|
export default _default;
|
|
@@ -6,6 +6,6 @@ export interface ServiceOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const API: ({ headers, params, }?: ServiceOptions) => AxiosInstance;
|
|
8
8
|
declare const _default: {
|
|
9
|
-
reportTag: (
|
|
9
|
+
reportTag: (body: ReportTagBody) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -19,6 +19,7 @@ export interface TreeQueryParams {
|
|
|
19
19
|
systemRole?: string;
|
|
20
20
|
transactionAttribute?: string;
|
|
21
21
|
roleType?: string;
|
|
22
|
+
showAll?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export declare const API: ({ type, headers, params, }?: ServiceOptions) => AxiosInstance;
|
|
24
25
|
declare const TreeServices: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CurrencyValue } from '../components/v2/InputCurrency/InputCurrency.vue.d';
|
|
1
2
|
import { LinkedAsset } from '../components/v2/DialogLinkedAsset/DialogLinkedAsset.vue.d';
|
|
2
3
|
export type AssetFieldObject = {
|
|
3
4
|
_id?: string;
|
|
@@ -44,6 +45,7 @@ export type Asset = {
|
|
|
44
45
|
assetBrand?: AssetFieldObject;
|
|
45
46
|
assetModel?: AssetFieldObject;
|
|
46
47
|
assetTagType?: string;
|
|
48
|
+
assetValue?: CurrencyValue;
|
|
47
49
|
assignedTo?: string;
|
|
48
50
|
isTransactionable?: boolean;
|
|
49
51
|
addOn?: {
|
|
@@ -60,16 +62,34 @@ export type Asset = {
|
|
|
60
62
|
};
|
|
61
63
|
lastModifier?: string;
|
|
62
64
|
updatedAt?: string;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
secondImageBig?: string;
|
|
71
|
-
assetImageSmall?: string;
|
|
72
|
-
assetImageMedium?: string;
|
|
73
|
-
assetImageBig?: string;
|
|
65
|
+
tagReported: {
|
|
66
|
+
rfid?: string;
|
|
67
|
+
qr?: string;
|
|
68
|
+
};
|
|
69
|
+
firstImage?: string;
|
|
70
|
+
secondImage?: string;
|
|
71
|
+
assetImage?: string;
|
|
74
72
|
setDefault?: 'firstImage' | 'secondImage';
|
|
73
|
+
auditStatus?: string;
|
|
74
|
+
maintenanceStatus?: string;
|
|
75
|
+
transactions?: TransactionPolicyType;
|
|
76
|
+
formattedAssetValue?: string;
|
|
77
|
+
address?: string;
|
|
78
|
+
latitude: number | null;
|
|
79
|
+
longitude: number | null;
|
|
80
|
+
};
|
|
81
|
+
export type TransactionPolicyType = {
|
|
82
|
+
borrowing: boolean;
|
|
83
|
+
assignment: boolean;
|
|
84
|
+
transfer: boolean;
|
|
85
|
+
disposal: boolean;
|
|
86
|
+
maintenance: boolean;
|
|
87
|
+
audit: boolean;
|
|
88
|
+
repairTicketing: boolean;
|
|
89
|
+
tracking: boolean;
|
|
75
90
|
};
|
|
91
|
+
export interface AssetMap {
|
|
92
|
+
_id: string;
|
|
93
|
+
latitude: number;
|
|
94
|
+
longitude: number;
|
|
95
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FetchResponse } from '../components/v2/DataTable/DataTable.vue.d';
|
|
2
|
+
/**
|
|
3
|
+
* Format the response data from the API to display in the changelog table.
|
|
4
|
+
* This function formats the date and currency fields in the response data.
|
|
5
|
+
* It also formats the datetime fields if the field value is a valid ISO datetime string.
|
|
6
|
+
* @param {object} data - The response data from the API.
|
|
7
|
+
* @param {ChangelogObject} object - The changelog object.
|
|
8
|
+
* @returns {FetchResponse} - The formatted response data.
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatLogResponseData: (data: {
|
|
11
|
+
data: {
|
|
12
|
+
data: Record<string, unknown>[];
|
|
13
|
+
totalRecords?: number | undefined;
|
|
14
|
+
};
|
|
15
|
+
}) => FetchResponse;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a given value is a valid ISO datetime string.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} [value] - The value to be checked.
|
|
20
|
+
* @returns {boolean} - `true` if the value is a valid ISO datetime string, `false` otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isValidDateISOString: (value?: string) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Safely parse a JSON string into an object of type T.
|
|
25
|
+
* If the input is not a string or is not a valid JSON string, return null.
|
|
26
|
+
* If the parsing fails, return null.
|
|
27
|
+
* @template T
|
|
28
|
+
* @param {unknown} value - The value to parse.
|
|
29
|
+
* @returns {T | null}
|
|
30
|
+
*/
|
|
31
|
+
export declare const safeJsonParse: <T = string>(value?: unknown) => T | null;
|
|
32
|
+
/**
|
|
33
|
+
* Formats a date value from a string into a human-readable format.
|
|
34
|
+
* If the input is not a valid ISO datetime string, returns the original value.
|
|
35
|
+
* If the input is a valid ISO datetime string, returns a formatted date string.
|
|
36
|
+
* If the withTime parameter is true, includes the time in the formatted date string.
|
|
37
|
+
* @param {string} [value] - The date value to format.
|
|
38
|
+
* @param {boolean} [withTime] - Whether to include the time in the formatted date string.
|
|
39
|
+
* @returns {string | unknown} - The formatted date string, or the original value if the input is not a valid ISO datetime string.
|
|
40
|
+
*/
|
|
41
|
+
export declare const formatDateValue: (value?: string, withTime?: boolean) => string | unknown;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a given value is a valid JSON string that contains the 'dataType' key.
|
|
44
|
+
* @param {unknown} [value] - The value to be checked.
|
|
45
|
+
* @returns {boolean} - `true` if the value is a valid JSON string that contains the 'dataType' key, `false` otherwise.
|
|
46
|
+
*/
|
|
47
|
+
export declare const hasDataType: (value?: unknown) => boolean;
|
|
48
|
+
export declare const isCurrency: (value?: unknown) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Formats the 'newValue' and 'oldValue' properties of a given object from ISO datetime strings into human-readable formats.
|
|
51
|
+
* If the input values are not valid ISO datetime strings, they are left unchanged.
|
|
52
|
+
* The formatted date strings will include the time.
|
|
53
|
+
* @param {Record<string, unknown>} d - The object with 'newValue' and 'oldValue' properties to format.
|
|
54
|
+
*/
|
|
55
|
+
export declare const formatDateTimeField: (d: Record<string, unknown>) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Formats the 'newValue' and 'oldValue' properties of a given object from JSON strings containing ISO datetime strings into human-readable formats.
|
|
58
|
+
* If the input values are not valid JSON strings or do not contain the 'value' key, they are left unchanged.
|
|
59
|
+
* The formatted date strings will include the time.
|
|
60
|
+
* @param {Record<string, unknown>} d - The object with 'newValue' and 'oldValue' properties to format.
|
|
61
|
+
*/
|
|
62
|
+
export declare const formatDateFieldFromJson: (d: Record<string, unknown>) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Formats a given value from a JSON string containing a 'currency' and 'value' key into a human-readable currency string.
|
|
65
|
+
* If the input value is not a valid JSON string or does not contain the 'currency' key, it is left unchanged.
|
|
66
|
+
* @param {unknown} value - The value to be formatted.
|
|
67
|
+
* @returns {unknown} - The formatted value if it is a valid JSON string containing the 'currency' key, the original value otherwise.
|
|
68
|
+
*/
|
|
69
|
+
export declare const formatCurrencyField: (value: unknown) => unknown;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export declare const createVueControl: (component: Component, options?: {
|
|
3
|
+
props?: Record<string, unknown> | undefined;
|
|
4
|
+
emits?: Record<string, (...args: unknown[]) => void> | undefined;
|
|
5
|
+
} | undefined) => {
|
|
6
|
+
el: HTMLDivElement;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type MarkerConfig = {
|
|
2
|
+
kind: 'pin';
|
|
3
|
+
pinOptions?: google.maps.marker.PinElementOptions;
|
|
4
|
+
title?: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'img';
|
|
7
|
+
src: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'svgString';
|
|
11
|
+
svg: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'customElement';
|
|
15
|
+
createElement: () => HTMLElement;
|
|
16
|
+
title?: string;
|
|
17
|
+
};
|
|
18
|
+
export interface MapControl {
|
|
19
|
+
position?: google.maps.ControlPosition;
|
|
20
|
+
index?: number;
|
|
21
|
+
createElement: (ctx: {
|
|
22
|
+
map: google.maps.Map;
|
|
23
|
+
}) => HTMLElement;
|
|
24
|
+
}
|
|
25
|
+
export interface MapFocusConfig {
|
|
26
|
+
name: string;
|
|
27
|
+
featureType: google.maps.FeatureType;
|
|
28
|
+
featureStyleOptions: google.maps.FeatureStyleOptions;
|
|
29
|
+
}
|
|
30
|
+
export interface CustomMarkerOptions {
|
|
31
|
+
position: {
|
|
32
|
+
lat: number;
|
|
33
|
+
lng: number;
|
|
34
|
+
};
|
|
35
|
+
marker?: MarkerConfig;
|
|
36
|
+
title?: string;
|
|
37
|
+
popup?: string;
|
|
38
|
+
hoverable?: boolean;
|
|
39
|
+
draggable?: boolean;
|
|
40
|
+
clickable?: boolean;
|
|
41
|
+
onClick?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
|
|
42
|
+
onDragEnd?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
|
|
43
|
+
onHover?: (marker: google.maps.marker.AdvancedMarkerElement, isHovering: boolean) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare const createMarker: (options: CustomMarkerOptions) => Promise<google.maps.marker.AdvancedMarkerElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const debounce: <T extends (...args: any[]) => void>(fn: T, delay?: number) => (...args: Parameters<T>) => void;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
1
|
+
export declare const buildFileURL: (name?: string, width?: number, height?: number) => string;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param name The full URL, or the file token as it appears on the server
|
|
5
|
+
* @param fileName Custom File name
|
|
6
|
+
* @param immediateRevoke Immediately revoke the object URL after download - default to true
|
|
7
|
+
* @param viewNewTab View the file in a new tab - default to false
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const downloadFile: (name: string, customFileName?: string, immediateRevoke?: boolean, viewNewTab?: boolean) => Promise<string>;
|
|
11
|
+
export declare const getImageURL: (name?: string | null, width?: number, height?: number, returnURLOnly?: boolean) => Promise<string | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const googleMapLoader: () => Promise<void>;
|
|
@@ -3,8 +3,8 @@ import handleTokenExpiration from './handleTokenExpiration.util';
|
|
|
3
3
|
import exportToExcel from './exportToExcel.util';
|
|
4
4
|
import { formatGoDate, formatDate, formatDateReadable, getUserLocale } from './date.util';
|
|
5
5
|
import useToast from './toast.util';
|
|
6
|
-
import getImageURL from './getImageURL.util';
|
|
7
|
-
import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasAnyMonitoringReportRole, hasMonitoringReportRole, hasStaffRole } from './role.util';
|
|
6
|
+
import { getImageURL, downloadFile } from './getImageURL.util';
|
|
7
|
+
import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasAnyMonitoringReportRole, hasMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail } from './role.util';
|
|
8
8
|
import { getCurrency, formatCurrency } from './currency.util';
|
|
9
9
|
import { unListenSidebarChanges, listenSidebarChanges } from './listenSidebarChanges.util';
|
|
10
10
|
import { getBaseURL, getHostName } from './getBaseURL.util';
|
|
@@ -13,6 +13,10 @@ import { getSeverityByAssetStatus } from './getSeverityByAssetStatus.util';
|
|
|
13
13
|
import clearStorage from './clearStorage.util';
|
|
14
14
|
import forceLogout from './forceLogout.util';
|
|
15
15
|
import reLogin from './reLogin.util';
|
|
16
|
+
import { isValidJSONString } from './json.util';
|
|
17
|
+
import { buildBodyParams } from './request.util';
|
|
18
|
+
import { formatLogResponseData } from './changelog.util';
|
|
19
|
+
import { googleMapLoader } from './googleMapLoader.util';
|
|
16
20
|
declare const isObjectEmpty: (object: object) => boolean;
|
|
17
21
|
declare const getNestedProperyValue: (object: object, property: string) => string | boolean | number | object;
|
|
18
|
-
export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, formatUserName, formatVowelSoundLabel, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
|
|
22
|
+
export { isObjectEmpty, getNestedProperyValue, handleTokenExpiration, getImageURL, downloadFile, formatUserName, formatVowelSoundLabel, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getBaseURL, getHostName, useI18n, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, formatLogResponseData, googleMapLoader, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given value is a valid JSON string that represents an object or array.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The value to be checked
|
|
5
|
+
* @returns `true` if the value is a non-empty string that can be parsed into a valid JSON object or array,
|
|
6
|
+
* `false` otherwise
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* isValidJSONString('{"name": "John"}') // returns true
|
|
11
|
+
* isValidJSONString('[1, 2, 3]') // returns true
|
|
12
|
+
* isValidJSONString('123') // returns false (not an object/array)
|
|
13
|
+
* isValidJSONString('invalid json') // returns false
|
|
14
|
+
* isValidJSONString(null) // returns false
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const isValidJSONString: (value: unknown) => boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds and transforms body parameters by parsing JSON strings if valid.
|
|
3
|
+
* @param params - Optional record of key-value pairs where values can be of any type
|
|
4
|
+
* @returns A new record with the same keys but JSON strings parsed into objects
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // With JSON string value
|
|
9
|
+
* buildBodyParams({ data: '{"foo": "bar"}' })
|
|
10
|
+
* // Returns: { data: { foo: "bar" } }
|
|
11
|
+
*
|
|
12
|
+
* // With non-JSON value
|
|
13
|
+
* buildBodyParams({ data: "plain string" })
|
|
14
|
+
* // Returns: { data: "plain string" }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildBodyParams: (params?: Record<string, unknown>) => Record<string, unknown>;
|
|
@@ -28,5 +28,23 @@ declare const hasAnyMonitoringReportRole: () => boolean;
|
|
|
28
28
|
declare const hasStaffRole: (name: TransactionAttribute) => boolean;
|
|
29
29
|
declare const hasMonitoringReportRole: (name: TransactionAttribute) => boolean;
|
|
30
30
|
declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Vue Router navigation guard that checks user access based on the route's metadata
|
|
33
|
+
* and the user's type retrieved from local storage.
|
|
34
|
+
*
|
|
35
|
+
* Access is granted if:
|
|
36
|
+
* 1. The user is currently logging out (flag checked by `checkLogoutFlag`).
|
|
37
|
+
* 2. The route's `meta.hasAccess` is true AND the user is an 'Admin'.
|
|
38
|
+
* 3. The route's `meta.hasAccess` is true AND the route is a special exemption path
|
|
39
|
+
* ('handover-confirmation' or 'my-profile').
|
|
40
|
+
*
|
|
41
|
+
* If access is denied, navigation is redirected to '/not-found'.
|
|
42
|
+
*
|
|
43
|
+
* @param {RouteLocationNormalized} to - The target route location object.
|
|
44
|
+
* @param {RouteLocationNormalized} from - The current route location object.
|
|
45
|
+
* @param {NavigationGuardNext} next - The function to call to resolve the hook.
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
31
48
|
declare const checkRouteAccess: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => void;
|
|
32
|
-
|
|
49
|
+
declare const hasAccessToAssetDetail: () => boolean;
|
|
50
|
+
export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
|