@duxweb/dvha-core 1.0.35 → 1.0.36
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("vue"),O=require("@tanstack/vue-query"),M=require("@vueuse/core"),C=require("axios"),q=require("crypto-js"),W=require("dayjs"),T=require("lodash-es"),k=require("mathjs"),l=require("mime"),E=require("mitt"),L=require("pinia"),D=require("vue3-sfc-loader"),J=require("vue-router"),N=require("../../../hooks/manage.cjs"),V=require("../../../hooks/data.cjs");require("json-2-csv");require("@vee-validate/rules");require("vee-validate");const B=require("../../../hooks/i18n.cjs"),F=require("../../../hooks/json.cjs");require("../../../hooks/json/index.cjs");require("../../../utils/bus.cjs");require("@overlastic/vue");require("clsx");require("colorizr");const Q=require("../../../index.cjs");function i(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(c,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return c.default=n,Object.freeze(c)}const U=i(y),z=i(O),A=i(M),H=i(T),I=i(k),G=i(L),K=i(J),f=new Map;function X(n){return q.MD5(n).toString().substring(0,10)}function Y(n){const c=V.useClient(),{mergeLocale:o}=B.useI18n(),{config:a}=N.useManage(),v={moduleCache:{vue:U,"@duxweb/dvha-core":Q,"@vueuse/core":A,"@tanstack/vue-query":z,axios:C,crypto:q,mime:l,math:I,mitt:E,"lodash-es":H,pinia:G,dayjs:W,"vue-router":K,...a?.remote?.packages,"static!":function(e,r,t){const s=l.getType(t);if(s?.startsWith("image"))return`data:${s};charset=utf-8;base64,${btoa(e)}`;if(t===".json")return JSON.parse(e);throw new Error(`${t} unable to parse`)}},async handleModule(e,r){if(e!==".vue"){if(e===".json"){const t=await r(),{render:s}=F.useJsonSchema({data:t?.nodes||{},context:t?.data||{}});return()=>y.createVNode(s,null,null)}if(e!==".mjs")return r()}},customBlockHandler(e){if(e.type==="i18n"){const r=JSON.parse(e.content);for(const t in r)o(t,r[t])}},getFile:async e=>{e=g(e,".vue"),e=g(e,".json");const r=await c.request({path:typeof a?.remote?.apiRoutePath=="function"?a?.remote?.apiRoutePath(e):a?.remote?.apiRoutePath||"static",payload:{path:e},method:a?.remote?.apiMethod||"POST"}).then(s=>s?.data).catch(s=>{throw new Error(`${s?.message} ${e}`)});let t=r?.type||".vue";return(r?.type?.endsWith("js")||r?.type?.endsWith("ts")||r?.type?.endsWith("jsx")||r?.type?.endsWith("tsx"))&&(t=".mjs"),{content:r?.content,type:t}},getResource({refPath:e,relPath:r},t){const{moduleCache:s,pathResolve:_,getFile:j}=t,[b,...m]=r.match(/([^!]+!)|[^!]+$/g).reverse(),w=(u,h,p,x)=>m.reduce((R,$)=>s[$](R,h,p,x),u),d=_({refPath:e,relPath:b},t),S=m.join("")+d,P=u=>u.startsWith("@")?!0:!u.includes("/")&&!u.startsWith(".");return{id:S,path:d,async getContent(){if(P(d))throw new Error(`Package ${d} not imported`);const{content:u,type:h}=await j(d);return{getContentData:async p=>w(u,d,h,t),type:h}}}},addStyle(e){const r=X(e);if(f.has(r))return;f.set(r,!0);const t=document.createElement("style");t.textContent=e,t.setAttribute("data-hash",r),document.head.appendChild(t)}};return()=>D.loadModule(`${n}`,{...v})}function g(n,c){const o=new RegExp(`${c}$`);return n.replace(o,"")}exports.sfcLoader=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("vue"),O=require("@tanstack/vue-query"),M=require("@vueuse/core"),C=require("axios"),q=require("crypto-js"),W=require("dayjs"),T=require("lodash-es"),k=require("mathjs"),l=require("mime"),E=require("mitt"),L=require("pinia"),D=require("vue3-sfc-loader"),J=require("vue-router"),N=require("../../../hooks/manage.cjs"),V=require("../../../hooks/data.cjs");require("json-2-csv");require("@vee-validate/rules");require("vee-validate");const B=require("../../../hooks/i18n.cjs"),F=require("../../../hooks/json.cjs");require("../../../hooks/json/index.cjs");require("../../../utils/bus.cjs");require("@overlastic/vue");require("clsx");require("colorizr");const Q=require("../../../index.cjs");function i(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(c,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return c.default=n,Object.freeze(c)}const U=i(y),z=i(O),A=i(M),H=i(T),I=i(k),G=i(L),K=i(J),f=new Map;function X(n){return q.MD5(n).toString().substring(0,10)}function Y(n){const c=V.useClient(),{mergeLocale:o}=B.useI18n(),{config:a}=N.useManage(),v={moduleCache:{vue:U,"@duxweb/dvha-core":Q,"@vueuse/core":A,"@tanstack/vue-query":z,axios:C,"crypto-js":q,mime:l,math:I,mitt:E,"lodash-es":H,pinia:G,dayjs:W,"vue-router":K,...a?.remote?.packages,"static!":function(e,r,t){const s=l.getType(t);if(s?.startsWith("image"))return`data:${s};charset=utf-8;base64,${btoa(e)}`;if(t===".json")return JSON.parse(e);throw new Error(`${t} unable to parse`)}},async handleModule(e,r){if(e!==".vue"){if(e===".json"){const t=await r(),{render:s}=F.useJsonSchema({data:t?.nodes||{},context:t?.data||{}});return()=>y.createVNode(s,null,null)}if(e!==".mjs")return r()}},customBlockHandler(e){if(e.type==="i18n"){const r=JSON.parse(e.content);for(const t in r)o(t,r[t])}},getFile:async e=>{e=g(e,".vue"),e=g(e,".json");const r=await c.request({path:typeof a?.remote?.apiRoutePath=="function"?a?.remote?.apiRoutePath(e):a?.remote?.apiRoutePath||"static",payload:{path:e},method:a?.remote?.apiMethod||"POST"}).then(s=>s?.data).catch(s=>{throw new Error(`${s?.message} ${e}`)});let t=r?.type||".vue";return(r?.type?.endsWith("js")||r?.type?.endsWith("ts")||r?.type?.endsWith("jsx")||r?.type?.endsWith("tsx"))&&(t=".mjs"),{content:r?.content,type:t}},getResource({refPath:e,relPath:r},t){const{moduleCache:s,pathResolve:_,getFile:j}=t,[b,...m]=r.match(/([^!]+!)|[^!]+$/g).reverse(),w=(u,h,p,x)=>m.reduce((R,$)=>s[$](R,h,p,x),u),d=_({refPath:e,relPath:b},t),S=m.join("")+d,P=u=>u.startsWith("@")?!0:!u.includes("/")&&!u.startsWith(".");return{id:S,path:d,async getContent(){if(P(d))throw new Error(`Package ${d} not imported`);const{content:u,type:h}=await j(d);return{getContentData:async p=>w(u,d,h,t),type:h}}}},addStyle(e){const r=X(e);if(f.has(r))return;f.set(r,!0);const t=document.createElement("style");t.textContent=e,t.setAttribute("data-hash",r),document.head.appendChild(t)}};return()=>D.loadModule(`${n}`,{...v})}function g(n,c){const o=new RegExp(`${c}$`);return n.replace(o,"")}exports.sfcLoader=Y;
|
|
@@ -41,7 +41,7 @@ function ut(s) {
|
|
|
41
41
|
"@vueuse/core": E,
|
|
42
42
|
"@tanstack/vue-query": b,
|
|
43
43
|
axios: k,
|
|
44
|
-
crypto: y,
|
|
44
|
+
"crypto-js": y,
|
|
45
45
|
mime: h,
|
|
46
46
|
math: L,
|
|
47
47
|
mitt: N,
|
|
@@ -106,9 +106,9 @@ function ut(s) {
|
|
|
106
106
|
moduleCache: o,
|
|
107
107
|
pathResolve: v,
|
|
108
108
|
getFile: w
|
|
109
|
-
} = e, [
|
|
109
|
+
} = e, [j, ...p] = r.match(/([^!]+!)|[^!]+$/g).reverse(), x = (n, m, d, P) => p.reduce((S, C) => o[C](S, m, d, P), n), a = v({
|
|
110
110
|
refPath: t,
|
|
111
|
-
relPath:
|
|
111
|
+
relPath: j
|
|
112
112
|
}, e), $ = p.join("") + a, R = (n) => n.startsWith("@") ? !0 : !n.includes("/") && !n.startsWith(".");
|
|
113
113
|
return {
|
|
114
114
|
id: $,
|
|
@@ -121,7 +121,7 @@ function ut(s) {
|
|
|
121
121
|
type: m
|
|
122
122
|
} = await w(a);
|
|
123
123
|
return {
|
|
124
|
-
getContentData: async (d) =>
|
|
124
|
+
getContentData: async (d) => x(n, a, m, e),
|
|
125
125
|
type: m
|
|
126
126
|
};
|
|
127
127
|
}
|