x-essential-lib 0.10.7 → 0.10.9
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/i18n-en.exw0q3rp.js +201 -0
- package/dist/i18n-zhHans.itmme76z.js +201 -0
- package/dist/index.d.ts +136 -13
- package/dist/index.js +143 -117
- package/dist/{vendor.homyhtbu.js → vendor.nvyu21oc.js} +7 -7
- package/package.json +4 -1
- package/dist/i18n-en.nsm1ldfp.js +0 -113
- package/dist/i18n-zhHans.do0bpr19.js +0 -113
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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.nvyu21oc.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 { useRoute, useRouter } from "vue-router";
|
|
7
7
|
import axios from "axios";
|
|
8
|
+
import { getErrorMessage } from "x-error-lib";
|
|
9
|
+
import { createAxios as createAxios$1, messageError as messageError$1 } from "x-essential-lib";
|
|
8
10
|
|
|
9
11
|
//#region src/composables/color.ts
|
|
10
12
|
function useColor() {
|
|
@@ -79,10 +81,6 @@ function onRespRejected(error, onError) {
|
|
|
79
81
|
function onUnauthorized() {
|
|
80
82
|
api.remove("accessToken");
|
|
81
83
|
api.remove("refreshToken");
|
|
82
|
-
api.remove("userId");
|
|
83
|
-
api.remove("userName");
|
|
84
|
-
api.remove("phone");
|
|
85
|
-
api.remove("activeOrg");
|
|
86
84
|
useRouter().replace({ path: "/passport/login" });
|
|
87
85
|
}
|
|
88
86
|
|
|
@@ -369,6 +367,15 @@ let Permission = /* @__PURE__ */ function(Permission) {
|
|
|
369
367
|
Permission["filter_table"] = "filter_table";
|
|
370
368
|
return Permission;
|
|
371
369
|
}({});
|
|
370
|
+
function toPermissionObjects(permissions) {
|
|
371
|
+
const permissionObjects = {};
|
|
372
|
+
for (const key in permissions) {
|
|
373
|
+
if (key === "checksum") continue;
|
|
374
|
+
const value = permissions[key];
|
|
375
|
+
permissionObjects[key] = JSON.parse(value);
|
|
376
|
+
}
|
|
377
|
+
return permissionObjects;
|
|
378
|
+
}
|
|
372
379
|
function isExist(instanceTree, instance) {
|
|
373
380
|
if (!instanceTree) return false;
|
|
374
381
|
let curr = instanceTree;
|
|
@@ -392,47 +399,63 @@ function verifyPermission(permissionObjects, permission, instance) {
|
|
|
392
399
|
|
|
393
400
|
//#endregion
|
|
394
401
|
//#region src/utils/provideInject.ts
|
|
395
|
-
const darkKey = "essentialDark";
|
|
396
|
-
const localeKey = "essentialLocale";
|
|
397
|
-
const permissionObjectsKey = "essentialPermissionObjects";
|
|
398
|
-
const permissionChecksumKey = "essentialPermissionChecksum";
|
|
399
|
-
const lastAppPathKey = "essentialLastAppPath";
|
|
400
|
-
const viewsKey = "essentialViews";
|
|
401
402
|
function provideDark(dark) {
|
|
402
|
-
provide(
|
|
403
|
+
provide("essentialDark", dark);
|
|
403
404
|
}
|
|
404
405
|
function injectDark() {
|
|
405
|
-
return inject(
|
|
406
|
+
return inject("essentialDark");
|
|
406
407
|
}
|
|
407
408
|
function provideLocale(locale) {
|
|
408
|
-
provide(
|
|
409
|
+
provide("essentialLocale", locale);
|
|
409
410
|
}
|
|
410
411
|
function injectLocale() {
|
|
411
|
-
return inject(
|
|
412
|
+
return inject("essentialLocale");
|
|
413
|
+
}
|
|
414
|
+
function provideActiveOrg(activeOrg) {
|
|
415
|
+
provide("essentialActiveOrg", activeOrg);
|
|
416
|
+
}
|
|
417
|
+
function injectActiveOrg() {
|
|
418
|
+
return inject("essentialActiveOrg");
|
|
412
419
|
}
|
|
413
420
|
function providePermissionObjects(permissionObjects) {
|
|
414
|
-
provide(
|
|
421
|
+
provide("essentialPermissionObjects", permissionObjects);
|
|
415
422
|
}
|
|
416
423
|
function injectPermissionObjects() {
|
|
417
|
-
return inject(
|
|
424
|
+
return inject("essentialPermissionObjects");
|
|
418
425
|
}
|
|
419
426
|
function providePermissionChecksum(permissionChecksum) {
|
|
420
|
-
provide(
|
|
427
|
+
provide("essentialPermissionChecksum", permissionChecksum);
|
|
421
428
|
}
|
|
422
429
|
function injectPermissionChecksum() {
|
|
423
|
-
return inject(
|
|
430
|
+
return inject("essentialPermissionChecksum");
|
|
424
431
|
}
|
|
425
432
|
function provideLastAppPath(lastAppPath) {
|
|
426
|
-
provide(
|
|
433
|
+
provide("essentialLastAppPath", lastAppPath);
|
|
427
434
|
}
|
|
428
435
|
function injectLastAppPath() {
|
|
429
|
-
return inject(
|
|
436
|
+
return inject("essentialLastAppPath");
|
|
430
437
|
}
|
|
431
438
|
function provideViews(views) {
|
|
432
|
-
provide(viewsKey, views);
|
|
439
|
+
provide("viewsKey", views);
|
|
433
440
|
}
|
|
434
441
|
function injectViews() {
|
|
435
|
-
return inject(viewsKey);
|
|
442
|
+
return inject("viewsKey");
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/api/orgbase/instance.ts
|
|
447
|
+
const instance = createAxios$1({
|
|
448
|
+
baseUrl: "http://localhost/orgbase/",
|
|
449
|
+
onError: (error) => {
|
|
450
|
+
messageError$1(getErrorMessage(error));
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
if (window.API_URL) instance.defaults.baseURL = window.API_URL + "/orgbase/";
|
|
454
|
+
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/api/orgbase/index.ts
|
|
457
|
+
function PullPermission(request) {
|
|
458
|
+
return instance.post("pullPermission", request);
|
|
436
459
|
}
|
|
437
460
|
|
|
438
461
|
//#endregion
|
|
@@ -441,119 +464,130 @@ const routeMetas = [
|
|
|
441
464
|
{
|
|
442
465
|
app: "x-passport-mf",
|
|
443
466
|
path: "/passport/login",
|
|
444
|
-
level: 0
|
|
467
|
+
level: 0,
|
|
468
|
+
requireAuth: false
|
|
445
469
|
},
|
|
446
470
|
{
|
|
447
471
|
app: "x-passport-mf",
|
|
448
472
|
path: "/passport/loginAccount",
|
|
449
|
-
|
|
473
|
+
back: "/passport/login",
|
|
474
|
+
level: 1,
|
|
475
|
+
requireAuth: false
|
|
450
476
|
},
|
|
451
477
|
{
|
|
452
478
|
app: "x-passport-mf",
|
|
453
479
|
path: "/passport/register",
|
|
454
|
-
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
app: "x-org-mf",
|
|
458
|
-
path: "/org/joinOrCreate",
|
|
480
|
+
back: "/passport/login",
|
|
459
481
|
level: 1,
|
|
460
|
-
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
app: "x-org-mf",
|
|
464
|
-
path: "/org/manager",
|
|
465
|
-
level: 1,
|
|
466
|
-
requiredState: "org"
|
|
482
|
+
requireAuth: false
|
|
467
483
|
},
|
|
468
484
|
{
|
|
469
485
|
app: "x-main-mf",
|
|
470
486
|
path: "/main",
|
|
471
487
|
level: 0,
|
|
472
|
-
|
|
488
|
+
requireAuth: true
|
|
473
489
|
},
|
|
474
490
|
{
|
|
475
491
|
app: "x-create-mf",
|
|
476
492
|
path: "/create",
|
|
477
493
|
level: 0,
|
|
478
|
-
|
|
494
|
+
requireAuth: true
|
|
479
495
|
},
|
|
480
496
|
{
|
|
481
497
|
app: "x-ecosystem-mf",
|
|
482
498
|
path: "/ecosystem",
|
|
483
499
|
level: 0,
|
|
484
|
-
|
|
500
|
+
requireAuth: true
|
|
485
501
|
},
|
|
486
502
|
{
|
|
487
503
|
app: "x-mine-mf",
|
|
488
504
|
path: "/mine",
|
|
489
505
|
level: 0,
|
|
490
|
-
|
|
506
|
+
requireAuth: true
|
|
491
507
|
},
|
|
492
508
|
{
|
|
493
509
|
app: "x-mine-mf",
|
|
494
510
|
path: "/mine/personalInfo",
|
|
511
|
+
back: "/mine",
|
|
495
512
|
level: 1,
|
|
496
|
-
|
|
513
|
+
requireAuth: true
|
|
497
514
|
},
|
|
498
515
|
{
|
|
499
516
|
app: "x-mine-mf",
|
|
500
517
|
path: "/mine/accountSecurity",
|
|
518
|
+
back: "/mine/personalInfo",
|
|
501
519
|
level: 2,
|
|
502
|
-
|
|
520
|
+
requireAuth: true
|
|
503
521
|
},
|
|
504
522
|
{
|
|
505
523
|
app: "x-mine-mf",
|
|
506
524
|
path: "/mine/settings",
|
|
525
|
+
back: "/mine",
|
|
507
526
|
level: 1,
|
|
508
|
-
|
|
527
|
+
requireAuth: true
|
|
509
528
|
},
|
|
510
529
|
{
|
|
511
530
|
app: "x-mine-mf",
|
|
512
531
|
path: "/mine/general",
|
|
532
|
+
back: "/mine/settings",
|
|
513
533
|
level: 2,
|
|
514
|
-
|
|
534
|
+
requireAuth: true
|
|
515
535
|
},
|
|
516
536
|
{
|
|
517
537
|
app: "x-mine-mf",
|
|
518
538
|
path: "/mine/general/darkMode",
|
|
539
|
+
back: "/mine/general",
|
|
519
540
|
level: 3,
|
|
520
|
-
|
|
541
|
+
requireAuth: true
|
|
521
542
|
},
|
|
522
543
|
{
|
|
523
544
|
app: "x-mine-mf",
|
|
524
545
|
path: "/mine/general/language",
|
|
546
|
+
back: "/mine/general",
|
|
525
547
|
level: 3,
|
|
526
|
-
|
|
548
|
+
requireAuth: true
|
|
527
549
|
},
|
|
528
550
|
{
|
|
529
551
|
app: "x-app-mf",
|
|
530
552
|
path: "/app/manager",
|
|
553
|
+
back: "/create",
|
|
531
554
|
level: 1,
|
|
532
|
-
|
|
555
|
+
requireAuth: true
|
|
533
556
|
},
|
|
534
557
|
{
|
|
535
558
|
app: "x-app-mf",
|
|
536
559
|
path: "/app/editor",
|
|
560
|
+
back: "/app/manager",
|
|
537
561
|
level: 2,
|
|
538
|
-
|
|
562
|
+
requireAuth: true
|
|
539
563
|
},
|
|
540
564
|
{
|
|
541
565
|
app: "x-compute-mf",
|
|
542
566
|
path: "/compute",
|
|
567
|
+
back: "/create",
|
|
543
568
|
level: 1,
|
|
544
|
-
|
|
569
|
+
requireAuth: true
|
|
545
570
|
},
|
|
546
571
|
{
|
|
547
572
|
app: "x-data-mf",
|
|
548
573
|
path: "/data",
|
|
574
|
+
back: "/create",
|
|
549
575
|
level: 1,
|
|
550
|
-
|
|
576
|
+
requireAuth: true
|
|
551
577
|
},
|
|
552
578
|
{
|
|
553
579
|
app: "x-resource-mf",
|
|
554
580
|
path: "/resource",
|
|
581
|
+
back: "/create",
|
|
555
582
|
level: 1,
|
|
556
|
-
|
|
583
|
+
requireAuth: true
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
app: "x-org-mf",
|
|
587
|
+
path: "/org",
|
|
588
|
+
back: "/create",
|
|
589
|
+
level: 1,
|
|
590
|
+
requireAuth: true
|
|
557
591
|
}
|
|
558
592
|
];
|
|
559
593
|
function matchRouteMeta(path) {
|
|
@@ -599,52 +633,39 @@ function onBeforeChange(toPath, fromPath, lastAppPath) {
|
|
|
599
633
|
function isHasAccessToken() {
|
|
600
634
|
return !!api.get("accessToken");
|
|
601
635
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
636
|
+
async function syncPermission(orgId) {
|
|
637
|
+
const { permissions } = await PullPermission({
|
|
638
|
+
orgId,
|
|
639
|
+
checksum: ""
|
|
640
|
+
});
|
|
641
|
+
eventBus.emit("updatePermission", [toPermissionObjects(permissions), permissions["checksum"] ?? ""]);
|
|
604
642
|
}
|
|
605
|
-
function onBeforeEach(to, from, lastAppPath) {
|
|
643
|
+
async function onBeforeEach(to, from, lastAppPath) {
|
|
606
644
|
const hasAccessToken = isHasAccessToken();
|
|
607
|
-
const hasActiveOrg = isHasActiveOrg();
|
|
608
645
|
const toRouteMeta = matchRouteMeta(to.path);
|
|
609
|
-
if (!toRouteMeta)
|
|
610
|
-
if (toRouteMeta.
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
else {
|
|
619
|
-
const toPath = "/passport/login";
|
|
620
|
-
onBeforeChange(toPath, from.path, lastAppPath);
|
|
621
|
-
return { path: toPath };
|
|
622
|
-
}
|
|
623
|
-
else if (toRouteMeta.requiredState === "org") if (hasAccessToken) if (hasActiveOrg) {
|
|
646
|
+
if (!toRouteMeta) return;
|
|
647
|
+
if (toRouteMeta.requireAuth && !hasAccessToken) return { path: `/passport/login` };
|
|
648
|
+
if (hasAccessToken && to.path.startsWith("/passport/")) return { path: `/main` };
|
|
649
|
+
const orgId = to.query.orgId;
|
|
650
|
+
if (to.path.startsWith("/passport/")) onBeforeChange(to.path, from.path, lastAppPath);
|
|
651
|
+
else if (to.path.startsWith("/main")) try {
|
|
652
|
+
if (!orgId) throw new Error(`orgId not specified`);
|
|
653
|
+
await syncPermission(orgId);
|
|
654
|
+
eventBus.emit("updateActiveOrg", orgId);
|
|
624
655
|
onBeforeChange(to.path, from.path, lastAppPath);
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
const toPath = "/passport/login";
|
|
633
|
-
onBeforeChange(toPath, from.path, lastAppPath);
|
|
634
|
-
return { path: toPath };
|
|
635
|
-
}
|
|
636
|
-
else if (hasAccessToken) if (hasActiveOrg) {
|
|
637
|
-
const toPath = "/main";
|
|
638
|
-
onBeforeChange(toPath, from.path, lastAppPath);
|
|
639
|
-
return { path: toPath };
|
|
640
|
-
} else {
|
|
641
|
-
const toPath = "/org/joinOrCreate";
|
|
642
|
-
onBeforeChange(toPath, from.path, lastAppPath);
|
|
643
|
-
return { path: toPath };
|
|
656
|
+
} catch {
|
|
657
|
+
return {
|
|
658
|
+
path: `/main/${Date.now()}`,
|
|
659
|
+
query: { orgId: "public" }
|
|
660
|
+
};
|
|
644
661
|
}
|
|
645
|
-
else {
|
|
662
|
+
else try {
|
|
663
|
+
if (!orgId) throw new Error(`orgId not specified`);
|
|
664
|
+
await syncPermission(orgId);
|
|
665
|
+
eventBus.emit("updateActiveOrg", orgId);
|
|
646
666
|
onBeforeChange(to.path, from.path, lastAppPath);
|
|
647
|
-
|
|
667
|
+
} catch {
|
|
668
|
+
return { path: `/main` };
|
|
648
669
|
}
|
|
649
670
|
}
|
|
650
671
|
|
|
@@ -710,9 +731,10 @@ function clearViews(views) {
|
|
|
710
731
|
|
|
711
732
|
//#endregion
|
|
712
733
|
//#region src/composables/microApp.ts
|
|
713
|
-
function useMicroApp(
|
|
734
|
+
function useMicroApp(states, customBack) {
|
|
714
735
|
const route = useRoute();
|
|
715
736
|
const router = useRouter();
|
|
737
|
+
const { dark, locale, activeOrg, permissionObjects, permissionChecksum, lastAppPath, views } = states;
|
|
716
738
|
const prefDark = usePreferredDark();
|
|
717
739
|
const finalDark = ref(false);
|
|
718
740
|
watchEffect(() => {
|
|
@@ -723,6 +745,7 @@ function useMicroApp(dark, locale, permissionObjects, permissionChecksum, lastAp
|
|
|
723
745
|
});
|
|
724
746
|
provideDark(finalDark);
|
|
725
747
|
provideLocale(locale);
|
|
748
|
+
provideActiveOrg(activeOrg);
|
|
726
749
|
providePermissionObjects(permissionObjects);
|
|
727
750
|
providePermissionChecksum(permissionChecksum);
|
|
728
751
|
provideLastAppPath(lastAppPath);
|
|
@@ -731,28 +754,26 @@ function useMicroApp(dark, locale, permissionObjects, permissionChecksum, lastAp
|
|
|
731
754
|
watchEffect(async () => {
|
|
732
755
|
await theme.change(finalDark.value ? "dark" : "light");
|
|
733
756
|
});
|
|
734
|
-
|
|
757
|
+
async function handleBack() {
|
|
735
758
|
if (!isEmpty(views)) {
|
|
736
759
|
if (!hasView(views, "waitDlg")) popView(views);
|
|
737
760
|
return;
|
|
738
761
|
}
|
|
739
762
|
const routeMeta = matchRouteMeta(route.path);
|
|
740
|
-
if (!routeMeta)
|
|
741
|
-
console.assert(false);
|
|
742
|
-
return;
|
|
743
|
-
}
|
|
763
|
+
if (!routeMeta) return;
|
|
744
764
|
if (routeMeta.level === 0) navigator?.Backbutton?.goHome(() => {}, () => {});
|
|
745
|
-
else
|
|
746
|
-
|
|
747
|
-
|
|
765
|
+
else if (customBack) customBack(routeMeta);
|
|
766
|
+
else if (routeMeta.back) await router.replace({ path: routeMeta.back });
|
|
767
|
+
}
|
|
768
|
+
async function onKeyDown(e) {
|
|
748
769
|
if (e.key === "Escape") {
|
|
749
|
-
handleBack();
|
|
770
|
+
await handleBack();
|
|
750
771
|
return;
|
|
751
772
|
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
handleBack();
|
|
755
|
-
}
|
|
773
|
+
}
|
|
774
|
+
async function onBackButton() {
|
|
775
|
+
await handleBack();
|
|
776
|
+
}
|
|
756
777
|
onMounted(() => {
|
|
757
778
|
window.addEventListener("keydown", onKeyDown);
|
|
758
779
|
eventBus.on("backbutton", onBackButton);
|
|
@@ -761,23 +782,27 @@ function useMicroApp(dark, locale, permissionObjects, permissionChecksum, lastAp
|
|
|
761
782
|
window.removeEventListener("keydown", onKeyDown);
|
|
762
783
|
eventBus.off("backbutton", onBackButton);
|
|
763
784
|
});
|
|
764
|
-
|
|
785
|
+
function onUpdateDark(val) {
|
|
765
786
|
dark.value = val;
|
|
766
|
-
}
|
|
767
|
-
|
|
787
|
+
}
|
|
788
|
+
function onUpdateLocale(val) {
|
|
768
789
|
locale.value = val;
|
|
769
|
-
}
|
|
770
|
-
|
|
790
|
+
}
|
|
791
|
+
function onUpdateActiveOrg(val) {
|
|
792
|
+
activeOrg.value = val;
|
|
793
|
+
}
|
|
794
|
+
function onUpdatePermission(val) {
|
|
771
795
|
const v = val;
|
|
772
796
|
permissionObjects.value = v[0];
|
|
773
797
|
permissionChecksum.value = v[1];
|
|
774
|
-
}
|
|
775
|
-
|
|
798
|
+
}
|
|
799
|
+
function onUpdateLastAppPath(val) {
|
|
776
800
|
lastAppPath.value = val;
|
|
777
|
-
}
|
|
801
|
+
}
|
|
778
802
|
onBeforeMount(() => {
|
|
779
803
|
eventBus.on("updateDark", onUpdateDark);
|
|
780
804
|
eventBus.on("updateLocale", onUpdateLocale);
|
|
805
|
+
eventBus.on("updateActiveOrg", onUpdateActiveOrg);
|
|
781
806
|
eventBus.on("updatePermission", onUpdatePermission);
|
|
782
807
|
eventBus.on("updateLastAppPath", onUpdateLastAppPath);
|
|
783
808
|
eventBus.emit("syncGlobalState");
|
|
@@ -785,6 +810,7 @@ function useMicroApp(dark, locale, permissionObjects, permissionChecksum, lastAp
|
|
|
785
810
|
onBeforeUnmount(() => {
|
|
786
811
|
eventBus.off("updateDark", onUpdateDark);
|
|
787
812
|
eventBus.off("updateLocale", onUpdateLocale);
|
|
813
|
+
eventBus.off("updateActiveOrg", onUpdateActiveOrg);
|
|
788
814
|
eventBus.off("updatePermission", onUpdatePermission);
|
|
789
815
|
eventBus.off("updateLastAppPath", onUpdateLastAppPath);
|
|
790
816
|
});
|
|
@@ -1540,8 +1566,8 @@ const install = (app) => {
|
|
|
1540
1566
|
//#endregion
|
|
1541
1567
|
//#region src/i18n/index.ts
|
|
1542
1568
|
async function loadLocaleMessageEssential(locale) {
|
|
1543
|
-
if (locale === "en") return (await import("./i18n-en.
|
|
1544
|
-
else if (locale === "zhHans") return (await import("./i18n-zhHans.
|
|
1569
|
+
if (locale === "en") return (await import("./i18n-en.exw0q3rp.js").then((n) => n.t)).default;
|
|
1570
|
+
else if (locale === "zhHans") return (await import("./i18n-zhHans.itmme76z.js").then((n) => n.t)).default;
|
|
1545
1571
|
else throw new Error(`invalid locale=${locale}`);
|
|
1546
1572
|
}
|
|
1547
1573
|
|
|
@@ -1550,4 +1576,4 @@ async function loadLocaleMessageEssential(locale) {
|
|
|
1550
1576
|
var src_default = { install };
|
|
1551
1577
|
|
|
1552
1578
|
//#endregion
|
|
1553
|
-
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
1579
|
+
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectActiveOrg, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideActiveOrg, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, 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
|
-
|
|
580
|
+
65,
|
|
581
581
|
() => [],
|
|
582
582
|
[]
|
|
583
583
|
];
|
|
584
584
|
var Handler = [
|
|
585
|
-
|
|
585
|
+
66,
|
|
586
586
|
(T) => [T],
|
|
587
587
|
[
|
|
588
588
|
"",
|
|
@@ -591,7 +591,7 @@ var Handler = [
|
|
|
591
591
|
]
|
|
592
592
|
];
|
|
593
593
|
var WildcardHandler = [
|
|
594
|
-
|
|
594
|
+
67,
|
|
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
|
+
68,
|
|
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
|
+
69,
|
|
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
|
+
70,
|
|
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
|
+
71,
|
|
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.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"lint-staged": "lint-staged",
|
|
24
24
|
"prepare": "husky"
|
|
25
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"x-error-lib": "^0.6.3"
|
|
28
|
+
},
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@types/js-cookie": "^3.0.6",
|
|
28
31
|
"@types/lodash-es": "^4.17.12",
|
package/dist/i18n-en.nsm1ldfp.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime.c6i0pdwe.js";
|
|
2
|
-
|
|
3
|
-
//#region src/i18n/locales/en/$vuetify.ts
|
|
4
|
-
var $vuetify_default = {
|
|
5
|
-
badge: "Badge",
|
|
6
|
-
open: "Open",
|
|
7
|
-
close: "Close",
|
|
8
|
-
dismiss: "Dismiss",
|
|
9
|
-
confirmEdit: {
|
|
10
|
-
ok: "OK",
|
|
11
|
-
cancel: "Cancel"
|
|
12
|
-
},
|
|
13
|
-
dataIterator: {
|
|
14
|
-
noResultsText: "No matching records found",
|
|
15
|
-
loadingText: "Loading items..."
|
|
16
|
-
},
|
|
17
|
-
dataTable: {
|
|
18
|
-
itemsPerPageText: "Rows per page:",
|
|
19
|
-
ariaLabel: {
|
|
20
|
-
sortDescending: "Sorted descending.",
|
|
21
|
-
sortAscending: "Sorted ascending.",
|
|
22
|
-
sortNone: "Not sorted.",
|
|
23
|
-
activateNone: "Activate to remove sorting.",
|
|
24
|
-
activateDescending: "Activate to sort descending.",
|
|
25
|
-
activateAscending: "Activate to sort ascending."
|
|
26
|
-
},
|
|
27
|
-
sortBy: "Sort by"
|
|
28
|
-
},
|
|
29
|
-
dataFooter: {
|
|
30
|
-
itemsPerPageText: "Items per page:",
|
|
31
|
-
itemsPerPageAll: "All",
|
|
32
|
-
nextPage: "Next page",
|
|
33
|
-
prevPage: "Previous page",
|
|
34
|
-
firstPage: "First page",
|
|
35
|
-
lastPage: "Last page",
|
|
36
|
-
pageText: "{0}-{1} of {2}"
|
|
37
|
-
},
|
|
38
|
-
dateRangeInput: { divider: "to" },
|
|
39
|
-
datePicker: {
|
|
40
|
-
itemsSelected: "{0} selected",
|
|
41
|
-
range: {
|
|
42
|
-
title: "Select dates",
|
|
43
|
-
header: "Enter dates"
|
|
44
|
-
},
|
|
45
|
-
title: "Select date",
|
|
46
|
-
header: "Enter date",
|
|
47
|
-
input: { placeholder: "Enter date" }
|
|
48
|
-
},
|
|
49
|
-
noDataText: "No data available",
|
|
50
|
-
carousel: {
|
|
51
|
-
prev: "Previous visual",
|
|
52
|
-
next: "Next visual",
|
|
53
|
-
ariaLabel: { delimiter: "Carousel slide {0} of {1}" }
|
|
54
|
-
},
|
|
55
|
-
calendar: {
|
|
56
|
-
moreEvents: "{0} more",
|
|
57
|
-
today: "Today"
|
|
58
|
-
},
|
|
59
|
-
input: {
|
|
60
|
-
clear: "Clear {0}",
|
|
61
|
-
prependAction: "{0} prepended action",
|
|
62
|
-
appendAction: "{0} appended action",
|
|
63
|
-
otp: "Please enter OTP character {0}"
|
|
64
|
-
},
|
|
65
|
-
fileInput: {
|
|
66
|
-
counter: "{0} files",
|
|
67
|
-
counterSize: "{0} files ({1} in total)"
|
|
68
|
-
},
|
|
69
|
-
timePicker: {
|
|
70
|
-
am: "AM",
|
|
71
|
-
pm: "PM",
|
|
72
|
-
title: "Select Time"
|
|
73
|
-
},
|
|
74
|
-
pagination: { ariaLabel: {
|
|
75
|
-
root: "Pagination Navigation",
|
|
76
|
-
next: "Next page",
|
|
77
|
-
previous: "Previous page",
|
|
78
|
-
page: "Go to page {0}",
|
|
79
|
-
currentPage: "Page {0}, Current page",
|
|
80
|
-
first: "First page",
|
|
81
|
-
last: "Last page"
|
|
82
|
-
} },
|
|
83
|
-
stepper: {
|
|
84
|
-
next: "Next",
|
|
85
|
-
prev: "Previous"
|
|
86
|
-
},
|
|
87
|
-
rating: { ariaLabel: { item: "Rating {0} of {1}" } },
|
|
88
|
-
loading: "Loading...",
|
|
89
|
-
infiniteScroll: {
|
|
90
|
-
loadMore: "Load more",
|
|
91
|
-
empty: "No more"
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/i18n/locales/en/dlg.ts
|
|
97
|
-
var dlg_default = { common: {
|
|
98
|
-
ask: "Do you want to {verb} {object} <{name}> ?",
|
|
99
|
-
cancel: "Cancel",
|
|
100
|
-
confirm: "Confirm",
|
|
101
|
-
responding: "Responding..."
|
|
102
|
-
} };
|
|
103
|
-
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/i18n/locales/en/index.ts
|
|
106
|
-
var en_exports = /* @__PURE__ */ __exportAll({ default: () => en_default });
|
|
107
|
-
var en_default = {
|
|
108
|
-
$vuetify: $vuetify_default,
|
|
109
|
-
dlg: dlg_default
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
//#endregion
|
|
113
|
-
export { en_exports as t };
|