You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.1 KiB
JavaScript
2 lines
1.1 KiB
JavaScript
/*! © Drijkoningen Dirk - datatables.net/license */
|
|
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.render.percentBar=function(d,l,p,u,s,x,b,f){d=d||"square",l=l||"#000",p=p||"#BCBCBC",u=u||"#5FD868",s=s||"#E6E6E6",x=x||0,b=b||"ridge";return function(e,t,r){var i,o,a=parseFloat(e.toString().replace(/\s%|%/g,"")).toFixed(x);if(100<a&&(a=100),"display"!==t)return a;if("number"!=typeof e&&"string"!=typeof e)return e;if(f){for(var n=0;n<f.length;n++)if(a>=f[n].min&&a<=f[n].max){o=f[n].barColor||u,i=f[n].backgroundColor||s,f[n].textColor||l;break}}else i=s,o=u,0;t="border:2px "+b+" "+p+";line-height:12px;font-size:14px;color:"+l+";background:"+i+";position:relative;",e="height:12px;line-height:12px;text-align:center;background-color:"+o+";padding:auto 6px;";return"round"==d&&(t+="border-radius:5px;",e+="border-top-left-radius:4px;border-bottom-left-radius:4px;"),'<div style="max-width:100px;height:12px;margin:0 auto;"><div style="'+t+'"><div style="'+e+"width:"+a+'%;"></div><div style="width:100%;text-align:center;position:absolute;left:0;top:0;">'+a+"%</div></div></div>"}};export default DataTable; |