@harpercollins/harpercollins-design-system 1.35.3 → 1.36.0
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/cjs/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/cjs/components/data-display/DataGrid/ManageColumnsDropdown.cjs +1 -0
- package/dist/cjs/components/data-display/DataGrid/TableToolbar.cjs +3 -3
- package/dist/cjs/components/data-display/DataGrid/hooks/useDataGrid.cjs +1 -1
- package/dist/cjs/components/data-display/Table/TableBody.cjs +1 -1
- package/dist/cjs/components/data-display/Table/TableLayout.cjs +1 -1
- package/dist/cjs/components/global/Layout/Layout.cjs +3 -3
- package/dist/cjs/components/global/Sidebar/Sidebar.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs +1 -1
- package/dist/esm/components/data-display/DataGrid/DataGrid.js +25 -24
- package/dist/esm/components/data-display/DataGrid/ManageColumnsDropdown.js +121 -0
- package/dist/esm/components/data-display/DataGrid/TableToolbar.js +25 -12
- package/dist/esm/components/data-display/DataGrid/hooks/useDataGrid.js +140 -119
- package/dist/esm/components/data-display/Table/TableBody.js +53 -47
- package/dist/esm/components/data-display/Table/TableLayout.js +46 -45
- package/dist/esm/components/global/Layout/Layout.js +28 -26
- package/dist/esm/components/global/Sidebar/Sidebar.js +1 -3
- package/dist/esm/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js +38 -27
- package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Divider/dividerClasses.js +3 -3
- package/dist/index.d.ts +15 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),h=require("../../feedback/Alert/Alert.cjs"),a=require("../../feedback/CircularProgress/CircularProgress.cjs"),y=require("../Typography/Typography.cjs"),f=require("../Table/Table.styles.cjs"),q=require("./TableToolbar.cjs"),p=require("./hooks/useDataGrid.cjs"),n=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs");function T({id:l,loading:t=!1,reactTableOptions:o,gridCheckboxes:c=!1,allSelected:u=!1,onSelectionChange:d,infiniteScroll:s,syncUrl:x=!1,urlParamPrefix:g="",renderLayout:j,toolbar:i,isError:m=!1,errorMessage:b="An error occurred while loading data. Please try again."}){const r=p.useDataGrid({id:l,loading:t,reactTableOptions:o,gridCheckboxes:c,allSelected:u,onSelectionChange:d,infiniteScroll:s,syncUrl:x,urlParamPrefix:g});return e.jsxs(e.Fragment,{children:[m&&e.jsx(h,{color:"danger",sx:{marginBottom:1},children:b}),i?.enabled&&e.jsx(q,{ref:r.toolbarRef,toolbar:i,columnFilters:r.table.getState().columnFilters,table:r.table,resetColumnVisibility:r.resetColumnVisibility}),e.jsxs(n,{sx:{position:"relative"},children:[t&&e.jsx(f.LoadingOverlay,{children:e.jsx(a,{})}),j(r)]}),r.isVirtual&&s?.isFetchingNextPage&&e.jsxs(n,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:1,padding:1},children:[e.jsx(a,{size:"sm"}),e.jsx(y,{children:s.loadingText??"Loading more..."})]})]})}module.exports=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),m=require("../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),p=require("react"),h=require("../../inputs/Button/Button.cjs"),g=require("../../inputs/Checkbox/Checkbox.cjs"),x=require("../Icon/Icon.cjs"),b=require("../Typography/Typography.cjs"),j=require("../../../node_modules/.pnpm/@mui_base@5.0.0-beta.40-1_@types_react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@mui/base/Dropdown/Dropdown.cjs"),C=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.cjs"),q=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Menu/Menu.cjs"),i=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs"),y=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Input/Input.cjs"),f=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Divider/Divider.cjs"),w=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuItem/MenuItem.cjs");function D(n){return n.replace(/_/g," ").replace(/([A-Z])/g," $1").trim().toLowerCase().replace(/\b\w/g,r=>r.toUpperCase())}function a(n){if(n.columnDef.meta?.columnLabel)return n.columnDef.meta.columnLabel;const{header:r}=n.columnDef;if(typeof r=="string")return r;if(typeof r=="function")try{const o=r();if(typeof o=="string")return o;if(typeof o=="number")return String(o)}catch{}return D(n.id)}function v({table:n,onReset:r}){const[o,l]=p.useState(""),u=n.getAllLeafColumns().filter(e=>e.id!=="select"&&!e.columnDef.meta?.excludeFromManageColumns).sort((e,s)=>a(e).localeCompare(a(s))),c=o?u.filter(e=>a(e).toLowerCase().includes(o.toLowerCase())):u;return t.jsxs(j.Dropdown,{onOpenChange:(e,s)=>{s||l("")},children:[t.jsx(C.default,{size:"sm",variant:"outlined",color:"neutral",sx:{minWidth:"auto",px:.75},"aria-label":"Manage columns",title:"Manage columns",children:t.jsx(x,{icon:m.faColumns,size:"sm"})}),t.jsxs(q,{placement:"bottom-end",sx:{p:0,minWidth:260,maxWidth:320},children:[t.jsx(i,{sx:{p:1},children:t.jsx(y.default,{size:"sm",placeholder:"Search columns...",value:o,onChange:e=>l(e.target.value),onClick:e=>e.stopPropagation()})}),t.jsx(f.default,{}),t.jsxs(i,{sx:{maxHeight:300,overflowY:"auto",py:.5},children:[c.map(e=>{const s=a(e),d=!!e.columnDef.meta?.alwaysVisible;return t.jsx(i,{sx:{px:1.5,py:.5,"&:hover":{bgcolor:"background.level1"}},children:t.jsx(g,{size:"sm",label:s,checked:e.getIsVisible(),disabled:d,onChange:()=>e.toggleVisibility(),sx:{width:"100%",cursor:d?"default":"pointer"}})},e.id)}),c.length===0&&t.jsx(i,{sx:{px:2,py:1},children:t.jsx(b,{level:"body-sm",sx:{color:"text.tertiary"},children:"No columns found"})})]}),t.jsx(f.default,{}),t.jsx(w,{onClick:r,sx:{gap:1},children:t.jsx(h,{variant:"plain",color:"neutral",size:"sm",fullWidth:!0,startDecorator:t.jsx(x,{icon:m.faRotateLeft,size:"sm"}),children:"Reset"})})]})]})}module.exports=v;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),x=require("react"),i=require("styled-components"),a=require("../Typography/Typography.cjs"),p=require("./ExportToExcelButton.cjs"),u=require("./FilterChipsSection.cjs"),g=require("./ManageColumnsDropdown.cjs"),n=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs"),h=i(n)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 8px;
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
position: sticky;
|
|
10
10
|
top: 0;
|
|
11
11
|
z-index: 1;
|
|
12
|
-
`,
|
|
12
|
+
`,f=i(n)`
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
width: 100%;
|
|
17
|
-
`;function
|
|
17
|
+
`;function T({toolbar:e,columnFilters:o,table:s,resetColumnVisibility:l},r){const c=s.getFilteredRowModel().rows.length,d=o.length>0;return t.jsx(h,{ref:r,children:t.jsxs(f,{children:[t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.leftContent?e.leftContent:null,e.exportToExcel?.enabled&&t.jsx(p,{onExport:e.exportToExcel.onExport,disabled:e.exportToExcel.disabled}),e.showFilterChips?t.jsx(u,{columnFilters:o,table:s}):null]}),t.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.totalResults!==void 0&&t.jsx(a,{level:"body-sm",sx:{fontWeight:500},children:d?`Showing ${c.toLocaleString()} of ${e.totalResults.toLocaleString()} results`:`Total Results: ${e.totalResults.toLocaleString()}`}),e.rightContent?e.rightContent:null,e.manageColumns?.enabled&&t.jsx(g,{table:s,onReset:l})]})]})})}const m=x.forwardRef(T);module.exports=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),le=require("../../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.cjs"),n=require("react"),H=require("../../../../hooks/useLocalStorage.cjs"),B=require("../../../inputs/Checkbox/Checkbox.cjs"),c=require("../filters/filterFunctions.cjs"),a=require("../tableUrlUtils.cjs"),re=require("./useInfiniteScroll.cjs"),z=require("../../../../node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.cjs");function ue({table:s}){return j.jsx(B,{checked:s.getIsAllRowsSelected(),indeterminate:s.getIsSomeRowsSelected(),onChange:l=>s.toggleAllRowsSelected(l.target.checked),size:"md"})}function ce({row:s}){return j.jsx(B,{checked:s.getIsSelected(),disabled:!s.getCanSelect(),onChange:l=>s.toggleSelected(l.target.checked),size:"md"})}function ae({id:s,loading:l=!1,reactTableOptions:t,gridCheckboxes:m=!1,allSelected:M=!1,onSelectionChange:x,infiniteScroll:u,syncUrl:g=!1,urlParamPrefix:d=""}){const{columns:r}=t,P=n.useRef(a.extractColumnFilterTypes(r)),[b,U]=n.useState(()=>{if(g&&typeof window<"u"){const e=new URLSearchParams(window.location.search);return a.parseSortingFromUrl(e,d)}return[]}),[V,A]=n.useState(()=>{if(g&&typeof window<"u"){const e=new URLSearchParams(window.location.search);return a.parseFiltersFromUrl(e,d,P.current)}return[]}),[$,G]=H.useLocalStorage(`table.${s}.columnSizing`,{}),K=n.useRef(r),S=n.useMemo(()=>{const e={};return K.current.forEach(i=>{const o=i.id??i.accessorKey;o&&i.meta?.hidden&&(e[o]=!1)}),e},[]),[h,f]=H.useLocalStorage(`table.${s}.columnVisibility`,S),_=n.useCallback(()=>{f(S)},[S,f]),J=n.useCallback(e=>{f(typeof e=="function"?e(h):e)},[h,f]),[Q,W]=n.useState({}),X=n.useCallback(e=>{W(i=>{const o=typeof e=="function"?e(i):e;return x?.(o),o})},[x]),k=n.useRef(null),C=n.useRef(t.data),Y=l&&C.current.length>0?C.current:t.data;n.useEffect(()=>{!l&&t.data.length>0&&(C.current=t.data)},[l,t.data]);const R=n.useRef(null),Z=n.useRef(null),T=n.useMemo(()=>{const e=[],i=[];return r.forEach(o=>{o.meta?.pinned==="left"&&o.id?e.push(o.id):o.meta?.pinned==="right"&&o.id&&i.push(o.id)}),{left:e,right:i}},[r]),O=n.useMemo(()=>{let e=[...r];return e=e.map(i=>{const o=i.meta?.filterType;if(o&&!i.filterFn){const y={text:c.textFilter,number:c.numericFilter,date:c.dateFilter,select:c.selectFilter,multiselect:c.multiSelectFilter};return{...i,filterFn:y[o]}}return i}),m&&(e=[{id:"select",size:32,enableSorting:!1,enableResizing:!1,meta:{noSortButton:!0},header:ue,cell:ce},...e]),e},[m,r]),w=le.useReactTable({columnResizeDirection:"ltr",defaultColumn:{size:200,minSize:20,maxSize:500},...t,getCoreRowModel:z.getCoreRowModel(),getSortedRowModel:z.getSortedRowModel(),getFilteredRowModel:z.getFilteredRowModel(),columns:O,data:Y,enableSorting:t.enableSorting??!0,enableColumnResizing:t.enableColumnResizing??!0,columnResizeMode:t.columnResizeMode??"onChange",onColumnSizingChange:t.onColumnSizingChange??G,onSortingChange:t.onSortingChange??U,onColumnFiltersChange:t.onColumnFiltersChange??A,onColumnVisibilityChange:t.onColumnVisibilityChange??J,enableRowSelection:m,onRowSelectionChange:t.onRowSelectionChange??X,state:{...t.state,rowSelection:t.state?.rowSelection??Q,sorting:t.state?.sorting??b,columnFilters:t.state?.columnFilters??V,columnSizing:$,columnPinning:T,columnVisibility:t.state?.columnVisibility??h}}),{rows:q}=w.getRowModel(),{enabled:ee,virtualItems:te,paddingTop:ne,paddingBottom:oe,measureElement:ie}=re.useInfiniteScroll(q.length,u,R),E=u?.enabled,v=u?.hasNextPage,I=u?.isFetchingNextPage,L=u?.fetchNextPage,se=200,F=n.useCallback(e=>{if(!e||!E)return;const{scrollHeight:i,scrollTop:o,clientHeight:y}=e;i-o-y<se&&!I&&v&&L?.()},[E,v,I,L]);n.useEffect(()=>{F(R.current)},[F]),k.current=w,n.useEffect(()=>{k.current?.toggleAllRowsSelected(M)},[M]);const N=t.state?.sorting??b,p=t.state?.columnFilters??V,D=n.useMemo(()=>a.extractColumnFilterTypes(r),[r]);return n.useEffect(()=>{!g||typeof window>"u"||a.syncStateToUrl(N,p,d,D)},[g,N,p,d,D]),{id:s,table:w,rows:q,isVirtual:ee,virtualItems:te,paddingTop:ne,paddingBottom:oe,measureElement:ie,wrapperRef:R,toolbarRef:Z,loading:l,fetchMoreOnBottomReached:F,resetColumnVisibility:_}}exports.useDataGrid=ae;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.cjs"),h=require("react"),m=require("../Typography/Typography.cjs"),j=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs");function x({row:e,isSelected:i,visibleCellCount:g,virtualIndex:t,measureElement:r}){return l.jsx("tr",{"data-index":t,ref:t!==void 0?r:void 0,children:e.getVisibleCells().map(d=>{const o=d.column.getIsPinned();return l.jsx("td",{"data-pinned":o||void 0,children:y.flexRender(d.column.columnDef.cell,d.getContext())},d.id)})})}const u=h.memo(x,(e,i)=>e.row.id===i.row.id&&e.row.original===i.row.original&&e.isSelected===i.isSelected&&e.virtualIndex===i.virtualIndex&&e.visibleCellCount===i.visibleCellCount);function C({rows:e,columns:i,columnVisibility:g,rowRender:t,loading:r,rowSelectionState:d,virtualItems:o,paddingTop:a=0,paddingBottom:c=0,measureElement:b}){return!!(o&&o.length>0)&&o?l.jsxs("tbody",{children:[a>0&&l.jsx("tr",{children:l.jsx("td",{"aria-hidden":!0,style:{height:`${a}px`},colSpan:i.length})}),o.map(n=>{const s=e[n.index];return t?t(s,{key:s.id}):l.jsx(u,{row:s,isSelected:d?.[s.id]??!1,visibleCellCount:s.getVisibleCells().length,virtualIndex:n.index,measureElement:b},s.id)}),c>0&&l.jsx("tr",{children:l.jsx("td",{"aria-hidden":!0,style:{height:`${c}px`},colSpan:i.length})})]}):e.length>0?l.jsx("tbody",{children:e.map(n=>t?t(n,{key:n.id}):l.jsx(u,{row:n,isSelected:d?.[n.id]??!1,visibleCellCount:n.getVisibleCells().length},n.id))}):l.jsx("tbody",{children:l.jsx("tr",{children:l.jsx("td",{colSpan:i.length,children:l.jsx(j,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"200px"},children:l.jsx(m,{children:r?"Loading...":" There is no data available"})})})})})}const f=h.memo(C,(e,i)=>e.rowRender===i.rowRender&&e.loading===i.loading&&e.columns===i.columns&&e.columnVisibility===i.columnVisibility&&e.rows===i.rows&&e.rowSelectionState===i.rowSelectionState&&e.virtualItems===i.virtualItems&&e.paddingTop===i.paddingTop&&e.paddingBottom===i.paddingBottom);exports.TableBody=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),F=require("../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.cjs"),c=require("react"),$=require("./StickyHorizontalScrollbar.cjs"),S=require("./Table.styles.cjs"),C=require("./TableBody.cjs"),I=require("./TableHeader.cjs"),G=require("./hooks/useStickyHeader.cjs"),M=require("./hooks/useStickyScrollbar.cjs"),W=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Table/Table.cjs");function E({ctx:g,maxHeight:u=!1,wrapText:m=!1,rowRender:b,showStickyScrollbar:p=!1,enableStickyHeader:f=!1,stickyHeaderOffset:h=0,footer:x}){const{id:i,table:e,rows:y,isVirtual:n,virtualItems:T,paddingTop:z,paddingBottom:R,measureElement:j,wrapperRef:l,toolbarRef:q,loading:v,fetchMoreOnBottomReached:k}=g,d=c.useRef(null),H=M.useStickyScrollbar(l),w=G.useStickyHeader({enabled:f,stickyHeaderOffset:h,tableWrapperRef:l,theadRef:d,toolbarRef:q}),V=c.useMemo(()=>{const r=e.getFlatHeaders(),t={};for(let s=0;s<r.length;s+=1){const a=r[s];t[`--${i}-header-${a.id}-size`]=a.getSize(),t[`--${i}-col-${a.column.id}-size`]=a.column.getSize()}return t},[i,e.getState().columnSizingInfo,e.getState().columnSizing]),B=c.useMemo(()=>e.getFlatHeaders().reduce((t,s)=>t+s.getSize(),0),[e.getState().columnSizingInfo,e.getState().columnSizing]);return o.jsxs(o.Fragment,{children:[o.jsx(S.TableWrapper,{ref:l,"data-testid":"table-wrapper",$maxHeight:u,onScroll:r=>k(r.currentTarget),children:o.jsxs(W,{hoverRow:!0,"data-testid":i,sx:S.getTableStyles(V,B,m,w,u),children:[o.jsx(I,{headerGroups:e.getHeaderGroups(),id:i,theadRef:d}),o.jsx(C.TableBody,{rows:y,columns:e.getVisibleLeafColumns(),columnVisibility:e.getState().columnVisibility,rowRender:b,loading:v,rowSelectionState:e.getState().rowSelection,virtualItems:n?T:void 0,paddingTop:n?z:void 0,paddingBottom:n?R:void 0,measureElement:n?j:void 0}),x&&e.getFooterGroups().length>0&&o.jsx("tfoot",{children:e.getFooterGroups().map(r=>o.jsx("tr",{children:r.headers.map(t=>o.jsx("td",{colSpan:t.colSpan,children:F.flexRender(t.column.columnDef.footer,t.getContext())},t.id))},r.id))})]})}),p&&o.jsx($,{scrollContainerRef:l,visible:H,constrainToContainer:"main"})]})}module.exports=E;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),t=require("styled-components"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("styled-components"),h=require("../../../hooks/useLocalStorage.cjs");;/* empty css */const m=require("../Footer/Footer.cjs"),b=require("../Sidebar/Sidebar.cjs"),q=require("../ThemeProvider/ThemeProvider.cjs"),y=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs"),j=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Sheet/Sheet.cjs"),S=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
height: 100vh;
|
|
5
5
|
width: 100%;
|
|
6
|
-
`,
|
|
6
|
+
`,k=t.a`
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: -100%;
|
|
9
9
|
left: 0;
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
&:focus {
|
|
19
19
|
top: 0;
|
|
20
20
|
}
|
|
21
|
-
`;function
|
|
21
|
+
`;function L({children:i,header:s,theme:c="light_internal",showSidebar:a,sidebarContent:l,sidebarWidth:o=240,collapsedSidebarWidth:n=60,sidebarHeaderContent:u,sidebarFooterContent:x,footerReleaseName:d,footerCopyright:p}){const[r,f]=h.useLocalStorage("sidebarOpen",!0),g=()=>{f(!r)};return e.jsx(q,{theme:c,children:e.jsxs(S,{children:[e.jsx(k,{href:"#main",children:"Skip to content"}),s,e.jsxs(y,{sx:{display:"flex",flex:1},children:[a?e.jsx(b,{sidebarOpen:r,onSidebarToggle:g,sidebarContent:l,sidebarWidth:o,collapsedSidebarWidth:n,headerContent:u,footerContent:x}):null,e.jsxs(j.default,{component:"main",id:"main",tabIndex:-1,sx:{bgcolor:"background.body",transition:"margin-left 0.3s ease",display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,width:{xs:"100%",md:`calc(100% - ${r?o:n}px)`,xl:`calc(100% - ${r?o*1.25:n}px)`}},children:[i,e.jsx(m,{releaseName:d,copyright:p})]})]})]})})}module.exports=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),a=require("../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),p=require("react"),b=require("../../../constants.cjs"),h=require("../../data-display/Icon/Icon.cjs"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),p=require("react"),b=require("../../../constants.cjs"),h=require("../../data-display/Icon/Icon.cjs"),g=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Sheet/Sheet.cjs"),s=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.cjs"),m=require("../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/IconButton/IconButton.cjs");function k(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const i=k(p),u=50;function j({sidebarOpen:e=!0,onSidebarToggle:o,headerContent:r,footerContent:n,sidebarContent:l,sidebarWidth:c,collapsedSidebarWidth:d}){const x=i.isValidElement(l)?i.cloneElement(l,{sidebarOpen:e,onSidebarToggle:o}):l,f=i.isValidElement(r)?i.cloneElement(r,{sidebarOpen:e,onSidebarToggle:o}):r;return t.jsxs(g.default,{component:"aside",sx:{backgroundColor:"background.surface",width:{xs:0,md:e?`${c}px`:`${d}px`,xl:e&&c?`${c*1.25}px`:`${d}px`},transition:"width 0.3s ease",flex:"0 0 auto",borderRight:"1px solid",borderColor:"divider",overflow:"hidden",flexDirection:"column",height:"100vh",position:"sticky",top:0,display:{xs:"none",md:"flex"}},children:[r?t.jsx(s,{sx:{backgroundColor:"background.surface",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center",p:1,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:f}):null,t.jsx(s,{sx:{flexGrow:1,display:"flex",flexDirection:"column",overflowY:"auto",overflowX:"hidden",minHeight:0,paddingBottom:`${u+b.APPBAR_HEIGHT}px`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:"neutral.300",borderRadius:"3px","&:hover":{backgroundColor:"neutral.400"}}},children:x}),n?t.jsx(s,{sx:{height:64,display:"flex",alignItems:"center",justifyContent:e?"flex-start":"center",px:1,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:n}):null,t.jsx(m.default,{"aria-label":"Toggle Sidebar",variant:"plain",onClick:o,sx:{backgroundColor:"background.surface",height:u,display:"flex",alignItems:"center",justifyContent:e?"flex-end":"center",px:2,borderTop:"1px solid",borderRight:"1px solid",borderColor:"divider",flexShrink:0,borderRadius:0,position:"fixed",bottom:0,width:"inherit"},children:t.jsx(h,{icon:e?a.faArrowLeft:a.faArrowRight})})]})}module.exports=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"]},o={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]},f={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},s={prefix:"fas",iconName:"chevron-up",icon:[512,512,[],"f077","M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},n={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},a={prefix:"fas",iconName:"table-columns",icon:[512,512,["columns"],"f0db","M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"]},r=a,e={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},t=e,m={prefix:"fas",iconName:"filter",icon:[512,512,[],"f0b0","M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]},L={prefix:"fas",iconName:"file-excel",icon:[384,512,[],"f1c3","M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM155.7 250.2L192 302.1l36.3-51.9c7.6-10.9 22.6-13.5 33.4-5.9s13.5 22.6 5.9 33.4L221.3 344l46.4 66.2c7.6 10.9 5 25.8-5.9 33.4s-25.8 5-33.4-5.9L192 385.8l-36.3 51.9c-7.6 10.9-22.6 13.5-33.4 5.9s-13.5-22.6-5.9-33.4L162.7 344l-46.4-66.2c-7.6-10.9-5-25.8 5.9-33.4s25.8-5 33.4 5.9z"]},C={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},x={prefix:"fas",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]},z={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},p={prefix:"fas",iconName:"ellipsis-vertical",icon:[128,512,["ellipsis-v"],"f142","M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]},M={prefix:"fas",iconName:"arrow-down",icon:[384,512,[8595],"f063","M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},N={prefix:"fas",iconName:"arrow-up",icon:[384,512,[8593],"f062","M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]},c={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},w=c,h=c,i={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},u=i;exports.faArrowDown=M;exports.faArrowLeft=z;exports.faArrowRight=C;exports.faArrowUp=N;exports.faBars=o;exports.faCheckCircle=t;exports.faChevronUp=s;exports.faCircle=x;exports.faCircleCheck=e;exports.faCircleExclamation=f;exports.faCircleNotch=l;exports.faClose=w;exports.faColumns=r;exports.faEllipsisVertical=p;exports.faExclamationTriangle=u;exports.faFileExcel=L;exports.faFilter=m;exports.faRotateLeft=n;exports.faTableColumns=a;exports.faTimes=h;exports.faTriangleExclamation=i;exports.faXmark=c;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, Fragment as b, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import y from "../../feedback/Alert/Alert.js";
|
|
3
3
|
import l from "../../feedback/CircularProgress/CircularProgress.js";
|
|
4
|
-
import
|
|
5
|
-
import { LoadingOverlay as
|
|
6
|
-
import
|
|
7
|
-
import { useDataGrid as
|
|
4
|
+
import C from "../Typography/Typography.js";
|
|
5
|
+
import { LoadingOverlay as F } from "../Table/Table.styles.js";
|
|
6
|
+
import T from "./TableToolbar.js";
|
|
7
|
+
import { useDataGrid as j } from "./hooks/useDataGrid.js";
|
|
8
8
|
import s from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
|
|
9
|
-
function
|
|
9
|
+
function w({
|
|
10
10
|
id: n,
|
|
11
|
-
loading:
|
|
11
|
+
loading: a = !1,
|
|
12
12
|
reactTableOptions: m,
|
|
13
13
|
gridCheckboxes: d = !1,
|
|
14
14
|
allSelected: f = !1,
|
|
@@ -16,14 +16,14 @@ function z({
|
|
|
16
16
|
infiniteScroll: t,
|
|
17
17
|
syncUrl: g = !1,
|
|
18
18
|
urlParamPrefix: p = "",
|
|
19
|
-
renderLayout:
|
|
20
|
-
toolbar:
|
|
21
|
-
isError:
|
|
19
|
+
renderLayout: u,
|
|
20
|
+
toolbar: o,
|
|
21
|
+
isError: x = !1,
|
|
22
22
|
errorMessage: h = "An error occurred while loading data. Please try again."
|
|
23
23
|
}) {
|
|
24
|
-
const e =
|
|
24
|
+
const e = j({
|
|
25
25
|
id: n,
|
|
26
|
-
loading:
|
|
26
|
+
loading: a,
|
|
27
27
|
reactTableOptions: m,
|
|
28
28
|
gridCheckboxes: d,
|
|
29
29
|
allSelected: f,
|
|
@@ -32,22 +32,23 @@ function z({
|
|
|
32
32
|
syncUrl: g,
|
|
33
33
|
urlParamPrefix: p
|
|
34
34
|
});
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
return /* @__PURE__ */ i(b, { children: [
|
|
36
|
+
x && /* @__PURE__ */ r(y, { color: "danger", sx: { marginBottom: 1 }, children: h }),
|
|
37
|
+
o?.enabled && /* @__PURE__ */ r(
|
|
38
|
+
T,
|
|
39
39
|
{
|
|
40
40
|
ref: e.toolbarRef,
|
|
41
|
-
toolbar:
|
|
41
|
+
toolbar: o,
|
|
42
42
|
columnFilters: e.table.getState().columnFilters,
|
|
43
|
-
table: e.table
|
|
43
|
+
table: e.table,
|
|
44
|
+
resetColumnVisibility: e.resetColumnVisibility
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/* @__PURE__ */ i(s, { sx: { position: "relative" }, children: [
|
|
48
|
+
a && /* @__PURE__ */ r(F, { children: /* @__PURE__ */ r(l, {}) }),
|
|
49
|
+
u(e)
|
|
49
50
|
] }),
|
|
50
|
-
e.isVirtual && t?.isFetchingNextPage && /* @__PURE__ */
|
|
51
|
+
e.isVirtual && t?.isFetchingNextPage && /* @__PURE__ */ i(
|
|
51
52
|
s,
|
|
52
53
|
{
|
|
53
54
|
sx: {
|
|
@@ -59,12 +60,12 @@ function z({
|
|
|
59
60
|
},
|
|
60
61
|
children: [
|
|
61
62
|
/* @__PURE__ */ r(l, { size: "sm" }),
|
|
62
|
-
/* @__PURE__ */ r(
|
|
63
|
+
/* @__PURE__ */ r(C, { children: t.loadingText ?? "Loading more..." })
|
|
63
64
|
]
|
|
64
65
|
}
|
|
65
66
|
)
|
|
66
67
|
] });
|
|
67
68
|
}
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
w as default
|
|
70
71
|
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { faColumns as h, faRotateLeft as g } from "../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
3
|
+
import x from "react";
|
|
4
|
+
import b from "../../inputs/Button/Button.js";
|
|
5
|
+
import C from "../../inputs/Checkbox/Checkbox.js";
|
|
6
|
+
import f from "../Icon/Icon.js";
|
|
7
|
+
import y from "../Typography/Typography.js";
|
|
8
|
+
import { Dropdown as v } from "../../../node_modules/.pnpm/@mui_base@5.0.0-beta.40-1_@types_react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@mui/base/Dropdown/Dropdown.js";
|
|
9
|
+
import w from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.js";
|
|
10
|
+
import D from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Menu/Menu.js";
|
|
11
|
+
import a from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
|
|
12
|
+
import L from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Input/Input.js";
|
|
13
|
+
import d from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Divider/Divider.js";
|
|
14
|
+
import z from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuItem/MenuItem.js";
|
|
15
|
+
function M(o) {
|
|
16
|
+
return o.replace(/_/g, " ").replace(/([A-Z])/g, " $1").trim().toLowerCase().replace(/\b\w/g, (r) => r.toUpperCase());
|
|
17
|
+
}
|
|
18
|
+
function l(o) {
|
|
19
|
+
if (o.columnDef.meta?.columnLabel) return o.columnDef.meta.columnLabel;
|
|
20
|
+
const { header: r } = o.columnDef;
|
|
21
|
+
if (typeof r == "string") return r;
|
|
22
|
+
if (typeof r == "function")
|
|
23
|
+
try {
|
|
24
|
+
const n = r();
|
|
25
|
+
if (typeof n == "string") return n;
|
|
26
|
+
if (typeof n == "number") return String(n);
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
return M(o.id);
|
|
30
|
+
}
|
|
31
|
+
function P({
|
|
32
|
+
table: o,
|
|
33
|
+
onReset: r
|
|
34
|
+
}) {
|
|
35
|
+
const [n, s] = x.useState(""), u = o.getAllLeafColumns().filter(
|
|
36
|
+
(e) => e.id !== "select" && !e.columnDef.meta?.excludeFromManageColumns
|
|
37
|
+
).sort((e, i) => l(e).localeCompare(l(i))), c = n ? u.filter(
|
|
38
|
+
(e) => l(e).toLowerCase().includes(n.toLowerCase())
|
|
39
|
+
) : u;
|
|
40
|
+
return /* @__PURE__ */ m(
|
|
41
|
+
v,
|
|
42
|
+
{
|
|
43
|
+
onOpenChange: (e, i) => {
|
|
44
|
+
i || s("");
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
w,
|
|
49
|
+
{
|
|
50
|
+
size: "sm",
|
|
51
|
+
variant: "outlined",
|
|
52
|
+
color: "neutral",
|
|
53
|
+
sx: { minWidth: "auto", px: 0.75 },
|
|
54
|
+
"aria-label": "Manage columns",
|
|
55
|
+
title: "Manage columns",
|
|
56
|
+
children: /* @__PURE__ */ t(f, { icon: h, size: "sm" })
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ m(D, { placement: "bottom-end", sx: { p: 0, minWidth: 260, maxWidth: 320 }, children: [
|
|
60
|
+
/* @__PURE__ */ t(a, { sx: { p: 1 }, children: /* @__PURE__ */ t(
|
|
61
|
+
L,
|
|
62
|
+
{
|
|
63
|
+
size: "sm",
|
|
64
|
+
placeholder: "Search columns...",
|
|
65
|
+
value: n,
|
|
66
|
+
onChange: (e) => s(e.target.value),
|
|
67
|
+
onClick: (e) => e.stopPropagation()
|
|
68
|
+
}
|
|
69
|
+
) }),
|
|
70
|
+
/* @__PURE__ */ t(d, {}),
|
|
71
|
+
/* @__PURE__ */ m(a, { sx: { maxHeight: 300, overflowY: "auto", py: 0.5 }, children: [
|
|
72
|
+
c.map((e) => {
|
|
73
|
+
const i = l(e), p = !!e.columnDef.meta?.alwaysVisible;
|
|
74
|
+
return /* @__PURE__ */ t(
|
|
75
|
+
a,
|
|
76
|
+
{
|
|
77
|
+
sx: {
|
|
78
|
+
px: 1.5,
|
|
79
|
+
py: 0.5,
|
|
80
|
+
"&:hover": { bgcolor: "background.level1" }
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ t(
|
|
83
|
+
C,
|
|
84
|
+
{
|
|
85
|
+
size: "sm",
|
|
86
|
+
label: i,
|
|
87
|
+
checked: e.getIsVisible(),
|
|
88
|
+
disabled: p,
|
|
89
|
+
onChange: () => e.toggleVisibility(),
|
|
90
|
+
sx: {
|
|
91
|
+
width: "100%",
|
|
92
|
+
cursor: p ? "default" : "pointer"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
},
|
|
97
|
+
e.id
|
|
98
|
+
);
|
|
99
|
+
}),
|
|
100
|
+
c.length === 0 && /* @__PURE__ */ t(a, { sx: { px: 2, py: 1 }, children: /* @__PURE__ */ t(y, { level: "body-sm", sx: { color: "text.tertiary" }, children: "No columns found" }) })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ t(d, {}),
|
|
103
|
+
/* @__PURE__ */ t(z, { onClick: r, sx: { gap: 1 }, children: /* @__PURE__ */ t(
|
|
104
|
+
b,
|
|
105
|
+
{
|
|
106
|
+
variant: "plain",
|
|
107
|
+
color: "neutral",
|
|
108
|
+
size: "sm",
|
|
109
|
+
fullWidth: !0,
|
|
110
|
+
startDecorator: /* @__PURE__ */ t(f, { icon: g, size: "sm" }),
|
|
111
|
+
children: "Reset"
|
|
112
|
+
}
|
|
113
|
+
) })
|
|
114
|
+
] })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
P as default
|
|
121
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import c from "react";
|
|
3
3
|
import r from "styled-components";
|
|
4
|
-
import
|
|
4
|
+
import m from "../Typography/Typography.js";
|
|
5
5
|
import x from "./ExportToExcelButton.js";
|
|
6
6
|
import f from "./FilterChipsSection.js";
|
|
7
|
+
import g from "./ManageColumnsDropdown.js";
|
|
7
8
|
import o from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
|
|
8
|
-
const
|
|
9
|
+
const u = r(o)`
|
|
9
10
|
display: flex;
|
|
10
11
|
flex-direction: column;
|
|
11
12
|
gap: 8px;
|
|
@@ -16,15 +17,20 @@ const g = r(o)`
|
|
|
16
17
|
position: sticky;
|
|
17
18
|
top: 0;
|
|
18
19
|
z-index: 1;
|
|
19
|
-
`,
|
|
20
|
+
`, h = r(o)`
|
|
20
21
|
display: flex;
|
|
21
22
|
align-items: center;
|
|
22
23
|
justify-content: space-between;
|
|
23
24
|
width: 100%;
|
|
24
25
|
`;
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
function T({
|
|
27
|
+
toolbar: e,
|
|
28
|
+
columnFilters: i,
|
|
29
|
+
table: n,
|
|
30
|
+
resetColumnVisibility: s
|
|
31
|
+
}, d) {
|
|
32
|
+
const p = n.getFilteredRowModel().rows.length, a = i.length > 0;
|
|
33
|
+
return /* @__PURE__ */ t(u, { ref: d, children: /* @__PURE__ */ l(h, { children: [
|
|
28
34
|
/* @__PURE__ */ l(o, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
29
35
|
e.leftContent ? e.leftContent : null,
|
|
30
36
|
e.exportToExcel?.enabled && /* @__PURE__ */ t(
|
|
@@ -34,15 +40,22 @@ function h({ toolbar: e, columnFilters: n, table: i }, s) {
|
|
|
34
40
|
disabled: e.exportToExcel.disabled
|
|
35
41
|
}
|
|
36
42
|
),
|
|
37
|
-
e.showFilterChips ? /* @__PURE__ */ t(f, { columnFilters:
|
|
43
|
+
e.showFilterChips ? /* @__PURE__ */ t(f, { columnFilters: i, table: n }) : null
|
|
38
44
|
] }),
|
|
39
45
|
/* @__PURE__ */ l(o, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
40
|
-
e.totalResults !== void 0 && /* @__PURE__ */ t(
|
|
41
|
-
e.rightContent ? e.rightContent : null
|
|
46
|
+
e.totalResults !== void 0 && /* @__PURE__ */ t(m, { level: "body-sm", sx: { fontWeight: 500 }, children: a ? `Showing ${p.toLocaleString()} of ${e.totalResults.toLocaleString()} results` : `Total Results: ${e.totalResults.toLocaleString()}` }),
|
|
47
|
+
e.rightContent ? e.rightContent : null,
|
|
48
|
+
e.manageColumns?.enabled && /* @__PURE__ */ t(
|
|
49
|
+
g,
|
|
50
|
+
{
|
|
51
|
+
table: n,
|
|
52
|
+
onReset: s
|
|
53
|
+
}
|
|
54
|
+
)
|
|
42
55
|
] })
|
|
43
56
|
] }) });
|
|
44
57
|
}
|
|
45
|
-
const
|
|
58
|
+
const j = c.forwardRef(T);
|
|
46
59
|
export {
|
|
47
|
-
|
|
60
|
+
j as default
|
|
48
61
|
};
|