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

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 +1 @@
1
- "use strict";import{TableContainer as k,Paper as x,Table as B,TableHead as C,TableRow as h,TableCell as i,TableBody as S,TableSortLabel as U}from"@mui/material";import{useMemo as p}from"react";import{EmptyChartSection as D}from"../EmptyChartSection.mjs";import{LoadingChartSection as L}from"../LoadingChartSection.mjs";import{BILLABLE_PRODUCTS as v}from"../BillableEventsTable/BillableEventsTable.types.mjs";import{useBillableSort as I}from"../BillableEventsTable/useBillableSort.hook.mjs";import{CopyableUuid as E}from"../../CopyableUuid/index.mjs";import{white as P}from"../../../styles/colors.mjs";import{jsx as e,jsxs as d}from"react/jsx-runtime";const w=["brand","integrationType"],R=({data:n,isLoading:b,isFetching:u,product:s,columnSlots:o})=>{const{sortKey:c,sortDir:g,handleSort:y,sortedData:T}=I(n,w,"brand"),l=p(()=>v.find(a=>a.product===s),[s]),m=p(()=>l?.columns??[],[l]),t=(a,r,f="left")=>e(U,{active:c===a,direction:c===a?g:"asc",onClick:()=>y(a),sx:f==="right"?{flexDirection:"row"}:void 0,children:r});return!(n!=null&&n.length)&&b?e(L,{}):n!=null&&n.length?e(k,{component:x,sx:{opacity:u?.4:1},children:d(B,{sx:{backgroundColor:P},children:[e(C,{children:d(h,{children:[e(i,{children:t("brand","Brand Name")}),e(i,{children:"Brand UUID"}),e(i,{children:t("integrationType","Integration Type")}),m.map(a=>e(i,{align:"right",children:t(a.key,a.label,"right")},a.key))]})}),e(S,{children:T.map(a=>d(h,{children:[e(i,{children:a.brand}),e(i,{children:e(E,{uuid:a.brandUuid,label:"Brand UUID",variant:"button",head:6,tail:0,mono:!1,iconSx:{color:"success.main"}})}),e(i,{children:a.integrationType}),m.map(r=>e(i,{align:"right",children:o!=null&&o[r.key]?o[r.key](a):a.metrics[r.key]??0},r.key))]},a.brandUuid))})]})}):e(D,{})};export{R as BillableEventsProductTable};
1
+ "use strict";import{TableContainer as k,Paper as x,Table as B,TableHead as C,TableRow as h,TableCell as i,TableBody as S,TableSortLabel as U}from"@mui/material";import{useMemo as p}from"react";import{EmptyChartSection as v}from"../EmptyChartSection.mjs";import{LoadingChartSection as D}from"../LoadingChartSection.mjs";import{BILLABLE_PRODUCTS as L}from"../BillableEventsTable/BillableEventsTable.types.mjs";import{useBillableSort as I}from"../BillableEventsTable/useBillableSort.hook.mjs";import{CopyableUuid as P}from"../../CopyableUuid/index.mjs";import{white as E}from"../../../styles/colors.mjs";import{jsx as e,jsxs as d}from"react/jsx-runtime";const w=["brand","integrationType"],R=({data:o,isLoading:b,isFetching:u,product:s,columnSlots:n})=>{const{sortKey:c,sortDir:g,handleSort:y,sortedData:T}=I(o,w,"brand"),l=p(()=>L.find(a=>a.product===s),[s]),m=p(()=>l?.columns??[],[l]),t=(a,r,f="left")=>e(U,{active:c===a,direction:c===a?g:"asc",onClick:()=>y(a),sx:f==="right"?{flexDirection:"row"}:void 0,children:r});return!(o!=null&&o.length)&&b?e(D,{}):o!=null&&o.length?e(k,{component:x,sx:{opacity:u?.4:1},children:d(B,{sx:{backgroundColor:E},children:[e(C,{children:d(h,{children:[e(i,{children:t("brand","Brand Name")}),e(i,{children:"Brand UUID"}),e(i,{children:t("integrationType","Integration Type")}),m.map(a=>e(i,{align:"right",children:t(a.key,a.label,"right")},a.key))]})}),e(S,{children:T.map(a=>d(h,{children:[e(i,{children:a.brand}),e(i,{children:e(P,{uuid:a.brandUuid,label:"Brand UUID",variant:"button",head:6,tail:0,mono:!1,iconSx:{color:"success.main"},typographyProps:{variant:"inherit",color:"inherit"}})}),e(i,{children:a.integrationType}),m.map(r=>e(i,{align:"right",children:n!=null&&n[r.key]?n[r.key](a):a.metrics[r.key]??0},r.key))]},a.brandUuid))})]})}):e(v,{})};export{R as BillableEventsProductTable};
@@ -1 +1 @@
1
- "use strict";import{TableContainer as C,Paper as x,Table as w,TableHead as U,TableRow as u,TableCell as a,TableBody as v,TableSortLabel as D}from"@mui/material";import{useEffect as L,useMemo as b}from"react";import{EmptyChartSection as E}from"../EmptyChartSection.mjs";import{LoadingChartSection as I}from"../LoadingChartSection.mjs";import{BillableProduct as P,BILLABLE_PRODUCTS as j}from"./BillableEventsTable.types.mjs";import{useBillableSort as M}from"./useBillableSort.hook.mjs";import{CopyableUuid as O}from"../../CopyableUuid/index.mjs";import{white as R}from"../../../styles/colors.mjs";import{jsx as r,jsxs as s}from"react/jsx-runtime";const K=["brand","integrationType"],_=({data:o,isLoading:f,isFetching:S,visibleProducts:y,onSortedDataChange:d,columnSlots:l,topLevelColumns:t=[]})=>{const{sortKey:g,sortDir:T,handleSort:B,sortedData:c}=M(o,K,"brand");L(()=>{d?.(c)},[c,d]);const m=b(()=>{const e=y??Object.values(P);return j.filter(n=>e.includes(n.product))},[y]),h=b(()=>new Set(t.map(e=>e.key)),[t]),k=b(()=>m.flatMap(e=>e.columns).filter(e=>!h.has(e.key)),[m,h]),i=(e,n,p="left")=>r(D,{active:g===e,direction:g===e?T:"asc",onClick:()=>B(e),sx:p==="right"?{flexDirection:"row"}:void 0,children:n});return!(o!=null&&o.length)&&f?r(I,{}):o!=null&&o.length?r(C,{component:x,sx:{opacity:S?.4:1},children:s(w,{sx:{backgroundColor:R},children:[s(U,{children:[s(u,{children:[r(a,{rowSpan:2,children:i("brand","Brand Name")}),r(a,{rowSpan:2,children:"Brand UUID"}),r(a,{rowSpan:2,children:i("integrationType","Integration Type")}),t.map(e=>r(a,{rowSpan:2,children:i(e.key,e.label)},e.key)),m.map(e=>{const n=e.columns.filter(p=>!h.has(p.key)).length;return n===0?null:r(a,{colSpan:n,align:"center",sx:{fontWeight:"bold",borderBottom:"none"},children:e.label},e.product)})]}),r(u,{children:k.map(e=>r(a,{align:"right",children:i(e.key,e.label,"right")},e.key))})]}),r(v,{children:c.map(e=>s(u,{children:[r(a,{children:e.brand}),r(a,{children:r(O,{uuid:e.brandUuid,label:"Brand UUID",variant:"button",head:6,tail:0,mono:!1,iconSx:{color:"success.main"}})}),r(a,{children:e.integrationType}),t.map(n=>r(a,{children:l!=null&&l[n.key]?l[n.key](e):e.metrics[n.key]??0},n.key)),k.map(n=>r(a,{align:"right",children:l!=null&&l[n.key]?l[n.key](e):e.metrics[n.key]??0},n.key))]},e.brandUuid))})]})}):r(E,{})};export{_ as BillableEventsTable};
1
+ "use strict";import{TableContainer as C,Paper as x,Table as v,TableHead as w,TableRow as u,TableCell as a,TableBody as U,TableSortLabel as D}from"@mui/material";import{useEffect as L,useMemo as b}from"react";import{EmptyChartSection as P}from"../EmptyChartSection.mjs";import{LoadingChartSection as E}from"../LoadingChartSection.mjs";import{BillableProduct as I,BILLABLE_PRODUCTS as j}from"./BillableEventsTable.types.mjs";import{useBillableSort as M}from"./useBillableSort.hook.mjs";import{CopyableUuid as O}from"../../CopyableUuid/index.mjs";import{white as R}from"../../../styles/colors.mjs";import{jsx as e,jsxs as s}from"react/jsx-runtime";const K=["brand","integrationType"],_=({data:l,isLoading:f,isFetching:S,visibleProducts:y,onSortedDataChange:d,columnSlots:o,topLevelColumns:t=[]})=>{const{sortKey:g,sortDir:T,handleSort:B,sortedData:c}=M(l,K,"brand");L(()=>{d?.(c)},[c,d]);const h=b(()=>{const r=y??Object.values(I);return j.filter(n=>r.includes(n.product))},[y]),m=b(()=>new Set(t.map(r=>r.key)),[t]),k=b(()=>h.flatMap(r=>r.columns).filter(r=>!m.has(r.key)),[h,m]),i=(r,n,p="left")=>e(D,{active:g===r,direction:g===r?T:"asc",onClick:()=>B(r),sx:p==="right"?{flexDirection:"row"}:void 0,children:n});return!(l!=null&&l.length)&&f?e(E,{}):l!=null&&l.length?e(C,{component:x,sx:{opacity:S?.4:1},children:s(v,{sx:{backgroundColor:R},children:[s(w,{children:[s(u,{children:[e(a,{rowSpan:2,children:i("brand","Brand Name")}),e(a,{rowSpan:2,children:"Brand UUID"}),e(a,{rowSpan:2,children:i("integrationType","Integration Type")}),t.map(r=>e(a,{rowSpan:2,children:i(r.key,r.label)},r.key)),h.map(r=>{const n=r.columns.filter(p=>!m.has(p.key)).length;return n===0?null:e(a,{colSpan:n,align:"center",sx:{fontWeight:"bold",borderBottom:"none"},children:r.label},r.product)})]}),e(u,{children:k.map(r=>e(a,{align:"right",children:i(r.key,r.label,"right")},r.key))})]}),e(U,{children:c.map(r=>s(u,{children:[e(a,{children:r.brand}),e(a,{children:e(O,{uuid:r.brandUuid,label:"Brand UUID",variant:"button",head:6,tail:0,mono:!1,iconSx:{color:"success.main"},typographyProps:{variant:"inherit",color:"inherit"}})}),e(a,{children:r.integrationType}),t.map(n=>e(a,{children:o!=null&&o[n.key]?o[n.key](r):r.metrics[n.key]??0},n.key)),k.map(n=>e(a,{align:"right",children:o!=null&&o[n.key]?o[n.key](r):r.metrics[n.key]??0},n.key))]},r.brandUuid))})]})}):e(P,{})};export{_ as BillableEventsTable};
@@ -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.3",
4
4
  "description": "A set of UI components, utilities that is shareable with the core apps.",
5
5
  "private": false,
6
6
  "sideEffects": false,