1import{r as f,h as c,H as S,c as l,p as O,f as F,N as L,O as v,P as H,Q as T,U as W,W as m,X as A,Y as u,V as B,D as P,Z as V,_ as D,$ as N,a0 as $,o as b,t as K,a1 as U,l as X,a2 as Y,R as G,a3 as _}from"./FieldsView-CYLq4VuU.js";import{v as Z,g as C}from"./events-BvSmBueA-k9NlCA2M.js";import{i as z,a as j,b as Q,c as q,d as J,e as ee,f as te,g as ie,h as se}from"./edit.utils-Dnnbd0xG-BGu4dvTZ.js";import{H as oe}from"./viewport.helpers-CoCAvmZs-BklLoqZc.js";import{L as ne,a as re,g as le,t as ae}from"./throttle-CaUDyxyU-CVbHz2LF.js";import"./index-DBAIXX39.js";import"./PumpCurveEditor-Cr5Ivi2g.js";import"./VDialog-BVJy90fW.js";import"./index-CvneU2GP.js";import"./VOverlay-BxLjFlP9.js";import"./VTextarea-DSPwrNKO.js";import"./VTextField-DZnb8Qtf.js";import"./index-Daolnky5.js";import"./VSelect-BTvj6afo.js";import"./VMenu-BaeoiIwK.js";import"./VSwitch-CFBcCL5H.js";import"./VProgressCircular-BkqYBa4z.js";/*! 2 * Built by Revolist OU â¤ï¸ 3 */const $e=class{constructor(t){f(this,t)}render(){return c(S,{key:"3d66475a019010c24b6c610ccc047e01c35178f9"},c("a",{key:"777afddffef0309a697b9c14ee73c0001ac22b71",href:"https://rv-grid.com/guide/attribution",target:"_blank",rel:"noopener noreferrer",title:"Made with â¤ï¸ by Revolist OU Team",class:"value"},"RevoGrid"))}},Ke=class{constructor(t){f(this,t),this.nodes=[],this.update=1}async refresh(){this.update*=-1}render(){var t;return(t=this.nodes)===null||t===void 0?void 0:t.map(e=>{if(typeof e=="function"){const i={},s=()=>[e({refresh:()=>{var o;return(o=i.refresh)===null||o===void 0?void 0:o.call(i)}})];return c("revogr-extra",{nodes:s(),ref:o=>{o&&(i.refresh=()=>{o.nodes=s()})}})}return e})}};function M(t,e){const i={};for(let s in t){const o=parseInt(s,10);i[o]=O(e,o)}return i}function k(t,e){if(t.defaultPrevented)return null;const i=C(t,"clientX"),s=C(t,"clientY");if(i===null||s===null)return null;const o=E({x:i,y:s},e);return w(o,e.lastCell)?null:o}function E({x:t,y:e},{el:i,rows:s,cols:o}){const{top:n,left:r,height:a,width:h}=i.getBoundingClientRect();let d=e-n,g=t-r;d>=a&&(d=a-1),g>=h&&(g=h-1);const p=_(s,d+(s.renderOffset||0)),R=_(o,g+(o.renderOffset||0));return R.itemIndex<0&&(R.itemIndex=0),p.itemIndex<0&&(p.itemIndex=0),{x:R.itemIndex,y:p.itemIndex}}function ce(t,e,i,s=!1){const o=(n,r=0)=>{const a={x:t.x,y:t.y},h=s?{x:t.x1,y:t.y1}:a,d=h[n]>e[n]?h:a;return d[n]+=r,{start:a,end:h}};return i.x?o("x",i.x):i.y?o("y",i.y):null}function w({x:t,y:e},i){return t>=i.x||e>=i.y}function I({x:t,y:e}){return t<0||e<0}function x(t){return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function y({x:t,y:e,x1:i,y1:s},o,n){const r=o.renderOffset||0,a=n.renderOffset||0,h=b(o,e).start-r,d=b(n,t).start-a,g=b(o,s).end-r,p=b(n,i).end-a;return{left:d,right:p,top:h,bottom:g,width:p-d,height:g-h}}const he=()=>"revogr-focus.focused-cell{box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset;position:absolute;pointer-events:none;z-index:9;display:block !important}",de=class{constructor(e){f(this,e),this.beforeFocusRender=l(this,"beforefocusrender",7),this.beforeScrollIntoView=l(this,"beforescrollintoview",7),this.afterFocus=l(this,"afterfocus",7),this.focusTemplate=null,this.activeFocus=null}componentDidRender(){var e,i;const s=this.selectionStore.get("focus");if(!(((e=this.activeFocus)===null||e===void 0?void 0:e.x)===(s==null?void 0:s.x)&&((i=this.activeFocus)===null||i===void 0?void 0:i.y)===(s==null?void 0:s.y))&&(this.activeFocus=s,s&&this.el)){this.beforeScrollIntoView.emit({el:this.el}).defaultPrevented||this.el.scrollIntoView({block:"nearest",inline:"nearest"});const n=O(this.dataStore,s.y),r=O(this.colData,s.x);this.afterFocus.emit({model:n,column:r,rowType:this.rowType,colType:this.colType,rowIndex:s.y,colIndex:s.x})}}render(){var e;if(this.selectionStore.get("edit"))return;const s=this.selectionStore.get("focus");if(!s)return;const o=this.beforeFocusRender.emit({range:Object.assign(Object.assign({},s),{x1:s.x,y1:s.y}),rowType:this.rowType,colType:this.colType,rowDimension:Object.assign({},this.dimensionRow.state),colDimension:Object.assign({},this.dimensionCol.state)});if(o.defaultPrevented)return c("slot",null);const{detail:n}=o,r=y(n.range,o.detail.rowDimension,o.detail.colDimension),a=x(r),h=(e=this.focusTemplate)===null||e===void 0?void 0:e.call(this,c,n),d={class:{[$]:!0},style:a};return c(S,Object.assign({},d),c("slot",null),h)}get el(){return F(this)}};de.style=he();const ue=[u.TAB,u.ARROW_UP,u.ARROW_DOWN,u.ARROW_LEFT,u.ARROW_RIGHT];class ge{constructor(e){this.sv=e}appendPendingEditValue(e){if(j(e)||e.key.length!==1||e.target instanceof HTMLElement&&z(e.target))return!1;const i=this.sv.selectionStore.get("edit");return typeof(i==null?void 0:i.val)!="string"?!1:(this.sv.selectionStore.set("edit",Object.assign(Object.assign({},i),{val:`${i.val}${e.key}`})),!0)}async keyDown(e,i,s,{range:o,focus:n}){if(s){if(this.appendPendingEditValue(e))return;switch(e.code){case u.ESCAPE:this.sv.cancel();break;case u.TAB:this.keyChangeSelection(e,i);break}return}if(o&&Q(e.code)){this.sv.clearCell();return}if(n){if(q(e.code)){this.keyChangeSelection(e,i);return}if(J(e.key)){this.sv.change();return}if(!ee(e)&&!te(e)){if(ie(e)){this.sv.internalPaste();return}if(se(e)){i&&this.selectAll(e);return}if(!j(e)&&e.key.length===1){this.sv.change(e.key);return}await this.keyChangeSelection(e,i)}}}selectAll(e){const i=this.sv.selectionStore.get("range"),s=this.sv.selectionStore.get("focus");!i||!s||(e.preventDefault(),this.sv.selectAll())}async keyChangeSelection(e,i){const s=this.changeDirectionKey(e,i);if(!s)return!1;await K(G+30);const o=this.sv.selectionStore.get("range"),n=this.sv.selectionStore.get("focus");return this.keyPositionChange(s.changes,o,n,s.isMulti)}keyPositionChange(e,i,s,o=!1){if(!i||!s)return!1;const n=ce(i,s,e,o);if(!n)return!1;const r=this.sv.getData();if(o){if([n.start,n.end].some(d=>
3w(d,r.lastCell)||I(d)))return!1;const h=m(n.start,n.end);return this.sv.range(h)}return this.sv.focus(n.start,e,w(n.start,r.lastCell)?1:I(n.start)?-1:0)}changeDirectionKey(e,i){const s=i&&e.shiftKey;if(ue.includes(e.code)&&e.preventDefault(),e.shiftKey)switch(e.code){case u.TAB:return{changes:{x:-1},isMulti:!1}}switch(e.code){case u.ARROW_UP:return{changes:{y:-1},isMulti:s};case u.ARROW_DOWN:return{changes:{y:1},isMulti:s};case u.ARROW_LEFT:return{changes:{x:-1},isMulti:s};case u.TAB:case u.ARROW_RIGHT:return{changes:{x:1},isMulti:s}}}}class fe{constructor(e){this.sv=e,this.autoFillType=null,this.autoFillInitial=null,this.autoFillStart=null,this.autoFillLast=null}renderAutofill(e,i,s=!1){let o;return e?o=y(e,this.sv.dimensionRow.state,this.sv.dimensionCol.state):o=y(Object.assign(Object.assign({},i),{x1:i.x,y1:i.y}),this.sv.dimensionRow.state,this.sv.dimensionCol.state),c("div",{class:{[U]:!0,[v]:s},style:{left:`${o.right}px`,top:`${o.bottom}px`},onMouseDown:n=>this.autoFillHandler(n),onTouchStart:n=>this.autoFillHandler(n)})}autoFillHandler(e,i="AutoFill"){let s=null;e.target instanceof Element&&(s=e.target),s&&(this.selectionStart(s,this.sv.getData(),i),e.preventDefault())}get isAutoFill(){return!!this.autoFillType}selectionMouseMove(e){this.onMouseMoveAutofill||(this.onMouseMoveAutofill=X((i,s)=>this.doAutofillMouseMove(i,s),5)),this.isAutoFill&&this.onMouseMoveAutofill(e,this.sv.getData())}getFocus(e,i){return!e&&i&&(e={x:i.x,y:i.y}),e||null}doAutofillMouseMove(e,i){if(!this.autoFillInitial)return;const s=C(e,"clientX",v),o=C(e,"clientY",v);if(s===null||o===null)return;const n=E({x:s,y:o},i);if(this.autoFillLast||this.autoFillLast||(this.autoFillLast=this.autoFillStart),w(n,i.lastCell))return;if(this.autoFillLast=n,n.x===this.autoFillInitial.x&&n.y===this.autoFillInitial.y)this.sv.setTempRange(null);else{const a=m(this.autoFillInitial,this.autoFillLast);this.sv.setTempRange({area:a,type:this.autoFillType})}}selectionStart(e,i,s="Selection"){const{top:o,left:n}=e.getBoundingClientRect();this.autoFillInitial=this.getFocus(i.focus,i.range),this.autoFillType=s,this.autoFillStart=E({x:n,y:o},i)}clearAutoFillSelection(e,i){if(this.autoFillInitial)if(this.autoFillInitial=this.getFocus(e,i),this.autoFillType==="AutoFill"){const s=m(this.autoFillInitial,this.autoFillLast);if(s){const{defaultPrevented:o,detail:{range:n}}=this.sv.clearRangeDataApply({range:s});!o&&i?this.applyRangeWithData(n,i):this.sv.setTempRange(null)}}else this.applyRangeOnly(this.autoFillInitial,this.autoFillLast);this.resetAutoFillState()}resetAutoFillState(){this.autoFillType=null,this.autoFillInitial=null,this.autoFillLast=null,this.autoFillStart=null}onRangeApply(e,i,s){this.sv.rangeDataApply({data:e,models:M(e,this.sv.dataStore),type:this.sv.dataStore.get("type"),oldRange:s,newRange:i}),this.sv.setRange(i)}applyRangeWithData(e,i){const s={type:this.sv.dataStore.get("type"),colType:this.sv.columnService.type,newData:{},mapping:{},newRange:e,oldRange:i},{mapping:o,changed:n}=this.sv.columnService.getRangeData(s,this.sv.columnService.columns);s.newData=n,s.mapping=o;let r=this.sv.selectionChanged(s);if(r.defaultPrevented){this.sv.setTempRange(null);return}if(r=this.sv.rangeCopy(s),r.defaultPrevented){this.sv.setRange(e);return}this.onRangeApply(s.newData,e,i)}applyRangeOnly(e,i){if(!e||!i)return;const s=m(e,i);this.sv.setRange(s)}}function pe(t,e){var i;if(!ve(e))return null;const s=me(t);return s.length===1&&((i=s[0])===null||i===void 0?void 0:i.length)===1?s:null}function ve(t){return typeof t=="object"&&t.rangeFill===!0}function me(t){const e=[...t];for(;e.length>1&&ye(e[e.length-1]);)e.pop();return e}function ye(t){return!t||t.every(e=>e==="")}const Se=()=>'revogr-overlay-selection{display:block;position:relative;width:100%}revogr-overlay-selection .autofill-handle{position:absolute;width:14px;height:14px;margin-left:-13px;margin-top:-13px;z-index:10;cursor:crosshair}revogr-overlay-selection .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection.mobile .autofill-handle{position:absolute;width:30px;height:30px;margin-left:-29px;margin-top:-29px;z-index:10;cursor:crosshair}revogr-overlay-selection.mobile .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:12px;height:12px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection .selection-border-range{position:absolute;pointer-events:none;z-index:9;box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset}revogr-overlay-selection .selection-border-range .range-handlers{height:100%;background-color:transparent;width:75%;max-width:50px;min-width:20px;left:50%;transform:translateX(-50%);position:absolute}revogr-overlay-selection .selection-border-range .range-handlers>span{pointer-events:auto;height:20px;width:20px;position:absolute;
3left:50%;transform:translateX(-50%)}revogr-overlay-selection .selection-border-range .range-handlers>span:before,revogr-overlay-selection .selection-border-range .range-handlers>span:after{position:absolute;border-radius:5px;width:15px;height:5px;left:50%;transform:translateX(-50%);background-color:rgba(0, 0, 0, 0.2)}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child{top:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child:before{content:"";top:0}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child{bottom:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child:after{content:"";bottom:0}revogr-overlay-selection revogr-edit{z-index:10}',be=class{constructor(t){f(this,t),this.beforeCopyRegion=l(this,"beforecopyregion",7),this.beforeRegionPaste=l(this,"beforepasteregion",7),this.cellEditApply=l(this,"celleditapply",7),this.beforeFocusCell=l(this,"beforecellfocusinit",7),this.beforeNextViewportFocus=l(this,"beforenextvpfocus",7),this.setEdit=l(this,"setedit",7),this.beforeApplyRange=l(this,"beforeapplyrange",7),this.beforeSetRange=l(this,"beforesetrange",7),this.setRange=l(this,"setrange",7),this.beforeEditRender=l(this,"beforeeditrender",7),this.selectAll=l(this,"selectall",7),this.cancelEdit=l(this,"canceledit",7),this.setTempRange=l(this,"settemprange",7),this.beforeSetTempRange=l(this,"beforesettemprange",7),this.applyFocus=l(this,"applyfocus",7),this.focusCell=l(this,"focuscell",7),this.beforeRangeDataApply=l(this,"beforerangedataapply",7),this.selectionChange=l(this,"selectionchangeinit",7),this.beforeRangeCopyApply=l(this,"beforerangecopyapply",7),this.rangeEditApply=l(this,"rangeeditapply",7),this.rangeClipboardCopy=l(this,"clipboardrangecopy",7),this.rangeClipboardPaste=l(this,"clipboardrangepaste",7),this.beforeKeyDown=l(this,"beforekeydown",7),this.beforeKeyUp=l(this,"beforekeyup",7),this.beforeCellSave=l(this,"beforecellsave",7),this.cellEditDone=l(this,"celledit",7),this.applyChangesOnClose=!1,this.keyboardService=null,this.autoFillService=null,this.unsubscribeSelectionStore=[]}onMouseMove(t){var e;this.selectionStore.get("focus")&&((e=this.autoFillService)===null||e===void 0||e.selectionMouseMove(t))}onMouseUp(){var t;(t=this.autoFillService)===null||t===void 0||t.clearAutoFillSelection(this.selectionStore.get("focus"),this.selectionStore.get("range"))}onCellDrag(t){var e;(e=this.orderEditor)===null||e===void 0||e.dragStart(t.detail)}onKeyUp(t){this.beforeKeyUp.emit(Object.assign({original:t},this.getData()))}onKeyDown(t){var e;const i=this.beforeKeyDown.emit(Object.assign({original:t},this.getData()));t.defaultPrevented||i.defaultPrevented||(e=this.keyboardService)===null||e===void 0||e.keyDown(t,this.range,!!this.selectionStore.get("edit"),{focus:this.selectionStore.get("focus"),range:this.selectionStore.get("range")})}selectionServiceSet(t){this.unsubscribeSelectionStore.forEach(e=>e()),this.unsubscribeSelectionStore.length=0,this.unsubscribeSelectionStore.push(t.onChange("nextFocus",e=>e&&this.doFocus(e,e))),this.keyboardService=new ge({selectionStore:t,range:e=>!!e&&this.triggerRangeEvent(e),focus:(e,i,s)=>s?(this.beforeNextViewportFocus.emit(e),!1):this.doFocus(e,e,i),change:e=>{this.readonly||this.doEdit(e)},cancel:async()=>{var e;await((e=this.revogrEdit)===null||e===void 0?void 0:e.cancelChanges()),this.closeEdit()},clearCell:()=>!this.readonly&&this.clearCell(),internalPaste:()=>!this.readonly&&this.beforeRegionPaste.emit(),getData:()=>this.getData(),selectAll:()=>this.selectAll.emit()}),this.createAutoFillService()}createAutoFillService(){this.autoFillService=new fe({dimensionRow:this.dimensionRow,dimensionCol:this.dimensionCol,columnService:this.columnService,dataStore:this.dataStore,clearRangeDataApply:t=>this.beforeRangeDataApply.emit(Object.assign(Object.assign(Object.assign({},t),this.types),{rowDimension:Object.assign({},this.dimensionRow.state),colDimension:Object.assign({},this.dimensionCol.state)})),setTempRange:t=>{const e=this.beforeSetTempRange.emit(Object.assign(Object.assign({tempRange:t},this.getData()),this.types));return e.defaultPrevented?null:this.setTempRange.emit(e.detail.tempRange)},selectionChanged:t=>this.selectionChange.emit(t),rangeCopy:t=>this.beforeRangeCopyApply.emit(t),rangeDataApply:t=>this.rangeEditApply.emit(t),setRange:t=>!!t&&this.triggerRangeEvent(t),getData:()=>this.getData()})}columnServiceSet(){var t;(t=this.columnService)===null||t===void 0||t.destroy(),this.columnService=new L(this.dataStore,this.colData),this.createAutoFillService()}connectedCallback(){this.columnServiceSet(),this.selectionServiceSet(this.selectionStore)}disconnectedCallback(){var t;
3this.unsubscribeSelectionStore.forEach(e=>e()),this.unsubscribeSelectionStore.length=0,(t=this.columnService)===null||t===void 0||t.destroy()}async componentWillRender(){var t,e;this.selectionStore.get("edit")||await((e=(t=this.revogrEdit)===null||t===void 0?void 0:t.beforeDisconnect)===null||e===void 0?void 0:e.call(t))}renderRange(t){const e=y(t,this.dimensionRow.state,this.dimensionCol.state),i=x(e);return[c("div",{class:H,style:i},this.isMobileDevice&&c("div",{class:"range-handlers"},c("span",{class:v}),c("span",{class:v})))]}renderEditor(){const t=this.selectionStore.get("edit");if(this.readonly||!t)return null;const e=t.val||T(this.columnService.rowDataModel(t.y,t.x).value),i=Object.assign(Object.assign({},t),this.columnService.getSaveData(t.y,t.x,e)),s=this.beforeEditRender.emit(Object.assign(Object.assign({range:Object.assign(Object.assign({},t),{x1:t.x,y1:t.y})},this.types),{rowDimension:Object.assign({},this.dimensionRow.state),colDimension:Object.assign({},this.dimensionCol.state)}));if(s.defaultPrevented)return null;const o=y(s.detail.range,s.detail.rowDimension,s.detail.colDimension),n=x(o);return c("revogr-edit",{style:n,ref:r=>this.revogrEdit=r,additionalData:this.additionalData,editCell:i,saveOnClose:this.applyChangesOnClose,onCelleditinit:r=>{this.cellEditDone.emit(r.detail)},column:this.columnService.rowDataModel(t.y,t.x),editor:W(this.columnService.columns[t.x],this.editors)})}onEditCell(t){if(t.defaultPrevented)return;const e=this.beforeCellSave.emit(t.detail);e.defaultPrevented||this.cellEdit(e.detail),e.detail.preventFocus||this.focusNext()}render(){var t;const e=[],i=this.renderEditor();if(i)e.push(i);else{const s=this.selectionStore.get("range"),o=this.selectionStore.get("focus");(s||o)&&this.useClipboard&&e.push(c("revogr-clipboard",{readonly:this.readonly,onCopyregion:n=>this.onCopy(n.detail),onClearregion:()=>!this.readonly&&this.clearCell(),ref:n=>this.clipboard=n,onPasteregion:n=>this.onPaste(n.detail)})),s&&e.push(...this.renderRange(s)),o&&!this.readonly&&this.range&&e.push((t=this.autoFillService)===null||t===void 0?void 0:t.renderAutofill(s,o,this.isMobileDevice)),this.canDrag&&e.push(c("revogr-order-editor",{ref:n=>this.orderEditor=n,dataStore:this.dataStore,dimensionRow:this.dimensionRow,dimensionCol:this.dimensionCol,parent:this.element,rowType:this.types.rowType,onRowdragstartinit:n=>this.rowDragStart(n)}))}return c(S,{key:"ff303c39d59e4ef217421fa11b9a80de07311b07",class:{mobile:this.isMobileDevice},onDblClick:s=>this.onElementDblClick(s),onMouseDown:s=>this.onElementMouseDown(s),onTouchStart:s=>this.onElementMouseDown(s,!0),onCloseedit:s=>this.closeEdit(s),onCelledit:s=>this.onEditCell(s)},e,c("slot",{key:"3cbe4c3ad7d447f779e9e20f73eec2e3107275e0",name:"data"}))}doFocus(t,e,i){const{defaultPrevented:s}=this.beforeFocusCell.emit(this.columnService.getSaveData(t.y,t.x));if(s)return!1;const o=Object.assign(Object.assign({range:Object.assign(Object.assign({},t),{x1:e.x,y1:e.y}),next:i},this.types),{rowDimension:Object.assign({},this.dimensionRow.state),colDimension:Object.assign({},this.dimensionCol.state)}),n=this.applyFocus.emit(o);if(n.defaultPrevented)return!1;const{range:r}=n.detail;return!this.focusCell.emit(Object.assign({focus:{x:r.x,y:r.y},end:{x:r.x1,y:r.y1}},n.detail)).defaultPrevented}triggerRangeEvent(t){const e=this.types.rowType,i=this.beforeApplyRange.emit(Object.assign(Object.assign({range:Object.assign({},t)},this.types),{rowDimension:Object.assign({},this.dimensionRow.state),colDimension:Object.assign({},this.dimensionCol.state)}));if(i.defaultPrevented)return!1;const s=this.columnService.getRangeTransformedToProps(i.detail.range,this.dataStore);let o=this.beforeSetRange.emit(s);return o.defaultPrevented||(o=this.setRange.emit(Object.assign(Object.assign({},i.detail.range),{type:e})),o.defaultPrevented)?!1:!o.defaultPrevented}onElementDblClick(t){if(t.defaultPrevented)return;const e=this.getData();k(t,e)&&this.doEdit()}onElementMouseDown(t,e=!1){var i;const s=t.target;if(z(s)||t.defaultPrevented)return;const o=this.getData(),n=k(t,o);n&&(this.focus(n,this.range&&t.shiftKey),this.range&&(s&&((i=this.autoFillService)===null||i===void 0||i.selectionStart(s,this.getData())),e?Z(t.touches[0],v)&&t.preventDefault():t.preventDefault()))}doEdit(t=""){var e;if(this.canEdit()){const i=this.selectionStore.get("focus");if(!i)return;const s=this.columnService.getSaveData(i.y,i.x);(e=this.setEdit)===null||e===void 0||e.emit(Object.assign(Object.assign({},s),{val:t}))}}async closeEdit(t){this.cancelEdit.emit(),t!=null&&t.detail&&await this.focusNext()}cellEdit(t){const e=this.columnService.getSaveData(t.rgRow,t.rgCol,t.val);this.cellEditApply.emit(e)}getRegion(){const t=this.selectionStore.get("focus");let e=this.selectionStore.get("range");return e||(e=m(t,t)),e}onCopy(t){var e;const i=this.getRegion();if(this.beforeCopyRegion.emit(i).defaultPrevented)return!1;let o;if(i){const{data:n,mapping:r}=this.columnService.copyRangeArray(i,this.dataStore),a=this.rangeClipboardCopy.emit(Object.assign({range:i,data:n,mapping:r},this.types));a.defaultPrevented||(o=a.detail.data)}return(e=this.clipboard)===null||e===void 0||e.doCopy(t,o),!0}
3onPaste(t){var e;const i=this.selectionStore.get("focus"),s=this.selectionStore.get("edit")!==null;if(!i||s)return;const o=pe(t,this.useClipboard),n=o?this.getClipboardPasteTargetRange():null;let{changed:r,range:a}=this.columnService.getTransformedDataToApply({start:i,data:o||t,targetRange:n});const{defaultPrevented:h}=this.rangeClipboardPaste.emit(Object.assign({data:r,models:M(r,this.dataStore),range:a},this.types));h||(e=this.autoFillService)===null||e===void 0||e.onRangeApply(r,a,a)}getClipboardPasteTargetRange(){const t=this.selectionStore.get("range");return t&&!A(t)?t:null}async focusNext(){var t;await((t=this.keyboardService)===null||t===void 0?void 0:t.keyChangeSelection(new KeyboardEvent("keydown",{code:u.ARROW_DOWN}),this.range))||this.closeEdit()}clearCell(){var t;const e=this.selectionStore.get("range");if(e&&!A(e)){const i=this.columnService.getRangeStaticData(e,"");(t=this.autoFillService)===null||t===void 0||t.onRangeApply(i,e,e)}else if(this.canEdit()){const i=this.selectionStore.get("focus");if(!i)return;const s=this.columnService.getSaveData(i.y,i.x);this.cellEdit({rgRow:i.y,rgCol:i.x,val:"",type:s.type,prop:s.prop})}}rowDragStart({detail:t}){t.text=T(this.columnService.rowDataModel(t.cell.y,t.cell.x).value)}canEdit(){var t;if(this.readonly)return!1;const e=this.selectionStore.get("focus");return e&&!(!((t=this.columnService)===null||t===void 0)&&t.isReadOnly(e.y,e.x))}get edited(){return this.selectionStore.get("edit")}focus(t,e=!1){if(!t)return!1;const i=t,s=this.selectionStore.get("focus");if(e&&s){const o=m(s,i);if(o)return this.triggerRangeEvent(o)}return this.doFocus(t,i)}get types(){return{rowType:this.dataStore.get("type"),colType:this.columnService.type}}getData(){return{el:this.element,rows:this.dimensionRow.state,cols:this.dimensionCol.state,lastCell:this.lastCell,focus:this.selectionStore.get("focus"),range:this.selectionStore.get("range"),edit:this.selectionStore.get("edit")}}get element(){return F(this)}static get watchers(){return{selectionStore:[{selectionServiceSet:0}],dimensionRow:[{createAutoFillService:0}],dimensionCol:[{createAutoFillService:0}],dataStore:[{columnServiceSet:0}],colData:[{columnServiceSet:0}]}}};be.style=Se();const Ce=t=>(e,{rowIndex:i})=>t+i,Xe=class{constructor(t){f(this,t),this.scrollViewport=l(this,"scrollview",3),this.elementToScroll=l(this,"ref",3),this.jobsBeforeRender=[]}render(){const t=[],e=new B("colPinStart");let i=1;for(let r of this.dataPorts){const a=r.dataStore.get("items").length,h=new P(r.type,Object.assign({},r.dataStore.state)),d=new P("colPinStart"),g=Object.assign({cellTemplate:Ce(i)},this.rowHeaderColumn);d.updateData([g]),t.push(c("revogr-data",Object.assign({},r,{colType:"rowHeaders",jobsBeforeRender:this.jobsBeforeRender,rowClass:this.rowClass,dataStore:h.store,colData:d.store,viewportCol:e.store,readonly:!0,range:!1}))),i+=a}const s=V(i,this.rowHeaderColumn);e.setViewport({realCount:1,virtualSize:0,items:[{size:s,start:0,end:s,itemIndex:0}]});const o={contentHeight:this.height,contentWidth:0,style:{minWidth:`${s}px`},colType:"rowHeaders",ref:r=>this.elementToScroll.emit(r),onScrollviewport:r=>this.scrollViewport.emit(r.detail)},n=Object.assign(Object.assign({},this.headerProp),{groups:[],colData:typeof this.rowHeaderColumn=="object"?[this.rowHeaderColumn]:[],viewportCol:e.store,canResize:!1,type:D,slot:oe});return c(S,{class:{[D]:!0},key:D},c("revogr-viewport-scroll",Object.assign({key:"c401e82e02e4bdb7afb25f2f49c6776f2e115c81"},o,{"row-header":!0}),c("revogr-header",Object.assign({key:"3c73d27bd96e23a34fc0cf47eda4d2e65751df98"},n)),t))}};class we{constructor(e){this.element=e,this.autohideScrollTimeout=0}setScrollSize(e){e?this.element.removeAttribute("autohide"):this.element.setAttribute("autohide","true")}checkScroll({scrollSize:e,contentSize:i,virtualSize:s}){const o=i>s;!e&&o&&(this.element.setAttribute("visible","true"),this.autohideScrollTimeout=this.show(this.element,this.autohideScrollTimeout))}show(e,i){return clearTimeout(i),Number(setTimeout(()=>{e==null||e.removeAttribute("visible")},1e3))}clear(){clearTimeout(this.autohideScrollTimeout)}}const xe=()=>"revogr-scroll-virtual[autohide]{position:absolute;z-index:100 !important}revogr-scroll-virtual[autohide].vertical{top:0;right:0}revogr-scroll-virtual[autohide].vertical[visible]{min-width:20px !important}revogr-scroll-virtual[autohide].horizontal{bottom:0;left:0}revogr-scroll-virtual[autohide].horizontal[visible]{min-height:20px !important}revogr-scroll-virtual.vertical{overflow-y:auto;overflow-x:hidden;height:100%}revogr-scroll-virtual.vertical>div{width:1px}revogr-scroll-virtual.horizontal{overflow-x:auto;overflow-y:hidden;width:100%}revogr-scroll-virtual.horizontal>div{height:1px}",Re=class{constructor(t){f(this,t),this.scrollVirtual=l(this,"scrollvirtual",7),this.dimension="rgRow",this.scrollSize=0}async setScroll(t){var e;this.dimension===t.dimension&&(this.localScrollTimer.latestScrollUpdate(t.dimension),(e=this.localScrollService)===null||e===void 0||e.setScroll(t),t.co
3ordinate&&this.autohideScrollPlugin.checkScroll({scrollSize:this.scrollSize,contentSize:this.realSize,virtualSize:this.virtualSize}))}async changeScroll(t){if(t.delta){const e=t.dimension==="rgRow"?"scrollTop":"scrollLeft",i=this.element[e];return this.localScrollService.setScrollByDelta(t,i)}return t}connectedCallback(){this.autohideScrollPlugin=new we(this.element),this.localScrollTimer=new ne("ontouchstart"in document.documentElement?0:10),this.localScrollService=new re({runScroll:t=>this.scrollVirtual.emit(t),applyScroll:t=>{this.localScrollTimer.setCoordinate(t);const e=t.dimension==="rgRow"?"scrollTop":"scrollLeft";this.element[e]=t.coordinate}})}disconnectedCallback(){this.autohideScrollPlugin.clear()}componentWillLoad(){this.scrollSize=N(document)}componentDidRender(){let t=0;this.dimension==="rgRow"?(t=this.element.scrollHeight>this.element.clientHeight?this.scrollSize:0,this.element.style.minWidth=`${t}px`):(t=this.element.scrollWidth>this.element.clientWidth?this.scrollSize:0,this.element.style.minHeight=`${t}px`),this.autohideScrollPlugin.setScrollSize(t),this.localScrollService.setParams({contentSize:this.realSize,clientSize:this.dimension==="rgRow"?this.element.clientHeight:this.element.clientWidth,virtualSize:this.clientSize},this.dimension)}onScroll(t){if(!(t.target instanceof Element))return;const e=t.target;let i="scrollLeft";this.dimension==="rgRow"&&(i="scrollTop");const s=()=>{var o;(o=this.localScrollService)===null||o===void 0||o.scroll(e[i]||0,this.dimension)};this.localScrollTimer.isReady(this.dimension,e[i])?s():this.localScrollTimer.throttleLastScrollUpdate(this.dimension,e[i]||0,()=>s())}render(){const t=le(this.realSize,this.dimension==="rgRow"?this.element.clientHeight:this.element.clientWidth,this.clientSize);return c(S,{key:"7213817ef941eee4050b714266598ec0c2961ee9",onScroll:e=>this.onScroll(e)},c("div",{key:"501da49c63253ab943172494b9dbf5399be56cee",style:{[this.dimension==="rgRow"?"height":"width"]:`${t}px`}}))}get element(){return F(this)}};Re.style=xe();const De=()=>".temp-bg-range{display:block !important;position:absolute;pointer-events:none;z-index:9;border:1px solid rgb(255, 94, 0);box-sizing:border-box}.temp-bg-range.Selection{border:1px dashed gray}.temp-bg-range>div{width:1px;height:1px;position:absolute}.temp-bg-range>div.top{top:-1px}.temp-bg-range>div.bottom{bottom:-1px}.temp-bg-range>div.left{left:-1px}.temp-bg-range>div.right{right:-1px}",Oe=class{constructor(t){f(this,t),this.onChange=ae(e=>this.doChange(e),300)}doChange(t){t==null||t.scrollIntoView({block:"nearest",inline:"nearest"})}componentDidRender(){this.el&&this.onChange(this.el)}render(){const t=this.selectionStore.get("tempRange"),e=this.selectionStore.get("tempRangeType");if(!t)return;let i="bottom",s="right";const o=this.getRange();if(!o)return;t.y<o.y&&(i="top"),t.x<o.x&&(s="left");const n=`${s} ${i}`,r=y(t,this.dimensionRow.state,this.dimensionCol.state),a=x(r),h={class:{[Y]:!0,[e||""]:!0},style:a,hidden:!1};return c(S,Object.assign({},h),c("div",{class:n,ref:d=>this.el=d}))}getRange(){const t=this.selectionStore.get("range");if(t)return t;const e=this.selectionStore.get("focus");return e?Object.assign(Object.assign({},e),{x1:e.x,y1:e.y}):null}};Oe.style=De();export{$e as revogr_attribution,Ke as revogr_extra,de as revogr_focus,be as revogr_overlay_selection,Xe as revogr_row_headers,Re as revogr_scroll_virtual,Oe as revogr_temp_range};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.