@duxweb/dvha-pro 1.0.27 → 1.0.29
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/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/table/color.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/components/form/formItem.js +30 -21
- package/dist/esm/components/layout/table.js +24 -24
- package/dist/esm/components/table/tablePage.js +9 -8
- package/dist/esm/hooks/action.js +49 -48
- package/dist/esm/hooks/table/color.js +3 -3
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/form/formItem.d.ts +2 -0
- package/dist/types/components/table/tablePage.d.ts +1 -0
- package/dist/types/hooks/table/types.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),b=require("@vueuse/core"),x=require("vee-validate"),y=t.defineComponent({name:"DuxFormItem",props:{label:String,description:[String,Object],path:String,labelPlacement:{type:String},labelAlign:{type:String},labelWidth:{type:Number},required:{type:Boolean,default:!1},rule:[String,Object],message:[String,Object]},setup(e,{slots:d}){const n=t.toRef(e.message),c=t.computed(()=>typeof e.rule=="object"?{...e.rule,required:!!e.required}:typeof e.rule=="string"?e.rule?.includes("required")?e.rule:e.rule?`${e.rule}|required`:"required":e.rule),{errorMessage:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),b=require("@vueuse/core"),x=require("naive-ui"),h=require("vee-validate"),y=t.defineComponent({name:"DuxFormItem",props:{label:String,description:[String,Object],tooltip:String,path:String,labelPlacement:{type:String},labelAlign:{type:String},labelWidth:{type:Number},required:{type:Boolean,default:!1},rule:[String,Object],message:[String,Object]},setup(e,{slots:d}){const n=t.toRef(e.message),c=t.computed(()=>typeof e.rule=="object"?{...e.rule,required:!!e.required}:typeof e.rule=="string"?e.rule?.includes("required")?e.rule:e.rule?`${e.rule}|required`:"required":e.rule),{errorMessage:u,value:o,setErrors:s,validate:f}=h.useField(e.path||"",c.value||{},{label:e.label}),v=t.computed(()=>e.required?!0:e.rule?typeof e.rule=="string"?e.rule.includes("required"):typeof e.rule=="object"?"required"in e.rule:!1:!1),i=t.computed(()=>u.value&&(n.value||u.value));t.watch(i,r=>{r&&s(r)},{immediate:!0}),b.watchThrottled(o,r=>{r&&f()},{throttle:300,deep:!0});const a=t.inject("dux.form",{labelPlacement:t.ref("left"),labelAlign:t.ref("left"),labelWidth:t.ref(70),divider:t.ref(!1)}),l=t.computed(()=>e.labelPlacement||a.labelPlacement.value),g=t.computed(()=>{let r=e.labelWidth||a.labelWidth.value||70;return typeof r=="number"&&(r=`${r}px`),l.value!=="left"?"auto":r}),m=t.computed(()=>a.divider.value||l.value==="page");return()=>t.createVNode("div",{class:[l.value!=="top"?"md:flex-row gap-2 lg:items-center":"gap-1",m.value?"py-6":"",l.value==="setting"?"md:justify-between md:items-start md:gap-4":"",l.value==="page"?"grid grid-cols-1 lg:grid-cols-4 px-4":"flex flex-col"]},[e.label&&t.createVNode("div",{class:[l.value==="left"?"flex lg:items-center":"md:mb-1",l.value==="left"&&a.labelAlign.value==="right"?"justify-end":""],style:{width:g.value}},[t.createVNode("div",{class:"flex flex-col"},[t.createVNode("div",null,[t.createVNode("span",{class:"relative flex items-center gap-1"},[e.label,e.tooltip&&t.createVNode(x.NTooltip,{trigger:"hover"},{trigger:()=>t.createVNode("div",{class:"i-tabler:help size-4"},null),default:()=>e.tooltip}),v.value&&t.createVNode("span",{class:"text-error font-mono text-xs"},[t.createTextVNode("*")])])]),e.description&&(l.value==="setting"||l.value==="page")&&t.createVNode("div",{class:"text-sm text-muted"},[e.description])])]),t.createVNode("div",{class:["flex flex-col gap-1",l.value==="setting"?"flex-none md:w-40%":"flex-1",l.value==="page"?"col-span-3":""]},[t.createVNode("div",{class:l.value==="setting"?"flex-1 lg:flex lg:justify-end":""},[d?.default?.()]),e.description&&(l.value==="left"||l.value==="top")&&t.createVNode("div",{class:"text-sm text-muted"},[e.description]),i.value&&t.createVNode("div",{class:"text-error"},[i.value])])])}});exports.DuxFormItem=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("@duxweb/dvha-core"),E=require("@vueuse/core"),a=require("naive-ui"),F=require("../../hooks/action.cjs");require("@overlastic/vue");require("clsx");require("vue-echarts");require("vue3-ace-editor");require("ace-builds/src-noconflict/mode-vue");require("ace-builds/src-noconflict/mode-javascript");require("ace-builds/src-noconflict/mode-html");require("ace-builds/src-noconflict/mode-json");require("ace-builds/src-noconflict/mode-json5");require("ace-builds/src-noconflict/theme-tomorrow_night");require("ace-builds/src-noconflict/theme-tomorrow");require("ace-builds/src-noconflict/ext-searchbox");require("ace-builds/src-noconflict/ext-language_tools");require("ace-builds/src-noconflict/mode-snippets");require("vue-cropper");const W=require("../modal/modalPage.cjs");require("jinrishici");require("lodash-es");require("vue-draggable-plus");const I=require("./filter.cjs"),J=require("./filterLayout.cjs");require("@vee-validate/i18n");require("colorizr");require("echarts");require("@ant-design/colors");require("@unocss/preset-icons/browser");require("@unocss/preset-typography");require("unocss/preset-wind4");require("@vee-validate/i18n/dist/locale/en.json");require("@vee-validate/i18n/dist/locale/zh_CN.json");require("vee-validate");require("vue-router");require("vue-command-palette");require("@duxweb/dvha-naiveui");const M=require("../../pages/page.cjs");require("../../pages/page404.cjs");const v=require("../drawer/drawerPage.cjs"),_=require("./tools.cjs");require("short-unique-id");require("aieditor");require("@iconify-json/tabler/icons.json");require("../posterEditor/elements/index.cjs");require("fabric");require("mime");require("dayjs");require("@tanstack/vue-query");const $=require("../../hooks/table.cjs");require("pinia");function K(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const G=e.defineComponent({name:"DuxTableLayout",props:{path:{type:String,required:!0},filter:{type:Object},filterSchema:{type:Array},filterNumber:{type:Number,default:1},columns:{type:Array},pagination:{type:[Boolean,Object],default:!0},tabs:{type:Array},actions:{type:Array,default:()=>[]},tools:{type:Object},sideLeftTitle:{type:String,default:""},sideRightTitle:{type:String,default:""},hookTableProps:{type:Object}},setup(t,{slots:o}){const f=e.toRef(t,"filter",{}),q=e.toRef(t,"columns",[]),{t:l}=p.useI18n(),{renderAction:w}=F.useAction(),b=$.useTable({path:t.path,filters:f.value,columns:q,pagination:t.pagination,...t.hookTableProps}),{columns:N,tablePagination:y,table:V,onUpdateColumnSelected:x,onUpdateChecked:T,columnSelected:k,autoRefetch:C,autoCountdown:m,onAutoRefetch:R,isExporting:S,isExportingRows:j,isImporting:L,onExport:P,onExportRows:D,onImport:z}=b,B=e.computed(()=>N.value.filter(r=>"title"in r&&"key"in r).map(r=>({label:r.title,value:r.key}))),{width:n}=E.useWindowSize(),O=e.computed(()=>N.value.reduce((i,d)=>i+(Number(d?.width)||Number(d?.minWidth)||110),0)),u=e.reactive({show:!1}),c=e.reactive({show:!1}),s=e.reactive({show:!1}),h=e.computed(()=>(t.filterSchema||[]).map(r=>{const{label:i,...d}=r;return{tag:I.DuxTableFilter,attrs:{label:i},children:d}})),{render:U}=p.useJsonSchema({data:e.computed(()=>h.value?.slice(t.filterNumber))}),{render:A}=p.useJsonSchema({data:e.computed(()=>h.value?.slice(0,t.filterNumber))}),g=e.computed(()=>({import:!1,export:!0,refresh:!0,...t.tools}));return()=>e.createVNode(M.DuxPage,{actions:t.actions,scrollbar:!1},{sideLeft:()=>o?.sideLeft&&n.value>=1024?o?.sideLeft?.():void 0,sideRight:()=>o?.sideRight&&n.value>=1024?o?.sideRight?.():void 0,default:()=>e.createVNode("div",{class:"flex flex-col gap-2 h-full relative"},[e.createVNode("div",{class:"flex gap-2 justify-between flex-col lg:flex-row"},[t.tabs&&e.createVNode("div",{class:"flex flex-none"},[e.createVNode(a.NTabs,{type:"segment",size:"small",style:{"--n-tab-padding":"4px 10px"},"default-value":t.tabs?.[0]?.value,value:f.value?.tab,onUpdateValue:r=>{f.value.tab=r}},{default:()=>[t.tabs?.map(r=>e.createVNode(a.NTab,{name:r.value,tab:r.label},null))]})]),e.createVNode("div",{class:["overflow-hidden flex-1 flex gap-2"]},[o?.sideLeft&&n.value<1024&&e.createVNode(a.NButton,{class:"flex-none",secondary:!0,onClick:()=>{c.show=!c.show}},{icon:()=>e.createVNode("div",{class:"i-tabler:layout-sidebar-inactive size-4"},null)}),e.createVNode("div",{class:["flex-1 flex flex-col lg:flex-row gap-2 flex-wrap",t.tabs?"justify-end":"justify-start"]},[e.h(A)]),o?.sideRight&&n.value<1024&&e.createVNode(a.NButton,{class:"flex-none",secondary:!0,onClick:()=>{s.show=!s.show}},{icon:()=>e.createVNode("div",{class:"i-tabler:layout-sidebar-right-inactive size-4"},null)})]),e.createVNode("div",{class:"flex gap-2 justify-between lg:justify-end"},[e.createVNode("div",{class:"flex gap-2 items-center"},[h.value.length>t.filterNumber&&e.createVNode(a.NButton,{iconPlacement:"right",onClick:()=>{u.show=!u.show}},{default:()=>l("components.button.filter"),icon:()=>e.createVNode("div",{class:["i-tabler:chevrons-down size-4 transition-all"]},null)}),o?.tools?.(),e.createVNode(a.NPopselect,{options:B.value,value:k.value,onUpdateValue:r=>{x(r)},multiple:!0,placement:"bottom-start",trigger:"click"},{default:()=>[e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,"icon-placement":"right"},{icon:()=>e.createVNode("div",{class:"i-tabler:columns size-4"},null)}),default:()=>l("components.list.columnSetting")})]}),g.value.export&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,loading:S.value,onClick:P},{icon:()=>e.createVNode("div",{class:"i-tabler:database-export size-4"},null)}),default:()=>l("components.button.export")}),g.value.import&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,loading:L.value,onClick:z},{icon:()=>e.createVNode("div",{class:"i-tabler:database-import size-4"},null)}),default:()=>l("components.button.import")}),g.value.refresh&&e.createVNode(a.NTooltip,null,{trigger:()=>e.createVNode(a.NButton,{secondary:!0,onClick:R},{icon:()=>C.value?e.createVNode(a.NProgress,{class:"size-4",type:"circle",percentage:m.value*10,strokeWidth:20,color:"rgba(var(--ui-color-primary))"},{default:()=>[e.createVNode("span",{class:"text-8px"},[m.value])]}):e.createVNode("div",{class:"i-tabler:refresh size-4"},null)}),default:()=>l("components.button.autoRefresh")})]),e.createVNode("div",{class:"flex gap-2 justify-end"},[o.actions?.(),t.actions?.length>0&&w({type:n.value<1024?"dropdown":"button",items:t.actions})])])]),o?.header?.(),e.createVNode("div",{class:"flex-1 min-h-0"},[o?.default?.({...b,width:O.value})]),e.createVNode("div",{class:"flex justify-between"},[e.createVNode("div",null,[o?.bottom?.()]),e.createVNode("div",null,[t.pagination&&e.createVNode(a.NPagination,e.mergeProps(y.value,{simple:n.value<768}),{prefix:()=>e.createVNode("div",null,[l("components.list.total",{total:b.total.value||0})])})])]),e.createVNode(_.DuxTableTools,{number:V.value.checkedRowKeys?.length||0||0,group:[[{icon:"i-tabler:x",onClick:()=>{T?.([])}}],[{label:l("components.button.export"),icon:"i-tabler:file-export",loading:j.value,onClick:D},{label:l("components.button.delete"),type:"error",icon:"i-tabler:trash"}]]},null),e.createVNode(a.NModal,{draggable:!0,class:"bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur min-w-110",show:u.show,onUpdateShow:r=>u.show=r},{default:({draggableClass:r})=>{let i;return e.createVNode(W.default,{title:l("components.button.filter"),handle:r,onClose:()=>u.show=!1},{default:()=>[e.createVNode(J.DuxFilterLayout,{showLabel:!0,labelPlacement:"top"},K(i=e.h(U))?i:{default:()=>[i]})]})}}),e.createVNode(a.NDrawer,{show:c.show,onUpdateShow:r=>c.show=r,autoFocus:!1,placement:"left"},{default:()=>[e.createVNode(v.DuxDrawerPage,{title:t.sideLeftTitle||l("components.button.sideLeft"),onClose:()=>c.show=!1,scrollbar:!1},{default:()=>[o?.sideLeft?.()]})]}),e.createVNode(a.NDrawer,{show:s.show,onUpdateShow:r=>s.show=r,autoFocus:!1,placement:"right"},{default:()=>[e.createVNode(v.DuxDrawerPage,{title:t.sideRightTitle||l("components.button.sideRight"),onClose:()=>s.show=!1,scrollbar:!1},{default:()=>[o?.sideRight?.()]})]})])})}});exports.DuxTableLayout=G;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),u=require("naive-ui"),i=require("../layout/table.cjs");require("@duxweb/dvha-core");require("clsx");const n=require("../status/listEmpty.cjs"),d=r.defineComponent({name:"DuxTablePage",props:{tableProps:{type:Object}},extends:i.DuxTableLayout,slots:Object,setup(o,{slots:t}){const l=r.computed(()=>{const{tableProps:a,...e}=o;return e});return()=>r.createVNode(i.DuxTableLayout,l.value,{default:a=>r.createVNode(u.NDataTable,r.mergeProps(a.table.value,o.tableProps,{class:"h-full",minHeight:200,tableLayout:"fixed",flexHeight:!0,rowKey:e=>e.id,bordered:!1,scrollX:a.width,renderCell:e=>e==null||e===""?"-":e}),{empty:()=>r.createVNode(n.DuxListEmpty,{bordered:!1},null)}),bottom:t?.bottom,tools:t?.tools,actions:t?.actions,sideLeft:t?.sideLeft,sideRight:t?.sideRight,header:t?.header})}});exports.DuxTablePage=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@duxweb/dvha-core"),f=require("naive-ui"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@duxweb/dvha-core"),f=require("naive-ui"),s=require("vue"),S=require("vue-router"),M=require("./dialog.cjs"),$=require("./drawer.cjs"),D=require("./modal.cjs");function I(o){const h=D.useModal(),i=$.useDrawer(),u=M.useDialog(),{t:n}=r.useI18n(),d=f.useMessage(),y=r.useManage(),k=S.useRouter(),v=r.useCustomMutation({onSuccess:t=>{d.success(t.message||n("common.success"))},onError:t=>{d.error(t.message||n("common.error"))}}),q=r.useDelete({onSuccess:t=>{d.success(t.message||n("common.success"))},onError:t=>{d.error(t.message||n("common.error"))}}),m=o?.path||y.getPath(),g=t=>{const c=n(t.item.title||"",{},t.item.title),l=n(t.item.label||"",{},t.item.label);if(t.item.type==="modal"){const e=t.item,a=typeof e.componentProps=="function"?e.componentProps(t.data):e.componentProps;h.show({title:c||l,component:e.component,componentProps:{id:t.id,...a},width:e.width,draggable:e.draggable!==void 0?e.draggable:!0})}if(t.item.type==="drawer"){const e=t.item,a=typeof e.componentProps=="function"?e.componentProps(t.data):e.componentProps;i.show({title:c||l,component:e.component,componentProps:{id:t.id,...a},width:e.width,maxWidth:e.maxWidth})}if(t.item.type==="confirm"){const e=t.item;u.confirm({title:c||l,content:e.content}).then(a=>{a&&e.callback?.(t.id,t.data)})}if(t.item.type==="request"){const e=t.item;u.confirm({title:c||l,content:e.content}).then(()=>{const a=typeof e.data=="function"?e.data(t.id,t.data):e.data,A=(e.method||"post").toLowerCase(),j=typeof e.path=="function"?e.path(t.id,t.data):e.path||m;v.mutate({path:j,method:A,payload:a})})}if(t.item.type==="delete"){const e=t.item;u.confirm({title:c||l,content:e.content}).then(()=>{q.mutate({id:t.id,path:typeof e.path=="function"?e.path(t.id,t.data):e.path||m})})}if(t.item.type==="link"){const e=t.item;let a=typeof e.path=="function"?e.path?.(t.id,t.data):t.id?`${e.path||m}${t.data===void 0?"":`/${t.id}`}`:e.path||m;a.startsWith("/")||(a=y.getRoutePath(a)),k.push(a)}t.item.type==="callback"&&t.item.callback?.(t.id,t.data)},b=w(),x=P();return{target:g,renderTable:t=>(c,l)=>{const e={id:c[t.key||o?.key||"id"],data:c,index:l,target:g,text:t.text!==void 0?t.text:o?.text||!1,align:t.align!==void 0?t.align:o?.align||"left"};return(t.type||o?.type)==="button"?b.render({...e,action:t||o}):x.render({...e,action:t||o})},renderAction:t=>{const c={target:g,text:t.text!==void 0?t.text:o?.text||!1,align:t.align!==void 0?t.align:o?.align||"left"};return(t.type||o?.type)==="button"?b.render({...c,action:t||o}):x.render({...c,action:t||o})}}}function w(){const{t:o}=r.useI18n();return{render:i=>{const u=i.action.items?.filter(n=>!n.show||n.show?.(i.data,i.index)).map((n,d)=>s.h(f.NButton,{key:d,type:n.color||(n.type==="delete"?"error":"primary"),text:i.text,secondary:!i.text,onClick:()=>{i?.target?.({id:i.id,data:i.data,item:n})},renderIcon:n.icon?()=>s.h("div",{class:["n-icon",n.icon]}):void 0},()=>o(n.label||"",{},n.label)));return s.h("div",{class:["flex gap-2 flex-wrap items-center",i.align==="right"?"justify-end":i.align==="center"?"justify-center":"justify-start"]},u)}}}function P(){const{t:o}=r.useI18n();return{render:i=>{const u=i.action.items?.filter(n=>!n.show||n.show?.(i.data,i.index)).map((n,d)=>({label:o(n.label||"",{},n.label),key:d,icon:n.icon?()=>s.h("div",{class:["n-icon",n.icon]}):void 0,onSelect:()=>{i?.target?.({id:i.id,data:i.data,item:n})}}));return s.h(f.NDropdown,{trigger:"click",options:u,onSelect:(n,d)=>{d?.onSelect?.()}},()=>[s.h("div",{class:["flex items-center",i.align==="right"?"justify-end":i.align==="center"?"justify-center":"justify-start"]},s.h(f.NButton,{type:"default",text:i.text,secondary:!i.text,renderIcon:()=>s.h("div",{class:["n-icon","i-tabler:dots-vertical"]})}))])}}}exports.useAction=I;exports.useActionButton=w;exports.useActionDropdown=P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),l=require("lodash-es");function a(){return{render:t=>(o,i)=>{const u=t?.key||"status",n=l.findKey(t.maps,s=>s?s?.value===l.get(o,u):!1),e=n?t.maps?.[n]:void 0;return e?r.createVNode("div",{class:["flex gap-1 items-center",`text-${n}`]},[e.icon?r.createVNode("div",{class:`size-4 ${e.icon}`},null):null,r.createVNode("span",{class:"text-sm"},[e?.label])]):null}}}exports.useTableColumnColor=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=`/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-from-opacity:100%;--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-text-opacity:100%;--un-bg-opacity:100%;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-border-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-outline-style:solid;--un-fill-opacity:100%;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -954,6 +954,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
954
954
|
.i-tabler\\:forms{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3m7-14h7a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-7M5 7H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h1m12-5h.01M13 12h.01'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
955
|
.i-tabler\\:grid-4x4{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6h18M3 12h18M3 18h18M6 3v18m6-18v18m6-18v18'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
956
956
|
.i-tabler\\:grid-dots{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 5a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0M4 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0M4 19a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
957
|
+
.i-tabler\\:help{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9 5v.01'/%3E%3Cpath d='M12 13.5a1.5 1.5 0 0 1 1-1.5a2.6 2.6 0 1 0-3-4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
957
958
|
.i-tabler\\:hexagons{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 18v-5l4-2l4 2v5l-4 2zm4-7V6l4-2l4 2v5m-4 2l4-2l4 2v5l-4 2l-4-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
958
959
|
.i-tabler\\:info-circle{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01'/%3E%3Cpath d='M11 12h1v4h1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
959
960
|
.i-tabler\\:info-circle-filled{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1-19.995.324L2 12l.004-.28C2.152 6.327 6.57 2 12 2m0 9h-1l-.117.007a1 1 0 0 0 0 1.986L11 13v3l.007.117a1 1 0 0 0 .876.876L12 17h1l.117-.007a1 1 0 0 0 .876-.876L14 16l-.007-.117a1 1 0 0 0-.764-.857l-.112-.02L13 15v-3l-.007-.117a1 1 0 0 0-.876-.876zm.01-3l-.127.007a1 1 0 0 0 0 1.986L12 10l.127-.007a1 1 0 0 0 0-1.986z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent as h, toRef as y, computed as
|
|
1
|
+
import { defineComponent as h, toRef as y, computed as i, watch as q, inject as j, ref as u, createVNode as l, createTextVNode as S } from "vue";
|
|
2
2
|
import { watchThrottled as w } from "@vueuse/core";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { NTooltip as P } from "naive-ui";
|
|
4
|
+
import { useField as W } from "vee-validate";
|
|
5
|
+
const T = /* @__PURE__ */ h({
|
|
5
6
|
name: "DuxFormItem",
|
|
6
7
|
props: {
|
|
7
8
|
label: String,
|
|
8
9
|
description: [String, Object],
|
|
10
|
+
tooltip: String,
|
|
9
11
|
path: String,
|
|
10
12
|
labelPlacement: {
|
|
11
13
|
type: String
|
|
@@ -26,48 +28,55 @@ const N = /* @__PURE__ */ h({
|
|
|
26
28
|
setup(e, {
|
|
27
29
|
slots: s
|
|
28
30
|
}) {
|
|
29
|
-
const c = y(e.message), f =
|
|
31
|
+
const c = y(e.message), f = i(() => typeof e.rule == "object" ? {
|
|
30
32
|
...e.rule,
|
|
31
33
|
required: !!e.required
|
|
32
34
|
} : typeof e.rule == "string" ? e.rule?.includes("required") ? e.rule : e.rule ? `${e.rule}|required` : "required" : e.rule), {
|
|
33
35
|
errorMessage: d,
|
|
34
|
-
value:
|
|
35
|
-
setErrors:
|
|
36
|
-
validate:
|
|
37
|
-
} =
|
|
36
|
+
value: o,
|
|
37
|
+
setErrors: m,
|
|
38
|
+
validate: v
|
|
39
|
+
} = W(e.path || "", f.value || {}, {
|
|
38
40
|
label: e.label
|
|
39
|
-
}),
|
|
41
|
+
}), g = i(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), n = i(() => d.value && (c.value || d.value));
|
|
40
42
|
q(n, (r) => {
|
|
41
|
-
r &&
|
|
43
|
+
r && m(r);
|
|
42
44
|
}, {
|
|
43
45
|
immediate: !0
|
|
44
|
-
}), w(
|
|
45
|
-
r &&
|
|
46
|
+
}), w(o, (r) => {
|
|
47
|
+
r && v();
|
|
46
48
|
}, {
|
|
47
49
|
throttle: 300,
|
|
48
50
|
deep: !0
|
|
49
51
|
});
|
|
50
|
-
const
|
|
52
|
+
const a = j("dux.form", {
|
|
51
53
|
labelPlacement: u("left"),
|
|
52
54
|
labelAlign: u("left"),
|
|
53
55
|
labelWidth: u(70),
|
|
54
56
|
divider: u(!1)
|
|
55
|
-
}), t =
|
|
56
|
-
let r = e.labelWidth ||
|
|
57
|
+
}), t = i(() => e.labelPlacement || a.labelPlacement.value), b = i(() => {
|
|
58
|
+
let r = e.labelWidth || a.labelWidth.value || 70;
|
|
57
59
|
return typeof r == "number" && (r = `${r}px`), t.value !== "left" ? "auto" : r;
|
|
58
|
-
}),
|
|
60
|
+
}), x = i(() => a.divider.value || t.value === "page");
|
|
59
61
|
return () => l("div", {
|
|
60
|
-
class: [t.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1",
|
|
62
|
+
class: [t.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1", x.value ? "py-6" : "", t.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", t.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col"]
|
|
61
63
|
}, [e.label && l("div", {
|
|
62
|
-
class: [t.value === "left" ? "flex lg:items-center" : "md:mb-1", t.value === "left" &&
|
|
64
|
+
class: [t.value === "left" ? "flex lg:items-center" : "md:mb-1", t.value === "left" && a.labelAlign.value === "right" ? "justify-end" : ""],
|
|
63
65
|
style: {
|
|
64
|
-
width:
|
|
66
|
+
width: b.value
|
|
65
67
|
}
|
|
66
68
|
}, [l("div", {
|
|
67
69
|
class: "flex flex-col"
|
|
68
70
|
}, [l("div", null, [l("span", {
|
|
69
71
|
class: "relative flex items-center gap-1"
|
|
70
|
-
}, [e.label,
|
|
72
|
+
}, [e.label, e.tooltip && l(P, {
|
|
73
|
+
trigger: "hover"
|
|
74
|
+
}, {
|
|
75
|
+
trigger: () => l("div", {
|
|
76
|
+
class: "i-tabler:help size-4"
|
|
77
|
+
}, null),
|
|
78
|
+
default: () => e.tooltip
|
|
79
|
+
}), g.value && l("span", {
|
|
71
80
|
class: "text-error font-mono text-xs"
|
|
72
81
|
}, [S("*")])])]), e.description && (t.value === "setting" || t.value === "page") && l("div", {
|
|
73
82
|
class: "text-sm text-muted"
|
|
@@ -83,5 +92,5 @@ const N = /* @__PURE__ */ h({
|
|
|
83
92
|
}
|
|
84
93
|
});
|
|
85
94
|
export {
|
|
86
|
-
|
|
95
|
+
T as DuxFormItem
|
|
87
96
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as J, toRef as x, computed as
|
|
1
|
+
import { defineComponent as J, toRef as x, computed as s, reactive as v, createVNode as e, h as k, mergeProps as K, isVNode as G } from "vue";
|
|
2
2
|
import { useI18n as H, useJsonSchema as C } from "@duxweb/dvha-core";
|
|
3
3
|
import { useWindowSize as Q } from "@vueuse/core";
|
|
4
4
|
import { NTabs as X, NTab as Y, NButton as r, NPopselect as Z, NTooltip as f, NProgress as $, NPagination as ee, NModal as te, NDrawer as N } from "naive-ui";
|
|
@@ -129,38 +129,38 @@ const ut = /* @__PURE__ */ J({
|
|
|
129
129
|
onExport: V,
|
|
130
130
|
onExportRows: W,
|
|
131
131
|
onImport: I
|
|
132
|
-
} = b, B =
|
|
132
|
+
} = b, B = s(() => w.value.filter((o) => "title" in o && "key" in o).map((o) => ({
|
|
133
133
|
label: o.title,
|
|
134
134
|
value: o.key
|
|
135
135
|
}))), {
|
|
136
136
|
width: n
|
|
137
|
-
} = Q(), M =
|
|
138
|
-
show: !1
|
|
139
|
-
}), u = v({
|
|
137
|
+
} = Q(), M = s(() => w.value.reduce((a, m) => a + (Number(m?.width) || Number(m?.minWidth) || 110), 0)), u = v({
|
|
140
138
|
show: !1
|
|
141
139
|
}), c = v({
|
|
142
140
|
show: !1
|
|
143
|
-
}),
|
|
141
|
+
}), d = v({
|
|
142
|
+
show: !1
|
|
143
|
+
}), h = s(() => (t.filterSchema || []).map((o) => {
|
|
144
144
|
const {
|
|
145
145
|
label: a,
|
|
146
|
-
...
|
|
146
|
+
...m
|
|
147
147
|
} = o;
|
|
148
148
|
return {
|
|
149
149
|
tag: ie,
|
|
150
150
|
attrs: {
|
|
151
151
|
label: a
|
|
152
152
|
},
|
|
153
|
-
children:
|
|
153
|
+
children: m
|
|
154
154
|
};
|
|
155
155
|
})), {
|
|
156
156
|
render: _
|
|
157
157
|
} = C({
|
|
158
|
-
data: h.value?.slice(t.filterNumber)
|
|
158
|
+
data: s(() => h.value?.slice(t.filterNumber))
|
|
159
159
|
}), {
|
|
160
160
|
render: q
|
|
161
161
|
} = C({
|
|
162
|
-
data: h.value?.slice(0, t.filterNumber)
|
|
163
|
-
}), g =
|
|
162
|
+
data: s(() => h.value?.slice(0, t.filterNumber))
|
|
163
|
+
}), g = s(() => ({
|
|
164
164
|
import: !1,
|
|
165
165
|
export: !0,
|
|
166
166
|
refresh: !0,
|
|
@@ -200,7 +200,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
200
200
|
class: "flex-none",
|
|
201
201
|
secondary: !0,
|
|
202
202
|
onClick: () => {
|
|
203
|
-
|
|
203
|
+
c.show = !c.show;
|
|
204
204
|
}
|
|
205
205
|
}, {
|
|
206
206
|
icon: () => e("div", {
|
|
@@ -212,7 +212,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
212
212
|
class: "flex-none",
|
|
213
213
|
secondary: !0,
|
|
214
214
|
onClick: () => {
|
|
215
|
-
|
|
215
|
+
d.show = !d.show;
|
|
216
216
|
}
|
|
217
217
|
}, {
|
|
218
218
|
icon: () => e("div", {
|
|
@@ -225,7 +225,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
225
225
|
}, [h.value.length > t.filterNumber && e(r, {
|
|
226
226
|
iconPlacement: "right",
|
|
227
227
|
onClick: () => {
|
|
228
|
-
|
|
228
|
+
u.show = !u.show;
|
|
229
229
|
}
|
|
230
230
|
}, {
|
|
231
231
|
default: () => i("components.button.filter"),
|
|
@@ -300,7 +300,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
300
300
|
}, [l.actions?.(), t.actions?.length > 0 && T({
|
|
301
301
|
type: n.value < 1024 ? "dropdown" : "button",
|
|
302
302
|
items: t.actions
|
|
303
|
-
})])])]), e("div", {
|
|
303
|
+
})])])]), l?.header?.(), e("div", {
|
|
304
304
|
class: "flex-1 min-h-0"
|
|
305
305
|
}, [l?.default?.({
|
|
306
306
|
...b,
|
|
@@ -333,8 +333,8 @@ const ut = /* @__PURE__ */ J({
|
|
|
333
333
|
}, null), e(te, {
|
|
334
334
|
draggable: !0,
|
|
335
335
|
class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur min-w-110",
|
|
336
|
-
show:
|
|
337
|
-
onUpdateShow: (o) =>
|
|
336
|
+
show: u.show,
|
|
337
|
+
onUpdateShow: (o) => u.show = o
|
|
338
338
|
}, {
|
|
339
339
|
default: ({
|
|
340
340
|
draggableClass: o
|
|
@@ -343,7 +343,7 @@ const ut = /* @__PURE__ */ J({
|
|
|
343
343
|
return e(le, {
|
|
344
344
|
title: i("components.button.filter"),
|
|
345
345
|
handle: o,
|
|
346
|
-
onClose: () =>
|
|
346
|
+
onClose: () => u.show = !1
|
|
347
347
|
}, {
|
|
348
348
|
default: () => [e(ae, {
|
|
349
349
|
showLabel: !0,
|
|
@@ -354,27 +354,27 @@ const ut = /* @__PURE__ */ J({
|
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
}), e(N, {
|
|
357
|
-
show:
|
|
358
|
-
onUpdateShow: (o) =>
|
|
357
|
+
show: c.show,
|
|
358
|
+
onUpdateShow: (o) => c.show = o,
|
|
359
359
|
autoFocus: !1,
|
|
360
360
|
placement: "left"
|
|
361
361
|
}, {
|
|
362
362
|
default: () => [e(R, {
|
|
363
363
|
title: t.sideLeftTitle || i("components.button.sideLeft"),
|
|
364
|
-
onClose: () =>
|
|
364
|
+
onClose: () => c.show = !1,
|
|
365
365
|
scrollbar: !1
|
|
366
366
|
}, {
|
|
367
367
|
default: () => [l?.sideLeft?.()]
|
|
368
368
|
})]
|
|
369
369
|
}), e(N, {
|
|
370
|
-
show:
|
|
371
|
-
onUpdateShow: (o) =>
|
|
370
|
+
show: d.show,
|
|
371
|
+
onUpdateShow: (o) => d.show = o,
|
|
372
372
|
autoFocus: !1,
|
|
373
373
|
placement: "right"
|
|
374
374
|
}, {
|
|
375
375
|
default: () => [e(R, {
|
|
376
376
|
title: t.sideRightTitle || i("components.button.sideRight"),
|
|
377
|
-
onClose: () =>
|
|
377
|
+
onClose: () => d.show = !1,
|
|
378
378
|
scrollbar: !1
|
|
379
379
|
}, {
|
|
380
380
|
default: () => [l?.sideRight?.()]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, computed as m, createVNode as r, mergeProps as n } from "vue";
|
|
2
2
|
import { NDataTable as p } from "naive-ui";
|
|
3
3
|
import { DuxTableLayout as i } from "../layout/table.js";
|
|
4
4
|
import "@duxweb/dvha-core";
|
|
5
5
|
import "clsx";
|
|
6
|
-
import { DuxListEmpty as
|
|
7
|
-
const
|
|
6
|
+
import { DuxListEmpty as b } from "../status/listEmpty.js";
|
|
7
|
+
const g = /* @__PURE__ */ l({
|
|
8
8
|
name: "DuxTablePage",
|
|
9
9
|
props: {
|
|
10
10
|
tableProps: {
|
|
@@ -16,14 +16,14 @@ const P = /* @__PURE__ */ d({
|
|
|
16
16
|
setup(a, {
|
|
17
17
|
slots: t
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
19
|
+
const d = m(() => {
|
|
20
20
|
const {
|
|
21
21
|
tableProps: o,
|
|
22
22
|
...e
|
|
23
23
|
} = a;
|
|
24
24
|
return e;
|
|
25
25
|
});
|
|
26
|
-
return () => r(i,
|
|
26
|
+
return () => r(i, d.value, {
|
|
27
27
|
default: (o) => r(p, n(o.table.value, a.tableProps, {
|
|
28
28
|
class: "h-full",
|
|
29
29
|
minHeight: 200,
|
|
@@ -34,7 +34,7 @@ const P = /* @__PURE__ */ d({
|
|
|
34
34
|
scrollX: o.width,
|
|
35
35
|
renderCell: (e) => e == null || e === "" ? "-" : e
|
|
36
36
|
}), {
|
|
37
|
-
empty: () => r(
|
|
37
|
+
empty: () => r(b, {
|
|
38
38
|
bordered: !1
|
|
39
39
|
}, null)
|
|
40
40
|
}),
|
|
@@ -42,10 +42,11 @@ const P = /* @__PURE__ */ d({
|
|
|
42
42
|
tools: t?.tools,
|
|
43
43
|
actions: t?.actions,
|
|
44
44
|
sideLeft: t?.sideLeft,
|
|
45
|
-
sideRight: t?.sideRight
|
|
45
|
+
sideRight: t?.sideRight,
|
|
46
|
+
header: t?.header
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
g as DuxTablePage
|
|
51
52
|
};
|
package/dist/esm/hooks/action.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { useI18n as
|
|
1
|
+
import { useI18n as h, useManage as A, useCustomMutation as M, useDelete as S } from "@duxweb/dvha-core";
|
|
2
2
|
import { useMessage as D, NButton as b, NDropdown as C } from "naive-ui";
|
|
3
3
|
import { h as l } from "vue";
|
|
4
4
|
import { useRouter as I } from "vue-router";
|
|
5
5
|
import { useDialog as N } from "./dialog.js";
|
|
6
|
-
import { useDrawer as
|
|
7
|
-
import { useModal as
|
|
6
|
+
import { useDrawer as W } from "./drawer.js";
|
|
7
|
+
import { useModal as $ } from "./modal.js";
|
|
8
8
|
function K(o) {
|
|
9
|
-
const u =
|
|
9
|
+
const u = $(), i = W(), m = N(), {
|
|
10
10
|
t: n
|
|
11
|
-
} =
|
|
11
|
+
} = h(), d = D(), g = A(), w = I(), P = M({
|
|
12
12
|
onSuccess: (t) => {
|
|
13
|
-
|
|
13
|
+
d.success(t.message || n("common.success"));
|
|
14
14
|
},
|
|
15
15
|
onError: (t) => {
|
|
16
|
-
|
|
16
|
+
d.error(t.message || n("common.error"));
|
|
17
17
|
}
|
|
18
18
|
}), k = S({
|
|
19
19
|
onSuccess: (t) => {
|
|
20
|
-
|
|
20
|
+
d.success(t.message || n("common.success"));
|
|
21
21
|
},
|
|
22
22
|
onError: (t) => {
|
|
23
|
-
|
|
23
|
+
d.error(t.message || n("common.error"));
|
|
24
24
|
}
|
|
25
|
-
}), r = o?.path ||
|
|
26
|
-
const
|
|
25
|
+
}), r = o?.path || g.getPath(), f = (t) => {
|
|
26
|
+
const c = n(t.item.title || "", {}, t.item.title), s = n(t.item.label || "", {}, t.item.label);
|
|
27
27
|
if (t.item.type === "modal") {
|
|
28
|
-
const e = t.item,
|
|
28
|
+
const e = t.item, a = typeof e.componentProps == "function" ? e.componentProps(t.data) : e.componentProps;
|
|
29
29
|
u.show({
|
|
30
|
-
title:
|
|
30
|
+
title: c || s,
|
|
31
31
|
component: e.component,
|
|
32
32
|
componentProps: {
|
|
33
33
|
id: t.id,
|
|
34
|
-
...
|
|
34
|
+
...a
|
|
35
35
|
},
|
|
36
36
|
width: e.width,
|
|
37
37
|
draggable: e.draggable !== void 0 ? e.draggable : !0
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
if (t.item.type === "drawer") {
|
|
41
|
-
const e = t.item,
|
|
41
|
+
const e = t.item, a = typeof e.componentProps == "function" ? e.componentProps(t.data) : e.componentProps;
|
|
42
42
|
i.show({
|
|
43
|
-
title:
|
|
43
|
+
title: c || s,
|
|
44
44
|
component: e.component,
|
|
45
45
|
componentProps: {
|
|
46
46
|
id: t.id,
|
|
47
|
-
...
|
|
47
|
+
...a
|
|
48
48
|
},
|
|
49
49
|
width: e.width,
|
|
50
50
|
maxWidth: e.maxWidth
|
|
@@ -53,30 +53,30 @@ function K(o) {
|
|
|
53
53
|
if (t.item.type === "confirm") {
|
|
54
54
|
const e = t.item;
|
|
55
55
|
m.confirm({
|
|
56
|
-
title:
|
|
56
|
+
title: c || s,
|
|
57
57
|
content: e.content
|
|
58
|
-
}).then((
|
|
59
|
-
|
|
58
|
+
}).then((a) => {
|
|
59
|
+
a && e.callback?.(t.id, t.data);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
if (t.item.type === "request") {
|
|
63
63
|
const e = t.item;
|
|
64
64
|
m.confirm({
|
|
65
|
-
title:
|
|
65
|
+
title: c || s,
|
|
66
66
|
content: e.content
|
|
67
67
|
}).then(() => {
|
|
68
|
-
const
|
|
68
|
+
const a = typeof e.data == "function" ? e.data(t.id, t.data) : e.data, j = (e.method || "post").toLowerCase(), v = typeof e.path == "function" ? e.path(t.id, t.data) : e.path || r;
|
|
69
69
|
P.mutate({
|
|
70
70
|
path: v,
|
|
71
71
|
method: j,
|
|
72
|
-
payload:
|
|
72
|
+
payload: a
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
if (t.item.type === "delete") {
|
|
77
77
|
const e = t.item;
|
|
78
78
|
m.confirm({
|
|
79
|
-
title:
|
|
79
|
+
title: c || s,
|
|
80
80
|
content: e.content
|
|
81
81
|
}).then(() => {
|
|
82
82
|
k.mutate({
|
|
@@ -86,19 +86,20 @@ function K(o) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (t.item.type === "link") {
|
|
89
|
-
const e = t.item
|
|
90
|
-
|
|
89
|
+
const e = t.item;
|
|
90
|
+
let a = typeof e.path == "function" ? e.path?.(t.id, t.data) : t.id ? `${e.path || r}${t.data === void 0 ? "" : `/${t.id}`}` : e.path || r;
|
|
91
|
+
a.startsWith("/") || (a = g.getRoutePath(a)), w.push(a);
|
|
91
92
|
}
|
|
92
93
|
t.item.type === "callback" && t.item.callback?.(t.id, t.data);
|
|
93
|
-
}, y =
|
|
94
|
+
}, y = B(), x = E();
|
|
94
95
|
return {
|
|
95
|
-
target:
|
|
96
|
-
renderTable: (t) => (
|
|
96
|
+
target: f,
|
|
97
|
+
renderTable: (t) => (c, s) => {
|
|
97
98
|
const e = {
|
|
98
|
-
id:
|
|
99
|
-
data:
|
|
99
|
+
id: c[t.key || o?.key || "id"],
|
|
100
|
+
data: c,
|
|
100
101
|
index: s,
|
|
101
|
-
target:
|
|
102
|
+
target: f,
|
|
102
103
|
text: t.text !== void 0 ? t.text : o?.text || !1,
|
|
103
104
|
align: t.align !== void 0 ? t.align : o?.align || "left"
|
|
104
105
|
};
|
|
@@ -111,29 +112,29 @@ function K(o) {
|
|
|
111
112
|
});
|
|
112
113
|
},
|
|
113
114
|
renderAction: (t) => {
|
|
114
|
-
const
|
|
115
|
-
target:
|
|
115
|
+
const c = {
|
|
116
|
+
target: f,
|
|
116
117
|
text: t.text !== void 0 ? t.text : o?.text || !1,
|
|
117
118
|
align: t.align !== void 0 ? t.align : o?.align || "left"
|
|
118
119
|
};
|
|
119
120
|
return (t.type || o?.type) === "button" ? y.render({
|
|
120
|
-
...
|
|
121
|
+
...c,
|
|
121
122
|
action: t || o
|
|
122
123
|
}) : x.render({
|
|
123
|
-
...
|
|
124
|
+
...c,
|
|
124
125
|
action: t || o
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
};
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function B() {
|
|
130
131
|
const {
|
|
131
132
|
t: o
|
|
132
|
-
} =
|
|
133
|
+
} = h();
|
|
133
134
|
return {
|
|
134
135
|
render: (i) => {
|
|
135
|
-
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n,
|
|
136
|
-
key:
|
|
136
|
+
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n, d) => l(b, {
|
|
137
|
+
key: d,
|
|
137
138
|
type: n.color || (n.type === "delete" ? "error" : "primary"),
|
|
138
139
|
text: i.text,
|
|
139
140
|
secondary: !i.text,
|
|
@@ -154,15 +155,15 @@ function E() {
|
|
|
154
155
|
}
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function E() {
|
|
158
159
|
const {
|
|
159
160
|
t: o
|
|
160
|
-
} =
|
|
161
|
+
} = h();
|
|
161
162
|
return {
|
|
162
163
|
render: (i) => {
|
|
163
|
-
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n,
|
|
164
|
+
const m = i.action.items?.filter((n) => !n.show || n.show?.(i.data, i.index)).map((n, d) => ({
|
|
164
165
|
label: o(n.label || "", {}, n.label),
|
|
165
|
-
key:
|
|
166
|
+
key: d,
|
|
166
167
|
icon: n.icon ? () => l("div", {
|
|
167
168
|
class: ["n-icon", n.icon]
|
|
168
169
|
}) : void 0,
|
|
@@ -177,8 +178,8 @@ function T() {
|
|
|
177
178
|
return l(C, {
|
|
178
179
|
trigger: "click",
|
|
179
180
|
options: m,
|
|
180
|
-
onSelect: (n,
|
|
181
|
-
|
|
181
|
+
onSelect: (n, d) => {
|
|
182
|
+
d?.onSelect?.();
|
|
182
183
|
}
|
|
183
184
|
}, () => [l("div", {
|
|
184
185
|
class: ["flex items-center", i.align === "right" ? "justify-end" : i.align === "center" ? "justify-center" : "justify-start"]
|
|
@@ -195,6 +196,6 @@ function T() {
|
|
|
195
196
|
}
|
|
196
197
|
export {
|
|
197
198
|
K as useAction,
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
B as useActionButton,
|
|
200
|
+
E as useActionDropdown
|
|
200
201
|
};
|
|
@@ -2,10 +2,10 @@ import { createVNode as r } from "vue";
|
|
|
2
2
|
import { findKey as u, get as a } from "lodash-es";
|
|
3
3
|
function f() {
|
|
4
4
|
return {
|
|
5
|
-
render: (n) => (
|
|
6
|
-
const o = n?.key || "status", t = u(n.maps, (
|
|
5
|
+
render: (n) => (l, c) => {
|
|
6
|
+
const o = n?.key || "status", t = u(n.maps, (s) => s ? s?.value === a(l, o) : !1), e = t ? n.maps?.[t] : void 0;
|
|
7
7
|
return e ? r("div", {
|
|
8
|
-
class: ["flex gap-1", `text-${t}`]
|
|
8
|
+
class: ["flex gap-1 items-center", `text-${t}`]
|
|
9
9
|
}, [e.icon ? r("div", {
|
|
10
10
|
class: `size-4 ${e.icon}`
|
|
11
11
|
}, null) : null, r("span", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const r = `/* layer: properties */
|
|
2
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-from-opacity:100%;--un-
|
|
2
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-from-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-text-opacity:100%;--un-bg-opacity:100%;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-border-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-to-opacity:100%;--un-outline-style:solid;--un-fill-opacity:100%;}}
|
|
3
3
|
@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
4
4
|
@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
5
5
|
@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
@@ -954,6 +954,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
954
954
|
.i-tabler\\:forms{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3m7-14h7a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-7M5 7H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h1m12-5h.01M13 12h.01'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
955
955
|
.i-tabler\\:grid-4x4{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6h18M3 12h18M3 18h18M6 3v18m6-18v18m6-18v18'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
956
956
|
.i-tabler\\:grid-dots{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 5a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0M4 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0M4 19a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
957
|
+
.i-tabler\\:help{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9 5v.01'/%3E%3Cpath d='M12 13.5a1.5 1.5 0 0 1 1-1.5a2.6 2.6 0 1 0-3-4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
957
958
|
.i-tabler\\:hexagons{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 18v-5l4-2l4 2v5l-4 2zm4-7V6l4-2l4 2v5m-4 2l4-2l4 2v5l-4 2l-4-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
958
959
|
.i-tabler\\:info-circle{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01'/%3E%3Cpath d='M11 12h1v4h1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
959
960
|
.i-tabler\\:info-circle-filled{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1-19.995.324L2 12l.004-.28C2.152 6.327 6.57 2 12 2m0 9h-1l-.117.007a1 1 0 0 0 0 1.986L11 13v3l.007.117a1 1 0 0 0 .876.876L12 17h1l.117-.007a1 1 0 0 0 .876-.876L14 16l-.007-.117a1 1 0 0 0-.764-.857l-.112-.02L13 15v-3l-.007-.117a1 1 0 0 0-.876-.876zm.01-3l-.127.007a1 1 0 0 0 0 1.986L12 10l.127-.007a1 1 0 0 0 0-1.986z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
@@ -3,6 +3,7 @@ import type { PropType, VNode } from 'vue';
|
|
|
3
3
|
export declare const DuxFormItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
label: StringConstructor;
|
|
5
5
|
description: PropType<string | VNode>;
|
|
6
|
+
tooltip: StringConstructor;
|
|
6
7
|
path: StringConstructor;
|
|
7
8
|
labelPlacement: {
|
|
8
9
|
type: PropType<"left" | "top" | "setting" | "page">;
|
|
@@ -22,6 +23,7 @@ export declare const DuxFormItem: import("vue").DefineComponent<import("vue").Ex
|
|
|
22
23
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
24
|
label: StringConstructor;
|
|
24
25
|
description: PropType<string | VNode>;
|
|
26
|
+
tooltip: StringConstructor;
|
|
25
27
|
path: StringConstructor;
|
|
26
28
|
labelPlacement: {
|
|
27
29
|
type: PropType<"left" | "top" | "setting" | "page">;
|
|
@@ -23,7 +23,7 @@ export interface DrawerActionItem extends BaseActionItem {
|
|
|
23
23
|
}
|
|
24
24
|
export interface LinkActionItem extends BaseActionItem {
|
|
25
25
|
type: 'link';
|
|
26
|
-
path
|
|
26
|
+
path?: string | ((id?: unknown, item?: Record<string, any>) => string);
|
|
27
27
|
}
|
|
28
28
|
export interface ConfirmActionItem extends BaseActionItem {
|
|
29
29
|
type: 'confirm';
|
|
@@ -40,7 +40,7 @@ export interface RequestActionItem extends BaseActionItem {
|
|
|
40
40
|
export interface DeleteActionItem extends BaseActionItem {
|
|
41
41
|
type: 'delete';
|
|
42
42
|
content?: string;
|
|
43
|
-
path
|
|
43
|
+
path?: string | ((id?: unknown, item?: Record<string, any>) => string);
|
|
44
44
|
}
|
|
45
45
|
export interface CallbackActionItem extends BaseActionItem {
|
|
46
46
|
type: 'callback';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duxweb/dvha-pro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.29",
|
|
5
5
|
"author": "DuxWeb",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ant-design/colors": "^7.2.1",
|
|
36
|
-
"@duxweb/dvha-core": "^1.0.
|
|
37
|
-
"@duxweb/dvha-naiveui": "^1.0.
|
|
36
|
+
"@duxweb/dvha-core": "^1.0.29",
|
|
37
|
+
"@duxweb/dvha-naiveui": "^1.0.29",
|
|
38
38
|
"@iconify-json/tabler": "^1.2.18",
|
|
39
39
|
"@overlastic/vue": "^0.8.1",
|
|
40
40
|
"@tanstack/vue-query": "^5.80.7",
|