@verifiedinc-public/shared-ui-elements 9.9.2-beta.2 → 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
|
|
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
|
|
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};
|
package/package.json
CHANGED