@tap-payments/os-micro-frontend-shared 0.3.287 → 0.3.288
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-2IOTEGXO.js → chunk-2M6UER6N.js} +1 -1
- package/build/_chunks/{chunk-XYMZXP5A.js → chunk-47BHPSSP.js} +1 -1
- package/build/_chunks/{chunk-6GZFEPN6.js → chunk-4NLQZJVN.js} +1 -1
- package/build/_chunks/{chunk-VBB5WMVK.js → chunk-5KGT5D5O.js} +1 -1
- package/build/_chunks/{chunk-CZZIV6U2.js → chunk-64OLTOQM.js} +1 -1
- package/build/_chunks/{chunk-NNMPGGZY.js → chunk-6WI5CW2I.js} +1 -1
- package/build/_chunks/{chunk-OR22XGAD.js → chunk-6YAUL2OM.js} +1 -1
- package/build/_chunks/{chunk-7LVGFAVY.js → chunk-72FD3NW2.js} +1 -1
- package/build/_chunks/{chunk-RI3HCTED.js → chunk-7GJ5PPIY.js} +1 -1
- package/build/_chunks/{chunk-N2WU3HEH.js → chunk-7UCD3KUZ.js} +1 -1
- package/build/_chunks/{chunk-DO5LOF3O.js → chunk-7VUU5WEU.js} +1 -1
- package/build/_chunks/{chunk-YHRFQZCJ.js → chunk-A2SC5BOB.js} +1 -1
- package/build/_chunks/{chunk-RSIJKVO6.js → chunk-AE4JYS7U.js} +1 -1
- package/build/_chunks/{chunk-NQGK2Q5L.js → chunk-AMOFAS7L.js} +1 -1
- package/build/_chunks/{chunk-FYZLPKZJ.js → chunk-AXJZMO7Q.js} +1 -1
- package/build/_chunks/{chunk-3HYMTOAJ.js → chunk-BQ46OLDY.js} +1 -1
- package/build/_chunks/{chunk-J5Y23R6K.js → chunk-C2RHW4FN.js} +1 -1
- package/build/_chunks/{chunk-ZERM22LM.js → chunk-CIB4WTBC.js} +1 -1
- package/build/_chunks/{chunk-B7SIZBZ4.js → chunk-CNYQ4OI5.js} +1 -1
- package/build/_chunks/{chunk-PPHYI47H.js → chunk-D52IZHFQ.js} +1 -1
- package/build/_chunks/{chunk-JK5C4QAJ.js → chunk-DKBPLNEE.js} +1 -1
- package/build/_chunks/{chunk-AI4TRR5F.js → chunk-DN33IHNY.js} +1 -1
- package/build/_chunks/chunk-E2Z6V4OE.js +2 -0
- package/build/_chunks/chunk-EP5VELEJ.js +1 -0
- package/build/_chunks/{chunk-MZBS2I4P.js → chunk-GVXTYXRO.js} +1 -1
- package/build/_chunks/{chunk-U2D7PCC4.js → chunk-HPDPFVUQ.js} +1 -1
- package/build/_chunks/{chunk-2SZKMLBQ.js → chunk-HRQGL7NO.js} +1 -1
- package/build/_chunks/{chunk-D7SCPBNH.js → chunk-HZYY6NMO.js} +1 -1
- package/build/_chunks/{chunk-LDCRZFUN.js → chunk-JMPFZOV3.js} +1 -1
- package/build/_chunks/{chunk-LR6FBC7S.js → chunk-JUEXC7Z2.js} +1 -1
- package/build/_chunks/{chunk-UY75PFQ7.js → chunk-KFBXVUQ5.js} +1 -1
- package/build/_chunks/{chunk-JRADYN3S.js → chunk-L42ISYQY.js} +1 -1
- package/build/_chunks/{chunk-3M7YAX7A.js → chunk-LECTWR74.js} +1 -1
- package/build/_chunks/{chunk-UENR5XJD.js → chunk-MLZ63M2D.js} +1 -1
- package/build/_chunks/{chunk-JDSJDVQK.js → chunk-MSEBSRXG.js} +1 -1
- package/build/_chunks/{chunk-YI5J4DCB.js → chunk-MTACYUU3.js} +1 -1
- package/build/_chunks/{chunk-IBVECU2A.js → chunk-NDRHRXAO.js} +2 -2
- package/build/_chunks/{chunk-4UPB4XII.js → chunk-NHAXRGPW.js} +1 -1
- package/build/_chunks/{chunk-WRJLCKDU.js → chunk-OCHPXIEK.js} +1 -1
- package/build/_chunks/{chunk-MLJHEMAE.js → chunk-OHN7F4WA.js} +1 -1
- package/build/_chunks/{chunk-JKW2LY7R.js → chunk-OSXKJYUX.js} +1 -1
- package/build/_chunks/{chunk-AYDZ5BY7.js → chunk-P6WIYEZX.js} +1 -1
- package/build/_chunks/{chunk-XYGYT5QV.js → chunk-PL5M3LK2.js} +1 -1
- package/build/_chunks/{chunk-MGKZHRIG.js → chunk-PNRVZNL7.js} +1 -1
- package/build/_chunks/{chunk-7K7NRYXI.js → chunk-PUI6B7OY.js} +1 -1
- package/build/_chunks/{chunk-ONSPUGYN.js → chunk-RFA33XQQ.js} +1 -1
- package/build/_chunks/{chunk-ARPUXMV4.js → chunk-RTKA6K5L.js} +1 -1
- package/build/_chunks/{chunk-XSMIOEMD.js → chunk-RYHHS7S3.js} +1 -1
- package/build/_chunks/{chunk-7EIZDPRX.js → chunk-S3BFBCVM.js} +1 -1
- package/build/_chunks/{chunk-IPYIRN2R.js → chunk-SO6E7CJM.js} +1 -1
- package/build/_chunks/{chunk-S6DUWS2C.js → chunk-TCI6NIBC.js} +1 -1
- package/build/_chunks/{chunk-PG6JHNLH.js → chunk-TQIWHM5B.js} +1 -1
- package/build/_chunks/{chunk-KZIIULI3.js → chunk-TXLFAI3O.js} +1 -1
- package/build/_chunks/{chunk-HFZFV3IA.js → chunk-U5M6TIFS.js} +1 -1
- package/build/_chunks/{chunk-32GIDLTK.js → chunk-UGX2ZY27.js} +1 -1
- package/build/_chunks/{chunk-VIBNNV7I.js → chunk-UVU4YIMS.js} +1 -1
- package/build/_chunks/{chunk-R367WWTC.js → chunk-V5NBU5TE.js} +1 -1
- package/build/_chunks/{chunk-6PCVGKSW.js → chunk-W3DEOBBE.js} +1 -1
- package/build/_chunks/{chunk-OL4HUADY.js → chunk-WNQ3ONG2.js} +1 -1
- package/build/_chunks/{chunk-BT4FYCLB.js → chunk-XEYCTDD3.js} +1 -1
- package/build/_chunks/{chunk-ZYP2H2JO.js → chunk-XHFDGV2F.js} +1 -1
- package/build/_chunks/{chunk-QVH3AVGY.js → chunk-XLFVCH5I.js} +1 -1
- package/build/_chunks/chunk-XTJZTHR6.js +2 -0
- package/build/_chunks/{chunk-2DZTKOWC.js → chunk-ZGY3RIKJ.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/Card/index.js +1 -1
- package/build/components/CardList/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrenciesMenu/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DateInput/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/ExpandableChip/index.js +1 -1
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- 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/Filters/index.js +1 -1
- package/build/components/FlipCard/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MultiLevelMenu/index.js +1 -1
- package/build/components/MultiLevelSelect/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/Select/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/Sidebar/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/TableReports/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timeline/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Window/index.js +1 -1
- package/build/components/WindowServices/index.js +1 -1
- package/build/components/WindowToolbar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/modules/JSONViewWindow/index.js +1 -1
- package/build/components/modules/RangeCalender/index.js +1 -1
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/modules/WindowShell/index.js +1 -1
- package/build/components/modules/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-3M2GZVQW.js +0 -2
- package/build/_chunks/chunk-QT55YVEL.js +0 -2
- package/build/_chunks/chunk-Z2DUFVI5.js +0 -1
|
@@ -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 {b}from'./chunk-LECTWR74.js';import {b as b$1}from'./chunk-DN33IHNY.js';import {j,a}from'./chunk-UGX2ZY27.js';import {R,B as B$1,x,h}from'./chunk-4NLQZJVN.js';import {oc,pc,Bc,q}from'./chunk-EP5VELEJ.js';import {Xc,Yc,Wj,Xj,Yj,fc,gc,Zj,ec}from'./chunk-XTJZTHR6.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:Yc,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:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,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:Zj,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:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,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?Wj:o?.timezone===t.timezone?Xj:Yj,[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(${Xc})`}},".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 +1 @@
|
|
|
1
|
-
import {nc}from'./chunk-
|
|
1
|
+
import {nc}from'./chunk-EP5VELEJ.js';import {forwardRef,useRef,useState,useCallback,useLayoutEffect,memo}from'react';import g from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var s="os-shared-CardList",e={root:`${s}-root`,item:`${s}-item`,itemContent:`${s}-itemContent`,itemStartAdornment:`${s}-itemStartAdornment`,itemText:`${s}-itemText`,itemEndAdornment:`${s}-itemEndAdornment`};var b=styled(g,{shouldForwardProp:t=>t!=="$showShadow"})(({theme:t,$showShadow:a})=>({borderRadius:"8px",overflow:"auto",flexGrow:1,height:"100%",listStyle:"none",margin:0,padding:0,boxSizing:"border-box",[`& .${e.item}:last-of-type`]:{borderBottom:"none"},"&::after":{content:'""',position:"sticky",bottom:0,display:"block",height:"32px",marginTop:"-32px",background:"linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(251, 251, 251, 0.8) 100%)",borderRadius:"0 0 8px 8px",pointerEvents:"none",zIndex:1,transition:t.transitions.create("opacity",{duration:250}),opacity:a?1:0}})),N=styled(g)(({theme:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingInlineStart:"12px",paddingInlineEnd:"8px",borderBottom:`1px solid ${t.palette.divider}`,height:40,boxSizing:"border-box"})),E=styled("aside")({display:"flex",alignItems:"center",gap:"8px"}),T=styled("span")(({theme:t})=>({color:t.v2.palette.base.black,fontSize:"11px",fontWeight:500,lineHeight:"13.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),$=styled("aside")({display:"flex",alignItems:"center"}),A=styled("aside")({display:"flex",alignItems:"center",gap:"4px"});var v=forwardRef(({hasShadow:t=true,children:a,onScroll:i,id:d,className:l,sx:p,"data-testid":c,...C},r)=>{let L=useRef(null),[P,H]=useState(true),f=useCallback(()=>{let o=L.current;if(!o)return;let{scrollTop:S,scrollHeight:u,clientHeight:I}=o,h=u>I+1&&(S===0||I<u-S-1);H(w=>w===h?w:h);},[]);useLayoutEffect(()=>{f();});let z=useCallback(o=>{L.current=o,typeof r=="function"?r(o):r&&(r.current=o);},[r]),B=useCallback(o=>{f(),i?.(o);},[i,f]);return jsx(b,{...C,component:"ul",ref:z,id:d,"data-testid":c??d??"CardList",onScroll:B,className:nc(e.root,l),sx:p,$showShadow:P&&t,children:a})});v.displayName="CardList";var G=memo(v);var k=forwardRef(({children:t,startAdornment:a,endAdornment:i,id:d,className:l,sx:p,"data-testid":c,...C},r)=>jsxs(N,{...C,component:"li",ref:r,id:d,"data-testid":c??d??"CardListItem",className:nc(e.item,l),sx:p,children:[jsxs(E,{className:e.itemContent,children:[a&&jsx($,{className:e.itemStartAdornment,children:a}),jsx(T,{className:e.itemText,children:t})]}),i&&jsx(A,{className:e.itemEndAdornment,children:i})]}));k.displayName="CardListItem";var J=memo(k);export{e as a,G as b,J as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {v}from'./chunk-6GZFEPN6.js';import {nc,Da,Ea}from'./chunk-Z2DUFVI5.js';import {Gb,Xc}from'./chunk-3M2GZVQW.js';import {forwardRef,useState,useRef,useCallback,memo,useEffect,useMemo}from'react';import H from'@mui/material/Box';import ko from'@mui/material/ClickAwayListener';import Po from'@mui/material/Popper';import go from'@mui/material/Stack';import ro from'@mui/material/Typography';import {RgbColorPicker,RgbaColorPicker}from'react-colorful';import eo from'@mui/material/MenuItem';import {styled,alpha}from'@mui/material/styles';import K from'@mui/material/Button';import Co from'@mui/material/TextField';import ho from'@mui/material/MenuList';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import v$1 from'color';import no from'@mui/material/InputAdornment';var m="os-shared-ColorPicker",n={root:`${m}-root`,controls:`${m}-controls`,swatch:`${m}-swatch`,actions:`${m}-actions`,valueLabel:`${m}-valueLabel`,editButton:`${m}-editButton`,resetButton:`${m}-resetButton`,panel:`${m}-panel`,panelFields:`${m}-panelFields`,panelFooter:`${m}-panelFooter`,panelCancel:`${m}-panelCancel`,panelConfirm:`${m}-panelConfirm`,schemeTrigger:`${m}-schemeTrigger`,schemeList:`${m}-schemeList`,channelInput:`${m}-channelInput`},F={hideReset:false,disableAlpha:false},I={cancel:"Cancel",confirm:"Okay"},w="Edit";var V=styled(go)(({theme:o})=>({backgroundColor:o.palette.grey[400],borderRadius:"4px",padding:o.spacing(.5),paddingRight:o.spacing(1.5)})),X=styled("button")({background:"transparent",border:"none",padding:0,margin:0,cursor:"pointer",width:10,height:10,display:"flex",justifyContent:"center",alignItems:"center","&:disabled, &.Mui-disabled":{opacity:.5,cursor:"not-allowed"}}),Z=styled(H)(({theme:o})=>({boxShadow:"0px 8px 30px rgba(0, 0, 0, 0.16)",width:264,backgroundColor:o.palette.common.white,padding:"12px",borderRadius:o.spacing(1),"& .react-colorful":{width:"100%","&__saturation":{minHeight:152,borderRadius:"4px",marginBottom:o.spacing(2),border:0,"&-pointer":{width:13,height:13}},"&__hue":{borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}},"&__alpha":{marginTop:o.spacing(2),marginBottom:0,border:0,borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}}}})),j=styled(H)(()=>({display:"flex",gap:"8px",justifyContent:"flex-end"})),q=styled("button")(({theme:o})=>({fontWeight:500,fontSize:"9px",color:o.palette.info.dark,textDecoration:"underline",cursor:"pointer",background:"transparent",border:"none",padding:0,margin:0,fontFamily:"inherit","&:disabled, &.Mui-disabled":{color:alpha(o.palette.info.dark,.5),textDecoration:"none",cursor:"not-allowed"},"&:hover:not(:disabled)":{textDecoration:"none"}})),J=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),Q=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}})),Y=styled("button",{shouldForwardProp:o=>o!=="active"})(({theme:o,active:a})=>({display:"flex",justifyContent:"space-between",alignItems:"center",color:o.palette.text.primary,border:"1px solid #F2F2F2",fontSize:12,fontWeight:500,backgroundColor:"transparent",padding:"4px 8px",borderRadius:"4px",minWidth:70,cursor:"pointer",...a&&{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}})),oo=styled(ho)({backgroundColor:"#ffffff",borderRadius:"4px",boxShadow:"0px 8px 30px 0px #00000029",minWidth:70,"& .MuiMenuItem-root":{fontSize:12,fontWeight:500,padding:"4px 8px"}}),b=styled(Co)(({theme:o})=>({"& .MuiOutlinedInput-root":{fontSize:"12px",fontWeight:500,borderRadius:"4px","& input":{padding:"4px","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}},"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"},"&:hover, &.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"}}}}));var yo=({scheme:o,setScheme:a})=>{let[l,t]=useState(null),u=!!l,i=useCallback(c=>{t(l?null:c.currentTarget);},[l]),s=useCallback(()=>{t(null);},[]),d=useCallback(c=>{s(),a(c);},[s,a]);return jsxs(Fragment,{children:[jsxs(Y,{type:"button",active:u,onClick:i,className:n.schemeTrigger,children:[o,jsx(H,{component:"img",sx:{transform:u?"rotateZ(180deg)":"rotateZ(0)",transition:"200ms transform ease-out"},src:Xc,alt:""})]}),jsx(Po,{anchorEl:l,open:u,placement:"bottom",disablePortal:true,keepMounted:true,modifiers:[{name:"offset",options:{offset:[0,4]}}],children:jsx(ko,{onClickAway:c=>{l?.contains(c.target)||s();},children:jsxs(oo,{className:n.schemeList,children:[jsx(eo,{onClick:()=>d("RGB"),children:"RGB"}),jsx(eo,{onClick:()=>d("HEX"),children:"HEX"})]})})})]})},to=yo;function B(o,a){return Number.isNaN(o)||o<0?0:o>a?a:o}var Ao=({value:o,onChange:a,disableAlpha:l=false})=>{let t=useMemo(()=>v$1.rgb(o.r,o.g,o.b,o.a).hex().replace("#",""),[o]),[u,i]=useState(t),s=Math.round(o.a*100);useEffect(()=>{let e=v$1.rgb(o.r,o.g,o.b).hex().replace("#","");i(e);},[o.r,o.g,o.b]);let d=e=>{let r=e.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase();r.length>6&&(r=r.slice(0,6)),i(r);},c=()=>{let e=u;if(e.length===3&&(e=e.split("").map(r=>r+r).join(""),i(e)),e.length===6)try{let r=v$1(`#${e}`).alpha(o.a);a({r:r.red(),g:r.green(),b:r.blue(),a:r.alpha()});}catch{i(t);}else i(t);},C=e=>{let r=B(parseInt(e.target.value,10),100);a({...o,a:r/100});},f=n.channelInput;return jsxs(go,{direction:"row",spacing:1,alignItems:"flex-start",children:[jsx(b,{className:f,value:u,onChange:d,onBlur:c,placeholder:"FFFFFF",sx:{flex:1.4,"& .MuiOutlinedInput-root":{pl:1}},InputProps:{startAdornment:jsx(no,{position:"start",sx:{m:0},children:jsx(ro,{component:"span",color:e=>alpha(e.palette.text.primary,.5),display:"inline-block",fontSize:12,fontWeight:500,children:"#"})})}}),!l&&jsx(b,{className:f,type:"number",value:s,onChange:C,inputProps:{min:0,max:100},sx:{flex:.8,"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",color:"text.primary",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})}})]})},ao=Ao;var _o=({value:o,onChange:a,disableAlpha:l=false})=>{let[t,u]=useState(o),{r:i,g:s,b:d,a:c}=t;useEffect(()=>{u(o);},[o]);let C=useCallback((r,x)=>p=>{u({...t,[r]:B(+p.target.value,x)});},[t]),f=useCallback((r,x)=>{a({...t,[r]:B(t[r],x)});},[a,t]),e=n.channelInput;return jsxs(go,{direction:"row",spacing:1,...l&&{flex:1},children:[jsx(b,{className:e,type:"number",value:i,onBlur:()=>f("r",255),onChange:C("r",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:s,onBlur:()=>f("g",255),onChange:C("g",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:d,onBlur:()=>f("b",255),onChange:C("b",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),!l&&jsx(b,{className:e,type:"number",value:c,onBlur:()=>f("a",100),onChange:C("a",100),inputProps:{min:0,max:100,style:{textAlign:"center"}},variant:"outlined",sx:{"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})},size:"small"})]})},io=_o;var zo=({initialValue:o="#ffffff",onCancel:a,onConfirm:l,disableAlpha:t=false})=>{let[u,i]=useState("RGB"),[s,d]=useState(()=>{let{alpha:p,...k}=Da(o).value;return {...k,a:p}}),c=useCallback(()=>{let{alpha:p,...k}=Da(o).value;d({...k,a:p}),a();},[o,a]),C=useCallback(()=>{let{a:p,...k}=s;l(Ea({...k,alpha:t?1:p}));},[s,l,t]),f=useCallback(p=>{d(t?{...p,a:1}:p);},[t]),e=useCallback(p=>{d({...p,a:p.a/100});},[]),r=useCallback(p=>{d({...p,a:p.a});},[]),x=t?RgbColorPicker:RgbaColorPicker;return jsxs(Z,{className:n.panel,children:[jsx(x,{color:s,onChange:f}),jsxs(go,{mt:2,spacing:1,direction:"row",className:n.panelFields,children:[jsx(to,{scheme:u,setScheme:i}),u==="RGB"?jsx(io,{value:{...s,a:Math.round(s.a*100)},onChange:e,disableAlpha:t}):jsx(ao,{value:{...s,a:s.a},onChange:r,disableAlpha:t})]}),jsx(v,{sx:{my:"12px"}}),jsxs(j,{className:n.panelFooter,children:[jsx(Q,{className:n.panelCancel,onClick:c,children:I.cancel}),jsx(J,{className:n.panelConfirm,onClick:C,children:I.confirm})]})]})},po=zo;var co=forwardRef(({value:o="#ffffff",onChange:a,onReset:l,sx:t,options:u,disabled:i=false,id:s,className:d},c)=>{let[C,f]=useState(null),{disableAlpha:e,hideReset:r}={...F,...u},x=useRef(null),p=useCallback(y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},[c]),k=useCallback(()=>{i||f(x.current);},[i]),mo=useCallback(()=>{i||f(null);},[i]),uo=useCallback(y=>{a(e?y.substring(0,7):y),f(null);},[a,e]);return jsx(ko,{onClickAway:()=>f(null),children:jsxs(V,{ref:p,id:s,"data-testid":s??"ColorPicker",direction:"row",justifyContent:"space-between",spacing:1,alignItems:"center",className:nc(n.root,d),sx:t,children:[jsxs(go,{direction:"row",spacing:1,alignItems:"center",className:n.controls,children:[jsx(H,{borderRadius:"5px",width:32,height:32,sx:{backgroundColor:o},className:n.swatch}),jsxs(H,{className:n.actions,children:[jsx(ro,{className:n.valueLabel,fontWeight:500,fontSize:9,color:"text.primary",textTransform:"uppercase",children:o}),jsx(q,{className:n.editButton,type:"button",onClick:k,disabled:i,children:w})]})]}),r?jsx("div",{}):jsx(X,{className:n.resetButton,type:"button",disabled:i,onClick:l,children:jsx(H,{component:"img",src:Gb,width:10,height:10,alt:""})}),jsx(Po,{anchorEl:C,open:!!C,placement:"top",children:jsx(po,{initialValue:o,onCancel:mo,onConfirm:uo,disableAlpha:e})})]})})});co.displayName="ColorPicker";var qo=memo(co);export{m as a,n as b,F as c,I as d,w as e,qo as f};
|
|
1
|
+
import {v}from'./chunk-4NLQZJVN.js';import {nc,Da,Ea}from'./chunk-EP5VELEJ.js';import {Gb,Yc}from'./chunk-XTJZTHR6.js';import {forwardRef,useState,useRef,useCallback,memo,useEffect,useMemo}from'react';import H from'@mui/material/Box';import ko from'@mui/material/ClickAwayListener';import Po from'@mui/material/Popper';import go from'@mui/material/Stack';import ro from'@mui/material/Typography';import {RgbColorPicker,RgbaColorPicker}from'react-colorful';import eo from'@mui/material/MenuItem';import {styled,alpha}from'@mui/material/styles';import K from'@mui/material/Button';import Co from'@mui/material/TextField';import ho from'@mui/material/MenuList';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import v$1 from'color';import no from'@mui/material/InputAdornment';var m="os-shared-ColorPicker",n={root:`${m}-root`,controls:`${m}-controls`,swatch:`${m}-swatch`,actions:`${m}-actions`,valueLabel:`${m}-valueLabel`,editButton:`${m}-editButton`,resetButton:`${m}-resetButton`,panel:`${m}-panel`,panelFields:`${m}-panelFields`,panelFooter:`${m}-panelFooter`,panelCancel:`${m}-panelCancel`,panelConfirm:`${m}-panelConfirm`,schemeTrigger:`${m}-schemeTrigger`,schemeList:`${m}-schemeList`,channelInput:`${m}-channelInput`},F={hideReset:false,disableAlpha:false},I={cancel:"Cancel",confirm:"Okay"},w="Edit";var V=styled(go)(({theme:o})=>({backgroundColor:o.palette.grey[400],borderRadius:"4px",padding:o.spacing(.5),paddingRight:o.spacing(1.5)})),X=styled("button")({background:"transparent",border:"none",padding:0,margin:0,cursor:"pointer",width:10,height:10,display:"flex",justifyContent:"center",alignItems:"center","&:disabled, &.Mui-disabled":{opacity:.5,cursor:"not-allowed"}}),Z=styled(H)(({theme:o})=>({boxShadow:"0px 8px 30px rgba(0, 0, 0, 0.16)",width:264,backgroundColor:o.palette.common.white,padding:"12px",borderRadius:o.spacing(1),"& .react-colorful":{width:"100%","&__saturation":{minHeight:152,borderRadius:"4px",marginBottom:o.spacing(2),border:0,"&-pointer":{width:13,height:13}},"&__hue":{borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}},"&__alpha":{marginTop:o.spacing(2),marginBottom:0,border:0,borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}}}})),j=styled(H)(()=>({display:"flex",gap:"8px",justifyContent:"flex-end"})),q=styled("button")(({theme:o})=>({fontWeight:500,fontSize:"9px",color:o.palette.info.dark,textDecoration:"underline",cursor:"pointer",background:"transparent",border:"none",padding:0,margin:0,fontFamily:"inherit","&:disabled, &.Mui-disabled":{color:alpha(o.palette.info.dark,.5),textDecoration:"none",cursor:"not-allowed"},"&:hover:not(:disabled)":{textDecoration:"none"}})),J=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),Q=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}})),Y=styled("button",{shouldForwardProp:o=>o!=="active"})(({theme:o,active:a})=>({display:"flex",justifyContent:"space-between",alignItems:"center",color:o.palette.text.primary,border:"1px solid #F2F2F2",fontSize:12,fontWeight:500,backgroundColor:"transparent",padding:"4px 8px",borderRadius:"4px",minWidth:70,cursor:"pointer",...a&&{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}})),oo=styled(ho)({backgroundColor:"#ffffff",borderRadius:"4px",boxShadow:"0px 8px 30px 0px #00000029",minWidth:70,"& .MuiMenuItem-root":{fontSize:12,fontWeight:500,padding:"4px 8px"}}),b=styled(Co)(({theme:o})=>({"& .MuiOutlinedInput-root":{fontSize:"12px",fontWeight:500,borderRadius:"4px","& input":{padding:"4px","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}},"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"},"&:hover, &.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"}}}}));var yo=({scheme:o,setScheme:a})=>{let[l,t]=useState(null),u=!!l,i=useCallback(c=>{t(l?null:c.currentTarget);},[l]),s=useCallback(()=>{t(null);},[]),d=useCallback(c=>{s(),a(c);},[s,a]);return jsxs(Fragment,{children:[jsxs(Y,{type:"button",active:u,onClick:i,className:n.schemeTrigger,children:[o,jsx(H,{component:"img",sx:{transform:u?"rotateZ(180deg)":"rotateZ(0)",transition:"200ms transform ease-out"},src:Yc,alt:""})]}),jsx(Po,{anchorEl:l,open:u,placement:"bottom",disablePortal:true,keepMounted:true,modifiers:[{name:"offset",options:{offset:[0,4]}}],children:jsx(ko,{onClickAway:c=>{l?.contains(c.target)||s();},children:jsxs(oo,{className:n.schemeList,children:[jsx(eo,{onClick:()=>d("RGB"),children:"RGB"}),jsx(eo,{onClick:()=>d("HEX"),children:"HEX"})]})})})]})},to=yo;function B(o,a){return Number.isNaN(o)||o<0?0:o>a?a:o}var Ao=({value:o,onChange:a,disableAlpha:l=false})=>{let t=useMemo(()=>v$1.rgb(o.r,o.g,o.b,o.a).hex().replace("#",""),[o]),[u,i]=useState(t),s=Math.round(o.a*100);useEffect(()=>{let e=v$1.rgb(o.r,o.g,o.b).hex().replace("#","");i(e);},[o.r,o.g,o.b]);let d=e=>{let r=e.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase();r.length>6&&(r=r.slice(0,6)),i(r);},c=()=>{let e=u;if(e.length===3&&(e=e.split("").map(r=>r+r).join(""),i(e)),e.length===6)try{let r=v$1(`#${e}`).alpha(o.a);a({r:r.red(),g:r.green(),b:r.blue(),a:r.alpha()});}catch{i(t);}else i(t);},C=e=>{let r=B(parseInt(e.target.value,10),100);a({...o,a:r/100});},f=n.channelInput;return jsxs(go,{direction:"row",spacing:1,alignItems:"flex-start",children:[jsx(b,{className:f,value:u,onChange:d,onBlur:c,placeholder:"FFFFFF",sx:{flex:1.4,"& .MuiOutlinedInput-root":{pl:1}},InputProps:{startAdornment:jsx(no,{position:"start",sx:{m:0},children:jsx(ro,{component:"span",color:e=>alpha(e.palette.text.primary,.5),display:"inline-block",fontSize:12,fontWeight:500,children:"#"})})}}),!l&&jsx(b,{className:f,type:"number",value:s,onChange:C,inputProps:{min:0,max:100},sx:{flex:.8,"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",color:"text.primary",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})}})]})},ao=Ao;var _o=({value:o,onChange:a,disableAlpha:l=false})=>{let[t,u]=useState(o),{r:i,g:s,b:d,a:c}=t;useEffect(()=>{u(o);},[o]);let C=useCallback((r,x)=>p=>{u({...t,[r]:B(+p.target.value,x)});},[t]),f=useCallback((r,x)=>{a({...t,[r]:B(t[r],x)});},[a,t]),e=n.channelInput;return jsxs(go,{direction:"row",spacing:1,...l&&{flex:1},children:[jsx(b,{className:e,type:"number",value:i,onBlur:()=>f("r",255),onChange:C("r",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:s,onBlur:()=>f("g",255),onChange:C("g",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:d,onBlur:()=>f("b",255),onChange:C("b",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),!l&&jsx(b,{className:e,type:"number",value:c,onBlur:()=>f("a",100),onChange:C("a",100),inputProps:{min:0,max:100,style:{textAlign:"center"}},variant:"outlined",sx:{"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})},size:"small"})]})},io=_o;var zo=({initialValue:o="#ffffff",onCancel:a,onConfirm:l,disableAlpha:t=false})=>{let[u,i]=useState("RGB"),[s,d]=useState(()=>{let{alpha:p,...k}=Da(o).value;return {...k,a:p}}),c=useCallback(()=>{let{alpha:p,...k}=Da(o).value;d({...k,a:p}),a();},[o,a]),C=useCallback(()=>{let{a:p,...k}=s;l(Ea({...k,alpha:t?1:p}));},[s,l,t]),f=useCallback(p=>{d(t?{...p,a:1}:p);},[t]),e=useCallback(p=>{d({...p,a:p.a/100});},[]),r=useCallback(p=>{d({...p,a:p.a});},[]),x=t?RgbColorPicker:RgbaColorPicker;return jsxs(Z,{className:n.panel,children:[jsx(x,{color:s,onChange:f}),jsxs(go,{mt:2,spacing:1,direction:"row",className:n.panelFields,children:[jsx(to,{scheme:u,setScheme:i}),u==="RGB"?jsx(io,{value:{...s,a:Math.round(s.a*100)},onChange:e,disableAlpha:t}):jsx(ao,{value:{...s,a:s.a},onChange:r,disableAlpha:t})]}),jsx(v,{sx:{my:"12px"}}),jsxs(j,{className:n.panelFooter,children:[jsx(Q,{className:n.panelCancel,onClick:c,children:I.cancel}),jsx(J,{className:n.panelConfirm,onClick:C,children:I.confirm})]})]})},po=zo;var co=forwardRef(({value:o="#ffffff",onChange:a,onReset:l,sx:t,options:u,disabled:i=false,id:s,className:d},c)=>{let[C,f]=useState(null),{disableAlpha:e,hideReset:r}={...F,...u},x=useRef(null),p=useCallback(y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},[c]),k=useCallback(()=>{i||f(x.current);},[i]),mo=useCallback(()=>{i||f(null);},[i]),uo=useCallback(y=>{a(e?y.substring(0,7):y),f(null);},[a,e]);return jsx(ko,{onClickAway:()=>f(null),children:jsxs(V,{ref:p,id:s,"data-testid":s??"ColorPicker",direction:"row",justifyContent:"space-between",spacing:1,alignItems:"center",className:nc(n.root,d),sx:t,children:[jsxs(go,{direction:"row",spacing:1,alignItems:"center",className:n.controls,children:[jsx(H,{borderRadius:"5px",width:32,height:32,sx:{backgroundColor:o},className:n.swatch}),jsxs(H,{className:n.actions,children:[jsx(ro,{className:n.valueLabel,fontWeight:500,fontSize:9,color:"text.primary",textTransform:"uppercase",children:o}),jsx(q,{className:n.editButton,type:"button",onClick:k,disabled:i,children:w})]})]}),r?jsx("div",{}):jsx(X,{className:n.resetButton,type:"button",disabled:i,onClick:l,children:jsx(H,{component:"img",src:Gb,width:10,height:10,alt:""})}),jsx(Po,{anchorEl:C,open:!!C,placement:"top",children:jsx(po,{initialValue:o,onCancel:mo,onConfirm:uo,disableAlpha:e})})]})})});co.displayName="ColorPicker";var qo=memo(co);export{m as a,n as b,F as c,I as d,w as e,qo as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o,v,u,t as t$1,n,C,w,r,q,p,s,m,l,z,A,ba}from'./chunk-
|
|
1
|
+
import {o,v,u,t as t$1,n,C,w,r,q,p,s,m,l,z,A,ba}from'./chunk-WNQ3ONG2.js';import {j,P,O,V,R,d}from'./chunk-4NLQZJVN.js';import {nc,mc}from'./chunk-EP5VELEJ.js';import {Sc}from'./chunk-XTJZTHR6.js';import {forwardRef,useRef,useState,memo}from'react';import ze from'@mui/material/ClickAwayListener';import Ve from'@mui/material/SvgIcon';import {jsx,jsxs}from'react/jsx-runtime';import g from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';var i="os-shared-GroupedSelect",t={root:`${i}-root`,trigger:`${i}-trigger`,triggerBody:`${i}-triggerBody`,hasLabel:`${i}-hasLabel`,triggerIcon:`${i}-triggerIcon`,menu:`${i}-menu`,groups:`${i}-groups`,group:`${i}-group`,groupLabel:`${i}-groupLabel`,option:`${i}-option`,optionCheck:`${i}-optionCheck`};function _({open:e}){return jsx(Ve,{viewBox:"0 0 8 5",sx:{width:8,height:5,transform:e?"rotate(180deg)":"none",transition:"transform 0.2s ease, color 0.2s ease"},children:jsx("path",{d:"M7.30273 0.117188C7.3806 0.115307 7.4565 0.138248 7.52051 0.182617C7.58455 0.227088 7.63373 0.290458 7.66211 0.363281C7.69046 0.436073 7.69761 0.516047 7.68262 0.592773C7.66777 0.668745 7.63069 0.738375 7.57715 0.793945L4.17285 4.43164C4.10255 4.50662 4.00523 4.55078 3.90234 4.55078C3.79964 4.55064 3.703 4.5065 3.63281 4.43164L0.227539 0.794922L0.228516 0.793945C0.175799 0.738766 0.139848 0.669812 0.125 0.594727C0.11011 0.519097 0.116275 0.440194 0.143555 0.368164C0.170957 0.296002 0.218752 0.232474 0.28125 0.1875C0.343758 0.14262 0.418162 0.11821 0.495117 0.118164C0.546901 0.118166 0.598306 0.12907 0.645508 0.150391C0.691832 0.171346 0.733094 0.201824 0.767578 0.239258L3.90234 3.58691L7.03711 0.239258C7.10547 0.164191 7.20108 0.119752 7.30273 0.117188Z",fill:"currentColor",stroke:"currentColor",strokeWidth:.233333})})}var te=styled(g,{shouldForwardProp:e=>e!=="open"&&e!=="disabled"})(({theme:e,open:o$1,disabled:c})=>{let u={border:`${o}px solid ${e.v2.palette.brand[500]}`,boxShadow:`0px 0px 4px 0px ${alpha(e.v2.palette.brand[500],.5)}`};return {display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",position:"relative",maxWidth:"100%",outline:"none",[`& .${t.trigger}`]:{border:`${o}px solid transparent`,boxSizing:"border-box",transition:e.transitions.create(["border-color","box-shadow"],{duration:e.transitions.duration.shorter})},...!c&&{[`&:focus-within .${t.trigger}`]:u,...o$1&&{[`& .${t.trigger}`]:u},[`&:focus-within .${t.triggerIcon} .MuiSvgIcon-root`]:{color:e.v2.palette.brand[500]},...o$1&&{[`& .${t.triggerIcon} .MuiSvgIcon-root`]:{color:e.v2.palette.brand[500]}}}}}),oe=styled(g,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:o})=>({flex:1,minWidth:0,height:32,maxHeight:32,borderRadius:"4px",overflow:"hidden",backgroundColor:e.palette.grey[400],cursor:o?"default":"pointer",position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",padding:`0 ${C}px 0 ${w}px`,textAlign:"start",[`&:where(.${t.hasLabel})`]:{height:n,maxHeight:n,gap:t$1,justifyContent:"flex-end",[`& .${t.triggerBody}`]:{flex:"0 0 auto",alignItems:"flex-start",minHeight:v+u,paddingBottom:u,boxSizing:"border-box","& > *":{height:"auto",minHeight:v}}}})),re=styled(j,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:o})=>({alignSelf:"stretch",width:"100%",boxSizing:"border-box",height:s,flexShrink:0,margin:0,paddingTop:p,fontSize:q,fontWeight:500,lineHeight:`${r}px`,textAlign:"start",color:o?e.palette.text.disabled:e.palette.grey[700],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),le=styled(g)(()=>({display:"flex",alignItems:"center",width:"100%",minWidth:0,flex:1})),ne=styled(g,{shouldForwardProp:e=>e!=="$placeholder"&&e!=="$disabled"&&e!=="$valueAlignment"})(({theme:e,$placeholder:o,$disabled:c,$valueAlignment:u=m})=>{let m=u===l.end;return {fontSize:"11px",lineHeight:"11px",color:c?e.palette.text.disabled:o?e.palette.text.secondary:e.v2.palette.base.black,height:22,flex:"1 1 0%",minWidth:0,display:"flex",alignItems:"center",justifyContent:m?"flex-end":"flex-start",textAlign:m?"end":"start",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingInlineEnd:m?0:void 0}}),ie=styled(g,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:o})=>({position:"absolute",right:A,top:"50%",transform:"translateY(-50%)",width:z,height:z,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",lineHeight:0,color:o?e.palette.text.disabled:e.v2.palette.base.black,opacity:o?e.palette.action.disabledOpacity:1})),ae=styled(g)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),de=styled(P)(({theme:e})=>{let o=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:o},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:o},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:o,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}}),se=styled(j)(({theme:e})=>({fontSize:q,color:e.v2.palette.grey[500],fontWeight:600,lineHeight:`${r}px`})),pe=styled(V)(()=>({fontSize:"10px",fontWeight:500,textTransform:"none",justifyContent:"space-between",padding:"8px 20px"}));function je(e,o){return e?.id===o?.id}var ge=forwardRef(({id:e,label:o,placeholder:c,renderValue:u,IconComponent:m$1,isLoading:me=false,valueAlignment:Se=m,options:xe,value:h,onChange:be,isOptionEqualToValue:fe=je,renderOption:he,renderGroupLabel:ye,open:Ge,onOpenChange:Ce,expandedGroupIndex:P,defaultExpandedGroupIndex:$e=0,onExpandedGroupChange:Le,disabled:p=false,sx:we,menuSx:Te,className:ve},Ee)=>{let k=useRef(null),[F,Ie]=useState(null),[Pe,ke]=useState($e),s=Ge??F!==null,S=F??k.current,Fe=P??Pe,N=useRef(void 0);s&&S&&S.clientWidth>0&&(N.current=S.clientWidth);let Ne=N.current,y=(r,n)=>{Ie(n),Ce?.(r);},Ae=r=>{if(p)return;let n=!s;y(n,n?r.currentTarget:null);},A=()=>{s&&y(false,null);},He=r=>{r.key==="Escape"&&A();},Me=(r,n)=>{let a=n?r:null;P===void 0&&ke(a),Le?.(a);},Be=r=>{r.disabled||(be?.(r),y(false,null));},H=u?.(h)??h?.label??null,M=m$1,B=!!o;return jsx(ze,{onClickAway:A,children:jsxs(te,{ref:Ee,id:e,"data-testid":"GroupedSelect",className:nc(t.root,ve),sx:we,open:s,disabled:p,tabIndex:p?-1:0,role:"combobox","aria-expanded":s,"aria-haspopup":"listbox",onClick:Ae,onKeyDown:He,children:[jsxs(oe,{ref:k,className:nc(t.trigger,B&&t.hasLabel),disabled:p,children:[B&&jsx(re,{$disabled:p,children:o}),jsx(le,{className:t.triggerBody,children:jsx(ne,{$placeholder:H==null,$disabled:p,$valueAlignment:Se,children:H??c??""})}),jsx(ie,{className:t.triggerIcon,$disabled:p,children:me?jsx(ba,{}):M?jsx(M,{className:nc(s&&"MuiSelect-iconOpen")}):jsx(_,{open:s})})]}),jsx(R,{open:s,anchorEl:S,placement:"bottom-start",className:t.menu,sx:mc({width:Ne??S?.clientWidth,marginTop:"4px"},Te),children:jsx(ae,{className:t.groups,onClick:r=>r.stopPropagation(),onMouseDown:r=>r.stopPropagation(),children:(xe??[]).map((r,n)=>jsx(de,{className:t.group,expanded:Fe===n,onChange:a=>Me(n,a),slotProps:{root:{square:true}},label:ye?.(r.group,n)??jsx(se,{variant:"caption",className:t.groupLabel,children:r.group}),content:(r?.options||[]).map((a,We)=>{let Oe=fe(a,h);return jsxs(pe,{className:t.option,startAdornment:null,isDisabled:a.disabled,onClick:()=>Be(a),children:[he?.(a)??a.label,Oe&&jsx(d,{src:Sc,alt:"selected",sx:{width:14,height:10},className:t.optionCheck})]},`${n}-${We}`)})},`${n}`))})})]})})});ge.displayName="GroupedSelect";var Ke=memo(ge);export{t as a,Ke as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {nc}from'./chunk-
|
|
1
|
+
import {nc}from'./chunk-EP5VELEJ.js';import {forwardRef,useCallback,memo}from'react';import {styled,Box,Typography,alpha}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var g="rgba(255, 0, 0, 1)",b={default:34,compact:24},x=2,r="os-shared-Timeline",o={root:`${r}-root`,item:`${r}-item`,indicator:`${r}-indicator`,dot:`${r}-dot`,connector:`${r}-connector`,content:`${r}-content`,title:`${r}-title`,subtitle:`${r}-subtitle`,endAdornment:`${r}-endAdornment`};var J={small:8,medium:12,large:16},I={default:12.648,compact:8},R={default:24,compact:16},w=styled(Box,{shouldForwardProp:e=>e!=="$orientation"})(({$orientation:e="vertical"})=>({display:"flex",flexDirection:e==="horizontal"?"row":"column",cursor:"default",width:"100%",textAlign:"start"})),P=styled(Box,{shouldForwardProp:e=>!["$orientation","$flip","$clickable"].includes(e)})(({$orientation:e="vertical",$flip:i=false,$clickable:t=false})=>({display:"flex",position:"relative",...e==="vertical"?{flexDirection:i?"row-reverse":"row",alignItems:"flex-start",width:"100%"}:{flexDirection:"column",flex:1,minWidth:0,paddingInlineEnd:12,"&:last-child":{flex:"0 1 auto",paddingInlineEnd:0}},cursor:t?"pointer":"default"})),L=styled(Box,{shouldForwardProp:e=>!["$orientation","$flip","$compact"].includes(e)})(({$orientation:e="vertical",$flip:i=false,$compact:t=false})=>({display:"flex",...e==="vertical"?{flexDirection:"column",position:"relative",alignItems:"center",alignSelf:"flex-start",flexShrink:0,gap:4,paddingBlock:4,...i?{marginInlineStart:t?I.compact:I.default}:{marginInlineEnd:t?I.compact:I.default}}:{flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:4,marginBottom:8}})),D=styled(Box,{shouldForwardProp:e=>e!=="colorVariant"&&e!=="dotSize"})(({theme:e,colorVariant:i="completed",dotSize:t="medium"})=>{let c=J[t],f=e.palette.info.dark,$=t==="small"?1.5:t==="large"?2.5:2,E=i==="error"?{backgroundColor:g}:i==="upcoming"?{backgroundColor:e.palette.grey[100]}:i==="current"?{backgroundColor:e.palette.common.white,border:`${$}px solid ${f}`,boxSizing:"border-box"}:{backgroundColor:f};return {width:c,height:c,borderRadius:"50%",flexShrink:0,...E}}),v=styled(Box,{shouldForwardProp:e=>!["isNextPending","connectorOrientation","$compact"].includes(e)})(({theme:e,isNextPending:i=false,connectorOrientation:t="vertical",$compact:c=false})=>({flexShrink:0,borderRadius:2,backgroundColor:i?e.palette.grey[100]:e.palette.info.dark,...t==="vertical"?{width:x,height:c?b.compact:b.default}:{height:x,flex:1,minWidth:4}})),A=styled(Box,{shouldForwardProp:e=>!["$flip","$compact","$isLast"].includes(e)})(({$flip:e=false,$compact:i=false,$isLast:t=false})=>({display:"flex",flexDirection:"column",gap:0,flex:1,...!t&&{paddingBottom:i?R.compact:R.default},...e&&{alignItems:"flex-end",textAlign:"end"}})),H=styled(Typography,{shouldForwardProp:e=>e!=="colorVariant"&&e!=="compactTitle"})(({theme:e,colorVariant:i="completed",compactTitle:t=false})=>({fontSize:t?11:12,fontWeight:700,lineHeight:t?"16px":"18.972px",...i==="error"&&{color:g},...i==="upcoming"&&{color:alpha(e.palette.text.primary,.3)}})),M=styled(Typography,{shouldForwardProp:e=>e!=="compactSubtitle"})(({theme:e,compactSubtitle:i=false})=>({fontSize:i?10:11,fontWeight:500,lineHeight:i?"14px":"14.229px",color:alpha(e.palette.text.primary,.5)})),W=styled(Box,{shouldForwardProp:e=>e!=="$clickable"})(({$clickable:e=false})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,alignSelf:"flex-start",marginInlineStart:"auto",lineHeight:0,...!e&&{cursor:"default",'& [data-testid="ChipCopyButton"]':{cursor:"pointer"}}}));function F(e,i){let t=e.id??`${e.title}-${e.subtitle??""}`;return `${i}-${t}`}function y(e,i,t){return e.status?e.status:t===void 0||i<t?"completed":i===t?"current":"upcoming"}var z=forwardRef(({items:e,activeIndex:i,orientation:t="vertical",variant:c="default",alignment:f="start",size:$="medium",hasConnector:E=true,onItemClick:T,className:B,sx:V},G)=>{let N=e,u=c==="compact",p=!!T,K=useCallback((n,l)=>s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),T?.(n,l));},[T]);return jsx(w,{ref:G,className:nc(o.root,B),sx:V,"data-testid":"Timeline",role:"list",$orientation:t,children:N.map((n,l)=>{let s=l===N.length-1,C=y(n,l,i),j=s?"completed":y(N[l+1],l+1,i),h=f==="alternate"&&t==="vertical"&&l%2===1;return jsxs(P,{className:o.item,$orientation:t,$flip:h,$clickable:p,role:p?"button":"listitem","aria-current":C==="current"?"step":void 0,tabIndex:p?0:void 0,onClick:p?()=>T?.(n,l):void 0,onKeyDown:p?K(n,l):void 0,children:[jsxs(L,{className:o.indicator,$orientation:t,$flip:h,$compact:u,children:[n.icon??jsx(D,{className:o.dot,colorVariant:C,dotSize:$}),!s&&E&&jsx(v,{className:o.connector,isNextPending:j==="upcoming",connectorOrientation:t,$compact:u})]}),jsxs(A,{className:o.content,$flip:h,$compact:u,$isLast:s,children:[jsx(H,{className:o.title,colorVariant:C,compactTitle:u,children:n.title}),n.subtitle&&jsx(M,{className:o.subtitle,compactSubtitle:u,children:n.subtitle})]}),n.endAdornment&&jsx(W,{className:o.endAdornment,$clickable:p,onClick:q=>q.stopPropagation(),children:n.endAdornment})]},F(n,l))})})});z.displayName="Timeline";var Y=memo(z);export{g as a,b,x as c,o as d,Y as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-4NLQZJVN.js';import {nc}from'./chunk-EP5VELEJ.js';import {forwardRef,memo}from'react';import {jsxs,jsx}from'react/jsx-runtime';import S from'@mui/material/Box';import {styled}from'@mui/material/styles';var l="os-shared-Alert",r={root:`${l}-root`,icon:`${l}-icon`,message:`${l}-message`},p={error:e=>({color:e.v2.palette.error[500],background:e.v2.palette.status.danger.subtle}),warning:e=>({color:e.v2.palette.warning[500],background:e.v2.palette.status.warning.subtle}),success:e=>({color:e.v2.palette.success[700],background:e.v2.palette.status.success.subtle}),info:e=>({color:e.v2.palette.brand[500],background:e.v2.palette.interactive.primary.subtle})};var C=()=>jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M6 12C9.30838 12 12 9.30838 12 6C12 2.69162 9.30838 -2.35309e-07 6 -5.24537e-07C2.69162 -8.13764e-07 8.13764e-07 2.69162 5.24537e-07 6C2.35309e-07 9.30838 2.69162 12 6 12ZM6 11.1C3.17801 11.1 0.9 8.82198 0.9 6C0.9 3.17802 3.17802 0.899999 6 0.899999C8.82199 0.899999 11.1 3.17802 11.1 6C11.1 8.82198 8.82198 11.1 6 11.1ZM6 9C6.15913 9 6.31174 8.93679 6.42426 8.82426C6.53679 8.71174 6.6 8.55913 6.6 8.4C6.6 8.24087 6.53679 8.08826 6.42426 7.97574C6.31174 7.86321 6.15913 7.8 6 7.8C5.84087 7.8 5.68826 7.86321 5.57574 7.97574C5.46321 8.08826 5.4 8.24087 5.4 8.4C5.4 8.55913 5.46321 8.71174 5.57574 8.82426C5.68826 8.93679 5.84087 9 6 9ZM6.00703 6.90644C6.12628 6.90458 6.23991 6.85546 6.32296 6.76988C6.40602 6.6843 6.45171 6.56925 6.45 6.45L6.45 3.15C6.45084 3.09037 6.43983 3.03116 6.41759 2.97583C6.39535 2.92049 6.36234 2.87013 6.32047 2.82766C6.2786 2.7852 6.22871 2.75148 6.17369 2.72846C6.11868 2.70544 6.05964 2.69359 6 2.69359C5.94036 2.69359 5.88132 2.70544 5.82631 2.72846C5.77129 2.75148 5.7214 2.7852 5.67953 2.82766C5.63766 2.87013 5.60465 2.92049 5.58241 2.97583C5.56017 3.03116 5.54916 3.09037 5.55 3.15L5.55 6.45C5.54914 6.51023 5.56037 6.57002 5.58304 6.62583C5.60571 6.68163 5.63935 6.73232 5.68197 6.77489C5.72459 6.81745 5.77533 6.85103 5.83116 6.87363C5.887 6.89623 5.9468 6.90739 6.00703 6.90644Z",fill:"currentColor"})}),d=()=>jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M9.63285 0.429835C9.54018 0.432536 9.45219 0.471196 9.38752 0.537631L3.21672 6.70844L0.614302 4.10602C0.581421 4.07177 0.542037 4.04443 0.498457 4.0256C0.454877 4.00676 0.407977 3.99681 0.360503 3.99633C0.313029 3.99585 0.265937 4.00484 0.221983 4.02279C0.178029 4.04073 0.138097 4.06727 0.104526 4.10084C0.0709555 4.13441 0.0444206 4.17434 0.0264755 4.21829C0.00853037 4.26225 -0.000464234 4.30934 1.8446e-05 4.35681C0.000501126 4.40429 0.0104514 4.45119 0.0292865 4.49477C0.0481216 4.53835 0.0754629 4.57773 0.109709 4.61061L2.96442 7.46533C3.03134 7.53222 3.12209 7.5698 3.21672 7.5698C3.31134 7.5698 3.40209 7.53222 3.46901 7.46533L9.89212 1.04222C9.9436 0.992086 9.97874 0.927576 9.99295 0.857134C10.0072 0.786693 9.99978 0.713603 9.97176 0.647428C9.94374 0.581254 9.8964 0.525079 9.83593 0.486255C9.77546 0.447431 9.70468 0.427767 9.63285 0.429835Z",fill:"currentColor"})}),m=()=>jsx("svg",{width:"12",height:"11",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M6 7.5V5.5M6 3.5H6.005M11 5.5C11 8.26142 8.76142 10.5 6 10.5C3.23858 10.5 1 8.26142 1 5.5C1 2.73858 3.23858 0.5 6 0.5C8.76142 0.5 11 2.73858 11 5.5Z",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",strokeLinejoin:"round"})});var g=styled(S,{shouldForwardProp:e=>e!=="$severity"})(({theme:e,$severity:s})=>({...p[s](e),display:"flex",alignItems:"center",gap:e.v2.spacing(4),minHeight:e.v2.spacing(32),padding:e.v2.spacing(8),borderRadius:e.v2.radius(4)})),f=styled("span")({width:12,height:12,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& svg":{width:12,height:12,display:"block"}}),u=styled(j)({color:"inherit",wordBreak:"break-word"});function k(e){switch(e){case "success":return jsx(d,{});case "info":return jsx(m,{});case "error":case "warning":return jsx(C,{})}}var y=forwardRef(({severity:e="error",message:s,icon:v,className:h,sx:w,id:i,...A},x)=>jsxs(g,{ref:x,...A,$severity:e,className:nc(r.root,h),sx:w,id:i,"data-testid":i??"Alert",children:[jsx(f,{className:r.icon,children:v??k(e)}),jsx(u,{component:"p",textVariant:"body.xsmall.regular",className:r.message,children:s})]}));y.displayName="Alert";var M=memo(y);
|
|
2
2
|
export{r as a,M as b};
|