1 line
5.2 KiB
JavaScript
1 line
5.2 KiB
JavaScript
!function(K,R){"use strict";var F="ht",d=F+".widget.",L=K[F],E=L.widget,i=L.Default,C=L.Color,l=i.getInternal(),A=l.fillRect,H=i.setImage,h=i.getImage,c=i.drawCenterImage,Z=l.layout,B=i.def;L.IsGetter.caseSensitive=1,H("proerptypane_category",16,16,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAACxSURBVHjaYrx68STD1p0H/zPgAN7u9owMeAALjGFubo4hefLkSQZCgAVdICwsjGHVqlUoYk5ufigu3LdrEyNWA0CasRmCrAEdMCFzYJrQXQAKIxhG5mP1ArpmbAGJzGchJsCQYwmkGcYHsRlB0YiumFDU4Y0FslxAlYRUWlqKIdnd3U3QBRhekJCQYHjx4gXRscCErhmZJjkQQTZjcwHRSRlmCDrAl5RZ0AOM1GgECDAAKhF1/YP8df0AAAAASUVORK5CYII="),H("proerptypane_sort",16,16,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAACqSURBVHjaYrx68SQDMnBy8/u/b9cmRgYswMltD1DOBUWOCZmzdefB/8g0OkDXjGFAb28vA8h2EI3LBTgNQLcVmyuwuYARFgYgv2NqQA0LbGHAgksDNgOxASZkxbhofIAFm1NxRSNOA4gNA7wGkBsGjOgpEaa5uLiYwdvdnhFX/MNig4mQZhAoLmZFUYPMZyKkGQTw8ZlwOxs1DGC2oruG4pSINRBJAQABBgDKqW8M60DHlgAAAABJRU5ErkJggg=="),l.addMethod(i,{propertyPaneHeaderLabelColor:i.labelColor,propertyPaneHeaderLabelFont:i.labelFont,propertyPaneSelectBackground:C.highlight,propertyPaneHeaderBackground:C.headerBackground},!0),E.PropertyPane=function(g){var x=this,y=x._view=l.createView(1,x),D=x._propertyView=new E.PropertyView(g),s=x._input=i.createElement("input"),V=x._canvas=l.createCanvas(y);V.style.background=i.propertyPaneHeaderBackground||"",y.appendChild(V),y.appendChild(s),y.appendChild(D.getView()),D.isVisible=function(g){var k=s.value,h=this._visibleFunc,z=this.getPropertyName(g);if(z&&k)if(x._caseSensitive){if(z.indexOf(k)<0)return!1}else if(z.toLocaleLowerCase().indexOf(k.toLocaleLowerCase())<0)return!1;return h?h(g):!0},D.mp(function(b){var e=b.property;("indent"===e||"columnPosition"===e||"sortFunc"===e||"categorizable"===e)&&x.iv()}),s.onkeydown=function(){D.ivm()},x._sortFunc=function(K,e){return i.sortFunc(D.getPropertyName(K),D.getPropertyName(e))},new J(x),x.iv()},B(d+"PropertyPane",R,{ms_v:1,ms_fire:1,ms_ac:["headerLabelColor","headerLabelFont","headerLabelAlign","headerLabels","caseSensitive","indent","toolbarHeight","headerHeight","selectBackground","categoryIcon","sortIcon","sortFunc"],_caseSensitive:!1,_headerLabels:["Property","Value"],_headerLabelColor:i.propertyPaneHeaderLabelColor,_headerLabelFont:i.propertyPaneHeaderLabelFont,_headerLabelAlign:"center",_indent:i.widgetIndent,_toolbarHeight:i.widgetTitleHeight,_headerHeight:i.widgetHeaderHeight,_selectBackground:i.propertyPaneSelectBackground,_categoryIcon:"proerptypane_category",_sortIcon:"proerptypane_sort",getPropertyView:function(){return this._propertyView},onPropertyChanged:function(){this.iv()},addProperties:function(C){this._propertyView.addProperties(C)},drawHeaderLabel:function(U,Y,e,y,I,t){var l=this;U.save(),U.beginPath(),U.rect(e,y,I,t),U.clip(),i.drawText(U,Y,l._headerLabelFont,l._headerLabelColor,e,y,I,t,l._headerLabelAlign),U.restore()},validateImpl:function(){var n=this,J=this._propertyView,U=n._indent,R=n._canvas,o=n.getWidth(),d=n.getHeight(),N=n._toolbarHeight,t=n._headerHeight,k=N+t,M=n._selectBackground,p=n._input,f=n._headerLabels;l.setCanvas(R,o,k);var s=l.initContext(R);l.translateAndScale(s,0,0,1),s.clearRect(0,0,o,k),N>0?(J.isCategorizable()&&A(s,0,0,U,N,M),c(s,h(n._categoryIcon),U/2,N/2),J.getSortFunc()&&A(s,U,0,U,N,M),c(s,h(n._sortIcon),U+U/2,N/2),Z(p,2*U+1,1,o-2*U-2,N-2),p.style.visibility="visible"):p.style.visibility="hidden",U=J.getIndent();var j=U+J.getColumnPosition()*(o-U);t>0&&(n.drawHeaderLabel(s,f[0],0,N,j,t),n.drawHeaderLabel(s,f[1],j+1,N,o-j-1,t),l.drawVerticalLine(s,J.getColumnLineColor(),j,N,t),A(s,0,k-1,o,1,J.getRowLineColor())),Z(J,0,k,o,d-k),s.restore()}});var J=function(T){var Q=this;Q.pp=T,Q.pv=T.getPropertyView(),Q.addListeners()};B(J,R,{ms_listener:1,getView:function(){return this.pp._view},setCursor:function(n){this.getView().style.cursor=n},handle_mousedown:function(Q){i.isLeftButton(Q)&&this.handle_touchstart(Q)},handleWindowMouseMove:function(i){this.handleWindowTouchMove(i)},handleWindowMouseUp:function(X){this.handleWindowTouchEnd(X)},lp:function(H){return i.getLogicalPoint(H,this.getView())},handle_mousemove:function(Y){if(!l.getDragger()){var i=this,y=i.pp,h=i.pv,e=y.getIndent(),p=y.getToolbarHeight(),g=y.getHeaderHeight(),X=i.lp(Y),V=X.x,c=X.y;if(i.setCursor("default"),p>c)2*e>V&&i.setCursor("pointer");else if(p+g>c){e=h.getIndent();var W=e+h.getColumnPosition()*(y.getWidth()-e);V>W-10&&W+10>V&&i.setCursor("ew-resize")}}},handle_touchstart:function(R){var m=this,T=m.pp;if(R.target!==T._input){i.preventDefault(R);var m=this,d=m.pv,k=T.getIndent(),I=T.getToolbarHeight(),C=T.getHeaderHeight(),l=m.lp(R),H=l.x,S=l.y;if(m.setCursor("default"),I>S)k>H?d.setCategorizable(!d.isCategorizable()):2*k>H&&d.setSortFunc(d.getSortFunc()?null:T.getSortFunc());else if(I+C>S){k=d.getIndent();var X=k+d.getColumnPosition()*(T.getWidth()-k);H>X-10&&X+10>H&&i.startDragging(m,R)}}},handleWindowTouchMove:function(K){var l=this,f=l.pp,c=l.pv,v=l.lp(K).x,q=c.getIndent(),w=f.getWidth(),m=w-q;if(m>16){var t=(v-q)/m,i=16/m;i>t&&(t=i),t>1-i&&(t=1-i),c.setColumnPosition(t)}},handleWindowTouchEnd:function(){}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:(0,eval)("this"),Object); |