tsv2-library 1.0.61-alpha.14 → 1.0.61-alpha.140

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.
Files changed (117) hide show
  1. package/dist/loading-0-1a7cddc8.js +4 -0
  2. package/dist/loading-1-892eee7c.js +4 -0
  3. package/dist/loading-2-bf39c889.js +4 -0
  4. package/dist/loading-3-f1ea4b15.js +4 -0
  5. package/dist/loading-table-fa-8b779ca8.js +4 -0
  6. package/dist/node_modules/@googlemaps/js-api-loader/src/deprecated.d.ts +7 -0
  7. package/dist/node_modules/@googlemaps/js-api-loader/src/index.d.ts +52 -0
  8. package/dist/node_modules/@googlemaps/js-api-loader/src/messages.d.ts +9 -0
  9. package/dist/src/build-entry.d.ts +5 -2830
  10. package/dist/src/components/v2/Animation/Animation.vue.d.ts +39 -0
  11. package/dist/src/components/v2/AssetInfo/AssetInfo.vue.d.ts +4 -4
  12. package/dist/src/components/v2/ButtonScan/ButtonScan.vue.d.ts +6 -0
  13. package/dist/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +7 -1
  14. package/dist/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +10 -0
  15. package/dist/src/components/v2/CustomColumn/DialogColumnSetup.vue.d.ts +4 -0
  16. package/dist/src/components/v2/DataTable/DataTable.vue.d.ts +28 -3
  17. package/dist/src/components/v2/DialogAssetNameDetail/DialogAssetNameDetail.vue.d.ts +3 -1
  18. package/dist/src/components/v2/DialogCoordinate/AssetList.vue.d.ts +4 -0
  19. package/dist/src/components/v2/DialogCoordinate/AssetListFilter.vue.d.ts +4 -0
  20. package/dist/src/components/v2/DialogCoordinate/CoordinateHeader.vue.d.ts +4 -0
  21. package/dist/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +100 -0
  22. package/dist/src/components/v2/DialogCoordinate/FullscreenToggle.vue.d.ts +4 -0
  23. package/dist/src/components/v2/DialogCoordinate/MapSearch.vue.d.ts +15 -0
  24. package/dist/src/components/v2/DialogCoordinate/Marker.vue.d.ts +13 -0
  25. package/dist/src/components/v2/DialogCoordinate/PopupDetail.vue.d.ts +13 -0
  26. package/dist/src/components/v2/DialogCoordinate/services/googleMapsService.d.ts +10 -0
  27. package/dist/src/components/v2/DialogCoordinate/services/openStreetMapService.d.ts +59 -0
  28. package/dist/src/components/v2/DialogForm/DialogForm.vue.d.ts +6 -0
  29. package/dist/src/components/v2/DialogReportDamage/DialogReportDamage.vue.d.ts +8 -0
  30. package/dist/src/components/v2/DialogReportMissing/DialogReportMissing.vue.d.ts +8 -0
  31. package/dist/src/components/v2/DialogSelectAsset/DialogSelectAsset.vue.d.ts +13 -9
  32. package/dist/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +9 -1
  33. package/dist/src/components/v2/DisposalReport/DisposalReportTable.vue.d.ts +16 -0
  34. package/dist/src/components/v2/FailedLoad/FailedLoad.vue.d.ts +26 -0
  35. package/dist/src/components/v2/FileUpload/FileUpload.vue.d.ts +4 -0
  36. package/dist/src/components/v2/Form/Form.vue.d.ts +2 -0
  37. package/dist/src/components/v2/HardwareSync/HardwareSync.vue.d.ts +2 -2
  38. package/dist/src/components/v2/Icon/Icon.vue.d.ts +13 -0
  39. package/dist/src/components/v2/ImageCompressor/BackgroundImageCropper.vue.d.ts +1 -1
  40. package/dist/src/components/v2/ImageCompressor/ImageCompressor.vue.d.ts +1 -1
  41. package/dist/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +64 -0
  42. package/dist/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +5 -0
  43. package/dist/src/components/v2/InputCurrencyReference/InputCurrencyReference.vue.d.ts +30 -0
  44. package/dist/src/components/v2/InputPhoneNumber/InputPhoneNumber.vue.d.ts +1 -0
  45. package/dist/src/components/v2/InputText/InputText.vue.d.ts +6 -0
  46. package/dist/src/components/v2/InputURL/InputURL.vue.d.ts +1 -0
  47. package/dist/src/components/v2/LazyLoadTrigger/LazyLoadTrigger.vue.d.ts +4 -0
  48. package/dist/src/components/v2/Textarea/Textarea.vue.d.ts +1 -0
  49. package/dist/src/components/v2/TransactionRoles/TransactionRoles.vue.d.ts +1 -0
  50. package/dist/src/components/v2/Tree/Tree.vue.d.ts +4 -0
  51. package/dist/src/components/v2/index.d.ts +6 -1
  52. package/dist/src/dto/assets.dto.d.ts +17 -0
  53. package/dist/src/dto/missing.dto.d.ts +1 -0
  54. package/dist/src/dto/tagTransaction.dto.d.ts +9 -0
  55. package/dist/src/event-bus/index.d.ts +8 -0
  56. package/dist/src/event-bus/mitt.d.ts +26 -0
  57. package/dist/src/presets/multiselect/index.js +1 -0
  58. package/dist/src/presets/paginator/index.js +1 -1
  59. package/dist/src/services/assets.service.d.ts +7 -2
  60. package/dist/src/services/column.service.d.ts +13 -0
  61. package/dist/src/services/deviceIOT.service.d.ts +1 -0
  62. package/dist/src/services/tagTransaction.service.d.ts +1 -1
  63. package/dist/src/services/tree.service.d.ts +1 -0
  64. package/dist/src/types/assets.type.d.ts +32 -11
  65. package/dist/src/utils/changelog.util.d.ts +69 -0
  66. package/dist/src/utils/createVueControl.d.ts +8 -0
  67. package/dist/src/utils/customMarker.util.d.ts +64 -0
  68. package/dist/src/utils/debounce.util.d.ts +1 -0
  69. package/dist/src/utils/exportToExcel.util.d.ts +1 -0
  70. package/dist/src/utils/getImageURL.util.d.ts +4 -4
  71. package/dist/src/utils/googleMapLoader.util.d.ts +1 -0
  72. package/dist/src/utils/index.d.ts +8 -4
  73. package/dist/src/utils/json.util.d.ts +17 -0
  74. package/dist/src/utils/request.util.d.ts +17 -0
  75. package/dist/src/utils/role.util.d.ts +19 -1
  76. package/dist/src/utils/textFormater.util.d.ts +3 -0
  77. package/dist/style.css +1 -1
  78. package/dist/tsv2-library.es.js +66118 -67234
  79. package/dist/tsv2-library.umd.js +47 -609
  80. package/package.json +7 -1
  81. package/src/components/v2/Animation/Animation.vue.d.ts +39 -0
  82. package/src/components/v2/ButtonScan/ButtonScan.vue.d.ts +6 -0
  83. package/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +7 -1
  84. package/src/components/v2/CustomColumn/CustomColumn.vue.d.ts +10 -0
  85. package/src/components/v2/DataTable/DataTable.vue.d.ts +28 -3
  86. package/src/components/v2/DialogAssetNameDetail/DialogAssetNameDetail.vue.d.ts +3 -1
  87. package/src/components/v2/DialogCoordinate/DialogCoordinate.vue.d.ts +100 -0
  88. package/src/components/v2/DialogForm/DialogForm.vue.d.ts +6 -0
  89. package/src/components/v2/DialogSelectAsset/DialogSelectAsset.vue.d.ts +13 -9
  90. package/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +9 -1
  91. package/src/components/v2/FailedLoad/FailedLoad.vue.d.ts +26 -0
  92. package/src/components/v2/FileUpload/FileUpload.vue.d.ts +4 -0
  93. package/src/components/v2/Form/Form.vue.d.ts +2 -0
  94. package/src/components/v2/Icon/Icon.vue.d.ts +13 -0
  95. package/src/components/v2/ImageCompressor/ImageCompressor.vue.d.ts +1 -1
  96. package/src/components/v2/InputCoordinate/InputCoordinate.vue.d.ts +64 -0
  97. package/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +5 -0
  98. package/src/components/v2/InputCurrencyReference/InputCurrencyReference.vue.d.ts +30 -0
  99. package/src/components/v2/InputPhoneNumber/InputPhoneNumber.vue.d.ts +1 -0
  100. package/src/components/v2/InputText/InputText.vue.d.ts +6 -0
  101. package/src/components/v2/InputURL/InputURL.vue.d.ts +1 -0
  102. package/src/components/v2/Textarea/Textarea.vue.d.ts +1 -0
  103. package/src/components/v2/TransactionRoles/TransactionRoles.vue.d.ts +1 -0
  104. package/src/components/v2/Tree/Tree.vue.d.ts +4 -0
  105. package/src/presets/multiselect/index.js +1 -0
  106. package/src/presets/paginator/index.js +1 -1
  107. package/src/services/assets.service.ts +49 -1
  108. package/src/services/column.service.ts +42 -0
  109. package/src/services/deviceIOT.service.ts +8 -0
  110. package/src/services/tagTransaction.service.ts +2 -2
  111. package/src/services/tracking.service.ts +1 -1
  112. package/src/services/tree.service.ts +1 -0
  113. package/dist/loading-0-7762a473.js +0 -4
  114. package/dist/loading-1-55418796.js +0 -4
  115. package/dist/loading-2-b6abf641.js +0 -4
  116. package/dist/loading-3-705786b6.js +0 -4
  117. package/dist/src/components/v2/DataTable/store/dataTable.store.d.ts +0 -22
@@ -0,0 +1,64 @@
1
+ import { Component } from 'vue';
2
+ export type MarkerConfig = {
3
+ kind: 'pin';
4
+ pinOptions?: google.maps.marker.PinElementOptions;
5
+ title?: string;
6
+ } | {
7
+ kind: 'img';
8
+ src: string;
9
+ title?: string;
10
+ } | {
11
+ kind: 'svgString';
12
+ svg: string;
13
+ title?: string;
14
+ } | {
15
+ kind: 'customElement';
16
+ createElement: () => HTMLElement;
17
+ title?: string;
18
+ };
19
+ export interface MapControl {
20
+ position?: google.maps.ControlPosition;
21
+ index?: number;
22
+ createElement: (ctx: {
23
+ map: google.maps.Map;
24
+ }) => HTMLElement;
25
+ }
26
+ export interface MapFocusConfig {
27
+ name: string;
28
+ featureType: google.maps.FeatureType;
29
+ featureStyleOptions: google.maps.FeatureStyleOptions;
30
+ }
31
+ export interface CustomMarkerOptions {
32
+ position: {
33
+ lat: number;
34
+ lng: number;
35
+ };
36
+ marker?: MarkerConfig;
37
+ title?: string;
38
+ popup?: string;
39
+ hoverable?: boolean;
40
+ draggable?: boolean;
41
+ clickable?: boolean;
42
+ onClick?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
43
+ onDragEnd?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
44
+ onHover?: (marker: google.maps.marker.AdvancedMarkerElement, isHovering: boolean) => void;
45
+ }
46
+ export declare const createMarker: (options: CustomMarkerOptions) => Promise<google.maps.marker.AdvancedMarkerElement>;
47
+ type MarkerContext<T = unknown> = {
48
+ id: string;
49
+ marker: google.maps.marker.AdvancedMarkerElement;
50
+ data: T;
51
+ };
52
+ type UseMapMarkersReturn<T = unknown> = {
53
+ markers: Map<string, MarkerContext<T>>;
54
+ setMap: (nextMap: google.maps.Map) => void;
55
+ addMarker: (id: string, marker: google.maps.marker.AdvancedMarkerElement, data: T, onClick?: () => void) => void;
56
+ openMarker: (id: string, options?: {
57
+ component?: Component;
58
+ props?: Record<string, unknown>;
59
+ loadData?: () => Promise<Record<string, unknown>>;
60
+ }) => Promise<void>;
61
+ clearMarkers: () => void;
62
+ };
63
+ export declare const useMapMarkers: <T = unknown>() => UseMapMarkersReturn<T>;
64
+ export {};
@@ -0,0 +1 @@
1
+ export declare const debounce: <T extends (...args: any[]) => void>(fn: T, delay?: number) => (...args: Parameters<T>) => void;
@@ -2,6 +2,7 @@ interface IExcelOptions {
2
2
  headers?: string[];
3
3
  data: object[];
4
4
  fileName: string;
5
+ preContentData?: (string | number)[][];
5
6
  }
6
7
  declare const exportToExcel: (options: IExcelOptions) => Promise<void>;
7
8
  export default exportToExcel;
@@ -1,11 +1,11 @@
1
- export declare const buildFileURL: (name: string, width?: number, height?: number) => string;
2
- export declare const fetchBlobFile: (url: string, token: string) => Promise<Blob>;
1
+ export declare const buildFileURL: (name?: string, width?: number, height?: number) => string;
3
2
  /**
4
3
  *
5
- * @param fileUrl The full URL
4
+ * @param name The full URL, or the file token as it appears on the server
6
5
  * @param fileName Custom File name
7
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
8
  * @returns
9
9
  */
10
- export declare const downloadFile: (fileUrl: string, fileName: string, immediateRevoke?: boolean) => Promise<string>;
10
+ export declare const downloadFile: (name: string, customFileName?: string, immediateRevoke?: boolean, viewNewTab?: boolean) => Promise<string>;
11
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>;
@@ -1,10 +1,10 @@
1
- import { formatUserName, formatVowelSoundLabel } from './textFormater.util';
1
+ import { formatUserName, formatVowelSoundLabel, formatDisplayAssetId, formatDisplayAssetName } from './textFormater.util';
2
2
  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, formatDisplayAssetId, formatDisplayAssetName, 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
- export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
49
+ declare const hasAccessToAssetDetail: () => boolean;
50
+ export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
@@ -1,4 +1,7 @@
1
+ import { Asset } from '../types/assets.type';
1
2
  export declare const formatVowelSoundLabel: (label?: string) => string;
2
3
  export declare const formatUserName: (name?: string) => string;
3
4
  export declare const formatTagCode: (tagCode?: string) => string;
5
+ export declare const formatDisplayAssetName: (asset: Asset) => string;
6
+ export declare const formatDisplayAssetId: (asset: Asset) => string;
4
7
  export default formatUserName;