@verifiedinc-public/shared-ui-elements 9.9.2-beta.1 → 9.9.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  "use strict";import{BillableProduct as g,BILLABLE_PRODUCTS as j}from"./BillableEventsTable.types.mjs";function o(u){const n=String(u);return n.includes(",")||n.includes('"')||n.includes(`
2
- `)?`"${n.replace(/"/g,'""')}"`:n}function B({data:u,visibleProducts:n,filename:y="billable-events",topLevelColumns:i=[],columnFormatters:r}){const k=n??Object.values(g),b=j.filter(e=>k.includes(e.product)),h=new Set(i.map(e=>e.key)),m=b.flatMap(e=>e.columns).filter(e=>!h.has(e.key)),a=[],f=["","","",...i.map(()=>"")];for(const e of b){const s=e.columns.filter(t=>!h.has(t.key)).length;if(s!==0){f.push(o(e.label));for(let t=1;t<s;t++)f.push("")}}a.push(f.join(","));const p=["Brand","UUID","Integration Type"];for(const e of i)p.push(o(e.label));for(const e of m)p.push(o(e.label));a.push(p.join(","));for(const e of u){const s=[o(e.brand),o(e.brandUuid),o(e.integrationType)];for(const t of i){const l=e.metrics[t.key]??0,c=r?.[t.key];s.push(c?o(c(l,e)):String(l))}for(const t of m){const l=e.metrics[t.key]??0,c=r?.[t.key];s.push(c?o(c(l,e)):String(l))}a.push(s.join(","))}const L=a.join(`
2
+ `)?`"${n.replace(/"/g,'""')}"`:n}function B({data:u,visibleProducts:n,filename:y="billable-events",topLevelColumns:i=[],columnFormatters:r}){const k=n??Object.values(g),b=j.filter(e=>k.includes(e.product)),h=new Set(i.map(e=>e.key)),m=b.flatMap(e=>e.columns).filter(e=>!h.has(e.key)),a=[],f=["","","",...i.map(()=>"")];for(const e of b){const s=e.columns.filter(t=>!h.has(t.key)).length;if(s!==0){f.push(o(e.label));for(let t=1;t<s;t++)f.push("")}}a.push(f.join(","));const p=["Brand Name","Brand UUID","Integration Type"];for(const e of i)p.push(o(e.label));for(const e of m)p.push(o(e.label));a.push(p.join(","));for(const e of u){const s=[o(e.brand),o(e.brandUuid),o(e.integrationType)];for(const t of i){const l=e.metrics[t.key]??0,c=r?.[t.key];s.push(c?o(c(l,e)):String(l))}for(const t of m){const l=e.metrics[t.key]??0,c=r?.[t.key];s.push(c?o(c(l,e)):String(l))}a.push(s.join(","))}const L=a.join(`
3
3
  `),U=new Blob([L],{type:"text/csv;charset=utf-8;"}),v=URL.createObjectURL(U),d=document.createElement("a");d.href=v,d.download=`${y}.csv`,d.click(),URL.revokeObjectURL(v)}export{B as exportBillableEventsToCsv};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verifiedinc-public/shared-ui-elements",
3
- "version": "9.9.2-beta.1",
3
+ "version": "9.9.2-beta.2",
4
4
  "description": "A set of UI components, utilities that is shareable with the core apps.",
5
5
  "private": false,
6
6
  "sideEffects": false,