@stonecrop/atable 0.4.24 → 0.4.25
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/atable.d.ts +13 -67
- package/dist/atable.js +885 -851
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts +12 -67
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/stores/table.js +81 -34
- package/package.json +3 -3
- package/src/stores/table.ts +91 -39
package/dist/atable.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(T,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],t):(T=typeof globalThis<"u"?globalThis:T||self,t(T["@stonecrop/atable"]={},T.Vue,T.pinia))})(this,function(T,t,lt){"use strict";var $e=document.createElement("style");$e.textContent=`@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap";.atable-cell{border-radius:0;box-sizing:border-box;margin:0;outline:none;box-shadow:none;color:var(--sc-cell-text-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);border-spacing:0px;border-collapse:collapse;overflow:hidden;text-overflow:ellipsis;order:1;white-space:nowrap;max-width:40ch;border-top:1px solid var(--sc-row-border-color)}.atable-cell a{color:var(--sc-cell-text-color);text-decoration:none}.atable-cell:focus,.atable-cell:focus-within{background-color:var(--sc-focus-cell-background);outline-width:var(--sc-atable-cell-border-width);outline-style:solid;outline-offset:calc(var(--sc-atable-cell-border-width) * -1);outline-color:var(--sc-focus-cell-outline);box-shadow:none;overflow:hidden;text-wrap:nowrap;box-sizing:border-box}.cell-modified{font-weight:700;font-style:italic}.cell-modified-highlight{background-color:var(--sc-cell-changed-color)}.row-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;display:flex;align-items:center;justify-content:center}.expandable-row{border-top:1px solid var(--sc-row-border-color);height:var(--sc-atable-row-height)}.expandable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.expanded-row{border-left:2px solid var(--sc-row-border-color)}.expandable-row:last-child{border-bottom:1px solid var(--sc-row-border-color)}.expanded-row-content{border-top:1px solid var(--sc-row-border-color);padding:1.5rem}.expandable-row.changed-row-gradient[data-v-5ad4bb41]:has(td.cell-modified){--cell-color-start: color-mix(in srgb, var(--sc-cell-changed-color), #fff 20%);--cell-color-end: color-mix(in srgb, var(--sc-cell-changed-color), #fff 60%);background:linear-gradient(90deg,var(--cell-color-start),var(--cell-color-end))}.aganttcell[data-v-a77cc6d2]{background-color:#f9f9f9;width:100%;padding:0;height:100%}.gantt-container[data-v-a77cc6d2]{position:relative;height:100%;background-color:#f0f0f0;border-radius:4px;overflow:visible}.gantt-bar[data-v-a77cc6d2]{position:absolute;border-radius:4px;display:flex;align-items:center;justify-content:space-between;cursor:grab;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);transition:left .1s ease-out,width .1s ease-out;height:80%;top:50%;z-index:2;transform:translateY(-50%)}.gantt-bar[data-v-a77cc6d2]:active{cursor:grabbing}.gantt-bar.is-dragging[data-v-a77cc6d2]{z-index:10}.gantt-label[data-v-a77cc6d2]{flex:1;text-align:center;font-size:12px;color:#aaa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px;-webkit-user-select:none;user-select:none}.resize-handle[data-v-a77cc6d2]{position:relative;width:12px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center;z-index:0;background:#00000040}.left-resize-handle[data-v-a77cc6d2]{border-right:1px solid rgba(0,0,0,.5)}.right-resize-handle[data-v-a77cc6d2]{border-left:1px solid rgba(0,0,0,.5)}.handle-grip[data-v-a77cc6d2]{width:4px;height:12px;border-radius:2px;background:#000c}.resize-handle[data-v-a77cc6d2]:hover{background-color:#ffffff80}.vertical-indicator[data-v-a77cc6d2]{position:absolute;width:2px;opacity:0;pointer-events:none;transition:opacity .2s ease;top:-100vh;height:100vh;z-index:5;background-color:var(--52017849)}.left-indicator[data-v-a77cc6d2]{left:50%;transform:translate(-50%)}.right-indicator[data-v-a77cc6d2]{right:50%;transform:translate(50%)}.resize-handle.is-dragging .vertical-indicator[data-v-a77cc6d2]{opacity:.7}.gantt-container[data-v-a77cc6d2]:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-size:calc(100% / var(--0d200c71)) 100%;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px);pointer-events:none;z-index:1}.connection-handle[data-v-a77cc6d2]{position:absolute;top:50%;transform:translateY(-50%);width:16px;height:16px;opacity:0;transition:opacity .2s ease;cursor:crosshair;z-index:15;display:flex;align-items:center;justify-content:center}.connection-handle.visible[data-v-a77cc6d2]{opacity:1}.left-connection-handle[data-v-a77cc6d2]{left:-16px}.right-connection-handle[data-v-a77cc6d2]{right:-16px}.connection-dot[data-v-a77cc6d2]{width:8px;height:8px;border-radius:50%;background-color:#2196f3;border:2px solid white;box-shadow:0 1px 3px #0000004d}.connection-handle:hover .connection-dot[data-v-a77cc6d2]{background-color:#1976d2;transform:scale(1.2)}.connection-handle.is-dragging[data-v-a77cc6d2]{opacity:1!important}.connection-handle.is-dragging .connection-dot[data-v-a77cc6d2]{background-color:#1976d2;transform:scale(1.3);box-shadow:0 2px 8px #2196f366}.atable-row{background-color:#fff}.atable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.list-index{color:var(--sc-header-text-color);font-weight:700;padding-left:var(--sc-atable-row-padding);padding-right:.5em;text-align:left;-webkit-user-select:none;user-select:none;width:7ch;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.tree-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;box-sizing:border-box;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.atable-row:has(td.cell-modified)>td.sticky-column,.atable-row:has(td.cell-modified)>th.sticky-column,.atable-row:has(td.cell-modified)>td.sticky-index,.atable-row:has(td.cell-modified)>th.sticky-index{background:var(--sc-cell-changed-color)}.atable-row.changed-row-gradient[data-v-c554ee0f]:has(td.cell-modified){--cell-color-start: color-mix(in srgb, var(--sc-cell-changed-color), #fff 20%);--cell-color-end: color-mix(in srgb, var(--sc-cell-changed-color), #fff 60%);background:linear-gradient(90deg,var(--cell-color-start),var(--cell-color-end))}.gantt-connection-overlay[data-v-955111b6]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1}.connection-path[data-v-955111b6]{transition:stroke-width .2s ease;pointer-events:auto;cursor:pointer;stroke-dasharray:5px;stroke:var(--sc-cell-text-color)}#arrowhead-marker polygon[data-v-955111b6]{fill:var(--sc-cell-text-color)}.animated-path[data-v-955111b6]{animation:animated-dash-955111b6 infinite 1.5s linear}.connection-path[data-v-955111b6]:hover{stroke-width:3px}.connection-hitbox[data-v-955111b6]{pointer-events:auto;cursor:pointer}@keyframes animated-dash-955111b6{0%{stroke-dashoffset:0px}to{stroke-dashoffset:-10px}}.atable-header-row th{padding-left:.5ch!important;font-weight:700;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);box-sizing:border-box;color:var(--sc-header-text-color);position:relative}#header-index{padding-left:var(--sc-atable-row-padding);box-sizing:border-box}.tree-index{padding-right:0}th{order:1}.list-expansion-index{width:2ch;margin-left:5px}:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.amodal{position:absolute;background-color:var(--sc-row-color-zebra-dark);z-index:5}.atable-container{position:relative}.sticky-index{position:sticky;left:0;z-index:10;order:0}.sticky-column,th.sticky-column,td.sticky-column,th.sticky-index,td.sticky-index{position:sticky;z-index:10;order:0;background:#fff}.sticky-column-edge,.atable th.sticky-column-edge{border-right:1px solid var(--sc-row-border-color)}[data-v-8533f0fc]:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.atable[data-v-8533f0fc]{position:relative;font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);border-collapse:collapse;box-sizing:border-box;table-layout:auto;width:auto;overflow:clip;height:1px}.atable th[data-v-8533f0fc]{border-width:0px;border-style:solid;border-radius:0;padding-left:.5ch;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);color:var(--sc-gray-60);height:var(--sc-atable-row-height);font-weight:300;letter-spacing:.05rem;order:1;box-sizing:border-box}.atable th[data-v-8533f0fc]:focus{outline:none}.atable[data-v-8533f0fc]:tbody{overflow:hidden;position:relative}.atable[data-v-8533f0fc]:tbody:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:transparent;z-index:100}.aloading[data-v-a930a25b]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-a930a25b]{width:100%;height:100%;position:absolute;left:-100%;top:0;background:linear-gradient(90deg,rgba(var(--sc-table-loading-color),0),rgba(var(--sc-table-loading-color),1),rgba(var(--sc-table-loading-color),0));animation:gradient-a930a25b infinite 2s;z-index:0}.aloading-header[data-v-a930a25b]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-a930a25b]:after{content:"...";animation:ellipse-a930a25b 2s;animation-iteration-count:infinite}@keyframes gradient-a930a25b{0%{left:-100%}to{left:100%}}@keyframes ellipse-a930a25b{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}.aloading[data-v-e1165876]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-e1165876]{width:50%;height:3px;position:absolute;left:-100%;bottom:0;background:var(--sc-row-border-color);animation:bar-left-e1165876 infinite 2s;z-index:0}.aloading-header[data-v-e1165876]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-e1165876]:after{content:"...";animation:ellipse-e1165876 2s;animation-iteration-count:infinite}@keyframes bar-left-e1165876{0%{left:-50%}to{left:100%}}@keyframes ellipse-e1165876{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild($e);function de(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const rt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const it=e=>e!=null,st=Object.prototype.toString,ct=e=>st.call(e)==="[object Object]",dt=()=>{};function oe(e){return Array.isArray(e)?e:[e]}function ft(e,n,o){return t.watch(e,n,{...o,immediate:!0})}const Z=rt?window:void 0;function J(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function _(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,c,u)=>(l.addEventListener(i,c,u),()=>l.removeEventListener(i,c,u)),s=t.computed(()=>{const l=oe(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=ft(()=>{var l,i;return[(i=(l=s.value)==null?void 0:l.map(c=>J(c)))!=null?i:[Z].filter(c=>c!=null),oe(t.toValue(s.value?e[1]:e[0])),oe(t.unref(s.value?e[2]:e[1])),t.toValue(s.value?e[3]:e[2])]},([l,i,c,u])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(c!=null&&c.length))return;const x=ct(u)?{...u}:u;n.push(...l.flatMap(m=>i.flatMap(w=>c.map(k=>r(m,w,k,x)))))},{flush:"post"}),a=()=>{d(),o()};return de(o),a}function ut(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function mt(e){const n=ut();return t.computed(()=>(n.value,!!e()))}function gt(e,n,o={}){const{window:r=Z,...s}=o;let d;const a=mt(()=>r&&"MutationObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const m=t.toValue(e),w=oe(m).map(J).filter(it);return new Set(w)}),c=t.watch(()=>i.value,m=>{l(),a.value&&m.size&&(d=new MutationObserver(n),m.forEach(w=>d.observe(w,s)))},{immediate:!0,flush:"post"}),u=()=>d==null?void 0:d.takeRecords(),x=()=>{c(),l()};return de(x),{isSupported:a,stop:x,takeRecords:u}}function pt(e,n,o={}){const{window:r=Z,document:s=r==null?void 0:r.document,flush:d="sync"}=o;if(!r||!s)return dt;let a;const l=u=>{a==null||a(),a=u},i=t.watchEffect(()=>{const u=J(e);if(u){const{stop:x}=gt(s,m=>{m.map(w=>[...w.removedNodes]).flat().some(w=>w===u||w.contains(u))&&n(m)},{window:r,childList:!0,subtree:!0});l(x)}},{flush:d}),c=()=>{i(),l()};return de(c),c}function ht(e={}){var n;const{window:o=Z,deep:r=!0,triggerOnRemoval:s=!1}=e,d=(n=e.document)!=null?n:o==null?void 0:o.document,a=()=>{var c;let u=d==null?void 0:d.activeElement;if(r)for(;u!=null&&u.shadowRoot;)u=(c=u==null?void 0:u.shadowRoot)==null?void 0:c.activeElement;return u},l=t.shallowRef(),i=()=>{l.value=a()};if(o){const c={capture:!0,passive:!0};_(o,"blur",u=>{u.relatedTarget===null&&i()},c),_(o,"focus",i,c)}return s&&pt(l,i,{document:d}),i(),l}const bt="focusin",wt="focusout",xt=":focus-within";function vt(e,n={}){const{window:o=Z}=n,r=t.computed(()=>J(e)),s=t.shallowRef(!1),d=t.computed(()=>s.value),a=ht(n);if(!o||!a.value)return{focused:d};const l={passive:!0};return _(r,bt,()=>s.value=!0,l),_(r,wt,()=>{var i,c,u;return s.value=(u=(c=(i=r.value)==null?void 0:i.matches)==null?void 0:c.call(i,xt))!=null?u:!1},l),{focused:d}}function yt(e,{window:n=Z,scrollTarget:o}={}){const r=t.ref(!1),s=()=>{if(!n)return;const d=n.document,a=J(e);if(!a)r.value=!1;else{const l=a.getBoundingClientRect();r.value=l.top<=(n.innerHeight||d.documentElement.clientHeight)&&l.left<=(n.innerWidth||d.documentElement.clientWidth)&&l.bottom>=0&&l.right>=0}};return t.watch(()=>J(e),()=>s(),{immediate:!0,flush:"post"}),n&&_(o||n,"scroll",s,{capture:!1,passive:!0}),r}const W=e=>{let n=yt(e).value;return n=n&&e.offsetHeight>0,n},X=e=>e.tabIndex>=0,Se=e=>{const n=e.target;return fe(n)},fe=e=>{var n;let o;if(e instanceof HTMLTableCellElement){const r=(n=e.parentElement)==null?void 0:n.previousElementSibling;if(r){const s=Array.from(r.children)[e.cellIndex];s&&(o=s)}}else if(e instanceof HTMLTableRowElement){const r=e.previousElementSibling;r&&(o=r)}return o&&(!X(o)||!W(o))?fe(o):o},kt=e=>{var n;const o=e.target;let r;if(o instanceof HTMLTableCellElement){const s=(n=o.parentElement)==null?void 0:n.parentElement;if(s){const d=s.firstElementChild,a=d==null?void 0:d.children[o.cellIndex];a&&(r=a)}}else if(o instanceof HTMLTableRowElement){const s=o.parentElement;if(s){const d=s.firstElementChild;d&&(r=d)}}return r&&(!X(r)||!W(r))?ue(r):r},ze=e=>{const n=e.target;return ue(n)},ue=e=>{var n;let o;if(e instanceof HTMLTableCellElement){const r=(n=e.parentElement)==null?void 0:n.nextElementSibling;if(r){const s=Array.from(r.children)[e.cellIndex];s&&(o=s)}}else if(e instanceof HTMLTableRowElement){const r=e.nextElementSibling;r&&(o=r)}return o&&(!X(o)||!W(o))?ue(o):o},Ct=e=>{var n;const o=e.target;let r;if(o instanceof HTMLTableCellElement){const s=(n=o.parentElement)==null?void 0:n.parentElement;if(s){const d=s.lastElementChild,a=d==null?void 0:d.children[o.cellIndex];a&&(r=a)}}else if(o instanceof HTMLTableRowElement){const s=o.parentElement;if(s){const d=s.lastElementChild;d&&(r=d)}}return r&&(!X(r)||!W(r))?fe(r):r},Re=e=>{const n=e.target;return me(n)},me=e=>{var n;let o;if(e.previousElementSibling)o=e.previousElementSibling;else{const r=(n=e.parentElement)==null?void 0:n.previousElementSibling;o=r==null?void 0:r.lastElementChild}return o&&(!X(o)||!W(o))?me(o):o},Me=e=>{const n=e.target;return ge(n)},ge=e=>{var n;let o;if(e.nextElementSibling)o=e.nextElementSibling;else{const r=(n=e.parentElement)==null?void 0:n.nextElementSibling;o=r==null?void 0:r.firstElementChild}return o&&(!X(o)||!W(o))?ge(o):o},Ve=e=>{const n=e.target.parentElement,o=n==null?void 0:n.firstElementChild;return o&&(!X(o)||!W(o))?ge(o):o},Ae=e=>{const n=e.target.parentElement,o=n==null?void 0:n.lastElementChild;return o&&(!X(o)||!W(o))?me(o):o},ae=["alt","control","shift","meta"],Et={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},pe={"keydown.up":e=>{const n=Se(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.down":e=>{const n=ze(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.left":e=>{const n=Re(e);e.preventDefault(),e.stopPropagation(),n&&n.focus()},"keydown.right":e=>{const n=Me(e);e.preventDefault(),e.stopPropagation(),n&&n.focus()},"keydown.control.up":e=>{const n=kt(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.down":e=>{const n=Ct(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.left":e=>{const n=Ve(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.right":e=>{const n=Ae(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.end":e=>{const n=Ae(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const n=ze(e);n&&n.focus()}},"keydown.shift.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const n=Se(e);n&&n.focus()}},"keydown.home":e=>{const n=Ve(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.tab":e=>{const n=Me(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.shift.tab":e=>{const n=Re(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())}};function he(e){const n=a=>{let l=null;return a.parent&&(typeof a.parent=="string"?l=document.querySelector(a.parent):a.parent instanceof HTMLElement?l=a.parent:l=a.parent.value),l},o=a=>{var l;const i=n(a);let c=[];if(typeof a.selectors=="string")c=i?Array.from(i.querySelectorAll(a.selectors)):Array.from(document.querySelectorAll(a.selectors));else if(Array.isArray(a.selectors))for(const u of a.selectors)u instanceof HTMLElement?c.push(u):c.push(u.$el);else if(a.selectors instanceof HTMLElement)c.push(a.selectors);else if((l=a.selectors)!=null&&l.value)if(Array.isArray(a.selectors.value))for(const u of a.selectors.value)u instanceof HTMLElement?c.push(u):c.push(u.$el);else c.push(a.selectors.value);return c},r=a=>{const l=n(a);let i=[];return a.selectors?i=o(a):l&&(i=Array.from(l.children).filter(c=>X(c)&&W(c))),i},s=a=>l=>{const i=Et[l.key]||l.key.toLowerCase();if(ae.includes(i))return;const c=a.handlers||pe;for(const u of Object.keys(c)){const[x,...m]=u.split(".");if(x==="keydown"&&m.includes(i)){const w=c[u],k=m.filter(f=>ae.includes(f)),C=ae.some(f=>{const b=f.charAt(0).toUpperCase()+f.slice(1);return l.getModifierState(b)});if(k.length>0){if(C){for(const f of ae)if(m.includes(f)){const b=f.charAt(0).toUpperCase()+f.slice(1);l.getModifierState(b)&&w(l)}}}else C||w(l)}}},d=[];t.onMounted(()=>{for(const a of e){const l=n(a),i=r(a),c=s(a),u=l?[l]:i;for(const x of u){const{focused:m}=vt(t.ref(x)),w=t.watch(m,k=>{k?x.addEventListener("keydown",c):x.removeEventListener("keydown",c)});d.push(w)}}}),t.onBeforeUnmount(()=>{for(const a of d)a()})}function Q(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const le=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const It=e=>e!=null,Bt=Object.prototype.toString,Te=e=>Bt.call(e)==="[object Object]",F=()=>{},be=$t();function $t(){var e,n;return le&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function St(...e){if(e.length!==1)return t.toRef(...e);const n=e[0];return typeof n=="function"?t.readonly(t.customRef(()=>({get:n,set:F}))):t.ref(n)}function zt(e,n){function o(...r){return new Promise((s,d)=>{Promise.resolve(e(()=>n.apply(this,r),{fn:n,thisArg:this,args:r})).then(s).catch(d)})}return o}function Rt(e,n={}){let o,r,s=F;const d=i=>{clearTimeout(i),s(),s=F};let a;return i=>{const c=t.toValue(e),u=t.toValue(n.maxWait);return o&&d(o),c<=0||u!==void 0&&u<=0?(r&&(d(r),r=void 0),Promise.resolve(i())):new Promise((x,m)=>{s=n.rejectOnCancel?m:x,a=i,u&&!r&&(r=setTimeout(()=>{o&&d(o),r=void 0,x(a())},u)),o=setTimeout(()=>{r&&d(r),r=void 0,x(i())},c)})}}function Y(e){return Array.isArray(e)?e:[e]}function Mt(e){return t.getCurrentInstance()}function Vt(e,n=200,o={}){return zt(Rt(n,o),e)}function At(e,n={}){if(!t.isRef(e))return t.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)o[r]=t.customRef(()=>({get(){return e.value[r]},set(s){var d;if((d=t.toValue(n.replaceRef))!=null?d:!0)if(Array.isArray(e.value)){const l=[...e.value];l[r]=s,e.value=l}else{const l={...e.value,[r]:s};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[r]=s}}));return o}function Tt(e,n=!0,o){Mt()?t.onMounted(e,o):n?e():t.nextTick(e)}function De(e,n,o){return t.watch(e,n,{...o,immediate:!0})}const re=le?window:void 0;function K(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function ee(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,c,u)=>(l.addEventListener(i,c,u),()=>l.removeEventListener(i,c,u)),s=t.computed(()=>{const l=Y(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=De(()=>{var l,i;return[(i=(l=s.value)==null?void 0:l.map(c=>K(c)))!=null?i:[re].filter(c=>c!=null),Y(t.toValue(s.value?e[1]:e[0])),Y(t.unref(s.value?e[2]:e[1])),t.toValue(s.value?e[3]:e[2])]},([l,i,c,u])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(c!=null&&c.length))return;const x=Te(u)?{...u}:u;n.push(...l.flatMap(m=>i.flatMap(w=>c.map(k=>r(m,w,k,x)))))},{flush:"post"}),a=()=>{d(),o()};return Q(o),a}function Dt(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function He(e){const n=Dt();return t.computed(()=>(n.value,!!e()))}function Le(e,n,o={}){const{window:r=re,...s}=o;let d;const a=He(()=>r&&"MutationObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const m=t.toValue(e),w=Y(m).map(K).filter(It);return new Set(w)}),c=t.watch(()=>i.value,m=>{l(),a.value&&m.size&&(d=new MutationObserver(n),m.forEach(w=>d.observe(w,s)))},{immediate:!0,flush:"post"}),u=()=>d==null?void 0:d.takeRecords(),x=()=>{c(),l()};return Q(x),{isSupported:a,stop:x,takeRecords:u}}function we(e,n={}){var o;const{pointerTypes:r,preventDefault:s,stopPropagation:d,exact:a,onMove:l,onEnd:i,onStart:c,initialValue:u,axis:x="both",draggingElement:m=re,containerElement:w,handle:k=e,buttons:C=[0]}=n,f=t.ref((o=t.toValue(u))!=null?o:{x:0,y:0}),b=t.ref(),v=$=>r?r.includes($.pointerType):!0,I=$=>{t.toValue(s)&&$.preventDefault(),t.toValue(d)&&$.stopPropagation()},V=$=>{var R;if(!t.toValue(C).includes($.button)||t.toValue(n.disabled)||!v($)||t.toValue(a)&&$.target!==t.toValue(e))return;const D=t.toValue(w),N=(R=D==null?void 0:D.getBoundingClientRect)==null?void 0:R.call(D),M=t.toValue(e).getBoundingClientRect(),G={x:$.clientX-(D?M.left-N.left+D.scrollLeft:M.left),y:$.clientY-(D?M.top-N.top+D.scrollTop:M.top)};(c==null?void 0:c(G,$))!==!1&&(b.value=G,I($))},L=$=>{if(t.toValue(n.disabled)||!v($)||!b.value)return;const R=t.toValue(w),D=t.toValue(e).getBoundingClientRect();let{x:N,y:M}=f.value;(x==="x"||x==="both")&&(N=$.clientX-b.value.x,R&&(N=Math.min(Math.max(0,N),R.scrollWidth-D.width))),(x==="y"||x==="both")&&(M=$.clientY-b.value.y,R&&(M=Math.min(Math.max(0,M),R.scrollHeight-D.height))),f.value={x:N,y:M},l==null||l(f.value,$),I($)},z=$=>{t.toValue(n.disabled)||!v($)||b.value&&(b.value=void 0,i==null||i(f.value,$),I($))};if(le){const $=()=>{var R;return{capture:(R=n.capture)!=null?R:!0,passive:!t.toValue(s)}};ee(k,"pointerdown",V,$),ee(m,"pointermove",L,$),ee(m,"pointerup",z,$)}return{...At(f),position:f,isDragging:t.computed(()=>!!b.value),style:t.computed(()=>`left:${f.value.x}px;top:${f.value.y}px;`)}}function Ht(e,n,o={}){const{window:r=re,...s}=o;let d;const a=He(()=>r&&"ResizeObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const x=t.toValue(e);return Array.isArray(x)?x.map(m=>K(m)):[K(x)]}),c=t.watch(i,x=>{if(l(),a.value&&r){d=new ResizeObserver(n);for(const m of x)m&&d.observe(m,s)}},{immediate:!0,flush:"post"}),u=()=>{l(),c()};return Q(u),{isSupported:a,stop:u}}function j(e,n={}){const{reset:o=!0,windowResize:r=!0,windowScroll:s=!0,immediate:d=!0,updateTiming:a="sync"}=n,l=t.shallowRef(0),i=t.shallowRef(0),c=t.shallowRef(0),u=t.shallowRef(0),x=t.shallowRef(0),m=t.shallowRef(0),w=t.shallowRef(0),k=t.shallowRef(0);function C(){const b=K(e);if(!b){o&&(l.value=0,i.value=0,c.value=0,u.value=0,x.value=0,m.value=0,w.value=0,k.value=0);return}const v=b.getBoundingClientRect();l.value=v.height,i.value=v.bottom,c.value=v.left,u.value=v.right,x.value=v.top,m.value=v.width,w.value=v.x,k.value=v.y}function f(){a==="sync"?C():a==="next-frame"&&requestAnimationFrame(()=>C())}return Ht(e,f),t.watch(()=>K(e),b=>!b&&f()),Le(e,f,{attributeFilter:["style","class"]}),s&&ee("scroll",f,{capture:!0,passive:!0}),r&&ee("resize",f,{passive:!0}),Tt(()=>{d&&f()}),{height:l,bottom:i,left:c,right:u,top:x,width:m,x:w,y:k,update:f}}const Lt=e=>{const n=new DOMParser().parseFromString(e,"text/html");return Array.from(n.body.childNodes).some(o=>o.nodeType===1)},Pt=(e=8)=>Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(""),Ot=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],Nt=["innerHTML"],Wt={key:2},Pe=t.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean,default:!1},debounce:{default:300}},setup(e,{expose:n}){const o=t.useTemplateRef("cell"),r=e.store.getCellData(e.colIndex,e.rowIndex),s=t.ref(""),d=t.ref(!1),a=e.store.columns[e.colIndex],l=e.store.rows[e.rowIndex],i=a.align||"center",c=a.width||"40ch",u=t.computed(()=>e.store.getCellDisplayValue(e.colIndex,e.rowIndex)),x=t.computed(()=>typeof u.value=="string"?Lt(u.value):!1),m=t.computed(()=>{var v;return{textAlign:i,width:c,fontWeight:d.value?"bold":"inherit",paddingLeft:e.store.getIndent(e.colIndex,(v=e.store.display[e.rowIndex])==null?void 0:v.indent)}}),w=t.computed(()=>({"sticky-column":e.pinned,"cell-modified":d.value})),k=()=>{const{left:v,bottom:I,width:V,height:L}=j(o);a.mask,a.modalComponent&&e.store.$patch(z=>{z.modal.visible=!0,z.modal.colIndex=e.colIndex,z.modal.rowIndex=e.rowIndex,z.modal.left=v,z.modal.bottom=I,z.modal.width=V,z.modal.height=L,z.modal.cell=o.value,typeof a.modalComponent=="function"?z.modal.component=a.modalComponent({table:z.table,row:l,column:a}):z.modal.component=a.modalComponent,z.modal.componentProps=a.modalComponentExtraProps})};if(e.addNavigation){let v={...pe,"keydown.f2":k,"keydown.alt.up":k,"keydown.alt.down":k,"keydown.alt.left":k,"keydown.alt.right":k};typeof e.addNavigation=="object"&&(v={...v,...e.addNavigation}),he([{selectors:o,handlers:v}])}const C=()=>{o.value&&(s.value=o.value.textContent)},f=v=>{const I=v.target;I.textContent!==s.value&&(s.value=I.textContent,a.format?(d.value=I.textContent!==e.store.getFormattedValue(e.colIndex,e.rowIndex,r),e.store.setCellText(e.colIndex,e.rowIndex,I.textContent)):(d.value=I.textContent!==r,e.store.setCellData(e.colIndex,e.rowIndex,I.textContent)))},b=Vt(f,e.debounce);return n({currentData:s}),(v,I)=>(t.openBlock(),t.createElementBlock("td",{ref:"cell","data-colindex":v.colIndex,"data-rowindex":v.rowIndex,"data-editable":t.unref(a).edit,contenteditable:t.unref(a).edit,tabindex:v.tabIndex,spellcheck:!1,style:t.normalizeStyle(m.value),onFocus:C,onPaste:f,onInput:I[0]||(I[0]=(...V)=>t.unref(b)&&t.unref(b)(...V)),onClick:k,class:t.normalizeClass(["atable-cell",w.value])},[t.unref(a).cellComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(a).cellComponent),t.mergeProps({key:0,value:u.value},t.unref(a).cellComponentProps),null,16,["value"])):x.value?(t.openBlock(),t.createElementBlock("span",{key:1,innerHTML:u.value},null,8,Nt)):(t.openBlock(),t.createElementBlock("span",Wt,t.toDisplayString(u.value),1))],46,Ot))}}),Xt=["tabindex"],Ft=["tabindex"],Gt=["colspan"],Yt=t.defineComponent({__name:"AExpansionRow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object]}},setup(e){const n=t.useTemplateRef("rowEl"),o=t.computed(()=>e.store.display[e.rowIndex].expanded?"▼":"►");if(e.addNavigation){const r={"keydown.control.g":s=>{s.stopPropagation(),s.preventDefault(),e.store.toggleRowExpand(e.rowIndex)}};typeof e.addNavigation=="object"&&Object.assign(r,e.addNavigation),he([{selectors:n,handlers:r}])}return(r,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("tr",t.mergeProps(r.$attrs,{ref:"rowEl",tabindex:r.tabIndex,class:"expandable-row"}),[t.createElementVNode("td",{tabIndex:-1,onClick:s[0]||(s[0]=d=>r.store.toggleRowExpand(r.rowIndex)),class:"row-index"},t.toDisplayString(o.value),1),t.renderSlot(r.$slots,"row",{},void 0,!0)],16,Xt),r.store.display[r.rowIndex].expanded?(t.openBlock(),t.createElementBlock("tr",{key:0,ref:"rowExpanded",tabindex:r.tabIndex,class:"expanded-row"},[t.createElementVNode("td",{tabIndex:-1,colspan:r.store.columns.length+1,class:"expanded-row-content"},[t.renderSlot(r.$slots,"content",{},void 0,!0)],8,Gt)],8,Ft)):t.createCommentVNode("",!0)],64))}}),U=(e,n)=>{const o=e.__vccOpts||e;for(const[r,s]of n)o[r]=s;return o},Oe=U(Yt,[["__scopeId","data-v-5ad4bb41"]]),jt=["colspan"],Ut={ref:"container",class:"gantt-container"},qt=["data-rowindex","data-colindex"],Zt={key:0,class:"gantt-label"},Jt=["x1","y1","x2","y2"],Ne=U(t.defineComponent({__name:"AGanttCell",props:{store:{},columnsCount:{},rowIndex:{},colIndex:{},start:{default:0},end:{},colspan:{default:1},label:{},color:{default:"#cccccc"}},emits:["connection:create"],setup(e,{expose:n,emit:o}){t.useCssVars(h=>({52017849:s.value,"0d200c71":h.colspan}));const r=o,s=t.ref(e.color.length>=6?e.color:"#cccccc"),d=`gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`,a=t.useTemplateRef("container"),l=t.useTemplateRef("bar"),i=t.useTemplateRef("leftResizeHandle"),c=t.useTemplateRef("rightResizeHandle"),u=t.useTemplateRef("leftConnectionHandle"),x=t.useTemplateRef("rightConnectionHandle"),{width:m}=j(a),{left:w,right:k}=j(l),C=t.ref(e.start),f=t.ref(e.end||C.value+e.colspan),b=t.ref(!1),v=t.ref(!1),I=t.ref(!1),V=t.ref(!1),L=t.ref(!1),z=t.ref({startX:0,startY:0,endX:0,endY:0}),$=t.computed(()=>ne.value||G.value||te.value),R=t.computed(()=>e.colspan>0?m.value/e.colspan:0),D=t.computed(()=>{const h=C.value/e.colspan*100,y=f.value/e.colspan*100;return{left:`${h}%`,width:`${y-h}%`,backgroundColor:s.value}}),N=t.computed(()=>({position:"fixed",top:0,left:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:1e3})),M=t.ref({startX:0,startPos:0}),{isDragging:G}=we(i,{axis:"x",onStart:()=>ce(w.value,C.value),onMove:({x:h})=>Ze(h),onEnd:({x:h})=>Je(h)}),{isDragging:te}=we(c,{axis:"x",onStart:()=>ce(k.value,f.value),onMove:({x:h})=>Qe(h),onEnd:({x:h})=>Ke(h)}),{isDragging:ne}=we(l,{exact:!0,axis:"x",onStart:()=>ce(w.value,C.value),onMove:({x:h})=>_e(h),onEnd:({x:h})=>et(h)});t.onMounted(()=>{tt()}),t.onUnmounted(()=>{nt()});function ce(h,y){l.value&&(l.value.style.transition="none"),M.value={startX:h,startPos:y}}function Ze(h){if(!G.value||!l.value)return;const B=(h-M.value.startX)/R.value,S=Math.max(0,Math.min(f.value-1,M.value.startPos+B));l.value.style.left=`${S/e.colspan*100}%`,l.value.style.width=`${(f.value-S)/e.colspan*100}%`}function Je(h){if(!l.value)return;const y=h-M.value.startX,B=Math.round(y/R.value),S=C.value,A=Math.max(0,Math.min(f.value-1,M.value.startPos+B));C.value=A,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"resize",edge:"start",oldStart:S,newStart:A,end:f.value,delta:B,oldColspan:f.value-S,newColspan:f.value-A})}function Qe(h){if(!te.value||!l.value)return;const B=(h-M.value.startX)/R.value,S=Math.max(C.value+1,Math.min(e.columnsCount,M.value.startPos+B));l.value.style.width=`${(S-C.value)/e.colspan*100}%`}function Ke(h){if(!l.value)return;const y=h-M.value.startX,B=Math.round(y/R.value),S=f.value,A=Math.max(C.value+1,Math.min(e.columnsCount,M.value.startPos+B));f.value=A,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"resize",edge:"end",oldEnd:S,newEnd:A,start:C.value,delta:B,oldColspan:S-C.value,newColspan:A-C.value})}function _e(h){if(!ne.value||!l.value)return;const B=(h-M.value.startX)/R.value,S=f.value-C.value,A=Math.max(0,Math.min(M.value.startPos+B,e.columnsCount-S));l.value.style.left=`${A/e.colspan*100}%`}function et(h){if(!l.value)return;const y=h-M.value.startX,B=Math.round(y/R.value),S=f.value-C.value,A=C.value,H=f.value;let P=M.value.startPos+B,O=P+S;P<0?(P=0,O=S):O>e.columnsCount&&(O=e.columnsCount,P=O-S),C.value=P,f.value=O,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"bar",oldStart:A,oldEnd:H,newStart:P,newEnd:O,delta:B,colspan:O-P})}function tt(){const{x:h,y}=j(l),{x:B,y:S}=j(u),{x:A,y:H}=j(x);e.store.registerGanttBar({id:d,rowIndex:e.rowIndex,colIndex:e.colIndex,startIndex:C,endIndex:f,color:s,label:e.label,position:{x:h,y}}),e.store.registerConnectionHandle({id:`${d}-connection-left`,rowIndex:e.rowIndex,colIndex:e.colIndex,side:"left",position:{x:B,y:S},visible:b,barId:d}),e.store.registerConnectionHandle({id:`${d}-connection-right`,rowIndex:e.rowIndex,colIndex:e.colIndex,side:"right",position:{x:A,y:H},visible:v,barId:d})}function nt(){e.store.unregisterGanttBar(d),e.store.unregisterConnectionHandle(`${d}-connection-left`),e.store.unregisterConnectionHandle(`${d}-connection-right`)}function ot(){b.value=!0,v.value=!0}function Be(){!I.value&&!V.value&&(b.value=!1,v.value=!1)}function g(h,y){y.preventDefault(),y.stopPropagation(),L.value=!0,h==="left"?I.value=!0:V.value=!0;const B=h==="left"?u.value:x.value;if(B){const H=B.getBoundingClientRect(),P=H.left+H.width/2,O=H.top+H.height/2;z.value={startX:P,startY:O,endX:P,endY:O}}const S=H=>{z.value.endX=H.clientX,z.value.endY=H.clientY},A=H=>{p(H,h),E(S,A)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",A)}function p(h,y){const B=document.elementFromPoint(h.clientX,h.clientY),S=B==null?void 0:B.closest(".connection-handle");if(S&&S!==(y==="left"?u.value:x.value)){const A=S.closest(".gantt-bar");if(A){const H=parseInt(A.getAttribute("data-rowindex")||"0"),P=parseInt(A.getAttribute("data-colindex")||"0"),O=S.classList.contains("left-connection-handle")?"left":"right",In=`gantt-bar-row-${H}-col-${P}`,at=e.store.createConnection(`${d}-connection-${y}`,`${In}-connection-${O}`);at&&r("connection:create",at)}}}function E(h,y){var B;L.value=!1,I.value=!1,V.value=!1,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",y),(B=l.value)!=null&&B.matches(":hover")||Be()}return n({barStyle:D,cleanupConnectionDrag:E,currentEnd:f,handleConnectionDrop:p,isLeftConnectionDragging:I,isLeftConnectionVisible:b,isRightConnectionDragging:V,isRightConnectionVisible:v,showDragPreview:L}),(h,y)=>(t.openBlock(),t.createElementBlock("td",{class:"aganttcell",colspan:h.colspan},[t.createElementVNode("div",Ut,[t.createElementVNode("div",{ref:"bar","data-rowindex":h.rowIndex,"data-colindex":h.colIndex,class:t.normalizeClass(["gantt-bar",{"is-dragging":$.value}]),style:t.normalizeStyle(D.value),onMouseenter:ot,onMouseleave:Be},[t.createElementVNode("div",{ref:"leftConnectionHandle",class:t.normalizeClass(["connection-handle left-connection-handle",{visible:b.value,"is-dragging":I.value}]),onMousedown:y[0]||(y[0]=t.withModifiers(B=>g("left",B),["stop"]))},y[2]||(y[2]=[t.createElementVNode("div",{class:"connection-dot"},null,-1)]),34),t.createElementVNode("div",{ref:"rightConnectionHandle",class:t.normalizeClass(["connection-handle right-connection-handle",{visible:v.value,"is-dragging":V.value}]),onMousedown:y[1]||(y[1]=t.withModifiers(B=>g("right",B),["stop"]))},y[3]||(y[3]=[t.createElementVNode("div",{class:"connection-dot"},null,-1)]),34),t.createElementVNode("div",{ref:"leftResizeHandle",class:t.normalizeClass(["resize-handle left-resize-handle",{"is-dragging":t.unref(G)}])},y[4]||(y[4]=[t.createElementVNode("div",{class:"handle-grip"},null,-1),t.createElementVNode("div",{class:"vertical-indicator left-indicator"},null,-1)]),2),h.label?(t.openBlock(),t.createElementBlock("label",Zt,t.toDisplayString(h.label),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"rightResizeHandle",class:t.normalizeClass(["resize-handle right-resize-handle",{"is-dragging":t.unref(te)}])},y[5]||(y[5]=[t.createElementVNode("div",{class:"handle-grip"},null,-1),t.createElementVNode("div",{class:"vertical-indicator right-indicator"},null,-1)]),2)],46,qt)],512),L.value?(t.openBlock(),t.createElementBlock("svg",{key:0,style:t.normalizeStyle(N.value)},[t.createElementVNode("line",{x1:z.value.startX,y1:z.value.startY,x2:z.value.endX,y2:z.value.endY,stroke:"#2196f3","stroke-width":"2","stroke-dasharray":"5,5"},null,8,Jt)],4)):t.createCommentVNode("",!0)],8,jt))}}),[["__scopeId","data-v-a77cc6d2"]]),Qt=["tabindex"],xe=U(t.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(e){const n=t.useTemplateRef("rowEl"),o=t.computed(()=>e.store.isRowVisible(e.rowIndex)),r=t.computed(()=>e.store.getRowExpandSymbol(e.rowIndex));if(e.addNavigation){let s=pe;typeof e.addNavigation=="object"&&(s={...s,...e.addNavigation}),he([{selectors:n,handlers:s}])}return(s,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("tr",{ref:"rowEl",tabindex:s.tabIndex,class:"atable-row"},[s.store.config.view!=="uncounted"?t.renderSlot(s.$slots,"index",{key:0},()=>[s.store.config.view==="list"?(t.openBlock(),t.createElementBlock("td",{key:0,tabIndex:-1,class:t.normalizeClass(["list-index",s.store.hasPinnedColumns?"sticky-index":""])},t.toDisplayString(s.rowIndex+1),3)):s.store.isTreeView?(t.openBlock(),t.createElementBlock("td",{key:1,tabIndex:-1,class:t.normalizeClass(["tree-index",s.store.hasPinnedColumns?"sticky-index":""]),onClick:d[0]||(d[0]=a=>s.store.toggleRowExpand(s.rowIndex))},t.toDisplayString(r.value),3)):t.createCommentVNode("",!0)],!0):t.createCommentVNode("",!0),t.renderSlot(s.$slots,"default",{},void 0,!0)],8,Qt)),[[t.vShow,o.value]])}}),[["__scopeId","data-v-c554ee0f"]]),ve=le?window:void 0;function q(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function ie(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,c,u)=>(l.addEventListener(i,c,u),()=>l.removeEventListener(i,c,u)),s=t.computed(()=>{const l=Y(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=De(()=>{var l,i;return[(i=(l=s.value)==null?void 0:l.map(c=>q(c)))!=null?i:[ve].filter(c=>c!=null),Y(t.toValue(s.value?e[1]:e[0])),Y(t.unref(s.value?e[2]:e[1])),t.toValue(s.value?e[3]:e[2])]},([l,i,c,u])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(c!=null&&c.length))return;const x=Te(u)?{...u}:u;n.push(...l.flatMap(m=>i.flatMap(w=>c.map(k=>r(m,w,k,x)))))},{flush:"post"}),a=()=>{d(),o()};return Q(o),a}let We=!1;function Xe(e,n,o={}){const{window:r=ve,ignore:s=[],capture:d=!0,detectIframe:a=!1,controls:l=!1}=o;if(!r)return l?{stop:F,cancel:F,trigger:F}:F;if(be&&!We){We=!0;const f={passive:!0};Array.from(r.document.body.children).forEach(b=>b.addEventListener("click",F,f)),r.document.documentElement.addEventListener("click",F,f)}let i=!0;const c=f=>t.toValue(s).some(b=>{if(typeof b=="string")return Array.from(r.document.querySelectorAll(b)).some(v=>v===f.target||f.composedPath().includes(v));{const v=q(b);return v&&(f.target===v||f.composedPath().includes(v))}});function u(f){const b=t.toValue(f);return b&&b.$.subTree.shapeFlag===16}function x(f,b){const v=t.toValue(f),I=v.$.subTree&&v.$.subTree.children;return I==null||!Array.isArray(I)?!1:I.some(V=>V.el===b.target||b.composedPath().includes(V.el))}const m=f=>{const b=q(e);if(f.target!=null&&!(!(b instanceof Element)&&u(e)&&x(e,f))&&!(!b||b===f.target||f.composedPath().includes(b))){if("detail"in f&&f.detail===0&&(i=!c(f)),!i){i=!0;return}n(f)}};let w=!1;const k=[ie(r,"click",f=>{w||(w=!0,setTimeout(()=>{w=!1},0),m(f))},{passive:!0,capture:d}),ie(r,"pointerdown",f=>{const b=q(e);i=!c(f)&&!!(b&&!f.composedPath().includes(b))},{passive:!0}),a&&ie(r,"blur",f=>{setTimeout(()=>{var b;const v=q(e);((b=r.document.activeElement)==null?void 0:b.tagName)==="IFRAME"&&!(v!=null&&v.contains(r.document.activeElement))&&n(f)},0)},{passive:!0})].filter(Boolean),C=()=>k.forEach(f=>f());return l?{stop:C,cancel:()=>{i=!1},trigger:f=>{i=!0,m(f),i=!1}}:C}const ye=new WeakMap,Kt={mounted(e,n){const o=!n.modifiers.bubble;let r;if(typeof n.value=="function")r=Xe(e,n.value,{capture:o});else{const[s,d]=n.value;r=Xe(e,s,Object.assign({capture:o},d))}ye.set(e,r)},unmounted(e){const n=ye.get(e);n&&typeof n=="function"?n():n==null||n.stop(),ye.delete(e)}};function _t(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function en(e){const n=_t();return t.computed(()=>(n.value,!!e()))}function Fe(e,n,o={}){const{window:r=ve,...s}=o;let d;const a=en(()=>r&&"ResizeObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const x=t.toValue(e);return Array.isArray(x)?x.map(m=>q(m)):[q(x)]}),c=t.watch(i,x=>{if(l(),a.value&&r){d=new ResizeObserver(n);for(const m of x)m&&d.observe(m,s)}},{immediate:!0,flush:"post"}),u=()=>{l(),c()};return Q(u),{isSupported:a,stop:u}}function ke(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const tn={mounted(e,n){typeof n.value=="function"?Fe(e,n.value):Fe(e,...n.value)}};function Ge(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const o=e.parentNode;return!o||o.tagName==="BODY"?!1:Ge(o)}}function nn(e){const n=e||window.event,o=n.target;return Ge(o)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const Ce=new WeakMap;function on(e,n=!1){const o=t.shallowRef(n);let r=null,s="";t.watch(St(e),l=>{const i=ke(t.toValue(l));if(i){const c=i;if(Ce.get(c)||Ce.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return o.value=!0;if(o.value)return c.style.overflow="hidden"}},{immediate:!0});const d=()=>{const l=ke(t.toValue(e));!l||o.value||(be&&(r=ie(l,"touchmove",i=>{nn(i)},{passive:!1})),l.style.overflow="hidden",o.value=!0)},a=()=>{const l=ke(t.toValue(e));!l||!o.value||(be&&(r==null||r()),l.style.overflow=s,Ce.delete(l),o.value=!1)};return Q(a),t.computed({get(){return o.value},set(l){l?d():a()}})}function an(){let e=!1;const n=t.shallowRef(!1);return(o,r)=>{if(n.value=r.value,e)return;e=!0;const s=on(o,r.value);t.watch(n,d=>s.value=d)}}an();const ln={class:"gantt-connection-overlay"},rn={class:"connection-svg",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1}},sn=["d","stroke-width","onDblclick"],cn=["d","stroke","stroke-width","id","onDblclick"],dn=.25,se=16,fn=U(t.defineComponent({__name:"AGanttConnection",props:{store:{}},emits:["connection:delete"],setup(e,{emit:n}){const o=n,r=t.computed(()=>e.store.connectionPaths.filter(a=>{const l=e.store.ganttBars.find(c=>c.id===a.from.barId),i=e.store.ganttBars.find(c=>c.id===a.to.barId);return l&&i})),s=(a,l=!1)=>{const i=e.store.connectionHandles.find(R=>R.barId===a.from.barId&&R.side===a.from.side),c=e.store.connectionHandles.find(R=>R.barId===a.to.barId&&R.side===a.to.side);if(!i||!c)return"";const u=i.position.x+se/2,x=i.position.y+se/2,m=c.position.x+se/2,w=c.position.y+se/2,k=Math.abs(m-u),C=Math.max(k*dn,50),f=u+(a.from.side==="left"?-C:C),b=m+(a.to.side==="left"?-C:C),v={x:.5*u+.5*f,y:.5*x+.5*x},I={x:.5*f+.5*b,y:.5*x+.5*w},V={x:.5*b+.5*m,y:.5*w+.5*w},L={x:.5*v.x+.5*I.x,y:.5*v.y+.5*I.y},z={x:.5*I.x+.5*V.x,y:.5*I.y+.5*V.y},$={x:.5*L.x+.5*z.x,y:.5*L.y+.5*z.y};return`M ${u} ${x} Q ${f} ${x}, ${$.x} ${$.y} Q ${b} ${w}, ${m} ${w}`},d=a=>{e.store.deleteConnection(a.id)&&o("connection:delete",a)};return(a,l)=>(t.openBlock(),t.createElementBlock("div",ln,[(t.openBlock(),t.createElementBlock("svg",rn,[l[0]||(l[0]=t.createElementVNode("defs",null,[t.createElementVNode("path",{id:"arrowhead",d:"M 0 -7 L 20 0 L 0 7Z",stroke:"black","stroke-width":"1",fill:"currentColor"}),t.createElementVNode("marker",{id:"arrowhead-marker",markerWidth:"10",markerHeight:"7",refX:"5",refY:"3.5",orient:"auto",markerUnits:"strokeWidth"},[t.createElementVNode("polygon",{points:"0 0, 10 3.5, 0 7",fill:"currentColor"})])],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,i=>{var c;return t.openBlock(),t.createElementBlock("path",{key:`${i.id}-hitbox`,d:s(i),stroke:"transparent","stroke-width":(((c=i.style)==null?void 0:c.width)||2)+10,fill:"none",class:"connection-hitbox",onDblclick:u=>d(i)},null,40,sn)}),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,i=>{var c,u;return t.openBlock(),t.createElementBlock("path",{key:i.id,d:s(i),stroke:((c=i.style)==null?void 0:c.color)||"#666","stroke-width":((u=i.style)==null?void 0:u.width)||2,fill:"none","marker-mid":"url(#arrowhead-marker)",id:i.id,class:"connection-path animated-path",onDblclick:x=>d(i)},null,40,cn)}),128))]))]))}}),[["__scopeId","data-v-955111b6"]]),un={key:0},mn={class:"atable-header-row",tabindex:"-1"},gn=["data-colindex"],Ee=t.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(e){const n=o=>{var r;for(const s of o){if(s.borderBoxSize.length===0)continue;const a=s.borderBoxSize[0].inlineSize,l=Number(s.target.dataset.colindex),i=(r=e.store.columns[l])==null?void 0:r.width;typeof i=="number"&&i!==a&&e.store.resizeColumn(l,a)}};return(o,r)=>o.columns.length?(t.openBlock(),t.createElementBlock("thead",un,[t.createElementVNode("tr",mn,[o.store.zeroColumn?(t.openBlock(),t.createElementBlock("th",{key:0,id:"header-index",class:t.normalizeClass([[o.store.hasPinnedColumns?"sticky-index":"",o.store.isTreeView?"tree-index":"",o.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.columns,(s,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("th",{key:s.name,"data-colindex":d,tabindex:"-1",style:t.normalizeStyle(o.store.getHeaderCellStyle(s)),class:t.normalizeClass(s.pinned?"sticky-column":"")},[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(s.label||String.fromCharCode(d+97).toUpperCase()),1)])],14,gn)),[[t.unref(tn),n]])),128))])])):t.createCommentVNode("",!0)}}),Ie=t.defineComponent({__name:"ATableModal",props:{store:{}},setup(e){const n=t.useTemplateRef("amodal"),{width:o,height:r}=j(n),s=t.computed(()=>{var x,m,w,k;if(!(e.store.modal.height&&e.store.modal.width&&e.store.modal.left&&e.store.modal.bottom))return;const d=(x=e.store.modal.cell)==null?void 0:x.closest("table"),a=d.offsetHeight||0,l=d.offsetWidth||0;let i=((m=e.store.modal.cell)==null?void 0:m.offsetTop)||0;const c=((w=d.querySelector("thead"))==null?void 0:w.offsetHeight)||0;i+=c,i=i+r.value<a?i:i-(r.value+e.store.modal.height);let u=((k=e.store.modal.cell)==null?void 0:k.offsetLeft)||0;return u=u+o.value<=l?u:u-(o.value-e.store.modal.width),{left:`${u}px`,top:`${i}px`}});return(d,a)=>(t.openBlock(),t.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:a[0]||(a[0]=t.withModifiers(()=>{},["stop"])),onInput:a[1]||(a[1]=t.withModifiers(()=>{},["stop"])),style:t.normalizeStyle(s.value)},[t.renderSlot(d.$slots,"default")],36))}}),Ye=e=>{const n=e.id||Pt();return lt.defineStore(`table-${n}`,()=>{const r=()=>{const g={};for(const[p,E]of d.value.entries())for(const[h,y]of a.value.entries())g[`${p}:${h}`]=y[E.name];return g},s=g=>{const p=[Object.assign({},{rowModified:!1})];if(g&&"0:0"in g)return g;const E=new Set;for(let h=0;h<a.value.length;h++){const y=a.value[h];y.parent!==null&&y.parent!==void 0&&E.add(y.parent)}for(let h=0;h<a.value.length;h++){const y=a.value[h];p[h]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:E.has(h),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return p},d=t.ref(e.columns),a=t.ref(e.rows),l=t.ref(e.config||{}),i=t.ref(e.table||r()),c=t.ref(s(e.display)),u=t.ref(e.modal||{visible:!1}),x=t.ref({}),m=t.ref([]),w=t.ref([]),k=t.ref([]),C=t.computed(()=>d.value.some(g=>g.pinned)),f=t.computed(()=>l.value.view==="gantt"||l.value.view==="tree-gantt"),b=t.computed(()=>l.value.view==="tree"||l.value.view==="tree-gantt"),v=t.computed(()=>`${Math.ceil(a.value.length/100+1)}ch`),I=t.computed(()=>l.value.view?["list","tree","tree-gantt","list-expansion"].includes(l.value.view):!1),V=(g,p)=>i.value[`${g}:${p}`],L=(g,p,E)=>{const h=`${g}:${p}`,y=d.value[g];i.value[h]!==E&&(c.value[p].rowModified=!0),i.value[h]=E,a.value[p]={...a.value[p],[y.name]:E}},z=(g,p,E)=>{const h=`${g}:${p}`;i.value[h]!==E&&(c.value[p].rowModified=!0,x.value[h]=E)},$=g=>{const p=d.value.indexOf(g)===d.value.length-1,E=l.value.fullWidth?g.resizable&&!p:g.resizable;return{width:g.width||"40ch",textAlign:g.align||"center",...E&&{resize:"horizontal",overflow:"hidden",whiteSpace:"nowrap"}}},R=(g,p)=>{if(g<0||g>=d.value.length)return;const h=Math.max(p,40);d.value[g]={...d.value[g],width:`${h}px`}},D=g=>{const p=a.value[g];return f.value&&p.gantt!==void 0},N=g=>!b.value||c.value[g].isRoot||c.value[g].open,M=g=>!b.value&&l.value.view!=="list-expansion"?"":b.value&&(c.value[g].isRoot||c.value[g].isParent)?c.value[g].childrenOpen?"▼":"►":l.value.view==="list-expansion"?c.value[g].expanded?"▼":"►":"",G=g=>{if(b.value){c.value[g].childrenOpen=!c.value[g].childrenOpen;const p=c.value[g].childrenOpen;for(let E=0;E<a.value.length;E++)c.value[E].parent===g&&(c.value[E].open=p,p||(c.value[E].childrenOpen=!1,G(E)))}else l.value.view==="list-expansion"&&(c.value[g].expanded=!c.value[g].expanded)},te=(g,p)=>{const E=V(g,p);return ne(g,p,E)},ne=(g,p,E)=>{const h=d.value[g],y=a.value[p],B=h.format;return B?typeof B=="function"?B(E,{table:i.value,row:y,column:h}):typeof B=="string"?Function(`"use strict";return (${B})`)()(E,{table:i.value,row:y,column:h}):E:E};return{columns:d,config:l,connectionHandles:w,connectionPaths:k,display:c,ganttBars:m,modal:u,rows:a,table:i,updates:x,hasPinnedColumns:C,isGanttView:f,isTreeView:b,numberedRowWidth:v,zeroColumn:I,closeModal:g=>{var p;g.target instanceof Node&&(p=u.value.parent)!=null&&p.contains(g.target)||u.value.visible&&(u.value.visible=!1)},createConnection:(g,p,E)=>{const h=w.value.find(S=>S.id===g),y=w.value.find(S=>S.id===p);if(!h||!y)return console.warn("Cannot create connection: handle not found"),null;const B={id:`connection-${g}-${p}`,from:{barId:h.barId,side:h.side},to:{barId:y.barId,side:y.side},style:E==null?void 0:E.style,label:E==null?void 0:E.label};return k.value.push(B),B},deleteConnection:g=>{const p=k.value.findIndex(E=>E.id===g);return p>=0?(k.value.splice(p,1),!0):!1},getCellData:V,getCellDisplayValue:te,getConnectionsForBar:g=>k.value.filter(p=>p.from.barId===g||p.to.barId===g),getFormattedValue:ne,getHandlesForBar:g=>w.value.filter(p=>p.barId===g),getHeaderCellStyle:$,getIndent:(g,p)=>p&&g===0&&p>0?`${p}ch`:"inherit",getRowExpandSymbol:M,isRowGantt:D,isRowVisible:N,registerConnectionHandle:g=>{const p=w.value.findIndex(E=>E.id===g.id);p>=0?w.value[p]=g:w.value.push(g)},registerGanttBar:g=>{const p=m.value.findIndex(E=>E.id===g.id);p>=0?m.value[p]=g:m.value.push(g)},resizeColumn:R,setCellData:L,setCellText:z,toggleRowExpand:G,unregisterConnectionHandle:g=>{const p=w.value.findIndex(E=>E.id===g);p>=0&&w.value.splice(p,1)},unregisterGanttBar:g=>{const p=m.value.findIndex(E=>E.id===g);p>=0&&m.value.splice(p,1)},updateGanttBar:g=>{var E;const p=(E=a.value[g.rowIndex])==null?void 0:E.gantt;p&&(g.type==="resize"?g.edge==="start"?(p.startIndex=g.newStart,p.endIndex=g.end,p.colspan=p.endIndex-p.startIndex):g.edge==="end"&&(p.startIndex=g.start,p.endIndex=g.newEnd,p.colspan=p.endIndex-p.startIndex):g.type==="bar"&&(p.startIndex=g.newStart,p.endIndex=g.newEnd,p.colspan=p.endIndex-p.startIndex))}}})()},pn={class:"atable-container",style:{position:"relative"}},je=U(t.defineComponent({__name:"ATable",props:t.mergeModels({id:{},columns:{},config:{default:()=>new Object}},{modelValue:{required:!0},modelModifiers:{}}),emits:t.mergeModels(["cellUpdate","gantt:drag","connection:event"],["update:modelValue"]),setup(e,{expose:n,emit:o}){const r=t.useModel(e,"modelValue"),s=o,d=t.useTemplateRef("table"),a=Ye({columns:e.columns,rows:r.value,id:e.id,config:e.config});a.$onAction(({name:m,store:w,args:k,after:C})=>{if(m==="setCellData"||m==="setCellText"){const[f,b,v]=k,I=w.getCellData(f,b);C(()=>{r.value=[...w.rows],s("cellUpdate",{colIndex:f,rowIndex:b,newValue:v,oldValue:I})})}else if(m==="updateGanttBar"){const[f]=k;let b=!1;f.type==="resize"?b=f.oldColspan!==f.newColspan:f.type==="bar"&&(b=f.oldStart!==f.newStart||f.oldEnd!==f.newEnd),b&&C(()=>{s("gantt:drag",f)})}}),t.watch(()=>r.value,m=>{JSON.stringify(m)!==JSON.stringify(a.rows)&&(a.rows=[...m])},{deep:!0}),t.onMounted(()=>{e.columns.some(m=>m.pinned)&&(i(),a.isTreeView&&Le(d,i,{childList:!0,subtree:!0}))});const l=t.computed(()=>a.columns.filter(m=>m.pinned).length),i=()=>{const m=d.value,w=m==null?void 0:m.rows[0],k=m==null?void 0:m.rows[1],C=w?Array.from(w.cells):[];for(const[f,b]of C.entries()){const v=k==null?void 0:k.cells[f];v&&(b.style.width=`${v.offsetWidth}px`)}for(const f of(m==null?void 0:m.rows)||[]){let b=0;const v=[];for(const I of f.cells)(I.classList.contains("sticky-column")||I.classList.contains("sticky-index"))&&(I.style.left=`${b}px`,b+=I.offsetWidth,v.push(I));v.length>0&&v[v.length-1].classList.add("sticky-column-edge")}};window.addEventListener("keydown",m=>{if(m.key==="Escape"&&a.modal.visible){a.modal.visible=!1;const w=a.modal.parent;w&&t.nextTick().then(()=>{w.focus()})}});const c=m=>{var k;if(!m.gantt||l.value===0)return a.columns;const w=[];for(let C=0;C<l.value;C++){const f={...a.columns[C]};f.originalIndex=C,w.push(f)}return w.push({...a.columns[l.value],isGantt:!0,colspan:((k=m.gantt)==null?void 0:k.colspan)||a.columns.length-l.value,originalIndex:l.value,width:"auto"}),w},u=m=>{s("connection:event",{type:"create",connection:m})},x=m=>{s("connection:event",{type:"delete",connection:m})};return n({store:a,createConnection:a.createConnection,deleteConnection:a.deleteConnection,getConnectionsForBar:a.getConnectionsForBar,getHandlesForBar:a.getHandlesForBar}),(m,w)=>(t.openBlock(),t.createElementBlock("div",pn,[t.withDirectives((t.openBlock(),t.createElementBlock("table",{ref:"table",class:"atable",style:t.normalizeStyle({width:t.unref(a).config.fullWidth?"100%":"auto"})},[t.renderSlot(m.$slots,"header",{data:t.unref(a)},()=>[t.createVNode(Ee,{columns:t.unref(a).columns,store:t.unref(a)},null,8,["columns","store"])],!0),t.createElementVNode("tbody",null,[t.renderSlot(m.$slots,"body",{data:t.unref(a)},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).rows,(k,C)=>(t.openBlock(),t.createBlock(xe,{key:k.id,row:k,rowIndex:C,store:t.unref(a)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c(k),(f,b)=>{var v,I,V;return t.openBlock(),t.createElementBlock(t.Fragment,{key:f.name},[f.isGantt?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.ganttComponent||"AGanttCell"),{key:0,store:t.unref(a),columnsCount:t.unref(a).columns.length-l.value,color:(v=k.gantt)==null?void 0:v.color,start:(I=k.gantt)==null?void 0:I.startIndex,end:(V=k.gantt)==null?void 0:V.endIndex,colspan:f.colspan,pinned:f.pinned,rowIndex:C,colIndex:f.originalIndex??b,style:t.normalizeStyle({textAlign:(f==null?void 0:f.align)||"center",minWidth:(f==null?void 0:f.width)||"40ch",width:t.unref(a).config.fullWidth?"auto":null}),"onConnection:create":u},null,40,["store","columnsCount","color","start","end","colspan","pinned","rowIndex","colIndex","style"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.cellComponent||"ACell"),{key:1,store:t.unref(a),pinned:f.pinned,rowIndex:C,colIndex:b,style:t.normalizeStyle({textAlign:(f==null?void 0:f.align)||"center",width:t.unref(a).config.fullWidth?"auto":null}),spellcheck:"false"},null,8,["store","pinned","rowIndex","colIndex","style"]))],64)}),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),t.renderSlot(m.$slots,"footer",{data:t.unref(a)},void 0,!0),t.renderSlot(m.$slots,"modal",{data:t.unref(a)},()=>[t.withDirectives(t.createVNode(Ie,{store:t.unref(a)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(a).modal.component),t.mergeProps({key:`${t.unref(a).modal.rowIndex}:${t.unref(a).modal.colIndex}`,colIndex:t.unref(a).modal.colIndex,rowIndex:t.unref(a).modal.rowIndex,store:t.unref(a)},t.unref(a).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[t.vShow,t.unref(a).modal.visible]])],!0)],4)),[[t.unref(Kt),t.unref(a).closeModal]]),t.unref(a).isGanttView?(t.openBlock(),t.createBlock(fn,{key:0,store:t.unref(a),"onConnection:delete":x},null,8,["store"])):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8533f0fc"]]),hn={},bn={class:"aloading"},wn={class:"aloading-header"};function xn(e,n){return t.openBlock(),t.createElementBlock("div",bn,[t.createElementVNode("h2",wn,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),n[0]||(n[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Ue=U(hn,[["render",xn],["__scopeId","data-v-a930a25b"]]),vn={},yn={class:"aloading"},kn={class:"aloading-header"};function Cn(e,n){return t.openBlock(),t.createElementBlock("div",yn,[t.createElementVNode("h2",kn,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),n[0]||(n[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const qe=U(vn,[["render",Cn],["__scopeId","data-v-e1165876"]]);function En(e){e.component("ACell",Pe),e.component("AExpansionRow",Oe),e.component("AGanttCell",Ne),e.component("ARow",xe),e.component("ATable",je),e.component("ATableHeader",Ee),e.component("ATableLoading",Ue),e.component("ATableLoadingBar",qe),e.component("ATableModal",Ie)}T.ACell=Pe,T.AExpansionRow=Oe,T.AGanttCell=Ne,T.ARow=xe,T.ATable=je,T.ATableHeader=Ee,T.ATableLoading=Ue,T.ATableLoadingBar=qe,T.ATableModal=Ie,T.createTableStore=Ye,T.install=En,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A["@stonecrop/atable"]={},A.Vue,A.pinia))})(this,function(A,t,lt){"use strict";var $e=document.createElement("style");$e.textContent=`@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap";.atable-cell{border-radius:0;box-sizing:border-box;margin:0;outline:none;box-shadow:none;color:var(--sc-cell-text-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);border-spacing:0px;border-collapse:collapse;overflow:hidden;text-overflow:ellipsis;order:1;white-space:nowrap;max-width:40ch;border-top:1px solid var(--sc-row-border-color)}.atable-cell a{color:var(--sc-cell-text-color);text-decoration:none}.atable-cell:focus,.atable-cell:focus-within{background-color:var(--sc-focus-cell-background);outline-width:var(--sc-atable-cell-border-width);outline-style:solid;outline-offset:calc(var(--sc-atable-cell-border-width) * -1);outline-color:var(--sc-focus-cell-outline);box-shadow:none;overflow:hidden;text-wrap:nowrap;box-sizing:border-box}.cell-modified{font-weight:700;font-style:italic}.cell-modified-highlight{background-color:var(--sc-cell-changed-color)}.row-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;display:flex;align-items:center;justify-content:center}.expandable-row{border-top:1px solid var(--sc-row-border-color);height:var(--sc-atable-row-height)}.expandable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.expanded-row{border-left:2px solid var(--sc-row-border-color)}.expandable-row:last-child{border-bottom:1px solid var(--sc-row-border-color)}.expanded-row-content{border-top:1px solid var(--sc-row-border-color);padding:1.5rem}.expandable-row.changed-row-gradient[data-v-5ad4bb41]:has(td.cell-modified){--cell-color-start: color-mix(in srgb, var(--sc-cell-changed-color), #fff 20%);--cell-color-end: color-mix(in srgb, var(--sc-cell-changed-color), #fff 60%);background:linear-gradient(90deg,var(--cell-color-start),var(--cell-color-end))}.aganttcell[data-v-a77cc6d2]{background-color:#f9f9f9;width:100%;padding:0;height:100%}.gantt-container[data-v-a77cc6d2]{position:relative;height:100%;background-color:#f0f0f0;border-radius:4px;overflow:visible}.gantt-bar[data-v-a77cc6d2]{position:absolute;border-radius:4px;display:flex;align-items:center;justify-content:space-between;cursor:grab;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);transition:left .1s ease-out,width .1s ease-out;height:80%;top:50%;z-index:2;transform:translateY(-50%)}.gantt-bar[data-v-a77cc6d2]:active{cursor:grabbing}.gantt-bar.is-dragging[data-v-a77cc6d2]{z-index:10}.gantt-label[data-v-a77cc6d2]{flex:1;text-align:center;font-size:12px;color:#aaa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px;-webkit-user-select:none;user-select:none}.resize-handle[data-v-a77cc6d2]{position:relative;width:12px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center;z-index:0;background:#00000040}.left-resize-handle[data-v-a77cc6d2]{border-right:1px solid rgba(0,0,0,.5)}.right-resize-handle[data-v-a77cc6d2]{border-left:1px solid rgba(0,0,0,.5)}.handle-grip[data-v-a77cc6d2]{width:4px;height:12px;border-radius:2px;background:#000c}.resize-handle[data-v-a77cc6d2]:hover{background-color:#ffffff80}.vertical-indicator[data-v-a77cc6d2]{position:absolute;width:2px;opacity:0;pointer-events:none;transition:opacity .2s ease;top:-100vh;height:100vh;z-index:5;background-color:var(--52017849)}.left-indicator[data-v-a77cc6d2]{left:50%;transform:translate(-50%)}.right-indicator[data-v-a77cc6d2]{right:50%;transform:translate(50%)}.resize-handle.is-dragging .vertical-indicator[data-v-a77cc6d2]{opacity:.7}.gantt-container[data-v-a77cc6d2]:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-size:calc(100% / var(--0d200c71)) 100%;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px);pointer-events:none;z-index:1}.connection-handle[data-v-a77cc6d2]{position:absolute;top:50%;transform:translateY(-50%);width:16px;height:16px;opacity:0;transition:opacity .2s ease;cursor:crosshair;z-index:15;display:flex;align-items:center;justify-content:center}.connection-handle.visible[data-v-a77cc6d2]{opacity:1}.left-connection-handle[data-v-a77cc6d2]{left:-16px}.right-connection-handle[data-v-a77cc6d2]{right:-16px}.connection-dot[data-v-a77cc6d2]{width:8px;height:8px;border-radius:50%;background-color:#2196f3;border:2px solid white;box-shadow:0 1px 3px #0000004d}.connection-handle:hover .connection-dot[data-v-a77cc6d2]{background-color:#1976d2;transform:scale(1.2)}.connection-handle.is-dragging[data-v-a77cc6d2]{opacity:1!important}.connection-handle.is-dragging .connection-dot[data-v-a77cc6d2]{background-color:#1976d2;transform:scale(1.3);box-shadow:0 2px 8px #2196f366}.atable-row{background-color:#fff}.atable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.list-index{color:var(--sc-header-text-color);font-weight:700;padding-left:var(--sc-atable-row-padding);padding-right:.5em;text-align:left;-webkit-user-select:none;user-select:none;width:7ch;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.tree-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;box-sizing:border-box;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.atable-row:has(td.cell-modified)>td.sticky-column,.atable-row:has(td.cell-modified)>th.sticky-column,.atable-row:has(td.cell-modified)>td.sticky-index,.atable-row:has(td.cell-modified)>th.sticky-index{background:var(--sc-cell-changed-color)}.atable-row.changed-row-gradient[data-v-c554ee0f]:has(td.cell-modified){--cell-color-start: color-mix(in srgb, var(--sc-cell-changed-color), #fff 20%);--cell-color-end: color-mix(in srgb, var(--sc-cell-changed-color), #fff 60%);background:linear-gradient(90deg,var(--cell-color-start),var(--cell-color-end))}.gantt-connection-overlay[data-v-955111b6]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1}.connection-path[data-v-955111b6]{transition:stroke-width .2s ease;pointer-events:auto;cursor:pointer;stroke-dasharray:5px;stroke:var(--sc-cell-text-color)}#arrowhead-marker polygon[data-v-955111b6]{fill:var(--sc-cell-text-color)}.animated-path[data-v-955111b6]{animation:animated-dash-955111b6 infinite 1.5s linear}.connection-path[data-v-955111b6]:hover{stroke-width:3px}.connection-hitbox[data-v-955111b6]{pointer-events:auto;cursor:pointer}@keyframes animated-dash-955111b6{0%{stroke-dashoffset:0px}to{stroke-dashoffset:-10px}}.atable-header-row th{padding-left:.5ch!important;font-weight:700;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);box-sizing:border-box;color:var(--sc-header-text-color);position:relative}#header-index{padding-left:var(--sc-atable-row-padding);box-sizing:border-box}.tree-index{padding-right:0}th{order:1}.list-expansion-index{width:2ch;margin-left:5px}:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.amodal{position:absolute;background-color:var(--sc-row-color-zebra-dark);z-index:5}.atable-container{position:relative}.sticky-index{position:sticky;left:0;z-index:10;order:0}.sticky-column,th.sticky-column,td.sticky-column,th.sticky-index,td.sticky-index{position:sticky;z-index:10;order:0;background:#fff}.sticky-column-edge,.atable th.sticky-column-edge{border-right:1px solid var(--sc-row-border-color)}[data-v-8533f0fc]:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.atable[data-v-8533f0fc]{position:relative;font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);border-collapse:collapse;box-sizing:border-box;table-layout:auto;width:auto;overflow:clip;height:1px}.atable th[data-v-8533f0fc]{border-width:0px;border-style:solid;border-radius:0;padding-left:.5ch;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);color:var(--sc-gray-60);height:var(--sc-atable-row-height);font-weight:300;letter-spacing:.05rem;order:1;box-sizing:border-box}.atable th[data-v-8533f0fc]:focus{outline:none}.atable[data-v-8533f0fc]:tbody{overflow:hidden;position:relative}.atable[data-v-8533f0fc]:tbody:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:transparent;z-index:100}.aloading[data-v-a930a25b]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-a930a25b]{width:100%;height:100%;position:absolute;left:-100%;top:0;background:linear-gradient(90deg,rgba(var(--sc-table-loading-color),0),rgba(var(--sc-table-loading-color),1),rgba(var(--sc-table-loading-color),0));animation:gradient-a930a25b infinite 2s;z-index:0}.aloading-header[data-v-a930a25b]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-a930a25b]:after{content:"...";animation:ellipse-a930a25b 2s;animation-iteration-count:infinite}@keyframes gradient-a930a25b{0%{left:-100%}to{left:100%}}@keyframes ellipse-a930a25b{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}.aloading[data-v-e1165876]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-e1165876]{width:50%;height:3px;position:absolute;left:-100%;bottom:0;background:var(--sc-row-border-color);animation:bar-left-e1165876 infinite 2s;z-index:0}.aloading-header[data-v-e1165876]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-e1165876]:after{content:"...";animation:ellipse-e1165876 2s;animation-iteration-count:infinite}@keyframes bar-left-e1165876{0%{left:-50%}to{left:100%}}@keyframes ellipse-e1165876{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild($e);function ce(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const rt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const it=e=>e!=null,st=Object.prototype.toString,ct=e=>st.call(e)==="[object Object]",dt=()=>{};function ne(e){return Array.isArray(e)?e:[e]}function ft(e,n,o){return t.watch(e,n,{...o,immediate:!0})}const U=rt?window:void 0;function q(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function Q(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,f,m)=>(l.addEventListener(i,f,m),()=>l.removeEventListener(i,f,m)),c=t.computed(()=>{const l=ne(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=ft(()=>{var l,i;return[(i=(l=c.value)==null?void 0:l.map(f=>q(f)))!=null?i:[U].filter(f=>f!=null),ne(t.toValue(c.value?e[1]:e[0])),ne(t.unref(c.value?e[2]:e[1])),t.toValue(c.value?e[3]:e[2])]},([l,i,f,m])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(f!=null&&f.length))return;const b=ct(m)?{...m}:m;n.push(...l.flatMap(p=>i.flatMap(v=>f.map(k=>r(p,v,k,b)))))},{flush:"post"}),a=()=>{d(),o()};return ce(o),a}function ut(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function mt(e){const n=ut();return t.computed(()=>(n.value,!!e()))}function gt(e,n,o={}){const{window:r=U,...c}=o;let d;const a=mt(()=>r&&"MutationObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const p=t.toValue(e),v=ne(p).map(q).filter(it);return new Set(v)}),f=t.watch(()=>i.value,p=>{l(),a.value&&p.size&&(d=new MutationObserver(n),p.forEach(v=>d.observe(v,c)))},{immediate:!0,flush:"post"}),m=()=>d==null?void 0:d.takeRecords(),b=()=>{f(),l()};return ce(b),{isSupported:a,stop:b,takeRecords:m}}function pt(e,n,o={}){const{window:r=U,document:c=r==null?void 0:r.document,flush:d="sync"}=o;if(!r||!c)return dt;let a;const l=m=>{a==null||a(),a=m},i=t.watchEffect(()=>{const m=q(e);if(m){const{stop:b}=gt(c,p=>{p.map(v=>[...v.removedNodes]).flat().some(v=>v===m||v.contains(m))&&n(p)},{window:r,childList:!0,subtree:!0});l(b)}},{flush:d}),f=()=>{i(),l()};return ce(f),f}function ht(e={}){var n;const{window:o=U,deep:r=!0,triggerOnRemoval:c=!1}=e,d=(n=e.document)!=null?n:o==null?void 0:o.document,a=()=>{var f;let m=d==null?void 0:d.activeElement;if(r)for(;m!=null&&m.shadowRoot;)m=(f=m==null?void 0:m.shadowRoot)==null?void 0:f.activeElement;return m},l=t.shallowRef(),i=()=>{l.value=a()};if(o){const f={capture:!0,passive:!0};Q(o,"blur",m=>{m.relatedTarget===null&&i()},f),Q(o,"focus",i,f)}return c&&pt(l,i,{document:d}),i(),l}const bt="focusin",wt="focusout",vt=":focus-within";function xt(e,n={}){const{window:o=U}=n,r=t.computed(()=>q(e)),c=t.shallowRef(!1),d=t.computed(()=>c.value),a=ht(n);if(!o||!a.value)return{focused:d};const l={passive:!0};return Q(r,bt,()=>c.value=!0,l),Q(r,wt,()=>{var i,f,m;return c.value=(m=(f=(i=r.value)==null?void 0:i.matches)==null?void 0:f.call(i,vt))!=null?m:!1},l),{focused:d}}function yt(e,{window:n=U,scrollTarget:o}={}){const r=t.ref(!1),c=()=>{if(!n)return;const d=n.document,a=q(e);if(!a)r.value=!1;else{const l=a.getBoundingClientRect();r.value=l.top<=(n.innerHeight||d.documentElement.clientHeight)&&l.left<=(n.innerWidth||d.documentElement.clientWidth)&&l.bottom>=0&&l.right>=0}};return t.watch(()=>q(e),()=>c(),{immediate:!0,flush:"post"}),n&&Q(o||n,"scroll",c,{capture:!1,passive:!0}),r}const P=e=>{let n=yt(e).value;return n=n&&e.offsetHeight>0,n},N=e=>e.tabIndex>=0,Re=e=>{const n=e.target;return de(n)},de=e=>{var n;let o;if(e instanceof HTMLTableCellElement){const r=(n=e.parentElement)==null?void 0:n.previousElementSibling;if(r){const c=Array.from(r.children)[e.cellIndex];c&&(o=c)}}else if(e instanceof HTMLTableRowElement){const r=e.previousElementSibling;r&&(o=r)}return o&&(!N(o)||!P(o))?de(o):o},kt=e=>{var n;const o=e.target;let r;if(o instanceof HTMLTableCellElement){const c=(n=o.parentElement)==null?void 0:n.parentElement;if(c){const d=c.firstElementChild,a=d==null?void 0:d.children[o.cellIndex];a&&(r=a)}}else if(o instanceof HTMLTableRowElement){const c=o.parentElement;if(c){const d=c.firstElementChild;d&&(r=d)}}return r&&(!N(r)||!P(r))?fe(r):r},ze=e=>{const n=e.target;return fe(n)},fe=e=>{var n;let o;if(e instanceof HTMLTableCellElement){const r=(n=e.parentElement)==null?void 0:n.nextElementSibling;if(r){const c=Array.from(r.children)[e.cellIndex];c&&(o=c)}}else if(e instanceof HTMLTableRowElement){const r=e.nextElementSibling;r&&(o=r)}return o&&(!N(o)||!P(o))?fe(o):o},Ct=e=>{var n;const o=e.target;let r;if(o instanceof HTMLTableCellElement){const c=(n=o.parentElement)==null?void 0:n.parentElement;if(c){const d=c.lastElementChild,a=d==null?void 0:d.children[o.cellIndex];a&&(r=a)}}else if(o instanceof HTMLTableRowElement){const c=o.parentElement;if(c){const d=c.lastElementChild;d&&(r=d)}}return r&&(!N(r)||!P(r))?de(r):r},Me=e=>{const n=e.target;return ue(n)},ue=e=>{var n;let o;if(e.previousElementSibling)o=e.previousElementSibling;else{const r=(n=e.parentElement)==null?void 0:n.previousElementSibling;o=r==null?void 0:r.lastElementChild}return o&&(!N(o)||!P(o))?ue(o):o},Ve=e=>{const n=e.target;return me(n)},me=e=>{var n;let o;if(e.nextElementSibling)o=e.nextElementSibling;else{const r=(n=e.parentElement)==null?void 0:n.nextElementSibling;o=r==null?void 0:r.firstElementChild}return o&&(!N(o)||!P(o))?me(o):o},Ae=e=>{const n=e.target.parentElement,o=n==null?void 0:n.firstElementChild;return o&&(!N(o)||!P(o))?me(o):o},Te=e=>{const n=e.target.parentElement,o=n==null?void 0:n.lastElementChild;return o&&(!N(o)||!P(o))?ue(o):o},oe=["alt","control","shift","meta"],Et={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ge={"keydown.up":e=>{const n=Re(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.down":e=>{const n=ze(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.left":e=>{const n=Me(e);e.preventDefault(),e.stopPropagation(),n&&n.focus()},"keydown.right":e=>{const n=Ve(e);e.preventDefault(),e.stopPropagation(),n&&n.focus()},"keydown.control.up":e=>{const n=kt(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.down":e=>{const n=Ct(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.left":e=>{const n=Ae(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.control.right":e=>{const n=Te(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.end":e=>{const n=Te(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const n=ze(e);n&&n.focus()}},"keydown.shift.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const n=Re(e);n&&n.focus()}},"keydown.home":e=>{const n=Ae(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.tab":e=>{const n=Ve(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())},"keydown.shift.tab":e=>{const n=Me(e);n&&(e.preventDefault(),e.stopPropagation(),n.focus())}};function pe(e){const n=a=>{let l=null;return a.parent&&(typeof a.parent=="string"?l=document.querySelector(a.parent):a.parent instanceof HTMLElement?l=a.parent:l=a.parent.value),l},o=a=>{var l;const i=n(a);let f=[];if(typeof a.selectors=="string")f=i?Array.from(i.querySelectorAll(a.selectors)):Array.from(document.querySelectorAll(a.selectors));else if(Array.isArray(a.selectors))for(const m of a.selectors)m instanceof HTMLElement?f.push(m):f.push(m.$el);else if(a.selectors instanceof HTMLElement)f.push(a.selectors);else if((l=a.selectors)!=null&&l.value)if(Array.isArray(a.selectors.value))for(const m of a.selectors.value)m instanceof HTMLElement?f.push(m):f.push(m.$el);else f.push(a.selectors.value);return f},r=a=>{const l=n(a);let i=[];return a.selectors?i=o(a):l&&(i=Array.from(l.children).filter(f=>N(f)&&P(f))),i},c=a=>l=>{const i=Et[l.key]||l.key.toLowerCase();if(oe.includes(i))return;const f=a.handlers||ge;for(const m of Object.keys(f)){const[b,...p]=m.split(".");if(b==="keydown"&&p.includes(i)){const v=f[m],k=p.filter(u=>oe.includes(u)),C=oe.some(u=>{const w=u.charAt(0).toUpperCase()+u.slice(1);return l.getModifierState(w)});if(k.length>0){if(C){for(const u of oe)if(p.includes(u)){const w=u.charAt(0).toUpperCase()+u.slice(1);l.getModifierState(w)&&v(l)}}}else C||v(l)}}},d=[];t.onMounted(()=>{for(const a of e){const l=n(a),i=r(a),f=c(a),m=l?[l]:i;for(const b of m){const{focused:p}=xt(t.ref(b)),v=t.watch(p,k=>{k?b.addEventListener("keydown",f):b.removeEventListener("keydown",f)});d.push(v)}}}),t.onBeforeUnmount(()=>{for(const a of d)a()})}function J(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const ae=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const It=e=>e!=null,St=Object.prototype.toString,De=e=>St.call(e)==="[object Object]",W=()=>{},he=Bt();function Bt(){var e,n;return ae&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function $t(...e){if(e.length!==1)return t.toRef(...e);const n=e[0];return typeof n=="function"?t.readonly(t.customRef(()=>({get:n,set:W}))):t.ref(n)}function Rt(e,n){function o(...r){return new Promise((c,d)=>{Promise.resolve(e(()=>n.apply(this,r),{fn:n,thisArg:this,args:r})).then(c).catch(d)})}return o}function zt(e,n={}){let o,r,c=W;const d=i=>{clearTimeout(i),c(),c=W};let a;return i=>{const f=t.toValue(e),m=t.toValue(n.maxWait);return o&&d(o),f<=0||m!==void 0&&m<=0?(r&&(d(r),r=void 0),Promise.resolve(i())):new Promise((b,p)=>{c=n.rejectOnCancel?p:b,a=i,m&&!r&&(r=setTimeout(()=>{o&&d(o),r=void 0,b(a())},m)),o=setTimeout(()=>{r&&d(r),r=void 0,b(i())},f)})}}function F(e){return Array.isArray(e)?e:[e]}function Mt(e){return t.getCurrentInstance()}function Vt(e,n=200,o={}){return Rt(zt(n,o),e)}function At(e,n={}){if(!t.isRef(e))return t.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)o[r]=t.customRef(()=>({get(){return e.value[r]},set(c){var d;if((d=t.toValue(n.replaceRef))!=null?d:!0)if(Array.isArray(e.value)){const l=[...e.value];l[r]=c,e.value=l}else{const l={...e.value,[r]:c};Object.setPrototypeOf(l,Object.getPrototypeOf(e.value)),e.value=l}else e.value[r]=c}}));return o}function Tt(e,n=!0,o){Mt()?t.onMounted(e,o):n?e():t.nextTick(e)}function Oe(e,n,o){return t.watch(e,n,{...o,immediate:!0})}const le=ae?window:void 0;function Z(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function K(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,f,m)=>(l.addEventListener(i,f,m),()=>l.removeEventListener(i,f,m)),c=t.computed(()=>{const l=F(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=Oe(()=>{var l,i;return[(i=(l=c.value)==null?void 0:l.map(f=>Z(f)))!=null?i:[le].filter(f=>f!=null),F(t.toValue(c.value?e[1]:e[0])),F(t.unref(c.value?e[2]:e[1])),t.toValue(c.value?e[3]:e[2])]},([l,i,f,m])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(f!=null&&f.length))return;const b=De(m)?{...m}:m;n.push(...l.flatMap(p=>i.flatMap(v=>f.map(k=>r(p,v,k,b)))))},{flush:"post"}),a=()=>{d(),o()};return J(o),a}function Dt(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function He(e){const n=Dt();return t.computed(()=>(n.value,!!e()))}function Le(e,n,o={}){const{window:r=le,...c}=o;let d;const a=He(()=>r&&"MutationObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const p=t.toValue(e),v=F(p).map(Z).filter(It);return new Set(v)}),f=t.watch(()=>i.value,p=>{l(),a.value&&p.size&&(d=new MutationObserver(n),p.forEach(v=>d.observe(v,c)))},{immediate:!0,flush:"post"}),m=()=>d==null?void 0:d.takeRecords(),b=()=>{f(),l()};return J(b),{isSupported:a,stop:b,takeRecords:m}}function be(e,n={}){var o;const{pointerTypes:r,preventDefault:c,stopPropagation:d,exact:a,onMove:l,onEnd:i,onStart:f,initialValue:m,axis:b="both",draggingElement:p=le,containerElement:v,handle:k=e,buttons:C=[0]}=n,u=t.ref((o=t.toValue(m))!=null?o:{x:0,y:0}),w=t.ref(),x=S=>r?r.includes(S.pointerType):!0,E=S=>{t.toValue(c)&&S.preventDefault(),t.toValue(d)&&S.stopPropagation()},M=S=>{var R;if(!t.toValue(C).includes(S.button)||t.toValue(n.disabled)||!x(S)||t.toValue(a)&&S.target!==t.toValue(e))return;const T=t.toValue(v),L=(R=T==null?void 0:T.getBoundingClientRect)==null?void 0:R.call(T),z=t.toValue(e).getBoundingClientRect(),X={x:S.clientX-(T?z.left-L.left+T.scrollLeft:z.left),y:S.clientY-(T?z.top-L.top+T.scrollTop:z.top)};(f==null?void 0:f(X,S))!==!1&&(w.value=X,E(S))},D=S=>{if(t.toValue(n.disabled)||!x(S)||!w.value)return;const R=t.toValue(v),T=t.toValue(e).getBoundingClientRect();let{x:L,y:z}=u.value;(b==="x"||b==="both")&&(L=S.clientX-w.value.x,R&&(L=Math.min(Math.max(0,L),R.scrollWidth-T.width))),(b==="y"||b==="both")&&(z=S.clientY-w.value.y,R&&(z=Math.min(Math.max(0,z),R.scrollHeight-T.height))),u.value={x:L,y:z},l==null||l(u.value,S),E(S)},$=S=>{t.toValue(n.disabled)||!x(S)||w.value&&(w.value=void 0,i==null||i(u.value,S),E(S))};if(ae){const S=()=>{var R;return{capture:(R=n.capture)!=null?R:!0,passive:!t.toValue(c)}};K(k,"pointerdown",M,S),K(p,"pointermove",D,S),K(p,"pointerup",$,S)}return{...At(u),position:u,isDragging:t.computed(()=>!!w.value),style:t.computed(()=>`left:${u.value.x}px;top:${u.value.y}px;`)}}function Ot(e,n,o={}){const{window:r=le,...c}=o;let d;const a=He(()=>r&&"ResizeObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const b=t.toValue(e);return Array.isArray(b)?b.map(p=>Z(p)):[Z(b)]}),f=t.watch(i,b=>{if(l(),a.value&&r){d=new ResizeObserver(n);for(const p of b)p&&d.observe(p,c)}},{immediate:!0,flush:"post"}),m=()=>{l(),f()};return J(m),{isSupported:a,stop:m}}function G(e,n={}){const{reset:o=!0,windowResize:r=!0,windowScroll:c=!0,immediate:d=!0,updateTiming:a="sync"}=n,l=t.shallowRef(0),i=t.shallowRef(0),f=t.shallowRef(0),m=t.shallowRef(0),b=t.shallowRef(0),p=t.shallowRef(0),v=t.shallowRef(0),k=t.shallowRef(0);function C(){const w=Z(e);if(!w){o&&(l.value=0,i.value=0,f.value=0,m.value=0,b.value=0,p.value=0,v.value=0,k.value=0);return}const x=w.getBoundingClientRect();l.value=x.height,i.value=x.bottom,f.value=x.left,m.value=x.right,b.value=x.top,p.value=x.width,v.value=x.x,k.value=x.y}function u(){a==="sync"?C():a==="next-frame"&&requestAnimationFrame(()=>C())}return Ot(e,u),t.watch(()=>Z(e),w=>!w&&u()),Le(e,u,{attributeFilter:["style","class"]}),c&&K("scroll",u,{capture:!0,passive:!0}),r&&K("resize",u,{passive:!0}),Tt(()=>{d&&u()}),{height:l,bottom:i,left:f,right:m,top:b,width:p,x:v,y:k,update:u}}const Ht=e=>{const n=new DOMParser().parseFromString(e,"text/html");return Array.from(n.body.childNodes).some(o=>o.nodeType===1)},Lt=(e=8)=>Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(""),Pt=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],Nt=["innerHTML"],Wt={key:2},Pe=t.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean,default:!1},debounce:{default:300}},setup(e,{expose:n}){const o=t.useTemplateRef("cell"),r=e.store.getCellData(e.colIndex,e.rowIndex),c=t.ref(""),d=t.ref(!1),a=e.store.columns[e.colIndex],l=e.store.rows[e.rowIndex],i=a.align||"center",f=a.width||"40ch",m=t.computed(()=>e.store.getCellDisplayValue(e.colIndex,e.rowIndex)),b=t.computed(()=>typeof m.value=="string"?Ht(m.value):!1),p=t.computed(()=>{var x;return{textAlign:i,width:f,fontWeight:d.value?"bold":"inherit",paddingLeft:e.store.getIndent(e.colIndex,(x=e.store.display[e.rowIndex])==null?void 0:x.indent)}}),v=t.computed(()=>({"sticky-column":e.pinned,"cell-modified":d.value})),k=()=>{const{left:x,bottom:E,width:M,height:D}=G(o);a.mask,a.modalComponent&&e.store.$patch($=>{$.modal.visible=!0,$.modal.colIndex=e.colIndex,$.modal.rowIndex=e.rowIndex,$.modal.left=x,$.modal.bottom=E,$.modal.width=M,$.modal.height=D,$.modal.cell=o.value,typeof a.modalComponent=="function"?$.modal.component=a.modalComponent({table:$.table,row:l,column:a}):$.modal.component=a.modalComponent,$.modal.componentProps=a.modalComponentExtraProps})};if(e.addNavigation){let x={...ge,"keydown.f2":k,"keydown.alt.up":k,"keydown.alt.down":k,"keydown.alt.left":k,"keydown.alt.right":k};typeof e.addNavigation=="object"&&(x={...x,...e.addNavigation}),pe([{selectors:o,handlers:x}])}const C=()=>{o.value&&(c.value=o.value.textContent)},u=x=>{const E=x.target;E.textContent!==c.value&&(c.value=E.textContent,a.format?(d.value=E.textContent!==e.store.getFormattedValue(e.colIndex,e.rowIndex,r),e.store.setCellText(e.colIndex,e.rowIndex,E.textContent)):(d.value=E.textContent!==r,e.store.setCellData(e.colIndex,e.rowIndex,E.textContent)))},w=Vt(u,e.debounce);return n({currentData:c}),(x,E)=>(t.openBlock(),t.createElementBlock("td",{ref:"cell","data-colindex":x.colIndex,"data-rowindex":x.rowIndex,"data-editable":t.unref(a).edit,contenteditable:t.unref(a).edit,tabindex:x.tabIndex,spellcheck:!1,style:t.normalizeStyle(p.value),onFocus:C,onPaste:u,onInput:E[0]||(E[0]=(...M)=>t.unref(w)&&t.unref(w)(...M)),onClick:k,class:t.normalizeClass(["atable-cell",v.value])},[t.unref(a).cellComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(a).cellComponent),t.mergeProps({key:0,value:m.value},t.unref(a).cellComponentProps),null,16,["value"])):b.value?(t.openBlock(),t.createElementBlock("span",{key:1,innerHTML:m.value},null,8,Nt)):(t.openBlock(),t.createElementBlock("span",Wt,t.toDisplayString(m.value),1))],46,Pt))}}),Xt=["tabindex"],Ft=["tabindex"],Gt=["colspan"],Yt=t.defineComponent({__name:"AExpansionRow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object]}},setup(e){const n=t.useTemplateRef("rowEl"),o=t.computed(()=>e.store.display[e.rowIndex].expanded?"▼":"►");if(e.addNavigation){const r={"keydown.control.g":c=>{c.stopPropagation(),c.preventDefault(),e.store.toggleRowExpand(e.rowIndex)}};typeof e.addNavigation=="object"&&Object.assign(r,e.addNavigation),pe([{selectors:n,handlers:r}])}return(r,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("tr",t.mergeProps(r.$attrs,{ref:"rowEl",tabindex:r.tabIndex,class:"expandable-row"}),[t.createElementVNode("td",{tabIndex:-1,onClick:c[0]||(c[0]=d=>r.store.toggleRowExpand(r.rowIndex)),class:"row-index"},t.toDisplayString(o.value),1),t.renderSlot(r.$slots,"row",{},void 0,!0)],16,Xt),r.store.display[r.rowIndex].expanded?(t.openBlock(),t.createElementBlock("tr",{key:0,ref:"rowExpanded",tabindex:r.tabIndex,class:"expanded-row"},[t.createElementVNode("td",{tabIndex:-1,colspan:r.store.columns.length+1,class:"expanded-row-content"},[t.renderSlot(r.$slots,"content",{},void 0,!0)],8,Gt)],8,Ft)):t.createCommentVNode("",!0)],64))}}),Y=(e,n)=>{const o=e.__vccOpts||e;for(const[r,c]of n)o[r]=c;return o},Ne=Y(Yt,[["__scopeId","data-v-5ad4bb41"]]),jt=["colspan"],Ut={ref:"container",class:"gantt-container"},qt=["data-rowindex","data-colindex"],Jt={key:0,class:"gantt-label"},Zt=["x1","y1","x2","y2"],We=Y(t.defineComponent({__name:"AGanttCell",props:{store:{},columnsCount:{},rowIndex:{},colIndex:{},start:{default:0},end:{},colspan:{default:1},label:{},color:{default:"#cccccc"}},emits:["connection:create"],setup(e,{expose:n,emit:o}){t.useCssVars(s=>({52017849:c.value,"0d200c71":s.colspan}));const r=o,c=t.ref(e.color.length>=6?e.color:"#cccccc"),d=`gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`,a=t.useTemplateRef("container"),l=t.useTemplateRef("bar"),i=t.useTemplateRef("leftResizeHandle"),f=t.useTemplateRef("rightResizeHandle"),m=t.useTemplateRef("leftConnectionHandle"),b=t.useTemplateRef("rightConnectionHandle"),{width:p}=G(a),{left:v,right:k}=G(l),C=t.ref(e.start),u=t.ref(e.end||C.value+e.colspan),w=t.ref(!1),x=t.ref(!1),E=t.ref(!1),M=t.ref(!1),D=t.ref(!1),$=t.ref({startX:0,startY:0,endX:0,endY:0}),S=t.computed(()=>ee.value||X.value||_.value),R=t.computed(()=>e.colspan>0?p.value/e.colspan:0),T=t.computed(()=>{const s=C.value/e.colspan*100,h=u.value/e.colspan*100;return{left:`${s}%`,width:`${h-s}%`,backgroundColor:c.value}}),L=t.computed(()=>({position:"fixed",top:0,left:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:1e3})),z=t.ref({startX:0,startPos:0}),{isDragging:X}=be(i,{axis:"x",onStart:()=>te(v.value,C.value),onMove:({x:s})=>se(s),onEnd:({x:s})=>Ze(s)}),{isDragging:_}=be(f,{axis:"x",onStart:()=>te(k.value,u.value),onMove:({x:s})=>Qe(s),onEnd:({x:s})=>Ke(s)}),{isDragging:ee}=be(l,{exact:!0,axis:"x",onStart:()=>te(v.value,C.value),onMove:({x:s})=>_e(s),onEnd:({x:s})=>et(s)});t.onMounted(()=>{tt()}),t.onUnmounted(()=>{nt()});function te(s,h){l.value&&(l.value.style.transition="none"),z.value={startX:s,startPos:h}}function se(s){if(!X.value||!l.value)return;const y=(s-z.value.startX)/R.value,I=Math.max(0,Math.min(u.value-1,z.value.startPos+y));l.value.style.left=`${I/e.colspan*100}%`,l.value.style.width=`${(u.value-I)/e.colspan*100}%`}function Ze(s){if(!l.value)return;const h=s-z.value.startX,y=Math.round(h/R.value),I=C.value,B=Math.max(0,Math.min(u.value-1,z.value.startPos+y));C.value=B,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"resize",edge:"start",oldStart:I,newStart:B,end:u.value,delta:y,oldColspan:u.value-I,newColspan:u.value-B})}function Qe(s){if(!_.value||!l.value)return;const y=(s-z.value.startX)/R.value,I=Math.max(C.value+1,Math.min(e.columnsCount,z.value.startPos+y));l.value.style.width=`${(I-C.value)/e.colspan*100}%`}function Ke(s){if(!l.value)return;const h=s-z.value.startX,y=Math.round(h/R.value),I=u.value,B=Math.max(C.value+1,Math.min(e.columnsCount,z.value.startPos+y));u.value=B,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"resize",edge:"end",oldEnd:I,newEnd:B,start:C.value,delta:y,oldColspan:I-C.value,newColspan:B-C.value})}function _e(s){if(!ee.value||!l.value)return;const y=(s-z.value.startX)/R.value,I=u.value-C.value,B=Math.max(0,Math.min(z.value.startPos+y,e.columnsCount-I));l.value.style.left=`${B/e.colspan*100}%`}function et(s){if(!l.value)return;const h=s-z.value.startX,y=Math.round(h/R.value),I=u.value-C.value,B=C.value,V=u.value;let O=z.value.startPos+y,H=O+I;O<0?(O=0,H=I):H>e.columnsCount&&(H=e.columnsCount,O=H-I),C.value=O,u.value=H,e.store.updateGanttBar({rowIndex:e.rowIndex,colIndex:e.colIndex,type:"bar",oldStart:B,oldEnd:V,newStart:O,newEnd:H,delta:y,colspan:H-O})}function tt(){const{x:s,y:h}=G(l),{x:y,y:I}=G(m),{x:B,y:V}=G(b);e.store.registerGanttBar({id:d,rowIndex:e.rowIndex,colIndex:e.colIndex,startIndex:C,endIndex:u,color:c,label:e.label,position:{x:s,y:h}}),e.store.registerConnectionHandle({id:`${d}-connection-left`,rowIndex:e.rowIndex,colIndex:e.colIndex,side:"left",position:{x:y,y:I},visible:w,barId:d}),e.store.registerConnectionHandle({id:`${d}-connection-right`,rowIndex:e.rowIndex,colIndex:e.colIndex,side:"right",position:{x:B,y:V},visible:x,barId:d})}function nt(){e.store.unregisterGanttBar(d),e.store.unregisterConnectionHandle(`${d}-connection-left`),e.store.unregisterConnectionHandle(`${d}-connection-right`)}function ot(){w.value=!0,x.value=!0}function Ie(){!E.value&&!M.value&&(w.value=!1,x.value=!1)}function Se(s,h){h.preventDefault(),h.stopPropagation(),D.value=!0,s==="left"?E.value=!0:M.value=!0;const y=s==="left"?m.value:b.value;if(y){const V=y.getBoundingClientRect(),O=V.left+V.width/2,H=V.top+V.height/2;$.value={startX:O,startY:H,endX:O,endY:H}}const I=V=>{$.value.endX=V.clientX,$.value.endY=V.clientY},B=V=>{Be(V,s),g(I,B)};document.addEventListener("mousemove",I),document.addEventListener("mouseup",B)}function Be(s,h){const y=document.elementFromPoint(s.clientX,s.clientY),I=y==null?void 0:y.closest(".connection-handle");if(I&&I!==(h==="left"?m.value:b.value)){const B=I.closest(".gantt-bar");if(B){const V=parseInt(B.getAttribute("data-rowindex")||"0"),O=parseInt(B.getAttribute("data-colindex")||"0"),H=I.classList.contains("left-connection-handle")?"left":"right",In=`gantt-bar-row-${V}-col-${O}`,at=e.store.createConnection(`${d}-connection-${h}`,`${In}-connection-${H}`);at&&r("connection:create",at)}}}function g(s,h){var y;D.value=!1,E.value=!1,M.value=!1,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",h),(y=l.value)!=null&&y.matches(":hover")||Ie()}return n({barStyle:T,cleanupConnectionDrag:g,currentEnd:u,handleConnectionDrop:Be,isLeftConnectionDragging:E,isLeftConnectionVisible:w,isRightConnectionDragging:M,isRightConnectionVisible:x,showDragPreview:D}),(s,h)=>(t.openBlock(),t.createElementBlock("td",{class:"aganttcell",colspan:s.colspan},[t.createElementVNode("div",Ut,[t.createElementVNode("div",{ref:"bar","data-rowindex":s.rowIndex,"data-colindex":s.colIndex,class:t.normalizeClass(["gantt-bar",{"is-dragging":S.value}]),style:t.normalizeStyle(T.value),onMouseenter:ot,onMouseleave:Ie},[t.createElementVNode("div",{ref:"leftConnectionHandle",class:t.normalizeClass(["connection-handle left-connection-handle",{visible:w.value,"is-dragging":E.value}]),onMousedown:h[0]||(h[0]=t.withModifiers(y=>Se("left",y),["stop"]))},h[2]||(h[2]=[t.createElementVNode("div",{class:"connection-dot"},null,-1)]),34),t.createElementVNode("div",{ref:"rightConnectionHandle",class:t.normalizeClass(["connection-handle right-connection-handle",{visible:x.value,"is-dragging":M.value}]),onMousedown:h[1]||(h[1]=t.withModifiers(y=>Se("right",y),["stop"]))},h[3]||(h[3]=[t.createElementVNode("div",{class:"connection-dot"},null,-1)]),34),t.createElementVNode("div",{ref:"leftResizeHandle",class:t.normalizeClass(["resize-handle left-resize-handle",{"is-dragging":t.unref(X)}])},h[4]||(h[4]=[t.createElementVNode("div",{class:"handle-grip"},null,-1),t.createElementVNode("div",{class:"vertical-indicator left-indicator"},null,-1)]),2),s.label?(t.openBlock(),t.createElementBlock("label",Jt,t.toDisplayString(s.label),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"rightResizeHandle",class:t.normalizeClass(["resize-handle right-resize-handle",{"is-dragging":t.unref(_)}])},h[5]||(h[5]=[t.createElementVNode("div",{class:"handle-grip"},null,-1),t.createElementVNode("div",{class:"vertical-indicator right-indicator"},null,-1)]),2)],46,qt)],512),D.value?(t.openBlock(),t.createElementBlock("svg",{key:0,style:t.normalizeStyle(L.value)},[t.createElementVNode("line",{x1:$.value.startX,y1:$.value.startY,x2:$.value.endX,y2:$.value.endY,stroke:"#2196f3","stroke-width":"2","stroke-dasharray":"5,5"},null,8,Zt)],4)):t.createCommentVNode("",!0)],8,jt))}}),[["__scopeId","data-v-a77cc6d2"]]),Qt=["tabindex"],we=Y(t.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(e){const n=t.useTemplateRef("rowEl"),o=t.computed(()=>e.store.isRowVisible(e.rowIndex)),r=t.computed(()=>e.store.getRowExpandSymbol(e.rowIndex));if(e.addNavigation){let c=ge;typeof e.addNavigation=="object"&&(c={...c,...e.addNavigation}),pe([{selectors:n,handlers:c}])}return(c,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("tr",{ref:"rowEl",tabindex:c.tabIndex,class:"atable-row"},[c.store.config.view!=="uncounted"?t.renderSlot(c.$slots,"index",{key:0},()=>[c.store.config.view==="list"?(t.openBlock(),t.createElementBlock("td",{key:0,tabIndex:-1,class:t.normalizeClass(["list-index",c.store.hasPinnedColumns?"sticky-index":""])},t.toDisplayString(c.rowIndex+1),3)):c.store.isTreeView?(t.openBlock(),t.createElementBlock("td",{key:1,tabIndex:-1,class:t.normalizeClass(["tree-index",c.store.hasPinnedColumns?"sticky-index":""]),onClick:d[0]||(d[0]=a=>c.store.toggleRowExpand(c.rowIndex))},t.toDisplayString(r.value),3)):t.createCommentVNode("",!0)],!0):t.createCommentVNode("",!0),t.renderSlot(c.$slots,"default",{},void 0,!0)],8,Qt)),[[t.vShow,o.value]])}}),[["__scopeId","data-v-c554ee0f"]]),ve=ae?window:void 0;function j(e){var n;const o=t.toValue(e);return(n=o==null?void 0:o.$el)!=null?n:o}function re(...e){const n=[],o=()=>{n.forEach(l=>l()),n.length=0},r=(l,i,f,m)=>(l.addEventListener(i,f,m),()=>l.removeEventListener(i,f,m)),c=t.computed(()=>{const l=F(t.toValue(e[0])).filter(i=>i!=null);return l.every(i=>typeof i!="string")?l:void 0}),d=Oe(()=>{var l,i;return[(i=(l=c.value)==null?void 0:l.map(f=>j(f)))!=null?i:[ve].filter(f=>f!=null),F(t.toValue(c.value?e[1]:e[0])),F(t.unref(c.value?e[2]:e[1])),t.toValue(c.value?e[3]:e[2])]},([l,i,f,m])=>{if(o(),!(l!=null&&l.length)||!(i!=null&&i.length)||!(f!=null&&f.length))return;const b=De(m)?{...m}:m;n.push(...l.flatMap(p=>i.flatMap(v=>f.map(k=>r(p,v,k,b)))))},{flush:"post"}),a=()=>{d(),o()};return J(o),a}let Xe=!1;function Fe(e,n,o={}){const{window:r=ve,ignore:c=[],capture:d=!0,detectIframe:a=!1,controls:l=!1}=o;if(!r)return l?{stop:W,cancel:W,trigger:W}:W;if(he&&!Xe){Xe=!0;const u={passive:!0};Array.from(r.document.body.children).forEach(w=>w.addEventListener("click",W,u)),r.document.documentElement.addEventListener("click",W,u)}let i=!0;const f=u=>t.toValue(c).some(w=>{if(typeof w=="string")return Array.from(r.document.querySelectorAll(w)).some(x=>x===u.target||u.composedPath().includes(x));{const x=j(w);return x&&(u.target===x||u.composedPath().includes(x))}});function m(u){const w=t.toValue(u);return w&&w.$.subTree.shapeFlag===16}function b(u,w){const x=t.toValue(u),E=x.$.subTree&&x.$.subTree.children;return E==null||!Array.isArray(E)?!1:E.some(M=>M.el===w.target||w.composedPath().includes(M.el))}const p=u=>{const w=j(e);if(u.target!=null&&!(!(w instanceof Element)&&m(e)&&b(e,u))&&!(!w||w===u.target||u.composedPath().includes(w))){if("detail"in u&&u.detail===0&&(i=!f(u)),!i){i=!0;return}n(u)}};let v=!1;const k=[re(r,"click",u=>{v||(v=!0,setTimeout(()=>{v=!1},0),p(u))},{passive:!0,capture:d}),re(r,"pointerdown",u=>{const w=j(e);i=!f(u)&&!!(w&&!u.composedPath().includes(w))},{passive:!0}),a&&re(r,"blur",u=>{setTimeout(()=>{var w;const x=j(e);((w=r.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!(x!=null&&x.contains(r.document.activeElement))&&n(u)},0)},{passive:!0})].filter(Boolean),C=()=>k.forEach(u=>u());return l?{stop:C,cancel:()=>{i=!1},trigger:u=>{i=!0,p(u),i=!1}}:C}const xe=new WeakMap,Kt={mounted(e,n){const o=!n.modifiers.bubble;let r;if(typeof n.value=="function")r=Fe(e,n.value,{capture:o});else{const[c,d]=n.value;r=Fe(e,c,Object.assign({capture:o},d))}xe.set(e,r)},unmounted(e){const n=xe.get(e);n&&typeof n=="function"?n():n==null||n.stop(),xe.delete(e)}};function _t(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function en(e){const n=_t();return t.computed(()=>(n.value,!!e()))}function Ge(e,n,o={}){const{window:r=ve,...c}=o;let d;const a=en(()=>r&&"ResizeObserver"in r),l=()=>{d&&(d.disconnect(),d=void 0)},i=t.computed(()=>{const b=t.toValue(e);return Array.isArray(b)?b.map(p=>j(p)):[j(b)]}),f=t.watch(i,b=>{if(l(),a.value&&r){d=new ResizeObserver(n);for(const p of b)p&&d.observe(p,c)}},{immediate:!0,flush:"post"}),m=()=>{l(),f()};return J(m),{isSupported:a,stop:m}}function ye(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const tn={mounted(e,n){typeof n.value=="function"?Ge(e,n.value):Ge(e,...n.value)}};function Ye(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const o=e.parentNode;return!o||o.tagName==="BODY"?!1:Ye(o)}}function nn(e){const n=e||window.event,o=n.target;return Ye(o)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const ke=new WeakMap;function on(e,n=!1){const o=t.shallowRef(n);let r=null,c="";t.watch($t(e),l=>{const i=ye(t.toValue(l));if(i){const f=i;if(ke.get(f)||ke.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(c=f.style.overflow),f.style.overflow==="hidden")return o.value=!0;if(o.value)return f.style.overflow="hidden"}},{immediate:!0});const d=()=>{const l=ye(t.toValue(e));!l||o.value||(he&&(r=re(l,"touchmove",i=>{nn(i)},{passive:!1})),l.style.overflow="hidden",o.value=!0)},a=()=>{const l=ye(t.toValue(e));!l||!o.value||(he&&(r==null||r()),l.style.overflow=c,ke.delete(l),o.value=!1)};return J(a),t.computed({get(){return o.value},set(l){l?d():a()}})}function an(){let e=!1;const n=t.shallowRef(!1);return(o,r)=>{if(n.value=r.value,e)return;e=!0;const c=on(o,r.value);t.watch(n,d=>c.value=d)}}an();const ln={class:"gantt-connection-overlay"},rn={class:"connection-svg",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1}},sn=["d","stroke-width","onDblclick"],cn=["d","stroke","stroke-width","id","onDblclick"],dn=.25,ie=16,fn=Y(t.defineComponent({__name:"AGanttConnection",props:{store:{}},emits:["connection:delete"],setup(e,{emit:n}){const o=n,r=t.computed(()=>e.store.connectionPaths.filter(a=>{const l=e.store.ganttBars.find(f=>f.id===a.from.barId),i=e.store.ganttBars.find(f=>f.id===a.to.barId);return l&&i})),c=(a,l=!1)=>{const i=e.store.connectionHandles.find(R=>R.barId===a.from.barId&&R.side===a.from.side),f=e.store.connectionHandles.find(R=>R.barId===a.to.barId&&R.side===a.to.side);if(!i||!f)return"";const m=i.position.x+ie/2,b=i.position.y+ie/2,p=f.position.x+ie/2,v=f.position.y+ie/2,k=Math.abs(p-m),C=Math.max(k*dn,50),u=m+(a.from.side==="left"?-C:C),w=p+(a.to.side==="left"?-C:C),x={x:.5*m+.5*u,y:.5*b+.5*b},E={x:.5*u+.5*w,y:.5*b+.5*v},M={x:.5*w+.5*p,y:.5*v+.5*v},D={x:.5*x.x+.5*E.x,y:.5*x.y+.5*E.y},$={x:.5*E.x+.5*M.x,y:.5*E.y+.5*M.y},S={x:.5*D.x+.5*$.x,y:.5*D.y+.5*$.y};return`M ${m} ${b} Q ${u} ${b}, ${S.x} ${S.y} Q ${w} ${v}, ${p} ${v}`},d=a=>{e.store.deleteConnection(a.id)&&o("connection:delete",a)};return(a,l)=>(t.openBlock(),t.createElementBlock("div",ln,[(t.openBlock(),t.createElementBlock("svg",rn,[l[0]||(l[0]=t.createElementVNode("defs",null,[t.createElementVNode("path",{id:"arrowhead",d:"M 0 -7 L 20 0 L 0 7Z",stroke:"black","stroke-width":"1",fill:"currentColor"}),t.createElementVNode("marker",{id:"arrowhead-marker",markerWidth:"10",markerHeight:"7",refX:"5",refY:"3.5",orient:"auto",markerUnits:"strokeWidth"},[t.createElementVNode("polygon",{points:"0 0, 10 3.5, 0 7",fill:"currentColor"})])],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,i=>{var f;return t.openBlock(),t.createElementBlock("path",{key:`${i.id}-hitbox`,d:c(i),stroke:"transparent","stroke-width":(((f=i.style)==null?void 0:f.width)||2)+10,fill:"none",class:"connection-hitbox",onDblclick:m=>d(i)},null,40,sn)}),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,i=>{var f,m;return t.openBlock(),t.createElementBlock("path",{key:i.id,d:c(i),stroke:((f=i.style)==null?void 0:f.color)||"#666","stroke-width":((m=i.style)==null?void 0:m.width)||2,fill:"none","marker-mid":"url(#arrowhead-marker)",id:i.id,class:"connection-path animated-path",onDblclick:b=>d(i)},null,40,cn)}),128))]))]))}}),[["__scopeId","data-v-955111b6"]]),un={key:0},mn={class:"atable-header-row",tabindex:"-1"},gn=["data-colindex"],Ce=t.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(e){const n=o=>{var r;for(const c of o){if(c.borderBoxSize.length===0)continue;const a=c.borderBoxSize[0].inlineSize,l=Number(c.target.dataset.colindex),i=(r=e.store.columns[l])==null?void 0:r.width;typeof i=="number"&&i!==a&&e.store.resizeColumn(l,a)}};return(o,r)=>o.columns.length?(t.openBlock(),t.createElementBlock("thead",un,[t.createElementVNode("tr",mn,[o.store.zeroColumn?(t.openBlock(),t.createElementBlock("th",{key:0,id:"header-index",class:t.normalizeClass([[o.store.hasPinnedColumns?"sticky-index":"",o.store.isTreeView?"tree-index":"",o.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.columns,(c,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("th",{key:c.name,"data-colindex":d,tabindex:"-1",style:t.normalizeStyle(o.store.getHeaderCellStyle(c)),class:t.normalizeClass(c.pinned?"sticky-column":"")},[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(c.label||String.fromCharCode(d+97).toUpperCase()),1)])],14,gn)),[[t.unref(tn),n]])),128))])])):t.createCommentVNode("",!0)}}),Ee=t.defineComponent({__name:"ATableModal",props:{store:{}},setup(e){const n=t.useTemplateRef("amodal"),{width:o,height:r}=G(n),c=t.computed(()=>{var b,p,v,k;if(!(e.store.modal.height&&e.store.modal.width&&e.store.modal.left&&e.store.modal.bottom))return;const d=(b=e.store.modal.cell)==null?void 0:b.closest("table"),a=d.offsetHeight||0,l=d.offsetWidth||0;let i=((p=e.store.modal.cell)==null?void 0:p.offsetTop)||0;const f=((v=d.querySelector("thead"))==null?void 0:v.offsetHeight)||0;i+=f,i=i+r.value<a?i:i-(r.value+e.store.modal.height);let m=((k=e.store.modal.cell)==null?void 0:k.offsetLeft)||0;return m=m+o.value<=l?m:m-(o.value-e.store.modal.width),{left:`${m}px`,top:`${i}px`}});return(d,a)=>(t.openBlock(),t.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:a[0]||(a[0]=t.withModifiers(()=>{},["stop"])),onInput:a[1]||(a[1]=t.withModifiers(()=>{},["stop"])),style:t.normalizeStyle(c.value)},[t.renderSlot(d.$slots,"default")],36))}}),je=e=>{const n=e.id||Lt();return lt.defineStore(`table-${n}`,()=>{const r=()=>{const g=[Object.assign({},{rowModified:!1})],s=new Set;for(let h=0;h<d.value.length;h++){const y=d.value[h];y.parent!==null&&y.parent!==void 0&&s.add(y.parent)}for(let h=0;h<d.value.length;h++){const y=d.value[h];g[h]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:s.has(h),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return g},c=t.ref(e.columns),d=t.ref(e.rows),a=t.ref(e.config||{}),l=t.ref({}),i=t.ref({}),f=t.computed(()=>{const g={};for(const[s,h]of c.value.entries())for(const[y,I]of d.value.entries())g[`${s}:${y}`]=I[h.name];return g}),m=t.computed({get:()=>{const g=r();for(let s=0;s<g.length;s++)l.value[s]&&(g[s].rowModified=l.value[s]),i.value[s]&&(i.value[s].childrenOpen!==void 0&&(g[s].childrenOpen=i.value[s].childrenOpen),i.value[s].expanded!==void 0&&(g[s].expanded=i.value[s].expanded));if(x.value)for(let s=0;s<g.length;s++){const h=g[s];if(!h.isRoot&&h.parent!==null&&h.parent!==void 0){const y=h.parent;y>=0&&y<g.length&&(g[s].open=g[y].childrenOpen||!1)}}return g},set:g=>{JSON.stringify(g)!==JSON.stringify(m.value)&&(m.value=g)}}),b=t.ref(e.modal||{visible:!1}),p=t.ref({}),v=t.ref([]),k=t.ref([]),C=t.ref([]),u=t.computed(()=>c.value.some(g=>g.pinned)),w=t.computed(()=>a.value.view==="gantt"||a.value.view==="tree-gantt"),x=t.computed(()=>a.value.view==="tree"||a.value.view==="tree-gantt"),E=t.computed(()=>`${Math.ceil(d.value.length/100+1)}ch`),M=t.computed(()=>a.value.view?["list","tree","tree-gantt","list-expansion"].includes(a.value.view):!1),D=(g,s)=>f.value[`${g}:${s}`],$=(g,s,h)=>{const y=`${g}:${s}`,I=c.value[g];f.value[y]!==h&&(l.value[s]=!0),f.value[y]=h,d.value[s]={...d.value[s],[I.name]:h}},S=g=>{d.value=g},R=(g,s,h)=>{const y=`${g}:${s}`;f.value[y]!==h&&(l.value[s]=!0,p.value[y]=h)},T=g=>{const s=c.value.indexOf(g)===c.value.length-1,h=a.value.fullWidth?g.resizable&&!s:g.resizable;return{width:g.width||"40ch",textAlign:g.align||"center",...h&&{resize:"horizontal",overflow:"hidden",whiteSpace:"nowrap"}}},L=(g,s)=>{if(g<0||g>=c.value.length)return;const y=Math.max(s,40);c.value[g]={...c.value[g],width:`${y}px`}},z=g=>{const s=d.value[g];return w.value&&s.gantt!==void 0},X=g=>!x.value||m.value[g].isRoot||m.value[g].open,_=g=>!x.value&&a.value.view!=="list-expansion"?"":x.value&&(m.value[g].isRoot||m.value[g].isParent)?m.value[g].childrenOpen?"▼":"►":a.value.view==="list-expansion"?m.value[g].expanded?"▼":"►":"",ee=g=>{if(x.value){const s=i.value[g]||{},y=!(s.childrenOpen??m.value[g].childrenOpen);if(i.value[g]={...s,childrenOpen:y},!y){for(let I=0;I<d.value.length;I++)if(m.value[I].parent===g){const B=i.value[I]||{};i.value[I]={...B,childrenOpen:!1},ee(I)}}}else if(a.value.view==="list-expansion"){const s=i.value[g]||{},h=s.expanded??m.value[g].expanded;i.value[g]={...s,expanded:!h}}},te=(g,s)=>{const h=D(g,s);return se(g,s,h)},se=(g,s,h)=>{const y=c.value[g],I=d.value[s],B=y.format;return B?typeof B=="function"?B(h,{table:f.value,row:I,column:y}):typeof B=="string"?Function(`"use strict";return (${B})`)()(h,{table:f.value,row:I,column:y}):h:h};return{columns:c,config:a,connectionHandles:k,connectionPaths:C,display:m,ganttBars:v,modal:b,rows:d,table:f,updates:p,hasPinnedColumns:u,isGanttView:w,isTreeView:x,numberedRowWidth:E,zeroColumn:M,closeModal:g=>{var s;g.target instanceof Node&&(s=b.value.parent)!=null&&s.contains(g.target)||b.value.visible&&(b.value.visible=!1)},createConnection:(g,s,h)=>{const y=k.value.find(V=>V.id===g),I=k.value.find(V=>V.id===s);if(!y||!I)return console.warn("Cannot create connection: handle not found"),null;const B={id:`connection-${g}-${s}`,from:{barId:y.barId,side:y.side},to:{barId:I.barId,side:I.side},style:h==null?void 0:h.style,label:h==null?void 0:h.label};return C.value.push(B),B},deleteConnection:g=>{const s=C.value.findIndex(h=>h.id===g);return s>=0?(C.value.splice(s,1),!0):!1},getCellData:D,getCellDisplayValue:te,getConnectionsForBar:g=>C.value.filter(s=>s.from.barId===g||s.to.barId===g),getFormattedValue:se,getHandlesForBar:g=>k.value.filter(s=>s.barId===g),getHeaderCellStyle:T,getIndent:(g,s)=>s&&g===0&&s>0?`${s}ch`:"inherit",getRowExpandSymbol:_,isRowGantt:z,isRowVisible:X,registerConnectionHandle:g=>{const s=k.value.findIndex(h=>h.id===g.id);s>=0?k.value[s]=g:k.value.push(g)},registerGanttBar:g=>{const s=v.value.findIndex(h=>h.id===g.id);s>=0?v.value[s]=g:v.value.push(g)},resizeColumn:L,setCellData:$,setCellText:R,toggleRowExpand:ee,unregisterConnectionHandle:g=>{const s=k.value.findIndex(h=>h.id===g);s>=0&&k.value.splice(s,1)},unregisterGanttBar:g=>{const s=v.value.findIndex(h=>h.id===g);s>=0&&v.value.splice(s,1)},updateGanttBar:g=>{var h;const s=(h=d.value[g.rowIndex])==null?void 0:h.gantt;s&&(g.type==="resize"?g.edge==="start"?(s.startIndex=g.newStart,s.endIndex=g.end,s.colspan=s.endIndex-s.startIndex):g.edge==="end"&&(s.startIndex=g.start,s.endIndex=g.newEnd,s.colspan=s.endIndex-s.startIndex):g.type==="bar"&&(s.startIndex=g.newStart,s.endIndex=g.newEnd,s.colspan=s.endIndex-s.startIndex))},updateRows:S}})()},pn={class:"atable-container",style:{position:"relative"}},Ue=Y(t.defineComponent({__name:"ATable",props:t.mergeModels({id:{},columns:{},config:{default:()=>new Object}},{modelValue:{required:!0},modelModifiers:{}}),emits:t.mergeModels(["cellUpdate","gantt:drag","connection:event"],["update:modelValue"]),setup(e,{expose:n,emit:o}){const r=t.useModel(e,"modelValue"),c=o,d=t.useTemplateRef("table"),a=je({columns:e.columns,rows:r.value,id:e.id,config:e.config});a.$onAction(({name:p,store:v,args:k,after:C})=>{if(p==="setCellData"||p==="setCellText"){const[u,w,x]=k,E=v.getCellData(u,w);C(()=>{r.value=[...v.rows],c("cellUpdate",{colIndex:u,rowIndex:w,newValue:x,oldValue:E})})}else if(p==="updateGanttBar"){const[u]=k;let w=!1;u.type==="resize"?w=u.oldColspan!==u.newColspan:u.type==="bar"&&(w=u.oldStart!==u.newStart||u.oldEnd!==u.newEnd),w&&C(()=>{c("gantt:drag",u)})}}),t.watch(()=>r.value,p=>{JSON.stringify(p)!==JSON.stringify(a.rows)&&(a.rows=[...p])},{deep:!0}),t.onMounted(()=>{e.columns.some(p=>p.pinned)&&(i(),a.isTreeView&&Le(d,i,{childList:!0,subtree:!0}))});const l=t.computed(()=>a.columns.filter(p=>p.pinned).length),i=()=>{const p=d.value,v=p==null?void 0:p.rows[0],k=p==null?void 0:p.rows[1],C=v?Array.from(v.cells):[];for(const[u,w]of C.entries()){const x=k==null?void 0:k.cells[u];x&&(w.style.width=`${x.offsetWidth}px`)}for(const u of(p==null?void 0:p.rows)||[]){let w=0;const x=[];for(const E of u.cells)(E.classList.contains("sticky-column")||E.classList.contains("sticky-index"))&&(E.style.left=`${w}px`,w+=E.offsetWidth,x.push(E));x.length>0&&x[x.length-1].classList.add("sticky-column-edge")}};window.addEventListener("keydown",p=>{if(p.key==="Escape"&&a.modal.visible){a.modal.visible=!1;const v=a.modal.parent;v&&t.nextTick().then(()=>{v.focus()})}});const f=p=>{var k;if(!p.gantt||l.value===0)return a.columns;const v=[];for(let C=0;C<l.value;C++){const u={...a.columns[C]};u.originalIndex=C,v.push(u)}return v.push({...a.columns[l.value],isGantt:!0,colspan:((k=p.gantt)==null?void 0:k.colspan)||a.columns.length-l.value,originalIndex:l.value,width:"auto"}),v},m=p=>{c("connection:event",{type:"create",connection:p})},b=p=>{c("connection:event",{type:"delete",connection:p})};return n({store:a,createConnection:a.createConnection,deleteConnection:a.deleteConnection,getConnectionsForBar:a.getConnectionsForBar,getHandlesForBar:a.getHandlesForBar}),(p,v)=>(t.openBlock(),t.createElementBlock("div",pn,[t.withDirectives((t.openBlock(),t.createElementBlock("table",{ref:"table",class:"atable",style:t.normalizeStyle({width:t.unref(a).config.fullWidth?"100%":"auto"})},[t.renderSlot(p.$slots,"header",{data:t.unref(a)},()=>[t.createVNode(Ce,{columns:t.unref(a).columns,store:t.unref(a)},null,8,["columns","store"])],!0),t.createElementVNode("tbody",null,[t.renderSlot(p.$slots,"body",{data:t.unref(a)},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).rows,(k,C)=>(t.openBlock(),t.createBlock(we,{key:k.id,row:k,rowIndex:C,store:t.unref(a)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f(k),(u,w)=>{var x,E,M;return t.openBlock(),t.createElementBlock(t.Fragment,{key:u.name},[u.isGantt?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.ganttComponent||"AGanttCell"),{key:0,store:t.unref(a),columnsCount:t.unref(a).columns.length-l.value,color:(x=k.gantt)==null?void 0:x.color,start:(E=k.gantt)==null?void 0:E.startIndex,end:(M=k.gantt)==null?void 0:M.endIndex,colspan:u.colspan,pinned:u.pinned,rowIndex:C,colIndex:u.originalIndex??w,style:t.normalizeStyle({textAlign:(u==null?void 0:u.align)||"center",minWidth:(u==null?void 0:u.width)||"40ch",width:t.unref(a).config.fullWidth?"auto":null}),"onConnection:create":m},null,40,["store","columnsCount","color","start","end","colspan","pinned","rowIndex","colIndex","style"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.cellComponent||"ACell"),{key:1,store:t.unref(a),pinned:u.pinned,rowIndex:C,colIndex:w,style:t.normalizeStyle({textAlign:(u==null?void 0:u.align)||"center",width:t.unref(a).config.fullWidth?"auto":null}),spellcheck:"false"},null,8,["store","pinned","rowIndex","colIndex","style"]))],64)}),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),t.renderSlot(p.$slots,"footer",{data:t.unref(a)},void 0,!0),t.renderSlot(p.$slots,"modal",{data:t.unref(a)},()=>[t.withDirectives(t.createVNode(Ee,{store:t.unref(a)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(a).modal.component),t.mergeProps({key:`${t.unref(a).modal.rowIndex}:${t.unref(a).modal.colIndex}`,colIndex:t.unref(a).modal.colIndex,rowIndex:t.unref(a).modal.rowIndex,store:t.unref(a)},t.unref(a).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[t.vShow,t.unref(a).modal.visible]])],!0)],4)),[[t.unref(Kt),t.unref(a).closeModal]]),t.unref(a).isGanttView?(t.openBlock(),t.createBlock(fn,{key:0,store:t.unref(a),"onConnection:delete":b},null,8,["store"])):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8533f0fc"]]),hn={},bn={class:"aloading"},wn={class:"aloading-header"};function vn(e,n){return t.openBlock(),t.createElementBlock("div",bn,[t.createElementVNode("h2",wn,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),n[0]||(n[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const qe=Y(hn,[["render",vn],["__scopeId","data-v-a930a25b"]]),xn={},yn={class:"aloading"},kn={class:"aloading-header"};function Cn(e,n){return t.openBlock(),t.createElementBlock("div",yn,[t.createElementVNode("h2",kn,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),n[0]||(n[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Je=Y(xn,[["render",Cn],["__scopeId","data-v-e1165876"]]);function En(e){e.component("ACell",Pe),e.component("AExpansionRow",Ne),e.component("AGanttCell",We),e.component("ARow",we),e.component("ATable",Ue),e.component("ATableHeader",Ce),e.component("ATableLoading",qe),e.component("ATableLoadingBar",Je),e.component("ATableModal",Ee)}A.ACell=Pe,A.AExpansionRow=Ne,A.AGanttCell=We,A.ARow=we,A.ATable=Ue,A.ATableHeader=Ce,A.ATableLoading=qe,A.ATableLoadingBar=Je,A.ATableModal=Ee,A.createTableStore=je,A.install=En,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
3
3
|
//# sourceMappingURL=atable.umd.cjs.map
|