@tap-payments/os-micro-frontend-shared 0.3.219-test.2-test.4 → 0.3.220
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-MOCDGJR4.js → chunk-2OTSLKKQ.js} +1 -1
- package/build/_chunks/{chunk-KU2GYOVJ.js → chunk-3QLFEKLL.js} +1 -1
- package/build/_chunks/{chunk-2ZC24DCN.js → chunk-4DDBUSCP.js} +1 -1
- package/build/_chunks/{chunk-2ZTDZMQV.js → chunk-4QYIGMQJ.js} +1 -1
- package/build/_chunks/{chunk-UBHPOQSK.js → chunk-4VFYFG3T.js} +1 -1
- package/build/_chunks/chunk-5AWXBQ34.js +1 -0
- package/build/_chunks/{chunk-VJPODV3I.js → chunk-5DVGPGJM.js} +1 -1
- package/build/_chunks/{chunk-GYFZ73GR.js → chunk-5NOCNTU2.js} +1 -1
- package/build/_chunks/{chunk-STSV7NAV.js → chunk-5R6QHRGT.js} +1 -1
- package/build/_chunks/{chunk-CPXC2HIM.js → chunk-5SZCA7UT.js} +1 -1
- package/build/_chunks/{chunk-RXZVFV7R.js → chunk-6F3F5KWC.js} +1 -1
- package/build/_chunks/{chunk-DF7YGDHF.js → chunk-6JTFF3VW.js} +1 -1
- package/build/_chunks/chunk-7HAWTKHS.js +1 -0
- package/build/_chunks/{chunk-TGWIC62V.js → chunk-A422CNWA.js} +1 -1
- package/build/_chunks/{chunk-HCO33BCV.js → chunk-ALEWQKNK.js} +1 -1
- package/build/_chunks/{chunk-DTQFVATX.js → chunk-ARRLK626.js} +1 -1
- package/build/_chunks/{chunk-XIUJHYEE.js → chunk-B7FSN6KR.js} +1 -1
- package/build/_chunks/{chunk-OHP3DSFR.js → chunk-BFNBCZIC.js} +1 -1
- package/build/_chunks/{chunk-SFJXGJ6O.js → chunk-C746JR2U.js} +1 -1
- package/build/_chunks/chunk-CHR75VEJ.js +1 -0
- package/build/_chunks/{chunk-DNVGTZES.js → chunk-DAYM6H2G.js} +2 -2
- package/build/_chunks/{chunk-3F5ATMQB.js → chunk-DYMRORFM.js} +1 -1
- package/build/_chunks/{chunk-45YGTVZP.js → chunk-EKVX2K2J.js} +1 -1
- package/build/_chunks/{chunk-NE7LDEJD.js → chunk-EU7CMG3N.js} +1 -1
- package/build/_chunks/{chunk-B5EVH3FW.js → chunk-FCPQ7FTN.js} +1 -1
- package/build/_chunks/{chunk-BBR3H3KM.js → chunk-FUHQHDFU.js} +1 -1
- package/build/_chunks/{chunk-32FV6NCN.js → chunk-FWVZQRRW.js} +1 -1
- package/build/_chunks/{chunk-MOFWTHBX.js → chunk-HKH2SAJZ.js} +1 -1
- package/build/_chunks/{chunk-CSKIZJMP.js → chunk-IUQKBIXU.js} +1 -1
- package/build/_chunks/{chunk-GHCK3XPZ.js → chunk-IVDDMAXY.js} +1 -1
- package/build/_chunks/{chunk-FVQ3OAN4.js → chunk-IY2CABAN.js} +1 -1
- package/build/_chunks/{chunk-74FYV7XE.js → chunk-JGAKV56G.js} +1 -1
- package/build/_chunks/{chunk-IARFCKXQ.js → chunk-LK227QND.js} +1 -1
- package/build/_chunks/{chunk-NQ7BU6UU.js → chunk-LORKYJPD.js} +1 -1
- package/build/_chunks/{chunk-YIZ2SJ2R.js → chunk-LVMXAYG4.js} +1 -1
- package/build/_chunks/{chunk-BIY6O5KE.js → chunk-MAI6ZMUP.js} +1 -1
- package/build/_chunks/{chunk-IRYRPNQZ.js → chunk-MIWTFNVW.js} +1 -1
- package/build/_chunks/{chunk-NHNYMEO4.js → chunk-MOX5HIJO.js} +1 -1
- package/build/_chunks/{chunk-IQRA43OV.js → chunk-MQ5E5PIS.js} +1 -1
- package/build/_chunks/{chunk-WUVLXFRD.js → chunk-NE4LXCYK.js} +1 -1
- package/build/_chunks/{chunk-7DF4OCNS.js → chunk-NMENISJ3.js} +1 -1
- package/build/_chunks/{chunk-XX5Q5MBU.js → chunk-O3YBDJOY.js} +1 -1
- package/build/_chunks/chunk-OEI2M73L.js +1 -0
- package/build/_chunks/{chunk-ZL23AW36.js → chunk-OKG77XSE.js} +1 -1
- package/build/_chunks/{chunk-RNECVM7G.js → chunk-OLWGUR2Y.js} +1 -1
- package/build/_chunks/{chunk-2GIBPPKW.js → chunk-PCOJKH4L.js} +1 -1
- package/build/_chunks/{chunk-7LVTTKBG.js → chunk-PMZQWHUD.js} +1 -1
- package/build/_chunks/chunk-PP7J7PKR.js +1 -0
- package/build/_chunks/{chunk-RDK2KF63.js → chunk-PTLDMQUB.js} +1 -1
- package/build/_chunks/{chunk-32QJM33C.js → chunk-PTMPSZ4A.js} +1 -1
- package/build/_chunks/{chunk-DIOBCQQT.js → chunk-PWQC7GH2.js} +1 -1
- package/build/_chunks/{chunk-DILJTXAK.js → chunk-QKHBIWGZ.js} +1 -1
- package/build/_chunks/{chunk-NUN7SFUM.js → chunk-QOBRDOX3.js} +1 -1
- package/build/_chunks/{chunk-LSKSOVDA.js → chunk-R2LHC6Z5.js} +1 -1
- package/build/_chunks/{chunk-5VZHYPFP.js → chunk-RH5G5WEQ.js} +1 -1
- package/build/_chunks/{chunk-SRYFBQ3L.js → chunk-RPSV65AM.js} +1 -1
- package/build/_chunks/{chunk-DSKS3MZK.js → chunk-RWAHMAFU.js} +1 -1
- package/build/_chunks/{chunk-SIPE5HWZ.js → chunk-RZQR6OKW.js} +1 -1
- package/build/_chunks/{chunk-S7DGEHY2.js → chunk-SDNCK73U.js} +1 -1
- package/build/_chunks/chunk-SPVVVTD2.js +2 -0
- package/build/_chunks/{chunk-4KBICMEZ.js → chunk-TFM77CT6.js} +1 -1
- package/build/_chunks/{chunk-KNCLMG4I.js → chunk-UR23DZC6.js} +1 -1
- package/build/_chunks/{chunk-CYONSJOA.js → chunk-UWRIO72X.js} +1 -1
- package/build/_chunks/{chunk-VWFJNIS6.js → chunk-V62DA4NC.js} +1 -1
- package/build/_chunks/chunk-X5ABQMQQ.js +15 -0
- package/build/_chunks/chunk-XB7FBOZY.js +1 -0
- package/build/_chunks/{chunk-EBY66HDS.js → chunk-XGQF6ZKW.js} +1 -1
- package/build/_chunks/{chunk-YRQ3E36X.js → chunk-XJRUEHRU.js} +1 -1
- package/build/_chunks/{chunk-JK3V4FT5.js → chunk-Y4MBLN4R.js} +1 -1
- package/build/_chunks/{chunk-K223QU64.js → chunk-ZKXJ2YUK.js} +1 -1
- package/build/_chunks/{chunk-OFUQV2S7.js → chunk-ZVC3PXJB.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AnimatedSpinnerIcon/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/ChipStack/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/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/CustomBackdrop/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/DisplayAmount/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/Error/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUpload/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlippingCard/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/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/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/OpenFileInNewTab/index.js +1 -1
- package/build/components/PaymentSourceFilter/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/RFH/index.js +1 -1
- package/build/components/RHFInput/index.js +1 -1
- package/build/components/RHFPhoneInput/index.js +1 -1
- package/build/components/RHFSwitch/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RangeCalender/type.d.ts +1 -17
- package/build/components/RangeCalender/utils.d.ts +0 -7
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/SelectDropdown/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/CustomCells/DateCell/DateCell.d.ts +0 -4
- package/build/components/TableCells/CustomCells/DateCell/DateViewer.d.ts +1 -5
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/index.d.ts +0 -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/ToggleView/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/constants/currency.d.ts +0 -1
- package/build/constants/timezones.d.ts +0 -12
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/types/appConfig.d.ts +0 -4
- package/build/types/day.d.ts +0 -2
- package/build/utils/date.d.ts +16 -33
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.js +1 -1
- package/build/utils/localStorage.d.ts +0 -2
- package/build/utils/timezone.d.ts +0 -7
- package/package.json +2 -6
- package/build/_chunks/chunk-2WFSLZCA.js +0 -1
- package/build/_chunks/chunk-7JTOHX7G.js +0 -1
- package/build/_chunks/chunk-7Y422WAK.js +0 -1
- package/build/_chunks/chunk-AB3JAJHF.js +0 -15
- package/build/_chunks/chunk-BN5OZACX.js +0 -1
- package/build/_chunks/chunk-EHHY7NAU.js +0 -1
- package/build/_chunks/chunk-FCQZSF6C.js +0 -1
- package/build/_chunks/chunk-TVHMB3N3.js +0 -2
- package/build/_chunks/chunk-YJ3DWX64.js +0 -1
- package/build/components/TableCells/CustomCells/ZonedDateCell/ZonedDateCell.d.ts +0 -28
- package/build/components/TableCells/CustomCells/ZonedDateCell/index.d.ts +0 -2
- package/build/datetime/index.d.ts +0 -8
- package/build/datetime/index.js +0 -1
- package/build/datetime/instant.d.ts +0 -63
- package/build/datetime/zone.d.ts +0 -32
- package/build/utils/reactKeys.d.ts +0 -12
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-32FV6NCN.js';import {a}from'./chunk-45YGTVZP.js';import {j,a as a$3}from'./chunk-32QJM33C.js';import {a as a$1}from'./chunk-XIUJHYEE.js';import {R,x,h as h$1}from'./chunk-DNVGTZES.js';import {g,d,h,c,e,f}from'./chunk-2WFSLZCA.js';import {zc,o}from'./chunk-MOCDGJR4.js';import {Uc,Vc,Uj,Vj,Wj,dc,ec,Xj,cc}from'./chunk-M5HS3EYQ.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import v from'@mui/material/Box';import Tt from'@mui/material/Popper';import Wt from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Xo from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import Ce from'@mui/material/Button';import X from'react-date-object';import at from'react-date-object/calendars/arabic';import pt from'react-date-object/calendars/gregorian';import dt from'react-date-object/locales/arabic_ar';import st from'react-date-object/locales/arabic_en';import lt from'react-date-object/locales/gregorian_ar';import mt from'react-date-object/locales/gregorian_en';var qe=styled(v)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Je=styled(v,{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]}})),Xe=styled(v)(({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"})),Ve=styled(v)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var oo={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function et({sx:e,groupBy:o,isCalenderOpen:a,onUpdate:t}){let[n,p]=useState(null),l=!!n&&a,{t:m}=useTranslation(),c=()=>{p(null);},f=d=>{p(d.currentTarget);},s=d=>{t?.(d),c();};return jsx(Xo,{onClickAway:c,children:jsxs(v,{sx:e,children:[jsx(qe,{children:m("groupedBy")}),jsxs(Je,{onClick:f,open:l,children:[jsx("span",{children:oo[o]}),jsx(v,{component:"img",src:Vc,alt:"arrow",sx:{...l&&{transform:"rotate(180deg)"}}})]}),jsx(R,{open:l,anchorEl:n,children:jsx(Xe,{sx:{width:n?.clientWidth},children:Object.entries(oo).map(([d,i])=>jsx(Ve,{onClick:()=>{s(d);},className:o===d?"active":"",children:i},`${d}-groupedBy`))})})]})})}var ro=memo(et);var no=ro;var io=styled(v)(({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 fe({isHijri:e,onCalendarModeSwitch:o}){let{t:a}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(v,{children:jsxs(io,{children:[jsxs(v,{children:[jsx("img",{src:cc,alt:"hijri"}),jsx("span",{children:a("hijri")})]}),jsx(h$1,{checked:e,onChange:t})]})})}var so=fe;var mo=styled(Ce)(({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}})),co=styled(v)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var V=({isHijri:e,isAr:o=false})=>e?o?dt:st:o?lt:mt,ee=e=>e?at:pt,B=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),E=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),oe=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,a]=o();return [new X(o$1),new X(a)]}return [new X(e?.[0]),new X(e?.[1])]};function ge({onChange:e,isHijri:o,isAr:a=false}){let t={locale:V({isHijri:o,isAr:a}),calendar:ee(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,a]),{t:p}=useTranslation();return jsx(v,{"data-testid":"RangeCalender_QuickFilters",children:jsx(co,{children:n.map(l=>jsx(mo,{onClick:m=>{m.preventDefault(),e(l.value);},children:p(l.id)},l.id))})})}var fo=ge;var uo=styled(Ce)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var yt=["Su","Mo","Tu","We","Th","Fr","Sa"];function wt({isAr:e=false,isHijri:o,values:a,onChange:t,numberOfMonths:n=2,...p},l){let m=c=>c==="right"?e?dc:ec:e?ec:dc;return jsx(Calendar,{ref:l,numberOfMonths:n,value:a,onChange:t,calendar:ee(o),locale:V({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,f)=>jsx(uo,{onClick:f,children:jsx("img",{src:m(c),alt:"arrow"})}),weekDays:e?void 0:yt,maxDate:new Date,...p})}var go=forwardRef(wt);var xo=go;var bo=styled(v)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),te=styled(v)(({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"})),ho=styled(v,{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"}})),A=styled(v)(({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"}})),F=styled(v)(()=>({width:12,height:12})),W=styled(v)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function he({selectedTimezone:e,onChange:o,timezoneCountriesCodes:a$1,defaultCountryTimezone:t}){let[n,p]=useState(null),l=i=>{n||p(i.currentTarget);},m=()=>{n&&p(null);},c=(i,y)=>{i.stopPropagation(),o(y);},f=useMemo(()=>a$1?.flatMap(i=>{let y=d(i);return y?[h(y)]:[]}),[a$1]),s=useMemo(()=>f?.some(i=>e?.timezone===i?.timezone),[f,e]),d$1=useMemo(()=>e&&s?e:t,[e,t,s]);return jsxs(A,{onMouseEnter:l,onMouseLeave:m,onClick:()=>{e&&o(d$1);},children:[s?jsx("img",{src:Xj,alt:"icon"}):jsx(F,{}),jsx("img",{src:Vj,alt:"entity-timezone"}),jsx(a,{countryCode:d$1?.countryCode}),jsx(W,{className:s?"selected":"",children:g((s&&e?e:t).timezone)}),jsx(Tt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(te,{sx:{maxHeight:300},children:f?.map((i,y)=>{let Y=i?.timezone===e?.timezone;return jsxs(A,{onClick:ie=>{c(ie,i);},sx:{gap:"4px"},children:[Y?jsx("img",{src:Xj,alt:"icon"}):jsx(F,{}),jsx(a,{countryCode:i?.countryCode}),jsx(W,{className:Y?"selected":"",children:g(i.timezone)})]},`timezone-item-${y}`)})})})]})}function ye({onChange:e$1,selectedTimezone:o,browserTimezone:a$1}){let t=useMemo(()=>c(a$1??e()??""),[a$1]),n=useMemo(()=>t?h(t):void 0,[t]),p=()=>{n&&e$1(n);},l=n?.timezone===o?.timezone;return jsxs(A,{onClick:p,children:[l?jsx("img",{src:Xj,alt:"icon"}):jsx(F,{}),jsx("img",{src:Uj,alt:"user-timezone"}),jsx(a,{countryCode:n?.countryCode}),jsx(W,{className:l?"selected":"",children:n&&g(n.timezone)})]})}function Bt({onChange:e,selectedTimezone:o,browserTimezone:a$1,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,l]=useState(null),m=!!p,c=()=>{l(null);},f=i=>{e(i),c();},s=i=>{l(i.currentTarget);},d=useMemo(()=>a$1===o?.timezone?Uj:o?.timezone===t.timezone?Vj:Wj,[a$1,t.timezone,o?.timezone]);return jsx(Xo,{onClickAway:c,children:jsxs(bo,{"data-testid":"CustomTimezone",children:[jsxs(ho,{open:m,onClick:s,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a,{countryCode:o?.countryCode}),jsx("span",{children:o&&g(o.timezone)})]}),jsx(Tt,{open:m,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(te,{"data-testid":"CustomTimezone_dropdown",children:[jsx(he,{onChange:f,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(ye,{onChange:f,selectedTimezone:o,browserTimezone:a$1})]})})]})})}var Co=memo(Bt);var To=Co;var ko=styled(v,{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"}})),zo=styled(Ce)(({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}})),So=styled(Ce)(({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}})),Do=styled(v)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),vo=styled(Ce,{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]}})),Mo=styled(v)(({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"})),Bo=styled(v)(({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"})),Eo=styled(v)(()=>({display:"flex",alignItems:"center",gap:"10px"})),Oo=styled(v)(()=>({position:"relative"})),Ro=styled(v)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Io=styled(v,{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}}})),Po=styled(v)(()=>({width:235})),Lo=styled(v)(({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(${Uc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Ao=styled(v)(({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 Rt({values:e,setValues:o}){let{t:a}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,l]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),m=({period:s,hour:d})=>s==="PM"&&d!==12?d+12:s==="AM"&&d===12?0:d,c=({hour:s,minute:d,period:i})=>{o([t.setHour(m({hour:s,period:i})).setMinute(d).setSecond(0),n]);},f=({hour:s,minute:d,period:i})=>{o([t,n.setHour(m({hour:s,period:i})).setMinute(d).setSecond(59)]);};return jsx(Po,{children:jsxs(Ao,{children:[jsxs(Io,{isAllDay:p,children:[jsx("span",{className:"label",children:a("allDay")}),jsx(h$1,{checked:p,onChange:s=>{l(!p),s.target.checked?o([B(e[0]),E(e[1])]):o(e);}})]}),!p&&jsxs(Lo,{children:[jsx(j,{defaultTime:{hour:a$3(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$3(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:f,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Wo=Rt;var Ho=Wo;function jt({defaultDate:e,onDateChange:o,mode:a="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:l,maxDateRange:m,onCalendarGroupChange:c,groupBy:f$1,timezone:s,onChangeTimezone:d,browserTimezone:i,renderCalendarButton:y,mainSx:Y,popperProps:ie,rangeDatePickerProps:$o,defaultCountryTimezone:ze,timezoneCountriesCodes:Se}){let[C,De]=useState(oe(e)),[x$1,T]=useState(C),[$,ve]=useState(s??null),[Me,Go]=useState(f$1||"day"),[Be,Ee]=useState(null),w=!!Be,[Oe,Re]=useState(false),{t:ae}=useTranslation(),P=useRef(null),Qo=zc(useId(),"range-calender"),pe=a==="hijri",G=()=>{Ee(null);},Ie=r=>{Ee(r.currentTarget);};useEffect(()=>{if(!w){if(n===1)return;T(oe(e));}},[w]),useEffect(()=>{if(e){let r=oe(e);De(r),T(r),P.current&&P.current.set("date",r[0]);}},[e]),useEffect(()=>{ve(s??null);},[s,w]);let Pe=()=>{De(x$1),G();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[B(x$1[0]),E(x$1[1])],o([r[0].toDate(),r[1].toDate()],$?f($):void 0),c?.(Me||"day"),d?.($);},Uo=useCallback(()=>{let r=C[0].format("MMM D"),Q=C[1]?C[1].format("MMM D"):C[0].format("MMM D");return r===Q&&!p?r:`${r} - ${Q}`},[C,p]),No=r=>{if(r.length<2||!m){T(r);return}let Q=B(r[0]).toDate(),_o=E(r[1]).toDate(),Le=Wt(_o).diff(Q,"day");if(Le<=m){T(r);return}Re(true),T([r[0],r[1].subtract(Le-m,"d")]),setTimeout(()=>{Re(false);},3e3);},Zo=r=>{T([B(r[0]),E(r[1])]),P.current&&P.current.set("date",r[0]);},Ko=r=>{r.key==="Enter"&&x$1[1]&&!Oe?(r.stopPropagation(),Pe()):r.key==="Escape"&&(r.stopPropagation(),G());};return jsxs(Oo,{id:Qo,"data-testid":"RangeCalender",sx:Y,children:[y?y(w,Ie):jsx(vo,{onClick:Ie,open:w,children:(C[0]||C[1])&&Uo()}),w&&jsx(a$1,{onClick:r=>{r.stopPropagation(),G();}}),jsx(Tt,{open:w,anchorEl:Be,placement:"bottom-end",...ie,children:jsxs(ko,{onKeyDown:Ko,$isSingleMonth:n===1,children:[!l&&jsxs(Bo,{children:[jsx(fo,{onChange:Zo,isHijri:pe}),jsxs(Ro,{children:[f$1&&jsx(no,{groupBy:Me,isCalenderOpen:w,onUpdate:r=>{Go(r);}}),jsx(so,{isHijri:pe,onCalendarModeSwitch:t})]})]}),jsxs(v,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(xo,{values:x$1,onChange:No,isHijri:pe,ref:P,numberOfMonths:n,...$o}),jsx(x,{in:Oe&&!!m,children:jsx(a$2,{error:ae("dateRangeError",{number:m}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(Mo,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&ze&&i&&Se&&jsx(Eo,{children:jsx(To,{onChange:ve,selectedTimezone:$,browserTimezone:i,defaultCountryTimezone:ze,timezoneCountriesCodes:Se},String(w))}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Ho,{values:x$1,setValues:T}),jsxs(Do,{children:[jsx(zo,{variant:"contained",onClick:G,children:ae("cancel")}),jsx(So,{variant:"contained",onClick:Pe,disabled:!x$1[1],children:ae("okay")})]})]})]})]})})]})}var Yo=jt;var ki=Yo;export{ki as a};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { TableCellProps } from '@mui/material';
|
|
3
|
-
import { type Instant, type ZoneId } from '../../../../datetime/index.js';
|
|
4
|
-
import type { CalendarFormats } from '../../../../utils/index.js';
|
|
5
|
-
import type { TableMode } from '../../../../types/index.js';
|
|
6
|
-
export interface ZonedDateCellProps extends TableCellProps {
|
|
7
|
-
/** The instant exactly as the backend sent it — epoch ms, or an ISO string with an offset. */
|
|
8
|
-
value: Instant;
|
|
9
|
-
/**
|
|
10
|
-
* The zone the backend serialised `value` in — `'UTC'` when it is true UTC. Required
|
|
11
|
-
* on purpose: a silent `?? 'UTC'` default is how a zone-less wall clock gets rendered
|
|
12
|
-
* as if it were UTC. This prop records a backend defect; the endpoint should emit offsets.
|
|
13
|
-
*/
|
|
14
|
-
source: ZoneId;
|
|
15
|
-
/** The zone to display in. */
|
|
16
|
-
zone: ZoneId;
|
|
17
|
-
/** A second zone for the tooltip icon. Shown only when it differs from `zone`. */
|
|
18
|
-
tooltipZone?: ZoneId;
|
|
19
|
-
format?: CalendarFormats;
|
|
20
|
-
flagIcon?: string;
|
|
21
|
-
hasFlag?: boolean;
|
|
22
|
-
tableMode?: TableMode;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* States zones instead of offsets. A layout adapter, not a logic owner: the MFE names
|
|
26
|
-
* *which* zones, `@datetime` decides *how*, this only renders.
|
|
27
|
-
*/
|
|
28
|
-
export default function ZonedDateCell({ value, source, zone, tooltipZone, format, ...props }: ZonedDateCellProps): import("react").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The module's public surface, and nothing else: `./zone` owns zone identity,
|
|
3
|
-
* `./instant` owns offsets and the instant ↔ wall-clock conversion.
|
|
4
|
-
*/
|
|
5
|
-
export { formatInZone, lastNDays, offsetLabelAt, offsetMinutesAt, toInstant, toInstantRange, toLegacyTimezone, toWallClock, zoneLabelOf, } from './instant';
|
|
6
|
-
export type { DateInput, Instant, InstantRange } from './instant';
|
|
7
|
-
export { PRIMARY_ZONE_BY_COUNTRY, isZoneId, localZone, zoneByCountry, zoneById, zoneIdOf } from './zone';
|
|
8
|
-
export type { Zone, ZoneId } from './zone';
|
package/build/datetime/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as PRIMARY_ZONE_BY_COUNTRY,n as formatInZone,b as isZoneId,o as lastNDays,e as localZone,j as offsetLabelAt,i as offsetMinutesAt,k as toInstant,m as toInstantRange,h as toLegacyTimezone,l as toWallClock,d as zoneByCountry,c as zoneById,f as zoneIdOf,g as zoneLabelOf}from'../_chunks/chunk-2WFSLZCA.js';
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { CalendarFormats, Timezone } from '../types/index.js';
|
|
2
|
-
import type { Zone, ZoneId } from './zone';
|
|
3
|
-
/**
|
|
4
|
-
* An absolute moment: epoch ms, a `Date`, or a string with an explicit offset.
|
|
5
|
-
* A zone-less string like `'2026-07-04 15:00'` is a wall clock, not an `Instant`.
|
|
6
|
-
*/
|
|
7
|
-
export type Instant = Date | number | string;
|
|
8
|
-
/** Everything the conversion helpers accept, including the "no value" cases. */
|
|
9
|
-
export type DateInput = Instant | null | undefined;
|
|
10
|
-
/** The wire shape of a date filter. Either end may be absent, never `NaN`. */
|
|
11
|
-
export interface InstantRange {
|
|
12
|
-
from?: number;
|
|
13
|
-
to?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The picker's label — `'Egypt (UTC+03:00)'` — with the offset resolved at `at`.
|
|
17
|
-
* Resolving it here, and not when the zone was built, is the Egypt fix.
|
|
18
|
-
*/
|
|
19
|
-
export declare const zoneLabelOf: (zoneId: ZoneId, at?: Instant) => string;
|
|
20
|
-
/** Migration boundary: for components still typed against the legacy `Timezone`. */
|
|
21
|
-
export declare const toLegacyTimezone: (zone: Zone, at?: Instant) => Timezone;
|
|
22
|
-
/**
|
|
23
|
-
* The zone's offset in **minutes, not hours**, at the instant — `180` for Cairo in
|
|
24
|
-
* July, `120` in January, `330` for Kolkata. `undefined` for an unknown zone, because
|
|
25
|
-
* `0` would claim the zone *is* UTC.
|
|
26
|
-
*
|
|
27
|
-
* The legacy `formatUTCOffset` and `Timezone.offset` are in hours; the two units are
|
|
28
|
-
* not interchangeable.
|
|
29
|
-
*/
|
|
30
|
-
export declare const offsetMinutesAt: (zone: ZoneId, at?: Instant) => number | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* The wire string `'UTC+03:00'` / `'UTC+05:30'` / `'UTC-04:00'`, built from minutes so
|
|
33
|
-
* no zone round-trips through a fractional hour. `''` for an unknown zone.
|
|
34
|
-
*/
|
|
35
|
-
export declare const offsetLabelAt: (zone: ZoneId, at?: Instant) => string;
|
|
36
|
-
/**
|
|
37
|
-
* Places a wall clock in a zone; an epoch or an offset-bearing string is already
|
|
38
|
-
* absolute and passes through. A wall clock occurring twice takes the **earlier**
|
|
39
|
-
* occurrence, one that does not exist shifts **forward** past the gap.
|
|
40
|
-
*/
|
|
41
|
-
export declare const toInstant: (value: DateInput, zone: ZoneId) => Date | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* The zone's wall clock at an instant. The returned `Date`'s **local** fields are that
|
|
44
|
-
* wall clock, so every formatter renders it identically on every machine.
|
|
45
|
-
*/
|
|
46
|
-
export declare const toWallClock: (value: DateInput, zone: ZoneId) => Date | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* A picked range → the wire's `period.date` pair. The upper bound is the **end of the
|
|
49
|
-
* last day**, taken as the next day's start − 1 ms, because a day is not 24 hours.
|
|
50
|
-
* An unreadable bound is omitted, never thrown on.
|
|
51
|
-
*/
|
|
52
|
-
export declare const toInstantRange: (range: readonly DateInput[] | undefined, zone: ZoneId) => InstantRange;
|
|
53
|
-
/**
|
|
54
|
-
* Formats an instant as it reads in a zone — "Today, 3:00pm", "Mar 05, 2:00pm".
|
|
55
|
-
* The value *and* the "now" behind Today/Yesterday are the zone's wall clocks, so
|
|
56
|
-
* the answer is the same on every machine.
|
|
57
|
-
*/
|
|
58
|
-
export declare const formatInZone: (value: DateInput, zone: ZoneId, format?: CalendarFormats) => string;
|
|
59
|
-
/**
|
|
60
|
-
* The last `days` days in a zone, today included, as wall clocks.
|
|
61
|
-
* `undefined` for an unknown zone, so nothing silently falls back to the host's today.
|
|
62
|
-
*/
|
|
63
|
-
export declare const lastNDays: (days: number, zone: ZoneId) => [Date, Date] | undefined;
|
package/build/datetime/zone.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Timezone } from '../types/index.js';
|
|
2
|
-
/** An IANA zone identifier, e.g. `'Africa/Cairo'`. */
|
|
3
|
-
export type ZoneId = string;
|
|
4
|
-
/**
|
|
5
|
-
* A country's zone. Carries **no offset** — an offset is a property of a zone
|
|
6
|
-
* at a moment, not of the zone, so it is always resolved with `offsetMinutesAt`.
|
|
7
|
-
*/
|
|
8
|
-
export interface Zone {
|
|
9
|
-
id: ZoneId;
|
|
10
|
-
/** For the flag. Empty when the zone has no single country. */
|
|
11
|
-
countryCode: string;
|
|
12
|
-
/** For the label. Falls back to the zone id. */
|
|
13
|
-
countryName: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Pins multi-zone countries to their primary commercial zone. The package lists a
|
|
17
|
-
* country's zones alphabetically, so its first entry is meaningless — `'US'` would
|
|
18
|
-
* be `America/Adak`. Knowingly lossy: no record carries an IANA zone, so `country`
|
|
19
|
-
* is the only input available. Countries whose zones share one offset (MY, VN, CN,
|
|
20
|
-
* DE, PS, CY) are absent — the alphabetical pick is already right there.
|
|
21
|
-
*/
|
|
22
|
-
export declare const PRIMARY_ZONE_BY_COUNTRY: Record<string, ZoneId>;
|
|
23
|
-
/** Whether `Intl` recognises `value` as a zone. Never throws. */
|
|
24
|
-
export declare const isZoneId: (value: string) => boolean;
|
|
25
|
-
/** Resolves a zone id, or `undefined` — substituting a default is the bug this replaces. */
|
|
26
|
-
export declare const zoneById: (id: ZoneId) => Zone | undefined;
|
|
27
|
-
/** Resolves a country's zone, or `undefined` when it has none (a typo must not become Riyadh). */
|
|
28
|
-
export declare const zoneByCountry: (countryCode: string) => Zone | undefined;
|
|
29
|
-
/** The browser's own zone, or `undefined` in an environment without `Intl`. */
|
|
30
|
-
export declare const localZone: () => ZoneId | undefined;
|
|
31
|
-
/** Migration boundary: a caller still holding a legacy `Timezone` or `Zone` normalizes once here. */
|
|
32
|
-
export declare const zoneIdOf: (ref: ZoneId | Zone | Timezone) => ZoneId;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type StableKeyGenerator = (rawValue: unknown, index: number) => string;
|
|
2
|
-
/**
|
|
3
|
-
* Creates a React list-key generator with stable value-derived keys.
|
|
4
|
-
*
|
|
5
|
-
* Unique non-empty values produce `${prefix}-${value}`, which survives
|
|
6
|
-
* search filtering and reordering. Empty (`''`) or duplicate values fall
|
|
7
|
-
* back to `${prefix}-idx-${index}-${value}` to guarantee uniqueness.
|
|
8
|
-
*
|
|
9
|
-
* The returned generator tracks seen values in a `Set`, so create one
|
|
10
|
-
* instance per rendered list during render (fresh `Set` each render).
|
|
11
|
-
*/
|
|
12
|
-
export declare function createStableKeyGenerator(prefix: string): StableKeyGenerator;
|