nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//>>built
define("../main dojo/_base/array dojo/_base/lang dojo/_base/window dojo/_base/event dojo/_base/sniff dojo/_base/connect dojo/dnd/Moveable dojox/html/metrics ./util dojo/_base/html dojo/dom-geometry".split(" "),function(v,w,m,n,x,p,A,B,C,t,g,D){var q=v.grid,E=function(a){return 0<=a.rowIndex?a.rowIndex:w.indexOf(a.parentNode.childNodes,a)},F=function(a,b){return a&&((a.rows||0)[b]||a.childNodes[b])},y=function(a){for(;a&&"TABLE"!=a.tagName;a=a.parentNode);return a},G=function(a){var b=a.toUpperCase();
return function(a){return a.tagName!=b}},z=t.rowIndexTag,u=t.gridViewTag,r=q._Builder=m.extend(function(a){a&&(this.view=a,this.grid=a.grid)},{view:null,_table:'\x3ctable class\x3d"dojoxGridRowTable" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"',getTableArray:function(){var a=[this._table];this.view.viewWidth&&a.push([' style\x3d"width:',this.view.viewWidth,';"'].join(""));a.push("\x3e");return a},generateCellMarkup:function(a,b,c,f){var e=[],d;f?(d=a.index!=a.grid.getSortIndex()?
"":0<a.grid.sortInfo?'aria-sort\x3d"ascending"':'aria-sort\x3d"descending"',a.id||(a.id=this.grid.id+"Hdr"+a.index),d=['\x3cth tabIndex\x3d"-1" aria-readonly\x3d"true" role\x3d"columnheader"',d,' id\x3d"',a.id,'"']):d=['\x3ctd tabIndex\x3d"-1" role\x3d"gridcell"',this.grid.editable&&!a.editable?'aria-readonly\x3d"true"':""];a.colSpan&&d.push(' colspan\x3d"',a.colSpan,'"');a.rowSpan&&d.push(' rowspan\x3d"',a.rowSpan,'"');d.push(' class\x3d"dojoxGridCell ');a.classes&&d.push(a.classes," ");c&&d.push(c,
" ");e.push(d.join(""));e.push("");d=['" idx\x3d"',a.index,'" style\x3d"'];b&&";"!=b[b.length-1]&&(b+=";");d.push(a.styles,b||"",a.hidden?"display:none;":"");a.unitWidth&&d.push("width:",a.unitWidth,";");e.push(d.join(""));e.push("");d=['"'];a.attrs&&d.push(" ",a.attrs);d.push("\x3e");e.push(d.join(""));e.push("");e.push(f?"\x3c/th\x3e":"\x3c/td\x3e");return e},isCellNode:function(a){return!(!a||a==n.doc||!g.attr(a,"idx"))},getCellNodeIndex:function(a){return a?Number(g.attr(a,"idx")):-1},getCellNode:function(a,
b){for(var c=0,f;(f=F(a.firstChild,c))&&f.cells;c++)for(var e=0,d;d=f.cells[e];e++)if(this.getCellNodeIndex(d)==b)return d;return null},findCellTarget:function(a,b){for(;a&&(!this.isCellNode(a)||a.offsetParent&&u in a.offsetParent.parentNode&&a.offsetParent.parentNode[u]!=this.view.id)&&a!=b;)a=a.parentNode;return a!=b?a:null},baseDecorateEvent:function(a){a.dispatch="do"+a.type;a.grid=this.grid;a.sourceView=this.view;a.cellNode=this.findCellTarget(a.target,a.rowNode);a.cellIndex=this.getCellNodeIndex(a.cellNode);
a.cell=0<=a.cellIndex?this.grid.getCell(a.cellIndex):null},findTarget:function(a,b){for(;a&&a!=this.domNode&&(!(b in a)||u in a&&a[u]!=this.view.id);)a=a.parentNode;return a!=this.domNode?a:null},findRowTarget:function(a){return this.findTarget(a,z)},isIntraNodeEvent:function(a){try{return a.cellNode&&a.relatedTarget&&g.isDescendant(a.relatedTarget,a.cellNode)}catch(b){return!1}},isIntraRowEvent:function(a){try{var b=a.relatedTarget&&this.findRowTarget(a.relatedTarget);return!b&&-1==a.rowIndex||b&&
a.rowIndex==b.gridRowIndex}catch(c){return!1}},dispatchEvent:function(a){return a.dispatch in this?this[a.dispatch](a):!1},domouseover:function(a){a.cellNode&&a.cellNode!=this.lastOverCellNode&&(this.lastOverCellNode=a.cellNode,this.grid.onMouseOver(a));this.grid.onMouseOverRow(a)},domouseout:function(a){if(a.cellNode&&a.cellNode==this.lastOverCellNode&&!this.isIntraNodeEvent(a,this.lastOverCellNode)&&(this.lastOverCellNode=null,this.grid.onMouseOut(a),!this.isIntraRowEvent(a)))this.grid.onMouseOutRow(a)},
domousedown:function(a){if(a.cellNode)this.grid.onMouseDown(a);this.grid.onMouseDownRow(a)},_getTextDirStyle:function(a,b,c){return""}});v=q._ContentBuilder=m.extend(function(a){r.call(this,a)},r.prototype,{update:function(){this.prepareHtml()},prepareHtml:function(){for(var a=this.grid.get,b=this.view.structure.cells,c=0,f;f=b[c];c++)for(var e=0,d;d=f[e];e++)d.get=d.get||void 0==d.value&&a,d.markup=this.generateCellMarkup(d,d.cellStyles,d.cellClasses,!1),!this.grid.editable&&d.editable&&(this.grid.editable=
!0)},generateHtml:function(a,b){a=this.getTableArray();var c=this.view.structure.cells,f=this.grid.getItem(b),e;t.fire(this.view,"onBeforeRow",[b,c]);for(var d=0,g;g=c[d];d++)if(!g.hidden&&!g.header){a.push(g.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var l=0,h,k,m;h=g[l];l++)k=h.markup,e=h.customClasses=[],m=h.customStyles=[],k[5]=h.format(b,f),k[1]=e.join(" "),k[3]=m.join(";"),(e=h.textDir||this.grid.textDir)&&(k[3]+=this._getTextDirStyle(e,h,b)),a.push.apply(a,k);a.push("\x3c/tr\x3e")}a.push("\x3c/table\x3e");
return a.join("")},decorateEvent:function(a){a.rowNode=this.findRowTarget(a.target);if(!a.rowNode)return!1;a.rowIndex=a.rowNode[z];this.baseDecorateEvent(a);a.cell=this.grid.getCell(a.cellIndex);return!0}});var H=q._HeaderBuilder=m.extend(function(a){this.moveable=null;r.call(this,a)},r.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new q._TableMap(this.view.structure.cells)},generateHtml:function(a,
b){var c,f=this.getTableArray(),e=this.view.structure.cells;t.fire(this.view,"onBeforeRow",[-1,e]);for(var d=0,g;g=e[d];d++)if(!g.hidden){f.push(g.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var l=0,h,k;h=g[l];l++)h.customClasses=[],h.customStyles=[],this.view.simpleStructure&&(h.draggable&&(h.headerClasses?-1==h.headerClasses.indexOf("dojoDndItem")&&(h.headerClasses+=" dojoDndItem"):h.headerClasses="dojoDndItem"),h.attrs?-1==h.attrs.indexOf("dndType\x3d'gridColumn_")&&
(h.attrs+=" dndType\x3d'gridColumn_"+this.grid.id+"'"):h.attrs="dndType\x3d'gridColumn_"+this.grid.id+"'"),k=this.generateCellMarkup(h,h.headerStyles,h.headerClasses,!0),k[5]=void 0!=b?b:a(h),k[3]=h.customStyles.join(";"),(c=h.textDir||this.grid.textDir)&&(k[3]+=this._getTextDirStyle(c,h,b)),k[1]=h.customClasses.join(" "),f.push(k.join(""));f.push("\x3c/tr\x3e")}f.push("\x3c/table\x3e");return f.join("")},getCellX:function(a){var b;b=G("th");for(var c=a.target;c&&b(c);c=c.parentNode);(b=c)?(b=D.position(b),
a=a.clientX-b.x):a=a.layerX;return a},decorateEvent:function(a){this.baseDecorateEvent(a);a.rowIndex=-1;a.cellX=this.getCellX(a);return!0},prepareResize:function(a,b){do{var c=a.cellIndex;a.cellNode=c?a.cellNode.parentNode.cells[c+b]:null;a.cellIndex=a.cellNode?this.getCellNodeIndex(a.cellNode):-1}while(a.cellNode&&"none"==a.cellNode.style.display);return!!a.cellNode},canResize:function(a){if(!a.cellNode||1<a.cellNode.colSpan)return!1;a=this.grid.getCell(a.cellIndex);return!a.noresize&&a.canResize()},
overLeftResizeArea:function(a){if(g.hasClass(n.body(),"dojoDndMove"))return!1;if(p("ie")){var b=a.target;if(g.hasClass(b,"dojoxGridArrowButtonNode")||g.hasClass(b,"dojoxGridArrowButtonChar")||g.hasClass(b,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?0<a.cellIndex&&0<a.cellX&&a.cellX<this.overResizeWidth&&this.prepareResize(a,-1):a.cellNode&&0<a.cellX&&a.cellX<this.overResizeWidth},overRightResizeArea:function(a){if(g.hasClass(n.body(),"dojoDndMove"))return!1;if(p("ie")){var b=
a.target;if(g.hasClass(b,"dojoxGridArrowButtonNode")||g.hasClass(b,"dojoxGridArrowButtonChar")||g.hasClass(b,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?a.cellNode&&a.cellX>=a.cellNode.offsetWidth-this.overResizeWidth:0<a.cellIndex&&a.cellX>=a.cellNode.offsetWidth-this.overResizeWidth&&this.prepareResize(a,-1)},domousemove:function(a){if(!this.moveable){var b=this.overRightResizeArea(a)?"dojoxGridColResize":this.overLeftResizeArea(a)?"dojoxGridColResize":"";b&&!this.canResize(a)&&
(b="dojoxGridColNoResize");g.toggleClass(a.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==b);g.toggleClass(a.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==b);b&&x.stop(a)}},domousedown:function(a){this.moveable||((this.overRightResizeArea(a)||this.overLeftResizeArea(a))&&this.canResize(a)?this.beginColumnResize(a):(this.grid.onMouseDown(a),this.grid.onMouseOverRow(a)))},doclick:function(a){return this._skipBogusClicks?(x.stop(a),!0):!1},colResizeSetup:function(a,
b){var c=g.contentBox(a.sourceView.headerNode);if(b){this.lineDiv=document.createElement("div");b=g.position(a.sourceView.headerNode,!0);var f=g.contentBox(a.sourceView.domNode),e=a.pageX;!this.grid.isLeftToRight()&&8>p("ie")&&(e-=C.getScrollbar().w);g.style(this.lineDiv,{top:b.y+"px",left:e+"px",height:f.h+c.h+"px"});g.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=e;n.body().appendChild(this.lineDiv)}b=[];for(var f=this.tableMap.findOverlappingNodes(a.cellNode),e=0,d;d=f[e];e++)b.push({node:d,
index:this.getCellNodeIndex(d),width:d.offsetWidth});f=a.sourceView;d=this.grid.isLeftToRight()?1:-1;for(var m=a.grid.views.views,e=[],l=f.idx+d,h;h=m[l];l+=d)e.push({node:h.headerNode,left:window.parseInt(h.headerNode.style.left)});d=f.headerContentNode.firstChild;return{scrollLeft:a.sourceView.headerNode.scrollLeft,view:f,node:a.cellNode,index:a.cellIndex,w:g.contentBox(a.cellNode).w,vw:c.w,table:d,tw:g.contentBox(d).w,spanners:b,followers:e}},beginColumnResize:function(a){this.moverDiv=document.createElement("div");
g.style(this.moverDiv,{position:"absolute",left:0});n.body().appendChild(this.moverDiv);g.addClass(this.grid.domNode,"dojoxGridColumnResizing");var b=this.moveable=new B(this.moverDiv),c=this.colResizeSetup(a,!0);b.onMove=m.hitch(this,"doResizeColumn",c);A.connect(b,"onMoveStop",m.hitch(this,function(){this.endResizeColumn(c);c.node.releaseCapture&&c.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;g.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));
a.cellNode.setCapture&&a.cellNode.setCapture();b.onMouseDown(a)},doResizeColumn:function(a,b,c){var f=c.l,f={deltaX:f,w:a.w+(this.grid.isLeftToRight()?f:-f),vw:a.vw+f,tw:a.tw+f};this.dragRecord={inDrag:a,mover:b,leftTop:c};f.w>=this.minColWidth&&(b?g.style(this.lineDiv,"left",this.lineDiv._origLeft+f.deltaX+"px"):this.doResizeNow(a,f))},endResizeColumn:function(a){if(this.dragRecord){var b=this.dragRecord.leftTop,b=this.grid.isLeftToRight()?b.l:-b.l,b=b+(Math.max(a.w+b,this.minColWidth)-(a.w+b));
p("webkit")&&a.spanners.length&&(b+=g._getPadBorderExtents(a.spanners[0].node).w);this.doResizeNow(a,{deltaX:b,w:a.w+b,vw:a.vw+b,tw:a.tw+b});delete this.dragRecord}g.destroy(this.lineDiv);g.destroy(this.moverDiv);g.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=!0;a.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(a.index)},doResizeNow:function(a,b){a.view.convertColPctToFixed();if(a.view.flexCells&&!a.view.testFlexCells()){var c=y(a.node);c&&(c.style.width="")}for(var f,
e,c=0;f=a.spanners[c];c++)e=f.width+b.deltaX,0<e&&(f.node.style.width=e+"px",a.view.setColWidth(f.index,e));if(this.grid.isLeftToRight()||!p("ie"))for(c=0;f=a.followers[c];c++)e=f.left+b.deltaX,f.node.style.left=e+"px";a.node.style.width=b.w+"px";a.view.setColWidth(a.index,b.w);a.view.headerNode.style.width=b.vw+"px";a.view.setColumnsWidth(b.tw);this.grid.isLeftToRight()||(a.view.headerNode.scrollLeft=a.scrollLeft+b.deltaX)}});q._TableMap=m.extend(function(a){this.mapRows(a)},{map:null,mapRows:function(a){if(a.length){this.map=
[];for(var b,c=0;b=a[c];c++)this.map[c]=[];for(c=0;b=a[c];c++)for(var f=0,e=0,d,g;d=b[f];f++){for(;this.map[c][e];)e++;this.map[c][e]={c:f,r:c};g=d.rowSpan||1;d=d.colSpan||1;for(var l=0;l<g;l++)for(var h=0;h<d;h++)this.map[c+l][e+h]=this.map[c][e];e+=d}}},dumpMap:function(){for(var a=0,b;b=this.map[a];a++)for(var c=0;b[c];c++);},getMapCoords:function(a,b){for(var c=0,f;f=this.map[c];c++)for(var e=0,d;d=f[e];e++)if(d.c==b&&d.r==a)return{j:c,i:e};return{j:-1,i:-1}},getNode:function(a,b,c){return(a=
a&&a.rows[b])&&a.cells[c]},_findOverlappingNodes:function(a,b,c){var f=[];b=this.getMapCoords(b,c);c=0;for(var e;e=this.map[c];c++)c!=b.j&&(e=(e=e[b.i])?this.getNode(a,e.r,e.c):null)&&f.push(e);return f},findOverlappingNodes:function(a){return this._findOverlappingNodes(y(a),E(a.parentNode),0<=a.cellIndex?a.cellIndex:w.indexOf(a.parentNode.cells,a))}});return{_Builder:r,_HeaderBuilder:H,_ContentBuilder:v}});