UNPKG

quoslibero

Version:

FusionCharts JavaScript charting framework

1 lines 4.63 kB
import domEvtHandler from'../../dom-event';import{getDep}from'../../dependency-manager';import{UNDEF}from'../../lib';const DEFAULT_TIMEOUT=300,HOVER='hover',CLICK='click',COLOR_WHITE='#ffffff',COLOR_E3E3E3='#e3e3e3',STR_DEF='default',COLOR_EFEFEF='#efefef',COLOR_C2C2C2='#c2c2c2',preConfig={activated:{config:{hover:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#aaaaaa',"symbol-stroke":'#aaaaaa',cursor:'pointer'},normal:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',stroke:'#c2c2c2',"symbol-stroke":'#c2c2c2',"stroke-width":1,cursor:'pointer'},disable:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',"stroke-opacity":1,cursor:'pointer'},pressed:{fill:'#efefef',labelFill:'#efefef',symbolFill:'#efefef',hoverFill:'#efefef',"fill-symbol":'#efefef',"stroke-width":1,stroke:'#c2c2c2',"symbol-stroke":'#c2c2c2',cursor:'pointer'}},"button-disabled":!1,fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',stroke:'#c2c2c2',"symbol-stroke":'#c2c2c2',"stroke-opacity":1,cursor:'pointer'},disabled:{config:{hover:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',cursor:'default'},normal:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',"stroke-width":1,cursor:'default'},disable:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',"stroke-opacity":1,cursor:'default'},pressed:{fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',cursor:'default'}},fill:'#ffffff',labelFill:'#ffffff',symbolFill:'#ffffff',hoverFill:'#ffffff',"button-disabled":!1,stroke:'#e3e3e3',"symbol-stroke":'#e3e3e3',"stroke-opacity":1,cursor:'default'},pressed:{config:{hover:{fill:'#dcdcdc',labelFill:'#dcdcdc',symbolFill:'#ffffff',hoverFill:'#dcdcdc',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#b7b7b7',"symbol-stroke":'#b7b7b7',cursor:'pointer'},normal:{fill:'#dcdcdc',labelFill:'#dcdcdc',symbolFill:'#ffffff',hoverFill:'#dcdcdc',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#b7b7b7',"symbol-stroke":'#b7b7b7',cursor:'pointer'},pressed:{fill:'#dcdcdc',labelFill:'#dcdcdc',symbolFill:'#ffffff',hoverFill:'#dcdcdc',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#b7b7b7',"symbol-stroke":'#b7b7b7',cursor:'pointer'}},fill:'#dcdcdc',labelFill:'#dcdcdc',symbolFill:'#ffffff',hoverFill:'#dcdcdc',"fill-symbol":'#ffffff',"stroke-width":1,stroke:'#b7b7b7',"symbol-stroke":'#b7b7b7',cursor:'pointer'}};let Raphael=getDep('redraphael','plugin'),TEXTBOX_SYMBOL='Internal_CB',RSymbolFns=function(){return{CB_NOT_CHECKED:function(a,b,c){var d=c;return['M',a-d,b-d]},CB_CHECKED:function(a,b,c){var d=a,e=b,f=c,g=f/4;return['M',d-3*g,e,'L',d-g,e+f,d+f,e-f]}}}(),SymbolStore=function(){return Raphael.addSymbol(TEXTBOX_SYMBOL,RSymbolFns.CB_NOT_CHECKED),{register:function(){var a,b,c,d;if(1===arguments.length){if(c=arguments[0],null===c&&c===UNDEF||'object'!=typeof c)return;d=c}else if(1<arguments.length){if(a=arguments[0],b=arguments[1],'string'!=typeof a||'function'!=typeof b)return;d={},d[a]=b}else return;for(a in d)(b=d[a],!!{}.hasOwnProperty.call(d,a))&&Raphael.addSymbol(a,b)}}}(),defaultTextStyle={fill:'#555555',labelFill:'#555555',symbolFill:'#555555',hoverFill:'#555555',fontFamily:'Verdana,sans',fontSize:'12px',fontStyle:'normal',fontWeight:'normal',lineHeight:'14.399999999999999px'};function getEventHandlersFor(a,b){var c=function(){domEvtHandler.listen(b,'mousemove',function(a){a.originalEvent.stopPropagation()})};return'click'===a?function(a){domEvtHandler.listen(b,'click',function(b){b.target&&b.target.parentNode&&a.call(b.target)}),c()}:'hover'===a?function(a,d){domEvtHandler.listen(b,'pointerhover',function(b){b.target&&b.target.parentNode&&('start'===b.state?a:d).call(b.target)}),c()}:void 0}function mergeConf(a,b,c){var d,e;for(d in a)if(e=a[d],e!==UNDEF&&null!==e)if(c){if(b[d])continue;b[d]=e}else b[d]=e}function bottomPath(a,b,c,d,e){var f=a,g=d/2,h=Math.round(e/4+1),i=b+h+3;return['M',f-g,i,'L',f+g,i]}export{getEventHandlersFor,HOVER,CLICK,DEFAULT_TIMEOUT,preConfig,SymbolStore,defaultTextStyle,RSymbolFns,mergeConf,bottomPath};