@svar-ui/trial-vue-kanban 2.6.0

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.
Binary file
Binary file
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Y=require("@svar-ui/lib-vue"),he=require("@svar-ui/lib-state"),Z=require("@svar-ui/trial-kanban-store"),I=require("@svar-ui/lib-dom"),T=require("@svar-ui/vue-core"),ye=require("@svar-ui/vue-menu"),_=require("@svar-ui/kanban-locales"),ee=require("@svar-ui/core-locales"),G=require("@svar-ui/vue-editor"),ke=require("@svar-ui/vue-toolbar"),be=require("@svar-ui/kanban-provider"),Ce="2.6.0",xe={version:Ce},R=(n,t)=>{const a=n.__vccOpts||n;for(const[l,o]of t)a[l]=o;return a},we=["title","aria-label"],Be=["src"],Se={key:0,class:"wx-avatar wx-more"},Ee=Object.assign({name:"KanbanAvatar"},{__name:"Avatar",props:{value:{default:null},size:{default:24},limit:{}},setup(n){const t=n,a=e.computed(()=>Array.isArray(t.value)?t.value:t.value?[t.value]:[]),l=e.computed(()=>typeof t.limit=="number"&&Number.isFinite(t.limit)?Math.max(0,Math.floor(t.limit)):a.value.length),o=e.computed(()=>a.value.slice(0,l.value)),f=e.computed(()=>Math.max(0,a.value.length-o.value.length)),C=e.computed(()=>Math.max(10,Math.round(t.size*.42))),c=e.computed(()=>`--wx-avatar-size:${t.size}px;--wx-avatar-font-size:${C.value}px;`);function r(y){return y.label??y.name??""}function h(y){const u=r(y).trim();if(!u)return"";const s=u.split(/\s+/);return(s[0][0]+(s[1]?.[0]??"")).toUpperCase().slice(0,2)}function x(y){return y.img??y.avatar}return(y,u)=>a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-avatars",style:e.normalizeStyle(c.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,s=>(e.openBlock(),e.createElementBlock("span",{key:s.id,class:e.normalizeClass("wx-avatar "+(s.css??"")),title:r(s)||void 0,"aria-label":r(s)||void 0},[x(s)?(e.openBlock(),e.createElementBlock("img",{key:0,class:"wx-image",src:x(s),alt:"",loading:"lazy"},null,8,Be)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(h(s)),1)],64))],10,we))),128)),f.value>0?(e.openBlock(),e.createElementBlock("span",Se,"+"+e.toDisplayString(f.value),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)}}),Ve=R(Ee,[["__scopeId","data-v-2884c896"]]);function me(){return{priority:!0,progress:!0,description:!0,deadline:!0,tags:!0}}function le(){return[{id:1,label:"Low",css:"wx-card-priority-low"},{id:2,label:"Medium",css:"wx-card-priority-medium"},{id:3,label:"High",css:"wx-card-priority-high"}]}function oe(n){return typeof n=="object"&&n!==null?n:void 0}function fe(n){const t=n??{description:!0,priority:!0,progress:!0,deadline:!0,tags:!1,users:!1},a=[{comp:"text",key:"label",label:"Title",required:!0}];if(t.description&&a.push({comp:"textarea",key:"description",label:"Description"}),t.priority){const f=oe(t.priority)?.data;a.push({comp:"richselect",key:"priority",label:"Priority",options:f??le()})}t.progress&&a.push({comp:"slider",key:"progress",label:"Progress",min:0,max:1,step:.1}),t.deadline&&a.push({comp:"datepicker",key:"deadline",label:"Deadline",clear:!0});const l=oe(t.tags)?.data;l&&a.push({comp:"multicombo",key:"tags",label:"Tags",options:l});const o=oe(t.users)?.data;return o&&a.push({comp:"multicombo",key:"users",label:"Users",options:o}),a}const Ne={key:1,class:"wx-header"},De={key:1,class:"wx-deadline"},ze=["aria-label"],Me={class:"wx-body"},Le={class:"wx-title-row"},Ie={key:0,class:"wx-title"},Oe=["aria-label"],Pe={key:0,class:"wx-description"},$e={key:1,class:"wx-tags"},Ae={key:2,class:"wx-progress-row"},Fe=["aria-label"],Te={key:0,class:"wx-progress-label"},Re={key:2,class:"wx-footer"},je={class:"wx-counters"},He=["aria-label"],We=["aria-label"],qe=Object.assign({name:"KanbanCard"},{__name:"Card",props:{card:{},cardShape:{}},setup(n){const t=n,a=e.inject("wx-i18n").getGroup("kanban");function l(d){return typeof d=="number"?d:Array.isArray(d)?d.length:0}function o(d){return typeof d=="object"&&d!==null?d:void 0}function f(d){if(typeof d=="string"||typeof d=="number")return d;const V=d?.id;return typeof V=="string"||typeof V=="number"?V:null}function C(d){const V=f(d);return V!=null?String(V):String(d?.label??d?.name??"")}function c(d,V){return d?.find(z=>z.id===V)}function r(d,V){const z=f(d);if(z==null)return null;const j=c(V,z);return j||{id:z,label:C(d)}}function h(d,V,z){if(!Array.isArray(d))return[];const j=d.map(L=>r(L,V)).filter(L=>L!==null);return typeof z=="number"&&Number.isFinite(z)?j.slice(0,Math.max(0,z)):j}function x(d){if(d instanceof Date)return Number.isNaN(d.getTime())?null:d;if(typeof d=="string"||typeof d=="number"){const V=new Date(d);return Number.isNaN(V.getTime())?null:V}return null}function y(d){return d<10?"0"+d:String(d)}function u(d,V){const z=x(d);return z?V?V.replace(/YYYY/g,String(z.getFullYear())).replace(/MM/g,y(z.getMonth()+1)).replace(/DD/g,y(z.getDate())).replace(/HH/g,y(z.getHours())).replace(/mm/g,y(z.getMinutes())):z.toLocaleDateString():null}const s=e.computed(()=>o(t.cardShape.priority)),N=e.computed(()=>o(t.cardShape.tags)),b=e.computed(()=>o(t.cardShape.users)),p=e.computed(()=>o(t.cardShape.deadline)),w=e.computed(()=>o(t.cardShape.progress)),M=e.computed(()=>Math.round(Math.max(0,Math.min(1,t.card.progress??0))*100)),k=e.computed(()=>t.cardShape.priority?r(t.card.priority,s.value?.data??le()):null),g=e.computed(()=>t.cardShape.tags?h(t.card.tags,N.value?.data,N.value?.max):[]),D=e.computed(()=>t.cardShape.users?h(t.card.users,b.value?.data,b.value?.max):[]),P=e.computed(()=>D.value.map(d=>({id:d.id,name:d.label,avatar:d.img}))),$=e.computed(()=>t.cardShape.deadline?u(t.card.deadline,p.value?.format):null);return(d,V)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[n.card.cover&&n.cardShape.cover?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-cover",style:e.normalizeStyle(`background-image: url(${n.card.cover});`)},null,4)):e.createCommentVNode("",!0),k.value||$.value?(e.openBlock(),e.createElementBlock("div",Ne,[k.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass("wx-priority "+(k.value.css??""))},e.toDisplayString(e.unref(a)(k.value.label)),3)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString($.value),1)):e.createCommentVNode("",!0),n.cardShape.menu?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"wx-menu","data-action":"menu","aria-label":e.unref(a)("Card menu")},[...V[0]||(V[0]=[e.createElementVNode("i",{class:"wx-icon wxi-dots-h"},null,-1)])],8,ze)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Me,[e.createElementVNode("div",Le,[n.card.label?(e.openBlock(),e.createElementBlock("div",Ie,[e.createTextVNode(e.toDisplayString(n.card.label)+" ",1),n.cardShape.menu&&!k.value&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wx-menu","data-action":"menu","aria-label":e.unref(a)("Card menu")},[...V[1]||(V[1]=[e.createElementVNode("i",{class:"wx-icon wxi-dots-h"},null,-1)])],8,Oe)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),n.card.description&&n.cardShape.description?(e.openBlock(),e.createElementBlock("p",Pe,e.toDisplayString(n.card.description),1)):e.createCommentVNode("",!0),g.value.length>0?(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z.id,class:e.normalizeClass("wx-tag "+(z.css??""))},e.toDisplayString(z.label),3))),128))])):e.createCommentVNode("",!0),n.card.progress>0&&n.cardShape.progress?(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",{class:"wx-progress","aria-label":e.unref(a)("Progress")},[e.createElementVNode("div",{class:"wx-progress-fill",style:e.normalizeStyle(`width: ${M.value}%;`)},null,4)],8,Fe),w.value?.showLabel?(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(M.value)+"%",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),D.value.length>0||l(n.card.attachments)>0&&n.cardShape.attachments||l(n.card.comments)>0&&n.cardShape.comments?(e.openBlock(),e.createElementBlock("div",Re,[P.value.length>0?(e.openBlock(),e.createBlock(Ve,{key:0,value:P.value,size:24},null,8,["value"])):e.createCommentVNode("",!0),e.createElementVNode("div",je,[l(n.card.attachments)>0&&n.cardShape.attachments?(e.openBlock(),e.createElementBlock("span",{key:0,class:"wx-counter","aria-label":e.unref(a)("Attachments")},[V[2]||(V[2]=e.createElementVNode("i",{class:"wx-icon wxi-paperclip"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l(n.card.attachments)),1)],8,He)):e.createCommentVNode("",!0),l(n.card.comments)>0&&n.cardShape.comments?(e.openBlock(),e.createElementBlock("span",{key:1,class:"wx-counter","aria-label":e.unref(a)("Comments")},[V[3]||(V[3]=e.createElementVNode("i",{class:"wx-icon wxi-message"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l(n.card.comments)),1)],8,We)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64))}}),Ke=R(qe,[["__scopeId","data-v-52077978"]]),Ge=["data-id","aria-label"],Ye={__name:"CardWrapper",props:{cardContent:{},card:{},cardShape:{},extraCss:{default:""}},setup(n){const a=e.inject("wx-i18n").getGroup("kanban");return(l,o)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass("wx-card "+(n.card.css??"")+" "+n.extraCss),"data-id":n.card.id==null?void 0:e.unref(I.setID)(n.card.id),role:"button",tabindex:"0","aria-label":n.card.label??`${e.unref(a)("Card")} ${n.card.id}`},[typeof n.cardContent=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.cardContent),{key:0,card:n.card,cardShape:n.cardShape},null,8,["card","cardShape"])):(e.openBlock(),e.createBlock(Ke,{key:1,card:n.card,cardShape:n.cardShape},null,8,["card","cardShape"]))],10,Ge))}},re=R(Ye,[["__scopeId","data-v-913e56be"]]),pe=Symbol("wx/kanban-scroll-container"),q=Symbol("kanban-api"),te=Symbol("wx/kanban-dnd");function Xe(n,t){let a=t;function l(o){if(a.readonly||o.target!==n)return;const C=ve({label:"New card"},a.columnAccessor,a.column);a.store.exec("add-card",{card:C})}return n.addEventListener("dblclick",l),{update(o){a=o},destroy(){n.removeEventListener("dblclick",l)}}}function ve(n,t,a){return typeof t=="string"?{...n,[t]:a}:t.set(n,a)}const Ue=["data-kanban-column-cards","data-kanban-render-start","data-kanban-render-end","data-kanban-card-count","data-kanban-after-rendered-before-id"],Je=["data-kanban-card-id"],Qe=["data-kanban-card-id"],Ze={__name:"CardList",props:{column:{},readonly:{type:Boolean,default:!1},cardContent:{},cardShape:{},contentVisible:{type:Boolean},virtualizeCards:{type:Boolean},estimatedCardHeight:{type:Number},cardOverscan:{type:Number},fixedColumnWidth:{type:Boolean},cardCss:{type:Function}},setup(n){const t=n;function a(v){return t.cardCss?t.cardCss(v,t.column)??"":""}const l=e.inject(q),o=e.inject(te),f=e.inject(pe,void 0),C=e.computed(()=>l.getState().columnAccessor),c=e.ref(null),r=e.ref({start:0,end:-1,top:0,bottom:0,total:0}),h=e.ref(8);let x=0,y=!1;const u=new Map,s=new Map;let N;const b=e.computed(()=>o?.active&&o.target?.column===t.column.id),p=e.computed(()=>t.virtualizeCards?r.value.start:0),w=e.computed(()=>t.virtualizeCards?r.value.end:t.column.cards.length-1),M=e.computed(()=>t.contentVisible?t.column.cards.slice(p.value,Math.max(p.value,w.value+1)):[]),k=e.computed(()=>r.value.total||d(t.column.cards.length)),g=e.computed(()=>r.value.start>0?Math.max(0,r.value.top-h.value):0),D=e.computed(()=>r.value.bottom>0?Math.max(0,r.value.bottom-h.value):0),P=e.computed(()=>t.contentVisible&&t.virtualizeCards&&w.value>=0&&w.value<t.column.cards.length-1?t.column.cards[w.value+1]?.id:void 0),$=e.computed(()=>b.value&&(o.target?.beforeId==null||o.target?.beforeId===P.value));function d(v){if(!v)return 0;const B=Math.max(1,t.estimatedCardHeight||1);return v*B+Math.max(0,v-1)*h.value}function V(){if(!c.value)return;const v=getComputedStyle(c.value),m=v.getPropertyValue("--wx-card-gap").trim()||v.rowGap||v.gap,O=Number.parseFloat(m);h.value=Number.isFinite(O)?O:8}function z(v){return v.id!=null?u.get(v.id)??Math.max(1,t.estimatedCardHeight||1):Math.max(1,t.estimatedCardHeight||1)}function j(){const v=[0];let B=0;for(let m=0;m<t.column.cards.length;m++)B+=z(t.column.cards[m]),m<t.column.cards.length-1&&(B+=h.value),v.push(B);return{offsets:v,total:B}}function L(v,B){let m=0,O=v.length;for(;m<O;){const A=Math.floor((m+O)/2);v[A]<=B?m=A+1:O=A}return m}function ne(){if(!c.value)return;if(V(),!t.contentVisible||!t.virtualizeCards){r.value={start:0,end:t.contentVisible?t.column.cards.length-1:-1,top:0,bottom:0,total:d(t.column.cards.length)};return}const v=t.column.cards.length;if(!v){r.value={start:0,end:-1,top:0,bottom:0,total:0};return}const{offsets:B,total:m}=j(),O=f?.()??null;let A=0,J=0;if(O){const F=O.getBoundingClientRect(),Q=c.value.getBoundingClientRect();A=Math.max(0,F.top-Q.top),J=Math.min(m,F.bottom-Q.top)}else A=c.value.scrollTop,J=A+c.value.clientHeight;const i=Math.max(0,Math.floor(t.cardOverscan||0));let S=Math.max(0,L(B,A)-1),E=Math.max(S,L(B,J)-1);S=Math.max(0,S-i),E=Math.min(v-1,E+i),r.value={start:S,end:E,top:B[S],bottom:Math.max(0,m-B[E+1]),total:m}}function W(){x||(x=requestAnimationFrame(()=>{x=0,ne()}))}function ae(){const v=new Set(t.column.cards.map(B=>B.id));for(const B of u.keys())v.has(B)||u.delete(B);for(;u.size>1e4;){const B=u.keys().next().value;if(B===void 0)break;u.delete(B)}}function X(){N||typeof ResizeObserver>"u"||(N=new ResizeObserver(v=>{let B=!1;for(const m of v){const O=s.get(m.target);if(O==null)continue;const A=Math.ceil(m.target.offsetHeight);A>0&&u.get(O)!==A&&(u.delete(O),u.set(O,A),B=!0)}B&&W()}))}const K={mounted(v,B){const m=B.value;m.id!=null&&(X(),s.set(v,m.id),N?.observe(v))},updated(v,B){const m=B.value;N?.unobserve(v),m.id!=null?(X(),s.set(v,m.id),N?.observe(v)):s.delete(v)},unmounted(v){N?.unobserve(v),s.delete(v)}},U={mounted(v,B){const m=Xe(v,B.value);v.__dblclickAction=m},updated(v,B){v.__dblclickAction?.update(B.value)},unmounted(v){v.__dblclickAction?.destroy(),delete v.__dblclickAction}};return e.watchEffect(()=>{t.virtualizeCards&&!y&&u.clear(),y=t.virtualizeCards,ae(),t.column.cards,t.contentVisible,t.estimatedCardHeight,t.cardOverscan,W()}),e.watchEffect(v=>{if(!c.value||!t.contentVisible||!t.virtualizeCards)return;const B=f?.()??c.value,m=()=>W();B.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),W(),v(()=>{B.removeEventListener("scroll",m),window.removeEventListener("resize",m)})}),e.watchEffect(v=>{if(!c.value||!t.contentVisible||!t.virtualizeCards||t.fixedColumnWidth||typeof ResizeObserver>"u")return;let B=c.value.clientWidth;const m=new ResizeObserver(()=>{const O=c.value?.clientWidth??0;O&&O!==B&&(B=O,u.clear(),W())});m.observe(c.value),v(()=>m.disconnect())}),e.onUnmounted(()=>{x&&cancelAnimationFrame(x),N?.disconnect()}),(v,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"wx-column-cards","data-kanban-column-cards":e.unref(I.setID)(n.column.id),"data-kanban-render-start":p.value,"data-kanban-render-end":w.value,"data-kanban-card-count":n.column.cards.length,"data-kanban-after-rendered-before-id":P.value==null?void 0:e.unref(I.setID)(P.value),ref_key:"container",ref:c},[n.contentVisible?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.virtualizeCards?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-virtual-spacer",style:e.normalizeStyle({height:g.value+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.id},[b.value&&e.unref(o).target?.beforeId===m.id?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-drop-placeholder",style:e.normalizeStyle({height:e.unref(o).height+"px"})},null,4)):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-card-row",m.css??"",a(m),{"wx-dragging":e.unref(o)?.active&&e.unref(o).cardId===m.id}]),"data-kanban-card-id":m.id==null?void 0:e.unref(I.setID)(m.id)},[e.createVNode(re,{card:m,cardContent:n.cardContent,cardShape:n.cardShape,extraCss:a(m)},null,8,["card","cardContent","cardShape","extraCss"])],10,Je)),[[K,m]])],64))),128)),$.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"wx-drop-placeholder",style:e.normalizeStyle({height:e.unref(o).height+"px"})},null,4)):e.createCommentVNode("",!0),D.value>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"wx-virtual-spacer",style:e.normalizeStyle({height:D.value+"px"})},null,4)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.column.cards,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.id},[b.value&&e.unref(o).target?.beforeId===m.id?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-drop-placeholder",style:e.normalizeStyle({height:e.unref(o).height+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["wx-card-row",m.css??"",a(m),{"wx-dragging":e.unref(o)?.active&&e.unref(o).cardId===m.id}]),"data-kanban-card-id":m.id==null?void 0:e.unref(I.setID)(m.id)},[e.createVNode(re,{card:m,cardContent:n.cardContent,cardShape:n.cardShape,extraCss:a(m)},null,8,["card","cardContent","cardShape","extraCss"])],10,Qe)],64))),128)),$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-drop-placeholder",style:e.normalizeStyle({height:e.unref(o).height+"px"})},null,4)):e.createCommentVNode("",!0)],64))],64)):k.value>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:"wx-virtual-spacer",style:e.normalizeStyle({height:k.value+"px"})},null,4)):e.createCommentVNode("",!0)],8,Ue)),[[U,{store:e.unref(l),column:n.column.id,columnAccessor:C.value,readonly:n.readonly}]])}},_e=R(Ze,[["__scopeId","data-v-78a4e100"]]),et=["aria-label"],tt={class:"wx-body"},nt={class:"wx-title"},at={class:"wx-column-header"},ot=["aria-label"],rt={class:"wx-title"},lt=["aria-label"],ct=Object.assign({name:"KanbanColumn"},{__name:"Column",props:{column:{},readonly:{type:Boolean,default:!1},cardContent:{},cardShape:{},contentVisible:{type:Boolean},requestVisible:{type:Boolean},virtualizeCards:{type:Boolean},estimatedCardHeight:{type:Number},cardOverscan:{type:Number},fixedColumnWidth:{type:Boolean},registerColumn:{type:Function},cardCss:{type:Function},columnCss:{type:Function}},setup(n){const t=n,a=e.computed(()=>t.columnCss?t.columnCss(t.column.cards,t.column)??"":""),l=e.inject(q),o=e.computed(()=>l.getState().columnAccessor),f=e.inject("wx-i18n").getGroup("kanban"),C=e.ref(null),c=e.computed(()=>typeof t.column.cardLimit=="number"||t.column.cardLimit===!0),r=e.computed(()=>typeof t.column.cardLimit=="number"?t.column.cardLimit:null),h=e.computed(()=>t.column.addCard!==!1&&!t.readonly);function x(){l.exec("update-column",{id:t.column.id,column:{collapsed:!t.column.collapsed}})}function y(){if(!h.value)return;const u=ve({},o.value,t.column.id);l.exec("add-card",{card:u,edit:!0})}return e.watchEffect(()=>{if(!t.registerColumn||!C.value)return;const u=t.column.id;t.registerColumn(u,C.value),e.onWatcherCleanup(()=>t.registerColumn(u,null))}),e.watchEffect(()=>{!t.column.collapsed&&t.requestVisible&&t.column.dataStatus==="unknown"&&l.exec("request-data",{id:t.column.id})}),(u,s)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["wx-column",n.column.css??"",a.value,{"wx-collapsed":n.column.collapsed,"wx-over-limit":n.column.overLimit}]),ref_key:"root",ref:C},[n.column.collapsed?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",class:"wx-expand",onClick:x,"aria-label":e.unref(f)("Expand column")},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"wx-icon wxi-angle-right"},null,-1)])],8,et),e.createElementVNode("div",tt,[e.createElementVNode("h3",nt,[e.createElementVNode("span",null,e.toDisplayString(n.column.label),1),c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["wx-count",{"wx-over":n.column.overLimit}])},[e.createTextVNode(e.toDisplayString(n.column.cards.length),1),r.value!=null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(r.value),1)],64)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)])])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("header",at,[e.createElementVNode("button",{type:"button",class:"wx-toggle",onClick:x,"aria-label":e.unref(f)("Collapse column")},[...s[1]||(s[1]=[e.createElementVNode("i",{class:"wx-icon wxi-angle-left"},null,-1)])],8,ot),e.createElementVNode("h3",rt,e.toDisplayString(n.column.label),1),c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["wx-count",{"wx-over":n.column.overLimit}])},[e.createTextVNode(e.toDisplayString(n.column.cards.length),1),r.value!=null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(r.value),1)],64)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wx-add",onClick:y,"aria-label":e.unref(f)("Add card to")+" "+n.column.label},[...s[2]||(s[2]=[e.createElementVNode("i",{class:"wx-icon wxi-plus"},null,-1)])],8,lt)):e.createCommentVNode("",!0)]),e.createVNode(_e,{column:n.column,readonly:n.readonly,cardContent:n.cardContent,cardShape:n.cardShape,contentVisible:n.contentVisible,virtualizeCards:n.virtualizeCards,estimatedCardHeight:n.estimatedCardHeight,cardOverscan:n.cardOverscan,fixedColumnWidth:n.fixedColumnWidth,cardCss:n.cardCss},null,8,["column","readonly","cardContent","cardShape","contentVisible","virtualizeCards","estimatedCardHeight","cardOverscan","fixedColumnWidth","cardCss"])],64))],2))}}),it=R(ct,[["__scopeId","data-v-aedbf81a"]]),st=["oncontextmenu"],dt={__name:"ContextMenu",props:{options:{default:()=>[]},api:{default:null},resolver:{default:null},filter:{default:null},at:{default:"point"},onclick:{type:Function},css:{}},setup(n,{expose:t}){const a=n,l=e.useSlots(),o=e.inject(q,void 0);function f(k){if(typeof k=="string"&&k.startsWith(":")){const g=document.createElement("div");return g.setAttribute("data-id",k),I.getID(g)}return typeof k=="string"||typeof k=="number"?k:null}function C(k){const g=f(k);if(g!=null)return a.api?a.api.getCards().find(D=>D.id===g):o?.getState().cards.getById(g)}function c(k,g){(a.api??o)?.exec(k,g)}let r=null,h=e.inject("wx-i18n",void 0);h||(h=I.locale({..._.en,...ee.en}),e.provide("wx-i18n",h));const x=h.getGroup("kanban");function y(k){return k.map(g=>(g={...g},g.text&&(g.text=x(g.text)),g.subtext&&(g.subtext=x(g.subtext)),g.data&&(g.data=y(g.data)),g))}function u(){const k=a.options.length?a.options:Z.getMenuOptions();return y(k)}function s(k,g){if(k==null)return null;const D=C(k);return!D||a.resolver&&!a.resolver(D,g)?null:(r=D.id,D)}function N(k){const g=k?.action;if(!g)return;const D=typeof r=="object"?r.id:r;g.id==="edit-card"?c("select-card",{id:D}):g.id==="duplicate-card"?c("duplicate-card",{id:D}):g.id==="delete-card"&&c("delete-card",{id:D}),a.onclick?.(k)}function b(k,g){return a.filter?a.filter(k,g):!0}const p=e.computed(()=>u()),w=e.ref(null);function M(k,g){w.value.show(k,g)}return t({show:M}),(k,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(ye.ContextMenu),{filter:b,options:p.value,dataKey:"id",resolver:s,onclick:N,css:n.css,at:n.at,ref_key:"menu",ref:w},null,8,["options","css","at"]),e.unref(l).default?(e.openBlock(),e.createElementBlock("span",{key:0,oncontextmenu:w.value?.show,"data-menu-ignore":"true"},[e.renderSlot(k.$slots,"default",{},void 0,!0)],8,st)):e.createCommentVNode("",!0)],64))}},ge=R(dt,[["__scopeId","data-v-dc3e87b0"]]),ut={__name:"DragGhost",props:{root:{},cardContent:{},cardShape:{}},setup(n){const t=n,a=e.inject(te),l=e.inject(q),o=e.computed(()=>!a?.active||a.cardId==null?null:l.getState().cards.getById(a.cardId)??null),f=e.computed(()=>{if(!a)return{x:0,y:0};let C=a.pointer.x-a.offset.x,c=a.pointer.y-a.offset.y;if(t.root&&a.active){const r=t.root.getBoundingClientRect();C=Math.max(r.left,Math.min(C,r.right-a.width)),c=Math.max(r.top,Math.min(c,r.bottom-a.height))}return{x:C,y:c}});return(C,c)=>e.unref(a)?.active&&o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-ghost",style:e.normalizeStyle({width:e.unref(a).width+"px",height:e.unref(a).height+"px",transform:"translate("+f.value.x+"px, "+f.value.y+"px)"})},[e.createVNode(re,{card:o.value,cardContent:n.cardContent,cardShape:n.cardShape},null,8,["card","cardContent","cardShape"])],4)):e.createCommentVNode("",!0)}},mt=R(ut,[["__scopeId","data-v-40eca5a6"]]),de=4;function ft(n,t){let a=t,l=0,o=0,f=!1,C=!1,c=null;function r(b){if(b.button!==0||a.readonly||!a.dnd||!a.store)return;const p=b.target,w=p?p.closest("[data-kanban-card-id]"):null;if(!w||!n.contains(w))return;const M=w.closest("[data-kanban-column-cards]");if(!M)return;const k=I.getID(w,"data-kanban-card-id"),g=I.getID(M,"data-kanban-column-cards");if(k==null||g==null)return;const{viewData:D}=a.store.getState(),P=D.columns.find(d=>d.id===g),$=P?.cards.find(d=>d.id===k);!P||!$||$.id==null||(c={dnd:a.dnd,store:a.store,id:$.id,column:P.id,cardEl:w},f=!0,C=!1,l=b.clientX,o=b.clientY,window.addEventListener("pointermove",h),window.addEventListener("pointerup",x),window.addEventListener("keydown",y))}function h(b){if(!(!f||!c)){if(a.readonly){N();return}if(!C){const p=b.clientX-l,w=b.clientY-o;if(p*p+w*w<de*de)return;u(b,c)}c.dnd.pointer={x:b.clientX,y:b.clientY},pt(b.clientX,b.clientY,c)}}function x(){s(),C&&c&&(vt(c),c.dnd.reset(),document.body.style.userSelect="",gt()),f=!1,C=!1,c=null}function y(b){b.key!=="Escape"||!C||!c||N()}function u(b,p){const w=p.cardEl.getBoundingClientRect();p.dnd.width=w.width,p.dnd.height=w.height,p.dnd.offset={x:l-w.left,y:o-w.top},p.dnd.pointer={x:b.clientX,y:b.clientY},p.dnd.cardId=p.id,p.dnd.sourceColumn=p.column,p.dnd.target={column:p.column,beforeId:null},p.dnd.active=!0,document.body.style.userSelect="none",C=!0}function s(){window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",x),window.removeEventListener("keydown",y)}function N(){s(),C&&c&&(c.dnd.reset(),document.body.style.userSelect=""),f=!1,C=!1,c=null}return n.addEventListener("pointerdown",r),{update(b){a=b,a.readonly&&(f||C)&&N()},destroy(){n.removeEventListener("pointerdown",r),N()}}}function pt(n,t,a){const l=document.elementFromPoint(n,t),o=l?l.closest("[data-kanban-column-cards]"):null;if(!o)return;const f=I.getID(o,"data-kanban-column-cards");if(f==null)return;const c=a.store.getState().viewData.columns.find(u=>u.id===f);if(!c)return;const r=Array.from(o.querySelectorAll("[data-kanban-card-id]")).filter(u=>I.getID(u,"data-kanban-card-id")!==a.id);let h=null;for(const u of r){const s=u.getBoundingClientRect();if(t<s.top+s.height/2){h=ue(c,I.getID(u,"data-kanban-card-id"));break}}h==null&&(h=ue(c,I.getID(o,"data-kanban-after-rendered-before-id")));const x={column:c.id,beforeId:h},y=a.dnd.target;(!y||y.column!==x.column||y.beforeId!==x.beforeId)&&(a.dnd.target=x)}function ue(n,t){return t==null?null:n.cards.find(a=>a.id===t)?.id??null}function vt(n){const t=n.dnd.target;if(!t)return;const a={id:n.id,column:t.column};t.beforeId!=null&&(a.before=t.beforeId),n.store.exec("move-card",a)}function gt(){const n=t=>{t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",n,!0)};window.addEventListener("click",n,!0),setTimeout(()=>window.removeEventListener("click",n,!0),0)}function ht(n,t="right-start"){let a=null;const l=e.ref(null),o=e.ref({x:0,y:0}),f=e.ref(null);function C(x){if(o.value={x:x.clientX,y:x.clientY},f.value||!x.target)return;const y=I.locate(x.target)??null;if(y===a)return;if(a=y,!y){l.value=null;return}const u=n(I.getID(y));l.value=u?{card:u}:null}function c(){a=null,l.value=null}function r(x){if(l.value=null,a=null,!x){f.value=null;return}const y=n(x.cardId);y&&(f.value={card:y,element:x.element,at:t})}function h(){f.value=null}return{get tooltipState(){return l.value},get mousePos(){return o.value},get cardPopupState(){return f.value},handleTooltipMove:C,handleTooltipLeave:c,handleCardPopup:r,hideCardPopup:h}}const yt=["aria-label"],kt={class:"wx-content"},bt=["href"],Ct=Object.assign({name:"KanbanLayout"},{__name:"Layout",props:{cardShape:{},readonly:{type:Boolean,default:!1},render:{},cardContent:{},tooltip:{},cardPopup:{},cardCss:{type:Function},columnCss:{type:Function}},setup(n){const t=n,a=e.computed(()=>t.render?.columnScroll??!0),l=e.computed(()=>t.render?.fixedColumnWidth??!0),o=e.computed(()=>t.render?.virtualizeCards??!1),f=e.computed(()=>t.render?.virtualizeColumns??!1),C=e.computed(()=>t.render?.estimatedCardHeight??80),c=e.computed(()=>t.render?.cardOverscan??5),r=e.computed(()=>t.render?.columnOverscan??1),h=e.inject(q),x=Y.subscribe(h.getReactiveState().viewData),y=h.getBrandmark(),u=e.inject("wx-i18n").getGroup("kanban"),s=e.inject(te),N=e.ref(null),b=e.ref(null),p=e.ref(new Set);let w=0;const M=new Map;e.provide(pe,()=>a.value?null:b.value??null);function k(i,S){if(i.size!==S.size)return!1;for(const E of i)if(!S.has(E))return!1;return!0}function g(i){k(p.value,i)||(p.value=i)}function D(){if(!f.value||!b.value){g(new Set);return}const i=x.value.columns;if(!i.length){g(new Set);return}const S=b.value.getBoundingClientRect();let E=-1,F=-1;for(let H=0;H<i.length;H++){const ie=M.get(i[H].id);if(!ie)continue;const se=ie.getBoundingClientRect();se.right>=S.left&&se.left<=S.right&&(E===-1&&(E=H),F=H)}if(E===-1||F===-1){g(new Set);return}const Q=Math.max(0,Math.floor(r.value||0));E=Math.max(0,E-Q),F=Math.min(i.length-1,F+Q);const ce=new Set;for(let H=E;H<=F;H++)ce.add(i[H].id);g(ce)}function P(){w||(w=requestAnimationFrame(()=>{w=0,D()}))}function $(i,S){S?M.set(i,S):M.delete(i),P()}function d(){b.value&&b.value.style.setProperty("--wx-kanban-scroll-height",`${b.value.clientHeight}px`)}function V(i){return!f.value||p.value.size===0||p.value.has(i)}function z(i){return!f.value||p.value.has(i)}function j(i){return h.getState().cards.getById(i)}const L=ht(j,"right-start"),ne={trackScroll:!0};function W(i){!t.readonly&&i!=null&&h.exec("select-card",{id:i})}function ae(i,S){if(!(t.readonly||s?.active)){if(t.cardPopup&&i!=null){const E=S?.target,F=E?I.locate(E):null;if(F){L.handleCardPopup({cardId:i,element:F});return}}W(i)}}function X(i){if(t.readonly)return;i?.preventDefault();const S=document.activeElement,E=S?I.locateID(S):null;if(t.cardPopup&&E!=null&&S){L.handleCardPopup({cardId:E,element:S});return}W(E)}const K=e.computed(()=>t.cardShape?.menu?typeof t.cardShape.menu=="object"?t.cardShape.menu:{}:null),U=e.ref(null);function v(i,S){t.readonly||i==null||!U.value||(S.stopPropagation(),U.value.show(S,i))}function B(i){return I.delegateClick(i,{click:ae,menu:v})}function m(i){return{destroy:I.hotkeys.subscribe(E=>{E.configure({enter:X,space:X},i)})}}const O={mounted(i,S){const E=ft(i,S.value);i._cardDrag=E},updated(i,S){i._cardDrag?.update(S.value)},unmounted(i){i._cardDrag?.destroy()}},A={mounted(i){const S=B(i);i._delegateCardClick=S},unmounted(i){i._delegateCardClick?.destroy()}},J={mounted(i){const S=m(i);i._cardHotkeys=S},unmounted(i){i._cardHotkeys?.destroy()}};return e.watchEffect(()=>{f.value,r.value,l.value,x.value.columns,P()}),e.watchEffect(()=>{if(!b.value||!f.value||typeof ResizeObserver>"u")return;const i=new ResizeObserver(()=>P());i.observe(b.value),e.onWatcherCleanup(()=>i.disconnect())}),e.watchEffect(()=>{if(!b.value)return;if(d(),window.addEventListener("resize",d),typeof ResizeObserver>"u"){e.onWatcherCleanup(()=>window.removeEventListener("resize",d));return}const i=new ResizeObserver(d);i.observe(b.value),e.onWatcherCleanup(()=>{i.disconnect(),window.removeEventListener("resize",d)})}),e.onUnmounted(()=>{w&&cancelAnimationFrame(w)}),(i,S)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-kanban",role:"region","aria-label":e.unref(u)("Kanban board"),ref_key:"root",ref:N},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-board",{"wx-scroll-board":!a.value,"wx-layout-flex":!l.value}]),onMousemove:S[0]||(S[0]=E=>n.tooltip&&e.unref(L).handleTooltipMove(E)),onMouseleave:S[1]||(S[1]=E=>n.tooltip&&e.unref(L).handleTooltipLeave(E))},[e.createElementVNode("div",{class:"wx-scroll",ref_key:"scroll",ref:b,onScroll:P},[e.createElementVNode("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x).columns,E=>(e.openBlock(),e.createBlock(it,{key:E.id,column:E,readonly:n.readonly,cardContent:n.cardContent,cardShape:n.cardShape,contentVisible:V(E.id),requestVisible:z(E.id),virtualizeCards:o.value,estimatedCardHeight:C.value,cardOverscan:c.value,fixedColumnWidth:l.value,registerColumn:$,cardCss:n.cardCss,columnCss:n.columnCss},null,8,["column","readonly","cardContent","cardShape","contentVisible","requestVisible","virtualizeCards","estimatedCardHeight","cardOverscan","fixedColumnWidth","cardCss","columnCss"]))),128))])],544)],34)),[[O,{dnd:e.unref(s),store:e.unref(h),readonly:n.readonly}],[A],[J]]),e.unref(y)?(e.openBlock(),e.createElementBlock("a",{key:0,style:e.normalizeStyle(e.unref(y).style),href:e.unref(y).link,target:"_blank"},e.toDisplayString(e.unref(y).text),13,bt)):e.createCommentVNode("",!0),e.createVNode(mt,{root:N.value,cardContent:n.cardContent,cardShape:n.cardShape},null,8,["root","cardContent","cardShape"]),K.value?(e.openBlock(),e.createBlock(ge,{key:1,options:K.value.options,filter:K.value.filter,onclick:K.value.onclick,ref_key:"cardMenu",ref:U},null,8,["options","filter","onclick"])):e.createCommentVNode("",!0),e.unref(L).tooltipState&&n.tooltip?(e.openBlock(),e.createElementBlock("div",{key:2,class:"wx-tooltip",style:e.normalizeStyle(`position:fixed;left:${e.unref(L).mousePos.x+12}px;top:${e.unref(L).mousePos.y+16}px;z-index:10000;pointer-events:none`),"aria-hidden":"true"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tooltip),{card:e.unref(L).tooltipState.card},null,8,["card"]))],4)):e.createCommentVNode("",!0),e.unref(L).cardPopupState&&n.cardPopup?(e.openBlock(),e.createBlock(e.unref(T.Popup),e.mergeProps({key:3,at:e.unref(L).cardPopupState.at,parent:e.unref(L).cardPopupState.element,oncancel:e.unref(L).hideCardPopup},ne),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.cardPopup),{card:e.unref(L).cardPopupState.card,close:e.unref(L).hideCardPopup},null,8,["card","close"]))]),_:1},16,["at","parent","oncancel"])):e.createCommentVNode("",!0)],8,yt))}}),xt=R(Ct,[["__scopeId","data-v-7797d7e5"]]),wt=["data-id"],Bt=Object.assign({name:"KanbanExportLayout"},{__name:"ExportLayout",props:{cardShape:{},cardCss:{type:Function},columnCss:{type:Function},cardContent:{}},setup(n){const t=n,a=e.inject(q),l=Y.subscribe(a.getReactiveState().viewData),o=e.ref(null);return e.watchEffect(()=>{const f={};if(t.cardContent){const r={};o.value?.querySelectorAll(".wx-ex-cell").forEach(h=>{r[h.dataset.id]=h.innerHTML}),f.cardContent=r}const C={};t.cardCss&&(l.value.columns.forEach(r=>{r.cards.forEach(h=>{C[h.id.toString()]=t.cardCss(h,r)})}),f.cardCss=C);const c={};t.columnCss&&(l.value.columns.forEach(r=>{c[r.id.toString()]=t.columnCss(r.cards,r)}),f.columnCss=c),a.exec("export-data",{format:"inner",data:f})}),(f,C)=>(e.openBlock(),e.createElementBlock("div",{style:{visibility:"hidden",position:"absolute"},ref_key:"root",ref:o},[n.cardContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(l).columns,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.cards,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:"wx-ex-cell","data-id":r.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.cardContent),{card:r,cardShape:n.cardShape},null,8,["card","cardShape"]))],8,wt))),128))],64))),128)):e.createCommentVNode("",!0)],512))}});function St(){const n=e.reactive({active:!1,cardId:null,sourceColumn:null,width:0,height:0,pointer:{x:0,y:0},offset:{x:0,y:0},target:null,reset(){n.active=!1,n.cardId=null,n.sourceColumn=null,n.target=null}});return n}const Et=Object.assign({name:"KanbanKanban"},{__name:"Kanban",props:{cards:{default:()=>[]},columns:{default:()=>[]},columnAccessor:{default:"column"},filters:{default:()=>new Map},sort:{default:null},card:{default:()=>me()},readonly:{type:Boolean,default:!1},render:{},dynamicData:{type:Boolean,default:!1},history:{type:Boolean,default:!1},cardContent:{},init:{type:Function},tooltip:{},cardPopup:{},cardCss:{type:Function},columnCss:{type:Function}},setup(n,{expose:t}){const a=n,l=e.useAttrs(),o=new Z.KanbanStore(Y.writable,{undo:a.history});let f=o.in;const C=/-/g,c=new he.EventBusRouter((D,P)=>{const $="on"+D.replace(C,""),d=l[$];typeof d=="function"&&d(P)});f.setNext(c);const r=o.getState.bind(o),h=o.getReactive.bind(o),x=()=>({data:o}),y=o.getCards.bind(o),u=o.in.exec.bind(o.in),s=o.in.on.bind(o.in),N=o.in.detach.bind(o.in),b=o.in.setNext.bind(o.in),p=o.in.intercept.bind(o.in),w={getState:r,getReactiveState:h,getStores:x,getCards:y,setNext:b,exec:u,on:s,detach:N,intercept:p};e.provide(q,{getReactiveState:h,getState:r,exec:u,getBrandmark:o.getBrandmark.bind(o)}),e.provide(te,St());const M=()=>({cards:a.cards,columns:a.columns,columnAccessor:a.columnAccessor,filters:a.filters,sort:a.sort,dynamicData:a.dynamicData});o.init({...M(),renderMode:""}),a.init?.(w);let k=!0;e.watchEffect(()=>{const D=M();if(k){k=!1;return}o.init(D)}),e.watchEffect(()=>{o.meta["export-data"]={card:a.card,cardContent:a.cardContent,cardCss:a.cardCss,columnCss:a.columnCss}});const g=Y.subscribe(o.getReactive().renderMode);return t({getState:r,getReactiveState:h,getStores:x,getCards:y,exec:u,on:s,detach:N,setNext:b,intercept:p}),(D,P)=>(e.openBlock(),e.createBlock(e.unref(T.Locale),{words:{...e.unref(ee.en),...e.unref(_.en)},optional:!0},{default:e.withCtx(()=>[e.createVNode(xt,{cardShape:a.card,readonly:n.readonly,render:n.render,cardContent:n.cardContent,tooltip:n.tooltip,cardPopup:n.cardPopup,cardCss:n.cardCss,columnCss:n.columnCss},null,8,["cardShape","readonly","render","cardContent","tooltip","cardPopup","cardCss","columnCss"]),e.unref(g)==="export"?(e.openBlock(),e.createBlock(Bt,{key:0,cardShape:a.card,cardContent:n.cardContent,cardCss:n.cardCss,columnCss:n.columnCss},null,8,["cardShape","cardContent","cardCss","columnCss"])):e.createCommentVNode("",!0)]),_:1},8,["words"]))}}),Vt=Object.assign({inheritAttrs:!1,name:"KanbanComponentsEditor"},{__name:"Editor",props:{api:{},values:{},items:{default:()=>fe()},placement:{default:"sidebar"},layout:{default:"default"},focus:{type:Boolean,default:!0},css:{default:""},topBar:{},autoSave:{type:Boolean,default:!0},onchange:{type:Function},onsave:{type:Function},onaction:{type:Function}},setup(n){G.registerEditorItem("richselect",T.RichSelect),G.registerEditorItem("multicombo",T.MultiCombo),G.registerEditorItem("datepicker",T.DatePicker),G.registerEditorItem("slider",T.Slider);const t=n,a=e.useAttrs(),l=Y.subscribeLater(()=>t.api?.getReactiveState()?.editorData);let o=e.inject("wx-i18n",void 0);o||(o=I.locale({..._.en,...ee.en}),e.provide("wx-i18n",o));const f=o.getGroup("kanban");function C(p){return typeof p=="string"?f(p):p}function c(p){return p.map(w=>{const M={...w};return M.label=C(M.label),Array.isArray(M.options)&&(M.options=M.options.map(k=>({...k,label:C(k.label)}))),M})}const r=e.computed(()=>c(t.items)),h={items:[{comp:"icon",icon:"wxi-close",id:"close"},{comp:"spacer"},{comp:"button",id:"delete",text:f("Delete"),type:"primary danger",onclick:N}]},x=e.computed(()=>t.topBar===void 0?h:t.topBar),y=e.computed(()=>["wx-editor-kanban",t.css].filter(Boolean).join(" "));function u(p){t.onsave?.(p);const w=l().value;w&&t.api.exec("update-card",{id:w.id,card:{...p.values}})}function s(p){t.onchange?.(p)}function N(){const p=l().value;p&&(t.api.exec("delete-card",{id:p.id}),t.api.exec("select-card",{id:null}))}function b(p){t.onaction?.(p);const{item:w}=p;w.id==="close"&&w.comp&&t.api.exec("select-card",{id:null})}return(p,w)=>e.unref(l)().value?(e.openBlock(),e.createBlock(e.unref(G.Editor),e.mergeProps({key:0},e.unref(a),{focus:n.focus,items:r.value,topBar:x.value,autoSave:n.autoSave,onchange:s,onaction:b,onsave:u,placement:n.placement,layout:n.layout,values:e.unref(l)().value,css:y.value}),null,16,["focus","items","topBar","autoSave","placement","layout","values","css"])):e.createCommentVNode("",!0)}}),Nt=R(Vt,[["__scopeId","data-v-238cb105"]]),Dt={class:"wx-root"},zt={__name:"Toolbar",props:{api:{default:null},items:{default:()=>[]},undo:{type:Boolean,default:!1},sort:{type:Boolean,default:!1},add:{type:Boolean,default:!0}},setup(n){const t={"sort-label-asc":{field:"label",dir:"asc"},"sort-label-desc":{field:"label",dir:"desc"},"sort-priority-asc":{field:"priority",dir:"asc"},"sort-priority-desc":{field:"priority",dir:"desc"}},a=n;let l=e.inject("wx-i18n",null);l||(l=I.locale({..._.en,...ee.en}),e.provide("wx-i18n",l));const o=l.getGroup("kanban"),f={undo:0,redo:0},C=Y.subscribeLater(()=>a.api?.getReactiveState()?.history),c=["undo","redo"],r=e.computed(()=>C()?.value??f);function h(u){a.api&&(u==="add-card"?a.api.exec("add-card",{card:{},edit:!0}):u==="undo"||u==="redo"?a.api.exec(u,{}):u==="sort-clear"?a.api.exec("sort-cards",{sort:null}):u in t&&a.api.exec("sort-cards",{sort:t[u]}))}function x(u){const s={...u},N=typeof s.id=="string"?s.id:"";return s.items&&(s.items=s.items.map(x)),s.text&&(s.text=o(s.text)),s.menuText&&(s.menuText=o(s.menuText)),s.title&&(s.title=o(s.title)),c.includes(N)&&(s.disabled=N==="undo"?!r.value?.undo:!r.value?.redo),!s.handler&&N&&(s.handler=()=>h(N)),s}const y=e.computed(()=>(a.items.length?a.items:Z.getToolbarItems({undo:a.undo,sort:a.sort,add:a.add})).map(x));return(u,s)=>(e.openBlock(),e.createElementBlock("div",Dt,[e.createVNode(e.unref(ke.Toolbar),{items:y.value},null,8,["items"])]))}},Mt=R(zt,[["__scopeId","data-v-cb870cea"]]),Lt=Object.assign({name:"ThemesWillow"},{__name:"Willow",props:{fonts:{type:Boolean,default:!0}},setup(n){const t=n;return(a,l)=>a.$slots.default?(e.openBlock(),e.createBlock(e.unref(T.Willow),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["fonts"])):(e.openBlock(),e.createBlock(e.unref(T.Willow),{key:1,fonts:t.fonts},null,8,["fonts"]))}}),It={__name:"WillowDark",props:{fonts:{type:Boolean,default:!0}},setup(n){const t=n;return(a,l)=>a.$slots.default?(e.openBlock(),e.createBlock(e.unref(T.WillowDark),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["fonts"])):(e.openBlock(),e.createBlock(e.unref(T.WillowDark),{key:1,fonts:t.fonts},null,8,["fonts"]))}},Ot=xe.version;Object.defineProperty(exports,"getMenuOptions",{enumerable:!0,get:()=>Z.getMenuOptions});Object.defineProperty(exports,"getToolbarItems",{enumerable:!0,get:()=>Z.getToolbarItems});Object.defineProperty(exports,"registerEditorItem",{enumerable:!0,get:()=>G.registerEditorItem});Object.defineProperty(exports,"RestDataProvider",{enumerable:!0,get:()=>be.RestDataProvider});exports.ContextMenu=ge;exports.Editor=Nt;exports.Kanban=Et;exports.Toolbar=Mt;exports.Willow=Lt;exports.WillowDark=It;exports.getCardShape=me;exports.getEditorItems=fe;exports.getPriorityOptions=le;exports.version=Ot;
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ .wx-avatars[data-v-2884c896]{display:inline-flex;align-items:center;min-width:0}.wx-avatar[data-v-2884c896]{display:inline-flex;align-items:center;justify-content:center;width:var(--wx-avatar-size);height:var(--wx-avatar-size);margin-left:calc(var(--wx-avatar-size) * -.25);border:2px solid var(--wx-kanban-card-bg);border-radius:50%;background:var(--wx-kanban-avatar-bg);color:var(--wx-color-font);font-size:var(--wx-avatar-font-size);font-weight:var(--wx-font-weight-md);line-height:1;overflow:hidden;text-transform:uppercase;-webkit-user-select:none;user-select:none}.wx-avatar[data-v-2884c896]:first-child{margin-left:0}.wx-image[data-v-2884c896]{display:block;width:100%;height:100%;object-fit:cover}.wx-more[data-v-2884c896]{font-size:calc(var(--wx-avatar-font-size) * .85);text-transform:none}.wx-cover[data-v-52077978]{margin:-12px -12px 0;height:80px;background-size:cover;background-position:center;border-top-left-radius:var(--wx-border-radius);border-top-right-radius:var(--wx-border-radius)}.wx-header[data-v-52077978]{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:var(--wx-font-size-sm)}.wx-priority[data-v-52077978]{background:var(--wx-kanban-tag-bg);border-radius:var(--wx-border-radius);padding:1px 6px;font-weight:var(--wx-font-weight-md)}.wx-header[data-v-52077978] .wx-card-priority-low{background:var(--wx-kanban-priority-low-bg);color:var(--wx-kanban-priority-low-color)}.wx-header[data-v-52077978] .wx-card-priority-medium{background:var(--wx-kanban-priority-medium-bg);color:var(--wx-kanban-priority-medium-color)}.wx-header[data-v-52077978] .wx-card-priority-high{background:var(--wx-kanban-priority-high-bg);color:var(--wx-kanban-priority-high-color)}.wx-deadline[data-v-52077978]{margin-left:auto;color:var(--wx-color-font-alt)}.wx-menu[data-v-52077978]{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:0;width:22px;height:22px;border-radius:var(--wx-icon-border-radius);cursor:pointer;color:var(--wx-color-font-alt);font-size:16px}.wx-title .wx-menu[data-v-52077978]{float:right}.wx-menu[data-v-52077978]:hover{background:var(--wx-background-hover);color:var(--wx-color-font)}.wx-menu[data-v-52077978]:focus-visible{outline:none;border:1px solid var(--wx-color-primary)}.wx-body[data-v-52077978]{display:flex;flex-direction:column;gap:4px}.wx-title[data-v-52077978]{font-weight:var(--wx-font-weight-md);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.wx-description[data-v-52077978]{margin:0 0 4px;color:var(--wx-color-font-alt);font-size:13px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.wx-tags[data-v-52077978]{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px}.wx-tag[data-v-52077978]{background:var(--wx-kanban-tag-bg);border-radius:10px;padding:1px 8px;font-size:11px;color:var(--wx-color-font-alt)}.wx-progress-row[data-v-52077978]{display:flex;align-items:center;gap:6px}.wx-progress[data-v-52077978]{flex:1;height:4px;background:var(--wx-kanban-progress-bg);border-radius:2px;overflow:hidden}.wx-progress-label[data-v-52077978]{font-size:11px;color:var(--wx-color-font-alt);min-width:32px;text-align:right}.wx-progress-fill[data-v-52077978]{height:100%;background:var(--wx-kanban-progress-fill)}.wx-footer[data-v-52077978]{display:flex;justify-content:space-between;align-items:center;margin-top:2px}.wx-counters[data-v-52077978]{display:flex;gap:12px;font-size:var(--wx-font-size-sm);color:var(--wx-color-font-alt);margin-top:-5px;margin-left:auto}.wx-counter[data-v-52077978]{display:inline-flex;align-items:center;gap:2px}.wx-counter .wx-icon[data-v-52077978]{font-size:16px;margin-top:7px;margin-bottom:5px}.wx-card[data-v-913e56be]{display:flex;flex-direction:column;gap:6px;padding:10px;background:var(--wx-kanban-card-bg);border-radius:var(--wx-border-radius);box-shadow:var(--wx-kanban-card-shadow);cursor:pointer;border-top:3px solid transparent;touch-action:none;-webkit-user-select:none;user-select:none}.wx-card[data-v-913e56be]:hover{box-shadow:var(--wx-kanban-card-shadow-hover)}.wx-card[data-v-913e56be]:focus-visible{outline:2px solid var(--wx-color-primary);outline-offset:1px}.wx-column-cards[data-v-78a4e100]{display:flex;flex-direction:column;gap:8px;padding:8px;overflow-y:auto;flex:1;min-height:0}.wx-column-cards[data-v-78a4e100]>div{flex-shrink:0}.wx-drop-placeholder[data-v-78a4e100]{border:1px dashed var(--wx-kanban-border-color);border-radius:var(--wx-border-radius);background:var(--wx-kanban-drop-placeholder-bg);box-sizing:border-box}.wx-dragging[data-v-78a4e100]{display:none}.wx-icon[data-v-aedbf81a]{font-size:24px;margin-top:5px}.wx-column[data-v-aedbf81a]{display:flex;flex-direction:column;flex:0 0 280px;min-width:280px;max-height:100%;background:var(--wx-kanban-column-bg);border-radius:var(--wx-radius-major);overflow:hidden}.wx-collapsed[data-v-aedbf81a]{flex:0 0 40px;min-width:40px;max-width:40px;align-items:center}.wx-over-limit .wx-column-header[data-v-aedbf81a],.wx-over-limit .wx-body[data-v-aedbf81a]{background:var(--wx-kanban-column-over-limit-bg)}.wx-column-header[data-v-aedbf81a]{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--wx-kanban-border-color)}.wx-title[data-v-aedbf81a]{flex:1;margin:0;font-weight:var(--wx-font-weight-md);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wx-count[data-v-aedbf81a]{font-size:var(--wx-font-size-sm);color:var(--wx-color-font-alt)}.wx-over[data-v-aedbf81a]{color:var(--wx-color-danger);font-weight:var(--wx-font-weight-md)}.wx-add[data-v-aedbf81a],.wx-toggle[data-v-aedbf81a]{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--wx-icon-border-radius);padding:0;width:18px;height:18px;cursor:pointer;font-size:var(--wx-font-size-sm);color:var(--wx-color-font-alt)}.wx-add[data-v-aedbf81a]:hover,.wx-toggle[data-v-aedbf81a]:hover{background:var(--wx-background-hover)}.wx-add[data-v-aedbf81a]:focus,.wx-toggle[data-v-aedbf81a]:focus{outline:none;border:1px solid var(--wx-color-primary)}.wx-expand[data-v-aedbf81a]{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:0;width:100%;height:36px;flex:0 0 36px;cursor:pointer;font-size:var(--wx-font-size-sm);color:var(--wx-color-font-alt)}.wx-body[data-v-aedbf81a]{position:relative;flex:1;width:100%;min-height:0}.wx-collapsed .wx-title[data-v-aedbf81a]{position:absolute;left:50%;bottom:0;display:flex;align-items:center;gap:8px;max-width:calc(var(--wx-kanban-scroll-height, 100vh) - 96px);transform:rotate(-90deg);transform-origin:left center}.wx-collapsed .wx-title>span[data-v-aedbf81a]:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis}.wx-collapsed .wx-count[data-v-aedbf81a]{flex:0 0 auto;font-weight:var(--wx-font-weight)}.wx-menu .wx-option.wx-disabled{pointer-events:none}.wx-menu .wx-option.wx-disabled .wx-value,.wx-menu .wx-option.wx-disabled .wx-icon{color:var(--wx-color-font-disabled)}.wx-ghost[data-v-40eca5a6]{position:fixed;top:0;left:0;z-index:10000;pointer-events:none;box-shadow:var(--wx-kanban-card-shadow-drag);border-radius:var(--wx-border-radius);transform-origin:top left;will-change:transform}.wx-ghost[data-v-40eca5a6] .wx-card{cursor:grabbing}.wx-kanban[data-v-7797d7e5]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:var(--wx-kanban-bg);overflow:hidden}.wx-board[data-v-7797d7e5]{flex:1;padding:12px;box-sizing:border-box;min-height:0}.wx-scroll[data-v-7797d7e5]{height:100%;overflow-x:auto;overflow-y:hidden}.wx-content[data-v-7797d7e5]{display:flex;gap:12px;align-items:stretch;min-height:100%;box-sizing:border-box}.wx-board:not(.wx-scroll-board) .wx-content[data-v-7797d7e5]{height:100%;min-height:0}.wx-board[data-v-7797d7e5]:not(.wx-scroll-board) .wx-column:not(.wx-collapsed){height:100%;min-height:0}.wx-board[data-v-7797d7e5]:not(.wx-scroll-board) .wx-column.wx-collapsed{height:100%;min-height:0}.wx-scroll-board .wx-scroll[data-v-7797d7e5]{overflow-y:auto}.wx-scroll-board[data-v-7797d7e5] .wx-column{max-height:none;overflow:visible}.wx-scroll-board[data-v-7797d7e5] .wx-column.wx-collapsed{position:sticky;top:0;z-index:1;align-self:flex-start;height:var(--wx-kanban-scroll-height, 100%);max-height:var(--wx-kanban-scroll-height, 100%);overflow:hidden}.wx-scroll-board[data-v-7797d7e5] .wx-column-cards{overflow:visible;flex:none}.wx-scroll-board[data-v-7797d7e5] .wx-column-header{position:sticky;top:0;z-index:1;background:var(--wx-kanban-column-bg)}.wx-layout-flex[data-v-7797d7e5] .wx-column:not(.wx-collapsed){flex:1 1 0;min-width:240px}.wx-sidearea .wx-editor-kanban{width:450px}.wx-root[data-v-cb870cea]{display:contents}.wx-root[data-v-cb870cea] .wx-toolbar>div.wx-separator{min-height:auto}.wx-willow-theme{height:100%;width:100%;--wx-kanban-bg: var(--wx-background-alt);--wx-kanban-column-bg: #ebecef;--wx-kanban-column-over-limit-bg: #fde1d6;--wx-kanban-card-bg: var(--wx-background);--wx-kanban-tag-bg: var(--wx-background-alt);--wx-kanban-avatar-bg: #d0d4dc;--wx-kanban-progress-bg: #e5e7eb;--wx-kanban-progress-fill: #3b82f6;--wx-kanban-border-color: #d6d8de;--wx-kanban-card-shadow: 0 1px 2px rgba(0, 0, 0, .08);--wx-kanban-card-shadow-hover: 0 2px 6px rgba(0, 0, 0, .12);--wx-kanban-card-shadow-drag: 0 8px 20px rgba(0, 0, 0, .18);--wx-kanban-drop-placeholder-bg: rgba(59, 130, 246, .08);--wx-kanban-priority-low-bg: #dcfce7;--wx-kanban-priority-low-color: #166534;--wx-kanban-priority-medium-bg: #fef3c7;--wx-kanban-priority-medium-color: #92400e;--wx-kanban-priority-high-bg: #fee2e2;--wx-kanban-priority-high-color: #991b1b}.wx-willow-dark-theme{height:100%;width:100%;--wx-kanban-bg: var(--wx-background);--wx-kanban-column-bg: var(--wx-background-alt);--wx-kanban-column-over-limit-bg: #5a2d2d;--wx-kanban-card-bg: var(--wx-background);--wx-kanban-tag-bg: #434863;--wx-kanban-avatar-bg: #4a5070;--wx-kanban-progress-bg: #434863;--wx-kanban-progress-fill: #60a5fa;--wx-kanban-border-color: #40455a;--wx-kanban-card-shadow: 0 1px 2px rgba(0, 0, 0, .3);--wx-kanban-card-shadow-hover: 0 2px 6px rgba(0, 0, 0, .4);--wx-kanban-card-shadow-drag: 0 8px 20px rgba(0, 0, 0, .5);--wx-kanban-drop-placeholder-bg: rgba(96, 165, 250, .16);--wx-kanban-priority-low-bg: #1f3a2a;--wx-kanban-priority-low-color: #86efac;--wx-kanban-priority-medium-bg: #3a2f1a;--wx-kanban-priority-medium-color: #fcd34d;--wx-kanban-priority-high-bg: #3a1f1f;--wx-kanban-priority-high-color: #fca5a5}