@duxweb/dvha-core 0.1.19 → 0.1.21
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/cjs/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/cjs/_virtual/dayjs.min.cjs +1 -0
- package/dist/cjs/_virtual/dayjs.min2.cjs +1 -0
- package/dist/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/render.cjs +1 -0
- package/dist/cjs/components/status/error.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -0
- package/dist/cjs/components/status/notAuthorized.cjs +1 -1
- package/dist/cjs/components/status/notFound.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -0
- package/dist/cjs/hooks/formValidate.cjs +1 -0
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +1 -1
- package/dist/cjs/hooks/json/index.cjs +1 -0
- package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -0
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -0
- package/dist/cjs/hooks/json/vFor.cjs +1 -0
- package/dist/cjs/hooks/json/vIf.cjs +1 -0
- package/dist/cjs/hooks/json/vModel.cjs +1 -0
- package/dist/cjs/hooks/json/vOn.cjs +1 -0
- package/dist/cjs/hooks/json/vShow.cjs +1 -0
- package/dist/cjs/hooks/json/vText.cjs +1 -0
- package/dist/cjs/hooks/json.cjs +1 -0
- package/dist/cjs/hooks/list.cjs +1 -0
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +2 -2
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/node_modules/dayjs/dayjs.min.cjs +1 -0
- package/dist/cjs/node_modules/jsep/dist/jsep.cjs +2 -0
- package/dist/cjs/node_modules/mitt/dist/mitt.cjs +1 -0
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/theme.cjs +9 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +6 -0
- package/dist/esm/_virtual/dayjs.min.js +7 -0
- package/dist/esm/_virtual/dayjs.min2.js +4 -0
- package/dist/esm/components/auth/can.js +11 -8
- package/dist/esm/components/loader/loader.js +47 -0
- package/dist/esm/components/loader/remote/loader.js +150 -0
- package/dist/esm/components/loader/remote/render.js +19 -0
- package/dist/esm/components/status/error.js +3 -3
- package/dist/esm/components/status/exception.js +23 -0
- package/dist/esm/components/status/notAuthorized.js +2 -2
- package/dist/esm/components/status/notFound.js +4 -4
- package/dist/esm/directive/permission.js +6 -3
- package/dist/esm/hooks/auth.js +67 -67
- package/dist/esm/hooks/data.js +187 -183
- package/dist/esm/hooks/export.js +26 -23
- package/dist/esm/hooks/form.js +38 -35
- package/dist/esm/hooks/formExtend.js +38 -0
- package/dist/esm/hooks/formValidate.js +28 -0
- package/dist/esm/hooks/i18n.js +16 -8
- package/dist/esm/hooks/json/index.js +23 -0
- package/dist/esm/hooks/json/utils/contextManager.js +31 -0
- package/dist/esm/hooks/json/utils/expressionParser.js +134 -0
- package/dist/esm/hooks/json/vFor.js +57 -0
- package/dist/esm/hooks/json/vIf.js +17 -0
- package/dist/esm/hooks/json/vModel.js +78 -0
- package/dist/esm/hooks/json/vOn.js +32 -0
- package/dist/esm/hooks/json/vShow.js +24 -0
- package/dist/esm/hooks/json/vText.js +54 -0
- package/dist/esm/hooks/json.js +80 -0
- package/dist/esm/hooks/list.js +179 -0
- package/dist/esm/hooks/manage.js +19 -14
- package/dist/esm/hooks/overlay.js +7 -4
- package/dist/esm/hooks/theme.js +72 -72
- package/dist/esm/index.js +132 -100
- package/dist/esm/main.js +22 -12
- package/dist/esm/node_modules/dayjs/dayjs.min.js +282 -0
- package/dist/esm/node_modules/jsep/dist/jsep.js +737 -0
- package/dist/esm/node_modules/mitt/dist/mitt.js +19 -0
- package/dist/esm/preset/i18nProvider.js +21 -13
- package/dist/esm/provider/app.js +62 -53
- package/dist/esm/stores/manage.js +23 -15
- package/dist/esm/stores/tab.js +58 -49
- package/dist/esm/utils/theme.js +89 -76
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/loader/loader.d.ts +2 -0
- package/dist/types/components/loader/remote/index.d.ts +2 -0
- package/dist/types/components/loader/remote/loader.d.ts +1 -0
- package/dist/types/components/loader/remote/render.d.ts +1 -0
- package/dist/types/components/status/error.d.ts +1 -2
- package/dist/types/components/status/exception.d.ts +3 -0
- package/dist/types/components/status/index.d.ts +4 -0
- package/dist/types/components/status/notAuthorized.d.ts +1 -2
- package/dist/types/components/status/notFound.d.ts +1 -2
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/hooks/auth.d.ts +6 -6
- package/dist/types/hooks/data.d.ts +30 -30
- package/dist/types/hooks/form.d.ts +6 -3
- package/dist/types/hooks/formExtend.d.ts +12 -0
- package/dist/types/hooks/formValidate.d.ts +14 -0
- package/dist/types/hooks/i18n.d.ts +2 -0
- package/dist/types/hooks/import.d.ts +1 -2
- package/dist/types/hooks/index.d.ts +6 -1
- package/dist/types/hooks/json/types.d.ts +1 -0
- package/dist/types/hooks/json.d.ts +2 -3
- package/dist/types/hooks/list.d.ts +66 -0
- package/dist/types/hooks/manage.d.ts +1 -0
- package/dist/types/hooks/overlay.d.ts +4 -0
- package/dist/types/index.d.ts +6 -5
- package/dist/types/preset/i18nProvider.d.ts +1 -1
- package/dist/types/stores/route.d.ts +180 -180
- package/dist/types/stores/tab.d.ts +1112 -73
- package/dist/types/types/config.d.ts +9 -0
- package/dist/types/types/data.d.ts +1 -1
- package/dist/types/types/i18n.d.ts +1 -0
- package/dist/types/types/manage.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +4 -49
- package/package.json +11 -5
- /package/dist/cjs/{hooks/themeColor.cjs → config/color.cjs} +0 -0
- /package/dist/esm/{hooks/themeColor.js → config/color.js} +0 -0
- /package/dist/types/{hooks/themeColor.d.ts → config/color.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("vue"),T=require("@overlastic/vue"),U=require("vue-router"),B=require("../hooks/auth.cjs"),G=require("../hooks/config.cjs");require("@tanstack/vue-query");const H=require("../hooks/manage.cjs");require("json-2-csv");require("lodash-es");require("@vee-validate/rules");require("vee-validate");const J=require("../stores/auth.cjs"),K=require("../stores/route.cjs");require("pinia");const Q=require("../stores/manage.cjs"),W=require("../stores/i18n.cjs");require("@vueuse/core");require("../hooks/json/index.cjs");require("colorizr");require("axios");require("clsx");const X=require("../components/status/error.cjs"),Y=require("../components/status/notAuthorized.cjs"),Z=require("../components/status/notFound.cjs"),x=h.defineComponent({name:"DuxAppProvider",props:{},setup(ee,{slots:p}){const f=h.inject("dux.manage"),s=G.useConfig(),d=U.useRouter();return d.beforeEach(async(o,re,a)=>{var P,b,$,A,R,S,M,k,z,D,w,y,F,I;const r=o.meta.manageName,O=o.meta.authorization===!1;if(!r){const e=s.defaultManage||((b=(P=s.manages)==null?void 0:P[0])==null?void 0:b.name)||"";return a({path:`/${e}`,replace:!0})}f&&(f.value=r);const m=Q.useManageStore(r);m.isInit()||m.setConfig(($=s.manages)==null?void 0:$.find(e=>e.name===r),s);const i=K.useRouteStore(r),n=H.useManage(r),l=J.useAuthStore(r),g=W.useI18nStore(r);if((A=n.config)!=null&&A.i18nProvider&&!g.isInit()){const e=g.getLocale();e&&((R=n.config)==null||R.i18nProvider.changeLocale(e))}if(!l.isLogin())return O?a():a({path:n.getRoutePath("login"),replace:!0});const q=e=>e==null?void 0:e.map(u=>({...u,path:u.path?n.getRoutePath(u.path):void 0}));if(!i.getRouteInit()){const e=((S=n.config)==null?void 0:S.components)||{},u=[];if(u.push({name:`${r}.notFound`,label:"404",path:":pathMatch(.*)*",component:e.notFound||Z.DuxNotFound,hidden:!0,meta:{can:!1}}),u.push({name:`${r}.notAuthorized`,label:"403",path:"notAuthorized",component:e.notAuthorized||Y.DuxNotAuthorized,hidden:!0,meta:{can:!1}}),u.push({name:`${r}.error`,label:"500",path:"error",component:e.error||X.DuxError,hidden:!0,meta:{can:!1}}),i.setRoutes(q(((M=n.config)==null?void 0:M.menus)||[])),(k=n.config)!=null&&k.apiRoutePath)try{await((w=(D=(z=n.config)==null?void 0:z.dataProvider)==null?void 0:D.default)==null?void 0:w.custom({path:n.config.apiRoutePath,meta:{timeout:5e3}},n,l.getUser()).then(t=>{i.appendRoutes(q(t.data||[]))}))}catch(t){console.error(t)}return i.appendRoutes(u),i.getRoutes().forEach(t=>{var N,C,E,L;if(!t.path)return;const c={name:t.name,path:t.path,meta:t.meta};switch(t.loader){case"iframe":c.component=((C=(N=n.config)==null?void 0:N.components)==null?void 0:C.iframe)||(()=>Promise.resolve().then(()=>require("../components/loader/iframe.cjs")));break;case"remote":c.component=((L=(E=n.config)==null?void 0:E.components)==null?void 0:L.remote)||(()=>Promise.resolve().then(()=>require("../components/loader/loader.cjs")));break;case"link":c.beforeEnter=()=>{var j;const _=((j=t.meta)==null?void 0:j.url)||t.path;return _&&window.open(_,"_blank"),!1},c.component=()=>Promise.resolve({template:"<div></div>"});break;default:t.component&&(c.component=t.component);break}d.addRoute(`${r}.auth`,c)}),a({path:((y=o.redirectedFrom)==null?void 0:y.path)||o.path,replace:!0})}const v=["","/",`/${r}`,`/${r}/`];if(v.includes(o.path)){const e=i.getIndexRoute();return!(e!=null&&e.path)||v.includes(e==null?void 0:e.path)?(console.warn("[Dux] index route not found, skip redirect"),a()):a({path:(e==null?void 0:e.path)||"/",replace:!0})}const V=B.useCan(r);return(((F=o.meta)==null?void 0:F.can)===void 0||((I=o.meta)==null?void 0:I.can)===!0)&&!V(o.name)?a({name:`${r}.notAuthorized`}):a()}),()=>h.createVNode(T.OverlaysProvider,null,{default:()=>{var o;return[(o=p.default)==null?void 0:o.call(p)]}})}});exports.DuxAppProvider=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("lodash-es"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("lodash-es"),h=require("pinia"),o=require("vue");function v(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.getList!="function"}function y(r){const i=o.inject("dux.manage");if(r||(r=(i==null?void 0:i.value)||""),!r)throw new Error("manage not found");return S(r)()}function S(r){return h.defineStore(`manages-${r}`,()=>{const i=o.ref(),c=o.ref(!1);return{config:i,isInit:()=>{const n=c.value;return c.value=!0,n},setConfig:(n,e)=>{const t=P.cloneDeep(n),u=[];t.title&&u.push(t.title),e.title&&u.push(e.title),t.title=u.join(" - "),t.copyright=t.copyright||e.copyright,t.description=t.description||e.description,t.theme={...e==null?void 0:e.theme,...t==null?void 0:t.theme};const d={};e!=null&&e.dataProvider&&(v(e.dataProvider)?Object.keys(e.dataProvider).forEach(s=>{d[s]=e.dataProvider[s]}):d.default=e.dataProvider),t!=null&&t.dataProvider&&(v(t.dataProvider)?Object.keys(t.dataProvider).forEach(s=>{d[s]=t.dataProvider[s]}):d.default=t.dataProvider),t.authProvider=(e==null?void 0:e.authProvider)||(t==null?void 0:t.authProvider),t.dataProvider=d,t.i18nProvider=(e==null?void 0:e.i18nProvider)||(t==null?void 0:t.i18nProvider),t.layoutComponent={...e.layoutComponent,...t.layoutComponent};const p={...e.components,...t.components};t.components=p,t.remote={...e.remote,...t.remote},i.value=t},getConfig:()=>i.value}})}exports.useManageStore=y;
|
package/dist/cjs/stores/tab.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("pinia"),s=require("vue");function p(r){const u=s.inject("dux.manage");if(r||(r=(u==null?void 0:u.value)||""),!r)throw new Error("manage not found");return c(r)()}function c(r){return h.defineStore(`tab-${r}`,()=>{const u=s.ref(),o=s.ref(),e=s.ref([]);return{current:u,tabs:e,isTab:l=>e.value.some(a=>a.path===l),addTab:(l,a)=>{l.path&&(e.value.some(t=>t.path===l.path)?(u.value&&u.value!==l.path&&(o.value=e.value.find(t=>t.path===u.value)),u.value=l.path):(u.value&&(o.value=e.value.find(t=>t.path===u.value)),e.value.push(l),a==null||a(l),u.value=l.path))},delTab:(l,a)=>{var d;const t=e.value.findIndex(i=>i.path===l);if(t===-1||e.value.length<=1)return;const n=e.value[t];if((d=n==null?void 0:n.meta)!=null&&d.lock)return;let v;if(l===u.value&&o.value&&(v=e.value.find(i=>{var f;return i.path===((f=o.value)==null?void 0:f.path)&&i.path!==l})),!v){const i=e.value[t-1],f=e.value[t+1];v=i||f}e.value.splice(t,1),a==null||a(v)},changeTab:(l,a)=>{const t=e.value.find(n=>n.path===l);t&&(u.value&&u.value!==l&&(o.value=e.value.find(n=>n.path===u.value)),u.value=l,a==null||a(t))},delOther:(l,a)=>{e.value=e.value.filter(t=>{var n;return t.path===l||((n=t.meta)==null?void 0:n.lock)}),a==null||a()},delLeft:(l,a)=>{const t=e.value.findIndex(n=>n.path===l);t<=0||s.nextTick(()=>{e.value=[...e.value.slice(0,t).filter(n=>{var v;return(v=n.meta)==null?void 0:v.lock}),...e.value.slice(t)],a==null||a()})},delRight:(l,a)=>{const t=e.value.findIndex(n=>n.path===l);t===-1||t===e.value.length-1||s.nextTick(()=>{e.value=[...e.value.slice(0,t+1),...e.value.slice(t+1).filter(n=>{var v;return(v=n.meta)==null?void 0:v.lock})],a==null||a()})},lockTab:l=>{const a=e.value.findIndex(t=>t.path===l);a!==-1&&e.value[a]&&(e.value[a].meta||(e.value[a].meta={}),e.value[a].meta.lock=!e.value[a].meta.lock)},clearTab:()=>{u.value=void 0,o.value=void 0,e.value=[]}}})}exports.createTabStore=c;exports.useTabStore=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("pinia"),n=require("vue"),s={primary:"blue",info:"cyan",success:"green",warning:"amber",error:"red",gray:"gray"};function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("pinia"),n=require("vue"),s={primary:"blue",info:"cyan",success:"green",warning:"amber",error:"red",gray:"gray"};function T(t){const e=n.inject("dux.manage");if(t||(t=(e==null?void 0:e.value)||""),!t)throw new Error("manage not found");return v(t)()}function v(t){return d.defineStore(`theme-${t}`,()=>{const e=n.ref(s),o=n.ref("auto"),u=n.ref(!1);function i(){u.value=!0}function c(r){o.value=r}function f(r,m){e.value[r]=m}function l(r){Object.assign(e.value,r)}function a(){e.value={...s}}function h(){return e.value}return{mode:o,setMode:c,theme:e,cssInit:u,setCssInit:i,setThemeColor:f,setThemeColors:l,resetTheme:a,getTheme:h}},{persist:{pick:["theme","mode"]}})}exports.useThemeStore=T;
|
package/dist/cjs/utils/theme.cjs
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(s){return`rgb(var(${s}))`}function f(s,u){return`color-mix(in oklab, rgb(var(${s})) var(${u}, 100%), transparent)`}function O(s){const u=["50","100","200","300","400","500","600","700","800","900","950"],E=["primary","info","success","warning","error","gray"],x=["hover","pressed","focus","disabled"],n={white:{DEFAULT:p("--ui-color-white")},black:{DEFAULT:p("--ui-color-black")}};Object.keys(s).forEach(r=>{n[r]={},u.forEach(e=>{n[r][e]=p(`--base-color-${r}-${e}`)})}),E.forEach(r=>{n[r]={DEFAULT:f(`--ui-color-${r}`,"--un-text-opacity")},u.forEach(e=>{n[r][e]=f(`--ui-color-${r}-${e}`,"--un-text-opacity")}),x.forEach(e=>{n[r][e]=f(`--ui-color-${r}-${e}`,"--un-text-opacity")})});const l={text:["default","dimmed","muted","toned","highlighted","inverted"],bg:["default","muted","elevated","accented","inverted"],border:["default","muted","accented","inverted"]};function a(r,e,i,t,d){const c=[];return i.forEach(o=>{const m=`--ui-${d||r}${o==="default"?"":`-${o}`}`;c.push([`${r}-${o}`,{[e]:`color-mix(in oklab, rgb(var(${m})) var(${t}, 100%), transparent)`,[t]:"100%"}]),c.push([new RegExp(`^${r}-${o}\\/(\\d*\\.?\\d+)(%?)$`),([,b,P])=>{const g=Number(b);let h;return P||g>1?h=`${g}%`:h=`${g*100}%`,{[e]:`color-mix(in oklab, rgb(var(${m})) var(${t}, 100%), transparent)`,[t]:h}}]),c.push([new RegExp(`^${r}-${o}\\[(.+)\\]$`),([,b])=>({[e]:b.replace(/_/g," ")})])}),c}const v=a("text","color",l.text,"--un-text-opacity"),R=a("bg","background-color",l.bg,"--un-bg-opacity"),y=a("border","border-color",l.border,"--un-border-opacity"),S=a("ring","--un-ring-color",l.border,"--un-ring-opacity","border"),$=[];l.border.forEach(r=>{const e=`--ui-border${r==="default"?"":`-${r}`}`;$.push([new RegExp(`^divide-${r}$`),(i,{rawSelector:t})=>`
|
|
2
|
+
.${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")} > :not(:last-child) {
|
|
3
|
+
border-color: color-mix(in oklab, rgb(var(${e})) var(--un-border-opacity, 100%), transparent);
|
|
4
|
+
--un-border-opacity: 100%;
|
|
5
|
+
}`]),$.push([new RegExp(`^divide-${r}\\/(\\d*\\.?\\d+)(%?)$`),([,i,t],{rawSelector:d})=>{const c=Number(i);let o;return t||c>1?o=`${c}%`:o=`${c*100}%`,`
|
|
6
|
+
.${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")} > :not(:last-child) {
|
|
7
|
+
border-color: color-mix(in oklab, rgb(var(${e})) var(--un-border-opacity, 100%), transparent);
|
|
8
|
+
--un-border-opacity: ${o};
|
|
9
|
+
}`}])});const k=[...v,...R,...y,...S,...$];return{name:"preset-theme",theme:{colors:n},rules:k}}exports.themePreset=O;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCan as
|
|
1
|
+
import { defineComponent as e } from "vue";
|
|
2
|
+
import { useCan as n } from "../../hooks/auth.js";
|
|
3
3
|
import "@tanstack/vue-query";
|
|
4
4
|
import "lodash-es";
|
|
5
|
+
import "vue-router";
|
|
5
6
|
import "pinia";
|
|
6
7
|
import "json-2-csv";
|
|
8
|
+
import "@vee-validate/rules";
|
|
9
|
+
import "vee-validate";
|
|
7
10
|
import "@vueuse/core";
|
|
8
|
-
import "
|
|
11
|
+
import "../../hooks/json/index.js";
|
|
9
12
|
import "@overlastic/vue";
|
|
10
13
|
import "clsx";
|
|
11
14
|
import "colorizr";
|
|
12
15
|
import "axios";
|
|
13
|
-
const
|
|
16
|
+
const O = /* @__PURE__ */ e({
|
|
14
17
|
name: "DuxCan",
|
|
15
18
|
props: {
|
|
16
19
|
name: {
|
|
@@ -24,13 +27,13 @@ const j = /* @__PURE__ */ n({
|
|
|
24
27
|
setup(m, {
|
|
25
28
|
slots: r
|
|
26
29
|
}) {
|
|
27
|
-
const
|
|
30
|
+
const t = n();
|
|
28
31
|
return () => {
|
|
29
|
-
var p,
|
|
30
|
-
return
|
|
32
|
+
var p, i;
|
|
33
|
+
return t(m.name, m.params) ? (p = r.default) == null ? void 0 : p.call(r) : ((i = r.fallback) == null ? void 0 : i.call(r)) || null;
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
export {
|
|
35
|
-
|
|
38
|
+
O as DuxCan
|
|
36
39
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as p, createVNode as o, Suspense as i, h as n } from "vue";
|
|
2
|
+
import "vue-router";
|
|
3
|
+
import "pinia";
|
|
4
|
+
import { useManage as l } from "../../hooks/manage.js";
|
|
5
|
+
import "@tanstack/vue-query";
|
|
6
|
+
import "json-2-csv";
|
|
7
|
+
import "lodash-es";
|
|
8
|
+
import "@vee-validate/rules";
|
|
9
|
+
import "vee-validate";
|
|
10
|
+
import "@vueuse/core";
|
|
11
|
+
import "../../hooks/json/index.js";
|
|
12
|
+
import "@overlastic/vue";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import { DuxException as a } from "../status/exception.js";
|
|
15
|
+
import "colorizr";
|
|
16
|
+
import "axios";
|
|
17
|
+
import "crypto-js";
|
|
18
|
+
import "../../_virtual/dayjs.min.js";
|
|
19
|
+
import "mathjs";
|
|
20
|
+
import "mime";
|
|
21
|
+
import "vue3-sfc-loader";
|
|
22
|
+
import "pinia-plugin-persistedstate";
|
|
23
|
+
import "vue-i18n";
|
|
24
|
+
import { DuxRemoteRender as u } from "./remote/render.js";
|
|
25
|
+
const A = /* @__PURE__ */ p({
|
|
26
|
+
name: "DuxLoaderRemote",
|
|
27
|
+
setup(d) {
|
|
28
|
+
const {
|
|
29
|
+
config: e
|
|
30
|
+
} = l(), m = () => {
|
|
31
|
+
var t;
|
|
32
|
+
const r = (t = e.components) == null ? void 0 : t.loading;
|
|
33
|
+
return r ? n(r) : null;
|
|
34
|
+
};
|
|
35
|
+
return () => o("div", {
|
|
36
|
+
class: "app-remote-loader"
|
|
37
|
+
}, [o(a, null, {
|
|
38
|
+
default: () => [o(i, null, {
|
|
39
|
+
default: () => o(u, null, null),
|
|
40
|
+
fallback: () => m()
|
|
41
|
+
})]
|
|
42
|
+
})]);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
A as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as b from "vue";
|
|
2
|
+
import { createVNode as E } from "vue";
|
|
3
|
+
import * as k from "@tanstack/vue-query";
|
|
4
|
+
import * as J from "@vueuse/core";
|
|
5
|
+
import T from "axios";
|
|
6
|
+
import $ from "crypto-js";
|
|
7
|
+
import L from "../../../_virtual/dayjs.min.js";
|
|
8
|
+
import * as N from "lodash-es";
|
|
9
|
+
import * as O from "mathjs";
|
|
10
|
+
import g from "mime";
|
|
11
|
+
import W from "../../../node_modules/mitt/dist/mitt.js";
|
|
12
|
+
import * as q from "pinia";
|
|
13
|
+
import { loadModule as F } from "vue3-sfc-loader";
|
|
14
|
+
import * as V from "vue-router";
|
|
15
|
+
import { useManage as _ } from "../../../hooks/manage.js";
|
|
16
|
+
import { useClient as A } from "../../../hooks/data.js";
|
|
17
|
+
import "json-2-csv";
|
|
18
|
+
import "@vee-validate/rules";
|
|
19
|
+
import "vee-validate";
|
|
20
|
+
import { useI18n as B } from "../../../hooks/i18n.js";
|
|
21
|
+
import { useJsonSchema as H } from "../../../hooks/json.js";
|
|
22
|
+
import "../../../hooks/json/index.js";
|
|
23
|
+
import "@overlastic/vue";
|
|
24
|
+
import "clsx";
|
|
25
|
+
import "colorizr";
|
|
26
|
+
import * as I from "../../../index.js";
|
|
27
|
+
const v = /* @__PURE__ */ new Map();
|
|
28
|
+
function Q(m) {
|
|
29
|
+
return $.MD5(m).toString().substring(0, 10);
|
|
30
|
+
}
|
|
31
|
+
function ct(m) {
|
|
32
|
+
var l;
|
|
33
|
+
const h = A(), {
|
|
34
|
+
mergeLocale: d
|
|
35
|
+
} = B(), {
|
|
36
|
+
config: r
|
|
37
|
+
} = _(), x = {
|
|
38
|
+
moduleCache: {
|
|
39
|
+
vue: b,
|
|
40
|
+
"@duxweb/dvha-core": I,
|
|
41
|
+
"@vueuse/core": J,
|
|
42
|
+
"@tanstack/vue-query": k,
|
|
43
|
+
axios: T,
|
|
44
|
+
crypto: $,
|
|
45
|
+
mime: g,
|
|
46
|
+
math: O,
|
|
47
|
+
mitt: W,
|
|
48
|
+
"lodash-es": N,
|
|
49
|
+
pinia: q,
|
|
50
|
+
dayjs: L,
|
|
51
|
+
"vue-router": V,
|
|
52
|
+
...(l = r == null ? void 0 : r.remote) == null ? void 0 : l.packages,
|
|
53
|
+
"static!": function(e, o, t) {
|
|
54
|
+
const a = g.getType(t);
|
|
55
|
+
if (a != null && a.startsWith("image"))
|
|
56
|
+
return `data:${a};charset=utf-8;base64,${btoa(e)}`;
|
|
57
|
+
if (t === ".json")
|
|
58
|
+
return JSON.parse(e);
|
|
59
|
+
throw new Error(`${t} unable to parse`);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
async handleModule(e, o) {
|
|
63
|
+
if (e !== ".vue") {
|
|
64
|
+
if (e === ".json") {
|
|
65
|
+
const t = await o(), {
|
|
66
|
+
render: a
|
|
67
|
+
} = H({
|
|
68
|
+
data: (t == null ? void 0 : t.nodes) || {},
|
|
69
|
+
context: (t == null ? void 0 : t.data) || {}
|
|
70
|
+
});
|
|
71
|
+
return () => E(a, null, null);
|
|
72
|
+
}
|
|
73
|
+
return o();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
customBlockHandler(e) {
|
|
77
|
+
if (e.type === "i18n") {
|
|
78
|
+
const o = JSON.parse(e.content);
|
|
79
|
+
for (const t in o)
|
|
80
|
+
d(t, o[t]);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
getFile: async (e) => {
|
|
84
|
+
var t, a, u, c;
|
|
85
|
+
e = w(e, ".vue"), e = w(e, ".json");
|
|
86
|
+
const o = await h.request({
|
|
87
|
+
path: typeof ((t = r == null ? void 0 : r.remote) == null ? void 0 : t.apiRoutePath) == "function" ? (a = r == null ? void 0 : r.remote) == null ? void 0 : a.apiRoutePath(e) : ((u = r == null ? void 0 : r.remote) == null ? void 0 : u.apiRoutePath) || "static",
|
|
88
|
+
payload: {
|
|
89
|
+
path: e
|
|
90
|
+
},
|
|
91
|
+
method: ((c = r == null ? void 0 : r.remote) == null ? void 0 : c.apiMethod) || "POST"
|
|
92
|
+
}).then((s) => s == null ? void 0 : s.data).catch((s) => {
|
|
93
|
+
throw new Error(`${s == null ? void 0 : s.message} ${e}`);
|
|
94
|
+
});
|
|
95
|
+
return await setTimeout(() => {
|
|
96
|
+
console.log("res", o);
|
|
97
|
+
}, 1e4), {
|
|
98
|
+
getContentData: () => o == null ? void 0 : o.content,
|
|
99
|
+
type: `${(o == null ? void 0 : o.type) || "vue"}`
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
getResource({
|
|
103
|
+
refPath: e,
|
|
104
|
+
relPath: o
|
|
105
|
+
}, t) {
|
|
106
|
+
const {
|
|
107
|
+
moduleCache: a,
|
|
108
|
+
pathResolve: u,
|
|
109
|
+
getFile: c
|
|
110
|
+
} = t, [s, ...y] = o.match(/([^!]+!)|[^!]+$/g).reverse(), C = (n, p, f, S) => y.reduce((j, M) => a[M](j, p, f, S), n), i = u({
|
|
111
|
+
refPath: e,
|
|
112
|
+
relPath: s
|
|
113
|
+
}, t), R = y.join("") + i, P = (n) => n.startsWith("@") ? !0 : !n.includes("/") && !n.startsWith(".");
|
|
114
|
+
return {
|
|
115
|
+
id: R,
|
|
116
|
+
path: i,
|
|
117
|
+
async getContent() {
|
|
118
|
+
if (P(i))
|
|
119
|
+
throw new Error(`Package ${i} not imported`);
|
|
120
|
+
const {
|
|
121
|
+
getContentData: n,
|
|
122
|
+
type: p
|
|
123
|
+
} = await c(i);
|
|
124
|
+
return {
|
|
125
|
+
getContentData: async (f) => C(await n(f), i, p, t),
|
|
126
|
+
type: p
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
addStyle(e) {
|
|
132
|
+
const o = Q(e);
|
|
133
|
+
if (v.has(o))
|
|
134
|
+
return;
|
|
135
|
+
v.set(o, !0);
|
|
136
|
+
const t = document.createElement("style");
|
|
137
|
+
t.textContent = e, t.setAttribute("data-hash", o), document.head.appendChild(t);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return () => F(`${m}`, {
|
|
141
|
+
...x
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function w(m, h) {
|
|
145
|
+
const d = new RegExp(`${h}$`);
|
|
146
|
+
return m.replace(d, "");
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
ct as sfcLoader
|
|
150
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent as m, defineAsyncComponent as n, createVNode as p } from "vue";
|
|
2
|
+
import { useRoute as u } from "vue-router";
|
|
3
|
+
import "pinia";
|
|
4
|
+
import { useRouteStore as s } from "../../../stores/route.js";
|
|
5
|
+
import "lodash-es";
|
|
6
|
+
import { sfcLoader as c } from "./loader.js";
|
|
7
|
+
const S = /* @__PURE__ */ m({
|
|
8
|
+
name: "DuxRemoteRender",
|
|
9
|
+
setup(a) {
|
|
10
|
+
var o;
|
|
11
|
+
const t = u(), e = s().searchRouteName(t.name), r = n({
|
|
12
|
+
loader: c((o = e == null ? void 0 : e.meta) == null ? void 0 : o.path)
|
|
13
|
+
});
|
|
14
|
+
return () => p(r, null, null);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
S as DuxRemoteRender
|
|
19
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as n, createVNode as
|
|
1
|
+
import { defineComponent as n, createVNode as r, createTextVNode as e } from "vue";
|
|
2
2
|
const t = /* @__PURE__ */ n({
|
|
3
3
|
name: "DuxError",
|
|
4
4
|
setup() {
|
|
5
|
-
return () =>
|
|
5
|
+
return () => r("div", null, [r("h1", null, [e("500")]), r("p", null, [e("Internal Server Error")])]);
|
|
6
6
|
}
|
|
7
7
|
});
|
|
8
8
|
export {
|
|
9
|
-
t as
|
|
9
|
+
t as DuxError
|
|
10
10
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineComponent as a, ref as c, onErrorCaptured as i, createVNode as o, createTextVNode as p } from "vue";
|
|
2
|
+
import { useRoute as d } from "vue-router";
|
|
3
|
+
const x = /* @__PURE__ */ a({
|
|
4
|
+
name: "DuxException",
|
|
5
|
+
setup(f, {
|
|
6
|
+
slots: t
|
|
7
|
+
}) {
|
|
8
|
+
const n = c(null), r = d();
|
|
9
|
+
return i((e) => (console.error(e), r.name ? n.value = {
|
|
10
|
+
title: "500",
|
|
11
|
+
desc: (e == null ? void 0 : e.message) || "Internal Server Error"
|
|
12
|
+
} : n.value = {
|
|
13
|
+
title: "404",
|
|
14
|
+
desc: "Page not found"
|
|
15
|
+
}, !1)), () => {
|
|
16
|
+
var e, u, l;
|
|
17
|
+
return n.value ? o("div", null, [o("h1", null, [((e = n.value) == null ? void 0 : e.title) || "Unknown"]), o("p", null, [((u = n.value) == null ? void 0 : u.desc) || "Unknown Description"]), o("p", null, [p("Use config.components.exception to configure the exception layout")])]) : (l = t.default) == null ? void 0 : l.call(t);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
x as DuxException
|
|
23
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as o, createVNode as e, createTextVNode as t } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const u = /* @__PURE__ */ o({
|
|
3
3
|
name: "DuxNotAuthorized",
|
|
4
4
|
setup() {
|
|
5
5
|
return () => e("div", null, [e("h1", null, [t("403")]), e("p", null, [t("You are not authorized to access this page")])]);
|
|
6
6
|
}
|
|
7
7
|
});
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
u as DuxNotAuthorized
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const u = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as n, createVNode as e, createTextVNode as o } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ n({
|
|
3
3
|
name: "DuxNotFound",
|
|
4
4
|
setup() {
|
|
5
|
-
return () => e("div", null, [e("h1", null, [
|
|
5
|
+
return () => e("div", null, [e("h1", null, [o("404")]), e("p", null, [o("Page not found")])]);
|
|
6
6
|
}
|
|
7
7
|
});
|
|
8
8
|
export {
|
|
9
|
-
u as
|
|
9
|
+
u as DuxNotFound
|
|
10
10
|
};
|
|
@@ -2,15 +2,18 @@ import { useCan as m } from "../hooks/auth.js";
|
|
|
2
2
|
import "vue";
|
|
3
3
|
import "@tanstack/vue-query";
|
|
4
4
|
import "lodash-es";
|
|
5
|
+
import "vue-router";
|
|
5
6
|
import "pinia";
|
|
6
7
|
import "json-2-csv";
|
|
8
|
+
import "@vee-validate/rules";
|
|
9
|
+
import "vee-validate";
|
|
7
10
|
import "@vueuse/core";
|
|
8
|
-
import "
|
|
11
|
+
import "../hooks/json/index.js";
|
|
9
12
|
import "@overlastic/vue";
|
|
10
13
|
import "clsx";
|
|
11
14
|
import "colorizr";
|
|
12
15
|
import "axios";
|
|
13
|
-
const
|
|
16
|
+
const b = {
|
|
14
17
|
mounted(t, i) {
|
|
15
18
|
var r;
|
|
16
19
|
const { value: o } = i;
|
|
@@ -20,5 +23,5 @@ const x = {
|
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
export {
|
|
23
|
-
|
|
26
|
+
b as permissionDirective
|
|
24
27
|
};
|