@duxweb/dvha-pro 1.0.37 → 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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),y=require("@duxweb/dvha-core"),B=require("@vueuse/core"),L=require("clsx"),s=require("naive-ui"),_=require("../card/card.cjs"),z=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(l,{emit:P,slots:p}){const N=B.useVModel(l,"value",P,{passive:!1,defaultValue:l.defaultValue}),D=t.toRef(l,"params",{}),O=t.toRef(l,"path",""),T=t.toRef(l,"sortPath",""),S=t.ref(),F=t.ref(0),g=t.ref(0),c=t.ref([]),b=t.ref(),{t:k}=y.useI18n(),{options:C,loading:U,expanded:q}=y.useTree({path:O.value,params:D.value,...l.treeOptions});t.watch(C,e=>{c.value=e},{immediate:!0,deep:!0});const v=t.ref(!1),I=t.computed(()=>l.menus?.map(e=>({label:e.label,key:e.value,icon:e?.icon?()=>t.createVNode("div",{class:e?.icon},null):void 0,onSelect:e.onSelect}))||[]),K=e=>{const a=l.menus?.find(n=>n.value===e);a&&a.onSelect(S.value),v.value=!1},j=y.useCustomMutation({path:T.value,method:"POST"}),V=(e,a)=>{for(const n of e)if(n.children){for(const m of n.children)if(m.id===a)return n;const d=V(n.children,a);if(d)return d}},A=({node:e,dragNode:a,dropPosition:n})=>{const d=V(c.value,a.id),m=!d,f=[...c.value];if(m){const r=c.value.findIndex(w=>w.id===a.id);r>=0&&f.splice(r,1)}else{const r=d?.children?.indexOf(a)||0;d?.children?.splice(r,1)}let u=V(f,e.id),x,o=u?.children||f,i=0;switch(n){case"before":i=o.findIndex(r=>r.id===e.id),i>0&&(x=o[i-1].id);break;case"inside":u=e,o=u.children=u.children||[],i=o.length;break;case"after":i=o.findIndex(r=>r.id===e.id)+1,x=e.id;break}o.splice(i,0,a),c.value=f,j.mutate({payload:{parent_id:u?.id,before_id:x,id:a.id}})},h=t.ref([]);t.watch(q,e=>{h?.value?.length>0||(h.value=e)},{immediate:!0});const M=t.computed(()=>{const{title:e,path:a,sortPath:n,params:d,menus:m,numField:f,iconField:u,treeOptions:x,value:o,defaultValue:i,onUpdateValue:r,bordered:w,...R}=l;return R});return()=>t.createVNode(_.DuxCard,{class:"h-full",contentClass:"flex flex-col",bordered:l.bordered},{default:()=>[l?.title&&t.createVNode("div",{class:"px-2 py-3 pb-1 text-base font-bold"},[l.title]),t.createVNode("div",{class:"p-2 flex gap-2 items-center"},[t.createVNode("div",{class:"flex-1"},[p.header?p.header():t.createVNode(s.NInput,{value:b.value,"onUpdate:value":e=>b.value=e,placeholder:k("common.keyword")},null)]),p.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:U.value,class:"h-full"},{default:()=>[t.createVNode(s.NTree,t.mergeProps(M.value,{data:c.value||[],expandedKeys:h.value,onUpdateExpandedKeys:e=>{h.value=e},blockLine:!0,selectedKeys:N.value,onUpdateSelectedKeys:e=>{N.value=e,l?.onUpdateValue?.(e)},onDrop:A,pattern:b.value,renderPrefix:l?.numField||l?.iconField?({option:e})=>t.createVNode(t.Fragment,null,[l.iconField&&e[l.iconField]&&t.createVNode("div",{class:L(e[l.iconField]||"","size-4")},null),l.numField&&t.createVNode("div",{class:"rounded-full bg-primary px-2 text-xs text-white"},[e[l.numField]||0])]):void 0,nodeProps:({option:e})=>({onContextmenu:a=>{S.value=e,v.value=!0,F.value=a.clientX,g.value=a.clientY,a.preventDefault()}})}),null)]})])]}),t.createVNode(s.NDropdown,{trigger:"manual",placement:"bottom-start",show:v.value,options:I.value,x:F.value,y:g.value,width:100,onSelect:K,onClickoutside:()=>{v.value=!1}},null)]})}});exports.DuxTreeFilter=z;
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;
@@ -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 R, toRef as S, ref as u, watch as O, computed as V, createVNode as n, mergeProps as X, Fragment as Y } from "vue";
2
- import { useI18n as q, useTree as G, useCustomMutation as H } from "@duxweb/dvha-core";
3
- import { useVModel as J } from "@vueuse/core";
4
- import Q from "clsx";
5
- import { NTree as k, NInput as W, NScrollbar as Z, NSpin as $, NDropdown as ee } from "naive-ui";
6
- import { DuxCard as te } from "../card/card.js";
7
- const re = /* @__PURE__ */ R({
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: k,
27
+ extends: K,
28
28
  setup(t, {
29
- emit: C,
30
- slots: x
29
+ emit: T,
30
+ slots: b
31
31
  }) {
32
- const F = J(t, "value", C, {
32
+ const w = Z(t, "value", T, {
33
33
  passive: !1,
34
34
  defaultValue: t.defaultValue
35
- }), T = S(t, "params", {}), U = S(t, "path", ""), I = S(t, "sortPath", ""), w = u(), g = u(0), P = u(0), s = u([]), b = u(), {
36
- t: K
37
- } = q(), {
38
- options: N,
39
- loading: A,
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
- } = G({
42
- path: U.value,
43
- params: T.value,
41
+ } = Q({
42
+ path: A.value,
43
+ params: U.value,
44
44
  ...t.treeOptions
45
45
  });
46
- O(N, (e) => {
47
- s.value = e;
46
+ V(E, (e) => {
47
+ r.value = e;
48
48
  }, {
49
49
  immediate: !0,
50
50
  deep: !0
51
51
  });
52
- const v = u(!1), B = V(() => t.menus?.map((e) => ({
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
- })) || []), L = (e) => {
59
+ })) || []), M = (e) => {
60
60
  const l = t.menus?.find((a) => a.value === e);
61
- l && l.onSelect(w.value), v.value = !1;
62
- }, M = H({
61
+ l && l.onSelect(F.value), p.value = !1;
62
+ }, _ = W({
63
63
  path: I.value,
64
64
  method: "POST"
65
- }), y = (e, l) => {
65
+ }), g = (e, l) => {
66
66
  for (const a of e)
67
67
  if (a.children) {
68
- for (const h of a.children)
69
- if (h.id === l)
68
+ for (const i of a.children)
69
+ if (i.id === l)
70
70
  return a;
71
- const d = y(a.children, l);
72
- if (d)
73
- return d;
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 d = y(s.value, l.id), h = !d, f = [...s.value];
81
- if (h) {
82
- const i = s.value.findIndex((D) => D.id === l.id);
83
- i >= 0 && f.splice(i, 1);
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 i = d?.children?.indexOf(l) || 0;
86
- d?.children?.splice(i, 1);
85
+ const d = o?.children?.indexOf(l) || 0;
86
+ o?.children?.splice(d, 1);
87
87
  }
88
- let c = y(f, e.id), p, o = c?.children || f, r = 0;
88
+ let h = g(m, e.id), x, s = h?.children || m, c = 0;
89
89
  switch (a) {
90
90
  case "before":
91
- r = o.findIndex((i) => i.id === e.id), r > 0 && (p = o[r - 1].id);
91
+ c = s.findIndex((d) => d.id === e.id), c > 0 && (x = s[c - 1].id);
92
92
  break;
93
93
  case "inside":
94
- c = e, o = c.children = c.children || [], r = o.length;
94
+ h = e, s = h.children = h.children || [], c = s.length;
95
95
  break;
96
96
  case "after":
97
- r = o.findIndex((i) => i.id === e.id) + 1, p = e.id;
97
+ c = s.findIndex((d) => d.id === e.id) + 1, x = e.id;
98
98
  break;
99
99
  }
100
- o.splice(r, 0, l), s.value = f, M.mutate({
100
+ s.splice(c, 0, l), r.value = m, _.mutate({
101
101
  payload: {
102
- parent_id: c?.id,
103
- before_id: p,
102
+ parent_id: h?.id,
103
+ before_id: x,
104
104
  id: l.id
105
105
  }
106
106
  });
107
- }, m = u([]);
108
- O(j, (e) => {
109
- m?.value?.length > 0 || (m.value = e);
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 z = V(() => {
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: d,
119
- menus: h,
120
- numField: f,
121
- iconField: c,
122
- treeOptions: p,
123
- value: o,
124
- defaultValue: r,
125
- onUpdateValue: i,
126
- bordered: D,
127
- ...E
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 E;
138
+ return Y;
130
139
  });
131
- return () => n(te, {
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("div", {
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
- }, [x.header ? x.header() : n(W, {
143
- value: b.value,
144
- "onUpdate:value": (e) => b.value = e,
145
- placeholder: K("common.keyword")
146
- }, null)]), x.tools?.()]), n(Z, {
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: A.value,
167
+ }, [n(ne, {
168
+ show: B.value,
154
169
  class: "h-full"
155
170
  }, {
156
- default: () => [n(k, X(z.value, {
157
- data: s.value || [],
158
- expandedKeys: m.value,
171
+ default: () => [n(K, G(X.value, {
172
+ data: r.value || [],
173
+ expandedKeys: f.value,
159
174
  onUpdateExpandedKeys: (e) => {
160
- m.value = e;
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: F.value,
180
+ selectedKeys: w.value,
164
181
  onUpdateSelectedKeys: (e) => {
165
- F.value = e, t?.onUpdateValue?.(e);
182
+ w.value = e, t?.onUpdateValue?.(e);
166
183
  },
167
- onDrop: _,
168
- pattern: b.value,
184
+ onDrop: z,
185
+ pattern: y.value,
169
186
  renderPrefix: t?.numField || t?.iconField ? ({
170
187
  option: e
171
- }) => n(Y, null, [t.iconField && e[t.iconField] && n("div", {
172
- class: Q(e[t.iconField] || "", "size-4")
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
- w.value = e, v.value = !0, g.value = l.clientX, P.value = l.clientY, l.preventDefault();
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(ee, {
202
+ }), n(ae, {
186
203
  trigger: "manual",
187
204
  placement: "bottom-start",
188
- show: v.value,
189
- options: B.value,
190
- x: g.value,
191
- y: P.value,
205
+ show: p.value,
206
+ options: L.value,
207
+ x: P.value,
208
+ y: k.value,
192
209
  width: 100,
193
- onSelect: L,
210
+ onSelect: M,
194
211
  onClickoutside: () => {
195
- v.value = !1;
212
+ p.value = !1;
196
213
  }
197
214
  }, null)]
198
215
  });
199
216
  }
200
217
  });
201
218
  export {
202
- re as DuxTreeFilter
219
+ fe as DuxTreeFilter
203
220
  };
@@ -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.37",
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",
37
- "@duxweb/dvha-naiveui": "^1.0.37",
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",