x-essential-lib 0.10.24 → 0.10.25

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,4 +1,4 @@
1
- import { n as EventType, t as Emitter } from "./vendor.homyhtbu.js";
1
+ import { n as EventType, t as Emitter } from "./vendor.dqdzrw43.js";
2
2
  import { Ref } from "vue";
3
3
  import { AxiosInstance } from "axios";
4
4
  import { RouteLocationNormalized } from "vue-router";
@@ -272,7 +272,6 @@ declare const routeTransName: import("vue").Ref<string, string>;
272
272
  declare function onBeforeEach(to: RouteLocationNormalized, from: RouteLocationNormalized, lastAppPath: string): Promise<{
273
273
  path: string;
274
274
  } | undefined>;
275
- declare function switchOrg(orgId: string | undefined): Promise<boolean>;
276
275
  //#endregion
277
276
  //#region src/utils/type.d.ts
278
277
  declare const types: readonly ["string", "number", "boolean", "array", "object", "any"];
@@ -553,4 +552,4 @@ declare const _default: {
553
552
  install: (app: import("vue").App) => void;
554
553
  };
555
554
  //#endregion
556
- 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, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, switchOrg, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
555
+ 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, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
package/dist/index.js CHANGED
@@ -1,12 +1,10 @@
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.homyhtbu.js";
2
+ import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.dqdzrw43.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";
6
6
  import axios from "axios";
7
7
  import { useRoute, useRouter } from "vue-router";
8
- import { getErrorMessage } from "x-error-lib";
9
- import { createAxios as createAxios$1, messageError as messageError$1 } from "x-essential-lib";
10
8
 
11
9
  //#region src/composables/color.ts
12
10
  function useColor() {
@@ -431,25 +429,6 @@ function injectViews() {
431
429
  return inject("viewsKey");
432
430
  }
433
431
 
434
- //#endregion
435
- //#region src/api/orgbase/instance.ts
436
- const instance = createAxios$1({
437
- baseUrl: "http://localhost/orgbase/",
438
- onError: (error) => {
439
- messageError$1(getErrorMessage(error));
440
- }
441
- });
442
- if (window.API_URL) instance.defaults.baseURL = window.API_URL + "/orgbase/";
443
-
444
- //#endregion
445
- //#region src/api/orgbase/index.ts
446
- function GetOrgName(request) {
447
- return instance.post("getOrgName", request);
448
- }
449
- function PullPermission(request) {
450
- return instance.post("pullPermission", request);
451
- }
452
-
453
432
  //#endregion
454
433
  //#region src/utils/router.ts
455
434
  const routeMetas = [
@@ -630,31 +609,6 @@ async function onBeforeEach(to, from, lastAppPath) {
630
609
  if (hasAccessToken && to.path.startsWith("/passport/")) return { path: `/main/${Date.now()}` };
631
610
  onBeforeChange(to.path, from.path, lastAppPath);
632
611
  }
633
- async function switchOrg(orgId) {
634
- const router = useRouter();
635
- if (!orgId) {
636
- await router.replace({ path: `/main/${Date.now()}` });
637
- return false;
638
- }
639
- if (orgId === "public") {
640
- eventBus.emit("updateActiveOrg", [orgId, ""]);
641
- eventBus.emit("updatePermission", [{}, ""]);
642
- return true;
643
- }
644
- try {
645
- const { name } = await GetOrgName({ orgId });
646
- const { permissions } = await PullPermission({
647
- orgId,
648
- checksum: ""
649
- });
650
- eventBus.emit("updateActiveOrg", [orgId, name]);
651
- eventBus.emit("updatePermission", [toPermissionObjects(permissions), permissions.checksum ?? ""]);
652
- return true;
653
- } catch (e) {
654
- if (e === "org not found" || e === "org member not found") await router.replace({ path: `/main/${Date.now()}` });
655
- return false;
656
- }
657
- }
658
612
 
659
613
  //#endregion
660
614
  //#region src/utils/type.ts
@@ -1588,4 +1542,4 @@ async function loadLocaleMessageEssential(locale) {
1588
1542
  var src_default = { install };
1589
1543
 
1590
1544
  //#endregion
1591
- 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, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, switchOrg, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
1545
+ 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, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePermission, 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
- 61,
580
+ 60,
581
581
  () => [],
582
582
  []
583
583
  ];
584
584
  var Handler = [
585
- 62,
585
+ 61,
586
586
  (T) => [T],
587
587
  [
588
588
  "",
@@ -591,7 +591,7 @@ var Handler = [
591
591
  ]
592
592
  ];
593
593
  var WildcardHandler = [
594
- 63,
594
+ 62,
595
595
  (T) => [
596
596
  Record,
597
597
  T,
@@ -609,7 +609,7 @@ var WildcardHandler = [
609
609
  ]
610
610
  ];
611
611
  var EventHandlerList = [
612
- 64,
612
+ 63,
613
613
  (T) => [
614
614
  T,
615
615
  Handler,
@@ -623,7 +623,7 @@ var EventHandlerList = [
623
623
  ]
624
624
  ];
625
625
  var WildCardEventHandlerList = [
626
- 65,
626
+ 64,
627
627
  (T) => [
628
628
  Record,
629
629
  T,
@@ -639,7 +639,7 @@ var WildCardEventHandlerList = [
639
639
  ]
640
640
  ];
641
641
  var EventHandlerMap = [
642
- 66,
642
+ 65,
643
643
  (Events) => [
644
644
  EventType,
645
645
  Record,
@@ -665,7 +665,7 @@ var EventHandlerMap = [
665
665
  ]
666
666
  ];
667
667
  var Emitter = [
668
- 67,
668
+ 66,
669
669
  (Key, Events) => [
670
670
  EventType,
671
671
  Record,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
- "version": "0.10.24",
3
+ "version": "0.10.25",
4
4
  "files": [
5
5
  "dist"
6
6
  ],