mantine-datatable 7.1.2 → 7.1.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.
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +49 -37
- package/dist/styles.css.map +1 -1
- package/dist/styles.layer.css +45 -30
- package/dist/styles.layer.css.map +1 -1
- package/package.json +19 -17
package/dist/index.d.ts
CHANGED
|
@@ -671,6 +671,10 @@ type DataTableProps<T = Record<string, unknown>> = {
|
|
|
671
671
|
* If true, will show a loader with semi-transparent background, centered over the table.
|
|
672
672
|
*/
|
|
673
673
|
fetching?: boolean;
|
|
674
|
+
/**
|
|
675
|
+
* If true, the last column will be pinned to the right side of the table.
|
|
676
|
+
*/
|
|
677
|
+
pinLastColumn?: boolean;
|
|
674
678
|
/**
|
|
675
679
|
* Default column props; will be merged with column props provided to each column
|
|
676
680
|
*/
|
|
@@ -768,7 +772,7 @@ type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
|
768
772
|
[Property in Key]-?: Type[Property];
|
|
769
773
|
};
|
|
770
774
|
|
|
771
|
-
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, groups, defaultColumnProps, defaultColumnRender, idAccessor, records, selectedRecords, onSelectedRecordsChange, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowContextMenu, onCellClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
|
|
775
|
+
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, groups, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectedRecords, onSelectedRecordsChange, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowContextMenu, onCellClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
|
|
772
776
|
|
|
773
777
|
/**
|
|
774
778
|
* Utility function that returns a humanized version of a string, e.g. "camelCase" -> "Camel Case"
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var Qo=Object.create;var We=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Uo=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Jo=(e,t)=>{for(var a in t)We(e,a,{get:t[a],enumerable:!0})},Lt=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $o(t))!Ko.call(e,o)&&o!==a&&We(e,o,{get:()=>t[o],enumerable:!(n=Xo(t,o))||n.enumerable});return e};var N=(e,t,a)=>(a=e!=null?Qo(Uo(e)):{},Lt(t||!e||!e.__esModule?We(a,"default",{value:e,enumerable:!0}):a,e)),Zo=e=>Lt(We({},"__esModule",{value:!0}),e);var jo={};Jo(jo,{DataTable:()=>Ga,differenceBy:()=>ct,getRecordId:()=>C,getValueAtPath:()=>Xe,humanize:()=>ke,uniqBy:()=>Re});module.exports=Zo(jo);var Ye=require("@mantine/core"),Wa=require("@mantine/hooks"),gt=N(require("clsx")),I=require("react");var dt=require("react/jsx-runtime");function Ht(){return(0,dt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,dt.jsx)("td",{})})}var Ge=require("@mantine/core");var B=require("react/jsx-runtime");function Ft(){return(0,B.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,B.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,B.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,B.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,B.jsx)("path",{d:"M3 3l18 18"})]})}var O=require("react/jsx-runtime");function Vt({icon:e,text:t,pt:a,pb:n,active:o,children:r}){return(0,O.jsx)(Ge.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:r||(0,O.jsxs)(O.Fragment,{children:[e||(0,O.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,O.jsx)(Ft,{})}),(0,O.jsx)(Ge.Text,{size:"sm",c:"dimmed",children:t})]})})}var be=require("@mantine/core"),aa=N(require("clsx")),oa=require("react");var Jt=require("@mantine/core"),Zt=N(require("clsx"));var At=require("@mantine/hooks");function pe(){let[e]=(0,At.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var Be=require("react"),_t=typeof window<"u"?Be.useLayoutEffect:Be.useEffect;var Qe=require("react");function Ot(e){let[t,a]=(0,Qe.useState)(null),n=e?.join(":")||"";return(0,Qe.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var ce=require("react");function Yo(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function qo(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function zt(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,ce.useState)(a?t:qo(e,t)),r=(0,ce.useRef)();return(0,ce.useEffect)(()=>{if("matchMedia"in window)return r.current=e.map(i=>window.matchMedia(i)),o(r.current.map(i=>i.matches)),Yo(r.current,i=>{o(i)})},[e]),n}var Wt=require("@mantine/core"),pt=require("react");function Gt(e){let t=(0,Wt.useMantineTheme)(),a=(0,pt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,pt.useMemo)(()=>e.map(()=>!0),[e]);return zt(a,n)}var Bt=require("@mantine/core"),Qt=require("@mantine/hooks");function Q(e){let t=(0,Bt.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,Qt.useMediaQuery)(a||"",!0)}var Xt=require("react");function ke(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function ct(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function Re(e,t){return e.filter((a,n,o)=>n===o.findIndex(r=>t(a)===t(r)))}function Xe(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function C(e,t){return typeof t=="string"?Xe(e,t):t(e)}function $t({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:l,allowMultiple:d,initiallyExpanded:s}=e;t&&l==="always"?n=t.map(u=>C(u,a)):s&&(n=t.filter((u,b)=>s({record:u,index:b})).map(u=>C(u,a)),d||(n=[n[0]]))}let o,r,i=(0,Xt.useState)(n);if(e){let{trigger:l,allowMultiple:d,collapseProps:s,content:u}=e;e.expanded?{recordIds:o,onRecordIdsChange:r}=e.expanded:[o,r]=i;let b=p=>r?.(o.filter(c=>c!==C(p,a)));return{expandOnClick:l!=="always"&&l!=="never",isRowExpanded:p=>l==="always"?!0:o.includes(C(p,a)),expandRow:p=>{let c=C(p,a);r?.(d?[...o,c]:[c])},collapseRow:b,collapseProps:s,content:({record:p,index:c})=>()=>u({record:p,index:c,collapse:()=>b(p)})}}}var mt=require("@mantine/hooks"),ve=require("react");function Ut(e,t){let[a,n]=(0,ve.useState)(e),[o,r]=(0,ve.useState)(e),i=(0,mt.useTimeout)(()=>n(!0),0),l=(0,mt.useTimeout)(()=>r(!1),t||200);return(0,ve.useEffect)(()=>{e?(l.clear(),r(!0),i.start()):(i.clear(),n(!1),l.start())},[i,l,e]),{expanded:a,visible:o}}var me="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",X="mantine-datatable-pointer-cursor",Kt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",U="mantine-datatable-text-align-center",K="mantine-datatable-text-align-right";var qt=require("react/jsx-runtime");function Yt({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:r,textAlign:i,width:l}){return Q(a)?(0,qt.jsx)(Jt.TableTh,{className:(0,Zt.default)({[me]:o||r,[ue]:r,[$]:i==="left",[U]:i==="center",[K]:i==="right"},e),style:[{width:l,minWidth:l,maxWidth:l},t],children:n}):null}var jt=require("@mantine/core"),ta=require("react/jsx-runtime");function ea({shadowVisible:e}){return(0,ta.jsx)(jt.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var fe=require("react/jsx-runtime"),na=(0,oa.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:r,leftShadowVisible:i,scrollDiff:l},d){let s=l<0;return(0,fe.jsx)(be.TableTfoot,{ref:d,className:(0,aa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,be.rem)(s?l:0)},a],children:(0,fe.jsxs)(be.TableTr,{children:[r&&(0,fe.jsx)(ea,{shadowVisible:i}),n.map(({hidden:u,...b})=>{if(u)return null;let{accessor:p,visibleMediaQuery:c,textAlign:f,width:y,footer:T,footerClassName:P,footerStyle:R,noWrap:A,ellipsis:v}={...o,...b};return(0,fe.jsx)(Yt,{className:P,style:R,visibleMediaQuery:c,textAlign:f,width:y,title:T,noWrap:A,ellipsis:v},p)})]})})});var Ie=require("@mantine/core"),ha=N(require("clsx")),ga=require("react");var ra=require("@mantine/core"),la=N(require("clsx")),ut=require("react");var sa=require("react/jsx-runtime");function ia({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:r}}){let i=(0,ut.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),l=Gt(i),d=(0,ut.useMemo)(()=>t.filter(({hidden:s},u)=>!s&&l?.[u]).length,[t,l]);return d>0?(0,sa.jsx)(ra.TableTh,{colSpan:d,className:(0,la.default)({[$]:n==="left",[U]:n==="center",[K]:n==="right"},o),style:r,children:a??ke(e)}):null}var z=require("@mantine/core"),$e=N(require("clsx"));var ne=require("@mantine/core"),ca=require("@mantine/hooks");var Ee=require("react/jsx-runtime");function da(){return(0,Ee.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ee.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ee.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var Ne=require("react/jsx-runtime");function pa(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var oe=require("react/jsx-runtime");function ma({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,ca.useDisclosure)(!1);return(0,oe.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,oe.jsx)(ne.PopoverTarget,{children:(0,oe.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,oe.jsx)(t?pa:da,{})})}),(0,oe.jsx)(ne.Popover.Dropdown,{onClick:i=>i.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var re=require("react/jsx-runtime");function ua(){return(0,re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,re.jsx)("path",{d:"M12 5l0 14"}),(0,re.jsx)("path",{d:"M16 9l-4 -4"}),(0,re.jsx)("path",{d:"M8 9l4 -4"})]})}var le=require("react/jsx-runtime");function fa(){return(0,le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,le.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,le.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,le.jsx)("path",{d:"M12 3l0 18"})]})}var D=require("react/jsx-runtime");function ba({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:r,sortIcons:i,textAlign:l,width:d,sortStatus:s,onSortStatusChange:u,filter:b,filtering:p}){if(!Q(n))return null;let c=o??ke(a),f=typeof c=="string"?c:void 0,y=r&&u?T=>{T?.defaultPrevented||u({columnAccessor:a,direction:s?.columnAccessor===a?s.direction==="asc"?"desc":"asc":s?.direction??"asc"})}:void 0;return(0,D.jsx)(z.TableTh,{className:(0,$e.default)({"mantine-datatable-header-cell-sortable":r},e),style:[{width:d,minWidth:d,maxWidth:d},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:y,onKeyDown:T=>T.key==="Enter"&&y?.(),children:(0,D.jsxs)(z.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,D.jsx)(z.Box,{className:(0,$e.default)("mantine-datatable-header-cell-sortable-text",{[$]:l==="left",[U]:l==="center",[K]:l==="right"},me,ue),title:f,children:c}),r||s?.columnAccessor===a?(0,D.jsx)(D.Fragment,{children:s?.columnAccessor===a?(0,D.jsx)(z.Center,{className:(0,$e.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":s.direction==="desc"}),role:"img","aria-label":`Sorted ${s.direction==="desc"?"descending":"ascending"}`,children:i?.sorted||(0,D.jsx)(ua,{})}):(0,D.jsx)(z.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:i?.unsorted||(0,D.jsx)(fa,{})})}):null,b?(0,D.jsx)(ma,{isActive:!!p,children:b}):null]})})}var Ue=require("@mantine/core");var ft=require("react/jsx-runtime");function Ta({shadowVisible:e,checked:t,indeterminate:a,checkboxProps:n,onChange:o,rowSpan:r}){return(0,ft.jsx)(Ue.TableTh,{className:"mantine-datatable-header-selector-cell",rowSpan:r,"data-shadow-visible":e||void 0,children:(0,ft.jsx)(Ue.Checkbox,{classNames:{input:X},checked:t,indeterminate:a,onChange:o,...n,disabled:!(o||n.onChange)||n.disabled})})}var J=require("react/jsx-runtime"),Ca=(0,ga.forwardRef)(function({className:t,style:a,sortStatus:n,sortIcons:o,onSortStatusChange:r,columns:i,defaultColumnProps:l,groups:d,selectionVisible:s,selectionChecked:u,selectionIndeterminate:b,onSelectionChange:p,selectionCheckboxProps:c,leftShadowVisible:f},y){let T=s?(0,J.jsx)(Ta,{shadowVisible:f,checked:u,indeterminate:b,checkboxProps:c,onChange:p,rowSpan:d?2:void 0}):null;return(0,J.jsxs)(Ie.TableThead,{className:(0,ha.default)("mantine-datatable-header",t),style:a,ref:y,children:[d&&(0,J.jsxs)(Ie.TableTr,{children:[T,d.map(P=>(0,J.jsx)(ia,{group:P},P.id))]}),(0,J.jsxs)(Ie.TableTr,{children:[!d&&T,i.map(({hidden:P,...R})=>{if(P)return null;let{accessor:A,visibleMediaQuery:v,textAlign:S,width:x,title:w,sortable:L,titleClassName:M,titleStyle:q,filter:ge,filtering:Ce}={...l,...R};return(0,J.jsx)(ba,{accessor:A,className:M,style:q,visibleMediaQuery:v,textAlign:S,width:x,title:w,sortable:L,sortStatus:n,sortIcons:o,onSortStatusChange:r,filter:ge,filtering:Ce},A)})]})]})});var Ke=require("@mantine/core"),ya=N(require("clsx")),bt=require("react/jsx-runtime");function wa({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:r,type:i,color:l}){return(0,bt.jsx)(Ke.Center,{pt:e,pb:t,className:(0,ya.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,bt.jsx)(Ke.Loader,{size:r,type:i,color:l}))})}var Z=require("@mantine/core"),Tt=N(require("clsx")),va=require("react");var h=require("@mantine/core"),ka=N(require("clsx"));var Sa=require("@mantine/core");function g(e,t,a){return e?(0,Sa.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Pa({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:r,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":g(t,e,"light"),"--mantine-datatable-color-dark":g(t,e,"dark"),"--mantine-datatable-background-color-light":g(a,e,"light"),"--mantine-datatable-background-color-dark":g(a,e,"dark"),"--mantine-datatable-border-color-light":g(n,e,"light"),"--mantine-datatable-border-color-dark":g(n,e,"dark"),"--mantine-datatable-row-border-color-light":g(o,e,"light"),"--mantine-datatable-row-border-color-dark":g(o,e,"dark"),"--mantine-datatable-striped-color-light":g(r,e,"light"),"--mantine-datatable-striped-color-dark":g(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":g(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":g(i,e,"dark")}}function Je({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":g(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":g(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":g(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":g(a,e,"dark")}}function xa({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":g(t,e,"light"),"--mantine-datatable-row-color-dark":g(t,e,"dark"),"--mantine-datatable-row-background-color-light":g(a,e,"light"),"--mantine-datatable-row-background-color-dark":g(a,e,"dark")}}var Te=require("react/jsx-runtime");function Ma(){return(0,Te.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Te.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Te.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Te.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var V=require("react/jsx-runtime"),Da={xs:(0,h.rem)(22),sm:(0,h.rem)(26),md:(0,h.rem)(32),lg:(0,h.rem)(38),xl:(0,h.rem)(44)};function Ra({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:r,onChange:i}){return(0,V.jsxs)(h.Group,{gap:"xs",children:[(0,V.jsx)(h.Text,{size:e,children:t}),(0,V.jsxs)(h.Menu,{withinPortal:!0,withArrow:!0,children:[(0,V.jsx)(h.MenuTarget,{children:(0,V.jsx)(h.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,V.jsx)(Ma,{}),style:[{fontWeight:"normal"},l=>({height:Da[e],paddingLeft:l.spacing[e],paddingRight:l.spacing[e]})],children:n})}),(0,V.jsx)(h.MenuDropdown,{children:a.map(l=>{let d=l===n;return(0,V.jsx)(h.MenuItem,{className:(0,ka.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:Da[e]},d&&(o||r)?s=>Je({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:r}):void 0],disabled:d,onClick:()=>i(l),children:(0,V.jsx)(h.Text,{size:e,children:l})},l)})})]})]})}var he=require("react/jsx-runtime"),Ea=(0,va.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:r,paginationWithEdges:i,paginationActiveTextColor:l,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:u,noRecordsText:b,paginationText:p,totalRecords:c,recordsPerPage:f,onRecordsPerPageChange:y,recordsPerPageLabel:T,recordsPerPageOptions:P,recordsLength:R,horizontalSpacing:A,paginationWrapBreakpoint:v,getPaginationControlProps:S},x){let w;if(n)w=u;else if(!c)w=b;else{let M=(o-1)*f+1,q=M+R-1;w=p({from:M,to:q,totalRecords:c})}let L=Q(({breakpoints:M})=>`(min-width: ${typeof v=="number"?`${(0,Z.rem)(v)}rem`:M[v]||v})`);return(0,he.jsxs)(Z.Box,{ref:x,px:A??"xs",py:"xs",className:(0,Tt.default)("mantine-datatable-pagination",t),style:[{flexDirection:L?"row":"column"},a],children:[(0,he.jsx)(Z.Text,{className:"mantine-datatable-pagination-text",size:s,children:w}),P&&(0,he.jsx)(Ra,{activeTextColor:l,activeBackgroundColor:d,size:s,label:T,values:P,value:f,onChange:y}),(0,he.jsx)(Z.Pagination,{classNames:{root:(0,Tt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!R}),control:"mantine-datatable-pagination-pages-control"},style:l||d?M=>Je({theme:M,paginationActiveTextColor:l,paginationActiveBackgroundColor:d}):void 0,withEdges:i,value:o,onChange:r,size:s,total:Math.ceil(c/f),getControlProps:S})]})});var Aa=require("@mantine/core"),_a=N(require("clsx"));var Na=require("@mantine/core"),Ia=N(require("clsx"));var Ha=require("react/jsx-runtime");function La({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:r,onContextMenu:i,noWrap:l,ellipsis:d,textAlign:s,width:u,accessor:b,render:p,defaultRender:c,customCellAttributes:f}){return Q(a)?(0,Ha.jsx)(Na.TableTd,{className:(0,Ia.default)({[me]:l||d,[ue]:d,[X]:r,[$]:s==="left",[U]:s==="center",[K]:s==="right"},e),style:[{width:u,minWidth:u,maxWidth:u},t],onClick:r,onContextMenu:i,...f?.(n,o),children:p?p(n,o):c?c(n,o,b):Xe(n,b)}):null}var ie=require("@mantine/core");var _=require("react/jsx-runtime");function Fa({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:r}=Ut(e,n?.transitionDuration);return r?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ie.TableTr,{}),(0,_.jsx)(ie.TableTr,{children:(0,_.jsx)(ie.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,_.jsx)(ie.Collapse,{in:o,...n,children:(0,_.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var Ze=require("@mantine/core");var ht=require("react/jsx-runtime");function Va({record:e,index:t,withRightShadow:a,getCheckboxProps:n,...o}){return(0,ht.jsx)(Ze.TableTd,{className:"mantine-datatable-row-selector-cell","data-shadow-visible":a||void 0,onClick:r=>r.stopPropagation(),children:(0,ht.jsx)(Ze.Checkbox,{classNames:{input:X},...o,...n(e,t)})})}var W=require("react/jsx-runtime");function Oa({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionVisible:r,selectionChecked:i,onSelectionChange:l,isRecordSelectable:d,getSelectionCheckboxProps:s,onClick:u,onContextMenu:b,onCellClick:p,onCellContextMenu:c,expansion:f,customAttributes:y,color:T,backgroundColor:P,className:R,style:A,leftShadowVisible:v}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Aa.TableTr,{className:(0,_a.default)("mantine-datatable-row",{[X]:u||f?.expandOnClick},typeof R=="function"?R(e,t):R),"data-selected":i||void 0,onClick:S=>{if(f){let{isRowExpanded:x,expandOnClick:w,expandRow:L,collapseRow:M}=f;w&&(x(e)?M(e):L(e))}u?.({event:S,record:e,index:t})},onContextMenu:b?S=>b({event:S,record:e,index:t}):void 0,style:[T||P?S=>{let x=T?.(e,t),w=P?.(e,t);return xa({theme:S,color:x,backgroundColor:w})}:void 0,A?.(e,t)],...y?.(e,t),children:[r&&(0,W.jsx)(Va,{record:e,index:t,withRightShadow:v,checked:i,disabled:!l||(d?!d(e,t):!1),onChange:l,getCheckboxProps:s}),a.map(({hidden:S,...x},w)=>{if(S)return null;let{accessor:L,visibleMediaQuery:M,textAlign:q,noWrap:ge,ellipsis:Ce,width:qe,render:je,cellsClassName:ye,cellsStyle:et,customCellAttributes:tt}={...n,...x};return(0,W.jsx)(La,{className:typeof ye=="function"?ye(e,t):ye,style:et?.(e,t),visibleMediaQuery:M,record:e,index:t,onClick:p?we=>p({event:we,record:e,index:t,column:x,columnIndex:w}):void 0,onContextMenu:c?we=>c({event:we,record:e,index:t,column:x,columnIndex:w}):void 0,accessor:L,textAlign:q,noWrap:ge,ellipsis:Ce,width:qe,render:je,defaultRender:o,customCellAttributes:tt},L)})]}),f&&(0,W.jsx)(Fa,{colSpan:a.filter(({hidden:S})=>!S).length+(r?1:0),open:f.isRowExpanded(e),content:f.content({record:e,index:t}),collapseProps:f.collapseProps})]})}var Y=require("@mantine/core"),Le=N(require("clsx")),se=require("react/jsx-runtime");function za({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,bottomShadowVisible:o,headerHeight:r,footerHeight:i,onScrollPositionChange:l,children:d,viewportRef:s,scrollAreaProps:u}){return(0,se.jsxs)(Y.ScrollArea,{...u,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:l,children:[d,(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,Y.rem)(r):0}}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-left-shadow-behind":a})}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n})}),(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":o}),style:{bottom:i?(0,Y.rem)(i):0}})]})}var k=require("react/jsx-runtime");function Ga({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:r,verticalAlign:i="center",fetching:l,columns:d,groups:s,defaultColumnProps:u,defaultColumnRender:b,idAccessor:p="id",records:c,selectedRecords:f,onSelectedRecordsChange:y,isRecordSelectable:T,allRecordsSelectionCheckboxProps:P={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:R=(E,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:A,sortIcons:v,onSortStatusChange:S,horizontalSpacing:x,page:w,onPageChange:L,totalRecords:M,recordsPerPage:q,onRecordsPerPageChange:ge,recordsPerPageOptions:Ce,recordsPerPageLabel:qe="Records per page",paginationWithEdges:je,paginationActiveTextColor:ye,paginationActiveBackgroundColor:et,paginationSize:tt="sm",paginationText:we=({from:E,to:j,totalRecords:ee})=>`${E} - ${j} / ${ee}`,paginationWrapBreakpoint:Ba="sm",getPaginationControlProps:Qa=E=>E==="previous"?{"aria-label":"Previous page"}:E==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Xa,customLoader:$a,loaderSize:Ua,loaderType:Ka,loaderColor:Ja,loadingText:Za="...",emptyState:Ya,noRecordsText:Ct="No records",noRecordsIcon:qa,highlightOnHover:ja,striped:eo,noHeader:to,onRowClick:ao,onRowContextMenu:oo,onCellClick:no,onCellContextMenu:ro,onScroll:yt,onScrollToTop:wt,onScrollToBottom:St,onScrollToLeft:Pt,onScrollToRight:xt,c:lo,backgroundColor:io,borderColor:so,rowBorderColor:po,stripedColor:co,highlightOnHoverColor:mo,rowColor:uo,rowBackgroundColor:fo,rowExpansion:bo,rowClassName:To,rowStyle:ho,customRowAttributes:go,scrollViewportRef:Co,scrollAreaProps:yo,bodyRef:wo,m:So,my:Po,mx:xo,mt:Mo,mb:Do,ml:ko,mr:Ro,className:vo,classNames:Se,style:Eo,styles:Pe,...No}){let{ref:E,width:j,height:ee}=pe(),He=(0,I.useMemo)(()=>s?.flatMap(m=>m.columns)??d,[d,s]),{ref:Io,height:at}=pe(),{ref:Lo,width:ot,height:xe}=pe(),{ref:Ho,height:Fo}=pe(),{ref:Vo,height:Mt}=pe(),[nt,Dt]=(0,I.useState)(!0),[rt,kt]=(0,I.useState)(!0),[Fe,Rt]=(0,I.useState)(!0),[lt,vt]=(0,I.useState)(!0),Ao=$t({rowExpansion:bo,records:c,idAccessor:p}),Ve=(0,I.useCallback)(()=>{let m=E.current?.scrollTop||0,G=E.current?.scrollLeft||0;if(l||xe<=ee)Dt(!0),kt(!0);else{let H=m===0,F=xe-m-ee<1;Dt(H),kt(F),H&&H!==nt&&wt?.(),F&&F!==rt&&St?.()}if(l||ot===j)Rt(!0),vt(!0);else{let H=G===0,F=ot-G-j<1;Rt(H),vt(F),H&&H!==Fe&&Pt?.(),F&&F!==lt&&xt?.()}},[l,St,Pt,xt,wt,ee,E,j,rt,Fe,lt,nt,xe,ot]);_t(Ve,[Ve]);let _o=(0,I.useCallback)(m=>{yt?.(m),Ve()},[Ve,yt]),Oo=(0,I.useCallback)(m=>{E.current?.scrollTo({top:0,left:0}),L(m)},[L,E]),Ae=c?.length,Et=c?.map(m=>C(m,p)),Me=!!f,De=f?.map(m=>C(m,p)),Nt=Et!==void 0&&De!==void 0&&De.length>0,it=T?c?.filter(T):c,_e=it?.map(m=>C(m,p)),Oe=Nt&&_e.every(m=>De.includes(m)),zo=Nt&&_e.some(m=>De.includes(m)),Wo=(0,I.useCallback)(()=>{f&&y&&y(Oe?f.filter(m=>!_e.includes(C(m,p))):Re([...f,...it],m=>C(m,p)))},[Oe,p,y,_e,it,f]),{lastSelectionChangeIndex:ze,setLastSelectionChangeIndex:Go}=Ot(Et),st=Me&&!Fe;return(0,k.jsxs)(Ye.Box,{...{m:So,my:Po,mx:xo,mt:Mo,mb:Do,ml:ko,mr:Ro},className:(0,gt.default)("mantine-datatable",{"mantine-datatable-with-border":e},vo,Se?.root),style:[m=>({...Pa({theme:m,c:lo,backgroundColor:io,borderColor:so,rowBorderColor:po,stripedColor:co,highlightOnHoverColor:mo}),borderRadius:m.radius[t]||t,boxShadow:m.shadows[r]||r,height:n,minHeight:o}),Eo,Pe?.root],children:[(0,k.jsx)(za,{viewportRef:(0,Wa.useMergedRef)(E,Co),topShadowVisible:!nt,leftShadowVisible:!Fe,leftShadowBehind:Me,rightShadowVisible:!lt,bottomShadowVisible:!rt,headerHeight:at,footerHeight:Fo,onScrollPositionChange:_o,scrollAreaProps:yo,children:(0,k.jsxs)(Ye.Table,{ref:Lo,horizontalSpacing:x,className:(0,gt.default)("mantine-datatable-table",{[Kt]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-table-last-row-border-bottom-visible":xe<ee},Se?.table),style:Pe?.table,"data-striped":Ae&&eo||void 0,"data-highlight-on-hover":ja||void 0,...No,children:[to?null:(0,k.jsx)(Ca,{ref:Io,className:Se?.header,style:Pe?.header,columns:He,defaultColumnProps:u,groups:s,sortStatus:A,sortIcons:v,onSortStatusChange:S,selectionVisible:Me,selectionChecked:Oe,selectionIndeterminate:zo&&!Oe,onSelectionChange:Wo,selectionCheckboxProps:P,leftShadowVisible:st}),(0,k.jsx)("tbody",{ref:wo,children:Ae?c.map((m,G)=>{let H=C(m,p),F=De?.includes(H)||!1,It;return y&&f&&(It=Bo=>{if(Bo.nativeEvent.shiftKey&&ze!==null){let de=c.filter(G>ze?(te,ae)=>ae>=ze&&ae<=G&&(T?T(te,ae):!0):(te,ae)=>ae>=G&&ae<=ze&&(T?T(te,ae):!0));y(F?ct(f,de,te=>C(te,p)):Re([...f,...de],te=>C(te,p)))}else y(F?f.filter(de=>C(de,p)!==H):Re([...f,m],de=>C(de,p)));Go(G)}),(0,k.jsx)(Oa,{record:m,index:G,columns:He,defaultColumnProps:u,defaultColumnRender:b,selectionVisible:Me,selectionChecked:F,onSelectionChange:It,isRecordSelectable:T,getSelectionCheckboxProps:R,onClick:ao,onCellClick:no,onContextMenu:oo,onCellContextMenu:ro,expansion:Ao,color:uo,backgroundColor:fo,className:To,style:ho,customAttributes:go,leftShadowVisible:st},H)}):(0,k.jsx)(Ht,{})}),He.some(({footer:m})=>m)&&(0,k.jsx)(na,{ref:Ho,className:Se?.footer,style:Pe?.footer,columns:He,defaultColumnProps:u,selectionVisible:Me,leftShadowVisible:st,scrollDiff:xe-ee})]})}),w&&(0,k.jsx)(Ea,{ref:Vo,className:Se?.pagination,style:Pe?.pagination,horizontalSpacing:x,fetching:l,page:w,onPageChange:Oo,totalRecords:M,recordsPerPage:q,onRecordsPerPageChange:ge,recordsPerPageOptions:Ce,recordsPerPageLabel:qe,paginationWithEdges:je,paginationActiveTextColor:ye,paginationActiveBackgroundColor:et,paginationSize:tt,paginationText:we,paginationWrapBreakpoint:Ba,getPaginationControlProps:Qa,noRecordsText:Ct,loadingText:Za,recordsLength:Ae}),(0,k.jsx)(wa,{pt:at,pb:Mt,fetching:l,backgroundBlur:Xa,customContent:$a,size:Ua,type:Ka,color:Ja}),(0,k.jsx)(Vt,{pt:at,pb:Mt,icon:qa,text:Ct,active:!l&&!Ae,children:Ya})]})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy});
|
|
1
|
+
"use strict";"use client";var Xo=Object.create;var Ge=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Ko=Object.getPrototypeOf,Jo=Object.prototype.hasOwnProperty;var Zo=(e,t)=>{for(var a in t)Ge(e,a,{get:t[a],enumerable:!0})},Lt=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Uo(t))!Jo.call(e,o)&&o!==a&&Ge(e,o,{get:()=>t[o],enumerable:!(n=$o(t,o))||n.enumerable});return e};var N=(e,t,a)=>(a=e!=null?Xo(Ko(e)):{},Lt(t||!e||!e.__esModule?Ge(a,"default",{value:e,enumerable:!0}):a,e)),Yo=e=>Lt(Ge({},"__esModule",{value:!0}),e);var en={};Zo(en,{DataTable:()=>Ga,differenceBy:()=>ct,getRecordId:()=>w,getValueAtPath:()=>$e,humanize:()=>ke,uniqBy:()=>Re});module.exports=Yo(en);var qe=require("@mantine/core"),Wa=require("@mantine/hooks"),gt=N(require("clsx")),I=require("react");var dt=require("react/jsx-runtime");function Ht(){return(0,dt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,dt.jsx)("td",{})})}var Be=require("@mantine/core");var B=require("react/jsx-runtime");function Ft(){return(0,B.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,B.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,B.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,B.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,B.jsx)("path",{d:"M3 3l18 18"})]})}var O=require("react/jsx-runtime");function Vt({icon:e,text:t,pt:a,pb:n,active:o,children:r}){return(0,O.jsx)(Be.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:r||(0,O.jsxs)(O.Fragment,{children:[e||(0,O.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,O.jsx)(Ft,{})}),(0,O.jsx)(Be.Text,{size:"sm",c:"dimmed",children:t})]})})}var be=require("@mantine/core"),aa=N(require("clsx")),oa=require("react");var Jt=require("@mantine/core"),Zt=N(require("clsx"));var At=require("@mantine/hooks");function pe(){let[e]=(0,At.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var Qe=require("react"),_t=typeof window<"u"?Qe.useLayoutEffect:Qe.useEffect;var Xe=require("react");function Ot(e){let[t,a]=(0,Xe.useState)(null),n=e?.join(":")||"";return(0,Xe.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var ce=require("react");function qo(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function jo(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function zt(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,ce.useState)(a?t:jo(e,t)),r=(0,ce.useRef)();return(0,ce.useEffect)(()=>{if("matchMedia"in window)return r.current=e.map(i=>window.matchMedia(i)),o(r.current.map(i=>i.matches)),qo(r.current,i=>{o(i)})},[e]),n}var Wt=require("@mantine/core"),pt=require("react");function Gt(e){let t=(0,Wt.useMantineTheme)(),a=(0,pt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,pt.useMemo)(()=>e.map(()=>!0),[e]);return zt(a,n)}var Bt=require("@mantine/core"),Qt=require("@mantine/hooks");function Q(e){let t=(0,Bt.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,Qt.useMediaQuery)(a||"",!0)}var Xt=require("react");function ke(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function ct(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function Re(e,t){return e.filter((a,n,o)=>n===o.findIndex(r=>t(a)===t(r)))}function $e(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function w(e,t){return typeof t=="string"?$e(e,t):t(e)}function $t({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:l,allowMultiple:p,initiallyExpanded:s}=e;t&&l==="always"?n=t.map(m=>w(m,a)):s&&(n=t.filter((m,f)=>s({record:m,index:f})).map(m=>w(m,a)),p||(n=[n[0]]))}let o,r,i=(0,Xt.useState)(n);if(e){let{trigger:l,allowMultiple:p,collapseProps:s,content:m}=e;e.expanded?{recordIds:o,onRecordIdsChange:r}=e.expanded:[o,r]=i;let f=b=>r?.(o.filter(d=>d!==w(b,a)));return{expandOnClick:l!=="always"&&l!=="never",isRowExpanded:b=>l==="always"?!0:o.includes(w(b,a)),expandRow:b=>{let d=w(b,a);r?.(p?[...o,d]:[d])},collapseRow:f,collapseProps:s,content:({record:b,index:d})=>()=>m({record:b,index:d,collapse:()=>f(b)})}}}var mt=require("@mantine/hooks"),ve=require("react");function Ut(e,t){let[a,n]=(0,ve.useState)(e),[o,r]=(0,ve.useState)(e),i=(0,mt.useTimeout)(()=>n(!0),0),l=(0,mt.useTimeout)(()=>r(!1),t||200);return(0,ve.useEffect)(()=>{e?(l.clear(),r(!0),i.start()):(i.clear(),n(!1),l.start())},[i,l,e]),{expanded:a,visible:o}}var me="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",X="mantine-datatable-pointer-cursor",Kt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",U="mantine-datatable-text-align-center",K="mantine-datatable-text-align-right";var qt=require("react/jsx-runtime");function Yt({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:r,textAlign:i,width:l}){return Q(a)?(0,qt.jsx)(Jt.TableTh,{className:(0,Zt.default)({[me]:o||r,[ue]:r,[$]:i==="left",[U]:i==="center",[K]:i==="right"},e),style:[{width:l,minWidth:l,maxWidth:l},t],children:n}):null}var jt=require("@mantine/core"),ta=require("react/jsx-runtime");function ea({shadowVisible:e}){return(0,ta.jsx)(jt.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var fe=require("react/jsx-runtime"),na=(0,oa.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:r,selectorCellShadowVisible:i,scrollDiff:l},p){let s=l<0;return(0,fe.jsx)(be.TableTfoot,{ref:p,className:(0,aa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,be.rem)(s?l:0)},a],children:(0,fe.jsxs)(be.TableTr,{children:[r&&(0,fe.jsx)(ea,{shadowVisible:i}),n.map(({hidden:m,...f})=>{if(m)return null;let{accessor:b,visibleMediaQuery:d,textAlign:u,width:T,footer:g,footerClassName:C,footerStyle:R,noWrap:A,ellipsis:v}={...o,...f};return(0,fe.jsx)(Yt,{className:C,style:R,visibleMediaQuery:d,textAlign:u,width:T,title:g,noWrap:A,ellipsis:v},b)})]})})});var Ie=require("@mantine/core"),ha=N(require("clsx")),ga=require("react");var ra=require("@mantine/core"),la=N(require("clsx")),ut=require("react");var sa=require("react/jsx-runtime");function ia({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:r}}){let i=(0,ut.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),l=Gt(i),p=(0,ut.useMemo)(()=>t.filter(({hidden:s},m)=>!s&&l?.[m]).length,[t,l]);return p>0?(0,sa.jsx)(ra.TableTh,{colSpan:p,className:(0,la.default)("mantine-datatable-column-group-header-cell",{[$]:n==="left",[U]:n==="center",[K]:n==="right"},o),style:r,children:a??ke(e)}):null}var z=require("@mantine/core"),Ue=N(require("clsx"));var ne=require("@mantine/core"),ca=require("@mantine/hooks");var Ee=require("react/jsx-runtime");function da(){return(0,Ee.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ee.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ee.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var Ne=require("react/jsx-runtime");function pa(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var oe=require("react/jsx-runtime");function ma({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,ca.useDisclosure)(!1);return(0,oe.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,oe.jsx)(ne.PopoverTarget,{children:(0,oe.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,oe.jsx)(t?pa:da,{})})}),(0,oe.jsx)(ne.Popover.Dropdown,{onClick:i=>i.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var re=require("react/jsx-runtime");function ua(){return(0,re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,re.jsx)("path",{d:"M12 5l0 14"}),(0,re.jsx)("path",{d:"M16 9l-4 -4"}),(0,re.jsx)("path",{d:"M8 9l4 -4"})]})}var le=require("react/jsx-runtime");function fa(){return(0,le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,le.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,le.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,le.jsx)("path",{d:"M12 3l0 18"})]})}var D=require("react/jsx-runtime");function ba({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:r,sortIcons:i,textAlign:l,width:p,sortStatus:s,onSortStatusChange:m,filter:f,filtering:b}){if(!Q(n))return null;let d=o??ke(a),u=typeof d=="string"?d:void 0,T=r&&m?g=>{g?.defaultPrevented||m({columnAccessor:a,direction:s?.columnAccessor===a?s.direction==="asc"?"desc":"asc":s?.direction??"asc"})}:void 0;return(0,D.jsx)(z.TableTh,{className:(0,Ue.default)({"mantine-datatable-header-cell-sortable":r},e),style:[{width:p,minWidth:p,maxWidth:p},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:T,onKeyDown:g=>g.key==="Enter"&&T?.(),children:(0,D.jsxs)(z.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,D.jsx)(z.Box,{className:(0,Ue.default)("mantine-datatable-header-cell-sortable-text",{[$]:l==="left",[U]:l==="center",[K]:l==="right"},me,ue),title:u,children:d}),r||s?.columnAccessor===a?(0,D.jsx)(D.Fragment,{children:s?.columnAccessor===a?(0,D.jsx)(z.Center,{className:(0,Ue.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":s.direction==="desc"}),role:"img","aria-label":`Sorted ${s.direction==="desc"?"descending":"ascending"}`,children:i?.sorted||(0,D.jsx)(ua,{})}):(0,D.jsx)(z.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:i?.unsorted||(0,D.jsx)(fa,{})})}):null,f?(0,D.jsx)(ma,{isActive:!!b,children:f}):null]})})}var Ke=require("@mantine/core");var ft=require("react/jsx-runtime");function Ta({shadowVisible:e,checked:t,indeterminate:a,checkboxProps:n,onChange:o,rowSpan:r}){return(0,ft.jsx)(Ke.TableTh,{className:"mantine-datatable-header-selector-cell",rowSpan:r,"data-shadow-visible":e||void 0,children:(0,ft.jsx)(Ke.Checkbox,{classNames:{input:X},checked:t,indeterminate:a,onChange:o,...n,disabled:!(o||n.onChange)||n.disabled})})}var J=require("react/jsx-runtime"),Ca=(0,ga.forwardRef)(function({className:t,style:a,sortStatus:n,sortIcons:o,onSortStatusChange:r,columns:i,defaultColumnProps:l,groups:p,selectionVisible:s,selectionChecked:m,selectionIndeterminate:f,onSelectionChange:b,selectionCheckboxProps:d,selectorCellShadowVisible:u},T){let g=s?(0,J.jsx)(Ta,{shadowVisible:u,checked:m,indeterminate:f,checkboxProps:d,onChange:b,rowSpan:p?2:void 0}):null;return(0,J.jsxs)(Ie.TableThead,{className:(0,ha.default)("mantine-datatable-header",t),style:a,ref:T,children:[p&&(0,J.jsxs)(Ie.TableTr,{children:[g,p.map(C=>(0,J.jsx)(ia,{group:C},C.id))]}),(0,J.jsxs)(Ie.TableTr,{children:[!p&&g,i.map(({hidden:C,...R})=>{if(C)return null;let{accessor:A,visibleMediaQuery:v,textAlign:P,width:M,title:S,sortable:L,titleClassName:x,titleStyle:q,filter:ge,filtering:Ce}={...l,...R};return(0,J.jsx)(ba,{accessor:A,className:x,style:q,visibleMediaQuery:v,textAlign:P,width:M,title:S,sortable:L,sortStatus:n,sortIcons:o,onSortStatusChange:r,filter:ge,filtering:Ce},A)})]})]})});var Je=require("@mantine/core"),ya=N(require("clsx")),bt=require("react/jsx-runtime");function wa({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:r,type:i,color:l}){return(0,bt.jsx)(Je.Center,{pt:e,pb:t,className:(0,ya.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,bt.jsx)(Je.Loader,{size:r,type:i,color:l}))})}var Z=require("@mantine/core"),Tt=N(require("clsx")),va=require("react");var h=require("@mantine/core"),ka=N(require("clsx"));var Sa=require("@mantine/core");function y(e,t,a){return e?(0,Sa.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Pa({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:r,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":y(t,e,"light"),"--mantine-datatable-color-dark":y(t,e,"dark"),"--mantine-datatable-background-color-light":y(a,e,"light"),"--mantine-datatable-background-color-dark":y(a,e,"dark"),"--mantine-datatable-border-color-light":y(n,e,"light"),"--mantine-datatable-border-color-dark":y(n,e,"dark"),"--mantine-datatable-row-border-color-light":y(o,e,"light"),"--mantine-datatable-row-border-color-dark":y(o,e,"dark"),"--mantine-datatable-striped-color-light":y(r,e,"light"),"--mantine-datatable-striped-color-dark":y(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":y(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":y(i,e,"dark")}}function Ze({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":y(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":y(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":y(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":y(a,e,"dark")}}function xa({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":y(t,e,"light"),"--mantine-datatable-row-color-dark":y(t,e,"dark"),"--mantine-datatable-row-background-color-light":y(a,e,"light"),"--mantine-datatable-row-background-color-dark":y(a,e,"dark")}}var Te=require("react/jsx-runtime");function Ma(){return(0,Te.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Te.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Te.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Te.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var V=require("react/jsx-runtime"),Da={xs:(0,h.rem)(22),sm:(0,h.rem)(26),md:(0,h.rem)(32),lg:(0,h.rem)(38),xl:(0,h.rem)(44)};function Ra({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:r,onChange:i}){return(0,V.jsxs)(h.Group,{gap:"xs",children:[(0,V.jsx)(h.Text,{size:e,children:t}),(0,V.jsxs)(h.Menu,{withinPortal:!0,withArrow:!0,children:[(0,V.jsx)(h.MenuTarget,{children:(0,V.jsx)(h.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,V.jsx)(Ma,{}),style:[{fontWeight:"normal"},l=>({height:Da[e],paddingLeft:l.spacing[e],paddingRight:l.spacing[e]})],children:n})}),(0,V.jsx)(h.MenuDropdown,{children:a.map(l=>{let p=l===n;return(0,V.jsx)(h.MenuItem,{className:(0,ka.default)({"mantine-datatable-page-size-selector-active":p}),style:[{height:Da[e]},p&&(o||r)?s=>Ze({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:r}):void 0],disabled:p,onClick:()=>i(l),children:(0,V.jsx)(h.Text,{size:e,children:l})},l)})})]})]})}var he=require("react/jsx-runtime"),Ea=(0,va.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:r,paginationWithEdges:i,paginationActiveTextColor:l,paginationActiveBackgroundColor:p,paginationSize:s,loadingText:m,noRecordsText:f,paginationText:b,totalRecords:d,recordsPerPage:u,onRecordsPerPageChange:T,recordsPerPageLabel:g,recordsPerPageOptions:C,recordsLength:R,horizontalSpacing:A,paginationWrapBreakpoint:v,getPaginationControlProps:P},M){let S;if(n)S=m;else if(!d)S=f;else{let x=(o-1)*u+1,q=x+R-1;S=b({from:x,to:q,totalRecords:d})}let L=Q(({breakpoints:x})=>`(min-width: ${typeof v=="number"?`${(0,Z.rem)(v)}rem`:x[v]||v})`);return(0,he.jsxs)(Z.Box,{ref:M,px:A??"xs",py:"xs",className:(0,Tt.default)("mantine-datatable-pagination",t),style:[{flexDirection:L?"row":"column"},a],children:[(0,he.jsx)(Z.Text,{className:"mantine-datatable-pagination-text",size:s,children:S}),C&&(0,he.jsx)(Ra,{activeTextColor:l,activeBackgroundColor:p,size:s,label:g,values:C,value:u,onChange:T}),(0,he.jsx)(Z.Pagination,{classNames:{root:(0,Tt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!R}),control:"mantine-datatable-pagination-pages-control"},style:l||p?x=>Ze({theme:x,paginationActiveTextColor:l,paginationActiveBackgroundColor:p}):void 0,withEdges:i,value:o,onChange:r,size:s,total:Math.ceil(d/u),getControlProps:P})]})});var Aa=require("@mantine/core"),_a=N(require("clsx"));var Na=require("@mantine/core"),Ia=N(require("clsx"));var Ha=require("react/jsx-runtime");function La({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:r,onContextMenu:i,noWrap:l,ellipsis:p,textAlign:s,width:m,accessor:f,render:b,defaultRender:d,customCellAttributes:u}){return Q(a)?(0,Ha.jsx)(Na.TableTd,{className:(0,Ia.default)({[me]:l||p,[ue]:p,[X]:r,[$]:s==="left",[U]:s==="center",[K]:s==="right"},e),style:[{width:m,minWidth:m,maxWidth:m},t],onClick:r,onContextMenu:i,...u?.(n,o),children:b?b(n,o):d?d(n,o,f):$e(n,f)}):null}var ie=require("@mantine/core");var _=require("react/jsx-runtime");function Fa({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:r}=Ut(e,n?.transitionDuration);return r?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ie.TableTr,{}),(0,_.jsx)(ie.TableTr,{children:(0,_.jsx)(ie.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,_.jsx)(ie.Collapse,{in:o,...n,children:(0,_.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var Ye=require("@mantine/core");var ht=require("react/jsx-runtime");function Va({record:e,index:t,withRightShadow:a,getCheckboxProps:n,...o}){return(0,ht.jsx)(Ye.TableTd,{className:"mantine-datatable-row-selector-cell","data-shadow-visible":a||void 0,onClick:r=>r.stopPropagation(),children:(0,ht.jsx)(Ye.Checkbox,{classNames:{input:X},...o,...n(e,t)})})}var W=require("react/jsx-runtime");function Oa({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionVisible:r,selectionChecked:i,onSelectionChange:l,isRecordSelectable:p,getSelectionCheckboxProps:s,onClick:m,onContextMenu:f,onCellClick:b,onCellContextMenu:d,expansion:u,customAttributes:T,color:g,backgroundColor:C,className:R,style:A,selectorCellShadowVisible:v}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Aa.TableTr,{className:(0,_a.default)("mantine-datatable-row",{[X]:m||u?.expandOnClick},typeof R=="function"?R(e,t):R),"data-selected":i||void 0,onClick:P=>{if(u){let{isRowExpanded:M,expandOnClick:S,expandRow:L,collapseRow:x}=u;S&&(M(e)?x(e):L(e))}m?.({event:P,record:e,index:t})},onContextMenu:f?P=>f({event:P,record:e,index:t}):void 0,style:[g||C?P=>{let M=g?.(e,t),S=C?.(e,t);return xa({theme:P,color:M,backgroundColor:S})}:void 0,A?.(e,t)],...T?.(e,t),children:[r&&(0,W.jsx)(Va,{record:e,index:t,withRightShadow:v,checked:i,disabled:!l||(p?!p(e,t):!1),onChange:l,getCheckboxProps:s}),a.map(({hidden:P,...M},S)=>{if(P)return null;let{accessor:L,visibleMediaQuery:x,textAlign:q,noWrap:ge,ellipsis:Ce,width:je,render:et,cellsClassName:ye,cellsStyle:tt,customCellAttributes:at}={...n,...M};return(0,W.jsx)(La,{className:typeof ye=="function"?ye(e,t):ye,style:tt?.(e,t),visibleMediaQuery:x,record:e,index:t,onClick:b?we=>b({event:we,record:e,index:t,column:M,columnIndex:S}):void 0,onContextMenu:d?we=>d({event:we,record:e,index:t,column:M,columnIndex:S}):void 0,accessor:L,textAlign:q,noWrap:ge,ellipsis:Ce,width:je,render:et,defaultRender:o,customCellAttributes:at},L)})]}),u&&(0,W.jsx)(Fa,{colSpan:a.filter(({hidden:P})=>!P).length+(r?1:0),open:u.isRowExpanded(e),content:u.content({record:e,index:t}),collapseProps:u.collapseProps})]})}var Y=require("@mantine/core"),Le=N(require("clsx")),se=require("react/jsx-runtime");function za({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,rightShadowBehind:o,bottomShadowVisible:r,headerHeight:i,footerHeight:l,onScrollPositionChange:p,children:s,viewportRef:m,scrollAreaProps:f}){return(0,se.jsxs)(Y.ScrollArea,{...f,viewportRef:m,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:p,children:[s,(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,Y.rem)(i):0}}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,se.jsx)("div",{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,se.jsx)(Y.Box,{className:(0,Le.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:l?(0,Y.rem)(l+1):0}})]})}var k=require("react/jsx-runtime");function Ga({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:r,verticalAlign:i="center",fetching:l,columns:p,groups:s,pinLastColumn:m,defaultColumnProps:f,defaultColumnRender:b,idAccessor:d="id",records:u,selectedRecords:T,onSelectedRecordsChange:g,isRecordSelectable:C,allRecordsSelectionCheckboxProps:R={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:A=(E,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:v,sortIcons:P,onSortStatusChange:M,horizontalSpacing:S,page:L,onPageChange:x,totalRecords:q,recordsPerPage:ge,onRecordsPerPageChange:Ce,recordsPerPageOptions:je,recordsPerPageLabel:et="Records per page",paginationWithEdges:ye,paginationActiveTextColor:tt,paginationActiveBackgroundColor:at,paginationSize:we="sm",paginationText:Ba=({from:E,to:j,totalRecords:ee})=>`${E} - ${j} / ${ee}`,paginationWrapBreakpoint:Qa="sm",getPaginationControlProps:Xa=E=>E==="previous"?{"aria-label":"Previous page"}:E==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:$a,customLoader:Ua,loaderSize:Ka,loaderType:Ja,loaderColor:Za,loadingText:Ya="...",emptyState:qa,noRecordsText:Ct="No records",noRecordsIcon:ja,highlightOnHover:eo,striped:to,noHeader:ao,onRowClick:oo,onRowContextMenu:no,onCellClick:ro,onCellContextMenu:lo,onScroll:yt,onScrollToTop:wt,onScrollToBottom:St,onScrollToLeft:Pt,onScrollToRight:xt,c:io,backgroundColor:so,borderColor:po,rowBorderColor:co,stripedColor:mo,highlightOnHoverColor:uo,rowColor:fo,rowBackgroundColor:bo,rowExpansion:To,rowClassName:ho,rowStyle:go,customRowAttributes:Co,scrollViewportRef:yo,scrollAreaProps:wo,bodyRef:So,m:Po,my:xo,mx:Mo,mt:Do,mb:ko,ml:Ro,mr:vo,className:Eo,classNames:Se,style:No,styles:Pe,...Io}){let{ref:E,width:j,height:ee}=pe(),He=(0,I.useMemo)(()=>s?.flatMap(c=>c.columns)??p,[p,s]),{ref:Lo,height:ot}=pe(),{ref:Ho,width:nt,height:xe}=pe(),{ref:Fo,height:Vo}=pe(),{ref:Ao,height:Mt}=pe(),[rt,Dt]=(0,I.useState)(!0),[lt,kt]=(0,I.useState)(!0),[Fe,Rt]=(0,I.useState)(!0),[Ve,vt]=(0,I.useState)(!0),_o=$t({rowExpansion:To,records:u,idAccessor:d}),Ae=(0,I.useCallback)(()=>{let c=E.current?.scrollTop||0,G=E.current?.scrollLeft||0;if(l||xe<=ee)Dt(!0),kt(!0);else{let H=c===0,F=xe-c-ee<1;Dt(H),kt(F),H&&H!==rt&&wt?.(),F&&F!==lt&&St?.()}if(l||nt===j)Rt(!0),vt(!0);else{let H=G===0,F=nt-G-j<1;Rt(H),vt(F),H&&H!==Fe&&Pt?.(),F&&F!==Ve&&xt?.()}},[l,St,Pt,xt,wt,ee,E,j,lt,Fe,Ve,rt,xe,nt]);_t(Ae,[Ae]);let Oo=(0,I.useCallback)(c=>{yt?.(c),Ae()},[Ae,yt]),zo=(0,I.useCallback)(c=>{E.current?.scrollTo({top:0,left:0}),x(c)},[x,E]),_e=u?.length,Et=u?.map(c=>w(c,d)),Me=!!T,De=T?.map(c=>w(c,d)),Nt=Et!==void 0&&De!==void 0&&De.length>0,it=C?u?.filter(C):u,Oe=it?.map(c=>w(c,d)),ze=Nt&&Oe.every(c=>De.includes(c)),Wo=Nt&&Oe.some(c=>De.includes(c)),Go=(0,I.useCallback)(()=>{T&&g&&g(ze?T.filter(c=>!Oe.includes(w(c,d))):Re([...T,...it],c=>w(c,d)))},[ze,d,g,Oe,it,T]),{lastSelectionChangeIndex:We,setLastSelectionChangeIndex:Bo}=Ot(Et),st=Me&&!Fe;return(0,k.jsxs)(qe.Box,{...{m:Po,my:xo,mx:Mo,mt:Do,mb:ko,ml:Ro,mr:vo},className:(0,gt.default)("mantine-datatable",{"mantine-datatable-with-border":e},Eo,Se?.root),style:[c=>({...Pa({theme:c,c:io,backgroundColor:so,borderColor:po,rowBorderColor:co,stripedColor:mo,highlightOnHoverColor:uo}),borderRadius:c.radius[t]||t,boxShadow:c.shadows[r]||r,height:n,minHeight:o}),No,Pe?.root],children:[(0,k.jsx)(za,{viewportRef:(0,Wa.useMergedRef)(E,yo),topShadowVisible:!rt,leftShadowVisible:!Fe,leftShadowBehind:Me,rightShadowVisible:!Ve,rightShadowBehind:m,bottomShadowVisible:!lt,headerHeight:ot,footerHeight:Vo,onScrollPositionChange:Oo,scrollAreaProps:wo,children:(0,k.jsxs)(qe.Table,{ref:Ho,horizontalSpacing:S,className:(0,gt.default)("mantine-datatable-table",{[Kt]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":xe<ee,"mantine-datatable-pin-last-column":m,"mantine-datatable-pin-last-column-scrolled":!Ve&&m},Se?.table),style:Pe?.table,"data-striped":_e&&to||void 0,"data-highlight-on-hover":eo||void 0,...Io,children:[ao?null:(0,k.jsx)(Ca,{ref:Lo,className:Se?.header,style:Pe?.header,columns:He,defaultColumnProps:f,groups:s,sortStatus:v,sortIcons:P,onSortStatusChange:M,selectionVisible:Me,selectionChecked:ze,selectionIndeterminate:Wo&&!ze,onSelectionChange:Go,selectionCheckboxProps:R,selectorCellShadowVisible:st}),(0,k.jsx)("tbody",{ref:So,children:_e?u.map((c,G)=>{let H=w(c,d),F=De?.includes(H)||!1,It;return g&&T&&(It=Qo=>{if(Qo.nativeEvent.shiftKey&&We!==null){let de=u.filter(G>We?(te,ae)=>ae>=We&&ae<=G&&(C?C(te,ae):!0):(te,ae)=>ae>=G&&ae<=We&&(C?C(te,ae):!0));g(F?ct(T,de,te=>w(te,d)):Re([...T,...de],te=>w(te,d)))}else g(F?T.filter(de=>w(de,d)!==H):Re([...T,c],de=>w(de,d)));Bo(G)}),(0,k.jsx)(Oa,{record:c,index:G,columns:He,defaultColumnProps:f,defaultColumnRender:b,selectionVisible:Me,selectionChecked:F,onSelectionChange:It,isRecordSelectable:C,getSelectionCheckboxProps:A,onClick:oo,onCellClick:ro,onContextMenu:no,onCellContextMenu:lo,expansion:_o,color:fo,backgroundColor:bo,className:ho,style:go,customAttributes:Co,selectorCellShadowVisible:st},H)}):(0,k.jsx)(Ht,{})}),He.some(({footer:c})=>c)&&(0,k.jsx)(na,{ref:Fo,className:Se?.footer,style:Pe?.footer,columns:He,defaultColumnProps:f,selectionVisible:Me,selectorCellShadowVisible:st,scrollDiff:xe-ee})]})}),L&&(0,k.jsx)(Ea,{ref:Ao,className:Se?.pagination,style:Pe?.pagination,horizontalSpacing:S,fetching:l,page:L,onPageChange:zo,totalRecords:q,recordsPerPage:ge,onRecordsPerPageChange:Ce,recordsPerPageOptions:je,recordsPerPageLabel:et,paginationWithEdges:ye,paginationActiveTextColor:tt,paginationActiveBackgroundColor:at,paginationSize:we,paginationText:Ba,paginationWrapBreakpoint:Qa,getPaginationControlProps:Xa,noRecordsText:Ct,loadingText:Ya,recordsLength:_e}),(0,k.jsx)(wa,{pt:ot,pb:Mt,fetching:l,backgroundBlur:$a,customContent:Ua,size:Ka,type:Ja,color:Za}),(0,k.jsx)(Vt,{pt:ot,pb:Mt,icon:ja,text:Ct,active:!l&&!_e,children:qa})]})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|