New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@grapecity/wijmo.interop.grid

Package Overview
Dependencies
Maintainers
0
Versions
1109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grapecity/wijmo.interop.grid - npm Package Compare versions

Comparing version

to
5.20241.19

4

es2015-commonjs.js
/*!
*
* Wijmo Library 5.20241.9
* Wijmo Library 5.20241.19
* https://developer.mescius.com/wijmo

@@ -14,2 +14,2 @@ *

"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var l in e)Object.hasOwnProperty.call(e,l)&&(t[l]=e[l]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),wjcCore=__importStar(require("@grapecity/wijmo")),wjcGrid=__importStar(require("@grapecity/wijmo.grid")),selfModule=__importStar(require("@grapecity/wijmo.interop.grid"));function softInput(){return wijmo_1._getModule("wijmo.input")}exports.softInput=softInput;function softGridDetail(){return wijmo_1._getModule("wijmo.grid.detail")}exports.softGridDetail=softGridDetail;var GridCellTemplateType,__gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}class DirectiveCellFactoryBase extends wjcGrid.CellFactory{constructor(e){super();this._lastApplyTimeStamp=0;this._noApplyLag=!1;this._startingEditing=!1;this._cellStampCounter=0;this._composing=!1;this._isCheckingHeight=!1;this._backupHeight=-1;this._cacheRow=null;this.grid=e;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var t in GridCellTemplateType)isNaN(t)&&DirectiveCellFactoryBase._templateTypes.push(t)}var l=this;this._baseCf=e.cellFactory;e.cellFactory=this;this._evtInput=document.createEvent("HTMLEvents");this._evtInput.initEvent("input",!0,!1);this._evtBlur=document.createEvent("HTMLEvents");this._evtBlur.initEvent("blur",!1,!1);e.prepareCellForEdit.addHandler((function(e,t){l._noApplyLag=!0}));e.cellEditEnded.addHandler((function(t,i){let r=i.range,o=r.col;(o<0||o<e.columns.length&&!e._getBindingColumn(e.cells,r.row,e.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(l._editChar=null);setTimeout((function(){l._noApplyLag=!1}),300)}));e.beginningEdit.addHandler((function(e,t){l._startingEditing=!0}));e.hostElement.addEventListener("keydown",(function(e){l._startingEditing=!1}),!0);e.hostElement.addEventListener("keypress",(function(t){var i=t.charCode>32?String.fromCharCode(t.charCode):null;if(i&&wjcCore.closest(t.target,".wj-flexgrid")===e.hostElement)if(!e.activeEditor||l._startingEditing){l._editChar=i;setTimeout(()=>{e.activeEditor||(l._editChar=null)},0)}else l._editChar&&(l._editChar+=i)}),!0);e.hostElement.addEventListener("compositionstart",(function(e){l._composing=!0}),!0);e.hostElement.addEventListener("compositionend",(function(e){l._composing=!1}),!0)}updateCell(e,t,l,i,r){this._cellStampCounter=(this._cellStampCounter+1)%1e7;let o=i[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;i.style.overflow&&(i.style.overflow="");let n=t,s=l;if(r&&!r.isSingleCell){t=r.row;l=r.col}let a,d=this,c=e.grid,p=c.editRange,u=e.rows[t],m=u.dataItem,C=!1,h=!1,g=!1,_=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(p&&p.row===t&&p.col===l){a=GridCellTemplateType.CellEdit;h=g=!0}else if(u instanceof wjcGrid.GroupRow){var f=!((_=m instanceof wjcCore.CollectionViewGroup)||u.hasChildren);if(l==e.columns.firstVisibleIndex)a=f?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{a=f?GridCellTemplateType.Cell:GridCellTemplateType.Group;h=!0}}else u instanceof wjcGrid._NewRowTemplate?a=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&u instanceof softGridDetail().DetailRow||(a=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:a=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:a=c.collectionView&&c.collectionView.currentEditItem===m?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;C=!0;break;case wjcGrid.CellType.TopLeft:a=GridCellTemplateType.TopLeft;C=!0;break;case wjcGrid.CellType.ColumnFooter:a=GridCellTemplateType.ColumnFooter;h=!0;break;case wjcGrid.CellType.BottomLeft:a=GridCellTemplateType.BottomLeft;C=!0}const w=!!_&&u.isSummary,y=_&&(c.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||c.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!u.isCollapsed);var T=!1;if(null!=a){let p=null;_&&a==GridCellTemplateType.GroupHeader?p=c.getColumn(m.groupDescription.propertyName):l>=0&&l<e.columns.length&&(p=e.cellType===wjcGrid.CellType.ColumnHeader&&c._hasColumnGroups()?c._getColumnGroup(t,l):c._getBindingColumn(e,t,e.columns[l]));if(p){var E=DirectiveCellFactoryBase.getTemplContextProp,v=E(a),G=(C?c:p)[v];if(!G)if(a===GridCellTemplateType.RowHeaderEdit){v=E(a=GridCellTemplateType.RowHeader);G=c[v]}else if((a===GridCellTemplateType.Group||a===GridCellTemplateType.GroupHeader)&&!_){v=E(a=GridCellTemplateType.Cell);G=p[v]}if(G){var j,F;if(h){j=e.getCellData(t,l,!1);F=e.getCellData(t,l,!0)}{T=!0;let t=i.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),a=t&&"true"===t.toLowerCase();if(g){this.clearCell(i);this._baseCf.updateCell(e,n,s,i,r,!0)}let m,C=g&&c.imeEnabled,h=C&&this._composing,f=i[v],E={cell:i,column:p,row:u,panel:e,rng:r,isEdit:g,isImeInput:C,isTrueImeInput:h,templateContext:G,templateCache:f,templateContextProperty:v,cellStamp:o,cellValue:j,cellValueFormatted:F},I=this.shouldInstantiate(E),D=!0;_&&!w&&l!=e.columns.firstVisibleIndex&&y&&(D=!1);if(I){if(g){var H=i.firstElementChild;if(H){C||i.focus();H.style.display="none"}}else this.clearCell(i);this._doDisposeCell(i);if(D){this.renderTemplate(E,!0);E.templateCache=f=i[v]}else this._doDisposeCell(i);m=E.cellBindingsData}else{D?this.renderTemplate(E,!1):this._doDisposeCell(i);m=E.cellBindingsData}G.cellOverflow&&(i.style.overflow=G.cellOverflow);a?this.applyImmediately(E):G.autoSizeRows&&!C?this.checkHeight(E):g&&setTimeout(()=>{C?this._initImeEditInput(E.cell,G):this._initEditInput(E.cell,G,null)},0);if(g){d._cellEditorVars=m.localVars;var editEndingEH=function(e,t){c.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){let e=wjcCore.getActiveElement();e&&e.dispatchEvent(d._evtBlur);wjcCore.contains(i,wjcCore.getActiveElement())&&i.focus()}d._triggerEditorEvents(i);if(!t.cancel&&!t.stayInEditMode){let e=m.localVars,t=Object.getOwnPropertyNames(m.bindings);for(let l of t)m.bindings[l].setValue(e,m.localVars.values[l])}var l=i.querySelectorAll(".wj-dropdown");[].forEach.call(l,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))};let editEndedEH=function(e,t){c.cellEditEnded.removeHandler(editEndedEH);d._cellEditorVars=null};c.cellEditEnding.addHandler(editEndingEH);c.cellEditEnded.addHandler(editEndedEH)}else this._baseCf.updateCell(e,n,s,i,r,!1)}}}}if(!T){this._doDisposeCell(i);this._baseCf.updateCell(e,n,s,i,r)}}getEditorValue(e){if(this._cellEditorVars){let t=e.editRange;t&&t.isValid&&this._triggerEditorEvents(e.cells.getCellElement(t.row,t.col));return this._cellEditorVars.value}return super.getEditorValue(e)}disposeCell(e){this._doDisposeCell(e)}disposeTemplate(e,t,l){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}}setBindingsData(e,t,l,i,r,o){e.row=t;e.col=l;e.item=i;let n={},s=e.cell||{},a={},d={localVars:s,bindings:a};s.row=t;s.col=l;s.item=i;s.value=r;s.valueFormatted=e.cellValueFormatted;s.values=n;if(o){let e=Object.getOwnPropertyNames(o);for(let t of e){let e=new wjcCore.Binding(o[t]);a[t]=e;n[t]=e.getValue(s)}}e.cell!==s&&(e.cell=s);return d}checkHeight(e){this._isCheckingHeight||setTimeout(()=>{let t=e.cell;if(e.cellStamp===t[DirectiveCellFactoryBase._cellStampProp]){var l=t.scrollHeight,i=e.panel.rows,r=e.row.index,o=e.rng,n=o&&o.rowSpan||1,s=e.isEdit;null!=i.maxSize&&(l=Math.min(l,i.maxSize));if(r<i.length&&i[r].renderHeight*n<l-1){const t=l/n;if(s){let l=this._isFullEdit(),i=this.grid;this._backupHeight=e.row.height;e.row.height=t;this._cacheRow=e.row;this._isCheckingHeight=!0;i.refresh();i.startEditing(l);this._isCheckingHeight=!1}}s&&(e.isImeInput?this._initImeEditInput(e.cell,e.templateContext):this._initEditInput(e.cell,e.templateContext,null))}},0)}_restoreRowHeight(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}}doDisposeCell(e){for(var t=DirectiveCellFactoryBase._templateTypes,l=0;l<t.length;l++){var i=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[l]]),r=e[i];if(r){let o=(r.column||this.grid)[i];this.disposeTemplate(e,r,o);t[l]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}}static getTemplContextProp(e){return"$__cellTempl"+GridCellTemplateType[e]}_doDisposeCell(e){this.doDisposeCell(e)}_initEditInput(e,t,l){this.setEditorFocusFlag(!0);let i=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);i&&setTimeout(()=>{let t=this._findInitialInput(e);if(t){var inpFocusEh=()=>{t.removeEventListener("focus",inpFocusEh);setTimeout(()=>{setTimeout(()=>{let e=null!=l?l:this._editChar;if(e){t.value=e;this._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(this._evtInput)}},0)},DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}},100)}_initImeEditInput(e,t){let l=wjcCore.getActiveElement();if(l&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&wjcCore.hasClass(l,"wj-grid-ime")){let i=this._findInitialInput(e),r=i&&i.style.color,o=this._composing,compEndEh=()=>{l.removeEventListener("compositionend",compEndEh);wjcCore.setCss(l,wjcGrid._ImeHandler._cssHidden);this.setEditorFocusFlag(!0);i&&(i.style.color=r);this._initEditInput(e,t,o?l.value:null)};if(o){l.addEventListener("compositionend",compEndEh);if(i){let e=i.getBoundingClientRect(),t=l.getBoundingClientRect(),r=window.getComputedStyle(l),o=parseFloat(r.left),n=parseFloat(r.top);wjcCore.setCss(l,{left:o+e.left-t.left+"px",top:n+e.top-t.top+"px",width:e.width+"px",height:e.height+"px"});i.style.color="transparent"}}else setTimeout(()=>compEndEh(),DirectiveCellFactoryBase._FOCUS_INTERVAL)}}_findInitialInput(e){let t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var l=0;l<t.length;l++){var i=t[l],r=window.getComputedStyle(i);if("none"!==r.display&&"visible"===r.visibility)return i}return null}static _setSelectionRange(e,t,l=t){if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(l),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}}_triggerEditorEvents(e){if(e){let t=e.querySelectorAll(".wj-control");for(let e=0;e<t.length;e++){let l=t[e],i=wjcCore.Control.getControl(l);i&&this.flushPendingEvents(i)}}}_isFullEdit(){let e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit}_setFullEdit(e){let t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)}}DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;exports.DirectiveCellFactoryBase=DirectiveCellFactoryBase;__gridCFRef||(window.wijmo.grid=null);!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType=exports.GridCellTemplateType||(exports.GridCellTemplateType={}));wijmo_1._registerModule("wijmo.interop.grid",selfModule);
"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),wjcCore=__importStar(require("@grapecity/wijmo")),wjcGrid=__importStar(require("@grapecity/wijmo.grid")),selfModule=__importStar(require("@grapecity/wijmo.interop.grid"));function softInput(){return wijmo_1._getModule("wijmo.input")}exports.softInput=softInput;function softGridDetail(){return wijmo_1._getModule("wijmo.grid.detail")}exports.softGridDetail=softGridDetail;var GridCellTemplateType,__gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}class DirectiveCellFactoryBase extends wjcGrid.CellFactory{constructor(e){super();this._lastApplyTimeStamp=0;this._noApplyLag=!1;this._startingEditing=!1;this._cellStampCounter=0;this._composing=!1;this._autoSizeCache={};this._isCheckingHeight=!1;this._backupHeight=-1;this._cacheRow=null;this.grid=e;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var t in GridCellTemplateType)isNaN(t)&&DirectiveCellFactoryBase._templateTypes.push(t)}var i=this;this._baseCf=e.cellFactory;e.cellFactory=this;this._evtInput=document.createEvent("HTMLEvents");this._evtInput.initEvent("input",!0,!1);this._evtBlur=document.createEvent("HTMLEvents");this._evtBlur.initEvent("blur",!1,!1);e.prepareCellForEdit.addHandler((function(e,t){i._noApplyLag=!0}));e.cellEditEnded.addHandler((function(t,l){let r=l.range,o=r.col;(o<0||o<e.columns.length&&!e._getBindingColumn(e.cells,r.row,e.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(i._editChar=null);setTimeout((function(){i._noApplyLag=!1}),300)}));e.beginningEdit.addHandler((function(e,t){i._startingEditing=!0}));e.hostElement.addEventListener("keydown",(function(e){i._startingEditing=!1}),!0);e.hostElement.addEventListener("keypress",(function(t){var l=t.charCode>32?String.fromCharCode(t.charCode):null;if(l&&wjcCore.closest(t.target,".wj-flexgrid")===e.hostElement)if(!e.activeEditor||i._startingEditing){i._editChar=l;setTimeout(()=>{e.activeEditor||(i._editChar=null)},0)}else i._editChar&&(i._editChar+=l)}),!0);e.hostElement.addEventListener("compositionstart",(function(e){i._composing=!0}),!0);e.hostElement.addEventListener("compositionend",(function(e){i._composing=!1}),!0);e.updatedView.addHandler((e,t)=>{this._updatedViewHandler()})}_updatedViewHandler(){queueMicrotask(()=>{this._autoSizeIfRequired()})}canRender(e){return!!e}updateCell(e,t,i,l,r){this._cellStampCounter=(this._cellStampCounter+1)%1e7;l[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;l.style.overflow&&(l.style.overflow="");let o=t,s=i;if(r&&!r.isSingleCell){t=r.row;i=r.col}let n,a=e.grid,d=a.editRange,c=e.rows[t],p=c.dataItem,u=!1,h=!1,C=!1,g=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(d&&d.row===t&&d.col===i){n=GridCellTemplateType.CellEdit;h=C=!0}else if(c instanceof wjcGrid.GroupRow){var m=!((g=p instanceof wjcCore.CollectionViewGroup)||c.hasChildren);if(i==e.columns.firstVisibleIndex)n=m?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{n=m?GridCellTemplateType.Cell:GridCellTemplateType.Group;h=!0}}else c instanceof wjcGrid._NewRowTemplate?n=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&c instanceof softGridDetail().DetailRow||(n=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:n=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:n=a.collectionView&&a.collectionView.currentEditItem===p?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;u=!0;break;case wjcGrid.CellType.TopLeft:n=GridCellTemplateType.TopLeft;u=!0;break;case wjcGrid.CellType.ColumnFooter:n=GridCellTemplateType.ColumnFooter;h=!0;break;case wjcGrid.CellType.BottomLeft:n=GridCellTemplateType.BottomLeft;u=!0}var _=!1;if(null!=n){let d=null;g&&n==GridCellTemplateType.GroupHeader?d=a.getColumn(p.groupDescription.propertyName):i>=0&&i<e.columns.length&&(d=e.cellType===wjcGrid.CellType.ColumnHeader&&a._hasColumnGroups()?a._getColumnGroup(t,i):a._getBindingColumn(e,t,e.columns[i]));if(d){var f=DirectiveCellFactoryBase.getTemplContextProp,w=f(n),E=(u?a:d)[w];E||(n===GridCellTemplateType.RowHeaderEdit?E=a[w=f(n=GridCellTemplateType.RowHeader)]:n!==GridCellTemplateType.Group&&n!==GridCellTemplateType.GroupHeader||g||(E=d[w=f(n=GridCellTemplateType.Cell)]));E&&this.canRender(E)&&(_=this._processTemplate(e,t,i,l,E,{needCellValue:h,isCvGroup:g,isEdit:C,riOriginal:o,ciOriginal:s,rng:r,templContextProp:w,col:d,row:c}))}}if(!_){this._doDisposeCell(l);this._baseCf.updateCell(e,o,s,l,r)}}_processTemplate(e,t,i,l,r,o){let s=o.needCellValue,n=o.isCvGroup,a=o.isEdit,d=e.grid,c=o.row,p=o.col,u=o.riOriginal,h=o.ciOriginal,C=o.rng,g=o.templContextProp;const m=l[DirectiveCellFactoryBase._cellStampProp],_=this;let f,w;if(s){f=e.getCellData(t,i,!1);w=e.getCellData(t,i,!0)}const E=!!n&&c.isSummary,y=n&&(d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!c.isCollapsed);let T=l.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),v=T&&"true"===T.toLowerCase();if(a){this.clearCell(l);this._baseCf.updateCell(e,u,h,l,C,!0)}let S,H=a&&d.imeEnabled,G=H&&this._composing,j=l[g],F={cell:l,column:p,row:c,panel:e,rng:C,isEdit:a,isImeInput:H,isTrueImeInput:G,templateContext:r,templateCache:j,templateContextProperty:g,cellStamp:m,cellValue:f,cellValueFormatted:w},z=this.shouldInstantiate(F),I=!0;n&&!E&&i!=e.columns.firstVisibleIndex&&y&&(I=!1);if(z){if(a){const e=l.firstElementChild;if(e){H||l.focus();e.style.display="none"}}else this.clearCell(l);this._doDisposeCell(l);if(I){this.renderTemplate(F,!0);F.templateCache=j=l[g]}S=F.cellBindingsData}else{I?this.renderTemplate(F,!1):this._doDisposeCell(l);S=F.cellBindingsData}r.cellOverflow&&(l.style.overflow=r.cellOverflow);v?this.applyImmediately(F):r.autoSizeRows&&!H&&this._markForAutoSize(t,i,e);if(a){I&&queueMicrotask(()=>{this._updateEditRowSize(e,t,i,l)});setTimeout(()=>{H?this._initImeEditInput(F.cell,r):this._initEditInput(F.cell,r,null)},0)}if(a){_._cellEditorVars=S.localVars;var editEndingEH=function(e,t){d.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){let e=wjcCore.getActiveElement();e&&e.dispatchEvent(_._evtBlur);wjcCore.contains(l,wjcCore.getActiveElement())&&l.focus()}_._triggerEditorEvents(l);if(!t.cancel&&!t.stayInEditMode){let e=S.localVars,t=Object.getOwnPropertyNames(S.bindings);for(let i of t)S.bindings[i].setValue(e,S.localVars.values[i])}var i=l.querySelectorAll(".wj-dropdown");[].forEach.call(i,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))};let editEndedEH=function(e,t){d.cellEditEnded.removeHandler(editEndedEH);_._cellEditorVars=null};d.cellEditEnding.addHandler(editEndingEH);d.cellEditEnded.addHandler(editEndedEH)}else this._baseCf.updateCell(e,u,h,l,C,!1);return!0}_updateEditRowSize(e,t,i,l){const r=e.rows[t];let o=this.getHeight(e,t,i,l),s=0;if(this.grid.rowHeaders.columns[0]&&this.grid.rowHeaders.columns[0].isVisible)try{s=this.getHeight(this.grid.rowHeaders,t,0,this.grid.rowHeaders.getCellElement(t,0))}catch(e){}s>o&&(o=s);if(!r.resizedManually&&o>r.renderHeight){const e=r.height;r.height=o;if(this.grid._toInv){clearTimeout(this.grid._toInv);this.grid._listenResizeEvents=!1;this.grid.refreshCells(!0);setTimeout(()=>{this.grid._listenResizeEvents=!0})}const endedHandler=(i,l)=>{r._editHandler=null;i.rowEditEnded.removeHandler(endedHandler);i.rows[t]&&(i.rows[t].height=e||null)};if(!r._editHandler){r._editHandler=endedHandler;this.grid.rowEditEnded.addHandler(endedHandler)}}}_autoSizePanelCells(e,t,i){let l,r=!1,o=0,s=!1,n=e.grid.editableCollectionView&&e.grid.editableCollectionView.currentEditItem;for(let t of e.columns)t.isVisible&&o++;for(let e of t.columns)if(e.isVisible){s=!0;break}const a=e.rows.defaultSize;for(l in i){l=parseInt(l);if(!e.rows[l]||n&&e.rows[l].dataItem===n)continue;if(e.rows[l].resizedManually||null!=e.rows[l].detail)continue;const d=Array.from(i[l].rowHeader),c=Array.from(i[l].cell);let p=-1;for(let e of d){const i=t.getCellElement(l,e);if(i&&(!i.$__cellTemplRowHeaderEdit||i.$__cellTemplRowHeaderEdit&&n)){const r=this.getHeight(t,l,e,i);r>p&&(p=r)}}for(let t of c){const i=e.getCellElement(l,t);if(i){const r=this.getHeight(e,l,t,i);r>p&&(p=r)}}c.length!=o&&a>p&&(p=a);e.grid.headersVisibility&wjcGrid.HeadersVisibility.Row&&s&&0===d.length&&a>p&&(p=a);if(p>-1&&Math.abs(e.rows[l].height-p)>1){e.rows[l].height=p;r=!0}}return r}getHeight(e,t,i,l){let r=l.scrollHeight,o=e.rows,s=e.grid.getMergedRange(e,t,i,!1),n=s&&s.rowSpan||1;if(l.firstElementChild){const e=getComputedStyle(l),t=l.firstElementChild.scrollHeight+(parseInt(e.paddingTop)||0)+(parseInt(e.paddingBottom)||0);l.firstElementChild.childNodes.length>0&&0!=l.firstElementChild.scrollHeight&&(r=t)}null!=o.maxSize&&(r=Math.min(r,o.maxSize));return r/n}_autoSizeIfRequired(){const e=this.grid.editRange;if(e&&this.grid.columns[e.col]||this.grid._mouseHdl._isDown&&this.grid._mouseHdl._szArgs){this._autoSizeCache={};return}const t=this.grid.viewRange;if(this._autoSizeCache&&this._autoSizeCache.pendingCells)for(let e=t.topRow;e<=t.bottomRow;e++){if(this._autoSizeCache.pendingCells.cells&&this._autoSizeCache.pendingCells.cells[e]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.headers&&this._autoSizeCache.pendingCells.headers[e]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.footers&&this._autoSizeCache.pendingCells.footers[e]){this._autoSizePendingCells();return}}}_autoSizePendingCells(){let e=!1,t=!1,i=!1;try{this.grid.beginUpdate();if(!this._autoSizeCache||!this._autoSizeCache.pendingCells)return;this._autoSizeCache.pendingCells.headers&&(e=this._autoSizePanelCells(this.grid.columnHeaders,this.grid.topLeftCells,this._autoSizeCache.pendingCells.headers));this._autoSizeCache.pendingCells.cells&&(t=this._autoSizePanelCells(this.grid.cells,this.grid.rowHeaders,this._autoSizeCache.pendingCells.cells));this._autoSizeCache.pendingCells.footers&&(i=this._autoSizePanelCells(this.grid.columnFooters,this.grid.bottomLeftCells,this._autoSizeCache.pendingCells.footers));this._autoSizeCache={}}finally{this.grid.endUpdate(e||t||i)}}_markForAutoSize(e,t,i){let l,r=!1;this._autoSizeCache.pendingCells||(this._autoSizeCache.pendingCells={});switch(i.cellType){case wjcGrid.CellType.TopLeft:r=!0;case wjcGrid.CellType.ColumnHeader:this._autoSizeCache.pendingCells.headers||(this._autoSizeCache.pendingCells.headers={});l=this._autoSizeCache.pendingCells.headers;break;case wjcGrid.CellType.RowHeader:r=!0;case wjcGrid.CellType.Cell:this._autoSizeCache.pendingCells.cells||(this._autoSizeCache.pendingCells.cells={});l=this._autoSizeCache.pendingCells.cells;break;case wjcGrid.CellType.BottomLeft:r=!0;case wjcGrid.CellType.ColumnFooter:this._autoSizeCache.pendingCells.footers||(this._autoSizeCache.pendingCells.footers={});l=this._autoSizeCache.pendingCells.footers;break;default:return}l[e]||(l[e]={rowHeader:new Set,cell:new Set});r?l[e].rowHeader.add(t):l[e].cell.add(t)}getEditorValue(e){if(this._cellEditorVars){let t=e.editRange;t&&t.isValid&&this._triggerEditorEvents(e.cells.getCellElement(t.row,t.col));return this._cellEditorVars.value}return super.getEditorValue(e)}disposeCell(e){this._doDisposeCell(e)}disposeTemplate(e,t,i){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}}setBindingsData(e,t,i,l,r,o){e.row=t;e.col=i;e.item=l;let s={},n=e.cell||{},a={},d={localVars:n,bindings:a};n.row=t;n.col=i;n.item=l;n.value=r;n.valueFormatted=e.cellValueFormatted;n.values=s;if(o){let e=Object.getOwnPropertyNames(o);for(let t of e){let e=new wjcCore.Binding(o[t]);a[t]=e;s[t]=e.getValue(n)}}e.cell!==n&&(e.cell=n);return d}checkHeight(e){this._isCheckingHeight||setTimeout(()=>{let t=e.cell;if(e.cellStamp===t[DirectiveCellFactoryBase._cellStampProp]){var i=t.scrollHeight,l=e.panel.rows,r=e.row.index,o=e.rng,s=o&&o.rowSpan||1,n=e.isEdit;null!=l.maxSize&&(i=Math.min(i,l.maxSize));if(r<l.length&&l[r].renderHeight*s<i-1){const t=i/s;if(n){let i=this._isFullEdit(),l=this.grid;this._backupHeight=e.row.height;e.row.height=t;this._cacheRow=e.row;this._isCheckingHeight=!0;l.refresh();l.startEditing(i);this._isCheckingHeight=!1}}n&&(e.isImeInput?this._initImeEditInput(e.cell,e.templateContext):this._initEditInput(e.cell,e.templateContext,null))}},0)}_restoreRowHeight(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}}doDisposeCell(e){for(var t=DirectiveCellFactoryBase._templateTypes,i=0;i<t.length;i++){var l=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[i]]),r=e[l];if(r){let o=(r.column||this.grid)[l];this.disposeTemplate(e,r,o);t[i]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}}static getTemplContextProp(e){return"$__cellTempl"+GridCellTemplateType[e]}_doDisposeCell(e){this.doDisposeCell(e)}_initEditInput(e,t,i){this.setEditorFocusFlag(!0);let l=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);if(l){let t=this._findInitialInput(e);if(t){var inpFocusEh=()=>{t.removeEventListener("focus",inpFocusEh);setTimeout(()=>{let e=null!=i?i:this._editChar;if(e){t.value=e;this._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(this._evtInput)}},DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}}}_initImeEditInput(e,t){let i=wjcCore.getActiveElement();if(i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&wjcCore.hasClass(i,"wj-grid-ime")){let l=this._findInitialInput(e),r=l&&l.style.color,o=this._composing,compEndEh=()=>{i.removeEventListener("compositionend",compEndEh);wjcCore.setCss(i,wjcGrid._ImeHandler._cssHidden);this.setEditorFocusFlag(!0);l&&(l.style.color=r);this._initEditInput(e,t,o?i.value:null)};if(o){i.addEventListener("compositionend",compEndEh);if(l){let e=l.getBoundingClientRect(),t=i.getBoundingClientRect(),r=window.getComputedStyle(i),o=parseFloat(r.left),s=parseFloat(r.top);wjcCore.setCss(i,{left:o+e.left-t.left+"px",top:s+e.top-t.top+"px",width:e.width+"px",height:e.height+"px"});l.style.color="transparent"}}else setTimeout(()=>compEndEh(),DirectiveCellFactoryBase._FOCUS_INTERVAL)}}_findInitialInput(e){let t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var i=0;i<t.length;i++){var l=t[i],r=window.getComputedStyle(l);if("none"!==r.display&&"visible"===r.visibility)return l}return null}static _setSelectionRange(e,t,i=t){if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(i),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}}_triggerEditorEvents(e){if(e){let t=e.querySelectorAll(".wj-control");for(let e=0;e<t.length;e++){let i=t[e],l=wjcCore.Control.getControl(i);l&&this.flushPendingEvents(l)}}}_isFullEdit(){let e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit}_setFullEdit(e){let t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)}}DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;exports.DirectiveCellFactoryBase=DirectiveCellFactoryBase;__gridCFRef||(window.wijmo.grid=null);!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType=exports.GridCellTemplateType||(exports.GridCellTemplateType={}));wijmo_1._registerModule("wijmo.interop.grid",selfModule);
/*!
*
* Wijmo Library 5.20241.9
* Wijmo Library 5.20241.19
* https://developer.mescius.com/wijmo

@@ -14,2 +14,2 @@ *

import{_getModule,_registerModule}from"@grapecity/wijmo";import*as wjcCore from"@grapecity/wijmo";import*as wjcGrid from"@grapecity/wijmo.grid";import*as selfModule from"@grapecity/wijmo.interop.grid";export function softInput(){return _getModule("wijmo.input")}export function softGridDetail(){return _getModule("wijmo.grid.detail")}var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}export class DirectiveCellFactoryBase extends wjcGrid.CellFactory{constructor(e){super();this._lastApplyTimeStamp=0;this._noApplyLag=!1;this._startingEditing=!1;this._cellStampCounter=0;this._composing=!1;this._isCheckingHeight=!1;this._backupHeight=-1;this._cacheRow=null;this.grid=e;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var t in GridCellTemplateType)isNaN(t)&&DirectiveCellFactoryBase._templateTypes.push(t)}var l=this;this._baseCf=e.cellFactory;e.cellFactory=this;this._evtInput=document.createEvent("HTMLEvents");this._evtInput.initEvent("input",!0,!1);this._evtBlur=document.createEvent("HTMLEvents");this._evtBlur.initEvent("blur",!1,!1);e.prepareCellForEdit.addHandler((function(e,t){l._noApplyLag=!0}));e.cellEditEnded.addHandler((function(t,i){let o=i.range,r=o.col;(r<0||r<e.columns.length&&!e._getBindingColumn(e.cells,o.row,e.columns[r])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(l._editChar=null);setTimeout((function(){l._noApplyLag=!1}),300)}));e.beginningEdit.addHandler((function(e,t){l._startingEditing=!0}));e.hostElement.addEventListener("keydown",(function(e){l._startingEditing=!1}),!0);e.hostElement.addEventListener("keypress",(function(t){var i=t.charCode>32?String.fromCharCode(t.charCode):null;if(i&&wjcCore.closest(t.target,".wj-flexgrid")===e.hostElement)if(!e.activeEditor||l._startingEditing){l._editChar=i;setTimeout(()=>{e.activeEditor||(l._editChar=null)},0)}else l._editChar&&(l._editChar+=i)}),!0);e.hostElement.addEventListener("compositionstart",(function(e){l._composing=!0}),!0);e.hostElement.addEventListener("compositionend",(function(e){l._composing=!1}),!0)}updateCell(e,t,l,i,o){this._cellStampCounter=(this._cellStampCounter+1)%1e7;let r=i[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;i.style.overflow&&(i.style.overflow="");let n=t,s=l;if(o&&!o.isSingleCell){t=o.row;l=o.col}let a,d=this,c=e.grid,p=c.editRange,u=e.rows[t],m=u.dataItem,C=!1,h=!1,g=!1,f=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(p&&p.row===t&&p.col===l){a=GridCellTemplateType.CellEdit;h=g=!0}else if(u instanceof wjcGrid.GroupRow){var _=!((f=m instanceof wjcCore.CollectionViewGroup)||u.hasChildren);if(l==e.columns.firstVisibleIndex)a=_?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{a=_?GridCellTemplateType.Cell:GridCellTemplateType.Group;h=!0}}else u instanceof wjcGrid._NewRowTemplate?a=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&u instanceof softGridDetail().DetailRow||(a=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:a=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:a=c.collectionView&&c.collectionView.currentEditItem===m?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;C=!0;break;case wjcGrid.CellType.TopLeft:a=GridCellTemplateType.TopLeft;C=!0;break;case wjcGrid.CellType.ColumnFooter:a=GridCellTemplateType.ColumnFooter;h=!0;break;case wjcGrid.CellType.BottomLeft:a=GridCellTemplateType.BottomLeft;C=!0}const w=!!f&&u.isSummary,E=f&&(c.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||c.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!u.isCollapsed);var T=!1;if(null!=a){let p=null;f&&a==GridCellTemplateType.GroupHeader?p=c.getColumn(m.groupDescription.propertyName):l>=0&&l<e.columns.length&&(p=e.cellType===wjcGrid.CellType.ColumnHeader&&c._hasColumnGroups()?c._getColumnGroup(t,l):c._getBindingColumn(e,t,e.columns[l]));if(p){var y=DirectiveCellFactoryBase.getTemplContextProp,v=y(a),G=(C?c:p)[v];if(!G)if(a===GridCellTemplateType.RowHeaderEdit){v=y(a=GridCellTemplateType.RowHeader);G=c[v]}else if((a===GridCellTemplateType.Group||a===GridCellTemplateType.GroupHeader)&&!f){v=y(a=GridCellTemplateType.Cell);G=p[v]}if(G){var j,F;if(h){j=e.getCellData(t,l,!1);F=e.getCellData(t,l,!0)}{T=!0;let t=i.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),a=t&&"true"===t.toLowerCase();if(g){this.clearCell(i);this._baseCf.updateCell(e,n,s,i,o,!0)}let m,C=g&&c.imeEnabled,h=C&&this._composing,_=i[v],y={cell:i,column:p,row:u,panel:e,rng:o,isEdit:g,isImeInput:C,isTrueImeInput:h,templateContext:G,templateCache:_,templateContextProperty:v,cellStamp:r,cellValue:j,cellValueFormatted:F},I=this.shouldInstantiate(y),D=!0;f&&!w&&l!=e.columns.firstVisibleIndex&&E&&(D=!1);if(I){if(g){var H=i.firstElementChild;if(H){C||i.focus();H.style.display="none"}}else this.clearCell(i);this._doDisposeCell(i);if(D){this.renderTemplate(y,!0);y.templateCache=_=i[v]}else this._doDisposeCell(i);m=y.cellBindingsData}else{D?this.renderTemplate(y,!1):this._doDisposeCell(i);m=y.cellBindingsData}G.cellOverflow&&(i.style.overflow=G.cellOverflow);a?this.applyImmediately(y):G.autoSizeRows&&!C?this.checkHeight(y):g&&setTimeout(()=>{C?this._initImeEditInput(y.cell,G):this._initEditInput(y.cell,G,null)},0);if(g){d._cellEditorVars=m.localVars;var editEndingEH=function(e,t){c.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){let e=wjcCore.getActiveElement();e&&e.dispatchEvent(d._evtBlur);wjcCore.contains(i,wjcCore.getActiveElement())&&i.focus()}d._triggerEditorEvents(i);if(!t.cancel&&!t.stayInEditMode){let e=m.localVars,t=Object.getOwnPropertyNames(m.bindings);for(let l of t)m.bindings[l].setValue(e,m.localVars.values[l])}var l=i.querySelectorAll(".wj-dropdown");[].forEach.call(l,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))};let editEndedEH=function(e,t){c.cellEditEnded.removeHandler(editEndedEH);d._cellEditorVars=null};c.cellEditEnding.addHandler(editEndingEH);c.cellEditEnded.addHandler(editEndedEH)}else this._baseCf.updateCell(e,n,s,i,o,!1)}}}}if(!T){this._doDisposeCell(i);this._baseCf.updateCell(e,n,s,i,o)}}getEditorValue(e){if(this._cellEditorVars){let t=e.editRange;t&&t.isValid&&this._triggerEditorEvents(e.cells.getCellElement(t.row,t.col));return this._cellEditorVars.value}return super.getEditorValue(e)}disposeCell(e){this._doDisposeCell(e)}disposeTemplate(e,t,l){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}}setBindingsData(e,t,l,i,o,r){e.row=t;e.col=l;e.item=i;let n={},s=e.cell||{},a={},d={localVars:s,bindings:a};s.row=t;s.col=l;s.item=i;s.value=o;s.valueFormatted=e.cellValueFormatted;s.values=n;if(r){let e=Object.getOwnPropertyNames(r);for(let t of e){let e=new wjcCore.Binding(r[t]);a[t]=e;n[t]=e.getValue(s)}}e.cell!==s&&(e.cell=s);return d}checkHeight(e){this._isCheckingHeight||setTimeout(()=>{let t=e.cell;if(e.cellStamp===t[DirectiveCellFactoryBase._cellStampProp]){var l=t.scrollHeight,i=e.panel.rows,o=e.row.index,r=e.rng,n=r&&r.rowSpan||1,s=e.isEdit;null!=i.maxSize&&(l=Math.min(l,i.maxSize));if(o<i.length&&i[o].renderHeight*n<l-1){const t=l/n;if(s){let l=this._isFullEdit(),i=this.grid;this._backupHeight=e.row.height;e.row.height=t;this._cacheRow=e.row;this._isCheckingHeight=!0;i.refresh();i.startEditing(l);this._isCheckingHeight=!1}}s&&(e.isImeInput?this._initImeEditInput(e.cell,e.templateContext):this._initEditInput(e.cell,e.templateContext,null))}},0)}_restoreRowHeight(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}}doDisposeCell(e){for(var t=DirectiveCellFactoryBase._templateTypes,l=0;l<t.length;l++){var i=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[l]]),o=e[i];if(o){let r=(o.column||this.grid)[i];this.disposeTemplate(e,o,r);t[l]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}}static getTemplContextProp(e){return"$__cellTempl"+GridCellTemplateType[e]}_doDisposeCell(e){this.doDisposeCell(e)}_initEditInput(e,t,l){this.setEditorFocusFlag(!0);let i=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);i&&setTimeout(()=>{let t=this._findInitialInput(e);if(t){var inpFocusEh=()=>{t.removeEventListener("focus",inpFocusEh);setTimeout(()=>{setTimeout(()=>{let e=null!=l?l:this._editChar;if(e){t.value=e;this._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(this._evtInput)}},0)},DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}},100)}_initImeEditInput(e,t){let l=wjcCore.getActiveElement();if(l&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&wjcCore.hasClass(l,"wj-grid-ime")){let i=this._findInitialInput(e),o=i&&i.style.color,r=this._composing,compEndEh=()=>{l.removeEventListener("compositionend",compEndEh);wjcCore.setCss(l,wjcGrid._ImeHandler._cssHidden);this.setEditorFocusFlag(!0);i&&(i.style.color=o);this._initEditInput(e,t,r?l.value:null)};if(r){l.addEventListener("compositionend",compEndEh);if(i){let e=i.getBoundingClientRect(),t=l.getBoundingClientRect(),o=window.getComputedStyle(l),r=parseFloat(o.left),n=parseFloat(o.top);wjcCore.setCss(l,{left:r+e.left-t.left+"px",top:n+e.top-t.top+"px",width:e.width+"px",height:e.height+"px"});i.style.color="transparent"}}else setTimeout(()=>compEndEh(),DirectiveCellFactoryBase._FOCUS_INTERVAL)}}_findInitialInput(e){let t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var l=0;l<t.length;l++){var i=t[l],o=window.getComputedStyle(i);if("none"!==o.display&&"visible"===o.visibility)return i}return null}static _setSelectionRange(e,t,l=t){if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(l),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}}_triggerEditorEvents(e){if(e){let t=e.querySelectorAll(".wj-control");for(let e=0;e<t.length;e++){let l=t[e],i=wjcCore.Control.getControl(l);i&&this.flushPendingEvents(i)}}}_isFullEdit(){let e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit}_setFullEdit(e){let t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)}}DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;__gridCFRef||(window.wijmo.grid=null);export var GridCellTemplateType;!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType||(GridCellTemplateType={}));_registerModule("wijmo.interop.grid",selfModule);
import{_getModule,_registerModule}from"@grapecity/wijmo";import*as wjcCore from"@grapecity/wijmo";import*as wjcGrid from"@grapecity/wijmo.grid";import*as selfModule from"@grapecity/wijmo.interop.grid";export function softInput(){return _getModule("wijmo.input")}export function softGridDetail(){return _getModule("wijmo.grid.detail")}var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}export class DirectiveCellFactoryBase extends wjcGrid.CellFactory{constructor(e){super();this._lastApplyTimeStamp=0;this._noApplyLag=!1;this._startingEditing=!1;this._cellStampCounter=0;this._composing=!1;this._autoSizeCache={};this._isCheckingHeight=!1;this._backupHeight=-1;this._cacheRow=null;this.grid=e;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var t in GridCellTemplateType)isNaN(t)&&DirectiveCellFactoryBase._templateTypes.push(t)}var i=this;this._baseCf=e.cellFactory;e.cellFactory=this;this._evtInput=document.createEvent("HTMLEvents");this._evtInput.initEvent("input",!0,!1);this._evtBlur=document.createEvent("HTMLEvents");this._evtBlur.initEvent("blur",!1,!1);e.prepareCellForEdit.addHandler((function(e,t){i._noApplyLag=!0}));e.cellEditEnded.addHandler((function(t,l){let o=l.range,r=o.col;(r<0||r<e.columns.length&&!e._getBindingColumn(e.cells,o.row,e.columns[r])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(i._editChar=null);setTimeout((function(){i._noApplyLag=!1}),300)}));e.beginningEdit.addHandler((function(e,t){i._startingEditing=!0}));e.hostElement.addEventListener("keydown",(function(e){i._startingEditing=!1}),!0);e.hostElement.addEventListener("keypress",(function(t){var l=t.charCode>32?String.fromCharCode(t.charCode):null;if(l&&wjcCore.closest(t.target,".wj-flexgrid")===e.hostElement)if(!e.activeEditor||i._startingEditing){i._editChar=l;setTimeout(()=>{e.activeEditor||(i._editChar=null)},0)}else i._editChar&&(i._editChar+=l)}),!0);e.hostElement.addEventListener("compositionstart",(function(e){i._composing=!0}),!0);e.hostElement.addEventListener("compositionend",(function(e){i._composing=!1}),!0);e.updatedView.addHandler((e,t)=>{this._updatedViewHandler()})}_updatedViewHandler(){queueMicrotask(()=>{this._autoSizeIfRequired()})}canRender(e){return!!e}updateCell(e,t,i,l,o){this._cellStampCounter=(this._cellStampCounter+1)%1e7;l[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;l.style.overflow&&(l.style.overflow="");let r=t,s=i;if(o&&!o.isSingleCell){t=o.row;i=o.col}let n,a=e.grid,d=a.editRange,c=e.rows[t],p=c.dataItem,u=!1,h=!1,C=!1,g=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(d&&d.row===t&&d.col===i){n=GridCellTemplateType.CellEdit;h=C=!0}else if(c instanceof wjcGrid.GroupRow){var m=!((g=p instanceof wjcCore.CollectionViewGroup)||c.hasChildren);if(i==e.columns.firstVisibleIndex)n=m?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{n=m?GridCellTemplateType.Cell:GridCellTemplateType.Group;h=!0}}else c instanceof wjcGrid._NewRowTemplate?n=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&c instanceof softGridDetail().DetailRow||(n=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:n=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:n=a.collectionView&&a.collectionView.currentEditItem===p?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;u=!0;break;case wjcGrid.CellType.TopLeft:n=GridCellTemplateType.TopLeft;u=!0;break;case wjcGrid.CellType.ColumnFooter:n=GridCellTemplateType.ColumnFooter;h=!0;break;case wjcGrid.CellType.BottomLeft:n=GridCellTemplateType.BottomLeft;u=!0}var _=!1;if(null!=n){let d=null;g&&n==GridCellTemplateType.GroupHeader?d=a.getColumn(p.groupDescription.propertyName):i>=0&&i<e.columns.length&&(d=e.cellType===wjcGrid.CellType.ColumnHeader&&a._hasColumnGroups()?a._getColumnGroup(t,i):a._getBindingColumn(e,t,e.columns[i]));if(d){var f=DirectiveCellFactoryBase.getTemplContextProp,w=f(n),E=(u?a:d)[w];E||(n===GridCellTemplateType.RowHeaderEdit?E=a[w=f(n=GridCellTemplateType.RowHeader)]:n!==GridCellTemplateType.Group&&n!==GridCellTemplateType.GroupHeader||g||(E=d[w=f(n=GridCellTemplateType.Cell)]));E&&this.canRender(E)&&(_=this._processTemplate(e,t,i,l,E,{needCellValue:h,isCvGroup:g,isEdit:C,riOriginal:r,ciOriginal:s,rng:o,templContextProp:w,col:d,row:c}))}}if(!_){this._doDisposeCell(l);this._baseCf.updateCell(e,r,s,l,o)}}_processTemplate(e,t,i,l,o,r){let s=r.needCellValue,n=r.isCvGroup,a=r.isEdit,d=e.grid,c=r.row,p=r.col,u=r.riOriginal,h=r.ciOriginal,C=r.rng,g=r.templContextProp;const m=l[DirectiveCellFactoryBase._cellStampProp],_=this;let f,w;if(s){f=e.getCellData(t,i,!1);w=e.getCellData(t,i,!0)}const E=!!n&&c.isSummary,y=n&&(d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!c.isCollapsed);let T=l.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),v=T&&"true"===T.toLowerCase();if(a){this.clearCell(l);this._baseCf.updateCell(e,u,h,l,C,!0)}let S,H=a&&d.imeEnabled,G=H&&this._composing,j=l[g],F={cell:l,column:p,row:c,panel:e,rng:C,isEdit:a,isImeInput:H,isTrueImeInput:G,templateContext:o,templateCache:j,templateContextProperty:g,cellStamp:m,cellValue:f,cellValueFormatted:w},z=this.shouldInstantiate(F),R=!0;n&&!E&&i!=e.columns.firstVisibleIndex&&y&&(R=!1);if(z){if(a){const e=l.firstElementChild;if(e){H||l.focus();e.style.display="none"}}else this.clearCell(l);this._doDisposeCell(l);if(R){this.renderTemplate(F,!0);F.templateCache=j=l[g]}S=F.cellBindingsData}else{R?this.renderTemplate(F,!1):this._doDisposeCell(l);S=F.cellBindingsData}o.cellOverflow&&(l.style.overflow=o.cellOverflow);v?this.applyImmediately(F):o.autoSizeRows&&!H&&this._markForAutoSize(t,i,e);if(a){R&&queueMicrotask(()=>{this._updateEditRowSize(e,t,i,l)});setTimeout(()=>{H?this._initImeEditInput(F.cell,o):this._initEditInput(F.cell,o,null)},0)}if(a){_._cellEditorVars=S.localVars;var editEndingEH=function(e,t){d.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){let e=wjcCore.getActiveElement();e&&e.dispatchEvent(_._evtBlur);wjcCore.contains(l,wjcCore.getActiveElement())&&l.focus()}_._triggerEditorEvents(l);if(!t.cancel&&!t.stayInEditMode){let e=S.localVars,t=Object.getOwnPropertyNames(S.bindings);for(let i of t)S.bindings[i].setValue(e,S.localVars.values[i])}var i=l.querySelectorAll(".wj-dropdown");[].forEach.call(i,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))};let editEndedEH=function(e,t){d.cellEditEnded.removeHandler(editEndedEH);_._cellEditorVars=null};d.cellEditEnding.addHandler(editEndingEH);d.cellEditEnded.addHandler(editEndedEH)}else this._baseCf.updateCell(e,u,h,l,C,!1);return!0}_updateEditRowSize(e,t,i,l){const o=e.rows[t];let r=this.getHeight(e,t,i,l),s=0;if(this.grid.rowHeaders.columns[0]&&this.grid.rowHeaders.columns[0].isVisible)try{s=this.getHeight(this.grid.rowHeaders,t,0,this.grid.rowHeaders.getCellElement(t,0))}catch(e){}s>r&&(r=s);if(!o.resizedManually&&r>o.renderHeight){const e=o.height;o.height=r;if(this.grid._toInv){clearTimeout(this.grid._toInv);this.grid._listenResizeEvents=!1;this.grid.refreshCells(!0);setTimeout(()=>{this.grid._listenResizeEvents=!0})}const endedHandler=(i,l)=>{o._editHandler=null;i.rowEditEnded.removeHandler(endedHandler);i.rows[t]&&(i.rows[t].height=e||null)};if(!o._editHandler){o._editHandler=endedHandler;this.grid.rowEditEnded.addHandler(endedHandler)}}}_autoSizePanelCells(e,t,i){let l,o=!1,r=0,s=!1,n=e.grid.editableCollectionView&&e.grid.editableCollectionView.currentEditItem;for(let t of e.columns)t.isVisible&&r++;for(let e of t.columns)if(e.isVisible){s=!0;break}const a=e.rows.defaultSize;for(l in i){l=parseInt(l);if(!e.rows[l]||n&&e.rows[l].dataItem===n)continue;if(e.rows[l].resizedManually||null!=e.rows[l].detail)continue;const d=Array.from(i[l].rowHeader),c=Array.from(i[l].cell);let p=-1;for(let e of d){const i=t.getCellElement(l,e);if(i&&(!i.$__cellTemplRowHeaderEdit||i.$__cellTemplRowHeaderEdit&&n)){const o=this.getHeight(t,l,e,i);o>p&&(p=o)}}for(let t of c){const i=e.getCellElement(l,t);if(i){const o=this.getHeight(e,l,t,i);o>p&&(p=o)}}c.length!=r&&a>p&&(p=a);e.grid.headersVisibility&wjcGrid.HeadersVisibility.Row&&s&&0===d.length&&a>p&&(p=a);if(p>-1&&Math.abs(e.rows[l].height-p)>1){e.rows[l].height=p;o=!0}}return o}getHeight(e,t,i,l){let o=l.scrollHeight,r=e.rows,s=e.grid.getMergedRange(e,t,i,!1),n=s&&s.rowSpan||1;if(l.firstElementChild){const e=getComputedStyle(l),t=l.firstElementChild.scrollHeight+(parseInt(e.paddingTop)||0)+(parseInt(e.paddingBottom)||0);l.firstElementChild.childNodes.length>0&&0!=l.firstElementChild.scrollHeight&&(o=t)}null!=r.maxSize&&(o=Math.min(o,r.maxSize));return o/n}_autoSizeIfRequired(){const e=this.grid.editRange;if(e&&this.grid.columns[e.col]||this.grid._mouseHdl._isDown&&this.grid._mouseHdl._szArgs){this._autoSizeCache={};return}const t=this.grid.viewRange;if(this._autoSizeCache&&this._autoSizeCache.pendingCells)for(let e=t.topRow;e<=t.bottomRow;e++){if(this._autoSizeCache.pendingCells.cells&&this._autoSizeCache.pendingCells.cells[e]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.headers&&this._autoSizeCache.pendingCells.headers[e]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.footers&&this._autoSizeCache.pendingCells.footers[e]){this._autoSizePendingCells();return}}}_autoSizePendingCells(){let e=!1,t=!1,i=!1;try{this.grid.beginUpdate();if(!this._autoSizeCache||!this._autoSizeCache.pendingCells)return;this._autoSizeCache.pendingCells.headers&&(e=this._autoSizePanelCells(this.grid.columnHeaders,this.grid.topLeftCells,this._autoSizeCache.pendingCells.headers));this._autoSizeCache.pendingCells.cells&&(t=this._autoSizePanelCells(this.grid.cells,this.grid.rowHeaders,this._autoSizeCache.pendingCells.cells));this._autoSizeCache.pendingCells.footers&&(i=this._autoSizePanelCells(this.grid.columnFooters,this.grid.bottomLeftCells,this._autoSizeCache.pendingCells.footers));this._autoSizeCache={}}finally{this.grid.endUpdate(e||t||i)}}_markForAutoSize(e,t,i){let l,o=!1;this._autoSizeCache.pendingCells||(this._autoSizeCache.pendingCells={});switch(i.cellType){case wjcGrid.CellType.TopLeft:o=!0;case wjcGrid.CellType.ColumnHeader:this._autoSizeCache.pendingCells.headers||(this._autoSizeCache.pendingCells.headers={});l=this._autoSizeCache.pendingCells.headers;break;case wjcGrid.CellType.RowHeader:o=!0;case wjcGrid.CellType.Cell:this._autoSizeCache.pendingCells.cells||(this._autoSizeCache.pendingCells.cells={});l=this._autoSizeCache.pendingCells.cells;break;case wjcGrid.CellType.BottomLeft:o=!0;case wjcGrid.CellType.ColumnFooter:this._autoSizeCache.pendingCells.footers||(this._autoSizeCache.pendingCells.footers={});l=this._autoSizeCache.pendingCells.footers;break;default:return}l[e]||(l[e]={rowHeader:new Set,cell:new Set});o?l[e].rowHeader.add(t):l[e].cell.add(t)}getEditorValue(e){if(this._cellEditorVars){let t=e.editRange;t&&t.isValid&&this._triggerEditorEvents(e.cells.getCellElement(t.row,t.col));return this._cellEditorVars.value}return super.getEditorValue(e)}disposeCell(e){this._doDisposeCell(e)}disposeTemplate(e,t,i){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}}setBindingsData(e,t,i,l,o,r){e.row=t;e.col=i;e.item=l;let s={},n=e.cell||{},a={},d={localVars:n,bindings:a};n.row=t;n.col=i;n.item=l;n.value=o;n.valueFormatted=e.cellValueFormatted;n.values=s;if(r){let e=Object.getOwnPropertyNames(r);for(let t of e){let e=new wjcCore.Binding(r[t]);a[t]=e;s[t]=e.getValue(n)}}e.cell!==n&&(e.cell=n);return d}checkHeight(e){this._isCheckingHeight||setTimeout(()=>{let t=e.cell;if(e.cellStamp===t[DirectiveCellFactoryBase._cellStampProp]){var i=t.scrollHeight,l=e.panel.rows,o=e.row.index,r=e.rng,s=r&&r.rowSpan||1,n=e.isEdit;null!=l.maxSize&&(i=Math.min(i,l.maxSize));if(o<l.length&&l[o].renderHeight*s<i-1){const t=i/s;if(n){let i=this._isFullEdit(),l=this.grid;this._backupHeight=e.row.height;e.row.height=t;this._cacheRow=e.row;this._isCheckingHeight=!0;l.refresh();l.startEditing(i);this._isCheckingHeight=!1}}n&&(e.isImeInput?this._initImeEditInput(e.cell,e.templateContext):this._initEditInput(e.cell,e.templateContext,null))}},0)}_restoreRowHeight(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}}doDisposeCell(e){for(var t=DirectiveCellFactoryBase._templateTypes,i=0;i<t.length;i++){var l=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[i]]),o=e[l];if(o){let r=(o.column||this.grid)[l];this.disposeTemplate(e,o,r);t[i]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}}static getTemplContextProp(e){return"$__cellTempl"+GridCellTemplateType[e]}_doDisposeCell(e){this.doDisposeCell(e)}_initEditInput(e,t,i){this.setEditorFocusFlag(!0);let l=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);if(l){let t=this._findInitialInput(e);if(t){var inpFocusEh=()=>{t.removeEventListener("focus",inpFocusEh);setTimeout(()=>{let e=null!=i?i:this._editChar;if(e){t.value=e;this._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(this._evtInput)}},DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}}}_initImeEditInput(e,t){let i=wjcCore.getActiveElement();if(i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&wjcCore.hasClass(i,"wj-grid-ime")){let l=this._findInitialInput(e),o=l&&l.style.color,r=this._composing,compEndEh=()=>{i.removeEventListener("compositionend",compEndEh);wjcCore.setCss(i,wjcGrid._ImeHandler._cssHidden);this.setEditorFocusFlag(!0);l&&(l.style.color=o);this._initEditInput(e,t,r?i.value:null)};if(r){i.addEventListener("compositionend",compEndEh);if(l){let e=l.getBoundingClientRect(),t=i.getBoundingClientRect(),o=window.getComputedStyle(i),r=parseFloat(o.left),s=parseFloat(o.top);wjcCore.setCss(i,{left:r+e.left-t.left+"px",top:s+e.top-t.top+"px",width:e.width+"px",height:e.height+"px"});l.style.color="transparent"}}else setTimeout(()=>compEndEh(),DirectiveCellFactoryBase._FOCUS_INTERVAL)}}_findInitialInput(e){let t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var i=0;i<t.length;i++){var l=t[i],o=window.getComputedStyle(l);if("none"!==o.display&&"visible"===o.visibility)return l}return null}static _setSelectionRange(e,t,i=t){if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(i),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}}_triggerEditorEvents(e){if(e){let t=e.querySelectorAll(".wj-control");for(let e=0;e<t.length;e++){let i=t[e],l=wjcCore.Control.getControl(i);l&&this.flushPendingEvents(l)}}}_isFullEdit(){let e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit}_setFullEdit(e){let t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)}}DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;__gridCFRef||(window.wijmo.grid=null);export var GridCellTemplateType;!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType||(GridCellTemplateType={}));_registerModule("wijmo.interop.grid",selfModule);
/*!
*
* Wijmo Library 5.20241.9
* Wijmo Library 5.20241.19
* https://developer.mescius.com/wijmo

@@ -14,2 +14,2 @@ *

var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();import{_getModule,_registerModule}from"@grapecity/wijmo";import*as wjcCore from"@grapecity/wijmo";import*as wjcGrid from"@grapecity/wijmo.grid";import*as selfModule from"@grapecity/wijmo.interop.grid";export function softInput(){return _getModule("wijmo.input")}export function softGridDetail(){return _getModule("wijmo.grid.detail")}var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}var DirectiveCellFactoryBase=function(e){__extends(DirectiveCellFactoryBase,e);function DirectiveCellFactoryBase(t){var l=e.call(this)||this;l._lastApplyTimeStamp=0;l._noApplyLag=!1;l._startingEditing=!1;l._cellStampCounter=0;l._composing=!1;l._isCheckingHeight=!1;l._backupHeight=-1;l._cacheRow=null;l.grid=t;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var i in GridCellTemplateType)isNaN(i)&&DirectiveCellFactoryBase._templateTypes.push(i)}var r=l;l._baseCf=t.cellFactory;t.cellFactory=l;l._evtInput=document.createEvent("HTMLEvents");l._evtInput.initEvent("input",!0,!1);l._evtBlur=document.createEvent("HTMLEvents");l._evtBlur.initEvent("blur",!1,!1);t.prepareCellForEdit.addHandler((function(e,t){r._noApplyLag=!0}));t.cellEditEnded.addHandler((function(e,l){var i=l.range,o=i.col;(o<0||o<t.columns.length&&!t._getBindingColumn(t.cells,i.row,t.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(r._editChar=null);setTimeout((function(){r._noApplyLag=!1}),300)}));t.beginningEdit.addHandler((function(e,t){r._startingEditing=!0}));t.hostElement.addEventListener("keydown",(function(e){r._startingEditing=!1}),!0);t.hostElement.addEventListener("keypress",(function(e){var l=e.charCode>32?String.fromCharCode(e.charCode):null;if(l&&wjcCore.closest(e.target,".wj-flexgrid")===t.hostElement)if(!t.activeEditor||r._startingEditing){r._editChar=l;setTimeout((function(){t.activeEditor||(r._editChar=null)}),0)}else r._editChar&&(r._editChar+=l)}),!0);t.hostElement.addEventListener("compositionstart",(function(e){r._composing=!0}),!0);t.hostElement.addEventListener("compositionend",(function(e){r._composing=!1}),!0);return l}DirectiveCellFactoryBase.prototype.updateCell=function(e,t,l,i,r){var o=this;this._cellStampCounter=(this._cellStampCounter+1)%1e7;var n=i[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;i.style.overflow&&(i.style.overflow="");var a=t,s=l;if(r&&!r.isSingleCell){t=r.row;l=r.col}var c,d=this,p=e.grid,u=p.editRange,C=e.rows[t],m=C.dataItem,f=!1,y=!1,v=!1,g=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(u&&u.row===t&&u.col===l){c=GridCellTemplateType.CellEdit;y=v=!0}else if(C instanceof wjcGrid.GroupRow){var _=!((g=m instanceof wjcCore.CollectionViewGroup)||C.hasChildren);if(l==e.columns.firstVisibleIndex)c=_?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{c=_?GridCellTemplateType.Cell:GridCellTemplateType.Group;y=!0}}else C instanceof wjcGrid._NewRowTemplate?c=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&C instanceof softGridDetail().DetailRow||(c=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:c=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:c=p.collectionView&&p.collectionView.currentEditItem===m?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;f=!0;break;case wjcGrid.CellType.TopLeft:c=GridCellTemplateType.TopLeft;f=!0;break;case wjcGrid.CellType.ColumnFooter:c=GridCellTemplateType.ColumnFooter;y=!0;break;case wjcGrid.CellType.BottomLeft:c=GridCellTemplateType.BottomLeft;f=!0}var h=!!g&&C.isSummary,w=g&&(p.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||p.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!C.isCollapsed),E=!1;if(null!=c){var T=null;g&&c==GridCellTemplateType.GroupHeader?T=p.getColumn(m.groupDescription.propertyName):l>=0&&l<e.columns.length&&(T=e.cellType===wjcGrid.CellType.ColumnHeader&&p._hasColumnGroups()?p._getColumnGroup(t,l):p._getBindingColumn(e,t,e.columns[l]));if(T){var F=DirectiveCellFactoryBase.getTemplContextProp,G=F(c),D=(f?p:T)[G];if(!D)if(c===GridCellTemplateType.RowHeaderEdit){G=F(c=GridCellTemplateType.RowHeader);D=p[G]}else if((c===GridCellTemplateType.Group||c===GridCellTemplateType.GroupHeader)&&!g){G=F(c=GridCellTemplateType.Cell);D=T[G]}if(D){var j,B;if(y){j=e.getCellData(t,l,!1);B=e.getCellData(t,l,!0)}E=!0;var H=i.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),I=H&&"true"===H.toLowerCase();if(v){this.clearCell(i);this._baseCf.updateCell(e,a,s,i,r,!0)}var S,R=v&&p.imeEnabled,b=R&&this._composing,x=i[G],L={cell:i,column:T,row:C,panel:e,rng:r,isEdit:v,isImeInput:R,isTrueImeInput:b,templateContext:D,templateCache:x,templateContextProperty:G,cellStamp:n,cellValue:j,cellValueFormatted:B},V=this.shouldInstantiate(L),A=!0;g&&!h&&l!=e.columns.firstVisibleIndex&&w&&(A=!1);if(V){if(v){var k=i.firstElementChild;if(k){R||i.focus();k.style.display="none"}}else this.clearCell(i);this._doDisposeCell(i);if(A){this.renderTemplate(L,!0);L.templateCache=x=i[G]}else this._doDisposeCell(i);S=L.cellBindingsData}else{A?this.renderTemplate(L,!1):this._doDisposeCell(i);S=L.cellBindingsData}D.cellOverflow&&(i.style.overflow=D.cellOverflow);I?this.applyImmediately(L):D.autoSizeRows&&!R?this.checkHeight(L):v&&setTimeout((function(){R?o._initImeEditInput(L.cell,D):o._initEditInput(L.cell,D,null)}),0);if(v){d._cellEditorVars=S.localVars;var editEndingEH=function(e,t){p.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){var l=wjcCore.getActiveElement();l&&l.dispatchEvent(d._evtBlur);wjcCore.contains(i,wjcCore.getActiveElement())&&i.focus()}d._triggerEditorEvents(i);if(!t.cancel&&!t.stayInEditMode)for(var r=S.localVars,o=0,n=Object.getOwnPropertyNames(S.bindings);o<n.length;o++){var a=n[o];S.bindings[a].setValue(r,S.localVars.values[a])}var s=i.querySelectorAll(".wj-dropdown");[].forEach.call(s,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))},editEndedEH_1=function(e,t){p.cellEditEnded.removeHandler(editEndedEH_1);d._cellEditorVars=null};p.cellEditEnding.addHandler(editEndingEH);p.cellEditEnded.addHandler(editEndedEH_1)}else this._baseCf.updateCell(e,a,s,i,r,!1)}}}if(!E){this._doDisposeCell(i);this._baseCf.updateCell(e,a,s,i,r)}};DirectiveCellFactoryBase.prototype.getEditorValue=function(t){if(this._cellEditorVars){var l=t.editRange;l&&l.isValid&&this._triggerEditorEvents(t.cells.getCellElement(l.row,l.col));return this._cellEditorVars.value}return e.prototype.getEditorValue.call(this,t)};DirectiveCellFactoryBase.prototype.disposeCell=function(e){this._doDisposeCell(e)};DirectiveCellFactoryBase.prototype.disposeTemplate=function(e,t,l){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}};DirectiveCellFactoryBase.prototype.setBindingsData=function(e,t,l,i,r,o){e.row=t;e.col=l;e.item=i;var n={},a=e.cell||{},s={},c={localVars:a,bindings:s};a.row=t;a.col=l;a.item=i;a.value=r;a.valueFormatted=e.cellValueFormatted;a.values=n;if(o)for(var d=0,p=Object.getOwnPropertyNames(o);d<p.length;d++){var u=p[d],C=new wjcCore.Binding(o[u]);s[u]=C;n[u]=C.getValue(a)}e.cell!==a&&(e.cell=a);return c};DirectiveCellFactoryBase.prototype.checkHeight=function(e){var t=this;this._isCheckingHeight||setTimeout((function(){var l=e.cell;if(e.cellStamp===l[DirectiveCellFactoryBase._cellStampProp]){var i=l.scrollHeight,r=e.panel.rows,o=e.row.index,n=e.rng,a=n&&n.rowSpan||1,s=e.isEdit;null!=r.maxSize&&(i=Math.min(i,r.maxSize));if(o<r.length&&r[o].renderHeight*a<i-1){var c=i/a;if(s){var d=t._isFullEdit(),p=t.grid;t._backupHeight=e.row.height;e.row.height=c;t._cacheRow=e.row;t._isCheckingHeight=!0;p.refresh();p.startEditing(d);t._isCheckingHeight=!1}}s&&(e.isImeInput?t._initImeEditInput(e.cell,e.templateContext):t._initEditInput(e.cell,e.templateContext,null))}}),0)};DirectiveCellFactoryBase.prototype._restoreRowHeight=function(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}};DirectiveCellFactoryBase.prototype.doDisposeCell=function(e){for(var t=DirectiveCellFactoryBase._templateTypes,l=0;l<t.length;l++){var i=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[l]]),r=e[i];if(r){var o=(r.column||this.grid)[i];this.disposeTemplate(e,r,o);t[l]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}};DirectiveCellFactoryBase.getTemplContextProp=function(e){return"$__cellTempl"+GridCellTemplateType[e]};DirectiveCellFactoryBase.prototype._doDisposeCell=function(e){this.doDisposeCell(e)};DirectiveCellFactoryBase.prototype._initEditInput=function(e,t,l){var i=this;this.setEditorFocusFlag(!0);var r=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);r&&setTimeout((function(){var t=i._findInitialInput(e);if(t){var inpFocusEh=function(){t.removeEventListener("focus",inpFocusEh);setTimeout((function(){setTimeout((function(){var e=null!=l?l:i._editChar;if(e){t.value=e;i._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(i._evtInput)}}),0)}),DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}}),100)};DirectiveCellFactoryBase.prototype._initImeEditInput=function(e,t){var l=this,i=wjcCore.getActiveElement();if(i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&wjcCore.hasClass(i,"wj-grid-ime")){var r=this._findInitialInput(e),o=r&&r.style.color,n=this._composing,compEndEh_1=function(){i.removeEventListener("compositionend",compEndEh_1);wjcCore.setCss(i,wjcGrid._ImeHandler._cssHidden);l.setEditorFocusFlag(!0);r&&(r.style.color=o);l._initEditInput(e,t,n?i.value:null)};if(n){i.addEventListener("compositionend",compEndEh_1);if(r){var a=r.getBoundingClientRect(),s=i.getBoundingClientRect(),c=window.getComputedStyle(i),d=parseFloat(c.left),p=parseFloat(c.top);wjcCore.setCss(i,{left:d+a.left-s.left+"px",top:p+a.top-s.top+"px",width:a.width+"px",height:a.height+"px"});r.style.color="transparent"}}else setTimeout((function(){return compEndEh_1()}),DirectiveCellFactoryBase._FOCUS_INTERVAL)}};DirectiveCellFactoryBase.prototype._findInitialInput=function(e){var t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var l=0;l<t.length;l++){var i=t[l],r=window.getComputedStyle(i);if("none"!==r.display&&"visible"===r.visibility)return i}return null};DirectiveCellFactoryBase._setSelectionRange=function(e,t,l){void 0===l&&(l=t);if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(l),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}};DirectiveCellFactoryBase.prototype._triggerEditorEvents=function(e){if(e)for(var t=e.querySelectorAll(".wj-control"),l=0;l<t.length;l++){var i=t[l],r=wjcCore.Control.getControl(i);r&&this.flushPendingEvents(r)}};DirectiveCellFactoryBase.prototype._isFullEdit=function(){var e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit};DirectiveCellFactoryBase.prototype._setFullEdit=function(e){var t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)};DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;return DirectiveCellFactoryBase}(wjcGrid.CellFactory);export{DirectiveCellFactoryBase};__gridCFRef||(window.wijmo.grid=null);export var GridCellTemplateType;!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType||(GridCellTemplateType={}));_registerModule("wijmo.interop.grid",selfModule);
var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();import{_getModule,_registerModule}from"@grapecity/wijmo";import*as wjcCore from"@grapecity/wijmo";import*as wjcGrid from"@grapecity/wijmo.grid";import*as selfModule from"@grapecity/wijmo.interop.grid";export function softInput(){return _getModule("wijmo.input")}export function softGridDetail(){return _getModule("wijmo.grid.detail")}var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}var DirectiveCellFactoryBase=function(e){__extends(DirectiveCellFactoryBase,e);function DirectiveCellFactoryBase(t){var i=e.call(this)||this;i._lastApplyTimeStamp=0;i._noApplyLag=!1;i._startingEditing=!1;i._cellStampCounter=0;i._composing=!1;i._autoSizeCache={};i._isCheckingHeight=!1;i._backupHeight=-1;i._cacheRow=null;i.grid=t;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var l in GridCellTemplateType)isNaN(l)&&DirectiveCellFactoryBase._templateTypes.push(l)}var r=i;i._baseCf=t.cellFactory;t.cellFactory=i;i._evtInput=document.createEvent("HTMLEvents");i._evtInput.initEvent("input",!0,!1);i._evtBlur=document.createEvent("HTMLEvents");i._evtBlur.initEvent("blur",!1,!1);t.prepareCellForEdit.addHandler((function(e,t){r._noApplyLag=!0}));t.cellEditEnded.addHandler((function(e,i){var l=i.range,o=l.col;(o<0||o<t.columns.length&&!t._getBindingColumn(t.cells,l.row,t.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(r._editChar=null);setTimeout((function(){r._noApplyLag=!1}),300)}));t.beginningEdit.addHandler((function(e,t){r._startingEditing=!0}));t.hostElement.addEventListener("keydown",(function(e){r._startingEditing=!1}),!0);t.hostElement.addEventListener("keypress",(function(e){var i=e.charCode>32?String.fromCharCode(e.charCode):null;if(i&&wjcCore.closest(e.target,".wj-flexgrid")===t.hostElement)if(!t.activeEditor||r._startingEditing){r._editChar=i;setTimeout((function(){t.activeEditor||(r._editChar=null)}),0)}else r._editChar&&(r._editChar+=i)}),!0);t.hostElement.addEventListener("compositionstart",(function(e){r._composing=!0}),!0);t.hostElement.addEventListener("compositionend",(function(e){r._composing=!1}),!0);t.updatedView.addHandler((function(e,t){i._updatedViewHandler()}));return i}DirectiveCellFactoryBase.prototype._updatedViewHandler=function(){var e=this;queueMicrotask((function(){e._autoSizeIfRequired()}))};DirectiveCellFactoryBase.prototype.canRender=function(e){return!!e};DirectiveCellFactoryBase.prototype.updateCell=function(e,t,i,l,r){this._cellStampCounter=(this._cellStampCounter+1)%1e7;l[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;l.style.overflow&&(l.style.overflow="");var o=t,a=i;if(r&&!r.isSingleCell){t=r.row;i=r.col}var n,s=e.grid,c=s.editRange,d=e.rows[t],p=d.dataItem,u=!1,C=!1,h=!1,g=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(c&&c.row===t&&c.col===i){n=GridCellTemplateType.CellEdit;C=h=!0}else if(d instanceof wjcGrid.GroupRow){var m=!((g=p instanceof wjcCore.CollectionViewGroup)||d.hasChildren);if(i==e.columns.firstVisibleIndex)n=m?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{n=m?GridCellTemplateType.Cell:GridCellTemplateType.Group;C=!0}}else d instanceof wjcGrid._NewRowTemplate?n=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&d instanceof softGridDetail().DetailRow||(n=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:n=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:n=s.collectionView&&s.collectionView.currentEditItem===p?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;u=!0;break;case wjcGrid.CellType.TopLeft:n=GridCellTemplateType.TopLeft;u=!0;break;case wjcGrid.CellType.ColumnFooter:n=GridCellTemplateType.ColumnFooter;C=!0;break;case wjcGrid.CellType.BottomLeft:n=GridCellTemplateType.BottomLeft;u=!0}var f=!1;if(null!=n){var _=null;g&&n==GridCellTemplateType.GroupHeader?_=s.getColumn(p.groupDescription.propertyName):i>=0&&i<e.columns.length&&(_=e.cellType===wjcGrid.CellType.ColumnHeader&&s._hasColumnGroups()?s._getColumnGroup(t,i):s._getBindingColumn(e,t,e.columns[i]));if(_){var y=DirectiveCellFactoryBase.getTemplContextProp,v=y(n),w=(u?s:_)[v];w||(n===GridCellTemplateType.RowHeaderEdit?w=s[v=y(n=GridCellTemplateType.RowHeader)]:n!==GridCellTemplateType.Group&&n!==GridCellTemplateType.GroupHeader||g||(w=_[v=y(n=GridCellTemplateType.Cell)]));w&&this.canRender(w)&&(f=this._processTemplate(e,t,i,l,w,{needCellValue:C,isCvGroup:g,isEdit:h,riOriginal:o,ciOriginal:a,rng:r,templContextProp:v,col:_,row:d}))}}if(!f){this._doDisposeCell(l);this._baseCf.updateCell(e,o,a,l,r)}};DirectiveCellFactoryBase.prototype._processTemplate=function(e,t,i,l,r,o){var a,n,s=this,c=o.needCellValue,d=o.isCvGroup,p=o.isEdit,u=e.grid,C=o.row,h=o.col,g=o.riOriginal,m=o.ciOriginal,f=o.rng,_=o.templContextProp,y=l[DirectiveCellFactoryBase._cellStampProp],v=this;if(c){a=e.getCellData(t,i,!1);n=e.getCellData(t,i,!0)}var w=!!d&&C.isSummary,E=d&&(u.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||u.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!C.isCollapsed),T=l.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),S=T&&"true"===T.toLowerCase();if(p){this.clearCell(l);this._baseCf.updateCell(e,g,m,l,f,!0)}var F,H=p&&u.imeEnabled,G=H&&this._composing,D=l[_],B={cell:l,column:h,row:C,panel:e,rng:f,isEdit:p,isImeInput:H,isTrueImeInput:G,templateContext:r,templateCache:D,templateContextProperty:_,cellStamp:y,cellValue:a,cellValueFormatted:n},j=this.shouldInstantiate(B),z=!0;d&&!w&&i!=e.columns.firstVisibleIndex&&E&&(z=!1);if(j){if(p){var R=l.firstElementChild;if(R){H||l.focus();R.style.display="none"}}else this.clearCell(l);this._doDisposeCell(l);if(z){this.renderTemplate(B,!0);B.templateCache=D=l[_]}F=B.cellBindingsData}else{z?this.renderTemplate(B,!1):this._doDisposeCell(l);F=B.cellBindingsData}r.cellOverflow&&(l.style.overflow=r.cellOverflow);S?this.applyImmediately(B):r.autoSizeRows&&!H&&this._markForAutoSize(t,i,e);if(p){z&&queueMicrotask((function(){s._updateEditRowSize(e,t,i,l)}));setTimeout((function(){H?s._initImeEditInput(B.cell,r):s._initEditInput(B.cell,r,null)}),0)}if(p){v._cellEditorVars=F.localVars;var editEndingEH=function(e,t){u.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){var i=wjcCore.getActiveElement();i&&i.dispatchEvent(v._evtBlur);wjcCore.contains(l,wjcCore.getActiveElement())&&l.focus()}v._triggerEditorEvents(l);if(!t.cancel&&!t.stayInEditMode)for(var r=F.localVars,o=0,a=Object.getOwnPropertyNames(F.bindings);o<a.length;o++){var n=a[o];F.bindings[n].setValue(r,F.localVars.values[n])}var s=l.querySelectorAll(".wj-dropdown");[].forEach.call(s,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))},editEndedEH_1=function(e,t){u.cellEditEnded.removeHandler(editEndedEH_1);v._cellEditorVars=null};u.cellEditEnding.addHandler(editEndingEH);u.cellEditEnded.addHandler(editEndedEH_1)}else this._baseCf.updateCell(e,g,m,l,f,!1);return!0};DirectiveCellFactoryBase.prototype._updateEditRowSize=function(e,t,i,l){var r=this,o=e.rows[t],a=this.getHeight(e,t,i,l),n=0;if(this.grid.rowHeaders.columns[0]&&this.grid.rowHeaders.columns[0].isVisible)try{n=this.getHeight(this.grid.rowHeaders,t,0,this.grid.rowHeaders.getCellElement(t,0))}catch(e){}n>a&&(a=n);if(!o.resizedManually&&a>o.renderHeight){var s=o.height;o.height=a;if(this.grid._toInv){clearTimeout(this.grid._toInv);this.grid._listenResizeEvents=!1;this.grid.refreshCells(!0);setTimeout((function(){r.grid._listenResizeEvents=!0}))}var endedHandler_1=function(e,i){o._editHandler=null;e.rowEditEnded.removeHandler(endedHandler_1);e.rows[t]&&(e.rows[t].height=s||null)};if(!o._editHandler){o._editHandler=endedHandler_1;this.grid.rowEditEnded.addHandler(endedHandler_1)}}};DirectiveCellFactoryBase.prototype._autoSizePanelCells=function(e,t,i){for(var l,r=!1,o=0,a=!1,n=e.grid.editableCollectionView&&e.grid.editableCollectionView.currentEditItem,s=0,c=e.columns;s<c.length;s++){c[s].isVisible&&o++}for(var d=0,p=t.columns;d<p.length;d++){if(p[d].isVisible){a=!0;break}}var u=e.rows.defaultSize;for(l in i){l=parseInt(l);if(e.rows[l]&&(!n||e.rows[l].dataItem!==n)&&(!e.rows[l].resizedManually&&null==e.rows[l].detail)){for(var C=Array.from(i[l].rowHeader),h=Array.from(i[l].cell),g=-1,m=0,f=C;m<f.length;m++){var _=f[m];if((w=t.getCellElement(l,_))&&(!w.$__cellTemplRowHeaderEdit||w.$__cellTemplRowHeaderEdit&&n)){(E=this.getHeight(t,l,_,w))>g&&(g=E)}}for(var y=0,v=h;y<v.length;y++){var w;_=v[y];if(w=e.getCellElement(l,_)){var E;(E=this.getHeight(e,l,_,w))>g&&(g=E)}}h.length!=o&&u>g&&(g=u);e.grid.headersVisibility&wjcGrid.HeadersVisibility.Row&&a&&0===C.length&&u>g&&(g=u);if(g>-1&&Math.abs(e.rows[l].height-g)>1){e.rows[l].height=g;r=!0}}}return r};DirectiveCellFactoryBase.prototype.getHeight=function(e,t,i,l){var r=l.scrollHeight,o=e.rows,a=e.grid.getMergedRange(e,t,i,!1),n=a&&a.rowSpan||1;if(l.firstElementChild){var s=getComputedStyle(l),c=l.firstElementChild.scrollHeight+(parseInt(s.paddingTop)||0)+(parseInt(s.paddingBottom)||0);l.firstElementChild.childNodes.length>0&&0!=l.firstElementChild.scrollHeight&&(r=c)}null!=o.maxSize&&(r=Math.min(r,o.maxSize));return r/n};DirectiveCellFactoryBase.prototype._autoSizeIfRequired=function(){var e=this.grid.editRange;if(e&&this.grid.columns[e.col]||this.grid._mouseHdl._isDown&&this.grid._mouseHdl._szArgs)this._autoSizeCache={};else{var t=this.grid.viewRange;if(this._autoSizeCache&&this._autoSizeCache.pendingCells)for(var i=t.topRow;i<=t.bottomRow;i++){if(this._autoSizeCache.pendingCells.cells&&this._autoSizeCache.pendingCells.cells[i]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.headers&&this._autoSizeCache.pendingCells.headers[i]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.footers&&this._autoSizeCache.pendingCells.footers[i]){this._autoSizePendingCells();return}}}};DirectiveCellFactoryBase.prototype._autoSizePendingCells=function(){var e=!1,t=!1,i=!1;try{this.grid.beginUpdate();if(!this._autoSizeCache||!this._autoSizeCache.pendingCells)return;this._autoSizeCache.pendingCells.headers&&(e=this._autoSizePanelCells(this.grid.columnHeaders,this.grid.topLeftCells,this._autoSizeCache.pendingCells.headers));this._autoSizeCache.pendingCells.cells&&(t=this._autoSizePanelCells(this.grid.cells,this.grid.rowHeaders,this._autoSizeCache.pendingCells.cells));this._autoSizeCache.pendingCells.footers&&(i=this._autoSizePanelCells(this.grid.columnFooters,this.grid.bottomLeftCells,this._autoSizeCache.pendingCells.footers));this._autoSizeCache={}}finally{this.grid.endUpdate(e||t||i)}};DirectiveCellFactoryBase.prototype._markForAutoSize=function(e,t,i){var l,r=!1;this._autoSizeCache.pendingCells||(this._autoSizeCache.pendingCells={});switch(i.cellType){case wjcGrid.CellType.TopLeft:r=!0;case wjcGrid.CellType.ColumnHeader:this._autoSizeCache.pendingCells.headers||(this._autoSizeCache.pendingCells.headers={});l=this._autoSizeCache.pendingCells.headers;break;case wjcGrid.CellType.RowHeader:r=!0;case wjcGrid.CellType.Cell:this._autoSizeCache.pendingCells.cells||(this._autoSizeCache.pendingCells.cells={});l=this._autoSizeCache.pendingCells.cells;break;case wjcGrid.CellType.BottomLeft:r=!0;case wjcGrid.CellType.ColumnFooter:this._autoSizeCache.pendingCells.footers||(this._autoSizeCache.pendingCells.footers={});l=this._autoSizeCache.pendingCells.footers;break;default:return}l[e]||(l[e]={rowHeader:new Set,cell:new Set});r?l[e].rowHeader.add(t):l[e].cell.add(t)};DirectiveCellFactoryBase.prototype.getEditorValue=function(t){if(this._cellEditorVars){var i=t.editRange;i&&i.isValid&&this._triggerEditorEvents(t.cells.getCellElement(i.row,i.col));return this._cellEditorVars.value}return e.prototype.getEditorValue.call(this,t)};DirectiveCellFactoryBase.prototype.disposeCell=function(e){this._doDisposeCell(e)};DirectiveCellFactoryBase.prototype.disposeTemplate=function(e,t,i){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}};DirectiveCellFactoryBase.prototype.setBindingsData=function(e,t,i,l,r,o){e.row=t;e.col=i;e.item=l;var a={},n=e.cell||{},s={},c={localVars:n,bindings:s};n.row=t;n.col=i;n.item=l;n.value=r;n.valueFormatted=e.cellValueFormatted;n.values=a;if(o)for(var d=0,p=Object.getOwnPropertyNames(o);d<p.length;d++){var u=p[d],C=new wjcCore.Binding(o[u]);s[u]=C;a[u]=C.getValue(n)}e.cell!==n&&(e.cell=n);return c};DirectiveCellFactoryBase.prototype.checkHeight=function(e){var t=this;this._isCheckingHeight||setTimeout((function(){var i=e.cell;if(e.cellStamp===i[DirectiveCellFactoryBase._cellStampProp]){var l=i.scrollHeight,r=e.panel.rows,o=e.row.index,a=e.rng,n=a&&a.rowSpan||1,s=e.isEdit;null!=r.maxSize&&(l=Math.min(l,r.maxSize));if(o<r.length&&r[o].renderHeight*n<l-1){var c=l/n;if(s){var d=t._isFullEdit(),p=t.grid;t._backupHeight=e.row.height;e.row.height=c;t._cacheRow=e.row;t._isCheckingHeight=!0;p.refresh();p.startEditing(d);t._isCheckingHeight=!1}}s&&(e.isImeInput?t._initImeEditInput(e.cell,e.templateContext):t._initEditInput(e.cell,e.templateContext,null))}}),0)};DirectiveCellFactoryBase.prototype._restoreRowHeight=function(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}};DirectiveCellFactoryBase.prototype.doDisposeCell=function(e){for(var t=DirectiveCellFactoryBase._templateTypes,i=0;i<t.length;i++){var l=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[i]]),r=e[l];if(r){var o=(r.column||this.grid)[l];this.disposeTemplate(e,r,o);t[i]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}};DirectiveCellFactoryBase.getTemplContextProp=function(e){return"$__cellTempl"+GridCellTemplateType[e]};DirectiveCellFactoryBase.prototype._doDisposeCell=function(e){this.doDisposeCell(e)};DirectiveCellFactoryBase.prototype._initEditInput=function(e,t,i){var l=this;this.setEditorFocusFlag(!0);var r=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);if(r){var o=this._findInitialInput(e);if(o){var inpFocusEh=function(){o.removeEventListener("focus",inpFocusEh);setTimeout((function(){var e=null!=i?i:l._editChar;if(e){o.value=e;l._editChar=null;DirectiveCellFactoryBase._setSelectionRange(o,e.length,e.length);o.dispatchEvent(l._evtInput)}}),DirectiveCellFactoryBase._FOCUS_INTERVAL)};o.addEventListener("focus",inpFocusEh);o.focus()}}};DirectiveCellFactoryBase.prototype._initImeEditInput=function(e,t){var i=this,l=wjcCore.getActiveElement();if(l&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&wjcCore.hasClass(l,"wj-grid-ime")){var r=this._findInitialInput(e),o=r&&r.style.color,a=this._composing,compEndEh_1=function(){l.removeEventListener("compositionend",compEndEh_1);wjcCore.setCss(l,wjcGrid._ImeHandler._cssHidden);i.setEditorFocusFlag(!0);r&&(r.style.color=o);i._initEditInput(e,t,a?l.value:null)};if(a){l.addEventListener("compositionend",compEndEh_1);if(r){var n=r.getBoundingClientRect(),s=l.getBoundingClientRect(),c=window.getComputedStyle(l),d=parseFloat(c.left),p=parseFloat(c.top);wjcCore.setCss(l,{left:d+n.left-s.left+"px",top:p+n.top-s.top+"px",width:n.width+"px",height:n.height+"px"});r.style.color="transparent"}}else setTimeout((function(){return compEndEh_1()}),DirectiveCellFactoryBase._FOCUS_INTERVAL)}};DirectiveCellFactoryBase.prototype._findInitialInput=function(e){var t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var i=0;i<t.length;i++){var l=t[i],r=window.getComputedStyle(l);if("none"!==r.display&&"visible"===r.visibility)return l}return null};DirectiveCellFactoryBase._setSelectionRange=function(e,t,i){void 0===i&&(i=t);if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(i),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}};DirectiveCellFactoryBase.prototype._triggerEditorEvents=function(e){if(e)for(var t=e.querySelectorAll(".wj-control"),i=0;i<t.length;i++){var l=t[i],r=wjcCore.Control.getControl(l);r&&this.flushPendingEvents(r)}};DirectiveCellFactoryBase.prototype._isFullEdit=function(){var e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit};DirectiveCellFactoryBase.prototype._setFullEdit=function(e){var t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)};DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;return DirectiveCellFactoryBase}(wjcGrid.CellFactory);export{DirectiveCellFactoryBase};__gridCFRef||(window.wijmo.grid=null);export var GridCellTemplateType;!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType||(GridCellTemplateType={}));_registerModule("wijmo.interop.grid",selfModule);
/*!
*
* Wijmo Library 5.20241.9
* Wijmo Library 5.20241.19
* https://developer.mescius.com/wijmo

@@ -27,2 +27,13 @@ *

export declare function softGridDetail(): typeof mGridDetail;
interface _IProcessTemplateCtx {
needCellValue: boolean;
isCvGroup: boolean;
isEdit: boolean;
riOriginal: number;
ciOriginal: number;
templContextProp: string;
rng?: wjcGrid.CellRange;
row: wjcGrid.Row;
col: wjcGrid.Column;
}
export declare abstract class DirectiveCellFactoryBase extends wjcGrid.CellFactory {

@@ -44,2 +55,3 @@ private static _templateTypes;

private _composing;
private _autoSizeCache;
protected _isCheckingHeight: boolean;

@@ -49,3 +61,12 @@ protected _backupHeight: number;

constructor(grid: wjcGrid.FlexGrid);
protected _updatedViewHandler(): void;
protected canRender(tplCtx: any): boolean;
updateCell(panel: wjcGrid.GridPanel, rowIndex: number, colIndex: number, cell: HTMLElement, rng?: wjcGrid.CellRange): void;
_processTemplate(panel: wjcGrid.GridPanel, rowIndex: number, colIndex: number, cell: HTMLElement, templContext: ICellTemplateInfo, ctx: _IProcessTemplateCtx): boolean;
private _updateEditRowSize;
private _autoSizePanelCells;
protected getHeight(panel: wjcGrid.GridPanel, r: number, c: number, cell: HTMLElement): number;
protected _autoSizeIfRequired(): void;
private _autoSizePendingCells;
private _markForAutoSize;
getEditorValue(g: wjcGrid.FlexGrid): any;

@@ -156,1 +177,2 @@ disposeCell(cell: HTMLElement): void;

}
export {};
/*!
*
* Wijmo Library 5.20241.9
* Wijmo Library 5.20241.19
* https://developer.mescius.com/wijmo

@@ -14,2 +14,2 @@ *

"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var l in e)Object.hasOwnProperty.call(e,l)&&(t[l]=e[l]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@grapecity/wijmo"),wjcCore=__importStar(require("@grapecity/wijmo")),wjcGrid=__importStar(require("@grapecity/wijmo.grid")),selfModule=__importStar(require("@grapecity/wijmo.interop.grid"));function softInput(){return wijmo_1._getModule("wijmo.input")}exports.softInput=softInput;function softGridDetail(){return wijmo_1._getModule("wijmo.grid.detail")}exports.softGridDetail=softGridDetail;var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}var GridCellTemplateType,DirectiveCellFactoryBase=function(e){__extends(DirectiveCellFactoryBase,e);function DirectiveCellFactoryBase(t){var l=e.call(this)||this;l._lastApplyTimeStamp=0;l._noApplyLag=!1;l._startingEditing=!1;l._cellStampCounter=0;l._composing=!1;l._isCheckingHeight=!1;l._backupHeight=-1;l._cacheRow=null;l.grid=t;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var i in GridCellTemplateType)isNaN(i)&&DirectiveCellFactoryBase._templateTypes.push(i)}var r=l;l._baseCf=t.cellFactory;t.cellFactory=l;l._evtInput=document.createEvent("HTMLEvents");l._evtInput.initEvent("input",!0,!1);l._evtBlur=document.createEvent("HTMLEvents");l._evtBlur.initEvent("blur",!1,!1);t.prepareCellForEdit.addHandler((function(e,t){r._noApplyLag=!0}));t.cellEditEnded.addHandler((function(e,l){var i=l.range,o=i.col;(o<0||o<t.columns.length&&!t._getBindingColumn(t.cells,i.row,t.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(r._editChar=null);setTimeout((function(){r._noApplyLag=!1}),300)}));t.beginningEdit.addHandler((function(e,t){r._startingEditing=!0}));t.hostElement.addEventListener("keydown",(function(e){r._startingEditing=!1}),!0);t.hostElement.addEventListener("keypress",(function(e){var l=e.charCode>32?String.fromCharCode(e.charCode):null;if(l&&wjcCore.closest(e.target,".wj-flexgrid")===t.hostElement)if(!t.activeEditor||r._startingEditing){r._editChar=l;setTimeout((function(){t.activeEditor||(r._editChar=null)}),0)}else r._editChar&&(r._editChar+=l)}),!0);t.hostElement.addEventListener("compositionstart",(function(e){r._composing=!0}),!0);t.hostElement.addEventListener("compositionend",(function(e){r._composing=!1}),!0);return l}DirectiveCellFactoryBase.prototype.updateCell=function(e,t,l,i,r){var o=this;this._cellStampCounter=(this._cellStampCounter+1)%1e7;var n=i[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;i.style.overflow&&(i.style.overflow="");var a=t,s=l;if(r&&!r.isSingleCell){t=r.row;l=r.col}var c,p=this,d=e.grid,u=d.editRange,C=e.rows[t],m=C.dataItem,f=!1,_=!1,y=!1,v=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(u&&u.row===t&&u.col===l){c=GridCellTemplateType.CellEdit;_=y=!0}else if(C instanceof wjcGrid.GroupRow){var g=!((v=m instanceof wjcCore.CollectionViewGroup)||C.hasChildren);if(l==e.columns.firstVisibleIndex)c=g?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{c=g?GridCellTemplateType.Cell:GridCellTemplateType.Group;_=!0}}else C instanceof wjcGrid._NewRowTemplate?c=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&C instanceof softGridDetail().DetailRow||(c=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:c=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:c=d.collectionView&&d.collectionView.currentEditItem===m?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;f=!0;break;case wjcGrid.CellType.TopLeft:c=GridCellTemplateType.TopLeft;f=!0;break;case wjcGrid.CellType.ColumnFooter:c=GridCellTemplateType.ColumnFooter;_=!0;break;case wjcGrid.CellType.BottomLeft:c=GridCellTemplateType.BottomLeft;f=!0}var h=!!v&&C.isSummary,w=v&&(d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||d.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!C.isCollapsed),T=!1;if(null!=c){var E=null;v&&c==GridCellTemplateType.GroupHeader?E=d.getColumn(m.groupDescription.propertyName):l>=0&&l<e.columns.length&&(E=e.cellType===wjcGrid.CellType.ColumnHeader&&d._hasColumnGroups()?d._getColumnGroup(t,l):d._getBindingColumn(e,t,e.columns[l]));if(E){var F=DirectiveCellFactoryBase.getTemplContextProp,G=F(c),D=(f?d:E)[G];if(!D)if(c===GridCellTemplateType.RowHeaderEdit){G=F(c=GridCellTemplateType.RowHeader);D=d[G]}else if((c===GridCellTemplateType.Group||c===GridCellTemplateType.GroupHeader)&&!v){G=F(c=GridCellTemplateType.Cell);D=E[G]}if(D){var j,B;if(_){j=e.getCellData(t,l,!1);B=e.getCellData(t,l,!0)}T=!0;var H=i.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),I=H&&"true"===H.toLowerCase();if(y){this.clearCell(i);this._baseCf.updateCell(e,a,s,i,r,!0)}var S,R=y&&d.imeEnabled,b=R&&this._composing,x=i[G],L={cell:i,column:E,row:C,panel:e,rng:r,isEdit:y,isImeInput:R,isTrueImeInput:b,templateContext:D,templateCache:x,templateContextProperty:G,cellStamp:n,cellValue:j,cellValueFormatted:B},V=this.shouldInstantiate(L),P=!0;v&&!h&&l!=e.columns.firstVisibleIndex&&w&&(P=!1);if(V){if(y){var A=i.firstElementChild;if(A){R||i.focus();A.style.display="none"}}else this.clearCell(i);this._doDisposeCell(i);if(P){this.renderTemplate(L,!0);L.templateCache=x=i[G]}else this._doDisposeCell(i);S=L.cellBindingsData}else{P?this.renderTemplate(L,!1):this._doDisposeCell(i);S=L.cellBindingsData}D.cellOverflow&&(i.style.overflow=D.cellOverflow);I?this.applyImmediately(L):D.autoSizeRows&&!R?this.checkHeight(L):y&&setTimeout((function(){R?o._initImeEditInput(L.cell,D):o._initEditInput(L.cell,D,null)}),0);if(y){p._cellEditorVars=S.localVars;var editEndingEH=function(e,t){d.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){var l=wjcCore.getActiveElement();l&&l.dispatchEvent(p._evtBlur);wjcCore.contains(i,wjcCore.getActiveElement())&&i.focus()}p._triggerEditorEvents(i);if(!t.cancel&&!t.stayInEditMode)for(var r=S.localVars,o=0,n=Object.getOwnPropertyNames(S.bindings);o<n.length;o++){var a=n[o];S.bindings[a].setValue(r,S.localVars.values[a])}var s=i.querySelectorAll(".wj-dropdown");[].forEach.call(s,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))},editEndedEH_1=function(e,t){d.cellEditEnded.removeHandler(editEndedEH_1);p._cellEditorVars=null};d.cellEditEnding.addHandler(editEndingEH);d.cellEditEnded.addHandler(editEndedEH_1)}else this._baseCf.updateCell(e,a,s,i,r,!1)}}}if(!T){this._doDisposeCell(i);this._baseCf.updateCell(e,a,s,i,r)}};DirectiveCellFactoryBase.prototype.getEditorValue=function(t){if(this._cellEditorVars){var l=t.editRange;l&&l.isValid&&this._triggerEditorEvents(t.cells.getCellElement(l.row,l.col));return this._cellEditorVars.value}return e.prototype.getEditorValue.call(this,t)};DirectiveCellFactoryBase.prototype.disposeCell=function(e){this._doDisposeCell(e)};DirectiveCellFactoryBase.prototype.disposeTemplate=function(e,t,l){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}};DirectiveCellFactoryBase.prototype.setBindingsData=function(e,t,l,i,r,o){e.row=t;e.col=l;e.item=i;var n={},a=e.cell||{},s={},c={localVars:a,bindings:s};a.row=t;a.col=l;a.item=i;a.value=r;a.valueFormatted=e.cellValueFormatted;a.values=n;if(o)for(var p=0,d=Object.getOwnPropertyNames(o);p<d.length;p++){var u=d[p],C=new wjcCore.Binding(o[u]);s[u]=C;n[u]=C.getValue(a)}e.cell!==a&&(e.cell=a);return c};DirectiveCellFactoryBase.prototype.checkHeight=function(e){var t=this;this._isCheckingHeight||setTimeout((function(){var l=e.cell;if(e.cellStamp===l[DirectiveCellFactoryBase._cellStampProp]){var i=l.scrollHeight,r=e.panel.rows,o=e.row.index,n=e.rng,a=n&&n.rowSpan||1,s=e.isEdit;null!=r.maxSize&&(i=Math.min(i,r.maxSize));if(o<r.length&&r[o].renderHeight*a<i-1){var c=i/a;if(s){var p=t._isFullEdit(),d=t.grid;t._backupHeight=e.row.height;e.row.height=c;t._cacheRow=e.row;t._isCheckingHeight=!0;d.refresh();d.startEditing(p);t._isCheckingHeight=!1}}s&&(e.isImeInput?t._initImeEditInput(e.cell,e.templateContext):t._initEditInput(e.cell,e.templateContext,null))}}),0)};DirectiveCellFactoryBase.prototype._restoreRowHeight=function(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}};DirectiveCellFactoryBase.prototype.doDisposeCell=function(e){for(var t=DirectiveCellFactoryBase._templateTypes,l=0;l<t.length;l++){var i=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[l]]),r=e[i];if(r){var o=(r.column||this.grid)[i];this.disposeTemplate(e,r,o);t[l]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}};DirectiveCellFactoryBase.getTemplContextProp=function(e){return"$__cellTempl"+GridCellTemplateType[e]};DirectiveCellFactoryBase.prototype._doDisposeCell=function(e){this.doDisposeCell(e)};DirectiveCellFactoryBase.prototype._initEditInput=function(e,t,l){var i=this;this.setEditorFocusFlag(!0);var r=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);r&&setTimeout((function(){var t=i._findInitialInput(e);if(t){var inpFocusEh=function(){t.removeEventListener("focus",inpFocusEh);setTimeout((function(){setTimeout((function(){var e=null!=l?l:i._editChar;if(e){t.value=e;i._editChar=null;DirectiveCellFactoryBase._setSelectionRange(t,e.length,e.length);t.dispatchEvent(i._evtInput)}}),0)}),DirectiveCellFactoryBase._FOCUS_INTERVAL)};t.addEventListener("focus",inpFocusEh);t.focus()}}),100)};DirectiveCellFactoryBase.prototype._initImeEditInput=function(e,t){var l=this,i=wjcCore.getActiveElement();if(i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&wjcCore.hasClass(i,"wj-grid-ime")){var r=this._findInitialInput(e),o=r&&r.style.color,n=this._composing,compEndEh_1=function(){i.removeEventListener("compositionend",compEndEh_1);wjcCore.setCss(i,wjcGrid._ImeHandler._cssHidden);l.setEditorFocusFlag(!0);r&&(r.style.color=o);l._initEditInput(e,t,n?i.value:null)};if(n){i.addEventListener("compositionend",compEndEh_1);if(r){var a=r.getBoundingClientRect(),s=i.getBoundingClientRect(),c=window.getComputedStyle(i),p=parseFloat(c.left),d=parseFloat(c.top);wjcCore.setCss(i,{left:p+a.left-s.left+"px",top:d+a.top-s.top+"px",width:a.width+"px",height:a.height+"px"});r.style.color="transparent"}}else setTimeout((function(){return compEndEh_1()}),DirectiveCellFactoryBase._FOCUS_INTERVAL)}};DirectiveCellFactoryBase.prototype._findInitialInput=function(e){var t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var l=0;l<t.length;l++){var i=t[l],r=window.getComputedStyle(i);if("none"!==r.display&&"visible"===r.visibility)return i}return null};DirectiveCellFactoryBase._setSelectionRange=function(e,t,l){void 0===l&&(l=t);if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(l),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}};DirectiveCellFactoryBase.prototype._triggerEditorEvents=function(e){if(e)for(var t=e.querySelectorAll(".wj-control"),l=0;l<t.length;l++){var i=t[l],r=wjcCore.Control.getControl(i);r&&this.flushPendingEvents(r)}};DirectiveCellFactoryBase.prototype._isFullEdit=function(){var e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit};DirectiveCellFactoryBase.prototype._setFullEdit=function(e){var t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)};DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;return DirectiveCellFactoryBase}(wjcGrid.CellFactory);exports.DirectiveCellFactoryBase=DirectiveCellFactoryBase;__gridCFRef||(window.wijmo.grid=null);!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType=exports.GridCellTemplateType||(exports.GridCellTemplateType={}));wijmo_1._registerModule("wijmo.interop.grid",selfModule);
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@grapecity/wijmo"),wjcCore=__importStar(require("@grapecity/wijmo")),wjcGrid=__importStar(require("@grapecity/wijmo.grid")),selfModule=__importStar(require("@grapecity/wijmo.interop.grid"));function softInput(){return wijmo_1._getModule("wijmo.input")}exports.softInput=softInput;function softGridDetail(){return wijmo_1._getModule("wijmo.grid.detail")}exports.softGridDetail=softGridDetail;var __gridCFRef=wjcGrid&&wjcGrid.CellFactory;if(!__gridCFRef){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}var GridCellTemplateType,DirectiveCellFactoryBase=function(e){__extends(DirectiveCellFactoryBase,e);function DirectiveCellFactoryBase(t){var i=e.call(this)||this;i._lastApplyTimeStamp=0;i._noApplyLag=!1;i._startingEditing=!1;i._cellStampCounter=0;i._composing=!1;i._autoSizeCache={};i._isCheckingHeight=!1;i._backupHeight=-1;i._cacheRow=null;i.grid=t;if(!DirectiveCellFactoryBase._templateTypes){DirectiveCellFactoryBase._templateTypes=[];for(var l in GridCellTemplateType)isNaN(l)&&DirectiveCellFactoryBase._templateTypes.push(l)}var r=i;i._baseCf=t.cellFactory;t.cellFactory=i;i._evtInput=document.createEvent("HTMLEvents");i._evtInput.initEvent("input",!0,!1);i._evtBlur=document.createEvent("HTMLEvents");i._evtBlur.initEvent("blur",!1,!1);t.prepareCellForEdit.addHandler((function(e,t){r._noApplyLag=!0}));t.cellEditEnded.addHandler((function(e,i){var l=i.range,o=l.col;(o<0||o<t.columns.length&&!t._getBindingColumn(t.cells,l.row,t.columns[o])[DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType.CellEdit)])&&(r._editChar=null);setTimeout((function(){r._noApplyLag=!1}),300)}));t.beginningEdit.addHandler((function(e,t){r._startingEditing=!0}));t.hostElement.addEventListener("keydown",(function(e){r._startingEditing=!1}),!0);t.hostElement.addEventListener("keypress",(function(e){var i=e.charCode>32?String.fromCharCode(e.charCode):null;if(i&&wjcCore.closest(e.target,".wj-flexgrid")===t.hostElement)if(!t.activeEditor||r._startingEditing){r._editChar=i;setTimeout((function(){t.activeEditor||(r._editChar=null)}),0)}else r._editChar&&(r._editChar+=i)}),!0);t.hostElement.addEventListener("compositionstart",(function(e){r._composing=!0}),!0);t.hostElement.addEventListener("compositionend",(function(e){r._composing=!1}),!0);t.updatedView.addHandler((function(e,t){i._updatedViewHandler()}));return i}DirectiveCellFactoryBase.prototype._updatedViewHandler=function(){var e=this;queueMicrotask((function(){e._autoSizeIfRequired()}))};DirectiveCellFactoryBase.prototype.canRender=function(e){return!!e};DirectiveCellFactoryBase.prototype.updateCell=function(e,t,i,l,r){this._cellStampCounter=(this._cellStampCounter+1)%1e7;l[DirectiveCellFactoryBase._cellStampProp]=this._cellStampCounter;l.style.overflow&&(l.style.overflow="");var o=t,a=i;if(r&&!r.isSingleCell){t=r.row;i=r.col}var n,s=e.grid,c=s.editRange,d=e.rows[t],p=d.dataItem,u=!1,C=!1,h=!1,g=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(c&&c.row===t&&c.col===i){n=GridCellTemplateType.CellEdit;C=h=!0}else if(d instanceof wjcGrid.GroupRow){var m=!((g=p instanceof wjcCore.CollectionViewGroup)||d.hasChildren);if(i==e.columns.firstVisibleIndex)n=m?GridCellTemplateType.Cell:GridCellTemplateType.GroupHeader;else{n=m?GridCellTemplateType.Cell:GridCellTemplateType.Group;C=!0}}else d instanceof wjcGrid._NewRowTemplate?n=GridCellTemplateType.NewCellTemplate:softGridDetail()&&softGridDetail().DetailRow&&d instanceof softGridDetail().DetailRow||(n=GridCellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:n=GridCellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:n=s.collectionView&&s.collectionView.currentEditItem===p?GridCellTemplateType.RowHeaderEdit:GridCellTemplateType.RowHeader;u=!0;break;case wjcGrid.CellType.TopLeft:n=GridCellTemplateType.TopLeft;u=!0;break;case wjcGrid.CellType.ColumnFooter:n=GridCellTemplateType.ColumnFooter;C=!0;break;case wjcGrid.CellType.BottomLeft:n=GridCellTemplateType.BottomLeft;u=!0}var f=!1;if(null!=n){var _=null;g&&n==GridCellTemplateType.GroupHeader?_=s.getColumn(p.groupDescription.propertyName):i>=0&&i<e.columns.length&&(_=e.cellType===wjcGrid.CellType.ColumnHeader&&s._hasColumnGroups()?s._getColumnGroup(t,i):s._getBindingColumn(e,t,e.columns[i]));if(_){var y=DirectiveCellFactoryBase.getTemplContextProp,v=y(n),w=(u?s:_)[v];w||(n===GridCellTemplateType.RowHeaderEdit?w=s[v=y(n=GridCellTemplateType.RowHeader)]:n!==GridCellTemplateType.Group&&n!==GridCellTemplateType.GroupHeader||g||(w=_[v=y(n=GridCellTemplateType.Cell)]));w&&this.canRender(w)&&(f=this._processTemplate(e,t,i,l,w,{needCellValue:C,isCvGroup:g,isEdit:h,riOriginal:o,ciOriginal:a,rng:r,templContextProp:v,col:_,row:d}))}}if(!f){this._doDisposeCell(l);this._baseCf.updateCell(e,o,a,l,r)}};DirectiveCellFactoryBase.prototype._processTemplate=function(e,t,i,l,r,o){var a,n,s=this,c=o.needCellValue,d=o.isCvGroup,p=o.isEdit,u=e.grid,C=o.row,h=o.col,g=o.riOriginal,m=o.ciOriginal,f=o.rng,_=o.templContextProp,y=l[DirectiveCellFactoryBase._cellStampProp],v=this;if(c){a=e.getCellData(t,i,!1);n=e.getCellData(t,i,!0)}var w=!!d&&C.isSummary,E=d&&(u.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Bottom||u.groupSummaryPosition===wjcGrid.GroupSummaryPosition.Auto&&!C.isCollapsed),T=l.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),S=T&&"true"===T.toLowerCase();if(p){this.clearCell(l);this._baseCf.updateCell(e,g,m,l,f,!0)}var F,H=p&&u.imeEnabled,G=H&&this._composing,D=l[_],j={cell:l,column:h,row:C,panel:e,rng:f,isEdit:p,isImeInput:H,isTrueImeInput:G,templateContext:r,templateCache:D,templateContextProperty:_,cellStamp:y,cellValue:a,cellValueFormatted:n},B=this.shouldInstantiate(j),z=!0;d&&!w&&i!=e.columns.firstVisibleIndex&&E&&(z=!1);if(B){if(p){var I=l.firstElementChild;if(I){H||l.focus();I.style.display="none"}}else this.clearCell(l);this._doDisposeCell(l);if(z){this.renderTemplate(j,!0);j.templateCache=D=l[_]}F=j.cellBindingsData}else{z?this.renderTemplate(j,!1):this._doDisposeCell(l);F=j.cellBindingsData}r.cellOverflow&&(l.style.overflow=r.cellOverflow);S?this.applyImmediately(j):r.autoSizeRows&&!H&&this._markForAutoSize(t,i,e);if(p){z&&queueMicrotask((function(){s._updateEditRowSize(e,t,i,l)}));setTimeout((function(){H?s._initImeEditInput(j.cell,r):s._initEditInput(j.cell,r,null)}),0)}if(p){v._cellEditorVars=F.localVars;var editEndingEH=function(e,t){u.cellEditEnding.removeHandler(editEndingEH);if(!t.stayInEditMode){var i=wjcCore.getActiveElement();i&&i.dispatchEvent(v._evtBlur);wjcCore.contains(l,wjcCore.getActiveElement())&&l.focus()}v._triggerEditorEvents(l);if(!t.cancel&&!t.stayInEditMode)for(var r=F.localVars,o=0,a=Object.getOwnPropertyNames(F.bindings);o<a.length;o++){var n=a[o];F.bindings[n].setValue(r,F.localVars.values[n])}var s=l.querySelectorAll(".wj-dropdown");[].forEach.call(s,(function(e){var t=wjcCore.Control.getControl(e);t&&softInput()&&t instanceof softInput().DropDown&&(t.isDroppedDown=!1)}))},editEndedEH_1=function(e,t){u.cellEditEnded.removeHandler(editEndedEH_1);v._cellEditorVars=null};u.cellEditEnding.addHandler(editEndingEH);u.cellEditEnded.addHandler(editEndedEH_1)}else this._baseCf.updateCell(e,g,m,l,f,!1);return!0};DirectiveCellFactoryBase.prototype._updateEditRowSize=function(e,t,i,l){var r=this,o=e.rows[t],a=this.getHeight(e,t,i,l),n=0;if(this.grid.rowHeaders.columns[0]&&this.grid.rowHeaders.columns[0].isVisible)try{n=this.getHeight(this.grid.rowHeaders,t,0,this.grid.rowHeaders.getCellElement(t,0))}catch(e){}n>a&&(a=n);if(!o.resizedManually&&a>o.renderHeight){var s=o.height;o.height=a;if(this.grid._toInv){clearTimeout(this.grid._toInv);this.grid._listenResizeEvents=!1;this.grid.refreshCells(!0);setTimeout((function(){r.grid._listenResizeEvents=!0}))}var endedHandler_1=function(e,i){o._editHandler=null;e.rowEditEnded.removeHandler(endedHandler_1);e.rows[t]&&(e.rows[t].height=s||null)};if(!o._editHandler){o._editHandler=endedHandler_1;this.grid.rowEditEnded.addHandler(endedHandler_1)}}};DirectiveCellFactoryBase.prototype._autoSizePanelCells=function(e,t,i){for(var l,r=!1,o=0,a=!1,n=e.grid.editableCollectionView&&e.grid.editableCollectionView.currentEditItem,s=0,c=e.columns;s<c.length;s++){c[s].isVisible&&o++}for(var d=0,p=t.columns;d<p.length;d++){if(p[d].isVisible){a=!0;break}}var u=e.rows.defaultSize;for(l in i){l=parseInt(l);if(e.rows[l]&&(!n||e.rows[l].dataItem!==n)&&(!e.rows[l].resizedManually&&null==e.rows[l].detail)){for(var C=Array.from(i[l].rowHeader),h=Array.from(i[l].cell),g=-1,m=0,f=C;m<f.length;m++){var _=f[m];if((w=t.getCellElement(l,_))&&(!w.$__cellTemplRowHeaderEdit||w.$__cellTemplRowHeaderEdit&&n)){(E=this.getHeight(t,l,_,w))>g&&(g=E)}}for(var y=0,v=h;y<v.length;y++){var w;_=v[y];if(w=e.getCellElement(l,_)){var E;(E=this.getHeight(e,l,_,w))>g&&(g=E)}}h.length!=o&&u>g&&(g=u);e.grid.headersVisibility&wjcGrid.HeadersVisibility.Row&&a&&0===C.length&&u>g&&(g=u);if(g>-1&&Math.abs(e.rows[l].height-g)>1){e.rows[l].height=g;r=!0}}}return r};DirectiveCellFactoryBase.prototype.getHeight=function(e,t,i,l){var r=l.scrollHeight,o=e.rows,a=e.grid.getMergedRange(e,t,i,!1),n=a&&a.rowSpan||1;if(l.firstElementChild){var s=getComputedStyle(l),c=l.firstElementChild.scrollHeight+(parseInt(s.paddingTop)||0)+(parseInt(s.paddingBottom)||0);l.firstElementChild.childNodes.length>0&&0!=l.firstElementChild.scrollHeight&&(r=c)}null!=o.maxSize&&(r=Math.min(r,o.maxSize));return r/n};DirectiveCellFactoryBase.prototype._autoSizeIfRequired=function(){var e=this.grid.editRange;if(e&&this.grid.columns[e.col]||this.grid._mouseHdl._isDown&&this.grid._mouseHdl._szArgs)this._autoSizeCache={};else{var t=this.grid.viewRange;if(this._autoSizeCache&&this._autoSizeCache.pendingCells)for(var i=t.topRow;i<=t.bottomRow;i++){if(this._autoSizeCache.pendingCells.cells&&this._autoSizeCache.pendingCells.cells[i]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.headers&&this._autoSizeCache.pendingCells.headers[i]){this._autoSizePendingCells();return}if(this._autoSizeCache.pendingCells.footers&&this._autoSizeCache.pendingCells.footers[i]){this._autoSizePendingCells();return}}}};DirectiveCellFactoryBase.prototype._autoSizePendingCells=function(){var e=!1,t=!1,i=!1;try{this.grid.beginUpdate();if(!this._autoSizeCache||!this._autoSizeCache.pendingCells)return;this._autoSizeCache.pendingCells.headers&&(e=this._autoSizePanelCells(this.grid.columnHeaders,this.grid.topLeftCells,this._autoSizeCache.pendingCells.headers));this._autoSizeCache.pendingCells.cells&&(t=this._autoSizePanelCells(this.grid.cells,this.grid.rowHeaders,this._autoSizeCache.pendingCells.cells));this._autoSizeCache.pendingCells.footers&&(i=this._autoSizePanelCells(this.grid.columnFooters,this.grid.bottomLeftCells,this._autoSizeCache.pendingCells.footers));this._autoSizeCache={}}finally{this.grid.endUpdate(e||t||i)}};DirectiveCellFactoryBase.prototype._markForAutoSize=function(e,t,i){var l,r=!1;this._autoSizeCache.pendingCells||(this._autoSizeCache.pendingCells={});switch(i.cellType){case wjcGrid.CellType.TopLeft:r=!0;case wjcGrid.CellType.ColumnHeader:this._autoSizeCache.pendingCells.headers||(this._autoSizeCache.pendingCells.headers={});l=this._autoSizeCache.pendingCells.headers;break;case wjcGrid.CellType.RowHeader:r=!0;case wjcGrid.CellType.Cell:this._autoSizeCache.pendingCells.cells||(this._autoSizeCache.pendingCells.cells={});l=this._autoSizeCache.pendingCells.cells;break;case wjcGrid.CellType.BottomLeft:r=!0;case wjcGrid.CellType.ColumnFooter:this._autoSizeCache.pendingCells.footers||(this._autoSizeCache.pendingCells.footers={});l=this._autoSizeCache.pendingCells.footers;break;default:return}l[e]||(l[e]={rowHeader:new Set,cell:new Set});r?l[e].rowHeader.add(t):l[e].cell.add(t)};DirectiveCellFactoryBase.prototype.getEditorValue=function(t){if(this._cellEditorVars){var i=t.editRange;i&&i.isValid&&this._triggerEditorEvents(t.cells.getCellElement(i.row,i.col));return this._cellEditorVars.value}return e.prototype.getEditorValue.call(this,t)};DirectiveCellFactoryBase.prototype.disposeCell=function(e){this._doDisposeCell(e)};DirectiveCellFactoryBase.prototype.disposeTemplate=function(e,t,i){if(t){t.rootElement=null;t.column=null;e[t.templateContextProperty]=null;t.templateContextProperty=null}};DirectiveCellFactoryBase.prototype.setBindingsData=function(e,t,i,l,r,o){e.row=t;e.col=i;e.item=l;var a={},n=e.cell||{},s={},c={localVars:n,bindings:s};n.row=t;n.col=i;n.item=l;n.value=r;n.valueFormatted=e.cellValueFormatted;n.values=a;if(o)for(var d=0,p=Object.getOwnPropertyNames(o);d<p.length;d++){var u=p[d],C=new wjcCore.Binding(o[u]);s[u]=C;a[u]=C.getValue(n)}e.cell!==n&&(e.cell=n);return c};DirectiveCellFactoryBase.prototype.checkHeight=function(e){var t=this;this._isCheckingHeight||setTimeout((function(){var i=e.cell;if(e.cellStamp===i[DirectiveCellFactoryBase._cellStampProp]){var l=i.scrollHeight,r=e.panel.rows,o=e.row.index,a=e.rng,n=a&&a.rowSpan||1,s=e.isEdit;null!=r.maxSize&&(l=Math.min(l,r.maxSize));if(o<r.length&&r[o].renderHeight*n<l-1){var c=l/n;if(s){var d=t._isFullEdit(),p=t.grid;t._backupHeight=e.row.height;e.row.height=c;t._cacheRow=e.row;t._isCheckingHeight=!0;p.refresh();p.startEditing(d);t._isCheckingHeight=!1}}s&&(e.isImeInput?t._initImeEditInput(e.cell,e.templateContext):t._initEditInput(e.cell,e.templateContext,null))}}),0)};DirectiveCellFactoryBase.prototype._restoreRowHeight=function(){if(!this._isCheckingHeight&&this._cacheRow){this._cacheRow.height=this._backupHeight;this._backupHeight=-1;this._cacheRow=null}};DirectiveCellFactoryBase.prototype.doDisposeCell=function(e){for(var t=DirectiveCellFactoryBase._templateTypes,i=0;i<t.length;i++){var l=DirectiveCellFactoryBase.getTemplContextProp(GridCellTemplateType[t[i]]),r=e[l];if(r){var o=(r.column||this.grid)[l];this.disposeTemplate(e,r,o);t[i]==GridCellTemplateType[GridCellTemplateType.CellEdit]&&this._restoreRowHeight()}}};DirectiveCellFactoryBase.getTemplContextProp=function(e){return"$__cellTempl"+GridCellTemplateType[e]};DirectiveCellFactoryBase.prototype._doDisposeCell=function(e){this.doDisposeCell(e)};DirectiveCellFactoryBase.prototype._initEditInput=function(e,t,i){var l=this;this.setEditorFocusFlag(!0);var r=!1!==this.getEditorFocusFlag();this.setEditorFocusFlag(null);this._setFullEdit(t);if(r){var o=this._findInitialInput(e);if(o){var inpFocusEh=function(){o.removeEventListener("focus",inpFocusEh);setTimeout((function(){var e=null!=i?i:l._editChar;if(e){o.value=e;l._editChar=null;DirectiveCellFactoryBase._setSelectionRange(o,e.length,e.length);o.dispatchEvent(l._evtInput)}}),DirectiveCellFactoryBase._FOCUS_INTERVAL)};o.addEventListener("focus",inpFocusEh);o.focus()}}};DirectiveCellFactoryBase.prototype._initImeEditInput=function(e,t){var i=this,l=wjcCore.getActiveElement();if(l&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&wjcCore.hasClass(l,"wj-grid-ime")){var r=this._findInitialInput(e),o=r&&r.style.color,a=this._composing,compEndEh_1=function(){l.removeEventListener("compositionend",compEndEh_1);wjcCore.setCss(l,wjcGrid._ImeHandler._cssHidden);i.setEditorFocusFlag(!0);r&&(r.style.color=o);i._initEditInput(e,t,a?l.value:null)};if(a){l.addEventListener("compositionend",compEndEh_1);if(r){var n=r.getBoundingClientRect(),s=l.getBoundingClientRect(),c=window.getComputedStyle(l),d=parseFloat(c.left),p=parseFloat(c.top);wjcCore.setCss(l,{left:d+n.left-s.left+"px",top:p+n.top-s.top+"px",width:n.width+"px",height:n.height+"px"});r.style.color="transparent"}}else setTimeout((function(){return compEndEh_1()}),DirectiveCellFactoryBase._FOCUS_INTERVAL)}};DirectiveCellFactoryBase.prototype._findInitialInput=function(e){var t=e&&e.rootElement&&e.rootElement.querySelectorAll("input,textarea")||e&&e.querySelectorAll("input,textarea");if(t)for(var i=0;i<t.length;i++){var l=t[i],r=window.getComputedStyle(l);if("none"!==r.display&&"visible"===r.visibility)return l}return null};DirectiveCellFactoryBase._setSelectionRange=function(e,t,i){void 0===i&&(i=t);if(wjcCore.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wjcCore.asNumber(t),wjcCore.asNumber(i),wjcCore.isIE()?null:"backward");e.focus()}catch(e){}};DirectiveCellFactoryBase.prototype._triggerEditorEvents=function(e){if(e)for(var t=e.querySelectorAll(".wj-control"),i=0;i<t.length;i++){var l=t[i],r=wjcCore.Control.getControl(l);r&&this.flushPendingEvents(r)}};DirectiveCellFactoryBase.prototype._isFullEdit=function(){var e=this.grid;return!e.activeEditor||e._edtHdl._fullEdit};DirectiveCellFactoryBase.prototype._setFullEdit=function(e){var t=this.grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)};DirectiveCellFactoryBase._cellStampProp="__wjCellStamp";DirectiveCellFactoryBase._FOCUS_INTERVAL=wjcCore.Control._FOCUS_INTERVAL+20;return DirectiveCellFactoryBase}(wjcGrid.CellFactory);exports.DirectiveCellFactoryBase=DirectiveCellFactoryBase;__gridCFRef||(window.wijmo.grid=null);!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.NewCellTemplate=8]="NewCellTemplate";e[e.ColumnFooter=9]="ColumnFooter";e[e.BottomLeft=10]="BottomLeft"}(GridCellTemplateType=exports.GridCellTemplateType||(exports.GridCellTemplateType={}));wijmo_1._registerModule("wijmo.interop.grid",selfModule);
{
"name": "@grapecity/wijmo.interop.grid",
"version": "5.20241.9",
"version": "5.20241.19",
"description": "UI library for pure JS, Angular, React, Vue and more...",

@@ -10,6 +10,6 @@ "author": "MESCIUS inc",

"dependencies": {
"@grapecity/wijmo": "5.20241.9",
"@grapecity/wijmo.input": "5.20241.9",
"@grapecity/wijmo.grid": "5.20241.9",
"@grapecity/wijmo.grid.detail": "5.20241.9"
"@grapecity/wijmo": "5.20241.19",
"@grapecity/wijmo.input": "5.20241.19",
"@grapecity/wijmo.grid": "5.20241.19",
"@grapecity/wijmo.grid.detail": "5.20241.19"
},

@@ -16,0 +16,0 @@ "homepage": "https://developer.mescius.com/wijmo",