@verifiedinc-public/shared-ui-elements 11.1.2-beta.0 → 11.2.1-beta.1
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.
- package/dist/components/DataTable/DataTable.context.d.ts +2 -2
- package/dist/components/DataTable/DataTable.mjs +1 -1
- package/dist/components/DataTable/DataTable.types.d.ts +12 -2
- package/dist/components/DataTable/DataTablePanels.mjs +1 -1
- package/dist/components/chart/BillableEventsTable/BillableEventsTable.types.mjs +1 -1
- package/dist/components/chart/oneClickVerification.types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, MouseEvent, MutableRefObject, ReactNode, RefObject, TouchEvent } from 'react';
|
|
2
2
|
import { Cell, ColumnPinningPosition, Header, OnChangeFn, Row, Table } from '@tanstack/react-table';
|
|
3
3
|
import { Virtualizer } from '@tanstack/react-virtual';
|
|
4
|
-
import { DataTableActiveFilters, DataTableBidirectionalScroll, DataTableCellProps, DataTableData, DataTableIcons, DataTableRowContext } from './DataTable.types';
|
|
4
|
+
import { DataTableActiveFilters, DataTableBidirectionalScroll, DataTableCellProps, DataTableData, DataTableFilterPanelContext, DataTableIcons, DataTableRowContext } from './DataTable.types';
|
|
5
5
|
import { DataTableExportColumn } from './DataTable.export';
|
|
6
6
|
/** Where a floating panel opens and which of its top corners pins there. */
|
|
7
7
|
export type DataTablePanelAnchor = {
|
|
@@ -67,7 +67,7 @@ export interface DataTableContextValue<TData extends DataTableData> {
|
|
|
67
67
|
onFiltersChange: OnChangeFn<DataTableActiveFilters>;
|
|
68
68
|
/** Consumer-rendered filter panel content, shown in place of the built-in operator
|
|
69
69
|
* panel. Can be used for custom/domain specific filters. */
|
|
70
|
-
renderFilterPanel?: () => ReactNode;
|
|
70
|
+
renderFilterPanel?: (context: DataTableFilterPanelContext<TData>) => ReactNode;
|
|
71
71
|
/** Active-filter count for the Filters button badge when using renderFilterPanel. */
|
|
72
72
|
activeFilterCount?: number;
|
|
73
73
|
search: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useMemo as O,useState as
|
|
1
|
+
"use strict";import{useMemo as O,useState as te,useRef as E,useEffect as mn}from"react";import{useReactTable as cn,getPaginationRowModel as fn,getSortedRowModel as hn,getCoreRowModel as pn}from"@tanstack/react-table";import{useVirtualizer as Cn}from"@tanstack/react-virtual";import{Box as bn,TableContainer as wn,Table as Rn}from"@mui/material";import{useBidirectionalScroll as vn}from"../../hooks/useBidirectionalScroll.mjs";import{DataTableProvider as Sn}from"./DataTable.context.mjs";import{useControllableState as m,useHeaderRowTops as Pn,useStickyHeaderHeight as yn,usePinnedOffsets as Ln}from"./DataTable.hooks.mjs";import{applySearch as xn,applyFilters as zn,EMPTY_FILTERS as Mn}from"./DataTable.filters.mjs";import{inferColumns as oe,applyMetaWidthsToSizes as Tn,getColumnMeta as ie,measureRowGroup as Fn}from"./DataTable.utils.mjs";import{DataTableBody as On}from"./DataTableBody.mjs";import{DataTableFooter as En}from"./DataTableFooter.mjs";import{DataTableHead as Hn}from"./DataTableHead.mjs";import{DataTablePanels as Dn}from"./DataTablePanels.mjs";import{DataTableToolbar as Vn}from"./DataTableToolbar.mjs";import{jsx as s,jsxs as ae}from"react/jsx-runtime";const In=25,Nn=[10,25,50,100],kn=53,Bn={},le={left:[],right:[]},re=()=>{};function se(i){for(const l of i??[]){const u=l.columns;if(u!=null&&u.length){const h=se(u);if(h)return h;continue}if(l.enablePinning===!1)continue;const c=l.accessorKey,f=l.id??(typeof c=="string"?c:void 0);if(f)return f}}function $n({data:i,columns:l,getRowId:u,renderRow:c,initialSorting:f=[],sorting:h,onSortingChange:ue,manualSorting:H=!1,initialPageSize:de=In,pageSizeOptions:ge=Nn,pagination:me,onPaginationChange:ce,manualPagination:p=!1,rowCount:w,disableSorting:R=!1,disablePagination:v=!1,bidirectionalScroll:t,enableColumnResizing:d=!1,enableColumnMenu:fe=!1,enableColumnPinning:D=!1,pinFirstColumn:he=!0,showToolbar:pe=!1,enableExport:Ce=!1,exportFilename:be="data",additionalExportColumns:we,initialFilters:Re=Mn,filters:ve,onFiltersChange:Se,manualFiltering:V=!1,renderFilterPanel:Pe,activeFilterCount:ye,initialSearch:Le="",search:xe,onSearchChange:ze,initialColumnVisibility:I={},columnVisibility:Me,onColumnVisibilityChange:Te,initialColumnPinning:N=le,columnPinning:k,onColumnPinningChange:Fe,footerLeft:Oe,estimateRowHeight:Ee=kn,minWidth:He=650,maxHeight:De=800,tableLayout:S="auto",icons:Ve=Bn,emptyMessage:Ie="No data to display.",isLoading:Ne=!1,renderLoading:ke}){var B,$;const[Be,$e]=m(f,h,ue),[We,je]=m({pageIndex:0,pageSize:de},me,ce),[P,Ke]=m(Re,ve,Se),[y,Ge]=m(Le,xe,ze),[Ye,qe]=m(I,Me,Te),W=O(()=>se(l??oe(i)),[l,i]),Je=k===void 0&&N===le&&he&&W?{left:[W],right:[]}:N,[L,Qe]=m(Je,k,Fe),x=D||(((B=L.left)==null?void 0:B.length)??0)>0||((($=L.right)==null?void 0:$.length)??0)>0,[z,Ue]=te({}),j=d&&Object.keys(z).length>0,[Xe,C]=te(null),Ze=()=>{C(null)},K=E(null),G=E(null),Y=(e,n)=>{if(n){const g=n.getBoundingClientRect();return{anchorPosition:{top:g.bottom,left:g.right},transformHorizontal:"right"}}const o=e.getBoundingClientRect();return{anchorPosition:{top:o.bottom,left:o.left},transformHorizontal:"left"}},_e=(e,n)=>{C({type:"filter",columnId:e,...Y(n,K.current)})},Ae=e=>{C({type:"manageColumns",...Y(e,G.current)})},M=E(null),r=O(()=>{const e=l??oe(i);return d?Tn(e):e},[l,i,d]),en=O(()=>V?i:xn(zn(i,P,r),y,r),[i,P,y,V,r]),a=cn({data:en,columns:r,state:{...R?{}:{sorting:Be},...v?{}:{pagination:We},...x?{columnPinning:L}:{},columnVisibility:Ye,columnSizing:z},initialState:{columnVisibility:I},onSortingChange:$e,onPaginationChange:je,onColumnVisibilityChange:qe,onColumnPinningChange:Qe,onColumnSizingChange:Ue,enableColumnPinning:D,columnResizeMode:"onChange",enableColumnResizing:d,getCoreRowModel:pn(),defaultColumn:{enableSorting:!1},enableSorting:!R,manualSorting:H,...R||H?{}:{getSortedRowModel:hn()},manualPagination:p,...p&&w!==void 0?{rowCount:w}:{},getRowCanExpand:()=>!0,...v||p?{}:{getPaginationRowModel:fn()},...u?{getRowId:u}:{}}),T=a.getRowModel().rows,nn=p?w??i.length:a.getPrePaginationRowModel().rows.length,tn=a.getVisibleLeafColumns().length||1,on=d&&a.getVisibleLeafColumns().some(e=>{var n;return typeof((n=ie(e.columnDef.meta))==null?void 0:n.width)=="number"}),an=j||on,F=x?a.getLeftVisibleLeafColumns().map(e=>e.id):[],q=x?a.getRightVisibleLeafColumns().map(e=>e.id):[],J=a.getHeaderGroups().length,{headerRowRefs:Q,headerRowTops:ln}=Pn(J,r),U=t!==void 0,rn=yn(U,Q,J,r),{headerCellRefs:X,pinnedOffsets:Z}=Ln(F,q,r),sn=(e,n)=>{var o;for(const g of a.getVisibleLeafColumns())if(z[g.id]===void 0){const ne=(o=X.current[g.id])==null?void 0:o.getBoundingClientRect().width;ne&&(g.columnDef.size=Math.round(ne))}e.getResizeHandler()(n)},_=(e,n)=>e==="left"?F[F.length-1]===n:q[0]===n,A=(e,n)=>{if(e==="left")return{left:Z.left[n]??0};if(e==="right")return{right:Z.right[n]??0}},ee=S==="fixed"?{overflow:"hidden",textOverflow:"ellipsis"}:void 0,un=(e,n)=>e?o=>({...ee,position:"sticky",zIndex:1,bgcolor:"background.paper",".MuiTableRow-hover:hover > &":{backgroundImage:`linear-gradient(${o.palette.action.hover}, ${o.palette.action.hover})`},..._(e,n)?{boxShadow:`inset ${e==="left"?-1:1}px 0 0 ${o.palette.divider}`}:{}}):ee,dn=e=>{var n;const o=e.column.getIsPinned();return{align:(n=ie(e.column.columnDef.meta))==null?void 0:n.align,style:A(o,e.column.id),sx:un(o,e.column.id)}},b=Cn({count:T.length,getScrollElement:()=>M.current,estimateSize:()=>Ee,overscan:5,measureElement:Fn});vn({enabled:U,scrollContainerRef:M,virtualizer:b,rowCount:T.length,hasNewer:t?.hasNewer,hasOlder:t?.hasOlder,isLoadingNewer:t?.isLoadingNewer,isLoadingOlder:t?.isLoadingOlder,onLoadNewer:t?.onLoadNewer??re,onLoadOlder:t?.onLoadOlder??re,resetKey:t?.resetKey});const{pageIndex:gn}=a.getState().pagination;return mn(()=>{b.scrollToOffset(0)},[gn,b]),s(Sn,{value:{table:a,data:i,rows:T,totalRowCount:nn,columnCount:tn,icons:Ve,isLoading:Ne,emptyMessage:Ie,tableLayout:S,enableColumnResizing:d,enableColumnMenu:fe,enableExport:Ce,exportFilename:be,additionalExportColumns:we,disablePagination:v,pageSizeOptions:ge,footerLeft:Oe,bidirectionalScroll:t,renderLoading:ke,renderRow:c,filters:P,onFiltersChange:Ke,renderFilterPanel:Pe,activeFilterCount:ye,search:y,onSearchChange:Ge,columnPanel:Xe,setColumnPanel:C,closeColumnPanel:Ze,openFilterPanel:_e,openManageColumnsPanel:Ae,toolbarFilterButtonRef:K,toolbarManageColumnsButtonRef:G,headerRowRefs:Q,headerCellRefs:X,headerRowTops:ln,headerHeight:rn,isPinnedEdge:_,getPinnedOffsetStyle:A,getCellProps:dn,hasResizedColumns:j,startColumnResize:sn,virtualizer:b},children:ae(bn,{sx:{width:"100%"},children:[pe&&s(Vn,{}),s(wn,{ref:M,sx:{maxHeight:De,width:0,minWidth:"100%"},children:ae(Rn,{stickyHeader:!0,sx:{minWidth:He,tableLayout:S},style:an?{width:`max(${a.getTotalSize()}px, 100%)`}:void 0,"aria-label":"data table",children:[s(Hn,{}),s(On,{})]})}),s(Dn,{}),s(En,{})]})})}export{$n as DataTable};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType, CSSProperties, ReactNode, Ref } from 'react';
|
|
2
2
|
import { SvgIconProps, SxProps, Theme } from '@mui/material';
|
|
3
|
-
import { Cell, ColumnDef, ColumnPinningState, PaginationState, Row, SortingState, VisibilityState } from '@tanstack/react-table';
|
|
3
|
+
import { Cell, ColumnDef, ColumnPinningState, PaginationState, Row, SortingState, Table, VisibilityState } from '@tanstack/react-table';
|
|
4
4
|
import { VirtualItem } from '@tanstack/react-virtual';
|
|
5
5
|
import { DataTableExportColumn } from './DataTable.export';
|
|
6
6
|
/**
|
|
@@ -51,6 +51,13 @@ export interface DataTableActiveFilters {
|
|
|
51
51
|
rows: DataTableFilterRow[];
|
|
52
52
|
logicOperator: DataTableFilterLogicOperator;
|
|
53
53
|
}
|
|
54
|
+
/** API handed to a consumer-rendered filter panel. */
|
|
55
|
+
export interface DataTableFilterPanelContext<TData extends DataTableData> {
|
|
56
|
+
/** Closes the filter popover, e.g. from an Apply/Cancel button inside the panel. */
|
|
57
|
+
onClose: () => void;
|
|
58
|
+
/** The table instance, for consumers that need column/row info. */
|
|
59
|
+
table: Table<TData>;
|
|
60
|
+
}
|
|
54
61
|
/**
|
|
55
62
|
* Optional per-column display hints, supplied via the TanStack
|
|
56
63
|
* `ColumnDef.meta` field.
|
|
@@ -449,8 +456,11 @@ export interface DataTableProps<TData extends DataTableData> {
|
|
|
449
456
|
* rendering this content instead of the built-in operator-based panel, the consumer supplies its
|
|
450
457
|
* own filter controls (wired to its own state / server query) and the table stays filter-agnostic.
|
|
451
458
|
* Pair with `manualFiltering`. Use `activeFilterCount` to drive the Filters button badge.
|
|
459
|
+
*
|
|
460
|
+
* Receives `{ onClose, table }` so the panel can close the popover itself (e.g. an Apply/Cancel
|
|
461
|
+
* button) and read the table instance if needed.
|
|
452
462
|
*/
|
|
453
|
-
renderFilterPanel?: () => ReactNode;
|
|
463
|
+
renderFilterPanel?: (context: DataTableFilterPanelContext<TData>) => ReactNode;
|
|
454
464
|
/**
|
|
455
465
|
* Active-filter count for the Filters button badge when using `renderFilterPanel` (the table can't
|
|
456
466
|
* infer it from consumer-owned filter state). Ignored without `renderFilterPanel`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Popover as h,Box as d}from"@mui/material";import{useDataTableContext as f}from"./DataTable.context.mjs";import{DataTableColumnMenu as
|
|
1
|
+
"use strict";import{Popover as h,Box as d}from"@mui/material";import{useDataTableContext as f}from"./DataTable.context.mjs";import{DataTableColumnMenu as C}from"./DataTableColumnMenu.mjs";import{DataTableFilterPanel as P}from"./DataTableFilterPanel.mjs";import{DataTableManageColumnsPanel as g}from"./DataTableManageColumnsPanel.mjs";import{jsxs as b,Fragment as v,jsx as a}from"react/jsx-runtime";function x(){const{table:l,data:i,icons:e,isLoading:s,filters:m,onFiltersChange:c,renderFilterPanel:r,columnPanel:o,closeColumnPanel:n,openFilterPanel:u,openManageColumnsPanel:p}=f(),t=o?.type==="menu"?l.getColumn(o.columnId):void 0;return b(v,{children:[o?.type==="menu"&&t&&a(C,{column:t,anchorEl:o.anchorEl,icons:e,isLoading:s,onClose:n,onOpenFilter:()=>u(o.columnId,o.anchorEl),onOpenManageColumns:()=>p(o.anchorEl)}),o?.type==="filter"&&(r?a(h,{open:!0,anchorReference:"anchorPosition",anchorPosition:o.anchorPosition,transformOrigin:{vertical:"top",horizontal:o.transformHorizontal},onClose:n,children:a(d,{sx:{p:2},children:r({onClose:n,table:l})})}):a(P,{table:l,data:i,initialColumnId:o.columnId,anchorPosition:o.anchorPosition,transformHorizontal:o.transformHorizontal,icons:e,filters:m,onFiltersChange:c,onClose:n})),o?.type==="manageColumns"&&a(g,{table:l,anchorPosition:o.anchorPosition,transformHorizontal:o.transformHorizontal,icons:e,onClose:n})]})}export{x as DataTablePanels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=(e=>(e.TEXT_TO_SIGNUP="TEXT_TO_SIGNUP",e.ONE_CLICK_VERIFY="ONE_CLICK_VERIFY",e.ONE_CLICK_SIGNUP="ONE_CLICK_SIGNUP",e.ONE_CLICK_HEALTH="ONE_CLICK_HEALTH",e))(i||{});const l=[{product:"TEXT_TO_SIGNUP",label:"Text to Signup",columns:[{key:"tts_smsKeywordsReceived",label:"SMS Keywords Received",metricKey:"ttsSent"},{key:"tts_verificationsSucceeded",label:"Verifications Succeeded",metricKey:"ttsVerified"}]},{product:"ONE_CLICK_VERIFY",label:"1-Click Verify",columns:[{key:"verify_smsSent",label:"SMS Sent",metricKey:"oneClickVerificationSending"},{key:"verify_verificationsSucceeded",label:"Verifications Succeeded",metricKey:"oneClickVerificationVerified"}]},{product:"ONE_CLICK_SIGNUP",label:"1-Click Signup",columns:[{key:"signup_autofillsSucceeded",label:"Autofills Succeeded",metricKey:"oneClickSuccess"},{key:"signup_riskSignalsReturned",label:"Risk Signals Returned",metricKey:"riskSignal"}]},{product:"ONE_CLICK_HEALTH",label:"1-Click Health",columns:[{key:"health_autofillsStarted",label:"Autofills Started",metricKey:"oneClickHealthCreated"}]}];export{l as BILLABLE_PRODUCTS,i as BillableProduct};
|
|
1
|
+
"use strict";var i=(e=>(e.TEXT_TO_SIGNUP="TEXT_TO_SIGNUP",e.ONE_CLICK_VERIFY="ONE_CLICK_VERIFY",e.ONE_CLICK_SIGNUP="ONE_CLICK_SIGNUP",e.ONE_CLICK_HEALTH="ONE_CLICK_HEALTH",e))(i||{});const l=[{product:"TEXT_TO_SIGNUP",label:"Text to Signup",columns:[{key:"tts_smsKeywordsReceived",label:"SMS Keywords Received",metricKey:"ttsSent"},{key:"tts_verificationsSucceeded",label:"Verifications Succeeded",metricKey:"ttsVerified"}]},{product:"ONE_CLICK_VERIFY",label:"1-Click Verify",columns:[{key:"verify_smsSent",label:"SMS Sent",metricKey:"oneClickVerificationSending"},{key:"verify_autofillsStarted",label:"Autofills Started",metricKey:"oneClickVerificationAutofillCreated"},{key:"verify_verificationsSucceeded",label:"Verifications Succeeded",metricKey:"oneClickVerificationVerified"}]},{product:"ONE_CLICK_SIGNUP",label:"1-Click Signup",columns:[{key:"signup_autofillsSucceeded",label:"Autofills Succeeded",metricKey:"oneClickSuccess"},{key:"signup_riskSignalsReturned",label:"Risk Signals Returned",metricKey:"riskSignal"}]},{product:"ONE_CLICK_HEALTH",label:"1-Click Health",columns:[{key:"health_autofillsStarted",label:"Autofills Started",metricKey:"oneClickHealthCreated"}]}];export{l as BILLABLE_PRODUCTS,i as BillableProduct};
|
|
@@ -8,6 +8,8 @@ export interface OneClickVerificationIntervalEntry {
|
|
|
8
8
|
oneClickVerificationFailed: number;
|
|
9
9
|
oneClickVerificationUndelivered: number;
|
|
10
10
|
oneClickVerificationExpired: number;
|
|
11
|
+
oneClickVerificationAutofillCreated?: number;
|
|
12
|
+
oneClickVerificationAutofillVerified?: number;
|
|
11
13
|
[key: string]: any;
|
|
12
14
|
}
|
|
13
15
|
/** Single brand entry as returned by the OneClickVerification API. */
|
package/package.json
CHANGED