@tap-payments/os-micro-frontend-shared 0.3.283 → 0.3.284-test.1794600023
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/build/_chunks/chunk-7JHHRIBK.js +2 -0
- package/build/_chunks/chunk-EJSKVMPF.js +1 -0
- package/build/_chunks/{chunk-J5Y23R6K.js → chunk-H2KCDUMN.js} +1 -1
- package/build/_chunks/chunk-NNMPGGZY.js +2 -0
- package/build/_chunks/chunk-U2D7PCC4.js +1 -0
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/ExpandableChip/ExpandableChip.d.ts +4 -0
- package/build/components/ExpandableChip/constants.d.ts +43 -0
- package/build/components/ExpandableChip/hooks/useExpandableChip.d.ts +23 -0
- package/build/components/ExpandableChip/index.d.ts +3 -0
- package/build/components/ExpandableChip/index.js +1 -0
- package/build/components/{LeftPeekRightExpandingChip → ExpandableChip}/style.d.ts +561 -10
- package/build/components/ExpandableChip/type.d.ts +89 -0
- package/build/components/ExpandableChip/utils.d.ts +16 -0
- package/build/components/FilterBar/constants.d.ts +8 -0
- package/build/components/FilterBar/index.js +1 -1
- package/build/components/FilterChip/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/index.d.ts +2 -2
- package/build/components/index.js +1 -1
- package/build/components/modules/RangeCalender/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-564OU743.js +0 -2
- package/build/_chunks/chunk-SLWEWDRS.js +0 -1
- package/build/_chunks/chunk-TPR56EBW.js +0 -2
- package/build/_chunks/chunk-VRPTMDSJ.js +0 -1
- package/build/_chunks/chunk-W2HSCMPT.js +0 -1
- package/build/components/LeftPeekRightExpandingChip/LeftPeekRightExpandingChip.d.ts +0 -13
- package/build/components/LeftPeekRightExpandingChip/index.d.ts +0 -2
- package/build/components/LeftPeekRightExpandingChip/index.js +0 -1
- package/build/components/LeftPeekRightExpandingChip/type.d.ts +0 -7
- package/build/components/LeftPeekRightExpandingChip/useLeftPeekRightExpandingChip.d.ts +0 -26
- package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.d.ts +0 -36
- package/build/components/RightLeftExpandingCenterChip/index.d.ts +0 -2
- package/build/components/RightLeftExpandingCenterChip/index.js +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -3417
- package/build/components/RightLeftExpandingCenterChip/type.d.ts +0 -11
- package/build/components/RightLeftExpandingCenterChip/useRightLeftExpandingCenterChip.d.ts +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-3M7YAX7A.js';import {b as b$1}from'./chunk-AI4TRR5F.js';import {j,a}from'./chunk-32GIDLTK.js';import {R,B as B$1,x,h}from'./chunk-6GZFEPN6.js';import {oc,pc,Bc,q}from'./chunk-Z2DUFVI5.js';import {Wc,Xc,Vj,Wj,Xj,fc,gc,Yj,ec}from'./chunk-3M2GZVQW.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import It from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q$1 from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Xe={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:i,onUpdate:t}){let[n,p]=useState(null),m=!!n&&i,{t:s}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},l=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:s("groupedBy")}),jsxs(Ke,{onClick:u,open:m,children:[jsx("span",{children:Xe[o]}),jsx(S,{component:"img",src:Xc,alt:"arrow",sx:{...m&&{transform:"rotate(180deg)"}}})]}),jsx(R,{open:m,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Xe).map(([d,a])=>jsx(qe,{onClick:()=>{l(d);},className:o===d?"active":"",children:a},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function se({isHijri:e,onCalendarModeSwitch:o}){let{t:i}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:ec,alt:"hijri"}),jsx("span",{children:i("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=se;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var J=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,X=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Z=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o,i]=q();return [new q$1(o),new q$1(i)]}return [new q$1(e?.[0]),new q$1(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:i=false}){let t={locale:J({isHijri:o,isAr:i}),calendar:X(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,i]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(m=>jsx(ao,{onClick:s=>{s.preventDefault(),e(m.value);},children:p(m.id)},m.id))})})}var lo=ce;var so=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:i,onChange:t,numberOfMonths:n=2,...p},m){let s=c=>c==="right"?e?fc:gc:e?gc:fc;return jsx(Calendar,{ref:m,numberOfMonths:n,value:i,onChange:t,calendar:X(o),locale:J({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(so,{onClick:u,children:jsx("img",{src:s(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),F=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:i,defaultCountryTimezone:t}){let[n,p]=useState(null),m=a=>{n||p(a.currentTarget);},s=()=>{n&&p(null);},c=(a,D)=>{a.stopPropagation(),o(D);},u=useMemo(()=>i?.map(a=>oc(a)),[i]),l=useMemo(()=>u?.some(a=>e?.timezone===a?.timezone),[u,e]),d=useMemo(()=>e&&l?e:t,[e,t,l]);return jsxs(L,{onMouseEnter:m,onMouseLeave:s,onClick:()=>{e&&o(d);},children:[l?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"entity-timezone"}),jsx(b,{countryCode:d?.countryCode}),jsx(F,{className:l?"selected":"",children:l?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((a,D)=>{let j=a?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a);},sx:{gap:"4px"},children:[j?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx(b,{countryCode:a?.countryCode}),jsx(F,{className:j?"selected":"",children:a?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?pc(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Vj,alt:"user-timezone"}),jsx(b,{countryCode:t?.countryCode}),jsx(F,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:i,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,m]=useState(null),s=!!p,c=()=>{m(null);},u=a=>{e(a),c();},l=a=>{m(a.currentTarget);},d=useMemo(()=>i===o?.timezone?Vj:o?.timezone===t.timezone?Wj:Xj,[i,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:s,onClick:l,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(b,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:s,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:i})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S,{shouldForwardProp:e=>e!=="$isSingleMonth"})(({theme:e,$isSingleMonth:o})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none",...o&&{width:"100%"}},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0,...o&&{display:"block !important"}},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Wc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:i}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,m]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),s=({period:l,hour:d})=>l==="PM"&&d!==12?d+12:l==="AM"&&d===12?0:d,c=({hour:l,minute:d,period:a})=>{o([t.setHour(s({hour:l,period:a})).setMinute(d).setSecond(0),n]);},u=({hour:l,minute:d,period:a})=>{o([t,n.setHour(s({hour:l,period:a})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:i("allDay")}),jsx(h,{checked:p,onChange:l=>{m(!p),l.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Po=Mt;var Io=Po;function At({defaultDate:e,onDateChange:o,mode:i="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:m,maxDateRange:s,onCalendarGroupChange:c,groupBy:u,timezone:l,onChangeTimezone:d,browserTimezone:a,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Fo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(Z(e)),[x$1,C]=useState(w),[ze,Se]=useState(l??null),[ve,Wo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),P=useRef(null),Ho=Bc(useId(),"range-calender"),ne=i==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(Z(e));}},[y]),useEffect(()=>{if(e){let r=Z(e);ke(r),C(r),P.current&&P.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(l??null);},[l,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),$=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===$&&!p?r:`${r} - ${$}`},[w,p]),Yo=r=>{if(r.length<2||!s){C(r);return}let $=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Pe=It(Qo).diff($,"day");if(Pe<=s){C(r);return}Ee(true),C([r[0],r[1].subtract(Pe-s,"d")]),setTimeout(()=>{Ee(false);},3e3);},$o=r=>{C([M(r[0]),B(r[1])]),P.current&&P.current.set("date",r[0]);},Go=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(B$1,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:Go,$isSingleMonth:n===1,children:[!m&&jsxs(zo,{children:[jsx(lo,{onChange:$o,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Wo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:P,numberOfMonths:n,...Fo}),jsx(x,{in:Be&&!!s,children:jsx(b$1,{severity:"error",message:re("dateRangeError",{number:s}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&a&&Te&&jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:a,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Io,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var bi=Ao;export{bi as a};
|
|
1
|
+
import {j,a}from'./chunk-32GIDLTK.js';import {b}from'./chunk-3M7YAX7A.js';import {b as b$1}from'./chunk-AI4TRR5F.js';import {R,B as B$1,x,h}from'./chunk-6GZFEPN6.js';import {oc,pc,Bc,q}from'./chunk-Z2DUFVI5.js';import {Wc,Xc,Vj,Wj,Xj,fc,gc,Yj,ec}from'./chunk-3M2GZVQW.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import It from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q$1 from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Xe={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:i,onUpdate:t}){let[n,p]=useState(null),m=!!n&&i,{t:s}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},l=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:s("groupedBy")}),jsxs(Ke,{onClick:u,open:m,children:[jsx("span",{children:Xe[o]}),jsx(S,{component:"img",src:Xc,alt:"arrow",sx:{...m&&{transform:"rotate(180deg)"}}})]}),jsx(R,{open:m,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Xe).map(([d,a])=>jsx(qe,{onClick:()=>{l(d);},className:o===d?"active":"",children:a},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function se({isHijri:e,onCalendarModeSwitch:o}){let{t:i}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:ec,alt:"hijri"}),jsx("span",{children:i("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=se;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var J=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,X=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Z=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o,i]=q();return [new q$1(o),new q$1(i)]}return [new q$1(e?.[0]),new q$1(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:i=false}){let t={locale:J({isHijri:o,isAr:i}),calendar:X(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,i]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(m=>jsx(ao,{onClick:s=>{s.preventDefault(),e(m.value);},children:p(m.id)},m.id))})})}var lo=ce;var so=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:i,onChange:t,numberOfMonths:n=2,...p},m){let s=c=>c==="right"?e?fc:gc:e?gc:fc;return jsx(Calendar,{ref:m,numberOfMonths:n,value:i,onChange:t,calendar:X(o),locale:J({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(so,{onClick:u,children:jsx("img",{src:s(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),F=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:i,defaultCountryTimezone:t}){let[n,p]=useState(null),m=a=>{n||p(a.currentTarget);},s=()=>{n&&p(null);},c=(a,D)=>{a.stopPropagation(),o(D);},u=useMemo(()=>i?.map(a=>oc(a)),[i]),l=useMemo(()=>u?.some(a=>e?.timezone===a?.timezone),[u,e]),d=useMemo(()=>e&&l?e:t,[e,t,l]);return jsxs(L,{onMouseEnter:m,onMouseLeave:s,onClick:()=>{e&&o(d);},children:[l?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"entity-timezone"}),jsx(b,{countryCode:d?.countryCode}),jsx(F,{className:l?"selected":"",children:l?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((a,D)=>{let j=a?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a);},sx:{gap:"4px"},children:[j?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx(b,{countryCode:a?.countryCode}),jsx(F,{className:j?"selected":"",children:a?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?pc(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Yj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Vj,alt:"user-timezone"}),jsx(b,{countryCode:t?.countryCode}),jsx(F,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:i,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,m]=useState(null),s=!!p,c=()=>{m(null);},u=a=>{e(a),c();},l=a=>{m(a.currentTarget);},d=useMemo(()=>i===o?.timezone?Vj:o?.timezone===t.timezone?Wj:Xj,[i,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:s,onClick:l,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(b,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:s,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:i})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S,{shouldForwardProp:e=>e!=="$isSingleMonth"})(({theme:e,$isSingleMonth:o})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none",...o&&{width:"100%"}},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0,...o&&{display:"block !important"}},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Wc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:i}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,m]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),s=({period:l,hour:d})=>l==="PM"&&d!==12?d+12:l==="AM"&&d===12?0:d,c=({hour:l,minute:d,period:a})=>{o([t.setHour(s({hour:l,period:a})).setMinute(d).setSecond(0),n]);},u=({hour:l,minute:d,period:a})=>{o([t,n.setHour(s({hour:l,period:a})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:i("allDay")}),jsx(h,{checked:p,onChange:l=>{m(!p),l.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Po=Mt;var Io=Po;function At({defaultDate:e,onDateChange:o,mode:i="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:m,maxDateRange:s,onCalendarGroupChange:c,groupBy:u,timezone:l,onChangeTimezone:d,browserTimezone:a,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Fo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(Z(e)),[x$1,C]=useState(w),[ze,Se]=useState(l??null),[ve,Wo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),P=useRef(null),Ho=Bc(useId(),"range-calender"),ne=i==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(Z(e));}},[y]),useEffect(()=>{if(e){let r=Z(e);ke(r),C(r),P.current&&P.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(l??null);},[l,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),$=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===$&&!p?r:`${r} - ${$}`},[w,p]),Yo=r=>{if(r.length<2||!s){C(r);return}let $=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Pe=It(Qo).diff($,"day");if(Pe<=s){C(r);return}Ee(true),C([r[0],r[1].subtract(Pe-s,"d")]),setTimeout(()=>{Ee(false);},3e3);},$o=r=>{C([M(r[0]),B(r[1])]),P.current&&P.current.set("date",r[0]);},Go=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(B$1,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:Go,$isSingleMonth:n===1,children:[!m&&jsxs(zo,{children:[jsx(lo,{onChange:$o,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Wo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:P,numberOfMonths:n,...Fo}),jsx(x,{in:Be&&!!s,children:jsx(b$1,{severity:"error",message:re("dateRangeError",{number:s}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&a&&Te&&jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:a,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Io,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var bi=Ao;export{bi as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,a,R,Q,V,U as U$1,z,B}from'./chunk-6GZFEPN6.js';import {g,nc,mc}from'./chunk-Z2DUFVI5.js';import {memo,forwardRef,useState,useEffect,useMemo,useCallback,Fragment as Fragment$1}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled,alpha}from'@mui/material/styles';var c="os-shared-FilterBar";var U={name:"offset",options:{offset:[0,4]}},o={root:`${c}-root`,button:`${c}-button`,labelWrapper:`${c}-labelWrapper`,label:`${c}-label`,icon:`${c}-icon`,badge:`${c}-badge`,chevronSlot:`${c}-chevronSlot`,menu:`${c}-menu`,menuItem:`${c}-menuItem`};var Y=jsx("svg",{width:"27",height:"32",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:"currentColor"})});var _=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(8)})),ee=styled(b,{shouldForwardProp:e=>e!=="$isActive"&&e!=="$hasMenu"})(({theme:e,$isActive:l=false,$hasMenu:r=false})=>{let{base:d,grey:i,foreground:f}=e.v2.palette,s=e.palette.background.gradient.shadedBlue;return {fontSize:e.typography.subtitle1.fontSize,lineHeight:e.typography.subtitle1.lineHeight,fontWeight:e.v2.typography.fontWeightRegular,boxSizing:"border-box",borderRadius:e.v2.radius(50),borderWidth:e.v2.spacing(1),borderStyle:"solid",minWidth:"135.11px",height:e.v2.spacing(32),minHeight:e.v2.spacing(32),display:"flex",justifyContent:"center",alignItems:"center",gap:e.v2.spacing(8),textTransform:"none",transition:"none",WebkitTapHighlightColor:"transparent",padding:0,paddingInline:e.v2.spacing(16),[`& .${a.content}`]:{width:"100%",minWidth:0},...r&&{paddingInlineEnd:e.v2.spacing(27),overflow:"hidden",[`& .${o.labelWrapper}`]:{paddingInlineEnd:e.v2.spacing(8)}},...l?{background:s,color:d.white,"&:hover":{background:s,opacity:.8}}:{backgroundColor:d.white,borderColor:i[100],color:f.primary,"&:hover":{backgroundColor:d.white,opacity:.7}}}}),te=styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),ne=styled("span",{shouldForwardProp:e=>e!=="$isActive"})(({theme:e,$isActive:l=false})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:e.v2.spacing(4),fontWeight:l?e.v2.typography.fontWeightBolder:e.v2.typography.fontWeightRegular})),re=styled("span",{shouldForwardProp:e=>e!=="$isActive"})(({theme:e,$isActive:l=false})=>({display:"flex",alignItems:"center",width:e.v2.spacing(14),height:e.v2.spacing(14),"& img":{width:e.v2.spacing(14),height:e.v2.spacing(14),filter:l?"brightness(0) invert(1)":"brightness(0) invert(0)"}})),ae=styled("span",{shouldForwardProp:e=>e!=="$isActive"})(({theme:e,$isActive:l=false})=>{let{base:r,grey:d,foreground:i}=e.v2.palette;return {position:"absolute",top:0,right:0,bottom:0,width:e.v2.spacing(27),boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",...!l&&{boxShadow:`inset 1px 0 0 ${d[100]}`},color:l?r.white:i.secondary,transition:"background-color 0.15s ease","& svg":{display:"block",width:e.v2.spacing(27),height:e.v2.spacing(32),flexShrink:0,pointerEvents:"none"},"&:hover":{backgroundColor:alpha(r.black,.1)}}}),oe=styled(R)({[`& .${Q.panel} .menu-item+.menu-item`]:{borderTop:"none"}}),le=styled(V)(({theme:e})=>({minHeight:"36px",height:"36px",gap:e.v2.spacing(4),WebkitTapHighlightColor:"transparent",[`& .${U$1.indicator} img`]:{maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",objectFit:"contain",display:"block"},[`& .${U$1.indicator} svg`]:{display:"block",maxWidth:"100%",maxHeight:"100%"},"&:hover":{boxShadow:"rgba(0, 0, 0, 0.15) 0px 0px 16px 0px"}}));function Ce(e,l){let{isActive:r=false,label:d,startIcon:i,badgeCount:f,onValueChange:s,id:w,className:L,sx:W,disabled:v,disableRipple:t=false}=e,a="items"in e?e.items:void 0,y="items"in e?e.defaultValue:void 0,h="items"in e?e.selectedValue:void 0,C="items"in e?void 0:e.value,[m,u]=useState(null),[$,x]=useState(void 0);useEffect(()=>{r||u(null);},[r]);let B$1=!!a?.length,T=r||h!==void 0,F=!!m,D=h??$,S=useMemo(()=>a?.find(n=>n.value===D),[D,a]),R=useMemo(()=>{if(!a?.length)return;let n=a.find(g=>g.value===y);return S?.value??n?.value??a[0].value},[y,a,S]),V=useMemo(()=>{if(i!=null)return typeof i=="function"?i(r):i;let n=S?.icon;return typeof n=="function"?n(r,true):n},[r,S,i]),de=useMemo(()=>V?jsx(re,{$isActive:r,className:o.icon,children:V}):null,[V,r]),ue=useMemo(()=>f?jsx(z,{color:r?"active":"inactive",className:o.badge,children:g(f)}):null,[f,r]),ce=useCallback(n=>{if(!a){s?.(C);return}if(!T){R!==void 0&&s?.(R),u(null);return}u(F?null:n.currentTarget);},[R,T,F,a,s,C]),A=useCallback(n=>{s?.(n),x(n),u(null);},[s]),pe=useCallback(()=>u(null),[]),fe=useCallback(n=>{n.key==="Escape"&&(n.stopPropagation(),u(null),m?.focus());},[m]),me=useCallback((n,g)=>{n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),A(g));},[A]);return a&&!B$1?null:jsxs(Fragment,{children:[jsx(ee,{ref:l,id:w,"data-testid":w??"FilterBarButton",className:nc(o.button,L),sx:W,variant:r?"primary":"secondary",$isActive:r,$hasMenu:B$1,disabled:v,disableRipple:t,"aria-pressed":r,"aria-haspopup":B$1?"menu":void 0,"aria-expanded":B$1?F:void 0,onClick:ce,children:jsxs(te,{className:o.labelWrapper,children:[jsxs(ne,{$isActive:r,className:o.label,children:[de,S?.label??d,ue]}),B$1&&jsx(ae,{$isActive:r,className:o.chevronSlot,children:Y})]})}),B$1&&jsxs(Fragment,{children:[jsx(B,{open:F,onClick:pe}),jsx(oe,{open:F,anchorEl:m,className:o.menu,placement:"bottom-start",modifiers:[U],panelProps:{role:"menu",onKeyDown:fe,sx:{minWidth:m?.clientWidth??133}},children:a?.map(n=>{let g=n.icon,ge=typeof g=="function"?g(r,false):g;return jsx(le,{role:"menuitem",tabIndex:0,className:o.menuItem,startAdornment:ge??null,onClick:()=>A(n.value),onKeyDown:be=>me(be,n.value),children:n.label??n.value},n.value)})})]})]})}var H=memo(forwardRef(Ce));function Me({value:e,items:l,onValueChange:r,keepInactive:d=false,renderItem:i,itemSx:f,id:s,sx:w,className:L},W){let v=useCallback(t=>r?.(t),[r]);return jsx(_,{ref:W,id:s,"data-testid":s??"FilterBar",className:nc(o.root,L),sx:w,children:l?.map((t,a)=>{let y="items"in t?e!=null&&t.items.some(x=>x.value===e):t.value===e,h=y&&!d,C="items"in t&&y?e:void 0,m=mc(f??{},t.itemSx),u=i?.({isActive:h,selectedValue:C,onActivate:()=>v("items"in t?t.items.find(x=>x.value===t.defaultValue)?.value??t.items[0]?.value:t.value),onDeactivate:()=>v(void 0),onSelect:v},t,a);if(u!=null)return jsx(Fragment$1,{children:u},`filter-bar-custom-${a}`);let $={isActive:h,label:t.label,startIcon:t.startIcon,badgeCount:t.badgeCount,disabled:t.disabled,disableRipple:t.disableRipple,sx:m,onValueChange:v};return "items"in t?jsx(H,{items:t.items,defaultValue:t.defaultValue,selectedValue:C,...$},`filter-bar-nested-${t.items[0]?.value??a}`):jsx(H,{value:t.value,...$},`filter-bar-single-${t.value}`)})})}var we=memo(forwardRef(Me));
|
|
2
|
+
export{o as a,we as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {mc,nc}from'./chunk-Z2DUFVI5.js';import {forwardRef,useCallback,memo}from'react';import {jsxs,jsx}from'react/jsx-runtime';import {styled,alpha}from'@mui/material/styles';var u="os-shared-FilterChip",a={root:`${u}-root`,label:`${u}-label`,dismissButton:`${u}-dismissButton`,dismissIcon:`${u}-dismissIcon`},C=",",g="Dismiss filter";function L({className:t}){return jsxs("svg",{className:t,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:[jsx("path",{d:"M1.79488 1.73941L6.31572 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"}),jsx("path",{d:"M6.31572 1.73941L1.79488 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"})]})}var k=styled("div",{shouldForwardProp:t=>!["$disabled","$isActive"].includes(t)})(({theme:t,$disabled:e,$isActive:r=true})=>{let{base:o,grey:s,foreground:n}=t.v2.palette,p=t.v2.spacing(1),i=t.palette.background.gradient.shadedBlue;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",gap:t.v2.spacing(8),height:t.v2.spacing(32),minWidth:"135.11px",maxWidth:"16rem",boxSizing:"border-box",borderStyle:"solid",borderRadius:t.v2.radius(48),...t.v2.typography.textVariants.body.small.regular,whiteSpace:"nowrap",overflow:"hidden",cursor:"default",opacity:e?.6:1,...r?{borderWidth:0,paddingInline:`calc(${t.v2.spacing(16)} + ${p})`,background:i,color:o.white}:{borderWidth:p,borderColor:s[100],paddingInline:t.v2.spacing(16),backgroundColor:o.white,color:n.primary}}}),E=styled("span")(({theme:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"1 1 auto",textAlign:"center",fontWeight:t.v2.typography.fontWeightRegular})),_=styled("button",{shouldForwardProp:t=>t!=="$disabled"&&t!=="$isActive"})(({theme:t,$disabled:e,$isActive:r=true})=>{let{base:o,foreground:s}=t.v2.palette;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:0,width:"16px",height:"16px",padding:0,border:"none",borderRadius:"50%",backgroundColor:alpha(o.black,.1),color:r?o.white:s.secondary,cursor:e?"not-allowed":"pointer",opacity:e?.6:1,transition:"opacity 150ms ease, background-color 150ms ease","&:hover":e?void 0:{backgroundColor:alpha(o.black,.2)},"&:focus-visible":{outline:`2px solid ${r?o.white:s.secondary}`,outlineOffset:"1px"},"& svg":{display:"block"}}});var A=forwardRef(({label:t,value:e,separator:r=C,visible:o=true,dismissible:s=true,onDismiss:n,dismissLabel:p=g,disabled:i=false,isActive:x=true,children:F,id:S,sx:R,className:w,slotProps:P,"data-testid":T},$)=>{let{label:h,dismissButton:l}=P??{},B=useCallback(f=>{f.stopPropagation(),!i&&(l?.onClick?.(f),n?.(f));},[i,l,n]);if(!o)return null;let m=t??(typeof e=="string"?e:e&&e.length>0?e.join(r):void 0);if(!m&&!F)return null;let N=s&&n!=null;return jsxs(k,{ref:$,id:S,"data-testid":T??S??"FilterChip",className:nc(a.root,w),sx:mc({},R),$disabled:i,$isActive:x,role:"status",children:[m?jsx(E,{...h,className:nc(a.label,h?.className),sx:mc({},h?.sx),children:m}):F,N&&jsx(_,{...l,type:"button","aria-label":l?.["aria-label"]??p,disabled:i,onClick:B,className:nc(a.dismissButton,l?.className),sx:mc({},l?.sx),$disabled:i,$isActive:x,children:jsx(L,{className:a.dismissIcon})})]})});A.displayName="FilterChip";var U=memo(A);export{a,C as b,g as c,U as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{pc as ColumnViewsPicker,rc as CreateViewDialog,nc as CustomViews,oc as DefaultViews,qc as ViewsDropdown,Jb as areAllColumnsSelected,Pb as areAllCurrentColumnsSelected,Sb as areColumnsEqual,Kb as areSomeColumnsSelected,Qb as areSomeCurrentColumnsSelected,ic as buildFullTemplateLayouts,gc as buildRequiredColumnView,qb as convertColumnsToLayoutSection,$b as convertTemplateToColumnsView,ac as convertTemplatesToColumnsView,yb as countCustomTemplates,zb as countCustomViewMenuItems,sb as createCustomViewMenuItem,Mb as deepCloneColumns,Fb as getColumnCheckState,Yb as getColumnOrder,pb as getColumnsByMode,ec as getLayoutCodesForMode,rb as getLayoutDataFromTemplates,fc as getOtherModeSectionCode,Xb as getSubmenuFromTemplateLayout,Cb as getSubmenuItems,Eb as getSubmenuItemsForDisplay,ub as getTemplateRole,Zb as handleTemplateUpdate,hc as hasLayoutSectionForMode,Db as hasSubmenu,Vb as initializeCreateColumns,Wb as initializeCreateColumnsWithCurrentState,Ub as initializeEditingColumns,dc as isCheckboxInteractionTarget,xb as isCustomTemplate,wb as isCustomView,mb as isDateColumn,nb as isIndexColumn,vb as isPresetView,Lb as isValidTemplateName,Bb as mapTemplatesToMenuItems,Rb as normalizeColumnsSelected,bc as replaceTemplateInList,Tb as resetColumnsToDefault,tb as setViewAsDefault,_b as templateToViewMenuItem,Ib as toggleAllColumns,Ob as toggleAllCurrentColumns,Gb as toggleColumn,Nb as toggleSingleColumn,Hb as toggleSubItem,ob as transformLayoutToColumns,Ab as transformTemplatesToViewMenuItems,cc as updateCurrentTemplate,mc as useCustomTableViews,lc as useSubmenuHover,jc as useViewsManager,kc as useViewsMenu}from'../../_chunks/chunk-
|
|
1
|
+
export{pc as ColumnViewsPicker,rc as CreateViewDialog,nc as CustomViews,oc as DefaultViews,qc as ViewsDropdown,Jb as areAllColumnsSelected,Pb as areAllCurrentColumnsSelected,Sb as areColumnsEqual,Kb as areSomeColumnsSelected,Qb as areSomeCurrentColumnsSelected,ic as buildFullTemplateLayouts,gc as buildRequiredColumnView,qb as convertColumnsToLayoutSection,$b as convertTemplateToColumnsView,ac as convertTemplatesToColumnsView,yb as countCustomTemplates,zb as countCustomViewMenuItems,sb as createCustomViewMenuItem,Mb as deepCloneColumns,Fb as getColumnCheckState,Yb as getColumnOrder,pb as getColumnsByMode,ec as getLayoutCodesForMode,rb as getLayoutDataFromTemplates,fc as getOtherModeSectionCode,Xb as getSubmenuFromTemplateLayout,Cb as getSubmenuItems,Eb as getSubmenuItemsForDisplay,ub as getTemplateRole,Zb as handleTemplateUpdate,hc as hasLayoutSectionForMode,Db as hasSubmenu,Vb as initializeCreateColumns,Wb as initializeCreateColumnsWithCurrentState,Ub as initializeEditingColumns,dc as isCheckboxInteractionTarget,xb as isCustomTemplate,wb as isCustomView,mb as isDateColumn,nb as isIndexColumn,vb as isPresetView,Lb as isValidTemplateName,Bb as mapTemplatesToMenuItems,Rb as normalizeColumnsSelected,bc as replaceTemplateInList,Tb as resetColumnsToDefault,tb as setViewAsDefault,_b as templateToViewMenuItem,Ib as toggleAllColumns,Ob as toggleAllCurrentColumns,Gb as toggleColumn,Nb as toggleSingleColumn,Hb as toggleSubItem,ob as transformLayoutToColumns,Ab as transformTemplatesToViewMenuItems,cc as updateCurrentTemplate,mc as useCustomTableViews,lc as useSubmenuHover,jc as useViewsManager,kc as useViewsMenu}from'../../_chunks/chunk-7JHHRIBK.js';import'../../_chunks/chunk-Z2ELLNWM.js';import'../../_chunks/chunk-G3QDXDRW.js';import'../../_chunks/chunk-JK5C4QAJ.js';import'../../_chunks/chunk-YHRFQZCJ.js';import'../../_chunks/chunk-7LVGFAVY.js';import'../../_chunks/chunk-CZZIV6U2.js';import'../../_chunks/chunk-XYGYT5QV.js';import'../../_chunks/chunk-WRJLCKDU.js';import'../../_chunks/chunk-KZIIULI3.js';import'../../_chunks/chunk-VBB5WMVK.js';import'../../_chunks/chunk-ISC5KT5E.js';import'../../_chunks/chunk-MLJHEMAE.js';import'../../_chunks/chunk-7EIZDPRX.js';import'../../_chunks/chunk-2SZKMLBQ.js';import'../../_chunks/chunk-VIBNNV7I.js';import'../../_chunks/chunk-RI3HCTED.js';import'../../_chunks/chunk-NQGK2Q5L.js';import'../../_chunks/chunk-IPYIRN2R.js';import'../../_chunks/chunk-H2KCDUMN.js';import'../../_chunks/chunk-JRADYN3S.js';import'../../_chunks/chunk-MZBS2I4P.js';import'../../_chunks/chunk-RSIJKVO6.js';import'../../_chunks/chunk-LDCRZFUN.js';import'../../_chunks/chunk-LR6FBC7S.js';import'../../_chunks/chunk-ONSPUGYN.js';import'../../_chunks/chunk-UY75PFQ7.js';import'../../_chunks/chunk-ZYP2H2JO.js';import'../../_chunks/chunk-R367WWTC.js';import'../../_chunks/chunk-EJSKVMPF.js';import'../../_chunks/chunk-UENR5XJD.js';import'../../_chunks/chunk-NNMPGGZY.js';import'../../_chunks/chunk-U2D7PCC4.js';import'../../_chunks/chunk-S6DUWS2C.js';import'../../_chunks/chunk-7K7NRYXI.js';import'../../_chunks/chunk-PPHYI47H.js';import'../../_chunks/chunk-N2WU3HEH.js';import'../../_chunks/chunk-PG6JHNLH.js';import'../../_chunks/chunk-3HYMTOAJ.js';import'../../_chunks/chunk-ARPUXMV4.js';import'../../_chunks/chunk-32GIDLTK.js';import'../../_chunks/chunk-QVH3AVGY.js';import'../../_chunks/chunk-XYMZXP5A.js';import'../../_chunks/chunk-OR22XGAD.js';import'../../_chunks/chunk-XSMIOEMD.js';import'../../_chunks/chunk-DO5LOF3O.js';import'../../_chunks/chunk-BT4FYCLB.js';import'../../_chunks/chunk-3M7YAX7A.js';import'../../_chunks/chunk-HFZFV3IA.js';import'../../_chunks/chunk-YI5J4DCB.js';import'../../_chunks/chunk-AI4TRR5F.js';import'../../_chunks/chunk-JDSJDVQK.js';import'../../_chunks/chunk-6PCVGKSW.js';import'../../_chunks/chunk-AYDZ5BY7.js';import'../../_chunks/chunk-2DZTKOWC.js';import'../../_chunks/chunk-IBVECU2A.js';import'../../_chunks/chunk-4UPB4XII.js';import'../../_chunks/chunk-OL4HUADY.js';import'../../_chunks/chunk-FYZLPKZJ.js';import'../../_chunks/chunk-MGKZHRIG.js';import'../../_chunks/chunk-ZERM22LM.js';import'../../_chunks/chunk-B7SIZBZ4.js';import'../../_chunks/chunk-6GZFEPN6.js';import'../../_chunks/chunk-JKW2LY7R.js';export{Db as CUSTOM_VIEW,yb as DATE_COLUMN_CONFIG,Cb as DEFAULT_VIEW,Eb as DEFAULT_VIEW_OPTIONS,tb as DIALOG_HEIGHT,sb as DIALOG_WIDTH,xb as INDEX_COLUMN_CONFIG,ub as MAX_CUSTOM_VIEWS,vb as TEMPLATE_NAME_MAX_LENGTH,wb as TableViewColumnNames}from'../../_chunks/chunk-Z2DUFVI5.js';import'../../_chunks/chunk-3M2GZVQW.js';import'../../_chunks/chunk-LS57WE6K.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Lc as DateFilter}from'../../_chunks/chunk-
|
|
1
|
+
export{Lc as DateFilter}from'../../_chunks/chunk-7JHHRIBK.js';import'../../_chunks/chunk-Z2ELLNWM.js';import'../../_chunks/chunk-G3QDXDRW.js';import'../../_chunks/chunk-JK5C4QAJ.js';import'../../_chunks/chunk-YHRFQZCJ.js';import'../../_chunks/chunk-7LVGFAVY.js';import'../../_chunks/chunk-CZZIV6U2.js';import'../../_chunks/chunk-XYGYT5QV.js';import'../../_chunks/chunk-WRJLCKDU.js';import'../../_chunks/chunk-KZIIULI3.js';import'../../_chunks/chunk-VBB5WMVK.js';import'../../_chunks/chunk-ISC5KT5E.js';import'../../_chunks/chunk-MLJHEMAE.js';import'../../_chunks/chunk-7EIZDPRX.js';import'../../_chunks/chunk-2SZKMLBQ.js';import'../../_chunks/chunk-VIBNNV7I.js';import'../../_chunks/chunk-RI3HCTED.js';import'../../_chunks/chunk-NQGK2Q5L.js';import'../../_chunks/chunk-IPYIRN2R.js';import'../../_chunks/chunk-H2KCDUMN.js';import'../../_chunks/chunk-JRADYN3S.js';import'../../_chunks/chunk-MZBS2I4P.js';import'../../_chunks/chunk-RSIJKVO6.js';import'../../_chunks/chunk-LDCRZFUN.js';import'../../_chunks/chunk-LR6FBC7S.js';import'../../_chunks/chunk-ONSPUGYN.js';import'../../_chunks/chunk-UY75PFQ7.js';import'../../_chunks/chunk-ZYP2H2JO.js';import'../../_chunks/chunk-R367WWTC.js';import'../../_chunks/chunk-EJSKVMPF.js';import'../../_chunks/chunk-UENR5XJD.js';import'../../_chunks/chunk-NNMPGGZY.js';import'../../_chunks/chunk-U2D7PCC4.js';import'../../_chunks/chunk-S6DUWS2C.js';import'../../_chunks/chunk-7K7NRYXI.js';import'../../_chunks/chunk-PPHYI47H.js';import'../../_chunks/chunk-N2WU3HEH.js';import'../../_chunks/chunk-PG6JHNLH.js';import'../../_chunks/chunk-3HYMTOAJ.js';import'../../_chunks/chunk-ARPUXMV4.js';import'../../_chunks/chunk-32GIDLTK.js';import'../../_chunks/chunk-QVH3AVGY.js';import'../../_chunks/chunk-XYMZXP5A.js';import'../../_chunks/chunk-OR22XGAD.js';import'../../_chunks/chunk-XSMIOEMD.js';import'../../_chunks/chunk-DO5LOF3O.js';import'../../_chunks/chunk-BT4FYCLB.js';import'../../_chunks/chunk-3M7YAX7A.js';import'../../_chunks/chunk-HFZFV3IA.js';import'../../_chunks/chunk-YI5J4DCB.js';import'../../_chunks/chunk-AI4TRR5F.js';import'../../_chunks/chunk-JDSJDVQK.js';import'../../_chunks/chunk-6PCVGKSW.js';import'../../_chunks/chunk-AYDZ5BY7.js';import'../../_chunks/chunk-2DZTKOWC.js';import'../../_chunks/chunk-IBVECU2A.js';import'../../_chunks/chunk-4UPB4XII.js';import'../../_chunks/chunk-OL4HUADY.js';import'../../_chunks/chunk-FYZLPKZJ.js';import'../../_chunks/chunk-MGKZHRIG.js';import'../../_chunks/chunk-ZERM22LM.js';import'../../_chunks/chunk-B7SIZBZ4.js';import'../../_chunks/chunk-6GZFEPN6.js';import'../../_chunks/chunk-JKW2LY7R.js';import'../../_chunks/chunk-Z2DUFVI5.js';import'../../_chunks/chunk-3M2GZVQW.js';import'../../_chunks/chunk-LS57WE6K.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExpandableChipProps } from './type';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Readonly<ExpandableChipProps> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ExpandableChipVariant, ResolvedExpandableChipTransition } from './type';
|
|
2
|
+
export declare const expandableChipClassNamePrefix: "os-shared-ExpandableChip";
|
|
3
|
+
export declare const expandableChipClassNames: {
|
|
4
|
+
/** Outer element. Receives consumer `className` / `sx`. */
|
|
5
|
+
readonly root: "os-shared-ExpandableChip-root";
|
|
6
|
+
/** Wrapper around `main` and its adornments — the part that shifts for `expandFrom="start" | "end"`. */
|
|
7
|
+
readonly mainGroup: "os-shared-ExpandableChip-mainGroup";
|
|
8
|
+
/** The always-visible chip. */
|
|
9
|
+
readonly main: "os-shared-ExpandableChip-main";
|
|
10
|
+
/** `startAdornment` / `endAdornment` container. */
|
|
11
|
+
readonly adornment: "os-shared-ExpandableChip-adornment";
|
|
12
|
+
/** One revealed chip (start or end side). */
|
|
13
|
+
readonly item: "os-shared-ExpandableChip-item";
|
|
14
|
+
/** Fan-only decorative sliver hinting at hidden items. */
|
|
15
|
+
readonly peek: "os-shared-ExpandableChip-peek";
|
|
16
|
+
};
|
|
17
|
+
/** Chip height and collapsed sliver width (px). */
|
|
18
|
+
export declare const EXPANDABLE_CHIP_CHIP_SIZE_PX = 24;
|
|
19
|
+
/** Space between open chips (px). */
|
|
20
|
+
export declare const EXPANDABLE_CHIP_GAP_PX = 3;
|
|
21
|
+
/** Stack: how far each stacked sliver sticks out beyond the previous one (px). */
|
|
22
|
+
export declare const EXPANDABLE_CHIP_STACK_STEP_PX = 6;
|
|
23
|
+
/** Fan: how far the decorative sliver sticks out beyond `main` (px). */
|
|
24
|
+
export declare const EXPANDABLE_CHIP_FAN_PEEK_OFFSET_PX = 5;
|
|
25
|
+
/** Adornment width animation duration (s) — same for both variants. */
|
|
26
|
+
export declare const EXPANDABLE_CHIP_ADORNMENT_DURATION_S = 0.2;
|
|
27
|
+
/** Peek / main transition duration (s) used by the fan variant for its sliver. */
|
|
28
|
+
export declare const EXPANDABLE_CHIP_PEEK_DURATION_S = 0.18;
|
|
29
|
+
export declare const EXPANDABLE_CHIP_DEFAULT_Z_INDEX = 1000;
|
|
30
|
+
export declare const EXPANDABLE_CHIP_DEFAULT_VARIANT: ExpandableChipVariant;
|
|
31
|
+
/**
|
|
32
|
+
* Variant defaults. Each variant only decides timing, padding, and how an item looks closed vs open —
|
|
33
|
+
* the positions come from the shared layout in `utils.ts`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const EXPANDABLE_CHIP_VARIANTS: Record<ExpandableChipVariant, ResolvedExpandableChipTransition & {
|
|
36
|
+
/** Horizontal padding inside `main` and open items (px). */
|
|
37
|
+
chipPaddingX: number;
|
|
38
|
+
}>;
|
|
39
|
+
/** Values used when `transition={false}` or the user prefers reduced motion. */
|
|
40
|
+
export declare const EXPANDABLE_CHIP_NO_MOTION: {
|
|
41
|
+
readonly duration: 0;
|
|
42
|
+
readonly stagger: 0;
|
|
43
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExpandableChipProps } from '../type';
|
|
3
|
+
type UseExpandableChipArgs = Pick<ExpandableChipProps, 'main' | 'startItems' | 'endItems' | 'startAdornment' | 'endAdornment' | 'variant' | 'transition' | 'open' | 'defaultOpen' | 'onOpenChange'> & {
|
|
4
|
+
expandFrom: NonNullable<ExpandableChipProps['expandFrom']>;
|
|
5
|
+
};
|
|
6
|
+
/** Open state, measurement, layout, and adornment motion values for `ExpandableChip`. */
|
|
7
|
+
export declare function useExpandableChip({ main, startItems, endItems, startAdornment, endAdornment, expandFrom, variant, transition, open: openProp, defaultOpen, onOpenChange, }: UseExpandableChipArgs): {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
motion: Required<import("../type").ExpandableChipTransition>;
|
|
10
|
+
variant: import("../type").ExpandableChipVariant;
|
|
11
|
+
chipPaddingX: number;
|
|
12
|
+
handleOpen: () => void;
|
|
13
|
+
handleClose: () => void;
|
|
14
|
+
layout: import("../type").ExpandableChipLayout;
|
|
15
|
+
mainRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
16
|
+
startContentRefs: import("react").MutableRefObject<(HTMLSpanElement | null)[]>;
|
|
17
|
+
endContentRefs: import("react").MutableRefObject<(HTMLSpanElement | null)[]>;
|
|
18
|
+
startAdornmentRef: import("react").MutableRefObject<HTMLSpanElement | null>;
|
|
19
|
+
endAdornmentRef: import("react").MutableRefObject<HTMLSpanElement | null>;
|
|
20
|
+
startAdornmentWidth: import("framer-motion").MotionValue<number>;
|
|
21
|
+
endAdornmentWidth: import("framer-motion").MotionValue<number>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as default,a as expandableChipClassNames}from'../../_chunks/chunk-EJSKVMPF.js';import'../../_chunks/chunk-Z2DUFVI5.js';import'../../_chunks/chunk-3M2GZVQW.js';import'../../_chunks/chunk-LS57WE6K.js';
|