x-essential-lib 0.10.32 → 0.10.33
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/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { n as EventType, t as Emitter } from "./vendor.
|
|
1
|
+
import { n as EventType, t as Emitter } from "./vendor.homyhtbu.js";
|
|
2
2
|
import { Ref } from "vue";
|
|
3
3
|
import { AxiosInstance } from "axios";
|
|
4
|
-
import { RouteLocationNormalized } from "vue-router";
|
|
5
4
|
|
|
6
5
|
//#region src/composables/color.d.ts
|
|
7
6
|
declare function useColor(): {
|
|
@@ -269,10 +268,7 @@ interface RouteMeta {
|
|
|
269
268
|
}
|
|
270
269
|
declare function matchRouteMeta(path: string): RouteMeta | undefined;
|
|
271
270
|
declare const routeTransName: import("vue").Ref<string, string>;
|
|
272
|
-
declare function
|
|
273
|
-
declare function onBeforeEach(to: RouteLocationNormalized, _from: RouteLocationNormalized): Promise<{
|
|
274
|
-
path: string;
|
|
275
|
-
} | undefined>;
|
|
271
|
+
declare function onBeforeEnter(toPath: string, fromPath: string, lastAppPath: string): void;
|
|
276
272
|
//#endregion
|
|
277
273
|
//#region src/utils/type.d.ts
|
|
278
274
|
declare const types: readonly ["string", "number", "boolean", "array", "object", "any"];
|
|
@@ -558,4 +554,4 @@ declare const _default: {
|
|
|
558
554
|
install: (app: import("vue").App) => void;
|
|
559
555
|
};
|
|
560
556
|
//#endregion
|
|
561
|
-
export { GlobalStates, Permission, PermissionObjects, RouteMeta, Type, addView, appAppear, clearViews, closeWaitDlg, createAxios, _default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning,
|
|
557
|
+
export { GlobalStates, Permission, PermissionObjects, RouteMeta, Type, addView, appAppear, clearViews, closeWaitDlg, createAxios, _default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEnter, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, useRouteChange, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){try{document.getElementById(`x-essential-lib`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-essential-lib`);const t = document.createTextNode(`.fade-leave-active[data-v-x-essential-lib-c3545c8d]{transition:opacity .5s}.fade-leave-to[data-v-x-essential-lib-c3545c8d]{opacity:0}.x-cont[data-v-x-essential-lib-c3545c8d]{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.lds-spinner[data-v-x-essential-lib-c3545c8d]{color:official;width:40px;height:40px;display:inline-block;position:relative}.lds-spinner div[data-v-x-essential-lib-c3545c8d]{transform-origin:20px 20px;animation:1.2s linear infinite lds-spinner-x-essential-lib-c3545c8d}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:after{content:" ";background:#9e9e9e;border-radius:5%;width:2px;height:6px;display:block;position:absolute;top:3px;left:18px}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes lds-spinner-x-essential-lib-c3545c8d{0%{opacity:1}to{opacity:0}}.x-item[data-v-x-essential-lib-cfcda9d9]{width:600px}@media (width<=600px){.x-item[data-v-x-essential-lib-cfcda9d9]{width:calc(100vw - 16px)}}.x-cont[data-v-x-essential-lib-b973907d]{z-index:9999;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}`);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
|
-
import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.
|
|
2
|
+
import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.homyhtbu.js";
|
|
3
3
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, resolveComponent, toDisplayString, unref, useTemplateRef, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
import { useDisplay, useTheme } from "vuetify";
|
|
@@ -583,7 +583,7 @@ function matchRouteMeta(path) {
|
|
|
583
583
|
return target;
|
|
584
584
|
}
|
|
585
585
|
const routeTransName = ref("");
|
|
586
|
-
function
|
|
586
|
+
function onBeforeEnter(toPath, fromPath, lastAppPath) {
|
|
587
587
|
if (fromPath === "/") fromPath = lastAppPath;
|
|
588
588
|
const toRouteMeta = matchRouteMeta(toPath);
|
|
589
589
|
const fromRouteMeta = matchRouteMeta(fromPath);
|
|
@@ -600,16 +600,6 @@ function onBeforeChange(toPath, fromPath, lastAppPath) {
|
|
|
600
600
|
appAppear(toRouteMeta.app, diff);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function isHasAccessToken() {
|
|
604
|
-
return !!api.get("accessToken");
|
|
605
|
-
}
|
|
606
|
-
async function onBeforeEach(to, _from) {
|
|
607
|
-
const hasAccessToken = isHasAccessToken();
|
|
608
|
-
const toRouteMeta = matchRouteMeta(to.path);
|
|
609
|
-
if (!toRouteMeta) return { path: `/main` };
|
|
610
|
-
if (toRouteMeta.requireAuth && !hasAccessToken) return { path: `/passport/login` };
|
|
611
|
-
if (hasAccessToken && to.path.startsWith("/passport/")) return { path: `/main` };
|
|
612
|
-
}
|
|
613
603
|
|
|
614
604
|
//#endregion
|
|
615
605
|
//#region src/utils/type.ts
|
|
@@ -1603,4 +1593,4 @@ async function loadLocaleMessageEssential(locale) {
|
|
|
1603
1593
|
var src_default = { install };
|
|
1604
1594
|
|
|
1605
1595
|
//#endregion
|
|
1606
|
-
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning,
|
|
1596
|
+
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEnter, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, useRouteChange, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
@@ -577,12 +577,12 @@ function toLower(value) {
|
|
|
577
577
|
//#endregion
|
|
578
578
|
//#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
|
|
579
579
|
var EventType = [
|
|
580
|
-
|
|
580
|
+
61,
|
|
581
581
|
() => [],
|
|
582
582
|
[]
|
|
583
583
|
];
|
|
584
584
|
var Handler = [
|
|
585
|
-
|
|
585
|
+
62,
|
|
586
586
|
(T) => [T],
|
|
587
587
|
[
|
|
588
588
|
"",
|
|
@@ -591,7 +591,7 @@ var Handler = [
|
|
|
591
591
|
]
|
|
592
592
|
];
|
|
593
593
|
var WildcardHandler = [
|
|
594
|
-
|
|
594
|
+
63,
|
|
595
595
|
(T) => [
|
|
596
596
|
Record,
|
|
597
597
|
T,
|
|
@@ -609,7 +609,7 @@ var WildcardHandler = [
|
|
|
609
609
|
]
|
|
610
610
|
];
|
|
611
611
|
var EventHandlerList = [
|
|
612
|
-
|
|
612
|
+
64,
|
|
613
613
|
(T) => [
|
|
614
614
|
T,
|
|
615
615
|
Handler,
|
|
@@ -623,7 +623,7 @@ var EventHandlerList = [
|
|
|
623
623
|
]
|
|
624
624
|
];
|
|
625
625
|
var WildCardEventHandlerList = [
|
|
626
|
-
|
|
626
|
+
65,
|
|
627
627
|
(T) => [
|
|
628
628
|
Record,
|
|
629
629
|
T,
|
|
@@ -639,7 +639,7 @@ var WildCardEventHandlerList = [
|
|
|
639
639
|
]
|
|
640
640
|
];
|
|
641
641
|
var EventHandlerMap = [
|
|
642
|
-
|
|
642
|
+
66,
|
|
643
643
|
(Events) => [
|
|
644
644
|
EventType,
|
|
645
645
|
Record,
|
|
@@ -665,7 +665,7 @@ var EventHandlerMap = [
|
|
|
665
665
|
]
|
|
666
666
|
];
|
|
667
667
|
var Emitter = [
|
|
668
|
-
|
|
668
|
+
67,
|
|
669
669
|
(Key, Events) => [
|
|
670
670
|
EventType,
|
|
671
671
|
Record,
|