dgz-ui-shared 1.0.10 → 1.0.12
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/DataTable-CT8P30Pn.cjs +21 -0
- package/dist/{DataTable-XG7LkJ95.js → DataTable-DP4eBOH5.js} +59 -59
- package/dist/{DateRangeFilter-kGzGi-tj.js → DateRangeFilter-CVw_FBVs.js} +2 -2
- package/dist/{DateRangeFilter-Cz5iPjWW.cjs → DateRangeFilter-tW4gYYqY.cjs} +1 -1
- package/dist/{DateRangePicker-CaPF9qkN.cjs → DateRangePicker-3-40EsIN.cjs} +2 -2
- package/dist/{DateRangePicker-DpymG6PF.js → DateRangePicker-C5E0x2RQ.js} +6 -6
- package/dist/{FilterWrapper-DCbt3zPG.js → FilterWrapper-D_RVDQiY.js} +15 -15
- package/dist/{FilterWrapper-DgmHiJHV.cjs → FilterWrapper-DaCa9GYH.cjs} +4 -4
- package/dist/{MyBreadcrumb-DFGKR9aK.js → MyBreadcrumb-BJ8paNrL.js} +5 -5
- package/dist/{MyBreadcrumb-JMFSq6B5.cjs → MyBreadcrumb-CXPIxCe9.cjs} +4 -4
- package/dist/{MyInput-BhG02ONB.js → MyInput-DGKxQKXb.js} +13 -13
- package/dist/{MyInput-L3MeWFxX.cjs → MyInput-DNUZn4hg.cjs} +18 -18
- package/dist/MyLimitSelect-CXlhfm4W.cjs +6 -0
- package/dist/{MyLimitSelect-DhVWHjk3.js → MyLimitSelect-r6-geCXQ.js} +25 -24
- package/dist/MyModal-C41zmKnr.cjs +6 -0
- package/dist/{MyModal-B1RlrfCl.js → MyModal-DjQUSnSb.js} +17 -16
- package/dist/MySelect-D7NFdYOL.js +65 -0
- package/dist/MySelect-LpQoa4HG.cjs +1 -0
- package/dist/{MyTimePicker-Ckwg7NLy.cjs → MyTimePicker-BRCPeoRF.cjs} +9 -9
- package/dist/{MyTimePicker-BOwPGxBg.js → MyTimePicker-CedYmUJN.js} +5 -5
- package/dist/MyTooltip-BCx9OZlP.js +342 -0
- package/dist/MyTooltip-CNsU5JvY.cjs +1 -0
- package/dist/{PageTitle-CZgb886r.cjs → PageTitle-BK2BZ1Ec.cjs} +1 -1
- package/dist/{PageTitle-DOG9ch6w.js → PageTitle-BVEJvNTV.js} +1 -1
- package/dist/PasswordConfirm-D8AMBxrj.cjs +7 -0
- package/dist/{PasswordConfirm-CQzDNPdU.js → PasswordConfirm-UO-o8zTJ.js} +9 -9
- package/dist/{ScrollArea-D04nVJdb.js → ScrollArea-DZ-ZHSWz.js} +3 -3
- package/dist/ScrollArea-N3-rKMsT.cjs +1 -0
- package/dist/check-DE-1lGDl-B29DO64K.cjs +6 -0
- package/dist/{check-DE-1lGDl-ByVYHHns.js → check-DE-1lGDl-C8i-XKZO.js} +38 -38
- package/dist/{chevron-right-HWBijj-I-_0oV6N8i.cjs → chevron-right-HWBijj-I-BDfcO9vE.cjs} +1 -1
- package/dist/{chevron-right-HWBijj-I-BJ9d3Typ.js → chevron-right-HWBijj-I-D4uWI0s-.js} +1 -1
- package/dist/components/breadcrumb/index.es.js +1 -1
- package/dist/components/breadcrumb/index.umd.js +1 -1
- package/dist/components/confirm/index.es.js +1 -1
- package/dist/components/confirm/index.umd.js +1 -1
- package/dist/components/datatable/index.es.js +1 -1
- package/dist/components/datatable/index.umd.js +1 -1
- package/dist/components/datepicker/index.es.js +1 -1
- package/dist/components/datepicker/index.umd.js +1 -1
- package/dist/components/filters/index.es.js +2 -2
- package/dist/components/filters/index.umd.js +1 -1
- package/dist/components/form/index.es.js +12 -12
- package/dist/components/form/index.umd.js +1 -1
- package/dist/components/modal/index.es.js +1 -1
- package/dist/components/modal/index.umd.js +1 -1
- package/dist/components/pagination/index.es.js +1 -1
- package/dist/components/pagination/index.umd.js +1 -1
- package/dist/components/scroll/index.es.js +1 -1
- package/dist/components/scroll/index.umd.js +1 -1
- package/dist/components/theme/index.es.js +1 -1
- package/dist/components/theme/index.umd.js +1 -1
- package/dist/components/title/index.es.js +1 -1
- package/dist/components/title/index.umd.js +1 -1
- package/dist/components/tooltip/index.es.js +6 -2
- package/dist/components/tooltip/index.umd.js +1 -1
- package/dist/createLucideIcon-B950nf2d-BkSLw1eV.cjs +61 -0
- package/dist/{createLucideIcon-B950nf2d-D1Qx06rd.js → createLucideIcon-B950nf2d-DmSkB8D3.js} +23 -24
- package/dist/dropdown-menu-D3ab2Xna-ChZClaUU.cjs +6 -0
- package/dist/{dropdown-menu--t1ZKu0y-oLlo1mVx.js → dropdown-menu-D3ab2Xna-DF2PMoGp.js} +79 -79
- package/dist/hooks/index.es.js +4 -4
- package/dist/hooks/index.umd.js +1 -1
- package/dist/index-BTN0oPfn-Dtia0wvB.cjs +5 -0
- package/dist/{index-BK3FjXZk-pNC03BDV.js → index-BTN0oPfn-lcR516IV.js} +25 -26
- package/dist/{index-C5JzSjdD-CRk3Pjir.cjs → index-CYIFqWxx-BsamIYAS.cjs} +1 -1
- package/dist/{index-C5JzSjdD-BaVma9GJ.js → index-CYIFqWxx-DGoLsMna.js} +10 -10
- package/dist/index-DFLDO_Wj-C8ppMJ8-.cjs +1 -0
- package/dist/{index-CMCLDN5g-6oBURVNC.js → index-DFLDO_Wj-DjjANZrP.js} +115 -116
- package/dist/index-DqTIeHVj-BYqu9UxO.cjs +1 -0
- package/dist/{index-CAkEtOXa-Z1UCiJrG.js → index-DqTIeHVj-NrWlaNo4.js} +58 -59
- package/dist/index-l1ZGtt0d-BEsNdMV0.js +364 -0
- package/dist/index-l1ZGtt0d-DeAZE3eu.cjs +22 -0
- package/dist/index.es.js +57 -53
- package/dist/index.umd.js +1 -1
- package/dist/popover-DDxpKohG-BNvpLrCQ.cjs +1 -0
- package/dist/{popover-CBRr00GV-NN2TGWBh.js → popover-DDxpKohG-DBdU9Sy_.js} +32 -32
- package/dist/select-BehdTDP2-BYtdexd3.cjs +56 -0
- package/dist/{select-Cwb1akIr-CW8ygpGM.js → select-BehdTDP2-JSC78BOJ.js} +29 -29
- package/dist/{theme-toggle-C0vCJeCR.js → theme-toggle-B2XzvxQT.js} +5 -5
- package/dist/{theme-toggle-BaD6gaad.cjs → theme-toggle-C9xcIHbJ.cjs} +3 -3
- package/dist/timepicker-C_vwQ2np-Bfq0B94y.cjs +6 -0
- package/dist/{timepicker-a0cR_CqS-C08jXZCe.js → timepicker-C_vwQ2np-Byjf7Fwu.js} +106 -105
- package/dist/types/components/tooltip/index.d.ts +1 -0
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/{useDateRange-RZdavG78.cjs → useDateRange-8LvWPcvl.cjs} +1 -1
- package/dist/{useDateRange-CRpmMpXd.js → useDateRange-gJSNAOHn.js} +1 -1
- package/dist/{useFilter-B019YOr7.js → useFilter-Cacodr7F.js} +1 -1
- package/dist/{useFilter--M0q2qTv.cjs → useFilter-DjKB_ucC.cjs} +1 -1
- package/dist/{useMediaQuerySizes-CWxumMum.js → useMediaQuerySizes-Cp5okcY8.js} +2 -2
- package/dist/{useMediaQuerySizes-B7SEVsDO.cjs → useMediaQuerySizes-GBUqWfo2.cjs} +1 -1
- package/dist/{useSortable-DXttMEpE.js → useSortable-CknNI0yo.js} +1 -1
- package/dist/{useSortable-BP669sHP.cjs → useSortable-D3Q8FRPO.cjs} +1 -1
- package/dist/utils-D0f6bOsw-BmDOeWKv.cjs +1 -0
- package/dist/{utils-PffWk1Lg-CZY16h3s.js → utils-D0f6bOsw-HrLsble-.js} +479 -761
- package/package.json +2 -2
- package/dist/DataTable-AVrjxPe9.cjs +0 -21
- package/dist/MyLimitSelect-B_W_z-G0.cjs +0 -6
- package/dist/MyModal-CJ8qkt43.cjs +0 -6
- package/dist/MySelect-Czusw_K5.cjs +0 -1
- package/dist/MySelect-PC3TcGp8.js +0 -65
- package/dist/MyTooltip-Bate7Rhg.cjs +0 -1
- package/dist/MyTooltip-DBwBoUxc.js +0 -302
- package/dist/PasswordConfirm-DbzDqQD0.cjs +0 -7
- package/dist/ScrollArea-D_wmeopf.cjs +0 -1
- package/dist/check-DE-1lGDl-B9PQ-2nR.cjs +0 -6
- package/dist/createLucideIcon-B950nf2d-DkVfmknu.cjs +0 -61
- package/dist/dropdown-menu--t1ZKu0y-lz04dGCR.cjs +0 -6
- package/dist/index-BK3FjXZk-cFG0L1A-.cjs +0 -5
- package/dist/index-CAkEtOXa-CHx6pQfS.cjs +0 -1
- package/dist/index-CMCLDN5g-Cp4PwCEr.cjs +0 -1
- package/dist/index-D2atLuzC-BfjqpKEo.js +0 -83
- package/dist/index-D2atLuzC-CgVmKI0O.cjs +0 -1
- package/dist/popover-CBRr00GV-BTlmw9EL.cjs +0 -1
- package/dist/select-Cwb1akIr-B-VjMkjS.cjs +0 -56
- package/dist/timepicker-a0cR_CqS-VR-d1M9f.cjs +0 -6
- package/dist/utils-PffWk1Lg-Bm8mmArS.cjs +0 -22
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";const h=require("./jsx-runtime-DUiatUiq.cjs"),re=require("./check-DE-1lGDl-B29DO64K.cjs"),P=require("./dropdown-menu-D3ab2Xna-ChZClaUU.cjs"),F=require("./MyLimitSelect-CXlhfm4W.cjs"),D=require("react"),k=require("./MyInput-DNUZn4hg.cjs"),u=require("./index-l1ZGtt0d-DeAZE3eu.cjs"),v=require("./index-DqTIeHVj-BYqu9UxO.cjs"),je=require("./select-BehdTDP2-BYtdexd3.cjs"),y=require("./utils-D0f6bOsw-BmDOeWKv.cjs"),B=require("./useSortable-D3Q8FRPO.cjs"),Ee=require("./ScrollArea-N3-rKMsT.cjs"),K=require("./SortOrder-81BrXp3i.cjs"),Re=require("./Empty-VUaePYiO.cjs"),X=require("./createLucideIcon-BnAj0RnC.cjs"),ee=require("./FilterWrapper-DaCa9GYH.cjs"),ye=require("./useTranslation-CZf20ucv.cjs");function Ne(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=Ne(D);function Se(e,r){return l.useReducer((t,o)=>r[t][o]??t,e)}var Z="ScrollArea",[ne,Ke]=v.j(Z),[Te,R]=ne(Z),oe=l.forwardRef((e,r)=>{const{__scopeScrollArea:t,type:o="hover",dir:n,scrollHideDelay:s=600,...i}=e,[d,a]=l.useState(null),[f,c]=l.useState(null),[x,p]=l.useState(null),[w,E]=l.useState(null),[L,_]=l.useState(null),[m,T]=l.useState(0),[b,j]=l.useState(0),[C,A]=l.useState(!1),[I,q]=l.useState(!1),g=u.x(r,z=>a(z)),N=re.n(n);return u.ae.jsx(Te,{scope:t,type:o,dir:N,scrollHideDelay:s,scrollArea:d,viewport:f,onViewportChange:c,content:x,onContentChange:p,scrollbarX:w,onScrollbarXChange:E,scrollbarXEnabled:C,onScrollbarXEnabledChange:A,scrollbarY:L,onScrollbarYChange:_,scrollbarYEnabled:I,onScrollbarYEnabledChange:q,onCornerWidthChange:T,onCornerHeightChange:j,children:u.ae.jsx(v.h.div,{dir:N,...i,ref:g,style:{position:"relative","--radix-scroll-area-corner-width":m+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});oe.displayName=Z;var se="ScrollAreaViewport",le=l.forwardRef((e,r)=>{const{__scopeScrollArea:t,children:o,nonce:n,...s}=e,i=R(se,t),d=l.useRef(null),a=u.x(r,d,i.onViewportChange);return u.ae.jsxs(u.ae.Fragment,{children:[u.ae.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),u.ae.jsx(v.h.div,{"data-radix-scroll-area-viewport":"",...s,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.ae.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});le.displayName=se;var S="ScrollAreaScrollbar",G=l.forwardRef((e,r)=>{const{forceMount:t,...o}=e,n=R(S,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=n,d=e.orientation==="horizontal";return l.useEffect(()=>(d?s(!0):i(!0),()=>{d?s(!1):i(!1)}),[d,s,i]),n.type==="hover"?u.ae.jsx(Ce,{...o,ref:r,forceMount:t}):n.type==="scroll"?u.ae.jsx(Le,{...o,ref:r,forceMount:t}):n.type==="auto"?u.ae.jsx(ie,{...o,ref:r,forceMount:t}):n.type==="always"?u.ae.jsx(J,{...o,ref:r}):null});G.displayName=S;var Ce=l.forwardRef((e,r)=>{const{forceMount:t,...o}=e,n=R(S,e.__scopeScrollArea),[s,i]=l.useState(!1);return l.useEffect(()=>{const d=n.scrollArea;let a=0;if(d){const f=()=>{window.clearTimeout(a),i(!0)},c=()=>{a=window.setTimeout(()=>i(!1),n.scrollHideDelay)};return d.addEventListener("pointerenter",f),d.addEventListener("pointerleave",c),()=>{window.clearTimeout(a),d.removeEventListener("pointerenter",f),d.removeEventListener("pointerleave",c)}}},[n.scrollArea,n.scrollHideDelay]),u.ae.jsx(v.R,{present:t||s,children:u.ae.jsx(ie,{"data-state":s?"visible":"hidden",...o,ref:r})})}),Le=l.forwardRef((e,r)=>{const{forceMount:t,...o}=e,n=R(S,e.__scopeScrollArea),s=e.orientation==="horizontal",i=$(()=>a("SCROLL_END"),100),[d,a]=Se("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(d==="idle"){const f=window.setTimeout(()=>a("HIDE"),n.scrollHideDelay);return()=>window.clearTimeout(f)}},[d,n.scrollHideDelay,a]),l.useEffect(()=>{const f=n.viewport,c=s?"scrollLeft":"scrollTop";if(f){let x=f[c];const p=()=>{const w=f[c];x!==w&&(a("SCROLL"),i()),x=w};return f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[n.viewport,s,a,i]),u.ae.jsx(v.R,{present:t||d!=="hidden",children:u.ae.jsx(J,{"data-state":d==="hidden"?"hidden":"visible",...o,ref:r,onPointerEnter:v.y$1(e.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:v.y$1(e.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),ie=l.forwardRef((e,r)=>{const t=R(S,e.__scopeScrollArea),{forceMount:o,...n}=e,[s,i]=l.useState(!1),d=e.orientation==="horizontal",a=$(()=>{if(t.viewport){const f=t.viewport.offsetWidth<t.viewport.scrollWidth,c=t.viewport.offsetHeight<t.viewport.scrollHeight;i(d?f:c)}},10);return M(t.viewport,a),M(t.content,a),u.ae.jsx(v.R,{present:o||s,children:u.ae.jsx(J,{"data-state":s?"visible":"hidden",...n,ref:r})})}),J=l.forwardRef((e,r)=>{const{orientation:t="vertical",...o}=e,n=R(S,e.__scopeScrollArea),s=l.useRef(null),i=l.useRef(0),[d,a]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=pe(d.viewport,d.content),c={...o,sizes:d,onSizesChange:a,hasThumb:f>0&&f<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function x(p,w){return Ae(p,i.current,d,w)}return t==="horizontal"?u.ae.jsx(_e,{...c,ref:r,onThumbPositionChange:()=>{if(n.viewport&&s.current){const p=n.viewport.scrollLeft,w=te(p,d,n.dir);s.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:p=>{n.viewport&&(n.viewport.scrollLeft=p)},onDragScroll:p=>{n.viewport&&(n.viewport.scrollLeft=x(p,n.dir))}}):t==="vertical"?u.ae.jsx(ke,{...c,ref:r,onThumbPositionChange:()=>{if(n.viewport&&s.current){const p=n.viewport.scrollTop,w=te(p,d);s.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:p=>{n.viewport&&(n.viewport.scrollTop=p)},onDragScroll:p=>{n.viewport&&(n.viewport.scrollTop=x(p))}}):null}),_e=l.forwardRef((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,s=R(S,e.__scopeScrollArea),[i,d]=l.useState(),a=l.useRef(null),f=u.x(r,a,s.onScrollbarXChange);return l.useEffect(()=>{a.current&&d(getComputedStyle(a.current))},[a]),u.ae.jsx(ce,{"data-orientation":"horizontal",...n,ref:f,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Y(t)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,x)=>{if(s.viewport){const p=s.viewport.scrollLeft+c.deltaX;e.onWheelScroll(p),fe(p,x)&&c.preventDefault()}},onResize:()=>{a.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:V(i.paddingLeft),paddingEnd:V(i.paddingRight)}})}})}),ke=l.forwardRef((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,s=R(S,e.__scopeScrollArea),[i,d]=l.useState(),a=l.useRef(null),f=u.x(r,a,s.onScrollbarYChange);return l.useEffect(()=>{a.current&&d(getComputedStyle(a.current))},[a]),u.ae.jsx(ce,{"data-orientation":"vertical",...n,ref:f,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Y(t)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,x)=>{if(s.viewport){const p=s.viewport.scrollTop+c.deltaY;e.onWheelScroll(p),fe(p,x)&&c.preventDefault()}},onResize:()=>{a.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:V(i.paddingTop),paddingEnd:V(i.paddingBottom)}})}})}),[De,ae]=ne(S),ce=l.forwardRef((e,r)=>{const{__scopeScrollArea:t,sizes:o,hasThumb:n,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:d,onThumbPositionChange:a,onDragScroll:f,onWheelScroll:c,onResize:x,...p}=e,w=R(S,t),[E,L]=l.useState(null),_=u.x(r,g=>L(g)),m=l.useRef(null),T=l.useRef(""),b=w.viewport,j=o.content-o.viewport,C=v.n(c),A=v.n(a),I=$(x,10);function q(g){if(m.current){const N=g.clientX-m.current.left,z=g.clientY-m.current.top;f({x:N,y:z})}}return l.useEffect(()=>{const g=N=>{const z=N.target;E!=null&&E.contains(z)&&C(N,j)};return document.addEventListener("wheel",g,{passive:!1}),()=>document.removeEventListener("wheel",g,{passive:!1})},[b,E,j,C]),l.useEffect(A,[o,A]),M(E,I),M(w.content,I),u.ae.jsx(De,{scope:t,scrollbar:E,hasThumb:n,onThumbChange:v.n(s),onThumbPointerUp:v.n(i),onThumbPositionChange:A,onThumbPointerDown:v.n(d),children:u.ae.jsx(v.h.div,{...p,ref:_,style:{position:"absolute",...p.style},onPointerDown:v.y$1(e.onPointerDown,g=>{g.button===0&&(g.target.setPointerCapture(g.pointerId),m.current=E.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),q(g))}),onPointerMove:v.y$1(e.onPointerMove,q),onPointerUp:v.y$1(e.onPointerUp,g=>{const N=g.target;N.hasPointerCapture(g.pointerId)&&N.releasePointerCapture(g.pointerId),document.body.style.webkitUserSelect=T.current,w.viewport&&(w.viewport.style.scrollBehavior=""),m.current=null})})})}),U="ScrollAreaThumb",de=l.forwardRef((e,r)=>{const{forceMount:t,...o}=e,n=ae(U,e.__scopeScrollArea);return u.ae.jsx(v.R,{present:t||n.hasThumb,children:u.ae.jsx(Pe,{ref:r,...o})})}),Pe=l.forwardRef((e,r)=>{const{__scopeScrollArea:t,style:o,...n}=e,s=R(U,t),i=ae(U,t),{onThumbPositionChange:d}=i,a=u.x(r,x=>i.onThumbChange(x)),f=l.useRef(void 0),c=$(()=>{f.current&&(f.current(),f.current=void 0)},100);return l.useEffect(()=>{const x=s.viewport;if(x){const p=()=>{if(c(),!f.current){const w=ze(x,d);f.current=w,d()}};return d(),x.addEventListener("scroll",p),()=>x.removeEventListener("scroll",p)}},[s.viewport,c,d]),u.ae.jsx(v.h.div,{"data-state":i.hasThumb?"visible":"hidden",...n,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:v.y$1(e.onPointerDownCapture,x=>{const p=x.target.getBoundingClientRect(),w=x.clientX-p.left,E=x.clientY-p.top;i.onThumbPointerDown({x:w,y:E})}),onPointerUp:v.y$1(e.onPointerUp,i.onThumbPointerUp)})});de.displayName=U;var Q="ScrollAreaCorner",ue=l.forwardRef((e,r)=>{const t=R(Q,e.__scopeScrollArea),o=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&o?u.ae.jsx(Me,{...e,ref:r}):null});ue.displayName=Q;var Me=l.forwardRef((e,r)=>{const{__scopeScrollArea:t,...o}=e,n=R(Q,t),[s,i]=l.useState(0),[d,a]=l.useState(0),f=!!(s&&d);return M(n.scrollbarX,()=>{var c;const x=((c=n.scrollbarX)==null?void 0:c.offsetHeight)||0;n.onCornerHeightChange(x),a(x)}),M(n.scrollbarY,()=>{var c;const x=((c=n.scrollbarY)==null?void 0:c.offsetWidth)||0;n.onCornerWidthChange(x),i(x)}),f?u.ae.jsx(v.h.div,{...o,ref:r,style:{width:s,height:d,position:"absolute",right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function V(e){return e?parseInt(e,10):0}function pe(e,r){const t=e/r;return isNaN(t)?0:t}function Y(e){const r=pe(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function Ae(e,r,t,o="ltr"){const n=Y(t),s=n/2,i=r||s,d=n-i,a=t.scrollbar.paddingStart+i,f=t.scrollbar.size-t.scrollbar.paddingEnd-d,c=t.content-t.viewport,x=o==="ltr"?[0,c]:[c*-1,0];return he([a,f],x)(e)}function te(e,r,t="ltr"){const o=Y(r),n=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,s=r.scrollbar.size-n,i=r.content-r.viewport,d=s-o,a=t==="ltr"?[0,i]:[i*-1,0],f=je.c(e,a);return he([0,i],[0,d])(f)}function he(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function fe(e,r){return e>0&&e<r}var ze=(e,r=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const s={left:e.scrollLeft,top:e.scrollTop},i=t.left!==s.left,d=t.top!==s.top;(i||d)&&r(),t=s,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function $(e,r){const t=v.n(e),o=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),l.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(t,r)},[t,r])}function M(e,r){const t=v.n(r);v.w(()=>{let o=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(t)});return n.observe(e),()=>{window.cancelAnimationFrame(o),n.unobserve(e)}}},[e,t])}var xe=oe,He=le,Ie=ue;const me=l.forwardRef(({className:e,children:r,...t},o)=>u.ae.jsxs(xe,{ref:o,className:y.mo("relative overflow-auto",e),...t,children:[u.ae.jsx(He,{className:"h-full w-full rounded-[inherit]",children:r}),u.ae.jsx(we,{}),u.ae.jsx(Ie,{})]}));me.displayName=xe.displayName;const we=l.forwardRef(({className:e,orientation:r="vertical",...t},o)=>u.ae.jsx(G,{ref:o,orientation:r,className:y.mo("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:u.ae.jsx(de,{className:"relative flex-1 rounded-full bg-border"})}));we.displayName=G.displayName;const ve=l.forwardRef(({className:e,...r},t)=>u.ae.jsx(me,{className:"w-full",children:u.ae.jsx("table",{ref:t,className:y.mo("caption-bottom text-sm w-full",e),...r})}));ve.displayName="Table";const be=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("thead",{ref:t,className:y.mo("[&_tr]:border-b",e),...r}));be.displayName="TableHeader";const ge=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("tbody",{ref:t,className:y.mo("[&_tr:last-child]:border-0",e),...r}));ge.displayName="TableBody";const qe=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("tfoot",{ref:t,className:y.mo("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...r}));qe.displayName="TableFooter";const W=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("tr",{ref:t,className:y.mo("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...r}));W.displayName="TableRow";const O=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("th",{ref:t,className:y.mo("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...r}));O.displayName="TableHead";const H=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("td",{ref:t,className:y.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...r}));H.displayName="TableCell";const We=l.forwardRef(({className:e,...r},t)=>u.ae.jsx("caption",{ref:t,className:y.mo("mt-4 text-sm text-muted-foreground",e),...r}));We.displayName="TableCaption";/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Oe=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],Fe=X.createLucideIcon("arrow-down-wide-narrow",Oe);/**
|
|
7
|
+
* @license lucide-react v0.511.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ue=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Ve=X.createLucideIcon("arrow-up-down",Ue);/**
|
|
12
|
+
* @license lucide-react v0.511.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Xe=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]],Ye=X.createLucideIcon("arrow-up-wide-narrow",Xe);/**
|
|
17
|
+
* @license lucide-react v0.511.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const $e=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Be=X.createLucideIcon("refresh-cw",$e),Ze=({color:e="currentColor",size:r=24,className:t,...o})=>D.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:e,...o,className:"remixicon "+(t||"")},D.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),Ge=({color:e="currentColor",size:r=24,className:t,...o})=>D.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:e,...o,className:"remixicon "+(t||"")},D.createElement("path",{d:"M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"})),Je=({rows:e=[],columns:r,onRowClick:t,rowKey:o,params:n={page:1,limit:F.DEFAULT_LIMIT},hasNumbers:s=!1,hasCheckbox:i=!1,selectedItems:d,onSelectedItemsChange:a,onSortOrderChange:f})=>{const{sortObject:c,handleSort:x}=B.useSortable({sortField:n==null?void 0:n.sortField,sortOrder:n==null?void 0:n.sortField,onSortOrderChange:f}),{selectedRows:p,isRowSelected:w,isAllRowsSelected:E,handleSelectAllRows:L,handleSelectRow:_}=B.useDataTable({rows:e,defaultSelectedRows:d});return D.useEffect(()=>{a&&a(p)},[p]),h.jsxRuntimeExports.jsx(Ee.ScrollArea,{className:"border-y h-full shrink",children:h.jsxRuntimeExports.jsxs(ve,{children:[h.jsxRuntimeExports.jsx(be,{children:h.jsxRuntimeExports.jsxs(W,{children:[i&&h.jsxRuntimeExports.jsx(O,{className:"w-12 p-3",children:h.jsxRuntimeExports.jsx(k.Ro,{className:"mt-1",checked:E(o),onCheckedChange:m=>L(o,!!m),"aria-label":"Select all"})}),s&&h.jsxRuntimeExports.jsx(O,{className:"w-12 p-2",children:"#"}),r.filter(m=>!m.hidden).map(m=>h.jsxRuntimeExports.jsx(O,{style:m.styles,className:y.mo("p-2",m.sortable&&"cursor-pointer"),onClick:()=>x(m.dataIndex),children:h.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[m.name," ",m.sortable&&((c==null?void 0:c.sortField)===m.key?h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[(c==null?void 0:c.sortOrder)===K.SortOrder.DESC&&h.jsxRuntimeExports.jsx(Fe,{size:15}),(c==null?void 0:c.sortOrder)===K.SortOrder.ASC&&h.jsxRuntimeExports.jsx(Ye,{size:15})]}):h.jsxRuntimeExports.jsx(Ve,{size:15}))]})},m.key))]})}),h.jsxRuntimeExports.jsx(ge,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:e.length?e.map((m,T)=>h.jsxRuntimeExports.jsxs(W,{onClick:()=>{t&&t(m)},"data-state":w(m[o])&&"selected",children:[i&&h.jsxRuntimeExports.jsx(H,{className:"w-12 p-3",onClick:b=>b.stopPropagation(),children:h.jsxRuntimeExports.jsx(k.Ro,{className:"mt-1",checked:w(m[o]),onCheckedChange:b=>_(m[o],!!b),"aria-label":"Select row"})}),s&&h.jsxRuntimeExports.jsx(H,{className:"w-12 p-2",children:(n.page-1)*(n.limit||F.DEFAULT_LIMIT)+T+1}),r.filter(b=>!b.hidden).map(b=>h.jsxRuntimeExports.jsx(H,{className:"max-w-xs overflow-hidden text-ellipsis p-2 text-body-xs-medium",style:b.styles,children:b.render?b.render(k.lodashExports.get(m,b.dataIndex),m):k.lodashExports.get(m,b.dataIndex,"")},`${T}-${b.key}`))]},`${m[o]}`)):h.jsxRuntimeExports.jsx(W,{children:h.jsxRuntimeExports.jsx(H,{colSpan:s?i?r.length+2:r.length+1:r.length,children:h.jsxRuntimeExports.jsx(Re.Empty,{})})})})]})})},Qe=({dataSource:e,columns:r,onRowClick:t,rowKey:o,hasNumbers:n=!1,hasSearch:s=!1,hasCheckbox:i=!1,hasPagination:d=!1,onParamChange:a,tableKey:f,filters:c=[],handleFilterChange:x,params:p,hasColumnsVisibilityDropdown:w=!1})=>{const{t:E}=ye.useTranslation(),[L,_]=D.useState([]),{formattedColumns:m,handleColumnsChange:T,resetColumns:b}=B.useColumns({key:f,columns:r});return h.jsxRuntimeExports.jsxs("div",{className:"border border-border-light overflow-hidden rounded-xl w-full shadow-xs !max-h-[calc(100vh-var(--spacing)*24)] flex flex-col",children:[(s||w&&f||!k.lodashExports.isEmpty(c))&&h.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-4 gap-3 shrink-0",children:[h.jsxRuntimeExports.jsx("div",{className:"shrink w-full",children:s&&h.jsxRuntimeExports.jsx(ee.Search,{defaultValue:k.lodashExports.get(p,"search",""),onSearchChange:j=>({...p,search:j,page:1})})}),h.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[w&&f&&h.jsxRuntimeExports.jsxs(P.Ot,{children:[h.jsxRuntimeExports.jsx(P.kt,{asChild:!0,children:h.jsxRuntimeExports.jsxs(re.u,{variant:"secondary",size:"sm",className:"ml-auto px-3 rounded-lg",children:[h.jsxRuntimeExports.jsx(Ge,{})," ",h.jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:E("Customize columns")}),h.jsxRuntimeExports.jsx(Ze,{})]})}),h.jsxRuntimeExports.jsxs(P.dt,{align:"end",children:[h.jsxRuntimeExports.jsxs(P.lt,{className:"capitalize",onClick:b,children:[h.jsxRuntimeExports.jsx(Be,{})," ",E("Reset columns")]}),h.jsxRuntimeExports.jsx(P.vt,{}),m.map(j=>h.jsxRuntimeExports.jsx(P.pt,{className:"capitalize",checked:!j.hidden,onCheckedChange:C=>T(j,!C),children:j.name},j.key))]})]}),!k.lodashExports.isEmpty(c)&&h.jsxRuntimeExports.jsx(ee.FilterWrapper,{filters:c,onFilter:x})]})]}),h.jsxRuntimeExports.jsx(Je,{params:p,rows:e==null?void 0:e.docs,rowKey:o,columns:m,hasCheckbox:i,hasNumbers:n,onRowClick:t,onSelectedItemsChange:_,onSortOrderChange:({sortField:j,sortOrder:C})=>{a&&a({...p,sortField:j,sortOrder:C})}}),d&&h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col lg:flex-row items-center justify-between gap-3 p-4 shrink-0",children:[h.jsxRuntimeExports.jsx("div",{className:"text-sm",children:h.jsxRuntimeExports.jsx(F.MyLimitSelect,{onLimitChange:j=>{a&&a({...p,limit:j,page:1})},defaultValue:e==null?void 0:e.limit})}),h.jsxRuntimeExports.jsxs("div",{className:"text-sm text-muted-foreground",children:[L.length," of ",(e==null?void 0:e.total)||0," row(s) selected."]}),h.jsxRuntimeExports.jsx("div",{children:h.jsxRuntimeExports.jsx(F.MyPagination,{onPageChange:j=>{a&&a({...p,page:j})},currentPage:e==null?void 0:e.page,totalPages:e==null?void 0:e.totalPages})})]})]})};exports.DataTable=Qe;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as h } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { n as je, u as
|
|
3
|
-
import {
|
|
4
|
-
import { D as ee, a as Le, M as ke } from "./MyLimitSelect-
|
|
2
|
+
import { n as je, u as Ne } from "./check-DE-1lGDl-C8i-XKZO.js";
|
|
3
|
+
import { O as Ce, k as Se, d as Re, l as Ee, v as Te, p as _e } from "./dropdown-menu-D3ab2Xna-DF2PMoGp.js";
|
|
4
|
+
import { D as ee, a as Le, M as ke } from "./MyLimitSelect-r6-geCXQ.js";
|
|
5
5
|
import * as s from "react";
|
|
6
6
|
import U, { useEffect as Pe, useState as De } from "react";
|
|
7
|
-
import { R as re, b as H } from "./MyInput-
|
|
8
|
-
import {
|
|
9
|
-
import { j as Ae, h as $, R as O, a as k,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { b as He, a as $e, u as We } from "./useSortable-
|
|
13
|
-
import { S as Ie } from "./ScrollArea-
|
|
7
|
+
import { R as re, b as H } from "./MyInput-DGKxQKXb.js";
|
|
8
|
+
import { a as p, x as D } from "./index-l1ZGtt0d-BEsNdMV0.js";
|
|
9
|
+
import { j as Ae, h as $, R as O, a as k, n as L, w as Me } from "./index-DqTIeHVj-NrWlaNo4.js";
|
|
10
|
+
import { c as ze } from "./select-BehdTDP2-JSC78BOJ.js";
|
|
11
|
+
import { m as N } from "./utils-D0f6bOsw-HrLsble-.js";
|
|
12
|
+
import { b as He, a as $e, u as We } from "./useSortable-CknNI0yo.js";
|
|
13
|
+
import { S as Ie } from "./ScrollArea-DZ-ZHSWz.js";
|
|
14
14
|
import { S as te } from "./SortOrder-CwuehjY1.js";
|
|
15
15
|
import { E as Fe } from "./Empty-BINT6CbW.js";
|
|
16
16
|
import { c as B } from "./createLucideIcon-B950nf2d.js";
|
|
17
|
-
import { S as Ye, F as Ue } from "./FilterWrapper-
|
|
17
|
+
import { S as Ye, F as Ue } from "./FilterWrapper-D_RVDQiY.js";
|
|
18
18
|
import { u as Ve } from "./useTranslation-dH-uwymc.js";
|
|
19
19
|
function Xe(e, t) {
|
|
20
20
|
return s.useReducer((r, n) => t[r][n] ?? r, e);
|
|
@@ -27,13 +27,13 @@ var G = "ScrollArea", [ne, Ar] = Ae(G), [Oe, j] = ne(G), le = s.forwardRef(
|
|
|
27
27
|
dir: o,
|
|
28
28
|
scrollHideDelay: l = 600,
|
|
29
29
|
...a
|
|
30
|
-
} = e, [d, i] = s.useState(null), [u, c] = s.useState(null), [m, f] = s.useState(null), [v, y] = s.useState(null), [T, _] = s.useState(null), [w,
|
|
30
|
+
} = e, [d, i] = s.useState(null), [u, c] = s.useState(null), [m, f] = s.useState(null), [v, y] = s.useState(null), [T, _] = s.useState(null), [w, R] = s.useState(0), [x, b] = s.useState(0), [E, A] = s.useState(!1), [W, I] = s.useState(!1), g = D(t, (M) => i(M)), C = je(o);
|
|
31
31
|
return /* @__PURE__ */ p.jsx(
|
|
32
32
|
Oe,
|
|
33
33
|
{
|
|
34
34
|
scope: r,
|
|
35
35
|
type: n,
|
|
36
|
-
dir:
|
|
36
|
+
dir: C,
|
|
37
37
|
scrollHideDelay: l,
|
|
38
38
|
scrollArea: d,
|
|
39
39
|
viewport: u,
|
|
@@ -42,18 +42,18 @@ var G = "ScrollArea", [ne, Ar] = Ae(G), [Oe, j] = ne(G), le = s.forwardRef(
|
|
|
42
42
|
onContentChange: f,
|
|
43
43
|
scrollbarX: v,
|
|
44
44
|
onScrollbarXChange: y,
|
|
45
|
-
scrollbarXEnabled:
|
|
45
|
+
scrollbarXEnabled: E,
|
|
46
46
|
onScrollbarXEnabledChange: A,
|
|
47
47
|
scrollbarY: T,
|
|
48
48
|
onScrollbarYChange: _,
|
|
49
49
|
scrollbarYEnabled: W,
|
|
50
50
|
onScrollbarYEnabledChange: I,
|
|
51
|
-
onCornerWidthChange:
|
|
51
|
+
onCornerWidthChange: R,
|
|
52
52
|
onCornerHeightChange: b,
|
|
53
53
|
children: /* @__PURE__ */ p.jsx(
|
|
54
54
|
$.div,
|
|
55
55
|
{
|
|
56
|
-
dir:
|
|
56
|
+
dir: C,
|
|
57
57
|
...a,
|
|
58
58
|
ref: g,
|
|
59
59
|
style: {
|
|
@@ -112,17 +112,17 @@ var se = "ScrollAreaViewport", ae = s.forwardRef(
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
ae.displayName = se;
|
|
115
|
-
var
|
|
115
|
+
var S = "ScrollAreaScrollbar", J = s.forwardRef(
|
|
116
116
|
(e, t) => {
|
|
117
|
-
const { forceMount: r, ...n } = e, o = j(
|
|
117
|
+
const { forceMount: r, ...n } = e, o = j(S, e.__scopeScrollArea), { onScrollbarXEnabledChange: l, onScrollbarYEnabledChange: a } = o, d = e.orientation === "horizontal";
|
|
118
118
|
return s.useEffect(() => (d ? l(!0) : a(!0), () => {
|
|
119
119
|
d ? l(!1) : a(!1);
|
|
120
120
|
}), [d, l, a]), o.type === "hover" ? /* @__PURE__ */ p.jsx(Be, { ...n, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ p.jsx(qe, { ...n, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ p.jsx(ie, { ...n, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ p.jsx(Q, { ...n, ref: t }) : null;
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
-
J.displayName =
|
|
123
|
+
J.displayName = S;
|
|
124
124
|
var Be = s.forwardRef((e, t) => {
|
|
125
|
-
const { forceMount: r, ...n } = e, o = j(
|
|
125
|
+
const { forceMount: r, ...n } = e, o = j(S, e.__scopeScrollArea), [l, a] = s.useState(!1);
|
|
126
126
|
return s.useEffect(() => {
|
|
127
127
|
const d = o.scrollArea;
|
|
128
128
|
let i = 0;
|
|
@@ -145,7 +145,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
145
145
|
}
|
|
146
146
|
) });
|
|
147
147
|
}), qe = s.forwardRef((e, t) => {
|
|
148
|
-
const { forceMount: r, ...n } = e, o = j(
|
|
148
|
+
const { forceMount: r, ...n } = e, o = j(S, e.__scopeScrollArea), l = e.orientation === "horizontal", a = Z(() => i("SCROLL_END"), 100), [d, i] = Xe("hidden", {
|
|
149
149
|
hidden: {
|
|
150
150
|
SCROLL: "scrolling"
|
|
151
151
|
},
|
|
@@ -189,7 +189,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
189
189
|
}
|
|
190
190
|
) });
|
|
191
191
|
}), ie = s.forwardRef((e, t) => {
|
|
192
|
-
const r = j(
|
|
192
|
+
const r = j(S, e.__scopeScrollArea), { forceMount: n, ...o } = e, [l, a] = s.useState(!1), d = e.orientation === "horizontal", i = Z(() => {
|
|
193
193
|
if (r.viewport) {
|
|
194
194
|
const u = r.viewport.offsetWidth < r.viewport.scrollWidth, c = r.viewport.offsetHeight < r.viewport.scrollHeight;
|
|
195
195
|
a(d ? u : c);
|
|
@@ -204,7 +204,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
204
204
|
}
|
|
205
205
|
) });
|
|
206
206
|
}), Q = s.forwardRef((e, t) => {
|
|
207
|
-
const { orientation: r = "vertical", ...n } = e, o = j(
|
|
207
|
+
const { orientation: r = "vertical", ...n } = e, o = j(S, e.__scopeScrollArea), l = s.useRef(null), a = s.useRef(0), [d, i] = s.useState({
|
|
208
208
|
content: 0,
|
|
209
209
|
viewport: 0,
|
|
210
210
|
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
@@ -258,7 +258,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
258
258
|
}
|
|
259
259
|
) : null;
|
|
260
260
|
}), Ze = s.forwardRef((e, t) => {
|
|
261
|
-
const { sizes: r, onSizesChange: n, ...o } = e, l = j(
|
|
261
|
+
const { sizes: r, onSizesChange: n, ...o } = e, l = j(S, e.__scopeScrollArea), [a, d] = s.useState(), i = s.useRef(null), u = D(t, i, l.onScrollbarXChange);
|
|
262
262
|
return s.useEffect(() => {
|
|
263
263
|
i.current && d(getComputedStyle(i.current));
|
|
264
264
|
}, [i]), /* @__PURE__ */ p.jsx(
|
|
@@ -297,7 +297,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
297
297
|
}
|
|
298
298
|
);
|
|
299
299
|
}), Ge = s.forwardRef((e, t) => {
|
|
300
|
-
const { sizes: r, onSizesChange: n, ...o } = e, l = j(
|
|
300
|
+
const { sizes: r, onSizesChange: n, ...o } = e, l = j(S, e.__scopeScrollArea), [a, d] = s.useState(), i = s.useRef(null), u = D(t, i, l.onScrollbarYChange);
|
|
301
301
|
return s.useEffect(() => {
|
|
302
302
|
i.current && d(getComputedStyle(i.current));
|
|
303
303
|
}, [i]), /* @__PURE__ */ p.jsx(
|
|
@@ -336,7 +336,7 @@ var Be = s.forwardRef((e, t) => {
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
);
|
|
339
|
-
}), [Je, ce] = ne(
|
|
339
|
+
}), [Je, ce] = ne(S), de = s.forwardRef((e, t) => {
|
|
340
340
|
const {
|
|
341
341
|
__scopeScrollArea: r,
|
|
342
342
|
sizes: n,
|
|
@@ -349,20 +349,20 @@ var Be = s.forwardRef((e, t) => {
|
|
|
349
349
|
onWheelScroll: c,
|
|
350
350
|
onResize: m,
|
|
351
351
|
...f
|
|
352
|
-
} = e, v = j(
|
|
352
|
+
} = e, v = j(S, r), [y, T] = s.useState(null), _ = D(t, (g) => T(g)), w = s.useRef(null), R = s.useRef(""), x = v.viewport, b = n.content - n.viewport, E = L(c), A = L(i), W = Z(m, 10);
|
|
353
353
|
function I(g) {
|
|
354
354
|
if (w.current) {
|
|
355
|
-
const
|
|
356
|
-
u({ x:
|
|
355
|
+
const C = g.clientX - w.current.left, M = g.clientY - w.current.top;
|
|
356
|
+
u({ x: C, y: M });
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
return s.useEffect(() => {
|
|
360
|
-
const g = (
|
|
361
|
-
const M =
|
|
362
|
-
y != null && y.contains(M) &&
|
|
360
|
+
const g = (C) => {
|
|
361
|
+
const M = C.target;
|
|
362
|
+
y != null && y.contains(M) && E(C, b);
|
|
363
363
|
};
|
|
364
364
|
return document.addEventListener("wheel", g, { passive: !1 }), () => document.removeEventListener("wheel", g, { passive: !1 });
|
|
365
|
-
}, [x, y, b,
|
|
365
|
+
}, [x, y, b, E]), s.useEffect(A, [n, A]), P(y, W), P(v.content, W), /* @__PURE__ */ p.jsx(
|
|
366
366
|
Je,
|
|
367
367
|
{
|
|
368
368
|
scope: r,
|
|
@@ -379,12 +379,12 @@ var Be = s.forwardRef((e, t) => {
|
|
|
379
379
|
ref: _,
|
|
380
380
|
style: { position: "absolute", ...f.style },
|
|
381
381
|
onPointerDown: k(e.onPointerDown, (g) => {
|
|
382
|
-
g.button === 0 && (g.target.setPointerCapture(g.pointerId), w.current = y.getBoundingClientRect(),
|
|
382
|
+
g.button === 0 && (g.target.setPointerCapture(g.pointerId), w.current = y.getBoundingClientRect(), R.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), I(g));
|
|
383
383
|
}),
|
|
384
384
|
onPointerMove: k(e.onPointerMove, I),
|
|
385
385
|
onPointerUp: k(e.onPointerUp, (g) => {
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
const C = g.target;
|
|
387
|
+
C.hasPointerCapture(g.pointerId) && C.releasePointerCapture(g.pointerId), document.body.style.webkitUserSelect = R.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
|
|
388
388
|
})
|
|
389
389
|
}
|
|
390
390
|
)
|
|
@@ -531,7 +531,7 @@ const ve = s.forwardRef(({ className: e, children: t, ...r }, n) => /* @__PURE__
|
|
|
531
531
|
we,
|
|
532
532
|
{
|
|
533
533
|
ref: n,
|
|
534
|
-
className:
|
|
534
|
+
className: N("relative overflow-auto", e),
|
|
535
535
|
...r,
|
|
536
536
|
children: [
|
|
537
537
|
/* @__PURE__ */ p.jsx(tr, { className: "h-full w-full rounded-[inherit]", children: t }),
|
|
@@ -546,7 +546,7 @@ const xe = s.forwardRef(({ className: e, orientation: t = "vertical", ...r }, n)
|
|
|
546
546
|
{
|
|
547
547
|
ref: n,
|
|
548
548
|
orientation: t,
|
|
549
|
-
className:
|
|
549
|
+
className: N(
|
|
550
550
|
"flex touch-none select-none transition-colors",
|
|
551
551
|
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
552
552
|
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -561,18 +561,18 @@ const ge = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(ve,
|
|
|
561
561
|
"table",
|
|
562
562
|
{
|
|
563
563
|
ref: r,
|
|
564
|
-
className:
|
|
564
|
+
className: N("caption-bottom text-sm w-full", e),
|
|
565
565
|
...t
|
|
566
566
|
}
|
|
567
567
|
) }));
|
|
568
568
|
ge.displayName = "Table";
|
|
569
|
-
const be = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx("thead", { ref: r, className:
|
|
569
|
+
const be = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx("thead", { ref: r, className: N("[&_tr]:border-b", e), ...t }));
|
|
570
570
|
be.displayName = "TableHeader";
|
|
571
571
|
const ye = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
572
572
|
"tbody",
|
|
573
573
|
{
|
|
574
574
|
ref: r,
|
|
575
|
-
className:
|
|
575
|
+
className: N("[&_tr:last-child]:border-0", e),
|
|
576
576
|
...t
|
|
577
577
|
}
|
|
578
578
|
));
|
|
@@ -581,7 +581,7 @@ const nr = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
|
581
581
|
"tfoot",
|
|
582
582
|
{
|
|
583
583
|
ref: r,
|
|
584
|
-
className:
|
|
584
|
+
className: N(
|
|
585
585
|
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
586
586
|
e
|
|
587
587
|
),
|
|
@@ -593,7 +593,7 @@ const F = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
|
593
593
|
"tr",
|
|
594
594
|
{
|
|
595
595
|
ref: r,
|
|
596
|
-
className:
|
|
596
|
+
className: N(
|
|
597
597
|
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
598
598
|
e
|
|
599
599
|
),
|
|
@@ -605,7 +605,7 @@ const Y = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
|
605
605
|
"th",
|
|
606
606
|
{
|
|
607
607
|
ref: r,
|
|
608
|
-
className:
|
|
608
|
+
className: N(
|
|
609
609
|
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
610
610
|
e
|
|
611
611
|
),
|
|
@@ -617,7 +617,7 @@ const z = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
|
617
617
|
"td",
|
|
618
618
|
{
|
|
619
619
|
ref: r,
|
|
620
|
-
className:
|
|
620
|
+
className: N("p-4 align-middle [&:has([role=checkbox])]:pr-0", e),
|
|
621
621
|
...t
|
|
622
622
|
}
|
|
623
623
|
));
|
|
@@ -626,7 +626,7 @@ const lr = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ p.jsx(
|
|
|
626
626
|
"caption",
|
|
627
627
|
{
|
|
628
628
|
ref: r,
|
|
629
|
-
className:
|
|
629
|
+
className: N("mt-4 text-sm text-muted-foreground", e),
|
|
630
630
|
...t
|
|
631
631
|
}
|
|
632
632
|
));
|
|
@@ -724,7 +724,7 @@ const hr = [
|
|
|
724
724
|
Y,
|
|
725
725
|
{
|
|
726
726
|
style: w.styles,
|
|
727
|
-
className:
|
|
727
|
+
className: N("p-2", w.sortable && "cursor-pointer"),
|
|
728
728
|
onClick: () => m(w.dataIndex),
|
|
729
729
|
children: /* @__PURE__ */ h.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
730
730
|
w.name,
|
|
@@ -738,7 +738,7 @@ const hr = [
|
|
|
738
738
|
w.key
|
|
739
739
|
))
|
|
740
740
|
] }) }),
|
|
741
|
-
/* @__PURE__ */ h.jsx(ye, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: e.length ? e.map((w,
|
|
741
|
+
/* @__PURE__ */ h.jsx(ye, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: e.length ? e.map((w, R) => /* @__PURE__ */ h.jsxs(
|
|
742
742
|
F,
|
|
743
743
|
{
|
|
744
744
|
onClick: () => {
|
|
@@ -762,7 +762,7 @@ const hr = [
|
|
|
762
762
|
)
|
|
763
763
|
}
|
|
764
764
|
),
|
|
765
|
-
l && /* @__PURE__ */ h.jsx(z, { className: "w-12 p-2", children: (o.page - 1) * (o.limit || ee) +
|
|
765
|
+
l && /* @__PURE__ */ h.jsx(z, { className: "w-12 p-2", children: (o.page - 1) * (o.limit || ee) + R + 1 }),
|
|
766
766
|
t.filter((x) => !x.hidden).map((x) => /* @__PURE__ */ h.jsx(
|
|
767
767
|
z,
|
|
768
768
|
{
|
|
@@ -770,7 +770,7 @@ const hr = [
|
|
|
770
770
|
style: x.styles,
|
|
771
771
|
children: x.render ? x.render(H.get(w, x.dataIndex), w) : H.get(w, x.dataIndex, "")
|
|
772
772
|
},
|
|
773
|
-
`${
|
|
773
|
+
`${R}-${x.key}`
|
|
774
774
|
))
|
|
775
775
|
]
|
|
776
776
|
},
|
|
@@ -799,7 +799,7 @@ const hr = [
|
|
|
799
799
|
params: f,
|
|
800
800
|
hasColumnsVisibilityDropdown: v = !1
|
|
801
801
|
}) => {
|
|
802
|
-
const { t: y } = Ve(), [T, _] = De([]), { formattedColumns: w, handleColumnsChange:
|
|
802
|
+
const { t: y } = Ve(), [T, _] = De([]), { formattedColumns: w, handleColumnsChange: R, resetColumns: x } = We({ key: u, columns: t });
|
|
803
803
|
return /* @__PURE__ */ h.jsxs(
|
|
804
804
|
"div",
|
|
805
805
|
{
|
|
@@ -814,9 +814,9 @@ const hr = [
|
|
|
814
814
|
}
|
|
815
815
|
) }),
|
|
816
816
|
/* @__PURE__ */ h.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-3", children: [
|
|
817
|
-
v && u && /* @__PURE__ */ h.jsxs(
|
|
818
|
-
/* @__PURE__ */ h.jsx(
|
|
819
|
-
|
|
817
|
+
v && u && /* @__PURE__ */ h.jsxs(Ce, { children: [
|
|
818
|
+
/* @__PURE__ */ h.jsx(Se, { asChild: !0, children: /* @__PURE__ */ h.jsxs(
|
|
819
|
+
Ne,
|
|
820
820
|
{
|
|
821
821
|
variant: "secondary",
|
|
822
822
|
size: "sm",
|
|
@@ -829,9 +829,9 @@ const hr = [
|
|
|
829
829
|
]
|
|
830
830
|
}
|
|
831
831
|
) }),
|
|
832
|
-
/* @__PURE__ */ h.jsxs(
|
|
832
|
+
/* @__PURE__ */ h.jsxs(Re, { align: "end", children: [
|
|
833
833
|
/* @__PURE__ */ h.jsxs(
|
|
834
|
-
|
|
834
|
+
Ee,
|
|
835
835
|
{
|
|
836
836
|
className: "capitalize",
|
|
837
837
|
onClick: x,
|
|
@@ -848,7 +848,7 @@ const hr = [
|
|
|
848
848
|
{
|
|
849
849
|
className: "capitalize",
|
|
850
850
|
checked: !b.hidden,
|
|
851
|
-
onCheckedChange: (
|
|
851
|
+
onCheckedChange: (E) => R(b, !E),
|
|
852
852
|
children: b.name
|
|
853
853
|
},
|
|
854
854
|
b.key
|
|
@@ -869,8 +869,8 @@ const hr = [
|
|
|
869
869
|
hasNumbers: o,
|
|
870
870
|
onRowClick: r,
|
|
871
871
|
onSelectedItemsChange: _,
|
|
872
|
-
onSortOrderChange: ({ sortField: b, sortOrder:
|
|
873
|
-
i && i({ ...f, sortField: b, sortOrder:
|
|
872
|
+
onSortOrderChange: ({ sortField: b, sortOrder: E }) => {
|
|
873
|
+
i && i({ ...f, sortField: b, sortOrder: E });
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { a as r } from "./useDateRange-
|
|
3
|
-
import { D as s } from "./DateRangePicker-
|
|
2
|
+
import { a as r } from "./useDateRange-gJSNAOHn.js";
|
|
3
|
+
import { D as s } from "./DateRangePicker-C5E0x2RQ.js";
|
|
4
4
|
const o = "date", R = ({
|
|
5
5
|
dateKey: e = o
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("./jsx-runtime-DUiatUiq.cjs"),s=require("./useDateRange-
|
|
1
|
+
"use strict";const r=require("./jsx-runtime-DUiatUiq.cjs"),s=require("./useDateRange-8LvWPcvl.cjs"),c=require("./DateRangePicker-3-40EsIN.cjs"),e="date",R=({dateKey:t=e})=>{const{range:n,handleRangeSelected:a}=s.useDateRange(t);return r.jsxRuntimeExports.jsx(c.DateRangePicker,{selected:n,onRangeSelected:a})};exports.DEFAULT_DATE_RANGE_KEY=e;exports.DateRangeFilter=R;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),a=require("react"),m=require("./timepicker-
|
|
1
|
+
"use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),a=require("react"),m=require("./timepicker-C_vwQ2np-Bfq0B94y.cjs"),n=require("./dayjs.min-DiHYRps1.cjs"),p=require("./check-DE-1lGDl-B29DO64K.cjs"),d=require("./popover-DDxpKohG-BNvpLrCQ.cjs"),y=require("./utils-D0f6bOsw-BmDOeWKv.cjs"),g=require("./useTranslation-CZf20ucv.cjs"),E=require("./createLucideIcon-BnAj0RnC.cjs");/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const k=[["path",{d:"M11 14h1v4",key:"fy54vd"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],v=E.createLucideIcon("calendar-1",k),q=({className:j,format:i=m.no,selected:x,timezone:u,onRangeSelected:D=()=>{},placeholder:b})=>{const{t:o}=g.useTranslation(),[R,f]=a.useState(!1),[t,c]=a.useState();a.useEffect(()=>{c(x)},[x]);const O=a.useMemo(()=>{const e=n.dayjs().endOf("day");return[{from:e.startOf("week").toDate(),to:e.endOf("week").toDate(),label:o("This week")},{from:e.startOf("month").toDate(),to:e.endOf("month").toDate(),label:o("This month")},{from:e.startOf("year").toDate(),to:e.endOf("year").toDate(),label:o("This year")},{from:e.subtract(7,"day").startOf("day").toDate(),to:e.toDate(),label:o("Last 7 days")},{from:e.subtract(30,"day").startOf("day").toDate(),to:e.toDate(),label:o("Last 30 days")},{from:e.subtract(3,"month").startOf("day").toDate(),to:e.toDate(),label:o("Last 3 months")},{from:e.subtract(6,"month").startOf("day").toDate(),to:e.toDate(),label:o("Last 6 months")},{from:e.subtract(12,"month").startOf("day").toDate(),to:e.toDate(),label:o("Last 12 months")}]},[o]),h=e=>{const{from:r,to:l}=e;c({from:r,to:l}),r&&l&&(D({from:r,to:l}),f(!1))};return s.jsxRuntimeExports.jsx("div",{className:y.mo("grid gap-2",j),children:s.jsxRuntimeExports.jsxs(d.Oe,{open:R,onOpenChange:f,children:[s.jsxRuntimeExports.jsx(d._e,{asChild:!0,children:s.jsxRuntimeExports.jsxs(p.u,{id:"date",size:"sm",variant:"secondary",className:y.mo("min-w-[170px] text-body-xs-regular justify-between",!t&&"text-primary"),children:[t!=null&&t.from?t.to?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[n.dayjs(t.from).format(i)," -"," ",n.dayjs(t.to).format(i)]}):n.dayjs(t.from).format(i):s.jsxRuntimeExports.jsx("span",{className:"text-secondary",children:b}),s.jsxRuntimeExports.jsx(v,{className:"text-secondary"})]})}),s.jsxRuntimeExports.jsxs(d.ue,{className:"w-auto p-0 flex",align:"end",side:"bottom",children:[s.jsxRuntimeExports.jsx("div",{className:"space-y-1 flex flex-col p-2 border-e border-border-alpha-light",children:O.map((e,r)=>s.jsxRuntimeExports.jsx(p.u,{size:"xs",variant:"ghost",className:"justify-start",onClick:()=>h(e),children:e.label},r))}),s.jsxRuntimeExports.jsx(m.Gs,{className:"border-e border-border-alpha-light",mode:"single",endMonth:t==null?void 0:t.to,selected:t==null?void 0:t.from,selectedToDate:t==null?void 0:t.to,selectedFromDate:t==null?void 0:t.from,timeZone:u,disabled:t!=null&&t.to?{after:t.to}:void 0,onSelect:e=>{c({...t,from:e})}}),s.jsxRuntimeExports.jsx(m.Gs,{mode:"single",startMonth:t==null?void 0:t.from,selected:t==null?void 0:t.to,timeZone:u,disabled:t!=null&&t.from?{before:t.from}:void 0,selectedToDate:t==null?void 0:t.to,selectedFromDate:t==null?void 0:t.from,onSelect:e=>{t&&h({...t,to:e})}})]})]})})};exports.DateRangePicker=q;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { useState as h, useEffect as g, useMemo as v } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { n as k, G as y } from "./timepicker-C_vwQ2np-Byjf7Fwu.js";
|
|
4
4
|
import { d as r } from "./dayjs.min-C0f7f7oH.js";
|
|
5
|
-
import { u as p } from "./check-DE-1lGDl-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { u as p } from "./check-DE-1lGDl-C8i-XKZO.js";
|
|
6
|
+
import { O as N, _ as w, u as M } from "./popover-DDxpKohG-DBdU9Sy_.js";
|
|
7
|
+
import { m as x } from "./utils-D0f6bOsw-HrLsble-.js";
|
|
8
8
|
import { u as L } from "./useTranslation-dH-uwymc.js";
|
|
9
9
|
import { c as T } from "./createLucideIcon-B950nf2d.js";
|
|
10
10
|
/**
|
|
@@ -19,7 +19,7 @@ const C = [
|
|
|
19
19
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
20
20
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
21
21
|
["rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", key: "12vinp" }]
|
|
22
|
-
], S = T("calendar-1", C),
|
|
22
|
+
], S = T("calendar-1", C), q = ({
|
|
23
23
|
className: b,
|
|
24
24
|
format: n = k,
|
|
25
25
|
selected: c,
|
|
@@ -159,5 +159,5 @@ const C = [
|
|
|
159
159
|
] }) });
|
|
160
160
|
};
|
|
161
161
|
export {
|
|
162
|
-
|
|
162
|
+
q as D
|
|
163
163
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { y as $, b as
|
|
3
|
-
import { u as r } from "./check-DE-1lGDl-
|
|
2
|
+
import { y as $, b as C, a as O, M as D } from "./MyInput-DGKxQKXb.js";
|
|
3
|
+
import { u as r } from "./check-DE-1lGDl-C8i-XKZO.js";
|
|
4
4
|
import { u as k } from "./useTranslation-dH-uwymc.js";
|
|
5
5
|
import { c } from "./createLucideIcon-B950nf2d.js";
|
|
6
|
-
import { memo as
|
|
7
|
-
import {
|
|
8
|
-
import { M as L } from "./MySelect-
|
|
9
|
-
import { u as R } from "./useFilter-
|
|
6
|
+
import { memo as E, useState as y, useEffect as f, useCallback as b } from "react";
|
|
7
|
+
import { O as q, _ as A, u as I } from "./popover-DDxpKohG-DBdU9Sy_.js";
|
|
8
|
+
import { M as L } from "./MySelect-D7NFdYOL.js";
|
|
9
|
+
import { u as R } from "./useFilter-Cacodr7F.js";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.511.0 - ISC
|
|
12
12
|
*
|
|
@@ -84,7 +84,7 @@ const G = [
|
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
}, ne =
|
|
87
|
+
}, ne = E(function({
|
|
88
88
|
filters: a,
|
|
89
89
|
params: t,
|
|
90
90
|
onFilter: n,
|
|
@@ -92,12 +92,12 @@ const G = [
|
|
|
92
92
|
onCancel: i,
|
|
93
93
|
...d
|
|
94
94
|
}) {
|
|
95
|
-
const { t: m } = k(), [
|
|
95
|
+
const { t: m } = k(), [v, M] = y(!1), [N, h] = y(!1), { form: u } = R({ params: t }), { watch: g, getValues: w, handleSubmit: S, control: x, reset: j } = u;
|
|
96
96
|
f(() => {
|
|
97
97
|
let s = !1;
|
|
98
98
|
a.map((z) => {
|
|
99
|
-
const p =
|
|
100
|
-
(Array.isArray(p) ? p.length > 0 : p) && (s = !0),
|
|
99
|
+
const p = C.get(t, `${z.name}`);
|
|
100
|
+
(Array.isArray(p) ? p.length > 0 : p) && (s = !0), M(s);
|
|
101
101
|
});
|
|
102
102
|
}, [a, t]), f(() => {
|
|
103
103
|
o && o(w());
|
|
@@ -115,8 +115,8 @@ const G = [
|
|
|
115
115
|
)
|
|
116
116
|
}), h(!1);
|
|
117
117
|
}, [n, j, t, a]);
|
|
118
|
-
return /* @__PURE__ */ e.jsxs(
|
|
119
|
-
/* @__PURE__ */ e.jsx(
|
|
118
|
+
return /* @__PURE__ */ e.jsxs(q, { open: N, onOpenChange: h, children: [
|
|
119
|
+
/* @__PURE__ */ e.jsx(A, { children: /* @__PURE__ */ e.jsx(
|
|
120
120
|
r,
|
|
121
121
|
{
|
|
122
122
|
asChild: !0,
|
|
@@ -125,14 +125,14 @@ const G = [
|
|
|
125
125
|
className: "ml-auto px-3",
|
|
126
126
|
...d,
|
|
127
127
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
128
|
-
|
|
128
|
+
v ? /* @__PURE__ */ e.jsx(B, { size: 20 }) : /* @__PURE__ */ e.jsx(P, { size: 20 }),
|
|
129
129
|
" ",
|
|
130
130
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:inline", children: m("Filter") }),
|
|
131
131
|
/* @__PURE__ */ e.jsx(V, {})
|
|
132
132
|
] })
|
|
133
133
|
}
|
|
134
134
|
) }),
|
|
135
|
-
/* @__PURE__ */ e.jsx(I, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(
|
|
135
|
+
/* @__PURE__ */ e.jsx(I, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(O, { ...u, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S(_), className: "space-y-2", children: [
|
|
136
136
|
/* @__PURE__ */ e.jsx("div", { className: "h-full shrink overflow-y-auto p-1", children: a.map(
|
|
137
137
|
(s) => s.options ? /* @__PURE__ */ e.jsx(
|
|
138
138
|
L,
|
|
@@ -146,7 +146,7 @@ const G = [
|
|
|
146
146
|
},
|
|
147
147
|
s.name
|
|
148
148
|
) : /* @__PURE__ */ e.jsx(
|
|
149
|
-
|
|
149
|
+
D,
|
|
150
150
|
{
|
|
151
151
|
control: x,
|
|
152
152
|
placeholder: s.placeholder,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-DUiatUiq.cjs"),a=require("./MyInput-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-DUiatUiq.cjs"),a=require("./MyInput-DNUZn4hg.cjs"),i=require("./check-DE-1lGDl-B29DO64K.cjs"),k=require("./useTranslation-CZf20ucv.cjs"),l=require("./createLucideIcon-BnAj0RnC.cjs"),o=require("react"),j=require("./popover-DDxpKohG-BNvpLrCQ.cjs"),_=require("./MySelect-LpQoa4HG.cjs"),D=require("./useFilter-DjKB_ucC.cjs");/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const F=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],I=l.createLucideIcon("chevron-down",F);/**
|
|
7
7
|
* @license lucide-react v0.511.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const z=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],
|
|
16
|
+
*/const z=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],C=l.createLucideIcon("list-filter",z);/**
|
|
17
17
|
* @license lucide-react v0.511.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const O=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],T=l.createLucideIcon("search",O),A=({name:u="search",defaultValue:t,onSearchChange:n})=>{const{t:r}=k.useTranslation(),c=x=>{const p=new FormData(x.currentTarget);n(p.get(u)),x.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative min-w-40 w-full max-w-64",onSubmit:c,children:[e.jsxRuntimeExports.jsx(a.yo,{className:"rounded-lg h-8",name:u,placeholder:r("Search..."),defaultValue:t?`${t}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"!bg-transparent absolute top-0 right-0 cursor-pointer rounded-md text-foreground",size:"sm",children:e.jsxRuntimeExports.jsx(T,{})})]})},W=o.memo(function({filters:t,params:n,onFilter:r,onChange:c,onCancel:x,...p}){const{t:d}=k.useTranslation(),[b,f]=o.useState(!1),[v,m]=o.useState(!1),{form:y}=D.useFilter({params:n}),{watch:M,getValues:N,handleSubmit:g,control:E,reset:R}=y;o.useEffect(()=>{let s=!1;t.map(S=>{const h=a.lodashExports.get(n,`${S.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),f(s)})},[t,n]),o.useEffect(()=>{c&&c(N())},[M()]);const q=o.useCallback((s={})=>{r&&r(s),m(!1)},[r]),w=o.useCallback(()=>{R(),r&&n&&r({...n,...Object.fromEntries(t.map(s=>[s.name,void 0]))}),m(!1)},[r,R,n,t]);return e.jsxRuntimeExports.jsxs(j.Oe,{open:v,onOpenChange:m,children:[e.jsxRuntimeExports.jsx(j._e,{children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...p,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[b?e.jsxRuntimeExports.jsx($,{size:20}):e.jsxRuntimeExports.jsx(C,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:d("Filter")}),e.jsxRuntimeExports.jsx(I,{})]})})}),e.jsxRuntimeExports.jsx(j.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(a.Mf,{...y,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:g(q),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink overflow-y-auto p-1",children:t.map(s=>s.options?e.jsxRuntimeExports.jsx(_.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(a.MyInput,{control:E,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:w,children:d("Reset")}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:d("Apply")})]})]})})})]})});exports.FilterWrapper=W;exports.Search=A;
|