Socket
Socket
Sign inDemoInstall

wp-charts

Package Overview
Dependencies
Maintainers
1
Versions
296
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wp-charts - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

2

dist/wp-charts.es.js

@@ -101,3 +101,3 @@ var indicator = "";

this.table.setAttribute("cellspacing", 0);
this.table.style.borderColor = borderColor;
this.table.style.borderColor = this.borderColor;
this.table.classList.add("wp-table");

@@ -104,0 +104,0 @@ this.table.append(colgroup, tbody);

@@ -1,1 +0,1 @@

(function(a,u){typeof exports=="object"&&typeof module!="undefined"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis!="undefined"?globalThis:a||self,u(a.wpCharts={}))})(this,function(a){"use strict";var u="";function g(r){const t=/\d{1,3}(?=(\d{3})+$)/g;return(r+"").replace(t,"$&,")}function f(r,t){return"rgba("+parseInt("0x"+r.slice(1,3))+","+parseInt("0x"+r.slice(3,5))+","+parseInt("0x"+r.slice(5,7))+","+t+")"}class y{constructor(t,s){this.dom=t,this.option=s,this.labelList=[],this.valueList=[],this.init()}init(){const t=document.createElement("div");t.setAttribute("class","wp-indicator");const{data:s,labelColor:n,valueColor:o,labelSize:i,valueSize:p}=this.option;for(let c=0,b=s.length;c<b;c++){const h=document.createElement("div"),d=document.createDocumentFragment(),{label:m,value:C}=s[c],l=document.createElement("div");l.innerHTML=m,l.setAttribute("class","wp-indicator-label"),l.style.cssText=`color: ${n}; font-size: ${i}`,this.labelList.push(l);const e=document.createElement("div");e.innerHTML=g(C),e.setAttribute("class","wp-indicator-value"),e.style.cssText=`color: ${o}; font-size: ${p}`,this.valueList.push(e),d.append(l,e),h.appendChild(d),t.appendChild(h)}this.dom.appendChild(t)}changeColor(t,s){t==="label"&&this.labelList.forEach(n=>n.style.cssText=n.style.cssText+`color: ${s}`),t==="value"&&this.valueList.forEach(n=>n.style.cssText=n.style.cssText+`color: ${s}`)}}var L="";class v{constructor(t,s){const{themeColor:n,data:o}=s;this.dom=t,this.borderColor=n,this.bgColor=f(n,.8),this.data=o.map(i=>[{t:"index"}].concat(i)),this.table=null,this.themeTdList=[],this.init()}init(){this.table=document.createElement("table");const t=document.createElement("tbody"),s=document.createDocumentFragment();for(let i=0,p=this.data.length;i<p;i++){const c=document.createDocumentFragment(),b=this.data[i],h=document.createElement("tr");for(let d=0,m=b.length;d<m;d++){const{v:C,t:l}=b[d],e=document.createElement("td");e.setAttribute("align","center"),e.setAttribute("valign","middle"),e.style.borderColor=this.borderColor,e.setAttribute("class","wp-table-td"),(l==="index"||i===0)&&(e.classList.add("wp-table-td-theme"),e.style.backgroundColor=this.bgColor,this.themeTdList.push(e)),l==="index"&&e.classList.add("wp-table-td-index"),e.innerHTML=l==="index"?i>0?i:"":C,c.append(e)}h.appendChild(c),s.appendChild(h)}t.appendChild(s);const n=document.createElement("colgroup"),o=document.createElement("col");o.setAttribute("name","wp-table-td-index"),o.setAttribute("style","width: 52px"),n.appendChild(o),this.table.setAttribute("cellspacing",0),this.table.style.borderColor=borderColor,this.table.classList.add("wp-table"),this.table.append(n,t),this.dom.appendChild(this.table)}changeColor(t){const s=f(t,.8);this.table.querySelectorAll("td").forEach(o=>o.style.borderColor=t),this.themeTdList.forEach(o=>o.style.backgroundColor=s),this.table.style.borderColor=t}}a.CreateIndicator=y,a.CreateTable=v,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
(function(a,u){typeof exports=="object"&&typeof module!="undefined"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis!="undefined"?globalThis:a||self,u(a.wpCharts={}))})(this,function(a){"use strict";var u="";function g(r){const t=/\d{1,3}(?=(\d{3})+$)/g;return(r+"").replace(t,"$&,")}function f(r,t){return"rgba("+parseInt("0x"+r.slice(1,3))+","+parseInt("0x"+r.slice(3,5))+","+parseInt("0x"+r.slice(5,7))+","+t+")"}class y{constructor(t,s){this.dom=t,this.option=s,this.labelList=[],this.valueList=[],this.init()}init(){const t=document.createElement("div");t.setAttribute("class","wp-indicator");const{data:s,labelColor:n,valueColor:o,labelSize:i,valueSize:p}=this.option;for(let c=0,b=s.length;c<b;c++){const h=document.createElement("div"),d=document.createDocumentFragment(),{label:m,value:C}=s[c],l=document.createElement("div");l.innerHTML=m,l.setAttribute("class","wp-indicator-label"),l.style.cssText=`color: ${n}; font-size: ${i}`,this.labelList.push(l);const e=document.createElement("div");e.innerHTML=g(C),e.setAttribute("class","wp-indicator-value"),e.style.cssText=`color: ${o}; font-size: ${p}`,this.valueList.push(e),d.append(l,e),h.appendChild(d),t.appendChild(h)}this.dom.appendChild(t)}changeColor(t,s){t==="label"&&this.labelList.forEach(n=>n.style.cssText=n.style.cssText+`color: ${s}`),t==="value"&&this.valueList.forEach(n=>n.style.cssText=n.style.cssText+`color: ${s}`)}}var L="";class v{constructor(t,s){const{themeColor:n,data:o}=s;this.dom=t,this.borderColor=n,this.bgColor=f(n,.8),this.data=o.map(i=>[{t:"index"}].concat(i)),this.table=null,this.themeTdList=[],this.init()}init(){this.table=document.createElement("table");const t=document.createElement("tbody"),s=document.createDocumentFragment();for(let i=0,p=this.data.length;i<p;i++){const c=document.createDocumentFragment(),b=this.data[i],h=document.createElement("tr");for(let d=0,m=b.length;d<m;d++){const{v:C,t:l}=b[d],e=document.createElement("td");e.setAttribute("align","center"),e.setAttribute("valign","middle"),e.style.borderColor=this.borderColor,e.setAttribute("class","wp-table-td"),(l==="index"||i===0)&&(e.classList.add("wp-table-td-theme"),e.style.backgroundColor=this.bgColor,this.themeTdList.push(e)),l==="index"&&e.classList.add("wp-table-td-index"),e.innerHTML=l==="index"?i>0?i:"":C,c.append(e)}h.appendChild(c),s.appendChild(h)}t.appendChild(s);const n=document.createElement("colgroup"),o=document.createElement("col");o.setAttribute("name","wp-table-td-index"),o.setAttribute("style","width: 52px"),n.appendChild(o),this.table.setAttribute("cellspacing",0),this.table.style.borderColor=this.borderColor,this.table.classList.add("wp-table"),this.table.append(n,t),this.dom.appendChild(this.table)}changeColor(t){const s=f(t,.8);this.table.querySelectorAll("td").forEach(o=>o.style.borderColor=t),this.themeTdList.forEach(o=>o.style.backgroundColor=s),this.table.style.borderColor=t}}a.CreateIndicator=y,a.CreateTable=v,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});

@@ -14,3 +14,3 @@ {

},
"version": "1.2.1",
"version": "1.2.2",
"scripts": {

@@ -17,0 +17,0 @@ "dev": "vite",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc