tsv2-library 1.0.61-alpha.108 → 1.0.61-alpha.109
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, downloadFile, isObjectEmpty, useToast, listenSidebarChanges, unListenSidebarChanges, getCurrency, formatCurrency, getHostName, getBaseURL, useI18n, getNestedProperyValue, getSeverityByAssetStatus, clearStorage, forceLogout, reLogin, isValidJSONString, buildBodyParams, formatLogResponseData, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail } 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, isValidJSONString, buildBodyParams, formatLogResponseData, googleMapLoader, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail } 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, 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, 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, isValidJSONString, buildBodyParams, formatLogResponseData, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, 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, 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, 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, isValidJSONString, buildBodyParams, formatLogResponseData, googleMapLoader, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, flattenTreeNodeChildren, parseNodeKeys, filterNodeKeys, TreeAPI, RoutineAPI, DisposalAPI, RoutineServices, AssetsServices, AssetNameService, AssetBrandService, DisposalServices, FilterMatchMode, useLoadingStore, Presets, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const googleMapLoader: () => Promise<void>;
|
|
@@ -16,6 +16,7 @@ import reLogin from './reLogin.util';
|
|
|
16
16
|
import { isValidJSONString } from './json.util';
|
|
17
17
|
import { buildBodyParams } from './request.util';
|
|
18
18
|
import { formatLogResponseData } from './changelog.util';
|
|
19
|
+
import { googleMapLoader } from './googleMapLoader.util';
|
|
19
20
|
declare const isObjectEmpty: (object: object) => boolean;
|
|
20
21
|
declare const getNestedProperyValue: (object: object, property: string) => string | boolean | number | object;
|
|
21
|
-
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, getTransactionRole, getSystemRole, hasSystemRole, hasTransactionRole, checkRouteAccess, hasApprovalRole, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };
|
|
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, };
|
package/dist/tsv2-library.es.js
CHANGED
|
@@ -13240,6 +13240,79 @@ const formatCurrencyField = (value) => {
|
|
|
13240
13240
|
return value;
|
|
13241
13241
|
return formatCurrency(parsed.value, parsed.currency);
|
|
13242
13242
|
};
|
|
13243
|
+
function setScriptSrc(script2, src) {
|
|
13244
|
+
script2.src = src;
|
|
13245
|
+
}
|
|
13246
|
+
const bootstrap = (bootstrapParams) => {
|
|
13247
|
+
var bootstrapPromise;
|
|
13248
|
+
var script2;
|
|
13249
|
+
var bootstrapParamsKey;
|
|
13250
|
+
var PRODUCT_NAME = "The Google Maps JavaScript API";
|
|
13251
|
+
var GOOGLE = "google";
|
|
13252
|
+
var IMPORT_API_NAME = "importLibrary";
|
|
13253
|
+
var PENDING_BOOTSTRAP_KEY = "__ib__";
|
|
13254
|
+
var doc = document;
|
|
13255
|
+
var global_ = window;
|
|
13256
|
+
var google_ = global_[GOOGLE] || (global_[GOOGLE] = {});
|
|
13257
|
+
var namespace = google_.maps || (google_.maps = {});
|
|
13258
|
+
var libraries = /* @__PURE__ */ new Set();
|
|
13259
|
+
var searchParams = new URLSearchParams();
|
|
13260
|
+
var triggerBootstrap = () => bootstrapPromise || (bootstrapPromise = new Promise(async (resolve, reject) => {
|
|
13261
|
+
var _a;
|
|
13262
|
+
await (script2 = doc.createElement("script"));
|
|
13263
|
+
searchParams.set("libraries", [...libraries] + "");
|
|
13264
|
+
for (bootstrapParamsKey in bootstrapParams) {
|
|
13265
|
+
searchParams.set(bootstrapParamsKey.replace(/[A-Z]/g, (g2) => "_" + g2[0].toLowerCase()), bootstrapParams[bootstrapParamsKey]);
|
|
13266
|
+
}
|
|
13267
|
+
searchParams.set("callback", GOOGLE + ".maps." + PENDING_BOOTSTRAP_KEY);
|
|
13268
|
+
setScriptSrc(script2, "https://maps.googleapis.com/maps/api/js?" + searchParams);
|
|
13269
|
+
namespace[PENDING_BOOTSTRAP_KEY] = resolve;
|
|
13270
|
+
script2.onerror = () => bootstrapPromise = reject(Error(PRODUCT_NAME + " could not load."));
|
|
13271
|
+
script2.nonce = ((_a = doc.querySelector("script[nonce]")) == null ? void 0 : _a.nonce) || "";
|
|
13272
|
+
doc.head.append(script2);
|
|
13273
|
+
}));
|
|
13274
|
+
namespace[IMPORT_API_NAME] ? console.warn(PRODUCT_NAME + " only loads once. Ignoring:", bootstrapParams) : namespace[IMPORT_API_NAME] = (libraryName, ...args) => libraries.add(libraryName) && triggerBootstrap().then(() => namespace[IMPORT_API_NAME](libraryName, ...args));
|
|
13275
|
+
};
|
|
13276
|
+
const MSG_REPEATED_SET_OPTIONS = (options3) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(options3)}) will be ignored.`;
|
|
13277
|
+
const MSG_IMPORT_LIBRARY_EXISTS = (options3) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(options3)}) will be ignored.`;
|
|
13278
|
+
const logDevWarning = () => {
|
|
13279
|
+
};
|
|
13280
|
+
const logDevNotice = () => {
|
|
13281
|
+
};
|
|
13282
|
+
let setOptionsWasCalled_ = false;
|
|
13283
|
+
function setOptions(options3) {
|
|
13284
|
+
if (setOptionsWasCalled_) {
|
|
13285
|
+
logDevWarning(MSG_REPEATED_SET_OPTIONS(options3));
|
|
13286
|
+
return;
|
|
13287
|
+
}
|
|
13288
|
+
installImportLibrary_(options3);
|
|
13289
|
+
setOptionsWasCalled_ = true;
|
|
13290
|
+
}
|
|
13291
|
+
async function importLibrary(libraryName) {
|
|
13292
|
+
var _a, _b;
|
|
13293
|
+
if (!((_b = (_a = window == null ? void 0 : window.google) == null ? void 0 : _a.maps) == null ? void 0 : _b.importLibrary)) {
|
|
13294
|
+
throw new Error("google.maps.importLibrary is not installed.");
|
|
13295
|
+
}
|
|
13296
|
+
return await google.maps.importLibrary(libraryName);
|
|
13297
|
+
}
|
|
13298
|
+
function installImportLibrary_(options3) {
|
|
13299
|
+
var _a, _b;
|
|
13300
|
+
const importLibraryExists = Boolean((_b = (_a = window.google) == null ? void 0 : _a.maps) == null ? void 0 : _b.importLibrary);
|
|
13301
|
+
if (importLibraryExists) {
|
|
13302
|
+
logDevNotice(MSG_IMPORT_LIBRARY_EXISTS(options3));
|
|
13303
|
+
}
|
|
13304
|
+
if (!importLibraryExists) {
|
|
13305
|
+
bootstrap(options3);
|
|
13306
|
+
}
|
|
13307
|
+
}
|
|
13308
|
+
const googleMapLoader = async () => {
|
|
13309
|
+
setOptions({
|
|
13310
|
+
key: {}.VITE_GOOGLE_MAPS_API_KEY,
|
|
13311
|
+
region: "ID",
|
|
13312
|
+
language: "en"
|
|
13313
|
+
});
|
|
13314
|
+
await importLibrary("maps");
|
|
13315
|
+
};
|
|
13243
13316
|
const isObjectEmpty = (object) => {
|
|
13244
13317
|
if (!object)
|
|
13245
13318
|
return true;
|
|
@@ -62417,71 +62490,6 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
62417
62490
|
};
|
|
62418
62491
|
}
|
|
62419
62492
|
});
|
|
62420
|
-
function setScriptSrc(script2, src) {
|
|
62421
|
-
script2.src = src;
|
|
62422
|
-
}
|
|
62423
|
-
const bootstrap = (bootstrapParams) => {
|
|
62424
|
-
var bootstrapPromise;
|
|
62425
|
-
var script2;
|
|
62426
|
-
var bootstrapParamsKey;
|
|
62427
|
-
var PRODUCT_NAME = "The Google Maps JavaScript API";
|
|
62428
|
-
var GOOGLE = "google";
|
|
62429
|
-
var IMPORT_API_NAME = "importLibrary";
|
|
62430
|
-
var PENDING_BOOTSTRAP_KEY = "__ib__";
|
|
62431
|
-
var doc = document;
|
|
62432
|
-
var global_ = window;
|
|
62433
|
-
var google_ = global_[GOOGLE] || (global_[GOOGLE] = {});
|
|
62434
|
-
var namespace = google_.maps || (google_.maps = {});
|
|
62435
|
-
var libraries = /* @__PURE__ */ new Set();
|
|
62436
|
-
var searchParams = new URLSearchParams();
|
|
62437
|
-
var triggerBootstrap = () => bootstrapPromise || (bootstrapPromise = new Promise(async (resolve, reject) => {
|
|
62438
|
-
var _a;
|
|
62439
|
-
await (script2 = doc.createElement("script"));
|
|
62440
|
-
searchParams.set("libraries", [...libraries] + "");
|
|
62441
|
-
for (bootstrapParamsKey in bootstrapParams) {
|
|
62442
|
-
searchParams.set(bootstrapParamsKey.replace(/[A-Z]/g, (g2) => "_" + g2[0].toLowerCase()), bootstrapParams[bootstrapParamsKey]);
|
|
62443
|
-
}
|
|
62444
|
-
searchParams.set("callback", GOOGLE + ".maps." + PENDING_BOOTSTRAP_KEY);
|
|
62445
|
-
setScriptSrc(script2, "https://maps.googleapis.com/maps/api/js?" + searchParams);
|
|
62446
|
-
namespace[PENDING_BOOTSTRAP_KEY] = resolve;
|
|
62447
|
-
script2.onerror = () => bootstrapPromise = reject(Error(PRODUCT_NAME + " could not load."));
|
|
62448
|
-
script2.nonce = ((_a = doc.querySelector("script[nonce]")) == null ? void 0 : _a.nonce) || "";
|
|
62449
|
-
doc.head.append(script2);
|
|
62450
|
-
}));
|
|
62451
|
-
namespace[IMPORT_API_NAME] ? console.warn(PRODUCT_NAME + " only loads once. Ignoring:", bootstrapParams) : namespace[IMPORT_API_NAME] = (libraryName, ...args) => libraries.add(libraryName) && triggerBootstrap().then(() => namespace[IMPORT_API_NAME](libraryName, ...args));
|
|
62452
|
-
};
|
|
62453
|
-
const MSG_REPEATED_SET_OPTIONS = (options3) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(options3)}) will be ignored.`;
|
|
62454
|
-
const MSG_IMPORT_LIBRARY_EXISTS = (options3) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(options3)}) will be ignored.`;
|
|
62455
|
-
const logDevWarning = () => {
|
|
62456
|
-
};
|
|
62457
|
-
const logDevNotice = () => {
|
|
62458
|
-
};
|
|
62459
|
-
let setOptionsWasCalled_ = false;
|
|
62460
|
-
function setOptions(options3) {
|
|
62461
|
-
if (setOptionsWasCalled_) {
|
|
62462
|
-
logDevWarning(MSG_REPEATED_SET_OPTIONS(options3));
|
|
62463
|
-
return;
|
|
62464
|
-
}
|
|
62465
|
-
installImportLibrary_(options3);
|
|
62466
|
-
setOptionsWasCalled_ = true;
|
|
62467
|
-
}
|
|
62468
|
-
async function importLibrary(libraryName) {
|
|
62469
|
-
var _a, _b;
|
|
62470
|
-
if (!((_b = (_a = window == null ? void 0 : window.google) == null ? void 0 : _a.maps) == null ? void 0 : _b.importLibrary)) {
|
|
62471
|
-
throw new Error("google.maps.importLibrary is not installed.");
|
|
62472
|
-
}
|
|
62473
|
-
return await google.maps.importLibrary(libraryName);
|
|
62474
|
-
}
|
|
62475
|
-
function installImportLibrary_(options3) {
|
|
62476
|
-
var _a, _b;
|
|
62477
|
-
const importLibraryExists = Boolean((_b = (_a = window.google) == null ? void 0 : _a.maps) == null ? void 0 : _b.importLibrary);
|
|
62478
|
-
if (importLibraryExists) {
|
|
62479
|
-
logDevNotice(MSG_IMPORT_LIBRARY_EXISTS(options3));
|
|
62480
|
-
}
|
|
62481
|
-
if (!importLibraryExists) {
|
|
62482
|
-
bootstrap(options3);
|
|
62483
|
-
}
|
|
62484
|
-
}
|
|
62485
62493
|
const formatAddress = (address) => {
|
|
62486
62494
|
const parts = [];
|
|
62487
62495
|
if (address.house_number && address.road) {
|
|
@@ -77620,6 +77628,7 @@ export {
|
|
|
77620
77628
|
getSystemRole,
|
|
77621
77629
|
getTransactionRole,
|
|
77622
77630
|
getUserLocale,
|
|
77631
|
+
googleMapLoader,
|
|
77623
77632
|
handleTokenExpiration,
|
|
77624
77633
|
hasAccessToAssetDetail,
|
|
77625
77634
|
hasAnyManagerRole,
|