tsv2-library 1.0.61-alpha.54 → 1.0.61-alpha.56

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.
@@ -19,7 +19,7 @@ interface TSFormContext<T> {
19
19
  declare const useForm: <T>() => TSFormContext<T>;
20
20
  declare const useField: <T>(path: MaybeRefOrGetter<string>, rules?: MaybeRef<RuleExpression<T>>, opts?: Partial<FieldOptions<T>> | undefined) => FieldContext<T>;
21
21
  import Presets from './presets';
22
- import { handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole } from './utils';
22
+ import { handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole } from './utils';
23
23
  import { flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys } from './components/v2/Tree/helpers';
24
24
  import useLoadingStore from './components/v2/Loading/store/loading.store';
25
25
  import Tooltip from '../node_modules/primevue/tooltip';
@@ -31,4 +31,4 @@ declare const _default: {
31
31
  install: (app: App) => void;
32
32
  };
33
33
  export default _default;
34
- export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, DialogDamageLog, DialogMissingLog, DialogTransferLog, 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, TSDatePicker, TSDataTable, 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, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, useForm, useField, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, AssetNameService, AssetBrandService, DisposalServices, FilterMatchMode, useLoadingStore, Presets, };
34
+ export { LibConfig, TSToastService, TSi18n, VueHtmlToPaper, Tooltip, Focus, DialogDamageLog, DialogMissingLog, DialogTransferLog, 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, TSDatePicker, TSDataTable, 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, TSInputText, TSInputSearch, TSInputURL, TSLoading, TSMenu, TSMultiSelect, TSOverlayPanel, TSPaginator, TSProgressBar, TSSteps, TSTabMenu, TSTagType, TSTextarea, TSTimeline, TSToast, TSTransactionRoles, TSTree, TSTreeSearchInput, TSUserWithIcon, TSValidatorMessage, handleTokenExpiration, exportToExcel, formatGoDate, formatDate, getUserLocale, formatDateReadable, formatUserName, formatVowelSoundLabel, getImageURL, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, useForm, useField, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, AssetNameService, AssetBrandService, DisposalServices, FilterMatchMode, useLoadingStore, Presets, };
@@ -3,7 +3,7 @@ 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';
6
+ import { getImageURL, downloadFile } from './getImageURL.util';
7
7
  import { getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasAnyMonitoringReportRole, hasMonitoringReportRole, hasStaffRole } from './role.util';
8
8
  import { getCurrency, formatCurrency } from './currency.util';
9
9
  import { unListenSidebarChanges, listenSidebarChanges } from './listenSidebarChanges.util';
@@ -15,4 +15,4 @@ import forceLogout from './forceLogout.util';
15
15
  import reLogin from './reLogin.util';
16
16
  declare const isObjectEmpty: (object: object) => boolean;
17
17
  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, };
18
+ 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, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
@@ -19623,6 +19623,31 @@ const fetchBlobFile = async (url, token) => {
19623
19623
  type: res.headers.get("Content-Type") || "image/webp"
19624
19624
  });
19625
19625
  };
19626
+ const downloadFile = async (fileUrl, fileName, immediateRevoke = true) => {
19627
+ const token = getAuthToken();
19628
+ const blob2 = await fetchBlobFile(fileUrl, token);
19629
+ let objectUrl = "";
19630
+ const isViewable = /^(image|application\/pdf)/i.test(blob2.type);
19631
+ if (isViewable) {
19632
+ const file = new File([blob2], fileName, {
19633
+ type: blob2.type
19634
+ });
19635
+ objectUrl = URL.createObjectURL(file);
19636
+ window.open(objectUrl, "_blank");
19637
+ } else {
19638
+ objectUrl = URL.createObjectURL(blob2);
19639
+ const a = document.createElement("a");
19640
+ a.href = objectUrl;
19641
+ a.download = fileName;
19642
+ document.body.appendChild(a);
19643
+ a.click();
19644
+ a.remove();
19645
+ }
19646
+ if (immediateRevoke) {
19647
+ URL.revokeObjectURL(objectUrl);
19648
+ }
19649
+ return objectUrl;
19650
+ };
19626
19651
  const createBlobURL = async (rawFileUrl) => {
19627
19652
  try {
19628
19653
  const token = getAuthToken();
@@ -65810,7 +65835,7 @@ const API$1 = ({
65810
65835
  const user = JSON.parse(localStorage.getItem("user") ?? "{}");
65811
65836
  const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
65812
65837
  const instance = axios.create({
65813
- baseURL: `${BASE_URL2}/tracking/v2/tracking`,
65838
+ baseURL: `${BASE_URL2}/missing-tracking/v2/tracking`,
65814
65839
  headers: {
65815
65840
  "Content-type": "application/json",
65816
65841
  "Authorization": `Bearer ${user.token}`,
@@ -73986,6 +74011,7 @@ export {
73986
74011
  checkRouteAccess,
73987
74012
  clearStorage,
73988
74013
  buildEntry as default,
74014
+ downloadFile,
73989
74015
  exportToExcel,
73990
74016
  filterNodeKeys,
73991
74017
  flattenTreeNodeChildren,