@duxweb/dvha-pro 1.0.36 → 1.0.38
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/tree/treeFilter.cjs +1 -1
- package/dist/cjs/components/widget/image.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +3 -1
- package/dist/esm/components/tree/treeFilter.js +105 -88
- package/dist/esm/components/widget/image.js +8 -12
- package/dist/esm/theme/uno.css.js +3 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("@duxweb/dvha-core"),_=require("@vueuse/core"),z=require("clsx"),s=require("naive-ui"),X=require("../card/card.cjs"),Y=t.defineComponent({name:"DuxTreeFilter",props:{title:String,path:String,sortPath:String,params:Object,menus:Array,numField:String,iconField:String,treeOptions:Object,value:Array,defaultValue:Array,onUpdateValue:Function,draggable:Boolean,bordered:{type:Boolean,default:!1}},extends:s.NTree,setup(a,{emit:D,slots:b}){const N=_.useVModel(a,"value",D,{passive:!1,defaultValue:a.defaultValue}),O=t.toRef(a,"params",{}),C=t.toRef(a,"path",""),T=t.toRef(a,"sortPath",""),S=t.ref(),w=t.ref(0),F=t.ref(0),i=t.ref([]),y=t.ref(),{t:K}=g.useI18n(),{options:U,loading:q,expanded:A}=g.useTree({path:C.value,params:O.value,...a.treeOptions});t.watch(U,e=>{i.value=e},{immediate:!0,deep:!0});const x=t.ref(!1),I=t.computed(()=>a.menus?.map(e=>({label:e.label,key:e.value,icon:e?.icon?()=>t.createVNode("div",{class:e?.icon},null):void 0,onSelect:e.onSelect}))||[]),E=e=>{const l=a.menus?.find(n=>n.value===e);l&&l.onSelect(S.value),x.value=!1},j=g.useCustomMutation({path:T.value,method:"POST"}),V=(e,l)=>{for(const n of e)if(n.children){for(const r of n.children)if(r.id===l)return n;const d=V(n.children,l);if(d)return d}},B=({node:e,dragNode:l,dropPosition:n})=>{const d=V(i.value,l.id),r=!d,p=[...i.value];if(r){const o=i.value.findIndex(k=>k.id===l.id);o>=0&&p.splice(o,1)}else{const o=d?.children?.indexOf(l)||0;d?.children?.splice(o,1)}let h=V(p,e.id),m,c=h?.children||p,u=0;switch(n){case"before":u=c.findIndex(o=>o.id===e.id),u>0&&(m=c[u-1].id);break;case"inside":h=e,c=h.children=h.children||[],u=c.length;break;case"after":u=c.findIndex(o=>o.id===e.id)+1,m=e.id;break}c.splice(u,0,l),i.value=p,j.mutate({payload:{parent_id:h?.id,before_id:m,id:l.id}})},f=t.ref([]),v=t.ref(!1);t.watch(A,e=>{f?.value?.length>0||(v.value=e.length>0,f.value=e)},{immediate:!0});const P=e=>{const l=[],n=d=>{d.forEach(r=>{r.children&&r.children.length>0&&(l.push(r.key||r.id),n(r.children))})};return n(e),l},M=()=>{v.value?(f.value=[],v.value=!1):(f.value=P(i.value),v.value=!0)},R=t.computed(()=>{const{title:e,path:l,sortPath:n,params:d,menus:r,numField:p,iconField:h,treeOptions:m,value:c,defaultValue:u,onUpdateValue:o,bordered:k,...L}=a;return L});return()=>t.createVNode(X.DuxCard,{class:"h-full",contentClass:"flex flex-col",bordered:a.bordered},{default:()=>[a?.title&&t.createVNode("div",{class:"px-2 py-3 pb-1 text-base font-bold"},[a.title]),t.createVNode("div",{class:"p-2 flex gap-2 items-center"},[t.createVNode(s.NButton,{onClick:M},{icon:()=>t.createVNode("div",{class:v.value?"i-tabler:fold-up":"i-tabler:fold-down"},null)}),t.createVNode("div",{class:"flex-1"},[b.header?b.header():t.createVNode(s.NInput,{value:y.value,"onUpdate:value":e=>y.value=e,placeholder:K("common.keyword")},null)]),b.tools?.()]),t.createVNode(s.NScrollbar,{class:"flex-1 min-h-0",xScrollable:!0},{default:()=>[t.createVNode("div",{class:"p-2"},[t.createVNode(s.NSpin,{show:q.value,class:"h-full"},{default:()=>[t.createVNode(s.NTree,t.mergeProps(R.value,{data:i.value||[],expandedKeys:f.value,onUpdateExpandedKeys:e=>{f.value=e;const l=P(i.value);v.value=l.length>0&&l.every(n=>e.includes(n))},blockLine:!0,selectedKeys:N.value,onUpdateSelectedKeys:e=>{N.value=e,a?.onUpdateValue?.(e)},onDrop:B,pattern:y.value,renderPrefix:a?.numField||a?.iconField?({option:e})=>t.createVNode(t.Fragment,null,[a.iconField&&e[a.iconField]&&t.createVNode("div",{class:z(e[a.iconField]||"","size-4")},null),a.numField&&t.createVNode("div",{class:"rounded-full bg-primary px-2 text-xs text-white"},[e[a.numField]||0])]):void 0,nodeProps:({option:e})=>({onContextmenu:l=>{S.value=e,x.value=!0,w.value=l.clientX,F.value=l.clientY,l.preventDefault()}})}),null)]})])]}),t.createVNode(s.NDropdown,{trigger:"manual",placement:"bottom-start",show:x.value,options:I.value,x:w.value,y:F.value,width:100,onSelect:E,onClickoutside:()=>{x.value=!1}},null)]})}});exports.DuxTreeFilter=Y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("naive-ui"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("naive-ui"),i=require("./placeholder.cjs"),l=e.defineComponent({name:"DuxImage",props:{},extends:t.NImage,setup(r){return()=>{const a=`size-${r.height}px`,c=e.createVNode("svg",{viewBox:"0 0 100 100",class:a},[e.createVNode("circle",{cx:"50",cy:"50",r:"50",fill:"rgb(var(--ui-color-primary))","fill-opacity":"0.1"},null),e.createVNode("g",{fill:"rgb(var(--ui-color-primary))","fill-opacity":"0.65"},[e.createVNode("circle",{cx:"50",cy:"36",r:"14"},null),e.createVNode("path",{d:"M 50 54 C 30 54 15 69 15 87 L 15 100 L 85 100 L 85 87 C 85 69 70 54 50 54 Z"},null)]),e.createVNode("g",{fill:"rgb(var(--ui-color-primary))","fill-opacity":"0.3"},[e.createVNode("circle",{cx:"20",cy:"20",r:"1.5"},[e.createVNode("animate",{attributeName:"r",values:"1.5;2.5;1.5",dur:"3s",repeatCount:"indefinite"},null)]),e.createVNode("circle",{cx:"80",cy:"25",r:"1"},[e.createVNode("animate",{attributeName:"r",values:"1;2;1",dur:"4s",repeatCount:"indefinite"},null)])])]);return r.src?e.createVNode(t.NImage,e.mergeProps(r,{src:r.src}),{placeholder:()=>e.createVNode(i.DuxPlaceholder,{width:r.width,height:r.height},null)}):e.h(c)}}});exports.DuxImage=l;
|
|
@@ -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-text-opacity:100%;--un-bg-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--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-text-opacity:100%;--un-bg-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--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%;}
|
|
@@ -951,6 +951,8 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
951
951
|
.i-tabler\\:eye-off{--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='M10.585 10.587a2 2 0 0 0 2.829 2.828'/%3E%3Cpath d='M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18'/%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;}
|
|
952
952
|
.i-tabler\\:file-export{--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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M11.5 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v5m-5 6h7m-3-3l3 3l-3 3'/%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;}
|
|
953
953
|
.i-tabler\\:file-upload{--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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2m-5-10v6'/%3E%3Cpath d='M9.5 13.5L12 11l2.5 2.5'/%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;}
|
|
954
|
+
.i-tabler\\:fold-down{--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 11v8l3-3m-6 0l3 3M9 7h1m4 0h1m4 0h1M4 7h1'/%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
|
+
.i-tabler\\:fold-up{--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 13V5L9 8m6 0l-3-3M9 17h1m4 0h1m4 0h1M4 17h1'/%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;}
|
|
954
956
|
.i-tabler\\:folder{--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='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-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;}
|
|
955
957
|
.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;}
|
|
956
958
|
.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;}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useVModel as
|
|
4
|
-
import
|
|
5
|
-
import { NTree as
|
|
6
|
-
import { DuxCard as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as q, toRef as S, ref as u, watch as V, computed as C, createVNode as n, mergeProps as G, Fragment as H } from "vue";
|
|
2
|
+
import { useI18n as J, useTree as Q, useCustomMutation as W } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as Z } from "@vueuse/core";
|
|
4
|
+
import $ from "clsx";
|
|
5
|
+
import { NTree as K, NButton as ee, NInput as le, NScrollbar as te, NSpin as ne, NDropdown as ae } from "naive-ui";
|
|
6
|
+
import { DuxCard as ie } from "../card/card.js";
|
|
7
|
+
const fe = /* @__PURE__ */ q({
|
|
8
8
|
name: "DuxTreeFilter",
|
|
9
9
|
props: {
|
|
10
10
|
title: String,
|
|
@@ -24,111 +24,120 @@ const re = /* @__PURE__ */ R({
|
|
|
24
24
|
default: !1
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
extends:
|
|
27
|
+
extends: K,
|
|
28
28
|
setup(t, {
|
|
29
|
-
emit:
|
|
30
|
-
slots:
|
|
29
|
+
emit: T,
|
|
30
|
+
slots: b
|
|
31
31
|
}) {
|
|
32
|
-
const
|
|
32
|
+
const w = Z(t, "value", T, {
|
|
33
33
|
passive: !1,
|
|
34
34
|
defaultValue: t.defaultValue
|
|
35
|
-
}),
|
|
36
|
-
t:
|
|
37
|
-
} =
|
|
38
|
-
options:
|
|
39
|
-
loading:
|
|
35
|
+
}), U = S(t, "params", {}), A = S(t, "path", ""), I = S(t, "sortPath", ""), F = u(), P = u(0), k = u(0), r = u([]), y = u(), {
|
|
36
|
+
t: N
|
|
37
|
+
} = J(), {
|
|
38
|
+
options: E,
|
|
39
|
+
loading: B,
|
|
40
40
|
expanded: j
|
|
41
|
-
} =
|
|
42
|
-
path:
|
|
43
|
-
params:
|
|
41
|
+
} = Q({
|
|
42
|
+
path: A.value,
|
|
43
|
+
params: U.value,
|
|
44
44
|
...t.treeOptions
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
V(E, (e) => {
|
|
47
|
+
r.value = e;
|
|
48
48
|
}, {
|
|
49
49
|
immediate: !0,
|
|
50
50
|
deep: !0
|
|
51
51
|
});
|
|
52
|
-
const
|
|
52
|
+
const p = u(!1), L = C(() => t.menus?.map((e) => ({
|
|
53
53
|
label: e.label,
|
|
54
54
|
key: e.value,
|
|
55
55
|
icon: e?.icon ? () => n("div", {
|
|
56
56
|
class: e?.icon
|
|
57
57
|
}, null) : void 0,
|
|
58
58
|
onSelect: e.onSelect
|
|
59
|
-
})) || []),
|
|
59
|
+
})) || []), M = (e) => {
|
|
60
60
|
const l = t.menus?.find((a) => a.value === e);
|
|
61
|
-
l && l.onSelect(
|
|
62
|
-
},
|
|
61
|
+
l && l.onSelect(F.value), p.value = !1;
|
|
62
|
+
}, _ = W({
|
|
63
63
|
path: I.value,
|
|
64
64
|
method: "POST"
|
|
65
|
-
}),
|
|
65
|
+
}), g = (e, l) => {
|
|
66
66
|
for (const a of e)
|
|
67
67
|
if (a.children) {
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
68
|
+
for (const i of a.children)
|
|
69
|
+
if (i.id === l)
|
|
70
70
|
return a;
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
71
|
+
const o = g(a.children, l);
|
|
72
|
+
if (o)
|
|
73
|
+
return o;
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, z = ({
|
|
76
76
|
node: e,
|
|
77
77
|
dragNode: l,
|
|
78
78
|
dropPosition: a
|
|
79
79
|
}) => {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
80
|
+
const o = g(r.value, l.id), i = !o, m = [...r.value];
|
|
81
|
+
if (i) {
|
|
82
|
+
const d = r.value.findIndex((O) => O.id === l.id);
|
|
83
|
+
d >= 0 && m.splice(d, 1);
|
|
84
84
|
} else {
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const d = o?.children?.indexOf(l) || 0;
|
|
86
|
+
o?.children?.splice(d, 1);
|
|
87
87
|
}
|
|
88
|
-
let
|
|
88
|
+
let h = g(m, e.id), x, s = h?.children || m, c = 0;
|
|
89
89
|
switch (a) {
|
|
90
90
|
case "before":
|
|
91
|
-
|
|
91
|
+
c = s.findIndex((d) => d.id === e.id), c > 0 && (x = s[c - 1].id);
|
|
92
92
|
break;
|
|
93
93
|
case "inside":
|
|
94
|
-
|
|
94
|
+
h = e, s = h.children = h.children || [], c = s.length;
|
|
95
95
|
break;
|
|
96
96
|
case "after":
|
|
97
|
-
|
|
97
|
+
c = s.findIndex((d) => d.id === e.id) + 1, x = e.id;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
s.splice(c, 0, l), r.value = m, _.mutate({
|
|
101
101
|
payload: {
|
|
102
|
-
parent_id:
|
|
103
|
-
before_id:
|
|
102
|
+
parent_id: h?.id,
|
|
103
|
+
before_id: x,
|
|
104
104
|
id: l.id
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
}, f = u([]), v = u(!1);
|
|
108
|
+
V(j, (e) => {
|
|
109
|
+
f?.value?.length > 0 || (v.value = e.length > 0, f.value = e);
|
|
110
110
|
}, {
|
|
111
111
|
immediate: !0
|
|
112
112
|
});
|
|
113
|
-
const
|
|
113
|
+
const D = (e) => {
|
|
114
|
+
const l = [], a = (o) => {
|
|
115
|
+
o.forEach((i) => {
|
|
116
|
+
i.children && i.children.length > 0 && (l.push(i.key || i.id), a(i.children));
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
return a(e), l;
|
|
120
|
+
}, R = () => {
|
|
121
|
+
v.value ? (f.value = [], v.value = !1) : (f.value = D(r.value), v.value = !0);
|
|
122
|
+
}, X = C(() => {
|
|
114
123
|
const {
|
|
115
124
|
title: e,
|
|
116
125
|
path: l,
|
|
117
126
|
sortPath: a,
|
|
118
|
-
params:
|
|
119
|
-
menus:
|
|
120
|
-
numField:
|
|
121
|
-
iconField:
|
|
122
|
-
treeOptions:
|
|
123
|
-
value:
|
|
124
|
-
defaultValue:
|
|
125
|
-
onUpdateValue:
|
|
126
|
-
bordered:
|
|
127
|
-
...
|
|
127
|
+
params: o,
|
|
128
|
+
menus: i,
|
|
129
|
+
numField: m,
|
|
130
|
+
iconField: h,
|
|
131
|
+
treeOptions: x,
|
|
132
|
+
value: s,
|
|
133
|
+
defaultValue: c,
|
|
134
|
+
onUpdateValue: d,
|
|
135
|
+
bordered: O,
|
|
136
|
+
...Y
|
|
128
137
|
} = t;
|
|
129
|
-
return
|
|
138
|
+
return Y;
|
|
130
139
|
});
|
|
131
|
-
return () => n(
|
|
140
|
+
return () => n(ie, {
|
|
132
141
|
class: "h-full",
|
|
133
142
|
contentClass: "flex flex-col",
|
|
134
143
|
bordered: t.bordered
|
|
@@ -137,39 +146,47 @@ const re = /* @__PURE__ */ R({
|
|
|
137
146
|
class: "px-2 py-3 pb-1 text-base font-bold"
|
|
138
147
|
}, [t.title]), n("div", {
|
|
139
148
|
class: "p-2 flex gap-2 items-center"
|
|
140
|
-
}, [n(
|
|
149
|
+
}, [n(ee, {
|
|
150
|
+
onClick: R
|
|
151
|
+
}, {
|
|
152
|
+
icon: () => n("div", {
|
|
153
|
+
class: v.value ? "i-tabler:fold-up" : "i-tabler:fold-down"
|
|
154
|
+
}, null)
|
|
155
|
+
}), n("div", {
|
|
141
156
|
class: "flex-1"
|
|
142
|
-
}, [
|
|
143
|
-
value:
|
|
144
|
-
"onUpdate:value": (e) =>
|
|
145
|
-
placeholder:
|
|
146
|
-
}, null)]),
|
|
157
|
+
}, [b.header ? b.header() : n(le, {
|
|
158
|
+
value: y.value,
|
|
159
|
+
"onUpdate:value": (e) => y.value = e,
|
|
160
|
+
placeholder: N("common.keyword")
|
|
161
|
+
}, null)]), b.tools?.()]), n(te, {
|
|
147
162
|
class: "flex-1 min-h-0",
|
|
148
163
|
xScrollable: !0
|
|
149
164
|
}, {
|
|
150
165
|
default: () => [n("div", {
|
|
151
166
|
class: "p-2"
|
|
152
|
-
}, [n(
|
|
153
|
-
show:
|
|
167
|
+
}, [n(ne, {
|
|
168
|
+
show: B.value,
|
|
154
169
|
class: "h-full"
|
|
155
170
|
}, {
|
|
156
|
-
default: () => [n(
|
|
157
|
-
data:
|
|
158
|
-
expandedKeys:
|
|
171
|
+
default: () => [n(K, G(X.value, {
|
|
172
|
+
data: r.value || [],
|
|
173
|
+
expandedKeys: f.value,
|
|
159
174
|
onUpdateExpandedKeys: (e) => {
|
|
160
|
-
|
|
175
|
+
f.value = e;
|
|
176
|
+
const l = D(r.value);
|
|
177
|
+
v.value = l.length > 0 && l.every((a) => e.includes(a));
|
|
161
178
|
},
|
|
162
179
|
blockLine: !0,
|
|
163
|
-
selectedKeys:
|
|
180
|
+
selectedKeys: w.value,
|
|
164
181
|
onUpdateSelectedKeys: (e) => {
|
|
165
|
-
|
|
182
|
+
w.value = e, t?.onUpdateValue?.(e);
|
|
166
183
|
},
|
|
167
|
-
onDrop:
|
|
168
|
-
pattern:
|
|
184
|
+
onDrop: z,
|
|
185
|
+
pattern: y.value,
|
|
169
186
|
renderPrefix: t?.numField || t?.iconField ? ({
|
|
170
187
|
option: e
|
|
171
|
-
}) => n(
|
|
172
|
-
class:
|
|
188
|
+
}) => n(H, null, [t.iconField && e[t.iconField] && n("div", {
|
|
189
|
+
class: $(e[t.iconField] || "", "size-4")
|
|
173
190
|
}, null), t.numField && n("div", {
|
|
174
191
|
class: "rounded-full bg-primary px-2 text-xs text-white"
|
|
175
192
|
}, [e[t.numField] || 0])]) : void 0,
|
|
@@ -177,27 +194,27 @@ const re = /* @__PURE__ */ R({
|
|
|
177
194
|
option: e
|
|
178
195
|
}) => ({
|
|
179
196
|
onContextmenu: (l) => {
|
|
180
|
-
|
|
197
|
+
F.value = e, p.value = !0, P.value = l.clientX, k.value = l.clientY, l.preventDefault();
|
|
181
198
|
}
|
|
182
199
|
})
|
|
183
200
|
}), null)]
|
|
184
201
|
})])]
|
|
185
|
-
}), n(
|
|
202
|
+
}), n(ae, {
|
|
186
203
|
trigger: "manual",
|
|
187
204
|
placement: "bottom-start",
|
|
188
|
-
show:
|
|
189
|
-
options:
|
|
190
|
-
x:
|
|
191
|
-
y:
|
|
205
|
+
show: p.value,
|
|
206
|
+
options: L.value,
|
|
207
|
+
x: P.value,
|
|
208
|
+
y: k.value,
|
|
192
209
|
width: 100,
|
|
193
|
-
onSelect:
|
|
210
|
+
onSelect: M,
|
|
194
211
|
onClickoutside: () => {
|
|
195
|
-
|
|
212
|
+
p.value = !1;
|
|
196
213
|
}
|
|
197
214
|
}, null)]
|
|
198
215
|
});
|
|
199
216
|
}
|
|
200
217
|
});
|
|
201
218
|
export {
|
|
202
|
-
|
|
219
|
+
fe as DuxTreeFilter
|
|
203
220
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, createVNode as e, h as c, mergeProps as n } from "vue";
|
|
2
2
|
import { NImage as i } from "naive-ui";
|
|
3
|
-
import { DuxPlaceholder as
|
|
4
|
-
const g = /* @__PURE__ */
|
|
3
|
+
import { DuxPlaceholder as o } from "./placeholder.js";
|
|
4
|
+
const g = /* @__PURE__ */ a({
|
|
5
5
|
name: "DuxImage",
|
|
6
6
|
props: {},
|
|
7
7
|
extends: i,
|
|
8
8
|
setup(r) {
|
|
9
9
|
return () => {
|
|
10
|
-
const
|
|
10
|
+
const l = `size-${r.height}px`, t = e("svg", {
|
|
11
11
|
viewBox: "0 0 100 100",
|
|
12
|
-
class:
|
|
12
|
+
class: l
|
|
13
13
|
}, [e("circle", {
|
|
14
14
|
cx: "50",
|
|
15
15
|
cy: "50",
|
|
@@ -47,18 +47,14 @@ const g = /* @__PURE__ */ c({
|
|
|
47
47
|
dur: "4s",
|
|
48
48
|
repeatCount: "indefinite"
|
|
49
49
|
}, null)])])]);
|
|
50
|
-
return r.src ? e(i,
|
|
50
|
+
return r.src ? e(i, n(r, {
|
|
51
51
|
src: r.src
|
|
52
52
|
}), {
|
|
53
|
-
placeholder: () => e(
|
|
54
|
-
width: r.width,
|
|
55
|
-
height: r.height
|
|
56
|
-
}, null),
|
|
57
|
-
error: () => e(l, {
|
|
53
|
+
placeholder: () => e(o, {
|
|
58
54
|
width: r.width,
|
|
59
55
|
height: r.height
|
|
60
56
|
}, null)
|
|
61
|
-
}) :
|
|
57
|
+
}) : c(t);
|
|
62
58
|
};
|
|
63
59
|
}
|
|
64
60
|
});
|
|
@@ -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-text-opacity:100%;--un-bg-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--un-divide-x-reverse:initial;--un-divide-opacity:100%;--un-shadow-opacity:100%;--un-ease:initial;--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--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-text-opacity:100%;--un-bg-opacity:100%;--un-divide-y-reverse:initial;--un-border-style:solid;--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%;}
|
|
@@ -951,6 +951,8 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
951
951
|
.i-tabler\\:eye-off{--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='M10.585 10.587a2 2 0 0 0 2.829 2.828'/%3E%3Cpath d='M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18'/%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;}
|
|
952
952
|
.i-tabler\\:file-export{--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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M11.5 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v5m-5 6h7m-3-3l3 3l-3 3'/%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;}
|
|
953
953
|
.i-tabler\\:file-upload{--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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2m-5-10v6'/%3E%3Cpath d='M9.5 13.5L12 11l2.5 2.5'/%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;}
|
|
954
|
+
.i-tabler\\:fold-down{--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 11v8l3-3m-6 0l3 3M9 7h1m4 0h1m4 0h1M4 7h1'/%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
|
+
.i-tabler\\:fold-up{--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 13V5L9 8m6 0l-3-3M9 17h1m4 0h1m4 0h1M4 17h1'/%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;}
|
|
954
956
|
.i-tabler\\:folder{--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='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-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;}
|
|
955
957
|
.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;}
|
|
956
958
|
.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;}
|
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.38",
|
|
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.38",
|
|
37
|
+
"@duxweb/dvha-naiveui": "^1.0.38",
|
|
38
38
|
"@iconify-json/tabler": "^1.2.18",
|
|
39
39
|
"@overlastic/vue": "^0.8.1",
|
|
40
40
|
"@tanstack/vue-query": "^5.80.7",
|