@stonecrop/atable 0.4.8 → 0.4.10
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/assets/index.css +1 -1
- package/dist/atable.js +581 -585
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +0 -3
- package/src/components/ATable.vue +6 -11
package/dist/atable.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(E,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],t):(E=typeof globalThis<"u"?globalThis:E||self,t(E["@stonecrop/atable"]={},E.Vue,E.pinia))})(this,function(E,t,Re){"use strict";var ce=document.createElement("style");ce.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);display:flex}.expandable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.expanded-row{display:flex;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-60affd71]: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))}.atable-row{display:flex;background-color:#fff}.table-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-9c529d3d]: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))}.atable-header-row{display:flex}.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)}#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}.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-37bee2a6]: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-37bee2a6]{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}.atable th[data-v-37bee2a6]{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-37bee2a6]:focus{outline:none}.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(ce);function U(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const Me=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Be=e=>e!=null,ze=Object.prototype.toString,Ve=e=>ze.call(e)==="[object Object]",Le=()=>{};function j(e){return Array.isArray(e)?e:[e]}function Oe(e,o,n){return t.watch(e,o,{...n,immediate:!0})}const B=Me?window:void 0;function z(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function D(...e){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},a=(l,s,r,d)=>(l.addEventListener(s,r,d),()=>l.removeEventListener(s,r,d)),i=t.computed(()=>{const l=j(t.toValue(e[0])).filter(s=>s!=null);return l.every(s=>typeof s!="string")?l:void 0}),f=Oe(()=>{var l,s;return[(s=(l=i.value)==null?void 0:l.map(r=>z(r)))!=null?s:[B].filter(r=>r!=null),j(t.toValue(i.value?e[1]:e[0])),j(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([l,s,r,d])=>{if(n(),!(l!=null&&l.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const p=Ve(d)?{...d}:d;o.push(...l.flatMap(b=>s.flatMap(m=>r.map(x=>a(b,m,x,p)))))},{flush:"post"}),c=()=>{f(),n()};return U(n),c}function De(){const e=t.shallowRef(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function Pe(e){const o=De();return t.computed(()=>(o.value,!!e()))}function Ne(e,o,n={}){const{window:a=B,...i}=n;let f;const c=Pe(()=>a&&"MutationObserver"in a),l=()=>{f&&(f.disconnect(),f=void 0)},s=t.computed(()=>{const b=t.toValue(e),m=j(b).map(z).filter(Be);return new Set(m)}),r=t.watch(()=>s.value,b=>{l(),c.value&&b.size&&(f=new MutationObserver(o),b.forEach(m=>f.observe(m,i)))},{immediate:!0,flush:"post"}),d=()=>f==null?void 0:f.takeRecords(),p=()=>{r(),l()};return U(p),{isSupported:c,stop:p,takeRecords:d}}function He(e,o,n={}){const{window:a=B,document:i=a==null?void 0:a.document,flush:f="sync"}=n;if(!a||!i)return Le;let c;const l=d=>{c==null||c(),c=d},s=t.watchEffect(()=>{const d=z(e);if(d){const{stop:p}=Ne(i,b=>{b.map(m=>[...m.removedNodes]).flat().some(m=>m===d||m.contains(d))&&o(b)},{window:a,childList:!0,subtree:!0});l(p)}},{flush:f}),r=()=>{s(),l()};return U(r),r}function We(e={}){var o;const{window:n=B,deep:a=!0,triggerOnRemoval:i=!1}=e,f=(o=e.document)!=null?o:n==null?void 0:n.document,c=()=>{var r;let d=f==null?void 0:f.activeElement;if(a)for(;d!=null&&d.shadowRoot;)d=(r=d==null?void 0:d.shadowRoot)==null?void 0:r.activeElement;return d},l=t.ref(),s=()=>{l.value=c()};if(n){const r={capture:!0,passive:!0};D(n,"blur",d=>{d.relatedTarget===null&&s()},r),D(n,"focus",s,r)}return i&&He(l,s,{document:f}),s(),l}const je="focusin",Fe="focusout",qe=":focus-within";function Ue(e,o={}){const{window:n=B}=o,a=t.computed(()=>z(e)),i=t.shallowRef(!1),f=t.computed(()=>i.value),c=We(o);if(!n||!c.value)return{focused:f};const l={passive:!0};return D(a,je,()=>i.value=!0,l),D(a,Fe,()=>{var s,r,d;return i.value=(d=(r=(s=a.value)==null?void 0:s.matches)==null?void 0:r.call(s,qe))!=null?d:!1},l),{focused:f}}function Ye(e,{window:o=B,scrollTarget:n}={}){const a=t.ref(!1),i=()=>{if(!o)return;const f=o.document,c=z(e);if(!c)a.value=!1;else{const l=c.getBoundingClientRect();a.value=l.top<=(o.innerHeight||f.documentElement.clientHeight)&&l.left<=(o.innerWidth||f.documentElement.clientWidth)&&l.bottom>=0&&l.right>=0}};return t.watch(()=>z(e),()=>i(),{immediate:!0,flush:"post"}),o&&D(n||o,"scroll",i,{capture:!1,passive:!0}),a}const T=e=>{let o=Ye(e).value;return o=o&&e.offsetHeight>0,o},$=e=>e.tabIndex>=0,se=e=>{const o=e.target;return Y(o)},Y=e=>{var o;let n;if(e instanceof HTMLTableCellElement){const a=(o=e.parentElement)==null?void 0:o.previousElementSibling;if(a){const i=Array.from(a.children)[e.cellIndex];i&&(n=i)}}else if(e instanceof HTMLTableRowElement){const a=e.previousElementSibling;a&&(n=a)}return n&&(!$(n)||!T(n))?Y(n):n},Ge=e=>{var o;const n=e.target;let a;if(n instanceof HTMLTableCellElement){const i=(o=n.parentElement)==null?void 0:o.parentElement;if(i){const f=i.firstElementChild,c=f==null?void 0:f.children[n.cellIndex];c&&(a=c)}}else if(n instanceof HTMLTableRowElement){const i=n.parentElement;if(i){const f=i.firstElementChild;f&&(a=f)}}return a&&(!$(a)||!T(a))?G(a):a},ie=e=>{const o=e.target;return G(o)},G=e=>{var o;let n;if(e instanceof HTMLTableCellElement){const a=(o=e.parentElement)==null?void 0:o.nextElementSibling;if(a){const i=Array.from(a.children)[e.cellIndex];i&&(n=i)}}else if(e instanceof HTMLTableRowElement){const a=e.nextElementSibling;a&&(n=a)}return n&&(!$(n)||!T(n))?G(n):n},Xe=e=>{var o;const n=e.target;let a;if(n instanceof HTMLTableCellElement){const i=(o=n.parentElement)==null?void 0:o.parentElement;if(i){const f=i.lastElementChild,c=f==null?void 0:f.children[n.cellIndex];c&&(a=c)}}else if(n instanceof HTMLTableRowElement){const i=n.parentElement;if(i){const f=i.lastElementChild;f&&(a=f)}}return a&&(!$(a)||!T(a))?Y(a):a},de=e=>{const o=e.target;return X(o)},X=e=>{var o;let n;if(e.previousElementSibling)n=e.previousElementSibling;else{const a=(o=e.parentElement)==null?void 0:o.previousElementSibling;n=a==null?void 0:a.lastElementChild}return n&&(!$(n)||!T(n))?X(n):n},fe=e=>{const o=e.target;return J(o)},J=e=>{var o;let n;if(e.nextElementSibling)n=e.nextElementSibling;else{const a=(o=e.parentElement)==null?void 0:o.nextElementSibling;n=a==null?void 0:a.firstElementChild}return n&&(!$(n)||!T(n))?J(n):n},ue=e=>{const o=e.target.parentElement,n=o==null?void 0:o.firstElementChild;return n&&(!$(n)||!T(n))?J(n):n},me=e=>{const o=e.target.parentElement,n=o==null?void 0:o.lastElementChild;return n&&(!$(n)||!T(n))?X(n):n},F=["alt","control","shift","meta"],Je={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},Q={"keydown.up":e=>{const o=se(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.down":e=>{const o=ie(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.left":e=>{const o=de(e);e.preventDefault(),e.stopPropagation(),o&&o.focus()},"keydown.right":e=>{const o=fe(e);e.preventDefault(),e.stopPropagation(),o&&o.focus()},"keydown.control.up":e=>{const o=Ge(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.down":e=>{const o=Xe(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.left":e=>{const o=ue(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.right":e=>{const o=me(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.end":e=>{const o=me(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const o=ie(e);o&&o.focus()}},"keydown.shift.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const o=se(e);o&&o.focus()}},"keydown.home":e=>{const o=ue(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.tab":e=>{const o=fe(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.shift.tab":e=>{const o=de(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())}};function Z(e){const o=c=>{let l=null;return c.parent&&(typeof c.parent=="string"?l=document.querySelector(c.parent):c.parent instanceof HTMLElement?l=c.parent:l=c.parent.value),l},n=c=>{var l;const s=o(c);let r=[];if(typeof c.selectors=="string")r=s?Array.from(s.querySelectorAll(c.selectors)):Array.from(document.querySelectorAll(c.selectors));else if(Array.isArray(c.selectors))for(const d of c.selectors)d instanceof HTMLElement?r.push(d):r.push(d.$el);else if(c.selectors instanceof HTMLElement)r.push(c.selectors);else if((l=c.selectors)!=null&&l.value)if(Array.isArray(c.selectors.value))for(const d of c.selectors.value)d instanceof HTMLElement?r.push(d):r.push(d.$el);else r.push(c.selectors.value);return r},a=c=>{const l=o(c);let s=[];return c.selectors?s=n(c):l&&(s=Array.from(l.children).filter(r=>$(r)&&T(r))),s},i=c=>l=>{const s=Je[l.key]||l.key.toLowerCase();if(F.includes(s))return;const r=c.handlers||Q;for(const d of Object.keys(r)){const[p,...b]=d.split(".");if(p==="keydown"&&b.includes(s)){const m=r[d],x=b.filter(u=>F.includes(u)),v=F.some(u=>{const w=u.charAt(0).toUpperCase()+u.slice(1);return l.getModifierState(w)});if(x.length>0){if(v){for(const u of F)if(b.includes(u)){const w=u.charAt(0).toUpperCase()+u.slice(1);l.getModifierState(w)&&m(l)}}}else v||m(l)}}},f=[];t.onMounted(()=>{for(const c of e){const l=o(c),s=a(c),r=i(c),d=l?[l]:s;for(const p of d){const{focused:b}=Ue(t.ref(p)),m=t.watch(b,x=>{x?p.addEventListener("keydown",r):p.removeEventListener("keydown",r)});f.push(m)}}}),t.onBeforeUnmount(()=>{for(const c of f)c()})}function P(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const K=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Qe=e=>e!=null,Ze=Object.prototype.toString,pe=e=>Ze.call(e)==="[object Object]",R=()=>{},_=Ke();function Ke(){var e,o;return K&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window==null?void 0:window.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function _e(e){return t.getCurrentInstance()}function M(e){return Array.isArray(e)?e:[e]}function et(...e){if(e.length!==1)return t.toRef(...e);const o=e[0];return typeof o=="function"?t.readonly(t.customRef(()=>({get:o,set:R}))):t.ref(o)}function tt(e,o=!0,n){_e()?t.onMounted(e,n):o?e():t.nextTick(e)}function be(e,o,n){return t.watch(e,o,{...n,immediate:!0})}const ee=K?window:void 0;function V(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function ge(...e){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},a=(l,s,r,d)=>(l.addEventListener(s,r,d),()=>l.removeEventListener(s,r,d)),i=t.computed(()=>{const l=M(t.toValue(e[0])).filter(s=>s!=null);return l.every(s=>typeof s!="string")?l:void 0}),f=be(()=>{var l,s;return[(s=(l=i.value)==null?void 0:l.map(r=>V(r)))!=null?s:[ee].filter(r=>r!=null),M(t.toValue(i.value?e[1]:e[0])),M(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([l,s,r,d])=>{if(n(),!(l!=null&&l.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const p=pe(d)?{...d}:d;o.push(...l.flatMap(b=>s.flatMap(m=>r.map(x=>a(b,m,x,p)))))},{flush:"post"}),c=()=>{f(),n()};return P(n),c}function ot(){const e=t.shallowRef(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function he(e){const o=ot();return t.computed(()=>(o.value,!!e()))}function we(e,o,n={}){const{window:a=ee,...i}=n;let f;const c=he(()=>a&&"MutationObserver"in a),l=()=>{f&&(f.disconnect(),f=void 0)},s=t.computed(()=>{const b=t.toValue(e),m=M(b).map(V).filter(Qe);return new Set(m)}),r=t.watch(()=>s.value,b=>{l(),c.value&&b.size&&(f=new MutationObserver(o),b.forEach(m=>f.observe(m,i)))},{immediate:!0,flush:"post"}),d=()=>f==null?void 0:f.takeRecords(),p=()=>{r(),l()};return P(p),{isSupported:c,stop:p,takeRecords:d}}function nt(e,o,n={}){const{window:a=ee,...i}=n;let f;const c=he(()=>a&&"ResizeObserver"in a),l=()=>{f&&(f.disconnect(),f=void 0)},s=t.computed(()=>{const p=t.toValue(e);return Array.isArray(p)?p.map(b=>V(b)):[V(p)]}),r=t.watch(s,p=>{if(l(),c.value&&a){f=new ResizeObserver(o);for(const b of p)b&&f.observe(b,i)}},{immediate:!0,flush:"post"}),d=()=>{l(),r()};return P(d),{isSupported:c,stop:d}}function ye(e,o={}){const{reset:n=!0,windowResize:a=!0,windowScroll:i=!0,immediate:f=!0,updateTiming:c="sync"}=o,l=t.shallowRef(0),s=t.shallowRef(0),r=t.shallowRef(0),d=t.shallowRef(0),p=t.shallowRef(0),b=t.shallowRef(0),m=t.shallowRef(0),x=t.shallowRef(0);function v(){const w=V(e);if(!w){n&&(l.value=0,s.value=0,r.value=0,d.value=0,p.value=0,b.value=0,m.value=0,x.value=0);return}const h=w.getBoundingClientRect();l.value=h.height,s.value=h.bottom,r.value=h.left,d.value=h.right,p.value=h.top,b.value=h.width,m.value=h.x,x.value=h.y}function u(){c==="sync"?v():c==="next-frame"&&requestAnimationFrame(()=>v())}return nt(e,u),t.watch(()=>V(e),w=>!w&&u()),we(e,u,{attributeFilter:["style","class"]}),i&&ge("scroll",u,{capture:!0,passive:!0}),a&&ge("resize",u,{passive:!0}),tt(()=>{f&&u()}),{height:l,bottom:s,left:r,right:d,top:p,width:b,x:m,y:x,update:u}}const lt=e=>{const o=new DOMParser().parseFromString(e,"text/html");return Array.from(o.body.childNodes).some(n=>n.nodeType===1)},rt=(e=8)=>Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(""),at=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],ct=["innerHTML"],st={key:2},te=t.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean,default:!1}},emits:["cellInput"],setup(e,{emit:o}){const n=o,a=t.useTemplateRef("cell"),i=e.store.getCellData(e.colIndex,e.rowIndex),f=t.ref(""),c=t.ref(!1),l=e.store.columns[e.colIndex],s=e.store.rows[e.rowIndex],r=l.align||"center",d=l.width||"40ch",p=t.computed(()=>e.store.getCellDisplayValue(e.colIndex,e.rowIndex)),b=t.computed(()=>typeof p.value=="string"?lt(p.value):!1),m=t.computed(()=>{var h;return{textAlign:r,width:d,fontWeight:c.value?"bold":"inherit",paddingLeft:e.store.getIndent(e.colIndex,(h=e.store.display[e.rowIndex])==null?void 0:h.indent)}}),x=t.computed(()=>({"sticky-column":e.pinned,"cell-modified":c.value})),v=()=>{const{left:h,bottom:S,width:O,height:q}=ye(a);l.mask,l.modalComponent&&e.store.$patch(A=>{A.modal.visible=!0,A.modal.colIndex=e.colIndex,A.modal.rowIndex=e.rowIndex,A.modal.left=h,A.modal.bottom=S,A.modal.width=O,A.modal.height=q,A.modal.cell=a.value,typeof l.modalComponent=="function"?A.modal.component=l.modalComponent({table:A.table,row:s,column:l}):A.modal.component=l.modalComponent,A.modal.componentProps=l.modalComponentExtraProps})};if(e.addNavigation){let h={...Q,"keydown.f2":v,"keydown.alt.up":v,"keydown.alt.down":v,"keydown.alt.left":v,"keydown.alt.right":v};typeof e.addNavigation=="object"&&(h={...h,...e.addNavigation}),Z([{selectors:a,handlers:h}])}const u=()=>{a.value&&(f.value=a.value.textContent)},w=h=>{const S=h.target;S.textContent!==f.value&&(n("cellInput",e.colIndex,e.rowIndex,S.textContent,f.value),f.value=S.textContent,l.format?(c.value=S.textContent!==e.store.getFormattedValue(e.colIndex,e.rowIndex,i),e.store.setCellText(e.colIndex,e.rowIndex,S.textContent)):(c.value=S.textContent!==i,e.store.setCellData(e.colIndex,e.rowIndex,S.textContent)))};return(h,S)=>(t.openBlock(),t.createElementBlock("td",{ref:"cell","data-colindex":h.colIndex,"data-rowindex":h.rowIndex,"data-editable":t.unref(l).edit,contenteditable:t.unref(l).edit,tabindex:h.tabIndex,spellcheck:!1,style:t.normalizeStyle(m.value),onFocus:u,onPaste:w,onInput:w,onClick:v,class:t.normalizeClass(["atable-cell",x.value])},[t.unref(l).cellComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(l).cellComponent),t.mergeProps({key:0,value:p.value},t.unref(l).cellComponentProps),null,16,["value"])):b.value?(t.openBlock(),t.createElementBlock("span",{key:1,innerHTML:p.value},null,8,ct)):(t.openBlock(),t.createElementBlock("span",st,t.toDisplayString(p.value),1))],46,at))}}),it=["tabindex"],dt=["tabindex"],ft=["colspan"],ut=t.defineComponent({__name:"AExpansionRow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object]}},setup(e){const o=t.useTemplateRef("rowEl"),n=t.computed(()=>e.store.display[e.rowIndex].expanded?"▼":"►");if(e.addNavigation){const a={"keydown.control.g":i=>{i.stopPropagation(),i.preventDefault(),e.store.toggleRowExpand(e.rowIndex)}};typeof e.addNavigation=="object"&&Object.assign(a,e.addNavigation),Z([{selectors:o,handlers:a}])}return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("tr",t.mergeProps(a.$attrs,{ref:"rowEl",tabindex:a.tabIndex,class:"expandable-row"}),[t.createElementVNode("td",{tabIndex:-1,onClick:i[0]||(i[0]=f=>a.store.toggleRowExpand(a.rowIndex)),class:"row-index"},t.toDisplayString(n.value),1),t.renderSlot(a.$slots,"row",{},void 0,!0)],16,it),a.store.display[a.rowIndex].expanded?(t.openBlock(),t.createElementBlock("tr",{key:0,ref:"rowExpanded",tabindex:a.tabIndex,class:"expanded-row"},[t.createElementVNode("td",{tabIndex:-1,colspan:a.store.columns.length+1,class:"expanded-row-content"},[t.renderSlot(a.$slots,"content",{},void 0,!0)],8,ft)],8,dt)):t.createCommentVNode("",!0)],64))}}),N=(e,o)=>{const n=e.__vccOpts||e;for(const[a,i]of o)n[a]=i;return n},xe=N(ut,[["__scopeId","data-v-60affd71"]]),mt=["tabindex"],oe=N(t.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(e){const o=t.useTemplateRef("rowEl"),n=t.computed(()=>e.store.isRowVisible(e.rowIndex)),a=t.computed(()=>e.store.getRowExpandSymbol(e.rowIndex));if(e.addNavigation){let i=Q;typeof e.addNavigation=="object"&&(i={...i,...e.addNavigation}),Z([{selectors:o,handlers:i}])}return(i,f)=>t.withDirectives((t.openBlock(),t.createElementBlock("tr",{ref:"rowEl",tabindex:i.tabIndex,class:"atable-row"},[i.store.config.view!=="uncounted"?t.renderSlot(i.$slots,"index",{key:0},()=>[i.store.config.view==="list"?(t.openBlock(),t.createElementBlock("td",{key:0,tabIndex:-1,class:t.normalizeClass(["list-index",i.store.hasPinnedColumns?"sticky-index":""])},t.toDisplayString(i.rowIndex+1),3)):i.store.config.view==="tree"?(t.openBlock(),t.createElementBlock("td",{key:1,tabIndex:-1,class:t.normalizeClass(["tree-index",i.store.hasPinnedColumns?"sticky-index":""]),onClick:f[0]||(f[0]=c=>i.store.toggleRowExpand(i.rowIndex))},t.toDisplayString(a.value),3)):t.createCommentVNode("",!0)],!0):t.createCommentVNode("",!0),t.renderSlot(i.$slots,"default",{},void 0,!0)],8,mt)),[[t.vShow,n.value]])}}),[["__scopeId","data-v-9c529d3d"]]),ve=K?window:void 0;function H(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function L(...e){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},a=(l,s,r,d)=>(l.addEventListener(s,r,d),()=>l.removeEventListener(s,r,d)),i=t.computed(()=>{const l=M(t.toValue(e[0])).filter(s=>s!=null);return l.every(s=>typeof s!="string")?l:void 0}),f=be(()=>{var l,s;return[(s=(l=i.value)==null?void 0:l.map(r=>H(r)))!=null?s:[ve].filter(r=>r!=null),M(t.toValue(i.value?e[1]:e[0])),M(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([l,s,r,d])=>{if(n(),!(l!=null&&l.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const p=pe(d)?{...d}:d;o.push(...l.flatMap(b=>s.flatMap(m=>r.map(x=>a(b,m,x,p)))))},{flush:"post"}),c=()=>{f(),n()};return P(n),c}let ke=!1;function Ee(e,o,n={}){const{window:a=ve,ignore:i=[],capture:f=!0,detectIframe:c=!1,controls:l=!1}=n;if(!a)return l?{stop:R,cancel:R,trigger:R}:R;if(_&&!ke){ke=!0;const u={passive:!0};Array.from(a.document.body.children).forEach(w=>L(w,"click",R,u)),L(a.document.documentElement,"click",R,u)}let s=!0;const r=u=>t.toValue(i).some(w=>{if(typeof w=="string")return Array.from(a.document.querySelectorAll(w)).some(h=>h===u.target||u.composedPath().includes(h));{const h=H(w);return h&&(u.target===h||u.composedPath().includes(h))}});function d(u){const w=t.toValue(u);return w&&w.$.subTree.shapeFlag===16}function p(u,w){const h=t.toValue(u),S=h.$.subTree&&h.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(O=>O.el===w.target||w.composedPath().includes(O.el))}const b=u=>{const w=H(e);if(u.target!=null&&!(!(w instanceof Element)&&d(e)&&p(e,u))&&!(!w||w===u.target||u.composedPath().includes(w))){if("detail"in u&&u.detail===0&&(s=!r(u)),!s){s=!0;return}o(u)}};let m=!1;const x=[L(a,"click",u=>{m||(m=!0,setTimeout(()=>{m=!1},0),b(u))},{passive:!0,capture:f}),L(a,"pointerdown",u=>{const w=H(e);s=!r(u)&&!!(w&&!u.composedPath().includes(w))},{passive:!0}),c&&L(a,"blur",u=>{setTimeout(()=>{var w;const h=H(e);((w=a.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!(h!=null&&h.contains(a.document.activeElement))&&o(u)},0)},{passive:!0})].filter(Boolean),v=()=>x.forEach(u=>u());return l?{stop:v,cancel:()=>{s=!1},trigger:u=>{s=!0,b(u),s=!1}}:v}const pt={mounted(e,o){const n=!o.modifiers.bubble;if(typeof o.value=="function")e.__onClickOutside_stop=Ee(e,o.value,{capture:n});else{const[a,i]=o.value;e.__onClickOutside_stop=Ee(e,a,Object.assign({capture:n},i))}},unmounted(e){e.__onClickOutside_stop()}};function ne(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Ce(e){const o=window.getComputedStyle(e);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&e.clientWidth<e.scrollWidth||o.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:Ce(n)}}function bt(e){const o=e||window.event,n=o.target;return Ce(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)}const le=new WeakMap;function gt(e,o=!1){const n=t.ref(o);let a=null,i="";t.watch(et(e),l=>{const s=ne(t.toValue(l));if(s){const r=s;if(le.get(r)||le.set(r,r.style.overflow),r.style.overflow!=="hidden"&&(i=r.style.overflow),r.style.overflow==="hidden")return n.value=!0;if(n.value)return r.style.overflow="hidden"}},{immediate:!0});const f=()=>{const l=ne(t.toValue(e));!l||n.value||(_&&(a=L(l,"touchmove",s=>{bt(s)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},c=()=>{const l=ne(t.toValue(e));!l||!n.value||(_&&(a==null||a()),l.style.overflow=i,le.delete(l),n.value=!1)};return P(c),t.computed({get(){return n.value},set(l){l?f():c()}})}function ht(){let e=!1;const o=t.shallowRef(!1);return(n,a)=>{if(o.value=a.value,e)return;e=!0;const i=gt(n,a.value);t.watch(o,f=>i.value=f)}}ht();const wt={key:0,id:"resizable"},yt={class:"atable-header-row",tabindex:"-1"},re=t.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(e){return(o,n)=>o.columns.length?(t.openBlock(),t.createElementBlock("thead",wt,[t.createElementVNode("tr",yt,[o.store.zeroColumn?(t.openBlock(),t.createElementBlock("th",{key:0,id:"header-index",class:t.normalizeClass([[o.store.hasPinnedColumns?"sticky-index":"",o.store.config.view==="tree"?"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,(a,i)=>(t.openBlock(),t.createElementBlock("th",{key:a.name,tabindex:"-1",style:t.normalizeStyle(o.store.getHeaderCellStyle(a)),class:t.normalizeClass(a.pinned?"sticky-column":"")},[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(a.label||String.fromCharCode(i+97).toUpperCase()),1)])],6))),128))])])):t.createCommentVNode("",!0)}}),ae=t.defineComponent({__name:"ATableModal",props:{store:{}},setup(e){const o=t.useTemplateRef("amodal"),{width:n,height:a}=ye(o),i=t.computed(()=>{var p,b,m,x;if(!(e.store.modal.height&&e.store.modal.width&&e.store.modal.left&&e.store.modal.bottom))return;const f=(p=e.store.modal.cell)==null?void 0:p.closest("table"),c=f.offsetHeight||0,l=f.offsetWidth||0;let s=((b=e.store.modal.cell)==null?void 0:b.offsetTop)||0;const r=((m=f.querySelector("thead"))==null?void 0:m.offsetHeight)||0;s+=r,s=s+a.value<c?s:s-(a.value+e.store.modal.height);let d=((x=e.store.modal.cell)==null?void 0:x.offsetLeft)||0;return d=d+n.value<=l?d:d-(n.value-e.store.modal.width),{left:`${d}px`,top:`${s}px`}});return(f,c)=>(t.openBlock(),t.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:c[0]||(c[0]=t.withModifiers(()=>{},["stop"])),onInput:c[1]||(c[1]=t.withModifiers(()=>{},["stop"])),style:t.normalizeStyle(i.value)},[t.renderSlot(f.$slots,"default")],36))}}),Se=e=>{const o=e.id||rt();return Re.defineStore(`table-${o}`,()=>{const a=()=>{const g={};for(const[y,k]of f.value.entries())for(const[C,I]of c.value.entries())g[`${y}:${C}`]=I[k.name];return g},i=g=>{const y=[Object.assign({},{rowModified:!1})];if(g&&"0:0"in g)return g;const k=new Set;for(let C=c.value.length-1;C>=0;C--){const I=c.value[C];I.parent&&k.add(I.parent),y[C]={childrenOpen:!1,expanded:!1,indent:I.indent||0,isParent:k.has(C),isRoot:I.parent===null||I.parent===void 0,rowModified:!1,open:I.parent===null||I.parent===void 0,parent:I.parent}}return y},f=t.ref(e.columns),c=t.ref(e.rows),l=t.ref(e.config||{}),s=t.ref(e.table||a()),r=t.ref(i(e.display)),d=t.ref(e.modal||{visible:!1}),p=t.ref({}),b=t.computed(()=>f.value.some(g=>g.pinned)),m=t.computed(()=>`${Math.ceil(c.value.length/100+1)}ch`),x=t.computed(()=>l.value.view?["list","tree","list-expansion"].includes(l.value.view):!1),v=(g,y)=>s.value[`${g}:${y}`],u=(g,y,k)=>{const C=`${g}:${y}`,I=f.value[g];s.value[C]!==k&&(r.value[y].rowModified=!0),s.value[C]=k,c.value[y][I.name]=k},w=(g,y,k)=>{const C=`${g}:${y}`;s.value[C]!==k&&(r.value[y].rowModified=!0,p.value[C]=k)},h=g=>({minWidth:g.width||"40ch",textAlign:g.align||"center",width:l.value.fullWidth?"auto":void 0}),S=g=>l.value.view!=="tree"||r.value[g].isRoot||r.value[g].open,O=g=>l.value.view!=="tree"?"":r.value[g].isRoot||r.value[g].isParent?r.value[g].childrenOpen?"-":"+":"",q=g=>{if(l.value.view==="tree"){r.value[g].childrenOpen=!r.value[g].childrenOpen;for(let y=c.value.length-1;y>=0;y--)r.value[y].parent===g&&(r.value[y].open=!r.value[y].open,r.value[y].childrenOpen&&q(y))}else l.value.view==="list-expansion"&&(r.value[g].expanded=!r.value[g].expanded)},A=(g,y)=>{const k=v(g,y);return $e(g,y,k)},$e=(g,y,k)=>{const C=f.value[g],I=c.value[y],W=C.format;return W?typeof W=="function"?W(k,{table:s.value,row:I,column:C}):typeof W=="string"?Function(`"use strict";return (${W})`)()(k,{table:s.value,row:I,column:C}):k:k};return{columns:f,config:l,display:r,modal:d,rows:c,table:s,updates:p,hasPinnedColumns:b,numberedRowWidth:m,zeroColumn:x,closeModal:g=>{var y;g.target instanceof Node&&(y=d.value.parent)!=null&&y.contains(g.target)||d.value.visible&&(d.value.visible=!1)},getCellData:v,getCellDisplayValue:A,getFormattedValue:$e,getHeaderCellStyle:h,getIndent:(g,y)=>y&&g===0&&y>0?`${y}ch`:"inherit",getRowExpandSymbol:O,isRowVisible:S,setCellData:u,setCellText:w,toggleRowExpand:q}})()},Ie=N(t.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(e,{expose:o,emit:n}){const a=n,i=t.useTemplateRef("table"),f=e.modelValue?e.modelValue:e.rows,c=Se({columns:e.columns,rows:f,id:e.id,config:e.config});c.$onAction(({name:r,store:d,args:p,after:b})=>{if(r==="setCellData"){const[m,x,v]=p,u=d.getCellData(m,x);b(()=>{a("cellUpdate",m,x,v,u)})}}),t.watch(()=>c.rows,r=>{a("update:modelValue",r)},{deep:!0}),t.onMounted(()=>{e.columns.some(r=>r.pinned)&&(s(),c.config.view==="tree"&&we(i,s,{childList:!0,subtree:!0}))});const l=(r,d,p,b)=>{a("cellUpdate",r,d,p,b)},s=()=>{const r=i.value,d=r==null?void 0:r.rows[0],p=r==null?void 0:r.rows[1],b=d?Array.from(d.cells):[];for(const[m,x]of b.entries()){const v=p==null?void 0:p.cells[m];v&&(x.style.width=`${v.offsetWidth}px`)}for(const m of(r==null?void 0:r.rows)||[]){let x=0;const v=[];for(const u of m.cells)(u.classList.contains("sticky-column")||u.classList.contains("sticky-index"))&&(u.style.left=`${x}px`,x+=u.offsetWidth,v.push(u));v.length>0&&v[v.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",r=>{if(r.key==="Escape"&&c.modal.visible){c.modal.visible=!1;const d=c.modal.parent;d&&t.nextTick().then(()=>{d.focus()})}}),o({store:c}),(r,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("table",{ref:"table",class:"atable",style:t.normalizeStyle({width:t.unref(c).config.fullWidth?"100%":"auto"})},[t.renderSlot(r.$slots,"header",{data:t.unref(c)},()=>[t.createVNode(re,{columns:t.unref(c).columns,store:t.unref(c)},null,8,["columns","store"])],!0),t.createElementVNode("tbody",null,[t.renderSlot(r.$slots,"body",{data:t.unref(c)},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c).rows,(p,b)=>(t.openBlock(),t.createBlock(oe,{key:p.id,row:p,rowIndex:b,store:t.unref(c)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c).columns,(m,x)=>(t.openBlock(),t.createBlock(te,{key:m.name,store:t.unref(c),col:m,spellcheck:"false",pinned:m.pinned,rowIndex:b,colIndex:x,component:m.cellComponent,style:t.normalizeStyle({textAlign:(m==null?void 0:m.align)||"center",minWidth:(m==null?void 0:m.width)||"40ch",width:t.unref(c).config.fullWidth?"auto":null}),onCellInput:l},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),t.renderSlot(r.$slots,"footer",{data:t.unref(c)},void 0,!0),t.renderSlot(r.$slots,"modal",{data:t.unref(c)},()=>[t.withDirectives(t.createVNode(ae,{store:t.unref(c)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(c).modal.component),t.mergeProps({key:`${t.unref(c).modal.rowIndex}:${t.unref(c).modal.colIndex}`,colIndex:t.unref(c).modal.colIndex,rowIndex:t.unref(c).modal.rowIndex,store:t.unref(c)},t.unref(c).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[t.vShow,t.unref(c).modal.visible]])],!0)],4)),[[t.unref(pt),t.unref(c).closeModal]])}}),[["__scopeId","data-v-37bee2a6"]]),xt={},vt={class:"aloading"},kt={class:"aloading-header"};function Et(e,o){return t.openBlock(),t.createElementBlock("div",vt,[t.createElementVNode("h2",kt,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),o[0]||(o[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Ae=N(xt,[["render",Et],["__scopeId","data-v-a930a25b"]]),Ct={},St={class:"aloading"},It={class:"aloading-header"};function At(e,o){return t.openBlock(),t.createElementBlock("div",St,[t.createElementVNode("h2",It,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),o[0]||(o[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Te=N(Ct,[["render",At],["__scopeId","data-v-e1165876"]]);function Tt(e){e.component("ACell",te),e.component("AExpansionRow",xe),e.component("ARow",oe),e.component("ATable",Ie),e.component("ATableHeader",re),e.component("ATableLoading",Ae),e.component("ATableLoadingBar",Te),e.component("ATableModal",ae)}E.ACell=te,E.AExpansionRow=xe,E.ARow=oe,E.ATable=Ie,E.ATableHeader=re,E.ATableLoading=Ae,E.ATableLoadingBar=Te,E.ATableModal=ae,E.createTableStore=Se,E.install=Tt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(E,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],t):(E=typeof globalThis<"u"?globalThis:E||self,t(E["@stonecrop/atable"]={},E.Vue,E.pinia))})(this,function(E,t,$e){"use strict";var re=document.createElement("style");re.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);display:flex}.expandable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.expanded-row{display:flex;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-60affd71]: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))}.atable-row{display:flex;background-color:#fff}.table-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-9c529d3d]: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))}.atable-header-row{display:flex}.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)}#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}.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-ef1d9615]: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-ef1d9615]{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}.atable th[data-v-ef1d9615]{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-ef1d9615]:focus{outline:none}.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(re);function F(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const Re=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Me=e=>e!=null,Be=Object.prototype.toString,ze=e=>Be.call(e)==="[object Object]",Ve=()=>{};function W(e){return Array.isArray(e)?e:[e]}function Le(e,o,n){return t.watch(e,o,{...n,immediate:!0})}const B=Re?window:void 0;function z(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function O(...e){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,l,c,f)=>(r.addEventListener(l,c,f),()=>r.removeEventListener(l,c,f)),i=t.computed(()=>{const r=W(t.toValue(e[0])).filter(l=>l!=null);return r.every(l=>typeof l!="string")?r:void 0}),d=Le(()=>{var r,l;return[(l=(r=i.value)==null?void 0:r.map(c=>z(c)))!=null?l:[B].filter(c=>c!=null),W(t.toValue(i.value?e[1]:e[0])),W(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([r,l,c,f])=>{if(n(),!(r!=null&&r.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const g=ze(f)?{...f}:f;o.push(...r.flatMap(m=>l.flatMap(p=>c.map(y=>a(m,p,y,g)))))},{flush:"post"}),s=()=>{d(),n()};return F(n),s}function Oe(){const e=t.shallowRef(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function De(e){const o=Oe();return t.computed(()=>(o.value,!!e()))}function Pe(e,o,n={}){const{window:a=B,...i}=n;let d;const s=De(()=>a&&"MutationObserver"in a),r=()=>{d&&(d.disconnect(),d=void 0)},l=t.computed(()=>{const m=t.toValue(e),p=W(m).map(z).filter(Me);return new Set(p)}),c=t.watch(()=>l.value,m=>{r(),s.value&&m.size&&(d=new MutationObserver(o),m.forEach(p=>d.observe(p,i)))},{immediate:!0,flush:"post"}),f=()=>d==null?void 0:d.takeRecords(),g=()=>{c(),r()};return F(g),{isSupported:s,stop:g,takeRecords:f}}function Ne(e,o,n={}){const{window:a=B,document:i=a==null?void 0:a.document,flush:d="sync"}=n;if(!a||!i)return Ve;let s;const r=f=>{s==null||s(),s=f},l=t.watchEffect(()=>{const f=z(e);if(f){const{stop:g}=Pe(i,m=>{m.map(p=>[...p.removedNodes]).flat().some(p=>p===f||p.contains(f))&&o(m)},{window:a,childList:!0,subtree:!0});r(g)}},{flush:d}),c=()=>{l(),r()};return F(c),c}function He(e={}){var o;const{window:n=B,deep:a=!0,triggerOnRemoval:i=!1}=e,d=(o=e.document)!=null?o:n==null?void 0:n.document,s=()=>{var c;let f=d==null?void 0:d.activeElement;if(a)for(;f!=null&&f.shadowRoot;)f=(c=f==null?void 0:f.shadowRoot)==null?void 0:c.activeElement;return f},r=t.ref(),l=()=>{r.value=s()};if(n){const c={capture:!0,passive:!0};O(n,"blur",f=>{f.relatedTarget===null&&l()},c),O(n,"focus",l,c)}return i&&Ne(r,l,{document:d}),l(),r}const We="focusin",je="focusout",Fe=":focus-within";function qe(e,o={}){const{window:n=B}=o,a=t.computed(()=>z(e)),i=t.shallowRef(!1),d=t.computed(()=>i.value),s=He(o);if(!n||!s.value)return{focused:d};const r={passive:!0};return O(a,We,()=>i.value=!0,r),O(a,je,()=>{var l,c,f;return i.value=(f=(c=(l=a.value)==null?void 0:l.matches)==null?void 0:c.call(l,Fe))!=null?f:!1},r),{focused:d}}function Ue(e,{window:o=B,scrollTarget:n}={}){const a=t.ref(!1),i=()=>{if(!o)return;const d=o.document,s=z(e);if(!s)a.value=!1;else{const r=s.getBoundingClientRect();a.value=r.top<=(o.innerHeight||d.documentElement.clientHeight)&&r.left<=(o.innerWidth||d.documentElement.clientWidth)&&r.bottom>=0&&r.right>=0}};return t.watch(()=>z(e),()=>i(),{immediate:!0,flush:"post"}),o&&O(n||o,"scroll",i,{capture:!1,passive:!0}),a}const T=e=>{let o=Ue(e).value;return o=o&&e.offsetHeight>0,o},I=e=>e.tabIndex>=0,ae=e=>{const o=e.target;return q(o)},q=e=>{var o;let n;if(e instanceof HTMLTableCellElement){const a=(o=e.parentElement)==null?void 0:o.previousElementSibling;if(a){const i=Array.from(a.children)[e.cellIndex];i&&(n=i)}}else if(e instanceof HTMLTableRowElement){const a=e.previousElementSibling;a&&(n=a)}return n&&(!I(n)||!T(n))?q(n):n},Ye=e=>{var o;const n=e.target;let a;if(n instanceof HTMLTableCellElement){const i=(o=n.parentElement)==null?void 0:o.parentElement;if(i){const d=i.firstElementChild,s=d==null?void 0:d.children[n.cellIndex];s&&(a=s)}}else if(n instanceof HTMLTableRowElement){const i=n.parentElement;if(i){const d=i.firstElementChild;d&&(a=d)}}return a&&(!I(a)||!T(a))?U(a):a},se=e=>{const o=e.target;return U(o)},U=e=>{var o;let n;if(e instanceof HTMLTableCellElement){const a=(o=e.parentElement)==null?void 0:o.nextElementSibling;if(a){const i=Array.from(a.children)[e.cellIndex];i&&(n=i)}}else if(e instanceof HTMLTableRowElement){const a=e.nextElementSibling;a&&(n=a)}return n&&(!I(n)||!T(n))?U(n):n},Ge=e=>{var o;const n=e.target;let a;if(n instanceof HTMLTableCellElement){const i=(o=n.parentElement)==null?void 0:o.parentElement;if(i){const d=i.lastElementChild,s=d==null?void 0:d.children[n.cellIndex];s&&(a=s)}}else if(n instanceof HTMLTableRowElement){const i=n.parentElement;if(i){const d=i.lastElementChild;d&&(a=d)}}return a&&(!I(a)||!T(a))?q(a):a},ce=e=>{const o=e.target;return Y(o)},Y=e=>{var o;let n;if(e.previousElementSibling)n=e.previousElementSibling;else{const a=(o=e.parentElement)==null?void 0:o.previousElementSibling;n=a==null?void 0:a.lastElementChild}return n&&(!I(n)||!T(n))?Y(n):n},ie=e=>{const o=e.target;return G(o)},G=e=>{var o;let n;if(e.nextElementSibling)n=e.nextElementSibling;else{const a=(o=e.parentElement)==null?void 0:o.nextElementSibling;n=a==null?void 0:a.firstElementChild}return n&&(!I(n)||!T(n))?G(n):n},de=e=>{const o=e.target.parentElement,n=o==null?void 0:o.firstElementChild;return n&&(!I(n)||!T(n))?G(n):n},fe=e=>{const o=e.target.parentElement,n=o==null?void 0:o.lastElementChild;return n&&(!I(n)||!T(n))?Y(n):n},j=["alt","control","shift","meta"],Xe={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},X={"keydown.up":e=>{const o=ae(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.down":e=>{const o=se(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.left":e=>{const o=ce(e);e.preventDefault(),e.stopPropagation(),o&&o.focus()},"keydown.right":e=>{const o=ie(e);e.preventDefault(),e.stopPropagation(),o&&o.focus()},"keydown.control.up":e=>{const o=Ye(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.down":e=>{const o=Ge(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.left":e=>{const o=de(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.control.right":e=>{const o=fe(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.end":e=>{const o=fe(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const o=se(e);o&&o.focus()}},"keydown.shift.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const o=ae(e);o&&o.focus()}},"keydown.home":e=>{const o=de(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.tab":e=>{const o=ie(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())},"keydown.shift.tab":e=>{const o=ce(e);o&&(e.preventDefault(),e.stopPropagation(),o.focus())}};function J(e){const o=s=>{let r=null;return s.parent&&(typeof s.parent=="string"?r=document.querySelector(s.parent):s.parent instanceof HTMLElement?r=s.parent:r=s.parent.value),r},n=s=>{var r;const l=o(s);let c=[];if(typeof s.selectors=="string")c=l?Array.from(l.querySelectorAll(s.selectors)):Array.from(document.querySelectorAll(s.selectors));else if(Array.isArray(s.selectors))for(const f of s.selectors)f instanceof HTMLElement?c.push(f):c.push(f.$el);else if(s.selectors instanceof HTMLElement)c.push(s.selectors);else if((r=s.selectors)!=null&&r.value)if(Array.isArray(s.selectors.value))for(const f of s.selectors.value)f instanceof HTMLElement?c.push(f):c.push(f.$el);else c.push(s.selectors.value);return c},a=s=>{const r=o(s);let l=[];return s.selectors?l=n(s):r&&(l=Array.from(r.children).filter(c=>I(c)&&T(c))),l},i=s=>r=>{const l=Xe[r.key]||r.key.toLowerCase();if(j.includes(l))return;const c=s.handlers||X;for(const f of Object.keys(c)){const[g,...m]=f.split(".");if(g==="keydown"&&m.includes(l)){const p=c[f],y=m.filter(u=>j.includes(u)),v=j.some(u=>{const b=u.charAt(0).toUpperCase()+u.slice(1);return r.getModifierState(b)});if(y.length>0){if(v){for(const u of j)if(m.includes(u)){const b=u.charAt(0).toUpperCase()+u.slice(1);r.getModifierState(b)&&p(r)}}}else v||p(r)}}},d=[];t.onMounted(()=>{for(const s of e){const r=o(s),l=a(s),c=i(s),f=r?[r]:l;for(const g of f){const{focused:m}=qe(t.ref(g)),p=t.watch(m,y=>{y?g.addEventListener("keydown",c):g.removeEventListener("keydown",c)});d.push(p)}}}),t.onBeforeUnmount(()=>{for(const s of d)s()})}function D(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Je=e=>e!=null,Qe=Object.prototype.toString,ue=e=>Qe.call(e)==="[object Object]",$=()=>{},Z=Ze();function Ze(){var e,o;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window==null?void 0:window.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ke(e){return t.getCurrentInstance()}function R(e){return Array.isArray(e)?e:[e]}function _e(...e){if(e.length!==1)return t.toRef(...e);const o=e[0];return typeof o=="function"?t.readonly(t.customRef(()=>({get:o,set:$}))):t.ref(o)}function et(e,o=!0,n){Ke()?t.onMounted(e,n):o?e():t.nextTick(e)}function me(e,o,n){return t.watch(e,o,{...n,immediate:!0})}const K=Q?window:void 0;function V(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function pe(...e){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,l,c,f)=>(r.addEventListener(l,c,f),()=>r.removeEventListener(l,c,f)),i=t.computed(()=>{const r=R(t.toValue(e[0])).filter(l=>l!=null);return r.every(l=>typeof l!="string")?r:void 0}),d=me(()=>{var r,l;return[(l=(r=i.value)==null?void 0:r.map(c=>V(c)))!=null?l:[K].filter(c=>c!=null),R(t.toValue(i.value?e[1]:e[0])),R(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([r,l,c,f])=>{if(n(),!(r!=null&&r.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const g=ue(f)?{...f}:f;o.push(...r.flatMap(m=>l.flatMap(p=>c.map(y=>a(m,p,y,g)))))},{flush:"post"}),s=()=>{d(),n()};return D(n),s}function tt(){const e=t.shallowRef(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function ge(e){const o=tt();return t.computed(()=>(o.value,!!e()))}function be(e,o,n={}){const{window:a=K,...i}=n;let d;const s=ge(()=>a&&"MutationObserver"in a),r=()=>{d&&(d.disconnect(),d=void 0)},l=t.computed(()=>{const m=t.toValue(e),p=R(m).map(V).filter(Je);return new Set(p)}),c=t.watch(()=>l.value,m=>{r(),s.value&&m.size&&(d=new MutationObserver(o),m.forEach(p=>d.observe(p,i)))},{immediate:!0,flush:"post"}),f=()=>d==null?void 0:d.takeRecords(),g=()=>{c(),r()};return D(g),{isSupported:s,stop:g,takeRecords:f}}function ot(e,o,n={}){const{window:a=K,...i}=n;let d;const s=ge(()=>a&&"ResizeObserver"in a),r=()=>{d&&(d.disconnect(),d=void 0)},l=t.computed(()=>{const g=t.toValue(e);return Array.isArray(g)?g.map(m=>V(m)):[V(g)]}),c=t.watch(l,g=>{if(r(),s.value&&a){d=new ResizeObserver(o);for(const m of g)m&&d.observe(m,i)}},{immediate:!0,flush:"post"}),f=()=>{r(),c()};return D(f),{isSupported:s,stop:f}}function he(e,o={}){const{reset:n=!0,windowResize:a=!0,windowScroll:i=!0,immediate:d=!0,updateTiming:s="sync"}=o,r=t.shallowRef(0),l=t.shallowRef(0),c=t.shallowRef(0),f=t.shallowRef(0),g=t.shallowRef(0),m=t.shallowRef(0),p=t.shallowRef(0),y=t.shallowRef(0);function v(){const b=V(e);if(!b){n&&(r.value=0,l.value=0,c.value=0,f.value=0,g.value=0,m.value=0,p.value=0,y.value=0);return}const x=b.getBoundingClientRect();r.value=x.height,l.value=x.bottom,c.value=x.left,f.value=x.right,g.value=x.top,m.value=x.width,p.value=x.x,y.value=x.y}function u(){s==="sync"?v():s==="next-frame"&&requestAnimationFrame(()=>v())}return ot(e,u),t.watch(()=>V(e),b=>!b&&u()),be(e,u,{attributeFilter:["style","class"]}),i&&pe("scroll",u,{capture:!0,passive:!0}),a&&pe("resize",u,{passive:!0}),et(()=>{d&&u()}),{height:r,bottom:l,left:c,right:f,top:g,width:m,x:p,y,update:u}}const nt=e=>{const o=new DOMParser().parseFromString(e,"text/html");return Array.from(o.body.childNodes).some(n=>n.nodeType===1)},lt=(e=8)=>Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(""),rt=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],at=["innerHTML"],st={key:2},_=t.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean,default:!1}},setup(e){const o=t.useTemplateRef("cell"),n=e.store.getCellData(e.colIndex,e.rowIndex),a=t.ref(""),i=t.ref(!1),d=e.store.columns[e.colIndex],s=e.store.rows[e.rowIndex],r=d.align||"center",l=d.width||"40ch",c=t.computed(()=>e.store.getCellDisplayValue(e.colIndex,e.rowIndex)),f=t.computed(()=>typeof c.value=="string"?nt(c.value):!1),g=t.computed(()=>{var u;return{textAlign:r,width:l,fontWeight:i.value?"bold":"inherit",paddingLeft:e.store.getIndent(e.colIndex,(u=e.store.display[e.rowIndex])==null?void 0:u.indent)}}),m=t.computed(()=>({"sticky-column":e.pinned,"cell-modified":i.value})),p=()=>{const{left:u,bottom:b,width:x,height:M}=he(o);d.mask,d.modalComponent&&e.store.$patch(C=>{C.modal.visible=!0,C.modal.colIndex=e.colIndex,C.modal.rowIndex=e.rowIndex,C.modal.left=u,C.modal.bottom=b,C.modal.width=x,C.modal.height=M,C.modal.cell=o.value,typeof d.modalComponent=="function"?C.modal.component=d.modalComponent({table:C.table,row:s,column:d}):C.modal.component=d.modalComponent,C.modal.componentProps=d.modalComponentExtraProps})};if(e.addNavigation){let u={...X,"keydown.f2":p,"keydown.alt.up":p,"keydown.alt.down":p,"keydown.alt.left":p,"keydown.alt.right":p};typeof e.addNavigation=="object"&&(u={...u,...e.addNavigation}),J([{selectors:o,handlers:u}])}const y=()=>{o.value&&(a.value=o.value.textContent)},v=u=>{const b=u.target;b.textContent!==a.value&&(a.value=b.textContent,d.format?(i.value=b.textContent!==e.store.getFormattedValue(e.colIndex,e.rowIndex,n),e.store.setCellText(e.colIndex,e.rowIndex,b.textContent)):(i.value=b.textContent!==n,e.store.setCellData(e.colIndex,e.rowIndex,b.textContent)))};return(u,b)=>(t.openBlock(),t.createElementBlock("td",{ref:"cell","data-colindex":u.colIndex,"data-rowindex":u.rowIndex,"data-editable":t.unref(d).edit,contenteditable:t.unref(d).edit,tabindex:u.tabIndex,spellcheck:!1,style:t.normalizeStyle(g.value),onFocus:y,onPaste:v,onInput:v,onClick:p,class:t.normalizeClass(["atable-cell",m.value])},[t.unref(d).cellComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(d).cellComponent),t.mergeProps({key:0,value:c.value},t.unref(d).cellComponentProps),null,16,["value"])):f.value?(t.openBlock(),t.createElementBlock("span",{key:1,innerHTML:c.value},null,8,at)):(t.openBlock(),t.createElementBlock("span",st,t.toDisplayString(c.value),1))],46,rt))}}),ct=["tabindex"],it=["tabindex"],dt=["colspan"],ft=t.defineComponent({__name:"AExpansionRow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object]}},setup(e){const o=t.useTemplateRef("rowEl"),n=t.computed(()=>e.store.display[e.rowIndex].expanded?"▼":"►");if(e.addNavigation){const a={"keydown.control.g":i=>{i.stopPropagation(),i.preventDefault(),e.store.toggleRowExpand(e.rowIndex)}};typeof e.addNavigation=="object"&&Object.assign(a,e.addNavigation),J([{selectors:o,handlers:a}])}return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("tr",t.mergeProps(a.$attrs,{ref:"rowEl",tabindex:a.tabIndex,class:"expandable-row"}),[t.createElementVNode("td",{tabIndex:-1,onClick:i[0]||(i[0]=d=>a.store.toggleRowExpand(a.rowIndex)),class:"row-index"},t.toDisplayString(n.value),1),t.renderSlot(a.$slots,"row",{},void 0,!0)],16,ct),a.store.display[a.rowIndex].expanded?(t.openBlock(),t.createElementBlock("tr",{key:0,ref:"rowExpanded",tabindex:a.tabIndex,class:"expanded-row"},[t.createElementVNode("td",{tabIndex:-1,colspan:a.store.columns.length+1,class:"expanded-row-content"},[t.renderSlot(a.$slots,"content",{},void 0,!0)],8,dt)],8,it)):t.createCommentVNode("",!0)],64))}}),P=(e,o)=>{const n=e.__vccOpts||e;for(const[a,i]of o)n[a]=i;return n},we=P(ft,[["__scopeId","data-v-60affd71"]]),ut=["tabindex"],ee=P(t.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(e){const o=t.useTemplateRef("rowEl"),n=t.computed(()=>e.store.isRowVisible(e.rowIndex)),a=t.computed(()=>e.store.getRowExpandSymbol(e.rowIndex));if(e.addNavigation){let i=X;typeof e.addNavigation=="object"&&(i={...i,...e.addNavigation}),J([{selectors:o,handlers:i}])}return(i,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("tr",{ref:"rowEl",tabindex:i.tabIndex,class:"atable-row"},[i.store.config.view!=="uncounted"?t.renderSlot(i.$slots,"index",{key:0},()=>[i.store.config.view==="list"?(t.openBlock(),t.createElementBlock("td",{key:0,tabIndex:-1,class:t.normalizeClass(["list-index",i.store.hasPinnedColumns?"sticky-index":""])},t.toDisplayString(i.rowIndex+1),3)):i.store.config.view==="tree"?(t.openBlock(),t.createElementBlock("td",{key:1,tabIndex:-1,class:t.normalizeClass(["tree-index",i.store.hasPinnedColumns?"sticky-index":""]),onClick:d[0]||(d[0]=s=>i.store.toggleRowExpand(i.rowIndex))},t.toDisplayString(a.value),3)):t.createCommentVNode("",!0)],!0):t.createCommentVNode("",!0),t.renderSlot(i.$slots,"default",{},void 0,!0)],8,ut)),[[t.vShow,n.value]])}}),[["__scopeId","data-v-9c529d3d"]]),ye=Q?window:void 0;function N(e){var o;const n=t.toValue(e);return(o=n==null?void 0:n.$el)!=null?o:n}function L(...e){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,l,c,f)=>(r.addEventListener(l,c,f),()=>r.removeEventListener(l,c,f)),i=t.computed(()=>{const r=R(t.toValue(e[0])).filter(l=>l!=null);return r.every(l=>typeof l!="string")?r:void 0}),d=me(()=>{var r,l;return[(l=(r=i.value)==null?void 0:r.map(c=>N(c)))!=null?l:[ye].filter(c=>c!=null),R(t.toValue(i.value?e[1]:e[0])),R(t.unref(i.value?e[2]:e[1])),t.toValue(i.value?e[3]:e[2])]},([r,l,c,f])=>{if(n(),!(r!=null&&r.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const g=ue(f)?{...f}:f;o.push(...r.flatMap(m=>l.flatMap(p=>c.map(y=>a(m,p,y,g)))))},{flush:"post"}),s=()=>{d(),n()};return D(n),s}let xe=!1;function ve(e,o,n={}){const{window:a=ye,ignore:i=[],capture:d=!0,detectIframe:s=!1,controls:r=!1}=n;if(!a)return r?{stop:$,cancel:$,trigger:$}:$;if(Z&&!xe){xe=!0;const u={passive:!0};Array.from(a.document.body.children).forEach(b=>L(b,"click",$,u)),L(a.document.documentElement,"click",$,u)}let l=!0;const c=u=>t.toValue(i).some(b=>{if(typeof b=="string")return Array.from(a.document.querySelectorAll(b)).some(x=>x===u.target||u.composedPath().includes(x));{const x=N(b);return x&&(u.target===x||u.composedPath().includes(x))}});function f(u){const b=t.toValue(u);return b&&b.$.subTree.shapeFlag===16}function g(u,b){const x=t.toValue(u),M=x.$.subTree&&x.$.subTree.children;return M==null||!Array.isArray(M)?!1:M.some(C=>C.el===b.target||b.composedPath().includes(C.el))}const m=u=>{const b=N(e);if(u.target!=null&&!(!(b instanceof Element)&&f(e)&&g(e,u))&&!(!b||b===u.target||u.composedPath().includes(b))){if("detail"in u&&u.detail===0&&(l=!c(u)),!l){l=!0;return}o(u)}};let p=!1;const y=[L(a,"click",u=>{p||(p=!0,setTimeout(()=>{p=!1},0),m(u))},{passive:!0,capture:d}),L(a,"pointerdown",u=>{const b=N(e);l=!c(u)&&!!(b&&!u.composedPath().includes(b))},{passive:!0}),s&&L(a,"blur",u=>{setTimeout(()=>{var b;const x=N(e);((b=a.document.activeElement)==null?void 0:b.tagName)==="IFRAME"&&!(x!=null&&x.contains(a.document.activeElement))&&o(u)},0)},{passive:!0})].filter(Boolean),v=()=>y.forEach(u=>u());return r?{stop:v,cancel:()=>{l=!1},trigger:u=>{l=!0,m(u),l=!1}}:v}const mt={mounted(e,o){const n=!o.modifiers.bubble;if(typeof o.value=="function")e.__onClickOutside_stop=ve(e,o.value,{capture:n});else{const[a,i]=o.value;e.__onClickOutside_stop=ve(e,a,Object.assign({capture:n},i))}},unmounted(e){e.__onClickOutside_stop()}};function te(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function ke(e){const o=window.getComputedStyle(e);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&e.clientWidth<e.scrollWidth||o.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:ke(n)}}function pt(e){const o=e||window.event,n=o.target;return ke(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)}const oe=new WeakMap;function gt(e,o=!1){const n=t.ref(o);let a=null,i="";t.watch(_e(e),r=>{const l=te(t.toValue(r));if(l){const c=l;if(oe.get(c)||oe.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(i=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const d=()=>{const r=te(t.toValue(e));!r||n.value||(Z&&(a=L(r,"touchmove",l=>{pt(l)},{passive:!1})),r.style.overflow="hidden",n.value=!0)},s=()=>{const r=te(t.toValue(e));!r||!n.value||(Z&&(a==null||a()),r.style.overflow=i,oe.delete(r),n.value=!1)};return D(s),t.computed({get(){return n.value},set(r){r?d():s()}})}function bt(){let e=!1;const o=t.shallowRef(!1);return(n,a)=>{if(o.value=a.value,e)return;e=!0;const i=gt(n,a.value);t.watch(o,d=>i.value=d)}}bt();const ht={key:0,id:"resizable"},wt={class:"atable-header-row",tabindex:"-1"},ne=t.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(e){return(o,n)=>o.columns.length?(t.openBlock(),t.createElementBlock("thead",ht,[t.createElementVNode("tr",wt,[o.store.zeroColumn?(t.openBlock(),t.createElementBlock("th",{key:0,id:"header-index",class:t.normalizeClass([[o.store.hasPinnedColumns?"sticky-index":"",o.store.config.view==="tree"?"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,(a,i)=>(t.openBlock(),t.createElementBlock("th",{key:a.name,tabindex:"-1",style:t.normalizeStyle(o.store.getHeaderCellStyle(a)),class:t.normalizeClass(a.pinned?"sticky-column":"")},[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(a.label||String.fromCharCode(i+97).toUpperCase()),1)])],6))),128))])])):t.createCommentVNode("",!0)}}),le=t.defineComponent({__name:"ATableModal",props:{store:{}},setup(e){const o=t.useTemplateRef("amodal"),{width:n,height:a}=he(o),i=t.computed(()=>{var g,m,p,y;if(!(e.store.modal.height&&e.store.modal.width&&e.store.modal.left&&e.store.modal.bottom))return;const d=(g=e.store.modal.cell)==null?void 0:g.closest("table"),s=d.offsetHeight||0,r=d.offsetWidth||0;let l=((m=e.store.modal.cell)==null?void 0:m.offsetTop)||0;const c=((p=d.querySelector("thead"))==null?void 0:p.offsetHeight)||0;l+=c,l=l+a.value<s?l:l-(a.value+e.store.modal.height);let f=((y=e.store.modal.cell)==null?void 0:y.offsetLeft)||0;return f=f+n.value<=r?f:f-(n.value-e.store.modal.width),{left:`${f}px`,top:`${l}px`}});return(d,s)=>(t.openBlock(),t.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:s[0]||(s[0]=t.withModifiers(()=>{},["stop"])),onInput:s[1]||(s[1]=t.withModifiers(()=>{},["stop"])),style:t.normalizeStyle(i.value)},[t.renderSlot(d.$slots,"default")],36))}}),Ee=e=>{const o=e.id||lt();return $e.defineStore(`table-${o}`,()=>{const a=()=>{const h={};for(const[w,k]of d.value.entries())for(const[S,A]of s.value.entries())h[`${w}:${S}`]=A[k.name];return h},i=h=>{const w=[Object.assign({},{rowModified:!1})];if(h&&"0:0"in h)return h;const k=new Set;for(let S=s.value.length-1;S>=0;S--){const A=s.value[S];A.parent&&k.add(A.parent),w[S]={childrenOpen:!1,expanded:!1,indent:A.indent||0,isParent:k.has(S),isRoot:A.parent===null||A.parent===void 0,rowModified:!1,open:A.parent===null||A.parent===void 0,parent:A.parent}}return w},d=t.ref(e.columns),s=t.ref(e.rows),r=t.ref(e.config||{}),l=t.ref(e.table||a()),c=t.ref(i(e.display)),f=t.ref(e.modal||{visible:!1}),g=t.ref({}),m=t.computed(()=>d.value.some(h=>h.pinned)),p=t.computed(()=>`${Math.ceil(s.value.length/100+1)}ch`),y=t.computed(()=>r.value.view?["list","tree","list-expansion"].includes(r.value.view):!1),v=(h,w)=>l.value[`${h}:${w}`],u=(h,w,k)=>{const S=`${h}:${w}`,A=d.value[h];l.value[S]!==k&&(c.value[w].rowModified=!0),l.value[S]=k,s.value[w][A.name]=k},b=(h,w,k)=>{const S=`${h}:${w}`;l.value[S]!==k&&(c.value[w].rowModified=!0,g.value[S]=k)},x=h=>({minWidth:h.width||"40ch",textAlign:h.align||"center",width:r.value.fullWidth?"auto":void 0}),M=h=>r.value.view!=="tree"||c.value[h].isRoot||c.value[h].open,C=h=>r.value.view!=="tree"?"":c.value[h].isRoot||c.value[h].isParent?c.value[h].childrenOpen?"-":"+":"",Te=h=>{if(r.value.view==="tree"){c.value[h].childrenOpen=!c.value[h].childrenOpen;for(let w=s.value.length-1;w>=0;w--)c.value[w].parent===h&&(c.value[w].open=!c.value[w].open,c.value[w].childrenOpen&&Te(w))}else r.value.view==="list-expansion"&&(c.value[h].expanded=!c.value[h].expanded)},It=(h,w)=>{const k=v(h,w);return Ie(h,w,k)},Ie=(h,w,k)=>{const S=d.value[h],A=s.value[w],H=S.format;return H?typeof H=="function"?H(k,{table:l.value,row:A,column:S}):typeof H=="string"?Function(`"use strict";return (${H})`)()(k,{table:l.value,row:A,column:S}):k:k};return{columns:d,config:r,display:c,modal:f,rows:s,table:l,updates:g,hasPinnedColumns:m,numberedRowWidth:p,zeroColumn:y,closeModal:h=>{var w;h.target instanceof Node&&(w=f.value.parent)!=null&&w.contains(h.target)||f.value.visible&&(f.value.visible=!1)},getCellData:v,getCellDisplayValue:It,getFormattedValue:Ie,getHeaderCellStyle:x,getIndent:(h,w)=>w&&h===0&&w>0?`${w}ch`:"inherit",getRowExpandSymbol:C,isRowVisible:M,setCellData:u,setCellText:b,toggleRowExpand:Te}})()},Ce=P(t.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(e,{expose:o,emit:n}){const a=n,i=t.useTemplateRef("table"),d=e.modelValue?e.modelValue:e.rows,s=Ee({columns:e.columns,rows:d,id:e.id,config:e.config});s.$onAction(({name:l,store:c,args:f,after:g})=>{if(l==="setCellData"||l==="setCellText"){const[m,p,y]=f,v=c.getCellData(m,p);g(()=>{a("cellUpdate",{colIndex:m,rowIndex:p,newValue:y,oldValue:v})})}}),t.watch(()=>s.rows,l=>{a("update:modelValue",l)},{deep:!0}),t.onMounted(()=>{e.columns.some(l=>l.pinned)&&(r(),s.config.view==="tree"&&be(i,r,{childList:!0,subtree:!0}))});const r=()=>{const l=i.value,c=l==null?void 0:l.rows[0],f=l==null?void 0:l.rows[1],g=c?Array.from(c.cells):[];for(const[m,p]of g.entries()){const y=f==null?void 0:f.cells[m];y&&(p.style.width=`${y.offsetWidth}px`)}for(const m of(l==null?void 0:l.rows)||[]){let p=0;const y=[];for(const v of m.cells)(v.classList.contains("sticky-column")||v.classList.contains("sticky-index"))&&(v.style.left=`${p}px`,p+=v.offsetWidth,y.push(v));y.length>0&&y[y.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",l=>{if(l.key==="Escape"&&s.modal.visible){s.modal.visible=!1;const c=s.modal.parent;c&&t.nextTick().then(()=>{c.focus()})}}),o({store:s}),(l,c)=>t.withDirectives((t.openBlock(),t.createElementBlock("table",{ref:"table",class:"atable",style:t.normalizeStyle({width:t.unref(s).config.fullWidth?"100%":"auto"})},[t.renderSlot(l.$slots,"header",{data:t.unref(s)},()=>[t.createVNode(ne,{columns:t.unref(s).columns,store:t.unref(s)},null,8,["columns","store"])],!0),t.createElementVNode("tbody",null,[t.renderSlot(l.$slots,"body",{data:t.unref(s)},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(s).rows,(f,g)=>(t.openBlock(),t.createBlock(ee,{key:f.id,row:f,rowIndex:g,store:t.unref(s)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(s).columns,(m,p)=>(t.openBlock(),t.createBlock(_,{key:m.name,store:t.unref(s),col:m,spellcheck:"false",pinned:m.pinned,rowIndex:g,colIndex:p,component:m.cellComponent,style:t.normalizeStyle({textAlign:(m==null?void 0:m.align)||"center",minWidth:(m==null?void 0:m.width)||"40ch",width:t.unref(s).config.fullWidth?"auto":null})},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),t.renderSlot(l.$slots,"footer",{data:t.unref(s)},void 0,!0),t.renderSlot(l.$slots,"modal",{data:t.unref(s)},()=>[t.withDirectives(t.createVNode(le,{store:t.unref(s)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(s).modal.component),t.mergeProps({key:`${t.unref(s).modal.rowIndex}:${t.unref(s).modal.colIndex}`,colIndex:t.unref(s).modal.colIndex,rowIndex:t.unref(s).modal.rowIndex,store:t.unref(s)},t.unref(s).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[t.vShow,t.unref(s).modal.visible]])],!0)],4)),[[t.unref(mt),t.unref(s).closeModal]])}}),[["__scopeId","data-v-ef1d9615"]]),yt={},xt={class:"aloading"},vt={class:"aloading-header"};function kt(e,o){return t.openBlock(),t.createElementBlock("div",xt,[t.createElementVNode("h2",vt,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),o[0]||(o[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Se=P(yt,[["render",kt],["__scopeId","data-v-a930a25b"]]),Et={},Ct={class:"aloading"},St={class:"aloading-header"};function At(e,o){return t.openBlock(),t.createElementBlock("div",Ct,[t.createElementVNode("h2",St,[t.renderSlot(e.$slots,"default",{},void 0,!0)]),o[0]||(o[0]=t.createElementVNode("div",{class:"aloading-bar"},null,-1))])}const Ae=P(Et,[["render",At],["__scopeId","data-v-e1165876"]]);function Tt(e){e.component("ACell",_),e.component("AExpansionRow",we),e.component("ARow",ee),e.component("ATable",Ce),e.component("ATableHeader",ne),e.component("ATableLoading",Se),e.component("ATableLoadingBar",Ae),e.component("ATableModal",le)}E.ACell=_,E.AExpansionRow=we,E.ARow=ee,E.ATable=Ce,E.ATableHeader=ne,E.ATableLoading=Se,E.ATableLoadingBar=Ae,E.ATableModal=le,E.createTableStore=Ee,E.install=Tt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
3
3
|
//# sourceMappingURL=atable.umd.cjs.map
|