@revolist/revogrid 4.10.0 → 4.10.2
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/cjs/{column.drag.plugin-7098477f.js → column.drag.plugin-08ca04f4.js} +18 -18
- package/dist/cjs/column.drag.plugin-08ca04f4.js.map +1 -0
- package/dist/cjs/column.service-2670e6e7.js +1286 -0
- package/dist/cjs/column.service-2670e6e7.js.map +1 -0
- package/dist/cjs/{edit.utils-75fa1cab.js → edit.utils-4a790cf8.js} +2 -2
- package/dist/cjs/{edit.utils-75fa1cab.js.map → edit.utils-4a790cf8.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-aaaad4c8.js → header-cell-renderer-db089f54.js} +2 -2
- package/dist/cjs/{header-cell-renderer-aaaad4c8.js.map → header-cell-renderer-db089f54.js.map} +1 -1
- package/dist/cjs/{column.service-f1d5d924.js → index-91e92bea.js} +452 -1227
- package/dist/cjs/index-91e92bea.js.map +1 -0
- package/dist/cjs/index.cjs.js +20 -20
- package/dist/cjs/{key.utils-8f1105f3.js → key.utils-e65c24e6.js} +2 -2
- package/dist/cjs/{key.utils-8f1105f3.js.map → key.utils-e65c24e6.js.map} +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +26 -26
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +11 -11
- package/dist/cjs/revogr-attribution_7.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +5 -4
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +9 -9
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/{row-header-utils-208e4026.js → row-header-utils-dc3d3185.js} +5 -6
- package/dist/cjs/row-header-utils-dc3d3185.js.map +1 -0
- package/dist/cjs/{text-editor-b64a080e.js → text-editor-a32a3993.js} +3 -3
- package/dist/cjs/{text-editor-b64a080e.js.map → text-editor-a32a3993.js.map} +1 -1
- package/dist/cjs/{throttle-3b362440.js → throttle-da92b75d.js} +2 -2
- package/dist/cjs/{throttle-3b362440.js.map → throttle-da92b75d.js.map} +1 -1
- package/dist/collection/components/order/revogr-order-editor.js +4 -2
- package/dist/collection/components/order/revogr-order-editor.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/esm/{column.drag.plugin-813698d2.js → column.drag.plugin-b7bba0da.js} +6 -6
- package/dist/esm/{column.drag.plugin-813698d2.js.map → column.drag.plugin-b7bba0da.js.map} +1 -1
- package/dist/esm/column.service-9b0603f4.js +1249 -0
- package/dist/esm/column.service-9b0603f4.js.map +1 -0
- package/dist/esm/{debounce-72878ced.js → debounce-7b511afc.js} +2 -2
- package/dist/esm/{debounce-72878ced.js.map → debounce-7b511afc.js.map} +1 -1
- package/dist/esm/{edit.utils-cd6a3224.js → edit.utils-abcd0152.js} +2 -2
- package/dist/esm/{edit.utils-cd6a3224.js.map → edit.utils-abcd0152.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-5939221a.js → header-cell-renderer-fce020c3.js} +2 -2
- package/dist/esm/{header-cell-renderer-5939221a.js.map → header-cell-renderer-fce020c3.js.map} +1 -1
- package/dist/esm/{column.service-aa142672.js → index-b1e05212.js} +411 -1187
- package/dist/esm/index-b1e05212.js.map +1 -0
- package/dist/esm/index.js +8 -8
- package/dist/esm/{key.utils-5ff2ec82.js → key.utils-ea9aec31.js} +2 -2
- package/dist/esm/{key.utils-5ff2ec82.js.map → key.utils-ea9aec31.js.map} +1 -1
- package/dist/esm/revo-grid.entry.js +6 -6
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +7 -7
- package/dist/esm/revogr-clipboard_3.entry.js +6 -5
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +5 -5
- package/dist/esm/revogr-filter-panel.entry.js +1 -1
- package/dist/esm/{row-header-utils-5511678e.js → row-header-utils-7af8fcbf.js} +2 -3
- package/dist/esm/row-header-utils-7af8fcbf.js.map +1 -0
- package/dist/esm/{text-editor-81767dcb.js → text-editor-fb3f24fe.js} +3 -3
- package/dist/esm/{text-editor-81767dcb.js.map → text-editor-fb3f24fe.js.map} +1 -1
- package/dist/esm/{throttle-4eff5b3c.js → throttle-1f5772ef.js} +3 -3
- package/dist/esm/{throttle-4eff5b3c.js.map → throttle-1f5772ef.js.map} +1 -1
- package/dist/revo-grid/column.drag.plugin-b7bba0da.js +5 -0
- package/dist/revo-grid/{column.drag.plugin-813698d2.js.map → column.drag.plugin-b7bba0da.js.map} +1 -1
- package/dist/revo-grid/column.service-9b0603f4.js +5 -0
- package/dist/revo-grid/column.service-9b0603f4.js.map +1 -0
- package/dist/revo-grid/{debounce-72878ced.js → debounce-7b511afc.js} +2 -2
- package/dist/revo-grid/{edit.utils-cd6a3224.js → edit.utils-abcd0152.js} +2 -2
- package/dist/revo-grid/{header-cell-renderer-5939221a.js → header-cell-renderer-fce020c3.js} +2 -2
- package/dist/revo-grid/index-b1e05212.js +5 -0
- package/dist/revo-grid/index-b1e05212.js.map +1 -0
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/key.utils-ea9aec31.js +5 -0
- package/dist/revo-grid/{key.utils-5ff2ec82.js.map → key.utils-ea9aec31.js.map} +1 -1
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/row-header-utils-7af8fcbf.js +5 -0
- package/dist/revo-grid/{row-header-utils-5511678e.js.map → row-header-utils-7af8fcbf.js.map} +1 -1
- package/dist/revo-grid/text-editor-fb3f24fe.js +5 -0
- package/dist/revo-grid/{throttle-4eff5b3c.js → throttle-1f5772ef.js} +2 -2
- package/dist/types/components/order/revogr-order-editor.d.ts +1 -0
- package/dist/types/components/revoGrid/revo-grid.d.ts +1 -5
- package/dist/types/components.d.ts +2 -0
- package/hydrate/index.js +24 -23
- package/hydrate/index.mjs +24 -23
- package/package.json +1 -1
- package/readme.md +10 -12
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.js +21 -2
- package/standalone/data.store.js.map +1 -1
- package/standalone/dimension.helpers.js +1 -1
- package/standalone/revo-grid.js +1 -2
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-order-editor2.js +2 -0
- package/standalone/revogr-order-editor2.js.map +1 -1
- package/dist/cjs/column.drag.plugin-7098477f.js.map +0 -1
- package/dist/cjs/column.service-f1d5d924.js.map +0 -1
- package/dist/cjs/index-aecb871a.js +0 -510
- package/dist/cjs/index-aecb871a.js.map +0 -1
- package/dist/cjs/row-header-utils-208e4026.js.map +0 -1
- package/dist/esm/column.service-aa142672.js.map +0 -1
- package/dist/esm/index-dbd1c020.js +0 -473
- package/dist/esm/index-dbd1c020.js.map +0 -1
- package/dist/esm/row-header-utils-5511678e.js.map +0 -1
- package/dist/revo-grid/column.drag.plugin-813698d2.js +0 -5
- package/dist/revo-grid/column.service-aa142672.js +0 -5
- package/dist/revo-grid/column.service-aa142672.js.map +0 -1
- package/dist/revo-grid/index-dbd1c020.js +0 -5
- package/dist/revo-grid/index-dbd1c020.js.map +0 -1
- package/dist/revo-grid/key.utils-5ff2ec82.js +0 -5
- package/dist/revo-grid/row-header-utils-5511678e.js +0 -5
- package/dist/revo-grid/text-editor-81767dcb.js +0 -5
- package/standalone/identity.js +0 -26
- package/standalone/identity.js.map +0 -1
- /package/dist/revo-grid/{debounce-72878ced.js.map → debounce-7b511afc.js.map} +0 -0
- /package/dist/revo-grid/{edit.utils-cd6a3224.js.map → edit.utils-abcd0152.js.map} +0 -0
- /package/dist/revo-grid/{header-cell-renderer-5939221a.js.map → header-cell-renderer-fce020c3.js.map} +0 -0
- /package/dist/revo-grid/{text-editor-81767dcb.js.map → text-editor-fb3f24fe.js.map} +0 -0
- /package/dist/revo-grid/{throttle-4eff5b3c.js.map → throttle-1f5772ef.js.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by Revolist OU ❤️
|
|
3
|
-
*/
|
|
4
|
-
import{z as t,A as i,m as s,B as e,C as n,b as o,r,E as c,F as h,G as l,H as a,q as u,v as f}from"./column.service-aa142672.js";import{c as d,z as p,b as v,t as m,g as b}from"./index-dbd1c020.js";import{f as g}from"./row-header-utils-5511678e.js";import{h as y}from"./index-a61f225b.js";import{b as w,i as j}from"./filter.button-d40ab17b.js";import{d as O}from"./debounce-72878ced.js";import{d as S,O as E}from"./header-cell-renderer-5939221a.js";const x=t=>({set(i){switch(i){case"count":case"sizes":case"originItemSize":{let i=0;const s=t.store.get("count");for(let e=0;e<s;e++){i+=t.store.get("sizes")[e]||t.store.get("originItemSize")}t.setStore({realSize:i});break}}}});const z=t=>{let i=null;let s=null;return{set(e,n){switch(e){case"sizes":{if(i&&i===n){i=null;return}s=null;break}case"trimmed":{const e=n;if(!s){s=t.store.get("sizes")}i=C(s,e||{});t.setSizes(i);break}}}}};function C(t,i){const s={};const e=Object.keys(t||{}).map(Number).sort(((t,i)=>t-i));const n=e[e.length-1];let o=0;for(let e=0;e<=n;e++){if(i[e]!==undefined){o++;if(t[e]!==undefined){continue}}if(t[e]!==undefined){s[e-o]=t[e]}}return s}function k(){return{indexes:[],count:0,trimmed:null,sizes:{},positionIndexToItem:{},indexToItem:{},positionIndexes:[]}}function P(){return Object.assign(Object.assign({},k()),{realSize:0,originItemSize:0})}class I{constructor(i){this.type=i;this.store=t(P());this.store.use(z({store:this.store,setSizes:this.setDimensionSize.bind(this)}));this.store.use(x({store:this.store,setStore:this.setStore.bind(this)}))}getCurrentState(){const t=P();const s=Object.keys(t);return i(s,((t,i)=>{const s=this.store.get(i);t[i]=s;return t}),t)}dispose(){s(this.store,P())}setStore(t){s(this.store,t)}drop(){s(this.store,k())}setDimensionSize(t={}){const i=d(this.store.get("originItemSize"),t);s(this.store,Object.assign(Object.assign({},i),{sizes:t}))}updateSizesPositionByIndexes(t,i=[]){const s=Object.assign({},this.store.get("sizes"));if(!Object.keys(s).length){return}const e={};i.forEach(((t,i)=>{if(!e[t]){e[t]=[]}e[t].push(i)}));const n={};t.forEach(((t,i)=>{const o=e[t];if(o&&o.length>0){const t=o.shift();if(t!==undefined&&t!==i&&s[t]){n[i]=s[t];delete s[t]}}}));if(Object.keys(n).length){this.setDimensionSize(Object.assign(Object.assign({},s),n))}}}const N=["rowPinStart","rgRow","rowPinEnd"];const q=["colPinStart","rgCol","colPinEnd"];function F(t){return N.indexOf(t)>-1}class M{constructor(t,i){this.revogrid=t;this.providers=i;this.h=y;this.subscriptions={}}addEventListener(t,i){this.revogrid.addEventListener(t,i);this.subscriptions[t]=i}watch(t,i,{immediate:s}={immediate:false}){const e=Object.getOwnPropertyDescriptor(this.revogrid,t)||Object.getOwnPropertyDescriptor(this.revogrid.constructor.prototype,t);Object.defineProperty(this.revogrid,t,{set(t){var s;const n=i(t);if(n===false){return}return(s=e===null||e===void 0?void 0:e.set)===null||s===void 0?void 0:s.call(this,t)},get(){var t;return(t=e===null||e===void 0?void 0:e.get)===null||t===void 0?void 0:t.call(this)}});if(s){i(e===null||e===void 0?void 0:e.value)}}removeEventListener(t){this.revogrid.removeEventListener(t,this.subscriptions[t]);delete this.subscriptions[t]}emit(t,i){const s=new CustomEvent(t,{detail:i,cancelable:true});this.revogrid.dispatchEvent(s);return s}clearSubscriptions(){for(let t in this.subscriptions){this.removeEventListener(t)}}destroy(){this.clearSubscriptions()}}function D(t,i){var s=-1,e=t==null?0:t.length;while(++s<e){if(i(t[s],s,t)===false){break}}return t}function R(t){return typeof t=="function"?t:p}function $(t,i){var s=e(t)?D:n;return s(t,R(i))}const B=7;var A;(function(t){t["headerClickAutosize"]="headerClickAutoSize";t["autoSizeOnTextOverlap"]="autoSizeOnTextOverlap";t["autoSizeAll"]="autoSizeAll"})(A||(A={}));class T extends M{constructor(t,i,s){super(t,i);this.providers=i;this.config=s;this.autoSizeColumns=null;this.dataResolve=null;this.dataReject=null;this.letterBlockSize=(s===null||s===void 0?void 0:s.letterBlockSize)||B;if(s===null||s===void 0?void 0:s.preciseSize){this.precsizeCalculationArea=this.initiatePresizeElement();t.appendChild(this.precsizeCalculationArea)}const e=({detail:{source:t}})=>{this.setSource(t)};const n=({detail:t})=>{this.afteredit(t)};const o=({detail:t})=>{this.afterEditAll(t)};const c=({detail:{columns:t}})=>{this.columnSet(t)};const h=({detail:t})=>{const i=r(t.column);const s=this.getColumnSize(t.index,i);if(s){this.providers.dimension.setCustomSizes(i,{[t.index]:s},true)}};this.addEventListener("beforecolumnsset",c);switch(s===null||s===void 0?void 0:s.mode){case A.autoSizeOnTextOverlap:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",n);break;case A.autoSizeAll:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",o);break;default:this.addEventListener("headerdblclick",h);break}}async setSource(t){let i=this.autoSizeColumns;if(this.dataReject){this.dataReject();this.clearPromise()}if(!i){const t=new Promise(((t,i)=>{this.dataResolve=t;this.dataReject=i}));try{i=await t}catch(t){return}}$(i,((s,e)=>{const n={};$(i[e],(i=>{i.size=n[i.index]=t.reduce(((t,s)=>Math.max(t,this.getLength(s[i.prop]))),this.getLength(i.name||""))}));this.providers.dimension.setCustomSizes(e,n,true)}))}getLength(t){var i;const s=15;if(!t){return 0}try{const e=t.toString();if((i=this.config)===null||i===void 0?void 0:i.preciseSize){this.precsizeCalculationArea.innerText=e;return this.precsizeCalculationArea.scrollWidth+s*2}return e.length*this.letterBlockSize+s*2}catch(t){return 0}}afteredit(t){let s;if(this.isRangeEdit(t)){s=t.data}else{s={0:{[t.prop]:t.val}}}$(this.autoSizeColumns,((t,e)=>{const n={};$(t,(t=>{var e;const o=i(s,((i,s)=>{if(typeof s[t.prop]==="undefined"){return i}return Math.max(i||0,this.getLength(s[t.prop]))}),undefined);if(o&&((e=t.size)!==null&&e!==void 0?e:0)<o){t.size=n[t.index]=o}}));this.providers.dimension.setCustomSizes(e,n,true)}))}afterEditAll(t){const i={};if(this.isRangeEdit(t)){$(t.data,(t=>$(t,((t,s)=>i[s]=true))))}else{i[t.prop]=true}$(this.autoSizeColumns,((t,s)=>{const e={};$(t,(t=>{if(i[t.prop]){const i=this.getColumnSize(t.index,s);if(i){e[t.index]=i}}}));this.providers.dimension.setCustomSizes(s,e,true)}))}getColumnSize(t,s){var e,n;const r=(n=(e=this.autoSizeColumns)===null||e===void 0?void 0:e[s])===null||n===void 0?void 0:n[t];if(!r){return 0}return i(this.providers.data.stores,((t,s)=>{const e=i(s.store.get("items"),((t,i,e)=>{const n=o(s.store,e);return Math.max(t||0,this.getLength(n===null||n===void 0?void 0:n[r.prop]))}),0);return Math.max(t,e)}),r.size||0)}columnSet(t){var i;for(let s of q){const e=s;const n=t[e];for(let t in n){if(n[t].autoSize||((i=this.config)===null||i===void 0?void 0:i.allColumns)){if(!this.autoSizeColumns){this.autoSizeColumns={}}if(!this.autoSizeColumns[e]){this.autoSizeColumns[e]={}}this.autoSizeColumns[e][t]=Object.assign(Object.assign({},n[t]),{index:parseInt(t,10)})}}}if(this.dataResolve){this.dataResolve(this.autoSizeColumns||{});this.clearPromise()}}clearPromise(){this.dataResolve=null;this.dataReject=null}isRangeEdit(t){return!!t.data}initiatePresizeElement(){var t;const i={position:"absolute",fontSize:"14px",height:"0",width:"0",whiteSpace:"nowrap",top:"0",overflowX:"scroll"};const s=document.createElement("div");for(let e in i){s.style[e]=(t=i[e])!==null&&t!==void 0?t:""}s.classList.add("revo-test-container");return s}destroy(){var t;super.destroy();(t=this.precsizeCalculationArea)===null||t===void 0?void 0:t.remove()}}class H extends M{constructor(t,i){super(t,i);this.providers=i;this.stretchedColumn=null;this.scrollSize=v(document);const s=({detail:{columns:t}})=>this.applyStretch(t);this.addEventListener("beforecolumnapplied",s)}setScroll({type:t,hasScroll:i}){var s;if(t==="rgRow"&&this.stretchedColumn&&((s=this.stretchedColumn)===null||s===void 0?void 0:s.initialSize)===this.stretchedColumn.size){if(i){this.stretchedColumn.size-=this.scrollSize;this.apply();this.dropChanges()}}}activateChanges(){const t=({detail:t})=>this.setScroll(t);this.addEventListener("scrollchange",t)}dropChanges(){this.stretchedColumn=null;this.removeEventListener("scrollchange")}apply(){if(!this.stretchedColumn){return}const t="rgCol";const i=this.providers.dimension.stores[t].store.get("sizes");this.providers.dimension.setCustomSizes(t,Object.assign(Object.assign({},i),{[this.stretchedColumn.index]:this.stretchedColumn.size}),true)}applyStretch(t){this.dropChanges();let i=this.revogrid.clientWidth-1;$(t,((t,s)=>{const e=this.providers.dimension.stores[s].store.get("realSize");i-=e}));if(this.revogrid.rowHeaders){const t=this.providers.data.stores.rgRow.store.get("source").length;const s=this.revogrid.rowHeaders;const e=g(t,typeof s==="object"?s:undefined);if(e){i-=e}}if(i>0){const s=t.rgCol.length-1;const e=t.rgCol[s];const n=(e===null||e===void 0?void 0:e.size)||this.revogrid.colSize||0;const o=i+n-1;if(e&&!e.autoSize&&n<o){this.stretchedColumn={initialSize:o,index:s,size:o};this.apply();this.activateChanges()}}}}function J(t){return!!t.applyStretch}function L(t,i,s){if(t===t){if(s!==undefined){t=t<=s?t:s}if(i!==undefined){t=t>=i?t:i}}return t}var G=4294967295;function X(t){return t?L(c(t),0,G):0}function K(t,i,s,e){var n=t.length;s=c(s);if(s<0){s=-s>n?0:n+s}e=e===undefined||e>n?n:c(e);if(e<0){e+=n}e=s>e?0:X(e);while(s<e){t[s++]=i}return t}function U(t,i,s,e){var n=t==null?0:t.length;if(!n){return[]}if(s&&typeof s!="number"&&h(t,i,s)){s=0;e=n}return K(t,i,s,e)}const V={mime:"text/csv",fileKind:"csv",bom:true,columnDelimiter:",",rowDelimiter:"\r\n",encoding:""};const Q=String.fromCharCode(13);const W=String.fromCharCode(10);const Y=String.fromCharCode(34);const Z=String.fromCharCode(65279);const _=new RegExp('"',"g");class tt{constructor(t={}){this.options=Object.assign(Object.assign({},V),t)}doExport({data:t,headers:i,props:s}){let e=this.options.bom?Z:"";if((i===null||i===void 0?void 0:i.length)>0){i.forEach((t=>{if(!t.length){return}e+=this.prepareHeader(t,this.options.columnDelimiter);e+=this.options.rowDelimiter}))}t.forEach(((t,i)=>{if(i>0){e+=this.options.rowDelimiter}if(l(t)){e+=this.parseCell(a(t),this.options.columnDelimiter);return}e+=s.map((i=>this.parseCell(t[i],this.options.columnDelimiter))).join(this.options.columnDelimiter)}));return e}prepareHeader(t,i){let s="";const e=t.map((t=>this.parseCell(t,i,true)));s+=e.join(i);return s}parseCell(t,i,s=false){let e=t;if(typeof t!=="string"){e=JSON.stringify(t)}const n=[Q,Y,W,i];if(typeof e==="undefined"){return""}if(e!==""&&(s||n.some((t=>e.indexOf(t)>=0)))){return`"${e.replace(_,'""')}"`}return e}}var it;(function(t){t["csv"]="csv"})(it||(it={}));class st extends M{async exportString(t={},i=it.csv){const s=await this.beforeexport();if(!s){return null}return this.formatter(i,t).doExport(s)}async exportBlob(t={},i=it.csv){return await this.getBlob(this.formatter(i,t))}async exportFile(t={},i=it.csv){const s=this.formatter(i,t);const e=window.URL||window.webkitURL;const n=document.createElement("a");const{filename:o,fileKind:r}=s.options;const c=`${o}.${r}`;const h=await this.getBlob(s);const l=h?e.createObjectURL(h):"";n.style.display="none";n.setAttribute("href",l);n.setAttribute("download",c);this.revogrid.appendChild(n);n.dispatchEvent(new MouseEvent("click"));this.revogrid.removeChild(n);await m(120);e.revokeObjectURL(l)}async getBlob(t){const i=`${t.options.mime};charset=${t.options.encoding}`;if(typeof Blob!=="undefined"){const s=await this.beforeexport();if(!s){return null}return new Blob([t.doExport(s)],{type:i})}return null}async beforeexport(){let t=await this.getData();const i=this.emit("beforeexport",{data:t});if(i.defaultPrevented){return null}return i.detail.data}async getData(){const t=await this.getSource();const i=[];const s=[];q.forEach(((t,e)=>{s.push(this.getColPerSource(t).then((t=>i[e]=t)))}));await Promise.all(s);const e={headers:[],props:[]};for(let t of i){t.headers.forEach(((t,i)=>{if(!e.headers[i]){e.headers[i]=[]}e.headers[i].push(...t)}));e.props.push(...t.props)}return Object.assign({data:t},e)}async getColPerSource(t){const i=await this.revogrid.getColumnStore(t);const s=i.get("source");const e=i.get("items");const n=i.get("groupingDepth");const o=i.get("groups");const r=[];const c=[];const h=e.reduce(((t,i,e)=>{const n=s[i].prop;r.push(s[i].name||"");c.push(n);t[n]=e;return t}),{});const l=this.getGroupHeaders(n,o,e,h);l.push(r);return{headers:l,props:c}}getGroupHeaders(t,i,s,e){const n=[];const o=U(new Array(s.length),"");for(let s=0;s<t;s++){const t=[...o];n.push(t);if(!i[s]){continue}const r=i[s];r.forEach((i=>{const s=this.findGroupStartIndex(i.ids,e);if(typeof s==="number"){t[s]=i.name}}))}return n}findGroupStartIndex(t,i){let s;t.forEach((t=>{const e=i[t];if(typeof e==="number"){if(typeof s!=="number"||s>e){s=e}}}));return s}async getSource(){const t=[];const i=[];N.forEach((s=>{const e=[];t.push(e);const n=this.revogrid.getVisibleSource(s).then((t=>e.push(...t)));i.push(n)}));await Promise.all(i);return t.reduce(((t,i)=>{t.push(...i);return t}),[])}formatter(t,i={}){switch(t){case it.csv:return new tt(i);default:throw new Error("Unknown format")}}}const et=(t,i)=>{if(typeof t==="undefined"||t===null&&!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}const s=i===null||i===void 0?void 0:i.toString().toLocaleLowerCase();if((s===null||s===void 0?void 0:s.length)===0){return true}return t.toLocaleLowerCase()===s};const nt=(t,i)=>!et(t,i);nt.extra="input";et.extra="input";const ot=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i===null||i===void 0?void 0:i.toString());return t>s}return false};ot.extra="input";const rt=function(t,i){return et(t,i)||ot(t,i)};rt.extra="input";const ct=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i.toString());return t<s}else{return false}};ct.extra="input";const ht=function(t,i){return et(t,i)||ct(t,i)};ht.extra="input";const lt=t=>!(t===""||t===null||t===void 0);const at=t=>!lt(t);const ut=(t,i)=>{if(!t){return false}if(!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}if(typeof i!=="string"){i=JSON.stringify(i)}return t.toLocaleLowerCase().indexOf(i.toLocaleLowerCase())===0};ut.extra="input";const ft=(t,i)=>{if(!i){return true}if(!t){return false}if(i){if(typeof t!=="string"){t=JSON.stringify(t)}return t.toLocaleLowerCase().indexOf(i.toString().toLowerCase())>-1}return true};const dt=(t,i)=>!ft(t,i);dt.extra="input";ft.extra="input";const pt={none:()=>true,empty:at,notEmpty:lt,eq:et,notEq:nt,begins:ut,contains:ft,notContains:dt,eqN:et,neqN:nt,gt:ot,gte:rt,lt:ct,lte:ht};const vt={string:["notEmpty","empty","eq","notEq","begins","contains","notContains"],number:["notEmpty","empty","eqN","neqN","gt","gte","lt","lte"]};const mt={none:"None",empty:"Not set",notEmpty:"Set",eq:"Equal",notEq:"Not equal",begins:"Begins with",contains:"Contains",notContains:"Does not contain",eqN:"=",neqN:"!=",gt:">",gte:">=",lt:"<",lte:"<="};const bt="filter";const gt="filterconfigchanged";const yt="revogr-filter-panel";class wt extends M{constructor(t,i,s){var e;super(t,i);this.revogrid=t;this.filterCollection={};this.multiFilterItems={};this.filterByType=Object.assign({},vt);this.filterNameIndexByType=Object.assign({},mt);this.filterFunctionsIndexedByType=Object.assign({},pt);this.filterProp=w;if(s){this.initConfig(s)}const n=this.revogrid.registerVNode.filter((t=>typeof t==="object"&&t.t!==yt));this.revogrid.registerVNode=[...n,y("revogr-filter-panel",{filterItems:this.multiFilterItems,filterNames:this.filterNameIndexByType,filterEntities:this.filterFunctionsIndexedByType,filterCaptions:(e=s===null||s===void 0?void 0:s.localization)===null||e===void 0?void 0:e.captions,onFilterChange:t=>this.onFilterChange(t.detail),onResetChange:t=>this.onFilterReset(t.detail),disableDynamicFiltering:s===null||s===void 0?void 0:s.disableDynamicFiltering,ref:t=>this.pop=t}," ",this.extraContent())];const o=async()=>{const t=Object.keys(this.filterCollection);if(t.length>0){t.forEach(((t,i)=>{if(!this.multiFilterItems[t]){this.multiFilterItems[t]=[{id:i,type:this.filterCollection[t].type,value:this.filterCollection[t].value,relation:"and"}]}}))}if(Object.keys(this.multiFilterItems).length===0){return}await this.runFiltering(this.multiFilterItems)};this.addEventListener("headerclick",(t=>this.headerclick(t)));this.addEventListener(gt,(({detail:t})=>{if(!t){this.clearFiltering();return}if(typeof t==="object"){this.initConfig(t)}o()}));this.addEventListener("aftersourceset",o);this.addEventListener("filter",(({detail:t})=>this.onFilterChange(t)))}extraContent(){return null}initConfig(t){if(t.multiFilterItems){this.multiFilterItems=Object.assign({},t.multiFilterItems)}if(t.customFilters){for(let i in t.customFilters){const s=t.customFilters[i];if(!this.filterByType[s.columnFilterType]){this.filterByType[s.columnFilterType]=[]}this.filterByType[s.columnFilterType].push(i);this.filterFunctionsIndexedByType[i]=s.func;this.filterNameIndexByType[i]=s.name}}if(t.filterProp){this.filterProp=t.filterProp}const s=t.include;if(s){const t={};for(let i in this.filterByType){const e=this.filterByType[i].filter((t=>s.indexOf(t)>-1));if(e.length){t[i]=e}}if(Object.keys(t).length>0){this.filterByType=t}}if(t.collection){this.filterCollection=i(t.collection,((t,i,s)=>{if(this.filterFunctionsIndexedByType[i.type]){t[s]=i}else{console.warn(`${i.type} type is not found.`)}return t}),{})}if(t.localization){if(t.localization.filterNames){Object.entries(t.localization.filterNames).forEach((([t,i])=>{if(this.filterNameIndexByType[t]!=void 0){this.filterNameIndexByType[t]=i}}))}}}async headerclick(t){var i,s,e;const n=(i=t.detail.originalEvent)===null||i===void 0?void 0:i.target;if(!j(n)){return}t.preventDefault();const o=await((s=this.pop)===null||s===void 0?void 0:s.getChanges());if(o&&(o===null||o===void 0?void 0:o.prop)===t.detail.prop){(e=this.pop)===null||e===void 0?void 0:e.show();return}if(!this.pop){return}const r=this.revogrid.getBoundingClientRect();const c=n.getBoundingClientRect();const h=t.detail.prop;this.pop.show(Object.assign(Object.assign({},this.filterCollection[h]),{x:c.x-r.x,y:c.y-r.y+c.height,autoCorrect:true,prop:h,filterTypes:this.getColumnFilter(t.detail.filter)}))}getColumnFilter(t){let i="string";if(!t){return{[i]:this.filterByType[i]}}if(this.isValidType(t)){i=t}else if(typeof t==="object"&&t.length){return t.reduce(((t,i)=>{if(this.isValidType(i)){t[i]=this.filterByType[i]}return t}),{})}return{[i]:this.filterByType[i]}}isValidType(t){return!!(typeof t==="string"&&this.filterByType[t])}async onFilterChange(t){this.multiFilterItems=t;this.runFiltering(this.multiFilterItems)}onFilterReset(t){delete this.multiFilterItems[t!==null&&t!==void 0?t:""];this.onFilterChange(this.multiFilterItems)}async doFiltering(t,i,s,e){const n=[];const o={};s.forEach((t=>{const i=Object.assign({},t);const s=e[i.prop];o[i.prop]=i;if(i[this.filterProp]&&!s){delete i[this.filterProp];n.push(i)}if(!i[this.filterProp]&&s){n.push(i);i[this.filterProp]=true}}));const r=this.getRowFilter(i,e,o);const{defaultPrevented:c,detail:h}=this.emit("beforefiltertrimmed",{collection:t,itemsToFilter:r,source:i,filterItems:e});if(c){return}const l=await this.revogrid.addTrimmed(h.itemsToFilter,bt);if(l.defaultPrevented){return}this.providers.column.updateColumns(n);this.emit("afterfilterapply")}async clearFiltering(){this.multiFilterItems={};await this.runFiltering(this.multiFilterItems)}async runFiltering(t){const i={};const s=Object.keys(t);for(const e of s){if(t[e].length>0){const s=t[e][0];i[e]={filter:this.filterFunctionsIndexedByType[s.type],type:s.type,value:s.value}}}this.filterCollection=i;const e=this.providers.column.getColumns();const n=this.providers.data.stores["rgRow"].store.get("source");const{defaultPrevented:o,detail:r}=this.emit("beforefilterapply",{collection:this.filterCollection,source:n,columns:e,filterItems:this.multiFilterItems});if(o){return}this.doFiltering(r.collection,r.source,r.columns,r.filterItems)}getRowFilter(t,i,s){const e=Object.keys(i);const n={};let o=0;let r=[];t.forEach(((t,c)=>{for(const h of e){const e=i[h];o=0;r=[];for(const[i,n]of e.entries()){const c=this.filterFunctionsIndexedByType[n.type];const l=s[h];const a=l?u(t,s[h]):t[h];if(n.relation==="or"){r=[];if(c(a,n.value)){continue}o++}else{r.push(!c(a,n.value));const t=e[i+1];if(!t||t.relation!=="and"){if(r.indexOf(true)===-1){r=[];continue}o+=r.length;r=[]}}}if(o===e.length){n[c]=true}}}));return n}}const jt="column-drag-start";class Ot{constructor(){this.offset=0}renderAutoscroll(t,i){if(!i){return}this.autoscrollEl=document.createElement("div");this.autoscrollEl.classList.add("drag-auto-scroll-y");i.appendChild(this.autoscrollEl)}autoscroll(t,i,s="translateX"){if(!this.autoscrollEl){return}const e=10;const n=Math.min(t+e,i-3);this.autoscrollEl.style.transform=`${s}(${n}px)`;this.autoscrollEl.scrollIntoView({block:"nearest",inline:"nearest"})}start(t,{dataEl:i,gridRect:s,scrollEl:e,gridEl:n},o="left"){n.classList.add(jt);const r=e.getBoundingClientRect();if(r){this.offset=r[o]-s[o]}this.renderAutoscroll(t,i)}stop(t){var i;t.classList.remove(jt);if(this.element){this.element.hidden=true}this.offset=0;(i=this.autoscrollEl)===null||i===void 0?void 0:i.remove();this.autoscrollEl=undefined}showHandler(t,i,s="translateX"){if(!this.element){return}if(this.offset){t=Math.max(t,this.offset)}t=Math.min(t,i);this.element.style.transform=`${s}(${t}px)`;this.element.hidden=false}render(){const t=this.element=document.createElement("div");t.classList.add("drag-position-y");t.hidden=true;return t}}const St=E;const Et="columndragmousemove";const xt="columndragend";const zt="beforecolumndragend";const Ct="columndragstart";class kt extends M{constructor(t,i){super(t,i);this.revogrid=t;this.providers=i;this.moveFunc=O((t=>this.doMove(t)),5);this.staticDragData=null;this.dragData=null;this.localSubscriptions={};this.orderUi=new Ot;t.appendChild(this.orderUi.render());t.classList.add("column-draggable");this.localSubscriptions["mouseleave"]={target:document,callback:t=>this.onMouseOut(t)};this.localSubscriptions["mouseup"]={target:document,callback:t=>this.onMouseUp(t)};this.localSubscriptions["mousemove"]={target:document,callback:t=>this.move(t)};this.addEventListener(St,(({detail:t})=>this.dragStart(t)))}dragStart({event:t,data:i}){if(t.defaultPrevented){return}const{defaultPrevented:s}=S(this.revogrid,Ct,i);if(s){return}this.clearOrder();const{mouseleave:e,mouseup:n,mousemove:o}=this.localSubscriptions;e.target.addEventListener("mouseleave",e.callback);n.target.addEventListener("mouseup",n.callback);const r=t.target.closest("revogr-header");const c=t.target.closest("revogr-viewport-scroll");if(!r||!c){return}if(f(i)||i.providers.type==="rowHeaders"){return}const h=this.getDimension(i.pin||"rgCol");const l=this.revogrid.getBoundingClientRect();const a=r.getBoundingClientRect();const u=b(h,Pt(t.x,l.left,a.left-l.left));this.staticDragData={startPos:t.x,startItem:u,data:i,dataEl:r,scrollEl:c,gridEl:this.revogrid,cols:h};this.dragData=this.getData(this.staticDragData);o.target.addEventListener("mousemove",o.callback);this.orderUi.start(t,Object.assign(Object.assign({},this.dragData),this.staticDragData))}doMove(t){if(!this.staticDragData){return}const i=this.dragData=this.getData(this.staticDragData);if(!i){return}const s=this.staticDragData.startPos;if(Math.abs(s-t.x)>10){const s=Pt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);const e=b(this.staticDragData.cols,s);this.orderUi.autoscroll(s,i.elRect.width);this.orderUi.showHandler(e.end+i.scrollOffset,i.gridRect.width)}}move(t){S(this.revogrid,Et,t);this.moveFunc(t)}onMouseOut(t){this.clearOrder()}onMouseUp(t){if(this.dragData&&this.staticDragData){let i=Pt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);if(i<0){i=0}const s=b(this.staticDragData.cols,i);const e=this.providers.column.stores[this.dragData.type].store;const n=[...e.get("items")];const{defaultPrevented:o}=S(this.revogrid,zt,Object.assign(Object.assign({},this.staticDragData),{startPosition:this.staticDragData.startItem,newPosition:s,newItem:e.get("source")[n[this.staticDragData.startItem.itemIndex]]}));if(!o){const t=n.splice(this.staticDragData.startItem.itemIndex,1);n.splice(s.itemIndex,0,...t);e.set("items",n)}S(this.revogrid,xt,this.dragData)}this.clearOrder()}clearLocalSubscriptions(){$(this.localSubscriptions,(({target:t,callback:i},s)=>t.removeEventListener(s,i)))}clearOrder(){this.staticDragData=null;this.dragData=null;this.clearLocalSubscriptions();this.orderUi.stop(this.revogrid)}clearSubscriptions(){super.clearSubscriptions();this.clearLocalSubscriptions()}getData({gridEl:t,dataEl:i,data:s}){const e=t.getBoundingClientRect();const n=i.getBoundingClientRect();const o=n.left-e.left;return{elRect:n,gridRect:e,type:s.pin||"rgCol",scrollOffset:o}}getDimension(t){return this.providers.dimension.stores[t].getCurrentState()}}function Pt(t,i,s){return t-i-s}export{T as A,M as B,kt as C,I as D,st as E,bt as F,H as S,J as a,gt as b,q as c,yt as d,wt as e,pt as f,vt as g,mt as h,F as i,Pt as j,$ as k,N as r};
|
|
5
|
-
//# sourceMappingURL=column.drag.plugin-813698d2.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by Revolist OU ❤️
|
|
3
|
-
*/
|
|
4
|
-
import{a as t,b as n,r as e,S as r,c as i,f as o,i as s,t as u}from"./debounce-72878ced.js";import{z as c,G as f,C as a,h as l}from"./index-dbd1c020.js";import{g as h,f as v}from"./index-a61f225b.js";const d=t=>({set(n,e){if(!p(n)){return}const r=t.get("items").reduce(((t,n)=>{t.add(n);return t}),new Set);const i=e.reduce(((t,n)=>{if(r.has(n)){t.push(n)}return t}),[]);t.set("items",i)}});function p(t){return t==="proxyItems"}function b(t,n,e,r){var i=t.length,o=e+(r?1:-1);while(r?o--:++o<i){if(n(t[o],o,t)){return o}}return-1}function y(){this.__data__=[];this.size=0}function j(t,n){return t===n||t!==t&&n!==n}function g(t,n){var e=t.length;while(e--){if(j(t[e][0],n)){return e}}return-1}var m=Array.prototype;var w=m.splice;function O(t){var n=this.__data__,e=g(n,t);if(e<0){return false}var r=n.length-1;if(e==r){n.pop()}else{w.call(n,e,1)}--this.size;return true}function x(t){var n=this.__data__,e=g(n,t);return e<0?undefined:n[e][1]}function A(t){return g(this.__data__,t)>-1}function _(t,n){var e=this.__data__,r=g(e,t);if(r<0){++this.size;e.push([t,n])}else{e[r][1]=n}return this}function C(t){var n=-1,e=t==null?0:t.length;this.clear();while(++n<e){var r=t[n];this.set(r[0],r[1])}}C.prototype.clear=y;C.prototype["delete"]=O;C.prototype.get=x;C.prototype.has=A;C.prototype.set=_;function R(){this.__data__=new C;this.size=0}function S(t){var n=this.__data__,e=n["delete"](t);this.size=n.size;return e}function M(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}var D="[object AsyncFunction]",$="[object Function]",P="[object GeneratorFunction]",T="[object Proxy]";function k(e){if(!t(e)){return false}var r=n(e);return r==$||r==P||r==D||r==T}var E=e["__core-js_shared__"];const F=E;var B=function(){var t=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function N(t){return!!B&&B in t}var G=Function.prototype;var U=G.toString;function V(t){if(t!=null){try{return U.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var W=/[\\^$.*+?()[\]{}|]/g;var L=/^\[object .+?Constructor\]$/;var J=Function.prototype,z=Object.prototype;var K=J.toString;var X=z.hasOwnProperty;var Y=RegExp("^"+K.call(X).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(n){if(!t(n)||N(n)){return false}var e=k(n)?Y:L;return e.test(V(n))}function H(t,n){return t==null?undefined:t[n]}function Q(t,n){var e=H(t,n);return q(e)?e:undefined}var Z=Q(e,"Map");const tt=Z;var nt=Q(Object,"create");const et=nt;function rt(){this.__data__=et?et(null):{};this.size=0}function it(t){var n=this.has(t)&&delete this.__data__[t];this.size-=n?1:0;return n}var ot="__lodash_hash_undefined__";var st=Object.prototype;var ut=st.hasOwnProperty;function ct(t){var n=this.__data__;if(et){var e=n[t];return e===ot?undefined:e}return ut.call(n,t)?n[t]:undefined}var ft=Object.prototype;var at=ft.hasOwnProperty;function lt(t){var n=this.__data__;return et?n[t]!==undefined:at.call(n,t)}var ht="__lodash_hash_undefined__";function vt(t,n){var e=this.__data__;this.size+=this.has(t)?0:1;e[t]=et&&n===undefined?ht:n;return this}function dt(t){var n=-1,e=t==null?0:t.length;this.clear();while(++n<e){var r=t[n];this.set(r[0],r[1])}}dt.prototype.clear=rt;dt.prototype["delete"]=it;dt.prototype.get=ct;dt.prototype.has=lt;dt.prototype.set=vt;function pt(){this.size=0;this.__data__={hash:new dt,map:new(tt||C),string:new dt}}function bt(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}function yt(t,n){var e=t.__data__;return bt(n)?e[typeof n=="string"?"string":"hash"]:e.map}function jt(t){var n=yt(this,t)["delete"](t);this.size-=n?1:0;return n}function gt(t){return yt(this,t).get(t)}function mt(t){return yt(this,t).has(t)}function wt(t,n){var e=yt(this,t),r=e.size;e.set(t,n);this.size+=e.size==r?0:1;return this}function Ot(t){var n=-1,e=t==null?0:t.length;this.clear();while(++n<e){var r=t[n];this.set(r[0],r[1])}}Ot.prototype.clear=pt;Ot.prototype["delete"]=jt;Ot.prototype.get=gt;Ot.prototype.has=mt;Ot.prototype.set=wt;var xt=200;function At(t,n){var e=this.__data__;if(e instanceof C){var r=e.__data__;if(!tt||r.length<xt-1){r.push([t,n]);this.size=++e.size;return this}e=this.__data__=new Ot(r)}e.set(t,n);this.size=e.size;return this}function _t(t){var n=this.__data__=new C(t);this.size=n.size}_t.prototype.clear=R;_t.prototype["delete"]=S;_t.prototype.get=M;_t.prototype.has=I;_t.prototype.set=At;var Ct="__lodash_hash_undefined__";function Rt(t){this.__data__.set(t,Ct);return this}function St(t){return this.__data__.has(t)}function Mt(t){var n=-1,e=t==null?0:t.length;this.__data__=new Ot;while(++n<e){this.add(t[n])}}Mt.prototype.add=Mt.prototype.push=Rt;Mt.prototype.has=St;function It(t,n){var e=-1,r=t==null?0:t.length;while(++e<r){if(n(t[e],e,t)){return true}}return false}function Dt(t,n){return t.has(n)}var $t=1,Pt=2;function Tt(t,n,e,r,i,o){var s=e&$t,u=t.length,c=n.length;if(u!=c&&!(s&&c>u)){return false}var f=o.get(t);var a=o.get(n);if(f&&a){return f==n&&a==t}var l=-1,h=true,v=e&Pt?new Mt:undefined;o.set(t,n);o.set(n,t);while(++l<u){var d=t[l],p=n[l];if(r){var b=s?r(p,d,l,n,t,o):r(d,p,l,t,n,o)}if(b!==undefined){if(b){continue}h=false;break}if(v){if(!It(n,(function(t,n){if(!Dt(v,n)&&(d===t||i(d,t,e,r,o))){return v.push(n)}}))){h=false;break}}else if(!(d===p||i(d,p,e,r,o))){h=false;break}}o["delete"](t);o["delete"](n);return h}var kt=e.Uint8Array;const Et=kt;function Ft(t){var n=-1,e=Array(t.size);t.forEach((function(t,r){e[++n]=[r,t]}));return e}function Bt(t){var n=-1,e=Array(t.size);t.forEach((function(t){e[++n]=t}));return e}var Nt=1,Gt=2;var Ut="[object Boolean]",Vt="[object Date]",Wt="[object Error]",Lt="[object Map]",Jt="[object Number]",zt="[object RegExp]",Kt="[object Set]",Xt="[object String]",Yt="[object Symbol]";var qt="[object ArrayBuffer]",Ht="[object DataView]";var Qt=r?r.prototype:undefined,Zt=Qt?Qt.valueOf:undefined;function tn(t,n,e,r,i,o,s){switch(e){case Ht:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset){return false}t=t.buffer;n=n.buffer;case qt:if(t.byteLength!=n.byteLength||!o(new Et(t),new Et(n))){return false}return true;case Ut:case Vt:case Jt:return j(+t,+n);case Wt:return t.name==n.name&&t.message==n.message;case zt:case Xt:return t==n+"";case Lt:var u=Ft;case Kt:var c=r&Nt;u||(u=Bt);if(t.size!=n.size&&!c){return false}var f=s.get(t);if(f){return f==n}r|=Gt;s.set(t,n);var a=Tt(u(t),u(n),r,i,o,s);s["delete"](t);return a;case Yt:if(Zt){return Zt.call(t)==Zt.call(n)}}return false}function nn(t,n){var e=-1,r=n.length,i=t.length;while(++e<r){t[i+e]=n[e]}return t}var en=Array.isArray;const rn=en;function on(t,n,e){var r=n(t);return rn(t)?r:nn(r,e(t))}function sn(t,n){var e=-1,r=t==null?0:t.length,i=0,o=[];while(++e<r){var s=t[e];if(n(s,e,t)){o[i++]=s}}return o}function un(){return[]}var cn=Object.prototype;var fn=cn.propertyIsEnumerable;var an=Object.getOwnPropertySymbols;var ln=!an?un:function(t){if(t==null){return[]}t=Object(t);return sn(an(t),(function(n){return fn.call(t,n)}))};const hn=ln;function vn(t,n){var e=-1,r=Array(t);while(++e<t){r[e]=n(e)}return r}var dn="[object Arguments]";function pn(t){return i(t)&&n(t)==dn}var bn=Object.prototype;var yn=bn.hasOwnProperty;var jn=bn.propertyIsEnumerable;var gn=pn(function(){return arguments}())?pn:function(t){return i(t)&&yn.call(t,"callee")&&!jn.call(t,"callee")};const mn=gn;function wn(){return false}var On=typeof exports=="object"&&exports&&!exports.nodeType&&exports;var xn=On&&typeof module=="object"&&module&&!module.nodeType&&module;var An=xn&&xn.exports===On;var _n=An?e.Buffer:undefined;var Cn=_n?_n.isBuffer:undefined;var Rn=Cn||wn;const Sn=Rn;var Mn=9007199254740991;var In=/^(?:0|[1-9]\d*)$/;function Dn(t,n){var e=typeof t;n=n==null?Mn:n;return!!n&&(e=="number"||e!="symbol"&&In.test(t))&&(t>-1&&t%1==0&&t<n)}var $n=9007199254740991;function Pn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$n}var Tn="[object Arguments]",kn="[object Array]",En="[object Boolean]",Fn="[object Date]",Bn="[object Error]",Nn="[object Function]",Gn="[object Map]",Un="[object Number]",Vn="[object Object]",Wn="[object RegExp]",Ln="[object Set]",Jn="[object String]",zn="[object WeakMap]";var Kn="[object ArrayBuffer]",Xn="[object DataView]",Yn="[object Float32Array]",qn="[object Float64Array]",Hn="[object Int8Array]",Qn="[object Int16Array]",Zn="[object Int32Array]",te="[object Uint8Array]",ne="[object Uint8ClampedArray]",ee="[object Uint16Array]",re="[object Uint32Array]";var ie={};ie[Yn]=ie[qn]=ie[Hn]=ie[Qn]=ie[Zn]=ie[te]=ie[ne]=ie[ee]=ie[re]=true;ie[Tn]=ie[kn]=ie[Kn]=ie[En]=ie[Xn]=ie[Fn]=ie[Bn]=ie[Nn]=ie[Gn]=ie[Un]=ie[Vn]=ie[Wn]=ie[Ln]=ie[Jn]=ie[zn]=false;function oe(t){return i(t)&&Pn(t.length)&&!!ie[n(t)]}function se(t){return function(n){return t(n)}}var ue=typeof exports=="object"&&exports&&!exports.nodeType&&exports;var ce=ue&&typeof module=="object"&&module&&!module.nodeType&&module;var fe=ce&&ce.exports===ue;var ae=fe&&o.process;var le=function(){try{var t=ce&&ce.require&&ce.require("util").types;if(t){return t}return ae&&ae.binding&&ae.binding("util")}catch(t){}}();const he=le;var ve=he&&he.isTypedArray;var de=ve?se(ve):oe;const pe=de;var be=Object.prototype;var ye=be.hasOwnProperty;function je(t,n){var e=rn(t),r=!e&&mn(t),i=!e&&!r&&Sn(t),o=!e&&!r&&!i&&pe(t),s=e||r||i||o,u=s?vn(t.length,String):[],c=u.length;for(var f in t){if((n||ye.call(t,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Dn(f,c)))){u.push(f)}}return u}var ge=Object.prototype;function me(t){var n=t&&t.constructor,e=typeof n=="function"&&n.prototype||ge;return t===e}function we(t,n){return function(e){return t(n(e))}}var Oe=we(Object.keys,Object);const xe=Oe;var Ae=Object.prototype;var _e=Ae.hasOwnProperty;function Ce(t){if(!me(t)){return xe(t)}var n=[];for(var e in Object(t)){if(_e.call(t,e)&&e!="constructor"){n.push(e)}}return n}function Re(t){return t!=null&&Pn(t.length)&&!k(t)}function Se(t){return Re(t)?je(t):Ce(t)}function Me(t){return on(t,Se,hn)}var Ie=1;var De=Object.prototype;var $e=De.hasOwnProperty;function Pe(t,n,e,r,i,o){var s=e&Ie,u=Me(t),c=u.length,f=Me(n),a=f.length;if(c!=a&&!s){return false}var l=c;while(l--){var h=u[l];if(!(s?h in n:$e.call(n,h))){return false}}var v=o.get(t);var d=o.get(n);if(v&&d){return v==n&&d==t}var p=true;o.set(t,n);o.set(n,t);var b=s;while(++l<c){h=u[l];var y=t[h],j=n[h];if(r){var g=s?r(j,y,h,n,t,o):r(y,j,h,t,n,o)}if(!(g===undefined?y===j||i(y,j,e,r,o):g)){p=false;break}b||(b=h=="constructor")}if(p&&!b){var m=t.constructor,w=n.constructor;if(m!=w&&("constructor"in t&&"constructor"in n)&&!(typeof m=="function"&&m instanceof m&&typeof w=="function"&&w instanceof w)){p=false}}o["delete"](t);o["delete"](n);return p}var Te=Q(e,"DataView");const ke=Te;var Ee=Q(e,"Promise");const Fe=Ee;var Be=Q(e,"Set");const Ne=Be;var Ge=Q(e,"WeakMap");const Ue=Ge;var Ve="[object Map]",We="[object Object]",Le="[object Promise]",Je="[object Set]",ze="[object WeakMap]";var Ke="[object DataView]";var Xe=V(ke),Ye=V(tt),qe=V(Fe),He=V(Ne),Qe=V(Ue);var Ze=n;if(ke&&Ze(new ke(new ArrayBuffer(1)))!=Ke||tt&&Ze(new tt)!=Ve||Fe&&Ze(Fe.resolve())!=Le||Ne&&Ze(new Ne)!=Je||Ue&&Ze(new Ue)!=ze){Ze=function(t){var e=n(t),r=e==We?t.constructor:undefined,i=r?V(r):"";if(i){switch(i){case Xe:return Ke;case Ye:return Ve;case qe:return Le;case He:return Je;case Qe:return ze}}return e}}const tr=Ze;var nr=1;var er="[object Arguments]",rr="[object Array]",ir="[object Object]";var or=Object.prototype;var sr=or.hasOwnProperty;function ur(t,n,e,r,i,o){var s=rn(t),u=rn(n),c=s?rr:tr(t),f=u?rr:tr(n);c=c==er?ir:c;f=f==er?ir:f;var a=c==ir,l=f==ir,h=c==f;if(h&&Sn(t)){if(!Sn(n)){return false}s=true;a=false}if(h&&!a){o||(o=new _t);return s||pe(t)?Tt(t,n,e,r,i,o):tn(t,n,c,e,r,i,o)}if(!(e&nr)){var v=a&&sr.call(t,"__wrapped__"),d=l&&sr.call(n,"__wrapped__");if(v||d){var p=v?t.value():t,b=d?n.value():n;o||(o=new _t);return i(p,b,e,r,o)}}if(!h){return false}o||(o=new _t);return Pe(t,n,e,r,i,o)}function cr(t,n,e,r,o){if(t===n){return true}if(t==null||n==null||!i(t)&&!i(n)){return t!==t&&n!==n}return ur(t,n,e,r,cr,o)}var fr=1,ar=2;function lr(t,n,e,r){var i=e.length,o=i,s=!r;if(t==null){return!o}t=Object(t);while(i--){var u=e[i];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t)){return false}}while(++i<o){u=e[i];var c=u[0],f=t[c],a=u[1];if(s&&u[2]){if(f===undefined&&!(c in t)){return false}}else{var l=new _t;if(r){var h=r(f,a,c,t,n,l)}if(!(h===undefined?cr(a,f,fr|ar,r,l):h)){return false}}}return true}function hr(n){return n===n&&!t(n)}function vr(t){var n=Se(t),e=n.length;while(e--){var r=n[e],i=t[r];n[e]=[r,i,hr(i)]}return n}function dr(t,n){return function(e){if(e==null){return false}return e[t]===n&&(n!==undefined||t in Object(e))}}function pr(t){var n=vr(t);if(n.length==1&&n[0][2]){return dr(n[0][0],n[0][1])}return function(e){return e===t||lr(e,t,n)}}var br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yr=/^\w*$/;function jr(t,n){if(rn(t)){return false}var e=typeof t;if(e=="number"||e=="symbol"||e=="boolean"||t==null||s(t)){return true}return yr.test(t)||!br.test(t)||n!=null&&t in Object(n)}var gr="Expected a function";function mr(t,n){if(typeof t!="function"||n!=null&&typeof n!="function"){throw new TypeError(gr)}var e=function(){var r=arguments,i=n?n.apply(this,r):r[0],o=e.cache;if(o.has(i)){return o.get(i)}var s=t.apply(this,r);e.cache=o.set(i,s)||o;return s};e.cache=new(mr.Cache||Ot);return e}mr.Cache=Ot;var wr=500;function Or(t){var n=mr(t,(function(t){if(e.size===wr){e.clear()}return t}));var e=n.cache;return n}var xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var Ar=/\\(\\)?/g;var _r=Or((function(t){var n=[];if(t.charCodeAt(0)===46){n.push("")}t.replace(xr,(function(t,e,r,i){n.push(r?i.replace(Ar,"$1"):e||t)}));return n}));const Cr=_r;function Rr(t,n){var e=-1,r=t==null?0:t.length,i=Array(r);while(++e<r){i[e]=n(t[e],e,t)}return i}var Sr=1/0;var Mr=r?r.prototype:undefined,Ir=Mr?Mr.toString:undefined;function Dr(t){if(typeof t=="string"){return t}if(rn(t)){return Rr(t,Dr)+""}if(s(t)){return Ir?Ir.call(t):""}var n=t+"";return n=="0"&&1/t==-Sr?"-0":n}function $r(t){return t==null?"":Dr(t)}function Pr(t,n){if(rn(t)){return t}return jr(t,n)?[t]:Cr($r(t))}var Tr=1/0;function kr(t){if(typeof t=="string"||s(t)){return t}var n=t+"";return n=="0"&&1/t==-Tr?"-0":n}function Er(t,n){n=Pr(n,t);var e=0,r=n.length;while(t!=null&&e<r){t=t[kr(n[e++])]}return e&&e==r?t:undefined}function Fr(t,n,e){var r=t==null?undefined:Er(t,n);return r===undefined?e:r}function Br(t,n){return t!=null&&n in Object(t)}function Nr(t,n,e){n=Pr(n,t);var r=-1,i=n.length,o=false;while(++r<i){var s=kr(n[r]);if(!(o=t!=null&&e(t,s))){break}t=t[s]}if(o||++r!=i){return o}i=t==null?0:t.length;return!!i&&Pn(i)&&Dn(s,i)&&(rn(t)||mn(t))}function Gr(t,n){return t!=null&&Nr(t,n,Br)}var Ur=1,Vr=2;function Wr(t,n){if(jr(t)&&hr(n)){return dr(kr(t),n)}return function(e){var r=Fr(e,t);return r===undefined&&r===n?Gr(e,t):cr(n,r,Ur|Vr)}}function Lr(t){return function(n){return n==null?undefined:n[t]}}function Jr(t){return function(n){return Er(n,t)}}function zr(t){return jr(t)?Lr(kr(t)):Jr(t)}function Kr(t){if(typeof t=="function"){return t}if(t==null){return c}if(typeof t=="object"){return rn(t)?Wr(t[0],t[1]):pr(t)}return zr(t)}var Xr=1/0,Yr=17976931348623157e292;function qr(t){if(!t){return t===0?t:0}t=u(t);if(t===Xr||t===-Xr){var n=t<0?-1:1;return n*Yr}return t===t?t:0}function Hr(t){var n=qr(t),e=n%1;return n===n?e?n-e:n:0}var Qr=Math.max;function Zr(t,n,e){var r=t==null?0:t.length;if(!r){return-1}var i=e==null?0:Hr(e);if(i<0){i=Qr(r+i,0)}return b(t,Kr(n),i)}var ti=Math.ceil,ni=Math.max;function ei(t,n,e,r){var i=-1,o=ni(ti((n-t)/(e||1)),0),s=Array(o);while(o--){s[r?o:++i]=t;t+=e}return s}function ri(n,e,r){if(!t(r)){return false}var i=typeof e;if(i=="number"?Re(r)&&Dn(e,r.length):i=="string"&&e in r){return j(r[e],n)}return false}function ii(t){return function(n,e,r){if(r&&typeof r!="number"&&ri(n,e,r)){e=r=undefined}n=qr(n);if(e===undefined){e=n;n=0}else{e=qr(e)}r=r===undefined?n<e?1:-1:qr(r);return ei(n,e,r,t)}}var oi=ii();const si=oi;const ui=(t,n,e)=>{const r=t.get(n);if(!r){t.set(n,[e])}else if(!r.includes(e)){r.push(e)}};const ci=(t,n)=>{let e;return(...r)=>{if(e){clearTimeout(e)}e=setTimeout((()=>{e=0;t(...r)}),n)}};const fi=t=>!("isConnected"in t)||t.isConnected;const ai=ci((t=>{for(let n of t.keys()){t.set(n,t.get(n).filter(fi))}}),2e3);const li=()=>{if(typeof h!=="function"){return{}}const t=new Map;return{dispose:()=>t.clear(),get:n=>{const e=h();if(e){ui(t,n,e)}},set:n=>{const e=t.get(n);if(e){t.set(n,e.filter(v))}ai(t)},reset:()=>{t.forEach((t=>t.forEach(v)));ai(t)}}};const hi=t=>typeof t==="function"?t():t;const vi=(t,n=((t,n)=>t!==n))=>{const e=hi(t);let r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));const i={dispose:[],get:[],set:[],reset:[]};const o=()=>{var n;r=new Map(Object.entries((n=hi(t))!==null&&n!==void 0?n:{}));i.reset.forEach((t=>t()))};const s=()=>{i.dispose.forEach((t=>t()));o()};const u=t=>{i.get.forEach((n=>n(t)));return r.get(t)};const c=(t,e)=>{const o=r.get(t);if(n(e,o,t)){r.set(t,e);i.set.forEach((n=>n(t,e,o)))}};const f=typeof Proxy==="undefined"?{}:new Proxy(e,{get(t,n){return u(n)},ownKeys(t){return Array.from(r.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,n){return r.has(n)},set(t,n,e){c(n,e);return true}});const a=(t,n)=>{i[t].push(n);return()=>{di(i[t],n)}};const l=(n,e)=>{const r=a("set",((t,r)=>{if(t===n){e(r)}}));const i=a("reset",(()=>e(hi(t)[n])));return()=>{r();i()}};const h=(...t)=>{const n=t.reduce(((t,n)=>{if(n.set){t.push(a("set",n.set))}if(n.get){t.push(a("get",n.get))}if(n.reset){t.push(a("reset",n.reset))}if(n.dispose){t.push(a("dispose",n.dispose))}return t}),[]);return()=>n.forEach((t=>t()))};const v=t=>{const n=r.get(t);i.set.forEach((e=>e(t,n,n)))};return{state:f,get:u,set:c,on:a,onChange:l,use:h,dispose:s,reset:o,forceUpdate:v}};const di=(t,n)=>{const e=t.indexOf(n);if(e>=0){t[e]=t[t.length-1];t.length--}};const pi=(t,n)=>{const e=vi(t,n);e.use(li());return e};const bi=t=>({set(n,e){switch(n){case"trimmed":{const n=t.get("proxyItems");const r=yi(e);const i=n.filter((t=>!r[t]));t.set("items",i);break}}}});function yi(t){const n={};for(let e in t){for(let r in t[e]){n[r]=n[r]||t[e][r]}}return n}function ji(t,n){Object.entries(n).forEach((([n,e])=>{t.set(n,e)}))}class gi{get store(){return this.dataStore}constructor(t,n){const e=this.dataStore=pi(Object.assign({items:[],proxyItems:[],source:[],groupingDepth:0,groups:{},type:t,trimmed:{},groupingCustomRenderer:undefined},n));e.use(d(e));e.use(bi(e))}updateData(t,n,e=false){if(!e){this.store.set("trimmed",{})}this.store.set("items",[]);const r=si(0,(t===null||t===void 0?void 0:t.length)||0);ji(this.store,{source:t,proxyItems:[...r]});this.store.set("items",r);if(n){ji(this.store,{groupingDepth:n.depth,groups:n.groups,groupingCustomRenderer:n.customRenderer})}}addTrimmed(t){let n=this.store.get("trimmed");n=Object.assign(Object.assign({},n),t);ji(this.store,{trimmed:n})}setSourceData(t,n=true){Ai(this.store,t,n)}setData(t){const n=Object.assign({},t);ji(this.store,n)}refresh(){const t=this.store.get("source");this.store.set("source",[...t])}}function mi(t,n){const e=t.get("items");return e[n]}function wi(t){const n=t.get("source");return t.get("items").map((t=>n[t]))}const Oi=(t,n)=>{const e=t.get("source");return e[xi(t,n)]};const xi=(t,n)=>{const e=t.get("items");return e[n]};function Ai(t,n,e=true){const r=t.get("items");const i=t.get("source");for(let t in n){const e=r[t];const o=n[t];i[e]=o}if(e){t.set("source",[...i])}}function _i(t,n,e=true){const r=t.get("source");for(let t in n){r[t]=n[t]}if(e){t.set("source",[...r])}}function Ci(t,n){t.set("items",n)}function Ri(t,n){const e=t.get("items");const r=t.get("source");const i=Zr(r,{prop:n});return e.indexOf(i)}function Si(t,n,e,r){var i=-1,o=t==null?0:t.length;if(r&&o){e=t[++i]}while(++i<o){e=n(e,t[i],i,t)}return e}function Mi(t){return function(n,e,r){var i=-1,o=Object(n),s=r(n),u=s.length;while(u--){var c=s[t?u:++i];if(e(o[c],c,o)===false){break}}return n}}var Ii=Mi();const Di=Ii;function $i(t,n){return t&&Di(t,n,Se)}function Pi(t,n){return function(e,r){if(e==null){return e}if(!Re(e)){return t(e,r)}var i=e.length,o=n?i:-1,s=Object(e);while(n?o--:++o<i){if(r(s[o],o,s)===false){break}}return e}}var Ti=Pi($i);const ki=Ti;function Ei(t,n,e,r,i){i(t,(function(t,i,o){e=r?(r=false,t):n(e,t,i,o)}));return e}function Fi(t,n,e){var r=rn(t)?Si:Ei,i=arguments.length<3;return r(t,Kr(n),e,i,ki)}function Bi(){return{range:null,tempRange:null,tempRangeType:null,focus:null,edit:null,lastCell:null,nextFocus:null}}class Ni{constructor(){this.unsubscribe=[];this.store=pi(Bi());this.store.on("set",((t,n)=>{if(t==="tempRange"&&!n){this.store.set("tempRangeType",null)}}))}onChange(t,n){this.unsubscribe.push(this.store.onChange(t,n))}clearFocus(){ji(this.store,{focus:null,range:null,edit:null,tempRange:null})}setFocus(t,n){if(!n){ji(this.store,{focus:t})}else{ji(this.store,{focus:t,range:Ji(t,n),edit:null,tempRange:null})}}setNextFocus(t){ji(this.store,{nextFocus:t})}setTempArea(t){ji(this.store,{tempRange:t===null||t===void 0?void 0:t.area,tempRangeType:t===null||t===void 0?void 0:t.type,edit:null})}clearTemp(){ji(this.store,{tempRange:null})}setRangeArea(t){ji(this.store,{range:t,edit:null,tempRange:null})}setRange(t,n){const e=Ji(t,n);this.setRangeArea(e)}setLastCell(t){ji(this.store,{lastCell:t})}setEdit(t){const n=this.store.get("focus");if(n&&typeof t==="string"){ji(this.store,{edit:{x:n.x,y:n.y,val:t}});return}ji(this.store,{edit:null})}dispose(){this.unsubscribe.forEach((t=>t()));this.store.dispose()}}const Gi=-1;class Ui{constructor(){this.dirty=false;this.stores={};this.columnStores={};this.rowStores={};this.storesByType={};this.storesXToType={};this.storesYToType={};this.sections=[]}get focusedStore(){var t;for(let n in this.stores){for(let e in this.stores[n]){const r=(t=this.stores[n][e])===null||t===void 0?void 0:t.store.get("focus");if(r){return{entity:this.stores[n][e],cell:r,position:{x:parseInt(e,10),y:parseInt(n,10)}}}}}return null}get edit(){var t;return(t=this.focusedStore)===null||t===void 0?void 0:t.entity.store.get("edit")}get focused(){var t;return(t=this.focusedStore)===null||t===void 0?void 0:t.entity.store.get("focus")}get selectedRange(){var t;return(t=this.focusedStore)===null||t===void 0?void 0:t.entity.store.get("range")}registerSection(t){if(!t){this.sections.length=0;this.dirty=true;return}if(this.sections.indexOf(t)===-1){this.sections.push(t)}}beforeUpdate(){if(this.dirty){for(let t in this.stores){for(let n in this.stores[t]){this.stores[t][n].dispose()}}this.dirty=false}}registerColumn(t,n){if(Vi(t)){return new Ni}if(this.columnStores[t]){return this.columnStores[t]}this.columnStores[t]=new Ni;this.storesByType[n]=t;this.storesXToType[t]=n;return this.columnStores[t]}registerRow(t,n){if(Vi(t)){return new Ni}if(this.rowStores[t]){return this.rowStores[t]}this.rowStores[t]=new Ni;this.storesByType[n]=t;this.storesYToType[t]=n;return this.rowStores[t]}register({x:t,y:n}){var e,r;if(Vi(t)||Vi(n)){return new Ni}if(!this.stores[n]){this.stores[n]={}}if(this.stores[n][t]){return this.stores[n][t]}this.stores[n][t]=new Ni;(e=this.stores[n][t])===null||e===void 0?void 0:e.onChange("range",(e=>{this.columnStores[t].setRangeArea(e);this.rowStores[n].setRangeArea(e)}));(r=this.stores[n][t])===null||r===void 0?void 0:r.store.on("dispose",(()=>this.destroy(t,n)));return this.stores[n][t]}destroy(t,n){var e,r;(e=this.columnStores[t])===null||e===void 0?void 0:e.dispose();(r=this.rowStores[n])===null||r===void 0?void 0:r.dispose();delete this.rowStores[n];delete this.columnStores[t];if(this.storesXToType[t]){const n=this.storesXToType[t];delete this.storesXToType[t];delete this.storesByType[n]}if(this.storesYToType[n]){const t=this.storesYToType[n];delete this.storesYToType[n];delete this.storesByType[t]}if(this.stores[n]){delete this.stores[n][t]}if(!Object.keys(this.stores[n]||{}).length){delete this.stores[n]}}setEditByCell(t,n){this.focusByCell(t,n,n);this.setEdit("")}beforeNextFocusCell(t){var n;if(!this.focusedStore){return}const e=this.focusedStore.entity.store.get("lastCell");const r=e&&this.getNextStore(t,this.focusedStore.position,e);(n=r===null||r===void 0?void 0:r.store)===null||n===void 0?void 0:n.setNextFocus(Object.assign(Object.assign({},t),r.item))}focusByCell(t,n,e){const r=this.stores[t.y][t.x];this.focus(r,{focus:n,end:e})}focus(t,{focus:n,end:e}){const r=this.getCurrentStorePointer(t);if(!r){return null}const i=t.store.get("lastCell");const o=i&&this.getNextStore(n,r,i);if(o===null||o===void 0?void 0:o.store){const t=Object.assign(Object.assign({},n),o.item);this.focus(o.store,{focus:t,end:t});return null}if(i){n=Li(n,i);e=Li(e,i)}t.setFocus(n,e);return n}getCurrentStorePointer(t){let n;for(let e in this.stores){for(let r in this.stores[e]){const i=this.stores[e][r];if(i!==t){i.clearFocus()}else{n={x:parseInt(r,10),y:parseInt(e,10)}}}}return n}getNextStore(t,n,e){const r=Wi(t,e);let i;if(r){Object.entries(r).forEach((([t,e])=>{let o;switch(t){case"x":o=this.getXStores(n.y);break;case"y":o=this.getYStores(n.x);break}if(e>=0){i=o[++n[t]]}else{i=o[--n[t]];const s=i===null||i===void 0?void 0:i.store.get("lastCell");if(s){r[t]=s[t]+e}}}))}return{store:i,item:r}}clearAll(){var t;for(let n in this.stores){for(let e in this.stores[n]){(t=this.stores[n][e])===null||t===void 0?void 0:t.clearFocus()}}}setEdit(t){if(!this.focusedStore){return}this.focusedStore.entity.setEdit(t)}selectAll(){for(let t in this.stores){for(let n in this.stores[t]){const e=this.stores[t][n];if(!e){continue}const r=e.store.get("lastCell");if(r){e.setRange({x:0,y:0},{x:r.x-1,y:r.y-1})}}}}getXStores(t){return this.stores[t]}getYStores(t){const n={};for(let e in this.stores){n[e]=this.stores[e][t]}return n}}function Vi(t){return t===Gi}function Wi(t,n){const e={};let r=["x","y"];for(let n of r){if(t[n]<0){e[n]=t[n];return e}}for(let i of r){if(t[i]>=n[i]){e[i]=t[i]-n[i];return e}}return null}function Li(t,n){const e=Object.assign({},t);const r=["x","y"];for(const i of r){if(t[i]<0){e[i]=0}else if(t[i]>=n[i]){e[i]=n[i]-1}}return e}function Ji(t,n){return t&&n?{x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),x1:Math.max(t.x,n.x),y1:Math.max(t.y,n.y)}:null}function zi(t){return t.x===t.x1&&t.y===t.y1}function Ki(t){if(typeof t==="undefined"||t===null){return""}return t}function Xi(t,n){const e=n.cellParser?n.cellParser(t,n):t[n.prop];return Ki(e)}function Yi(t){if(t.pin){return t.pin}return"rgCol"}function qi(t){const n={};for(const[e,r]of t.entries()){if(r.size){n[e]=r.size}}return n}function Hi(t){return!!t.children}function Qi(t,n=0,e){const r={columns:{rgCol:[],colPinStart:[],colPinEnd:[]},columnByProp:{},columnGrouping:{rgCol:[],colPinStart:[],colPinEnd:[]},maxLevel:n,sort:{}};return Fi(t,((t,r)=>{if(Hi(r)){return Zi(t,r,Qi(r.children,n+1,e),n)}const i=r.columnType&&(e===null||e===void 0?void 0:e[r.columnType]);const o=Object.assign(Object.assign({},i),r);if(!o.pin){t.columns.rgCol.push(o)}else{t.columns[o.pin].push(o)}if(o.order){t.sort[o.prop]=o}if(!t.columnByProp[o.prop]){t.columnByProp[o.prop]=[]}t.columnByProp[o.prop].push(o);o.beforeSetup&&o.beforeSetup(o);return t}),r)}function Zi(t,n,e,r=0){const i=Object.assign(Object.assign({},n),{level:r,ids:[]});for(let n in e.columns){const r=n;const o=t.columns[r];const s=e.columns[r];if(rn(o)&&rn(s)){o.push(...s);if(s.length){t.columnGrouping[r].push(Object.assign(Object.assign({},i),{ids:s.map((t=>t.prop))}))}}}for(let n in e.columnGrouping){const r=n;const i=e.columnGrouping[r];t.columnGrouping[r].push(...i)}t.maxLevel=Math.max(t.maxLevel,e.maxLevel);t.sort=Object.assign(Object.assign({},t.sort),e.sort);return t}function to(t,n){for(const e of t){if(Hi(e)){const t=to(e.children,n);if(t){return t}}else if(e.prop===n){return e}}return undefined}function no(t,n){return to(t,n)}const eo=`${f}-depth`;const ro=`${f}-name`;const io=`${f}-id`;const oo=`${f}-value`;const so=`${f}-column`;const uo=`${f}-expanded`;const co=`${f}-original-index`;const fo=`group-expand`;const ao=`groupexpandclick`;const lo="rgRow";function ho(t,n){return t[n]||null}function vo(t,n,{prevExpanded:e,expandedAll:r,getGroupValue:i=ho}){const o=new Map;t.forEach(((t,e)=>{const r=n.map((n=>i(t,n)));const s=r.pop();let u=o;r.forEach((t=>{if(!u.has(t)){u.set(t,new Map)}u=u.get(t)}));if(!u.has(s)){u.set(s,[])}const c=u.get(s);c.push(Object.assign(Object.assign({},t),{[co]:e}))}));let s=-1;const u=n.length;const c={};const f={};const a={};const l=[];function h(t,n,i){const o=n.length;t.forEach(((t,u)=>{const v=[...n,u];const d=v.join(",");const p=i&&(!!r||!!(e===null||e===void 0?void 0:e[d]));l.push({[ro]:u,[eo]:o,[io]:JSON.stringify(v),[oo]:d,[uo]:p});s+=1;if(!p&&o){c[s]=true}if(Array.isArray(t)){t.forEach((t=>{s+=1;if(!p){c[s]=true}f[t[co]]=s;const n=v.map(((t,n)=>v.slice(0,n+1).join(",")));n.forEach((t=>{if(!a[t]){a[t]=[]}a[t].push(s)}))}));l.push(...t)}else{h(t,v,p)}}))}h(o,[],true);return{sourceWithGroups:l,depth:u,trimmed:c,oldNewIndexMap:f,childrenByGroup:a}}function po(t){return t&&t[ro]}function bo(t){return typeof(t===null||t===void 0?void 0:t[ro])!=="undefined"}function yo(t){return t&&typeof t[so]!=="undefined"}function jo(t,n){const e=t.length;let r=0;for(;r<e;r++){if(t[r]!==n[r]){return r}}return r}function go(t){const n=JSON.parse(t);if(!Array.isArray(n)){return null}return n}function mo(t,n,e){const r=go(e[io]);if(!r){return false}const i=jo(t,r);return n[eo]<i}function wo(t,n,e){var r=-1,i=t.length;if(n<0){n=-n>i?0:i+n}e=e>i?i:e;if(e<0){e+=i}i=n>e?0:e-n>>>0;n>>>=0;var o=Array(i);while(++r<i){o[r]=t[r+n]}return o}function Oo(t,n,e){var r=t==null?0:t.length;if(!r){return[]}if(e&&typeof e!="number"&&ri(t,n,e)){n=0;e=r}else{n=n==null?0:Hr(n);e=e===undefined?r:Hr(e)}return wo(t,n,e)}class xo{get columns(){return wi(this.source)}constructor(t,n){this.dataStore=t;this.source=n;this.unsubscribe=[];this.hasGrouping=false;this.unsubscribe.push(n.onChange("source",(t=>this.checkGrouping(t))));this.checkGrouping(n.get("source"));this.type=n.get("type")}checkGrouping(t){for(let n of t){if(yo(n)){this.hasGrouping=true;return}this.hasGrouping=false}}isReadOnly(t,n){var e;const r=(e=this.columns[n])===null||e===void 0?void 0:e.readonly;if(typeof r==="function"){const e=this.rowDataModel(t,n);return r(e)}return!!r}mergeProperties(t,n,e,r,i){const o=Object.assign({},e);o.class=Object.assign(Object.assign({},typeof o.class==="string"?{[o.class]:true}:o.class),{[a]:true,[l]:this.isReadOnly(t,n)});const s=i===null||i===void 0?void 0:i(r);if(!s){return o}return Co(o,s)}getRowClass(t,n){const e=Oi(this.dataStore,t)||{};return e[n]||""}getCellData(t,n){const e=this.rowDataModel(t,n);return Ki(e.model[e.prop])}getSaveData(t,n,e){const r=this.rowDataModel(t,n);if(typeof e==="undefined"){e=Ki(r.model[r.prop])}return{prop:r.prop,rowIndex:t,colIndex:n,val:e,model:r.model,colType:this.type,type:this.dataStore.get("type")}}getCellEditor(t,n,e){var r;const i=(r=this.columns[n])===null||r===void 0?void 0:r.editor;if(!i){return undefined}if(typeof i==="string"){return e[i]}return i}rowDataModel(t,n){const e=this.columns[n];const r=e===null||e===void 0?void 0:e.prop;const i=Oi(this.dataStore,t)||{};const o=i[r];const s=this.dataStore.get("type");return{prop:r,model:i,data:this.dataStore.get("source"),column:e,rowIndex:t,colIndex:n,colType:this.type,type:s,value:o}}getRangeData(t,n){var e;const r={};const i=t.oldRange.x1-t.oldRange.x+1;const o=t.oldRange.y1-t.oldRange.y+1;const s={};for(let u=t.newRange.y,c=0;u<t.newRange.y1+1;u++,c++){const f=t.oldRange.y+c%o;const a=Oi(this.dataStore,f)||{};for(let o=t.newRange.x,c=0;o<t.newRange.x1+1;o++,c++){if(u>=t.oldRange.y&&u<=t.oldRange.y1&&o>=t.oldRange.x&&o<=t.oldRange.x1){continue}if(!this.columns[o]){continue}const l=(e=this.columns[o])===null||e===void 0?void 0:e.prop;const h=t.oldRange.x+c%i;const v=n[h].prop;if(!this.isReadOnly(u,o)){if(!r[u]){r[u]={}}r[u][l]=a[v];if(!s[u]){s[u]={}}s[u][l]={colIndex:h,colProp:v,rowIndex:f}}}}return{changed:r,mapping:s}}getTransformedDataToApply(t,n){const e={};const r=n.length;const i=this.columns.length;const o=this.dataStore.get("items").length;let s=t.y;let u=0;for(let c=0;s<o&&c<r;s++,c++){const o=n[c%r];const f=(o===null||o===void 0?void 0:o.length)||0;let a=t.x;for(let t=0;a<i&&t<f;a++,t++){const n=this.columns[a].prop;const r=t%i;if(!this.isReadOnly(s,a)){if(!e[s]){e[s]={}}e[s][n]=o[r]}}u=Math.max(u,a-1)}const c=Ji(t,{y:s-1,x:u});return{changed:e,range:c}}getRangeStaticData(t,n){const e={};for(let r=t.y,i=0;r<t.y1+1;r++,i++){for(let i=t.x,o=0;i<t.x1+1;i++,o++){if(!this.columns[i]){continue}const t=this.columns[i].prop;if(!this.isReadOnly(r,i)){if(!e[r]){e[r]={}}e[r][t]=n}}}return e}getRangeTransformedToProps(t,n){var e;const r=[];const i=this.dataStore.get("type");for(let o=t.y,s=0;o<t.y1+1;o++,s++){for(let s=t.x,u=0;s<t.x1+1;s++,u++){const t=(e=this.columns[s])===null||e===void 0?void 0:e.prop;r.push({prop:t,rowIndex:o,colIndex:s,model:Oi(n,o),type:i,colType:this.type})}}return r}copyRangeArray(t,n){const e=[...this.columns];const r=Oo(e,t.x,t.x1+1).map((t=>t.prop));const i=[];const o={};for(let e=t.y;e<=t.y1;e++){const t=[];o[e]={};for(let i of r){const r=Oi(n,e);if(!r){continue}const s=r[i];t.push(s);o[e][i]=s}i.push(t)}return{data:i,mapping:o}}destroy(){this.unsubscribe.forEach((t=>t()))}}function Ao(t,n){if(typeof t==="function"){return t(n)}return!!t}function _o(t={},n={}){if(typeof t==="string"){t={[t]:true}}if(typeof n==="string"){n={[n]:true}}return Object.assign(Object.assign({},t),n)}function Co(t,n){if(n.className){n.class=_o(n.class,n.className);delete n.className}let e=Object.assign(Object.assign({},n),t);if(n.class){e.class=_o(e.class,n.class)}if(n.style){e.style=Object.assign(Object.assign({},n.style),e.style)}return e}export{xo as $,Fi as A,rn as B,ki as C,gi as D,Hr as E,ri as F,bo as G,po as H,Co as I,uo as J,go as K,mo as L,eo as M,io as N,lo as O,oo as P,so as Q,ao as R,Ni as S,vo as T,yo as U,Lr as V,Re as W,tr as X,Ce as Y,Gi as Z,Ui as _,wi as a,Zr as a0,fo as a1,ro as a2,Ao as a3,Q as a4,Kr as a5,Oi as b,xi as c,_i as d,Ci as e,Ri as f,mi as g,yi as h,Vi as i,Li as j,Ji as k,zi as l,ji as m,Wi as n,Ki as o,d as p,Xi as q,Yi as r,Ai as s,bi as t,qi as u,Hi as v,Qi as w,Zi as x,no as y,pi as z};
|
|
5
|
-
//# sourceMappingURL=column.service-aa142672.js.map
|