v0.0.57
This commit is contained in:
1 parent
782c763603
commit
1e194a1fd0
118 files changed
+393
-3
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
import{i as I,s as C,e as V,bW as w,r as b,p as U,al as j,c as f,l as $,d as ve,h as fe,bF as z,bb as T,bu as x,ar as ye,ae as me,bg as ge,bO as pe,at as Se,au as he,cc as be,ap as ke,af as we,bY as Ae,ag as Pe,cd as Ce,cg as Ie,w as Ve,ah as Me,av as Oe,ce as Le,bh as Be,bR as _e,ax as De,az as Ne,aj as Re,ci as Ge,P as je,c7 as Te,G as y,ch as xe,a2 as F,a4 as E,V as H,bB as K}from"./index-438e4f89.js";const L=Symbol.for("vuetify:list");function Qe(){const e=I(L,{hasPrepend:C(!1),updateHasPrepend:()=>null}),r={hasPrepend:C(!1),updateHasPrepend:l=>{l&&(r.hasPrepend.value=l)}};return V(L,r),e}function Fe(){return I(L,null)}const Ee={open:e=>{let{id:r,value:l,opened:t,parents:a}=e;if(l){const n=new Set;n.add(r);let s=a.get(r);for(;s!=null;)n.add(s),s=a.get(s);return n}else return t.delete(r),t},select:()=>null},W={open:e=>{let{id:r,value:l,opened:t,parents:a}=e;if(l){let n=a.get(r);for(t.add(r);n!=null&&n!==r;)t.add(n),n=a.get(n);return t}else t.delete(r);return t},select:()=>null},He={open:W.open,select:e=>{let{id:r,value:l,opened:t,parents:a}=e;if(!l)return t;const n=[];let s=a.get(r);for(;s!=null;)n.push(s),s=a.get(s);return new Set(n)}},B=e=>{const r={select:l=>{let{id:t,value:a,selected:n}=l;if(t=w(t),e&&!a){const s=Array.from(n.entries()).reduce((c,p)=>{let[S,m]=p;return m==="on"?[...c,S]:c},[]);if(s.length===1&&s[0]===t)return n}return n.set(t,a?"on":"off"),n},in:(l,t,a)=>{let n=new Map;for(const s of l||[])n=r.select({id:s,value:!0,selected:new Map(n),children:t,parents:a});return n},out:l=>{const t=[];for(const[a,n]of l.entries())n==="on"&&t.push(a);return t}};return r},Y=e=>{const r=B(e);return{select:t=>{let{selected:a,id:n,...s}=t;n=w(n);const c=a.has(n)?new Map([[n,a.get(n)]]):new Map;return r.select({...s,id:n,selected:c})},in:(t,a,n)=>{let s=new Map;return t!=null&&t.length&&(s=r.in(t.slice(0,1),a,n)),s},out:(t,a,n)=>r.out(t,a,n)}},Ke=e=>{const r=B(e);return{select:t=>{let{id:a,selected:n,children:s,...c}=t;return a=w(a),s.has(a)?n:r.select({id:a,selected:n,children:s,...c})},in:r.in,out:r.out}},Ue=e=>{const r=Y(e);return{select:t=>{let{id:a,selected:n,children:s,...c}=t;return a=w(a),s.has(a)?n:r.select({id:a,selected:n,children:s,...c})},in:r.in,out:r.out}},$e=e=>{const r={select:l=>{let{id:t,value:a,selected:n,children:s,parents:c}=l;t=w(t);const p=new Map(n),S=[t];for(;S.length;){const i=S.shift();n.set(i,a?"on":"off"),s.has(i)&&S.push(...s.get(i))}let m=c.get(t);for(;m;){const i=s.get(m),u=i.every(o=>n.get(o)==="on"),d=i.every(o=>!n.has(o)||n.get(o)==="off");n.set(m,u?"on":d?"off":"indeterminate"),m=c.get(m)}return e&&!a&&Array.from(n.entries()).reduce((u,d)=>{let[o,h]=d;return h==="on"?[...u,o]:u},[]).length===0?p:n},in:(l,t,a)=>{let n=new Map;for(const s of l||[])n=r.select({id:s,value:!0,selected:new Map(n),children:t,parents:a});return n},out:(l,t)=>{const a=[];for(const[n,s]of l.entries())s==="on"&&!t.has(n)&&a.push(n);return a}};return r},A=Symbol.for("vuetify:nested"),q={id:C(),root:{register:()=>null,unregister:()=>null,parents:b(new Map),children:b(new Map),open:()=>null,openOnSelect:()=>null,select:()=>null,opened:b(new Set),selected:b(new Map),selectedValues:b([])}},Xe=U({selectStrategy:[String,Function],openStrategy:[String,Object],opened:Array,selected:Array,mandatory:Boolean},"nested"),Ze=e=>{let r=!1;const l=b(new Map),t=b(new Map),a=j(e,"opened",e.opened,i=>new Set(i),i=>[...i.values()]),n=f(()=>{if(typeof e.selectStrategy=="object")return e.selectStrategy;switch(e.selectStrategy){case"single-leaf":return Ue(e.mandatory);case"leaf":return Ke(e.mandatory);case"independent":return B(e.mandatory);case"single-independent":return Y(e.mandatory);case"classic":default:return $e(e.mandatory)}}),s=f(()=>{if(typeof e.openStrategy=="object")return e.openStrategy;switch(e.openStrategy){case"list":return He;case"single":return Ee;case"multiple":default:return W}}),c=j(e,"selected",e.selected,i=>n.value.in(i,l.value,t.value),i=>n.value.out(i,l.value,t.value));$(()=>{r=!0});function p(i){const u=[];let d=i;for(;d!=null;)u.unshift(d),d=t.value.get(d);return u}const S=ve("nested"),m={id:C(),root:{opened:a,selected:c,selectedValues:f(()=>{const i=[];for(const[u,d]of c.value.entries())d==="on"&&i.push(u);return i}),register:(i,u,d)=>{u&&i!==u&&t.value.set(i,u),d&&l.value.set(i,[]),u!=null&&l.value.set(u,[...l.value.get(u)||[],i])},unregister:i=>{if(r)return;l.value.delete(i);const u=t.value.get(i);if(u){const d=l.value.get(u)??[];l.value.set(u,d.filter(o=>o!==i))}t.value.delete(i),a.value.delete(i)},open:(i,u,d)=>{S.emit("click:open",{id:i,value:u,path:p(i),event:d});const o=s.value.open({id:i,value:u,opened:new Set(a.value),children:l.value,parents:t.value,event:d});o&&(a.value=o)},openOnSelect:(i,u,d)=>{const o=s.value.select({id:i,value:u,selected:new Map(c.value),opened:new Set(a.value),children:l.value,parents:t.value,event:d});o&&(a.value=o)},select:(i,u,d)=>{S.emit("click:select",{id:i,value:u,path:p(i),event:d});const o=n.value.select({id:i,value:u,selected:new Map(c.value),childrenLine truncated
|
||||
Reference in new issue
Block a user