@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.
Files changed (131) hide show
  1. package/dist/cjs/_virtual/_commonjsHelpers.cjs +1 -0
  2. package/dist/cjs/_virtual/dayjs.min.cjs +1 -0
  3. package/dist/cjs/_virtual/dayjs.min2.cjs +1 -0
  4. package/dist/cjs/components/auth/can.cjs +1 -1
  5. package/dist/cjs/components/loader/iframe.cjs +1 -1
  6. package/dist/cjs/components/loader/loader.cjs +1 -0
  7. package/dist/cjs/components/loader/remote/loader.cjs +1 -0
  8. package/dist/cjs/components/loader/remote/render.cjs +1 -0
  9. package/dist/cjs/components/status/error.cjs +1 -1
  10. package/dist/cjs/components/status/exception.cjs +1 -0
  11. package/dist/cjs/components/status/notAuthorized.cjs +1 -1
  12. package/dist/cjs/components/status/notFound.cjs +1 -1
  13. package/dist/cjs/directive/permission.cjs +1 -1
  14. package/dist/cjs/hooks/auth.cjs +1 -1
  15. package/dist/cjs/hooks/data.cjs +1 -1
  16. package/dist/cjs/hooks/export.cjs +1 -1
  17. package/dist/cjs/hooks/form.cjs +1 -1
  18. package/dist/cjs/hooks/formExtend.cjs +1 -0
  19. package/dist/cjs/hooks/formValidate.cjs +1 -0
  20. package/dist/cjs/hooks/i18n.cjs +1 -1
  21. package/dist/cjs/hooks/importCsv.cjs +1 -1
  22. package/dist/cjs/hooks/json/index.cjs +1 -0
  23. package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -0
  24. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -0
  25. package/dist/cjs/hooks/json/vFor.cjs +1 -0
  26. package/dist/cjs/hooks/json/vIf.cjs +1 -0
  27. package/dist/cjs/hooks/json/vModel.cjs +1 -0
  28. package/dist/cjs/hooks/json/vOn.cjs +1 -0
  29. package/dist/cjs/hooks/json/vShow.cjs +1 -0
  30. package/dist/cjs/hooks/json/vText.cjs +1 -0
  31. package/dist/cjs/hooks/json.cjs +1 -0
  32. package/dist/cjs/hooks/list.cjs +1 -0
  33. package/dist/cjs/hooks/manage.cjs +1 -1
  34. package/dist/cjs/hooks/menu.cjs +1 -1
  35. package/dist/cjs/hooks/overlay.cjs +1 -1
  36. package/dist/cjs/hooks/select.cjs +1 -1
  37. package/dist/cjs/hooks/theme.cjs +2 -2
  38. package/dist/cjs/hooks/upload.cjs +1 -1
  39. package/dist/cjs/index.cjs +1 -1
  40. package/dist/cjs/main.cjs +1 -1
  41. package/dist/cjs/node_modules/dayjs/dayjs.min.cjs +1 -0
  42. package/dist/cjs/node_modules/jsep/dist/jsep.cjs +2 -0
  43. package/dist/cjs/node_modules/mitt/dist/mitt.cjs +1 -0
  44. package/dist/cjs/preset/dataProvider.cjs +1 -1
  45. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  46. package/dist/cjs/provider/app.cjs +1 -1
  47. package/dist/cjs/stores/manage.cjs +1 -1
  48. package/dist/cjs/stores/tab.cjs +1 -1
  49. package/dist/cjs/stores/theme.cjs +1 -1
  50. package/dist/cjs/utils/theme.cjs +9 -1
  51. package/dist/esm/_virtual/_commonjsHelpers.js +6 -0
  52. package/dist/esm/_virtual/dayjs.min.js +7 -0
  53. package/dist/esm/_virtual/dayjs.min2.js +4 -0
  54. package/dist/esm/components/auth/can.js +11 -8
  55. package/dist/esm/components/loader/loader.js +47 -0
  56. package/dist/esm/components/loader/remote/loader.js +150 -0
  57. package/dist/esm/components/loader/remote/render.js +19 -0
  58. package/dist/esm/components/status/error.js +3 -3
  59. package/dist/esm/components/status/exception.js +23 -0
  60. package/dist/esm/components/status/notAuthorized.js +2 -2
  61. package/dist/esm/components/status/notFound.js +4 -4
  62. package/dist/esm/directive/permission.js +6 -3
  63. package/dist/esm/hooks/auth.js +67 -67
  64. package/dist/esm/hooks/data.js +187 -183
  65. package/dist/esm/hooks/export.js +26 -23
  66. package/dist/esm/hooks/form.js +38 -35
  67. package/dist/esm/hooks/formExtend.js +38 -0
  68. package/dist/esm/hooks/formValidate.js +28 -0
  69. package/dist/esm/hooks/i18n.js +16 -8
  70. package/dist/esm/hooks/json/index.js +23 -0
  71. package/dist/esm/hooks/json/utils/contextManager.js +31 -0
  72. package/dist/esm/hooks/json/utils/expressionParser.js +134 -0
  73. package/dist/esm/hooks/json/vFor.js +57 -0
  74. package/dist/esm/hooks/json/vIf.js +17 -0
  75. package/dist/esm/hooks/json/vModel.js +78 -0
  76. package/dist/esm/hooks/json/vOn.js +32 -0
  77. package/dist/esm/hooks/json/vShow.js +24 -0
  78. package/dist/esm/hooks/json/vText.js +54 -0
  79. package/dist/esm/hooks/json.js +80 -0
  80. package/dist/esm/hooks/list.js +179 -0
  81. package/dist/esm/hooks/manage.js +19 -14
  82. package/dist/esm/hooks/overlay.js +7 -4
  83. package/dist/esm/hooks/theme.js +72 -72
  84. package/dist/esm/index.js +132 -100
  85. package/dist/esm/main.js +22 -12
  86. package/dist/esm/node_modules/dayjs/dayjs.min.js +282 -0
  87. package/dist/esm/node_modules/jsep/dist/jsep.js +737 -0
  88. package/dist/esm/node_modules/mitt/dist/mitt.js +19 -0
  89. package/dist/esm/preset/i18nProvider.js +21 -13
  90. package/dist/esm/provider/app.js +62 -53
  91. package/dist/esm/stores/manage.js +23 -15
  92. package/dist/esm/stores/tab.js +58 -49
  93. package/dist/esm/utils/theme.js +89 -76
  94. package/dist/types/components/index.d.ts +2 -1
  95. package/dist/types/components/loader/loader.d.ts +2 -0
  96. package/dist/types/components/loader/remote/index.d.ts +2 -0
  97. package/dist/types/components/loader/remote/loader.d.ts +1 -0
  98. package/dist/types/components/loader/remote/render.d.ts +1 -0
  99. package/dist/types/components/status/error.d.ts +1 -2
  100. package/dist/types/components/status/exception.d.ts +3 -0
  101. package/dist/types/components/status/index.d.ts +4 -0
  102. package/dist/types/components/status/notAuthorized.d.ts +1 -2
  103. package/dist/types/components/status/notFound.d.ts +1 -2
  104. package/dist/types/config/index.d.ts +1 -0
  105. package/dist/types/hooks/auth.d.ts +6 -6
  106. package/dist/types/hooks/data.d.ts +30 -30
  107. package/dist/types/hooks/form.d.ts +6 -3
  108. package/dist/types/hooks/formExtend.d.ts +12 -0
  109. package/dist/types/hooks/formValidate.d.ts +14 -0
  110. package/dist/types/hooks/i18n.d.ts +2 -0
  111. package/dist/types/hooks/import.d.ts +1 -2
  112. package/dist/types/hooks/index.d.ts +6 -1
  113. package/dist/types/hooks/json/types.d.ts +1 -0
  114. package/dist/types/hooks/json.d.ts +2 -3
  115. package/dist/types/hooks/list.d.ts +66 -0
  116. package/dist/types/hooks/manage.d.ts +1 -0
  117. package/dist/types/hooks/overlay.d.ts +4 -0
  118. package/dist/types/index.d.ts +6 -5
  119. package/dist/types/preset/i18nProvider.d.ts +1 -1
  120. package/dist/types/stores/route.d.ts +180 -180
  121. package/dist/types/stores/tab.d.ts +1112 -73
  122. package/dist/types/types/config.d.ts +9 -0
  123. package/dist/types/types/data.d.ts +1 -1
  124. package/dist/types/types/i18n.d.ts +1 -0
  125. package/dist/types/types/manage.d.ts +6 -0
  126. package/dist/types/utils/index.d.ts +1 -1
  127. package/dist/types/utils/theme.d.ts +4 -49
  128. package/package.json +11 -5
  129. /package/dist/cjs/{hooks/themeColor.cjs → config/color.cjs} +0 -0
  130. /package/dist/esm/{hooks/themeColor.js → config/color.js} +0 -0
  131. /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"),U=require("@overlastic/vue"),V=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");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("clsx");require("colorizr");require("axios");const p=l=>Object.freeze(Object.defineProperty({__proto__:null,default:l},Symbol.toStringTag,{value:"Module"})),X=h.defineComponent({name:"DuxAppProvider",props:{},setup(l,{slots:f}){const d=h.inject("dux.manage"),s=G.useConfig(),m=V.useRouter();return m.beforeEach(async(n,Y,a)=>{var $,S,R,A,M,y,_,k,z,w,D,I,O,j;const r=n.meta.manageName,L=n.meta.authorization===!1;if(!r){const e=s.defaultManage||((S=($=s.manages)==null?void 0:$[0])==null?void 0:S.name)||"";return a({path:`/${e}`,replace:!0})}d&&(d.value=r);const g=Q.useManageStore(r);g.isInit()||g.setConfig((R=s.manages)==null?void 0:R.find(e=>e.name===r),s);const i=K.useRouteStore(r),o=H.useManage(r),q=J.useAuthStore(r),v=W.useI18nStore(r);if((A=o.config)!=null&&A.i18nProvider&&!v.isInit()){const e=v.getLocale();e&&((M=o.config)==null||M.i18nProvider.changeLocale(e))}if(!q.isLogin())return L?a():a({path:o.getRoutePath("login"),replace:!0});const P=e=>e==null?void 0:e.map(u=>({...u,path:u.path?o.getRoutePath(u.path):void 0}));if(!i.getRouteInit()){const e=((y=o.config)==null?void 0:y.components)||{},u=[];if(u.push({name:`${r}.notFound`,label:"404",path:":pathMatch(.*)*",component:e.notFound||(()=>Promise.resolve().then(()=>p(require("../components/status/notFound.cjs")))),hidden:!0,meta:{can:!1}}),u.push({name:`${r}.notAuthorized`,label:"403",path:"notAuthorized",component:e.notAuthorized||(()=>Promise.resolve().then(()=>p(require("../components/status/notAuthorized.cjs")))),hidden:!0,meta:{can:!1}}),u.push({name:`${r}.error`,label:"500",path:"error",component:e.error||(()=>Promise.resolve().then(()=>p(require("../components/status/error.cjs")))),hidden:!0,meta:{can:!1}}),i.setRoutes(P(((_=o.config)==null?void 0:_.menus)||[])),(k=o.config)!=null&&k.apiRoutePath)try{await((D=(w=(z=o.config)==null?void 0:z.dataProvider)==null?void 0:w.default)==null?void 0:D.custom({path:o.config.apiRoutePath,meta:{timeout:5e3}},o,q.getUser()).then(t=>{i.appendRoutes(P(t.data||[]))}))}catch(t){console.error(t)}return i.appendRoutes(u),i.getRoutes().forEach(t=>{var C,N;if(!t.path)return;const c={name:t.name,path:t.path,meta:t.meta};switch(t.loader){case"iframe":c.component=((N=(C=o.config)==null?void 0:C.components)==null?void 0:N.iframe)||(()=>Promise.resolve().then(()=>p(require("../components/loader/iframe.cjs"))));break;case"link":c.beforeEnter=()=>{var F;const E=((F=t.meta)==null?void 0:F.url)||t.path;return E&&window.open(E,"_blank"),!1},c.component=()=>Promise.resolve({template:"<div></div>"});break;default:t.component&&(c.component=t.component);break}m.addRoute(`${r}.auth`,c)}),a({path:((I=n.redirectedFrom)==null?void 0:I.path)||n.path,replace:!0})}const b=["","/",`/${r}`,`/${r}/`];if(b.includes(n.path)){const e=i.getIndexRoute();return!(e!=null&&e.path)||b.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 T=B.useCan(r);return(((O=n.meta)==null?void 0:O.can)===void 0||((j=n.meta)==null?void 0:j.can)===!0)&&!T(n.name)?a({name:`${r}.notAuthorized`}):a()}),()=>h.createVNode(U.OverlaysProvider,null,{default:()=>{var n;return[(n=f.default)==null?void 0:n.call(f)]}})}});exports.DuxAppProvider=X;
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"),p=require("pinia"),o=require("vue");function v(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.getList!="function"}function h(r){const i=o.inject("dux.manage");if(r||(r=(i==null?void 0:i.value)||""),!r)throw new Error("manage not found");return y(r)()}function y(r){return p.defineStore(`manages-${r}`,()=>{const i=o.ref(),c=o.ref(!1);return{config:i,isInit:()=>{const u=c.value;return c.value=!0,u},setConfig:(u,e)=>{const t=P.cloneDeep(u),n=[];t.title&&n.push(t.title),e.title&&n.push(e.title),t.title=n.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},i.value=t},getConfig:()=>i.value}})}exports.useManageStore=h;
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;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("pinia"),i=require("vue");function c(r){const u=i.inject("dux.manage");if(r||(r=(u==null?void 0:u.value)||""),!r)throw new Error("manage not found");return h(r)()}function h(r){return f.defineStore(`tabs-${r}`,()=>{const u=i.ref(),t=i.ref([]);return{current:u,tabs:t,isTab:l=>t.value.some(e=>e.path===l),addTab:(l,e)=>{l.path&&(t.value.some(a=>a.path===l.path)||(t.value.push(l),e==null||e(l)),u.value=l.path)},delTab:(l,e)=>{var s;const a=t.value.findIndex(d=>d.path===l);if(!a||t.value.length<=1)return;const n=t.value[a];if((s=n==null?void 0:n.meta)!=null&&s.lock)return;const o=t.value[a-1],v=t.value[a+1];e==null||e(o||v),setTimeout(()=>{t.value.splice(a,1)},0)},changeTab:(l,e)=>{u.value=l;const a=t.value.find(n=>n.path===l);a&&(e==null||e(a))},delOther:(l,e)=>{t.value=t.value.filter(a=>{var n;return a.path===l||((n=a.meta)==null?void 0:n.lock)}),e==null||e()},delLeft:(l,e)=>{const a=t.value.findIndex(n=>n.path===l);a<=0||(t.value=[...t.value.slice(0,a).filter(n=>{var o;return(o=n.meta)==null?void 0:o.lock}),...t.value.slice(a)],e==null||e())},delRight:(l,e)=>{const a=t.value.findIndex(n=>n.path===l);a===-1||a===t.value.length-1||(t.value=[...t.value.slice(0,a+1),...t.value.slice(a+1).filter(n=>{var o;return(o=n.meta)==null?void 0:o.lock})],e==null||e())},lockTab:l=>{const e=t.value.findIndex(a=>a.path===l);e!==-1&&t.value[e]&&(t.value[e].meta||(t.value[e].meta={}),t.value[e].meta.lock=!t.value[e].meta.lock)},clearTab:()=>{u.value=void 0,t.value=[]}}})}exports.useTabStore=c;
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 v(t){const e=n.inject("dux.manage");if(t||(t=(e==null?void 0:e.value)||""),!t)throw new Error("manage not found");return T(t)()}function T(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=v;
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;
@@ -1 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(c){return`rgb(var(${c}))`}function s(c){const t={},i=["50","100","200","300","400","500","600","700","800","900","950"],b=["primary","info","success","warning","error","gray"],n=["hover","pressed","focus","disabled"];t.white={DEFAULT:e("--ui-color-white")},t.black={DEFAULT:e("--ui-color-black")},Object.keys(c).forEach(r=>{t[r]={},i.forEach(o=>{t[r][o]=e(`--base-color-${r}-${o}`)})}),b.forEach(r=>{t[r]={},t[r].DEFAULT=e(`--ui-color-${r}`),i.forEach(o=>{t[r][o]=e(`--ui-color-${r}-${o}`)}),n.forEach(o=>{t[r][o]=e(`--ui-color-${r}-${o}`)})});const d={"text-default":{color:e("--ui-text")},"text-dimmed":{color:e("--ui-text-dimmed")},"text-muted":{color:e("--ui-text-muted")},"text-toned":{color:e("--ui-text-toned")},"text-highlighted":{color:e("--ui-text-highlighted")},"text-inverted":{color:e("--ui-text-inverted")},"bg-default":{"background-color":e("--ui-bg")},"bg-muted":{"background-color":e("--ui-bg-muted")},"bg-elevated":{"background-color":e("--ui-bg-elevated")},"bg-accented":{"background-color":e("--ui-bg-accented")},"bg-inverted":{"background-color":e("--ui-bg-inverted")},"border-default":{"border-color":e("--ui-border")},"border-muted":{"border-color":e("--ui-border-muted")},"border-accented":{"border-color":e("--ui-border-accented")},"border-inverted":{"border-color":e("--ui-border-inverted")}},u={};Object.entries(d).forEach(([r,o])=>{u[`.${r}`]=o});const l=[];return Object.entries(d).forEach(([r,o])=>{l.push([r,o])}),{colors:t,classes:d,rules:l,utilities:u}}exports.themePreset=s;
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;
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ }
4
+ export {
5
+ e as getDefaultExportFromCjs
6
+ };
@@ -0,0 +1,7 @@
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/dayjs/dayjs.min.js";
3
+ var t = o();
4
+ const s = /* @__PURE__ */ r(t);
5
+ export {
6
+ s as default
7
+ };
@@ -0,0 +1,4 @@
1
+ var a = { exports: {} };
2
+ export {
3
+ a as __module
4
+ };
@@ -1,16 +1,19 @@
1
- import { defineComponent as n } from "vue";
2
- import { useCan as t } from "../../hooks/auth.js";
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 "vue-router";
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 j = /* @__PURE__ */ n({
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 i = t();
30
+ const t = n();
28
31
  return () => {
29
- var p, e;
30
- return i(m.name, m.params) ? (p = r.default) == null ? void 0 : p.call(r) : ((e = r.fallback) == null ? void 0 : e.call(r)) || null;
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
- j as DuxCan
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 e, createTextVNode as r } from "vue";
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 () => e("div", null, [e("h1", null, [r("500")]), e("p", null, [r("Internal Server Error")])]);
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 default
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 r = /* @__PURE__ */ o({
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
- r as default
9
+ u as DuxNotAuthorized
10
10
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as o, createVNode as e, createTextVNode as n } from "vue";
2
- const u = /* @__PURE__ */ o({
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, [n("404")]), e("p", null, [n("Page not found")])]);
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 default
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 "vue-router";
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 x = {
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
- x as permissionDirective
26
+ b as permissionDirective
24
27
  };