@tap-payments/os-micro-frontend-shared 0.3.289 → 0.3.295
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/README.md +3 -2
- package/build/_chunks/chunk-2I5L7ASP.js +0 -0
- package/build/_chunks/{chunk-72FD3NW2.js → chunk-2MXRHXGS.js} +1 -1
- package/build/_chunks/chunk-2V7P76GA.js +1 -0
- package/build/_chunks/{chunk-7UCD3KUZ.js → chunk-2W2GZUKF.js} +1 -1
- package/build/_chunks/{chunk-2M6UER6N.js → chunk-2WOWP3QA.js} +1 -1
- package/build/_chunks/{chunk-JMPFZOV3.js → chunk-3ANVVXOL.js} +1 -1
- package/build/_chunks/chunk-3LLAL7SZ.js +2 -0
- package/build/_chunks/{chunk-XEYCTDD3.js → chunk-3MRO5CJP.js} +1 -1
- package/build/_chunks/{chunk-XLFVCH5I.js → chunk-45E65P5R.js} +1 -1
- package/build/_chunks/{chunk-LECTWR74.js → chunk-45GQW7K7.js} +1 -1
- package/build/_chunks/{chunk-DN33IHNY.js → chunk-52MTQXHO.js} +1 -1
- package/build/_chunks/{chunk-D52IZHFQ.js → chunk-6X4K2W2E.js} +1 -1
- package/build/_chunks/{chunk-7GJ5PPIY.js → chunk-73SAT4RE.js} +1 -1
- package/build/_chunks/{chunk-MTACYUU3.js → chunk-77K53QY2.js} +1 -1
- package/build/_chunks/chunk-7BA3JMDW.js +2 -0
- package/build/_chunks/{chunk-RTKA6K5L.js → chunk-7CT3QCVP.js} +1 -1
- package/build/_chunks/{chunk-PNRVZNL7.js → chunk-7LWPKOGV.js} +1 -1
- package/build/_chunks/{chunk-W3DEOBBE.js → chunk-7WMSYKS3.js} +1 -1
- package/build/_chunks/{chunk-XHFDGV2F.js → chunk-AJUXDLJF.js} +1 -1
- package/build/_chunks/chunk-AN73YAF5.js +1 -0
- package/build/_chunks/chunk-ANIJPMR3.js +1 -0
- package/build/_chunks/{chunk-ZGY3RIKJ.js → chunk-BAXN7S2I.js} +1 -1
- package/build/_chunks/{chunk-RFA33XQQ.js → chunk-BDW6QQXH.js} +1 -1
- package/build/_chunks/{chunk-CIB4WTBC.js → chunk-BTUNGKV3.js} +1 -1
- package/build/_chunks/chunk-CGGZ367Q.js +1 -0
- package/build/_chunks/chunk-CRSHY7OT.js +1 -0
- package/build/_chunks/{chunk-AE4JYS7U.js → chunk-DD3TYF3Y.js} +1 -1
- package/build/_chunks/{chunk-M64F4XVE.js → chunk-DIW7RMJY.js} +1 -1
- package/build/_chunks/chunk-DJHXUNB6.js +1 -0
- package/build/_chunks/{chunk-MLZ63M2D.js → chunk-DXDJ7ZQI.js} +1 -1
- package/build/_chunks/chunk-E74Q7ILM.js +1 -0
- package/build/_chunks/{chunk-NHAXRGPW.js → chunk-F5H3U3NJ.js} +1 -1
- package/build/_chunks/chunk-FI5H6V55.js +2 -0
- package/build/_chunks/{chunk-AMOFAS7L.js → chunk-H6CKZAJN.js} +1 -1
- package/build/_chunks/chunk-HI2JOLXL.js +1 -0
- package/build/_chunks/{chunk-RK4UGNRY.js → chunk-HWNPJALM.js} +1 -1
- package/build/_chunks/{chunk-L42ISYQY.js → chunk-IEPHBQH7.js} +1 -1
- package/build/_chunks/{chunk-P6WIYEZX.js → chunk-JRQZANGX.js} +1 -1
- package/build/_chunks/{chunk-U5M6TIFS.js → chunk-JZK2QZX3.js} +1 -1
- package/build/_chunks/{chunk-JUEXC7Z2.js → chunk-K67DFHSS.js} +1 -1
- package/build/_chunks/{chunk-TQIWHM5B.js → chunk-L2PULJKK.js} +1 -1
- package/build/_chunks/{chunk-NDRHRXAO.js → chunk-L4KBXHZI.js} +2 -2
- package/build/_chunks/{chunk-HRQGL7NO.js → chunk-LBKOWCCN.js} +1 -1
- package/build/_chunks/chunk-MBZF7BHG.js +1 -0
- package/build/_chunks/chunk-MBZVHLRC.js +1 -0
- package/build/_chunks/{chunk-KFBXVUQ5.js → chunk-MKDL4TYN.js} +1 -1
- package/build/_chunks/{chunk-47BHPSSP.js → chunk-MPIENGJC.js} +1 -1
- package/build/_chunks/{chunk-V5NBU5TE.js → chunk-N5K54WNL.js} +1 -1
- package/build/_chunks/{chunk-OCHPXIEK.js → chunk-NBVOXBIW.js} +1 -1
- package/build/_chunks/{chunk-GVXTYXRO.js → chunk-NIWGDILH.js} +1 -1
- package/build/_chunks/{chunk-TCI6NIBC.js → chunk-OEZIALDT.js} +1 -1
- package/build/_chunks/chunk-OTG5BKW6.js +1 -0
- package/build/_chunks/{chunk-7VUU5WEU.js → chunk-OW3B34TK.js} +1 -1
- package/build/_chunks/{chunk-PUI6B7OY.js → chunk-PF6NDV3G.js} +1 -1
- package/build/_chunks/chunk-PVUGMA6R.js +1 -0
- package/build/_chunks/{chunk-AXJZMO7Q.js → chunk-Q2GI76OF.js} +1 -1
- package/build/_chunks/{chunk-RYHHS7S3.js → chunk-QKUEMUT3.js} +1 -1
- package/build/_chunks/{chunk-6YAUL2OM.js → chunk-TMAA4QIY.js} +1 -1
- package/build/_chunks/{chunk-UGX2ZY27.js → chunk-UBMO65ZL.js} +1 -1
- package/build/_chunks/{chunk-WNQ3ONG2.js → chunk-UKV3UR3X.js} +1 -1
- package/build/_chunks/{chunk-OHN7F4WA.js → chunk-UPUJEOOS.js} +1 -1
- package/build/_chunks/{chunk-HZYY6NMO.js → chunk-VIIDA663.js} +1 -1
- package/build/_chunks/chunk-XXMVSJIM.js +2 -0
- package/build/_chunks/chunk-YWZJZGDA.js +1 -0
- package/build/_chunks/{chunk-HPDPFVUQ.js → chunk-ZLXQBIAQ.js} +1 -1
- package/build/_chunks/chunk-ZQ6WQPET.js +1 -0
- package/build/_chunks/{chunk-DKBPLNEE.js → chunk-ZQFDXQ4J.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/Alert/style.d.ts +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/AvatarStack/style.d.ts +2 -2
- package/build/components/Calender/index.js +1 -1
- package/build/components/Calender/style.d.ts +4 -4
- package/build/components/Card/index.js +1 -1
- package/build/components/Card/style.d.ts +1 -1
- package/build/components/CardList/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColorPicker/style.d.ts +2 -2
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ColumnViews/styles.d.ts +4 -4
- 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/CurrenciesMenu/style.d.ts +2 -2
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmount/style.d.ts +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencyAmountInput/style.d.ts +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DateFilter/style.d.ts +3 -3
- 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/ExpandableChip/style.d.ts +10 -10
- package/build/components/ExportReportButton/index.js +1 -1
- package/build/components/ExportReportButton/style.d.ts +3 -3
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FileDropbox/style.d.ts +2 -2
- 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/FilterDropdown/style.d.ts +3 -3
- package/build/components/Filters/index.js +1 -1
- package/build/components/Filters/style.d.ts +3 -3
- package/build/components/FlipCard/index.js +1 -1
- package/build/components/FlipCard/style.d.ts +2 -2
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/GroupedSelect/style.d.ts +2 -2
- 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/ListHeader/styles.d.ts +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/RadioGroup/style.d.ts +2 -2
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/RatingCount/style.d.ts +2 -2
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchButton/style.d.ts +7 -7
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/SearchInput/style.d.ts +2 -2
- package/build/components/Select/index.js +1 -1
- package/build/components/Select/style.d.ts +2 -2
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/SheetViewChip/type.d.ts +2 -2
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/AgreementIcon/style.d.ts +2 -2
- package/build/components/StatusIcons/AuthIcons/style.d.ts +4 -4
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +2 -2
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +12 -12
- package/build/components/StatusIcons/SourceIcons/style.d.ts +2 -2
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +3 -3
- package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +4 -4
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +4 -4
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +3 -3
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/PayoutReportCell/AnimatedSpinnerIcon/style.d.ts +3 -3
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +3 -3
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +10 -10
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +4 -4
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +2 -2
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +13 -13
- package/build/components/TableCells/CustomCells/style.d.ts +4 -4
- package/build/components/TableCells/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/Timepicker/style.d.ts +2 -2
- 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/WindowServices/style.d.ts +1 -1
- package/build/components/WindowToolbar/index.js +1 -1
- package/build/components/WindowToolbar/style.d.ts +3 -3
- package/build/components/index.js +1 -1
- package/build/components/modules/JSONViewWindow/components/Content/style.d.ts +2 -2
- package/build/components/modules/JSONViewWindow/components/CopiedIndicator/style.d.ts +3 -3
- package/build/components/modules/JSONViewWindow/components/JSONSearchBar/style.d.ts +12 -12
- package/build/components/modules/JSONViewWindow/index.js +1 -1
- package/build/components/modules/JSONViewWindow/style.d.ts +5 -5
- package/build/components/modules/RangeCalender/components/QuickFilters/style.d.ts +1 -1
- package/build/components/modules/RangeCalender/components/RangeDatepicker/style.d.ts +1 -1
- package/build/components/modules/RangeCalender/index.js +1 -1
- package/build/components/modules/RangeCalender/style.d.ts +3 -3
- package/build/components/modules/VirtualTables/components/ColumnFilter/Inputs/style.d.ts +1 -1
- package/build/components/modules/VirtualTables/components/ColumnFilter/style.d.ts +2 -2
- package/build/components/modules/VirtualTables/components/ErrorList/styles.d.ts +1 -1
- package/build/components/modules/VirtualTables/components/NestedMenu/styles.d.ts +1 -1
- package/build/components/modules/VirtualTables/components/TableFooter/style.d.ts +2 -2
- package/build/components/modules/VirtualTables/components/style.d.ts +3 -3
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/modules/WindowShell/index.js +1 -1
- package/build/components/modules/WindowShell/style.d.ts +4 -4
- package/build/components/modules/index.js +1 -1
- package/build/components/primitives/Backdrop/style.d.ts +1 -1
- package/build/components/primitives/Input/style.d.ts +2 -2
- package/build/components/primitives/Slider/style.d.ts +1 -1
- package/build/components/primitives/Textarea/style.d.ts +2 -2
- package/build/components/primitives/index.js +1 -1
- package/build/constants/assets.d.ts +3 -0
- package/build/constants/index.js +1 -1
- package/build/datetime/components/DateRangeCalendar/TimePicker/style.d.ts +2 -2
- package/build/datetime/components/DateRangeCalendar/style.d.ts +5 -5
- package/build/datetime/components/index.js +1 -1
- package/build/datetime/index.js +1 -1
- package/build/datetime/wirePeriod.d.ts +3 -4
- package/build/hooks/core/index.d.ts +25 -0
- package/build/hooks/core/index.js +1 -0
- package/build/hooks/core/useCountMap.d.ts +12 -0
- package/build/hooks/core/useCountdown.d.ts +19 -0
- package/build/hooks/core/useCustomEventListener.d.ts +7 -0
- package/build/hooks/core/useCustomEventPublisher.d.ts +5 -0
- package/build/hooks/core/useDelayedVisibility.d.ts +6 -0
- package/build/hooks/core/useElementSize.d.ts +19 -0
- package/build/hooks/core/useIntersectionObserver.d.ts +14 -0
- package/build/hooks/core/useKeyDown.d.ts +10 -0
- package/build/hooks/core/useNetworkStatus.d.ts +25 -0
- package/build/hooks/core/useScrollShadow.d.ts +13 -0
- package/build/hooks/core/useScrollState.d.ts +32 -0
- package/build/hooks/core/useThemeMode.d.ts +9 -0
- package/build/hooks/core/useToastController.d.ts +40 -0
- package/build/hooks/core/useViewportSize.d.ts +11 -0
- package/build/hooks/index.js +1 -1
- package/build/hooks/useAppEventListener.d.ts +4 -1
- package/build/hooks/useAppEventPublisher.d.ts +4 -1
- package/build/hooks/useAppsInfo.d.ts +3 -0
- package/build/hooks/useBadgesCount.d.ts +3 -0
- package/build/hooks/useColumnFiltersGate.d.ts +2 -7
- package/build/hooks/useCountdown.d.ts +3 -0
- package/build/hooks/useDelayToSetValue.d.ts +3 -0
- package/build/hooks/useElementSizeObserver.d.ts +3 -14
- package/build/hooks/useFilterKeyDown.d.ts +3 -7
- package/build/hooks/useNetworkState.d.ts +6 -1
- package/build/hooks/useScrollWithShadow.d.ts +5 -2
- package/build/hooks/useScrolledTo.d.ts +6 -3
- package/build/hooks/useSelectedMerchantDetails.d.ts +1 -4
- package/build/hooks/useStickyHeaderShadow.d.ts +8 -2
- package/build/hooks/useTableViews.d.ts +3 -0
- package/build/hooks/useThemeMode.d.ts +4 -1
- package/build/hooks/useToast.d.ts +5 -1
- package/build/hooks/useWindowDimensions.d.ts +4 -4
- package/build/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +5 -1
- package/build/_chunks/chunk-4NLQZJVN.js +0 -2
- package/build/_chunks/chunk-5KGT5D5O.js +0 -1
- package/build/_chunks/chunk-64OLTOQM.js +0 -1
- package/build/_chunks/chunk-6WI5CW2I.js +0 -2
- package/build/_chunks/chunk-A2SC5BOB.js +0 -1
- package/build/_chunks/chunk-BQ46OLDY.js +0 -1
- package/build/_chunks/chunk-C2RHW4FN.js +0 -1
- package/build/_chunks/chunk-CNYQ4OI5.js +0 -1
- package/build/_chunks/chunk-EP5VELEJ.js +0 -1
- package/build/_chunks/chunk-KMZPFESJ.js +0 -2
- package/build/_chunks/chunk-MSEBSRXG.js +0 -1
- package/build/_chunks/chunk-OSXKJYUX.js +0 -1
- package/build/_chunks/chunk-SO6E7CJM.js +0 -1
- package/build/_chunks/chunk-TXLFAI3O.js +0 -1
- package/build/_chunks/chunk-UVU4YIMS.js +0 -1
- package/build/_chunks/chunk-XTJZTHR6.js +0 -2
|
@@ -4,16 +4,16 @@ export declare const CalenderWrapper: import("@emotion/styled").StyledComponent<
|
|
|
4
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
5
|
export declare const CancelButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
6
6
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
7
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "
|
|
7
|
+
}, "color" | "disabled" | "size" | "classes" | "className" | "style" | "tabIndex" | "children" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "variant" | "startIcon" | "endIcon" | "fullWidth" | "href" | "disableFocusRipple" | "disableElevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
8
|
export declare const OkayButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
9
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
10
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "
|
|
10
|
+
}, "color" | "disabled" | "size" | "classes" | "className" | "style" | "tabIndex" | "children" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "variant" | "startIcon" | "endIcon" | "fullWidth" | "href" | "disableFocusRipple" | "disableElevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
11
11
|
export declare const ButtonsWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
12
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
13
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
14
14
|
export declare const SelectedDate: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
15
15
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
16
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "
|
|
16
|
+
}, "color" | "disabled" | "size" | "classes" | "className" | "style" | "tabIndex" | "children" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "variant" | "startIcon" | "endIcon" | "fullWidth" | "href" | "disableFocusRipple" | "disableElevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
17
17
|
open: boolean;
|
|
18
18
|
}, {}, {}>;
|
|
19
19
|
export declare const Footer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -50,10 +50,10 @@ export declare const CalendarModeToggleWrapper: import("@emotion/styled").Styled
|
|
|
50
50
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
51
51
|
export declare const ArrowButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
52
52
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
53
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "
|
|
53
|
+
}, "color" | "disabled" | "size" | "classes" | "className" | "style" | "tabIndex" | "children" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "variant" | "startIcon" | "endIcon" | "fullWidth" | "href" | "disableFocusRipple" | "disableElevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
54
54
|
export declare const PresetButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
55
55
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
56
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "
|
|
56
|
+
}, "color" | "disabled" | "size" | "classes" | "className" | "style" | "tabIndex" | "children" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "variant" | "startIcon" | "endIcon" | "fullWidth" | "href" | "disableFocusRipple" | "disableElevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
57
57
|
export declare const PresetsWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
58
58
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
59
59
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../../_chunks/chunk-KMZPFESJ.js';import'../../_chunks/chunk-64OLTOQM.js';import'../../_chunks/chunk-M64F4XVE.js';import'../../_chunks/chunk-OCHPXIEK.js';import'../../_chunks/chunk-G3QDXDRW.js';import'../../_chunks/chunk-DKBPLNEE.js';import'../../_chunks/chunk-A2SC5BOB.js';import'../../_chunks/chunk-72FD3NW2.js';import'../../_chunks/chunk-5KGT5D5O.js';import'../../_chunks/chunk-TXLFAI3O.js';import'../../_chunks/chunk-ISC5KT5E.js';import'../../_chunks/chunk-L42ISYQY.js';import'../../_chunks/chunk-GVXTYXRO.js';import'../../_chunks/chunk-AE4JYS7U.js';import'../../_chunks/chunk-OHN7F4WA.js';import'../../_chunks/chunk-2M6UER6N.js';import'../../_chunks/chunk-V5NBU5TE.js';import'../../_chunks/chunk-HRQGL7NO.js';import'../../_chunks/chunk-UVU4YIMS.js';import'../../_chunks/chunk-7GJ5PPIY.js';import'../../_chunks/chunk-AMOFAS7L.js';import'../../_chunks/chunk-C2RHW4FN.js';import'../../_chunks/chunk-SO6E7CJM.js';import'../../_chunks/chunk-D52IZHFQ.js';import'../../_chunks/chunk-JMPFZOV3.js';import'../../_chunks/chunk-XHFDGV2F.js';import'../../_chunks/chunk-JUEXC7Z2.js';import'../../_chunks/chunk-RFA33XQQ.js';import'../../_chunks/chunk-KFBXVUQ5.js';import'../../_chunks/chunk-RYHHS7S3.js';import'../../_chunks/chunk-6YAUL2OM.js';import'../../_chunks/chunk-MLZ63M2D.js';import'../../_chunks/chunk-6WI5CW2I.js';import'../../_chunks/chunk-HPDPFVUQ.js';import'../../_chunks/chunk-TCI6NIBC.js';import'../../_chunks/chunk-PUI6B7OY.js';import'../../_chunks/chunk-MTACYUU3.js';import'../../_chunks/chunk-7UCD3KUZ.js';import'../../_chunks/chunk-TQIWHM5B.js';import'../../_chunks/chunk-BQ46OLDY.js';import'../../_chunks/chunk-XLFVCH5I.js';import'../../_chunks/chunk-47BHPSSP.js';import'../../_chunks/chunk-HZYY6NMO.js';import'../../_chunks/chunk-RK4UGNRY.js';import'../../_chunks/chunk-CNYQ4OI5.js';import'../../_chunks/chunk-XEYCTDD3.js';import'../../_chunks/chunk-7VUU5WEU.js';import {b}from'../../_chunks/chunk-LECTWR74.js';import'../../_chunks/chunk-U5M6TIFS.js';import'../../_chunks/chunk-MSEBSRXG.js';import'../../_chunks/chunk-W3DEOBBE.js';import'../../_chunks/chunk-P6WIYEZX.js';import {b as b$1}from'../../_chunks/chunk-DN33IHNY.js';import'../../_chunks/chunk-ZGY3RIKJ.js';import'../../_chunks/chunk-NDRHRXAO.js';import'../../_chunks/chunk-NHAXRGPW.js';import'../../_chunks/chunk-WNQ3ONG2.js';import'../../_chunks/chunk-AXJZMO7Q.js';import'../../_chunks/chunk-RTKA6K5L.js';import'../../_chunks/chunk-UGX2ZY27.js';import'../../_chunks/chunk-PNRVZNL7.js';import {j,L,B as B$1,x as x$1,p,R as R$1,h}from'../../_chunks/chunk-4NLQZJVN.js';import'../../_chunks/chunk-CIB4WTBC.js';import {z,x,B,C,A,m,b as b$2,o,e,p as p$1,n}from'../../_chunks/chunk-BE2RKFQJ.js';import'../../_chunks/chunk-OSXKJYUX.js';import {Bc,Ya,Ma}from'../../_chunks/chunk-EP5VELEJ.js';import {Wj,Xj,Yj,Zj,H,Yc,ec,gc,fc,el,fl}from'../../_chunks/chunk-XTJZTHR6.js';import'../../_chunks/chunk-LS57WE6K.js';import {memo,createContext,useState,useMemo,useId,useRef,useEffect,useContext}from'react';import y from'@mui/material/Box';import ut from'@mui/material/Popper';import {useTranslation}from'react-i18next';import yt from'@mui/material/ClickAwayListener';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import q from'@mui/material/Button';import {Calendar,DateObject}from'react-multi-date-picker';import Ee from'react-date-object';import ht from'react-date-object/calendars/arabic';import Tt from'react-date-object/calendars/gregorian';import kt from'react-date-object/locales/arabic_en';import wt from'react-date-object/locales/gregorian_en';var co=styled(y)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),fe=styled(y)(({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"})),mo=styled(y,{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"}})),$=styled(y)(({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"}})),_=styled(y)(()=>({width:12,height:12})),K=styled(y)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function Re({zone:e,onChange:o,defaultCountryZone:t,countryCodes:n}){let[i,p]=useState(null),a=m=>{i||p(m.currentTarget);},l=()=>{i&&p(null);},r=(m,T)=>{m.stopPropagation(),o(T);},g=useMemo(()=>n.map(A).filter(m=>!!m),[n]),c=g.some(m=>B(m,e)),x=c?e:t;return jsxs($,{onMouseEnter:a,onMouseLeave:l,onClick:()=>{o(x);},children:[c?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(b,{countryCode:x.countryCode}),jsx(K,{className:c?"selected":"",children:C(x)}),jsx(ut,{open:!!i,anchorEl:i,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(fe,{sx:{maxHeight:300},children:g.map(m=>{let T=B(m,e);return jsxs($,{onClick:G=>{r(G,m);},sx:{gap:"4px"},children:[T?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx(b,{countryCode:m.countryCode}),jsx(K,{className:T?"selected":"",children:C(m)})]},m.countryCode)})})})]})}function ve({zone:e,onChange:o}){let t=z(x());if(!t)return null;let n=B(t,e);return jsxs($,{onClick:()=>o(t),children:[n?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(b,{countryCode:t.countryCode}),jsx(K,{className:n?"selected":"",children:C(t)})]})}function Ct({zone:e,onChange:o,defaultCountryZone:t,countryCodes:n}){let[i,p]=useState(null),a=!!i,l=z(x()),r=()=>{p(null);},g=m=>{o(m),r();},c=m=>{p(m.currentTarget);},x$1=B(e,l)?Wj:B(e,t)?Xj:Yj;return jsx(yt,{onClickAway:r,children:jsxs(co,{"data-testid":"ZonePicker",children:[jsxs(mo,{open:a,onClick:c,children:[jsx("img",{src:x$1,alt:"zone-icon"}),jsx(b,{countryCode:e.countryCode}),jsx("span",{children:C(e)})]}),jsx(ut,{open:a,anchorEl:i,placement:"top-start",sx:{zIndex:1400},children:jsxs(fe,{"data-testid":"ZonePicker_dropdown",children:[jsx(Re,{zone:e,onChange:g,defaultCountryZone:t,countryCodes:n}),jsx(ve,{zone:e,onChange:g})]})})]})})}var Se=memo(Ct);var fo=styled(y)(({theme:e})=>({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"},".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},".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"}})),go=styled(q)(({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}})),xo=styled(q)(({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}})),yo=styled(y)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),bo=styled(q,{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]}})),Co=styled(y)(({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"})),Do=styled(y)(({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"})),ho=styled(y)(()=>({display:"flex",alignItems:"center",gap:"10px"})),To=styled(y)(()=>({position:"relative"})),ko=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"24px"})),wo=styled(y)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Mo=styled(y,{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]}})),Po=styled(y)(({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"})),Ro=styled(y)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}})),vo=styled(y)(({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"}})),Bo=styled(q)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}})),So=styled(q)(({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}})),Oo=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),Eo=styled(y,{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}}})),Zo=styled(y)(()=>({width:235})),Io=styled(y)(()=>({display:"flex",gap:"4px"})),Ao=styled(y)(({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 Oe({calendarMode:e,onCalendarModeChange:o}){let{t}=useTranslation();return jsx(y,{children:jsxs(vo,{children:[jsxs(y,{children:[jsx("img",{src:ec,alt:"hijri"}),jsx("span",{children:t("hijri")})]}),jsx(h,{checked:e==="hijri",onChange:()=>o?.(e==="hijri"?"gregorian":"hijri")})]})})}var P=e=>e==="hijri"?kt:wt,R=e=>e==="hijri"?ht:Tt,jo=(e,o)=>!e||Number.isNaN(e.getTime())?void 0:new Ee({date:e,calendar:R(o),locale:P(o)}),Ze=(e$1,o,t)=>{let n=jo(e(e$1?.[0],t),o),i=jo(e(e$1?.[1],t),o);if(n&&i)return [n,i];let p=R(o),a=P(o),l=e(Date.now(),t)??new Date;return [new Ee({date:new Date(l.getFullYear(),l.getMonth(),l.getDate()-6),calendar:p,locale:a}),new Ee({date:l,calendar:p,locale:a})]},Ho=(e,o)=>Math.round((Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())-Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))/864e5),xe=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),ye=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Ie=e=>!!e[1]&&e[0].format("YYYYMMDD")===e[1].format("YYYYMMDD");var Bt=31,ze=createContext(null);function v(){let e=useContext(ze);if(!e)throw new Error("useDateRangeCalendar must be used inside a DateRangeCalendar");return e}function Wo({zone:e$1,range:o$1,onApply:t,calendarMode:n$1="gregorian",maxRangeDays:i,groupBy:p,onGroupByChange:a}){let[l,r]=useState(()=>Ze(o$1,n$1,e$1.zone)),[g,c]=useState(l),[x,m]=useState(e$1),[T,G]=useState(p??"day"),[te,D]=useState(()=>o(o$1,e$1.zone)),[re,V]=useState(null),[ne,ae]=useState(false),S=useRef(null),L=!!re,s=i===void 0?Bt:i;useEffect(()=>{if(L)return;let d=Ze(o$1,n$1,e$1.zone);r(d),c(d),D(o(o$1,e$1.zone)),S.current&&S.current.set("date",d[0]);},[o$1,e$1.zone,e$1.countryCode,n$1,L]),useEffect(()=>{let d=u=>new DateObject({date:u.toDate(),calendar:R(n$1),locale:P(n$1)});r(u=>[d(u[0]),d(u[1])]),c(u=>[d(u[0]),d(u[1])]);},[n$1]),useEffect(()=>{m(d=>d.zone===e$1.zone&&d.countryCode===e$1.countryCode?d:e$1);},[e$1.zone,e$1.countryCode,L]);let k=d=>{let u=d;if(d.length<2||s===0)return u;let j=Ho(xe(d[0]).toDate(),ye(d[1]).toDate());return j<=s?u:(ae(true),setTimeout(()=>{ae(false);},3e3),[d[0],d[1].subtract(j-s,"d")])},rt=d=>{let u=k(d);r(u),D(!Ie(u));},nt=d=>{let u=k(d);r([xe(u[0]),ye(u[1])]),D(true),S.current&&S.current.set("date",u[0]);},at=d=>r(d),it=d=>{D(d),d&&l[1]&&r([xe(l[0]),ye(l[1])]);},_e=()=>V(null),pt=d=>V(d.currentTarget),lt=()=>{let d=[l[0].toDate(),l[1].toDate()];return {range:(te?p$1(d,x.zone):n(d,x.zone))??d,zone:x}},dt=()=>{t(lt())!==false&&(c(l),a?.(T),_e());},st=d=>{let u=d[0]?.format("MMM D"),j=d[1]?.format("MMM D")??u;return u?u===j?u:`${u} - ${j}`:j};return {draft:l,isAllDay:te,isSameDay:Ie(l),isError:ne,maxRangeDays:s,open:L,anchorEl:re,pickedZone:x,selectedGroupBy:T,calendarRef:S,maxDate:e(Date.now(),x.zone),rangeLabel:st(g),pickRange:rt,pickPreset:nt,setTimes:at,setAllDay:it,pickZone:m,setGroupBy:G,openPicker:pt,closePicker:_e,apply:dt}}var Go={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function Zt(){let{selectedGroupBy:e,setGroupBy:o,open:t}=v(),[n,i]=useState(null),p=!!n&&t,{t:a}=useTranslation();return jsx(yt,{onClickAway:()=>i(null),children:jsxs(y,{children:[jsx(wo,{children:a("groupedBy")}),jsxs(Mo,{onClick:l=>i(l.currentTarget),open:p,children:[jsx("span",{children:Go[e]}),jsx(y,{component:"img",src:Yc,alt:"arrow",sx:{...p&&{transform:"rotate(180deg)"}}})]}),jsx(R$1,{open:p,anchorEl:n,children:jsx(Po,{sx:{width:n?.clientWidth},children:Object.entries(Go).map(([l,r])=>jsx(Ro,{onClick:()=>{o(l),i(null);},className:e===l?"active":"",children:r},l))})})]})})}var Yo=Zt;var At=["Su","Mo","Tu","We","Th","Fr","Sa"];function zt({calendarMode:e}){let{draft:o,maxDate:t,calendarRef:n,pickRange:i}=v();return jsx(Calendar,{ref:n,numberOfMonths:2,value:o,onChange:i,calendar:R(e),locale:P(e),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(p,a)=>jsx(Bo,{onClick:a,children:jsx("img",{src:p==="right"?gc:fc,alt:"arrow"})}),weekDays:At,maxDate:t})}var No=zt;function He({calendarMode:e$1}){let{t:o}=useTranslation(),{pickedZone:t,pickPreset:n}=v(),i=useMemo(()=>{let p=e(Date.now(),t.zone)??new Date,a=()=>new DateObject({date:p,calendar:R(e$1),locale:P(e$1)}),l=r=>a().subtract(r,"month");return [{id:"today",value:[a(),a()]},{id:"lastWeek",value:[a().subtract(6,"day"),a()]},{id:"lastMonth",value:[a().subtract(30,"day"),a()]},...[1,2,3].map(r=>({id:l(r).toFirstOfMonth().format("MMMM YYYY"),value:[l(r).toFirstOfMonth(),l(r).toLastOfMonth()]}))]},[e$1,t.zone]);return jsx(y,{"data-testid":"RangePresets",children:jsx(Oo,{children:i.map(p=>jsx(So,{onClick:a=>{a.preventDefault(),n(p.value);},children:o(p.id)},p.id))})})}var Q=e=>e===0?12:e<=12?e:e-12,be=e=>e>=12?"PM":"AM",Ce=(e,o)=>o==="AM"&&e===12?0:o==="PM"&&e!==12?e+12:e,$o=()=>new Date().getMinutes(),_o=()=>Q(new Date().getHours());var Ko=styled(y)(()=>({width:157,padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"})),Uo=styled(j,{shouldForwardProp:e=>e!=="open"&&e!=="size"})(({theme:e,open:o,size:t})=>{let{base:n,grey:i,brand:p}=e.v2.palette;return {fontSize:"11px",fontWeight:500,background:n.white,border:`1px solid ${i[100]}`,borderRadius:"19px",height:t==="large"?32:24,width:t==="large"?74:58,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{boxShadow:"0px 0px 4px 0px #1F88D080",borderColor:p[500]}}}),J=styled(y)(()=>({textAlign:"center",cursor:"pointer",userSelect:"none"})),qo=styled(j,{shouldForwardProp:e=>e!=="selected"})(({theme:e,selected:o})=>{let{base:t,grey:n,brand:i}=e.v2.palette;return {fontSize:"11px",fontWeight:500,background:t.white,border:`1px solid ${n[100]}`,borderRadius:"4px",height:24,width:33,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{borderColor:"transparent",color:i[500],backgroundColor:alpha(i[500],.1)}}}),Qo=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"4px"})),Xo=styled(y)(()=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px"})),We=styled(y)(()=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"6px"})),Fe=styled(L)(()=>({flexGrow:1,maxWidth:"100%",".MuiInput-input":{fontWeight:"500",fontSize:"11px",textAlign:"center"},".MuiInput-root":{paddingInline:"8px"},height:32,width:32}));var $t=["AM","PM"],he=12,Ge=59;function Te({onChange:e,defaultTime:o,enableRealTimeChange:t,size:n="large"}){let i=Bc(useId(),"time-picker"),[p,a]=useState(null),[l,r]=useState(o?.period??(new Date().getHours()>=he?"PM":"AM")),[g,c]=useState(o?.hour??_o()),[x,m]=useState(o?.minute??$o()),T=!!p;useEffect(()=>{t&&e?.({hour:g,minute:x,period:l});},[g,x,l,t]);let G=s=>{a(s.currentTarget);},te=()=>{a(null),e?.({hour:g,minute:x,period:l});},D=s=>s<10?`0${s}`:s.toString(),re=s=>{let k=Ma(D(Number(s.target.value)));if(k>he){s.preventDefault();return}c(k);},V=()=>{c(s=>s===he?1:s+1);},ne=()=>{c(s=>s===1?he:s-1);},ae=s=>{let k=Ma(D(Number(s.target.value)));if(k>Ge){s.preventDefault();return}m(k);},S=()=>{m(s=>s===Ge?(V(),0):s+1);},L=()=>{m(s=>s===0?(ne(),Ge):s-1);};return jsx(yt,{onClickAway:te,children:jsxs(y,{id:i,"data-testid":"TimePicker",children:[jsx(Uo,{size:n,open:T,onClick:G,children:`${D(g)}:${D(x)}${l.toLowerCase()}`}),jsx(R$1,{open:T,anchorEl:p,placement:"top-start",sx:{marginTop:"8px",marginBottom:"8px"},children:jsxs(Ko,{children:[jsxs(Xo,{children:[jsxs(We,{children:[jsx(J,{onClick:V,children:jsx("img",{src:el,alt:"arrow"})}),jsx(Fe,{type:"number",hideArrows:true,disableFocusRing:true,value:D(g),onChange:re}),jsx(J,{onClick:ne,children:jsx("img",{src:fl,alt:"arrow"})})]}),jsx(j,{children:":"}),jsxs(We,{children:[jsx(J,{onClick:S,children:jsx("img",{src:el,alt:"arrow"})}),jsx(Fe,{type:"number",hideArrows:true,disableFocusRing:true,value:D(x),onChange:ae}),jsx(J,{onClick:L,children:jsx("img",{src:fl,alt:"arrow"})})]})]}),jsx(Qo,{children:$t.map(s=>jsx(qo,{onClick:()=>r(s),selected:l===s,children:s},s))})]})})]})})}function Kt(){let{t:e}=useTranslation(),{draft:o,isAllDay:t,setTimes:n,setAllDay:i}=v(),p=new DateObject(o[0]),a=new DateObject(o[1]),l=({hour:g,minute:c,period:x})=>{n([p.setHour(Ce(g,x??"AM")).setMinute(c).setSecond(0),a]);},r=({hour:g,minute:c,period:x})=>{n([p,a.setHour(Ce(g,x??"AM")).setMinute(c).setSecond(59)]);};return jsx(Zo,{children:jsxs(Ao,{children:[jsxs(Eo,{isAllDay:t,children:[jsx("span",{className:"label",children:e("allDay")}),jsx(h,{checked:t,onChange:g=>i(g.target.checked)})]}),!t&&jsxs(Io,{children:[jsx(Te,{defaultTime:{hour:Q(p.hour),minute:p.minute,period:be(p.hour)},size:"small",onChange:l,enableRealTimeChange:true},`${o[0]?.toString()}-start`),jsx(Te,{defaultTime:{hour:Q(a.hour),minute:a.minute,period:be(a.hour)},size:"small",onChange:r,enableRealTimeChange:true},`${o[1]?.toString()}-end`)]})]})})}var et=Kt;function Jt(e){let{calendarMode:o="gregorian",onCalendarModeChange:t,defaultCountryZone:n,countryCodes:i,groupBy:p}=e,{t:a}=useTranslation(),l=Bc(useId(),"date-range-calendar"),r=Wo(e),g=c=>{c.key==="Enter"&&r.draft[1]&&!r.isError?(c.stopPropagation(),r.apply()):c.key==="Escape"&&(c.stopPropagation(),r.closePicker());};return jsx(ze.Provider,{value:r,children:jsxs(To,{id:l,"data-testid":"DateRangeCalendar",children:[jsx(bo,{onClick:r.openPicker,open:r.open,children:r.rangeLabel}),r.open&&jsx(B$1,{onClick:c=>{c.stopPropagation(),r.closePicker();}}),jsx(ut,{open:r.open,anchorEl:r.anchorEl,placement:"bottom-end",children:jsxs(fo,{onKeyDown:g,children:[jsxs(Do,{children:[jsx(He,{calendarMode:o}),jsxs(ko,{children:[p&&jsx(Yo,{}),jsx(Oe,{calendarMode:o,onCalendarModeChange:t})]})]}),jsxs(y,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(No,{calendarMode:o}),jsx(x$1,{in:r.isError&&r.maxRangeDays>0,children:jsx(b$1,{severity:"error",message:a("dateRangeError",{number:r.maxRangeDays}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(Co,{sx:{borderBottomLeftRadius:"8px"},children:[n&&i&&jsx(ho,{children:jsx(Se,{zone:r.pickedZone,onChange:r.pickZone,defaultCountryZone:n,countryCodes:i},String(r.open))}),r.isSameDay&&jsx(et,{}),jsxs(yo,{children:[jsx(go,{variant:"contained",onClick:r.closePicker,children:a("cancel")}),jsx(xo,{variant:"contained",onClick:r.apply,disabled:!r.draft[1],children:a("okay")})]})]})]})]})})]})})}var ot=Jt;function or({value:e,zone:o,format:t,...n}){let i=useMemo(()=>m(e,o,t),[e,o,t]);return jsx(a,{...n,children:i})}var tr=or;var tt=styled(y)({display:"flex",alignItems:"center",gap:"12px"});function lr({value:e,zone:o,format:t,rendered:n,tableMode:i,...p}){let a$1=useMemo(()=>n??m(e,o,t),[n,e,o,t]);return jsx(a,{...p,children:jsx(tt,{children:jsx(y,{sx:{...Ya(i)&&{fontSize:"11px"}},children:a$1})})})}var Ne=lr;function cr({value:e,zone:o,hintZone:t,format:n,tableMode:i,...p$1}){let a=useMemo(()=>{if(!(!t||e==null||e===""))return b$2(o,t,e)?m(e,t):void 0},[e,o,t]);return jsxs(y,{sx:{display:"flex",gap:"8px"},children:[jsx(Ne,{value:e,zone:o,format:n,tableMode:i,...p$1}),a!==void 0&&jsx(p,{title:a,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}var mr=cr;export{ot as DateRangeCalendar,Se as ZonePicker,tr as ZonedDateCell,mr as ZonedDateHintViewer,Ne as ZonedDateViewer};
|
|
1
|
+
import {a}from'../../_chunks/chunk-XXMVSJIM.js';import'../../_chunks/chunk-DIW7RMJY.js';import'../../_chunks/chunk-MBZVHLRC.js';import'../../_chunks/chunk-NBVOXBIW.js';import'../../_chunks/chunk-G3QDXDRW.js';import'../../_chunks/chunk-ZQFDXQ4J.js';import'../../_chunks/chunk-YWZJZGDA.js';import'../../_chunks/chunk-2MXRHXGS.js';import'../../_chunks/chunk-PVUGMA6R.js';import'../../_chunks/chunk-HI2JOLXL.js';import'../../_chunks/chunk-ISC5KT5E.js';import'../../_chunks/chunk-2I5L7ASP.js';import'../../_chunks/chunk-IEPHBQH7.js';import'../../_chunks/chunk-NIWGDILH.js';import'../../_chunks/chunk-DD3TYF3Y.js';import'../../_chunks/chunk-UPUJEOOS.js';import'../../_chunks/chunk-2WOWP3QA.js';import'../../_chunks/chunk-N5K54WNL.js';import'../../_chunks/chunk-LBKOWCCN.js';import'../../_chunks/chunk-MBZF7BHG.js';import'../../_chunks/chunk-73SAT4RE.js';import'../../_chunks/chunk-CRSHY7OT.js';import'../../_chunks/chunk-H6CKZAJN.js';import'../../_chunks/chunk-ZQ6WQPET.js';import'../../_chunks/chunk-6X4K2W2E.js';import'../../_chunks/chunk-3ANVVXOL.js';import'../../_chunks/chunk-AJUXDLJF.js';import'../../_chunks/chunk-BDW6QQXH.js';import'../../_chunks/chunk-K67DFHSS.js';import'../../_chunks/chunk-MKDL4TYN.js';import'../../_chunks/chunk-QKUEMUT3.js';import'../../_chunks/chunk-TMAA4QIY.js';import'../../_chunks/chunk-DXDJ7ZQI.js';import'../../_chunks/chunk-7BA3JMDW.js';import'../../_chunks/chunk-ZLXQBIAQ.js';import'../../_chunks/chunk-OEZIALDT.js';import'../../_chunks/chunk-PF6NDV3G.js';import'../../_chunks/chunk-7WMSYKS3.js';import'../../_chunks/chunk-2W2GZUKF.js';import'../../_chunks/chunk-L2PULJKK.js';import'../../_chunks/chunk-ANIJPMR3.js';import'../../_chunks/chunk-45E65P5R.js';import'../../_chunks/chunk-MPIENGJC.js';import'../../_chunks/chunk-VIIDA663.js';import'../../_chunks/chunk-HWNPJALM.js';import'../../_chunks/chunk-AN73YAF5.js';import'../../_chunks/chunk-OW3B34TK.js';import'../../_chunks/chunk-3MRO5CJP.js';import {b}from'../../_chunks/chunk-45GQW7K7.js';import'../../_chunks/chunk-JZK2QZX3.js';import'../../_chunks/chunk-77K53QY2.js';import'../../_chunks/chunk-E74Q7ILM.js';import'../../_chunks/chunk-JRQZANGX.js';import {b as b$1}from'../../_chunks/chunk-52MTQXHO.js';import'../../_chunks/chunk-BAXN7S2I.js';import'../../_chunks/chunk-L4KBXHZI.js';import'../../_chunks/chunk-F5H3U3NJ.js';import'../../_chunks/chunk-UKV3UR3X.js';import'../../_chunks/chunk-Q2GI76OF.js';import'../../_chunks/chunk-7CT3QCVP.js';import'../../_chunks/chunk-UBMO65ZL.js';import'../../_chunks/chunk-7LWPKOGV.js';import {j,L,B as B$1,x as x$1,p,R as R$1,h}from'../../_chunks/chunk-3LLAL7SZ.js';import'../../_chunks/chunk-BTUNGKV3.js';import {z,x,B,C,A,m,b as b$2,o,e,p as p$1,n}from'../../_chunks/chunk-BE2RKFQJ.js';import'../../_chunks/chunk-CGGZ367Q.js';import'../../_chunks/chunk-OTG5BKW6.js';import {Vb,qa,ea}from'../../_chunks/chunk-2V7P76GA.js';import'../../_chunks/chunk-DJHXUNB6.js';import {Wj,Xj,Yj,Zj,H,Yc,ec,gc,fc,el,fl}from'../../_chunks/chunk-FI5H6V55.js';import'../../_chunks/chunk-LS57WE6K.js';import {memo,createContext,useState,useMemo,useId,useRef,useEffect,useContext}from'react';import y from'@mui/material/Box';import ut from'@mui/material/Popper';import {useTranslation}from'react-i18next';import yt from'@mui/material/ClickAwayListener';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import q from'@mui/material/Button';import {Calendar,DateObject}from'react-multi-date-picker';import Ee from'react-date-object';import ht from'react-date-object/calendars/arabic';import Tt from'react-date-object/calendars/gregorian';import kt from'react-date-object/locales/arabic_en';import wt from'react-date-object/locales/gregorian_en';var co=styled(y)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),fe=styled(y)(({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"})),mo=styled(y,{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"}})),$=styled(y)(({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"}})),_=styled(y)(()=>({width:12,height:12})),K=styled(y)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function Re({zone:e,onChange:o,defaultCountryZone:t,countryCodes:n}){let[i,p]=useState(null),a=m=>{i||p(m.currentTarget);},l=()=>{i&&p(null);},r=(m,T)=>{m.stopPropagation(),o(T);},g=useMemo(()=>n.map(A).filter(m=>!!m),[n]),c=g.some(m=>B(m,e)),x=c?e:t;return jsxs($,{onMouseEnter:a,onMouseLeave:l,onClick:()=>{o(x);},children:[c?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(b,{countryCode:x.countryCode}),jsx(K,{className:c?"selected":"",children:C(x)}),jsx(ut,{open:!!i,anchorEl:i,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(fe,{sx:{maxHeight:300},children:g.map(m=>{let T=B(m,e);return jsxs($,{onClick:G=>{r(G,m);},sx:{gap:"4px"},children:[T?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx(b,{countryCode:m.countryCode}),jsx(K,{className:T?"selected":"",children:C(m)})]},m.countryCode)})})})]})}function ve({zone:e,onChange:o}){let t=z(x());if(!t)return null;let n=B(t,e);return jsxs($,{onClick:()=>o(t),children:[n?jsx("img",{src:Zj,alt:"icon"}):jsx(_,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(b,{countryCode:t.countryCode}),jsx(K,{className:n?"selected":"",children:C(t)})]})}function Ct({zone:e,onChange:o,defaultCountryZone:t,countryCodes:n}){let[i,p]=useState(null),a=!!i,l=z(x()),r=()=>{p(null);},g=m=>{o(m),r();},c=m=>{p(m.currentTarget);},x$1=B(e,l)?Wj:B(e,t)?Xj:Yj;return jsx(yt,{onClickAway:r,children:jsxs(co,{"data-testid":"ZonePicker",children:[jsxs(mo,{open:a,onClick:c,children:[jsx("img",{src:x$1,alt:"zone-icon"}),jsx(b,{countryCode:e.countryCode}),jsx("span",{children:C(e)})]}),jsx(ut,{open:a,anchorEl:i,placement:"top-start",sx:{zIndex:1400},children:jsxs(fe,{"data-testid":"ZonePicker_dropdown",children:[jsx(Re,{zone:e,onChange:g,defaultCountryZone:t,countryCodes:n}),jsx(ve,{zone:e,onChange:g})]})})]})})}var Se=memo(Ct);var fo=styled(y)(({theme:e})=>({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"},".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},".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"}})),go=styled(q)(({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}})),xo=styled(q)(({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}})),yo=styled(y)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),bo=styled(q,{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]}})),Co=styled(y)(({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"})),Do=styled(y)(({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"})),ho=styled(y)(()=>({display:"flex",alignItems:"center",gap:"10px"})),To=styled(y)(()=>({position:"relative"})),ko=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"24px"})),wo=styled(y)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Mo=styled(y,{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]}})),Po=styled(y)(({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"})),Ro=styled(y)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}})),vo=styled(y)(({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"}})),Bo=styled(q)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}})),So=styled(q)(({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}})),Oo=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),Eo=styled(y,{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}}})),Zo=styled(y)(()=>({width:235})),Io=styled(y)(()=>({display:"flex",gap:"4px"})),Ao=styled(y)(({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 Oe({calendarMode:e,onCalendarModeChange:o}){let{t}=useTranslation();return jsx(y,{children:jsxs(vo,{children:[jsxs(y,{children:[jsx("img",{src:ec,alt:"hijri"}),jsx("span",{children:t("hijri")})]}),jsx(h,{checked:e==="hijri",onChange:()=>o?.(e==="hijri"?"gregorian":"hijri")})]})})}var P=e=>e==="hijri"?kt:wt,R=e=>e==="hijri"?ht:Tt,jo=(e,o)=>!e||Number.isNaN(e.getTime())?void 0:new Ee({date:e,calendar:R(o),locale:P(o)}),Ze=(e$1,o,t)=>{let n=jo(e(e$1?.[0],t),o),i=jo(e(e$1?.[1],t),o);if(n&&i)return [n,i];let p=R(o),a=P(o),l=e(Date.now(),t)??new Date;return [new Ee({date:new Date(l.getFullYear(),l.getMonth(),l.getDate()-6),calendar:p,locale:a}),new Ee({date:l,calendar:p,locale:a})]},Ho=(e,o)=>Math.round((Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())-Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))/864e5),xe=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),ye=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Ie=e=>!!e[1]&&e[0].format("YYYYMMDD")===e[1].format("YYYYMMDD");var Bt=31,ze=createContext(null);function v(){let e=useContext(ze);if(!e)throw new Error("useDateRangeCalendar must be used inside a DateRangeCalendar");return e}function Wo({zone:e$1,range:o$1,onApply:t,calendarMode:n$1="gregorian",maxRangeDays:i,groupBy:p,onGroupByChange:a}){let[l,r]=useState(()=>Ze(o$1,n$1,e$1.zone)),[g,c]=useState(l),[x,m]=useState(e$1),[T,G]=useState(p??"day"),[te,D]=useState(()=>o(o$1,e$1.zone)),[re,V]=useState(null),[ne,ae]=useState(false),S=useRef(null),L=!!re,s=i===void 0?Bt:i;useEffect(()=>{if(L)return;let d=Ze(o$1,n$1,e$1.zone);r(d),c(d),D(o(o$1,e$1.zone)),S.current&&S.current.set("date",d[0]);},[o$1,e$1.zone,e$1.countryCode,n$1,L]),useEffect(()=>{let d=u=>new DateObject({date:u.toDate(),calendar:R(n$1),locale:P(n$1)});r(u=>[d(u[0]),d(u[1])]),c(u=>[d(u[0]),d(u[1])]);},[n$1]),useEffect(()=>{m(d=>d.zone===e$1.zone&&d.countryCode===e$1.countryCode?d:e$1);},[e$1.zone,e$1.countryCode,L]);let k=d=>{let u=d;if(d.length<2||s===0)return u;let j=Ho(xe(d[0]).toDate(),ye(d[1]).toDate());return j<=s?u:(ae(true),setTimeout(()=>{ae(false);},3e3),[d[0],d[1].subtract(j-s,"d")])},rt=d=>{let u=k(d);r(u),D(!Ie(u));},nt=d=>{let u=k(d);r([xe(u[0]),ye(u[1])]),D(true),S.current&&S.current.set("date",u[0]);},at=d=>r(d),it=d=>{D(d),d&&l[1]&&r([xe(l[0]),ye(l[1])]);},_e=()=>V(null),pt=d=>V(d.currentTarget),lt=()=>{let d=[l[0].toDate(),l[1].toDate()];return {range:(te?p$1(d,x.zone):n(d,x.zone))??d,zone:x}},dt=()=>{t(lt())!==false&&(c(l),a?.(T),_e());},st=d=>{let u=d[0]?.format("MMM D"),j=d[1]?.format("MMM D")??u;return u?u===j?u:`${u} - ${j}`:j};return {draft:l,isAllDay:te,isSameDay:Ie(l),isError:ne,maxRangeDays:s,open:L,anchorEl:re,pickedZone:x,selectedGroupBy:T,calendarRef:S,maxDate:e(Date.now(),x.zone),rangeLabel:st(g),pickRange:rt,pickPreset:nt,setTimes:at,setAllDay:it,pickZone:m,setGroupBy:G,openPicker:pt,closePicker:_e,apply:dt}}var Go={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function Zt(){let{selectedGroupBy:e,setGroupBy:o,open:t}=v(),[n,i]=useState(null),p=!!n&&t,{t:a}=useTranslation();return jsx(yt,{onClickAway:()=>i(null),children:jsxs(y,{children:[jsx(wo,{children:a("groupedBy")}),jsxs(Mo,{onClick:l=>i(l.currentTarget),open:p,children:[jsx("span",{children:Go[e]}),jsx(y,{component:"img",src:Yc,alt:"arrow",sx:{...p&&{transform:"rotate(180deg)"}}})]}),jsx(R$1,{open:p,anchorEl:n,children:jsx(Po,{sx:{width:n?.clientWidth},children:Object.entries(Go).map(([l,r])=>jsx(Ro,{onClick:()=>{o(l),i(null);},className:e===l?"active":"",children:r},l))})})]})})}var Yo=Zt;var At=["Su","Mo","Tu","We","Th","Fr","Sa"];function zt({calendarMode:e}){let{draft:o,maxDate:t,calendarRef:n,pickRange:i}=v();return jsx(Calendar,{ref:n,numberOfMonths:2,value:o,onChange:i,calendar:R(e),locale:P(e),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(p,a)=>jsx(Bo,{onClick:a,children:jsx("img",{src:p==="right"?gc:fc,alt:"arrow"})}),weekDays:At,maxDate:t})}var No=zt;function He({calendarMode:e$1}){let{t:o}=useTranslation(),{pickedZone:t,pickPreset:n}=v(),i=useMemo(()=>{let p=e(Date.now(),t.zone)??new Date,a=()=>new DateObject({date:p,calendar:R(e$1),locale:P(e$1)}),l=r=>a().subtract(r,"month");return [{id:"today",value:[a(),a()]},{id:"lastWeek",value:[a().subtract(6,"day"),a()]},{id:"lastMonth",value:[a().subtract(30,"day"),a()]},...[1,2,3].map(r=>({id:l(r).toFirstOfMonth().format("MMMM YYYY"),value:[l(r).toFirstOfMonth(),l(r).toLastOfMonth()]}))]},[e$1,t.zone]);return jsx(y,{"data-testid":"RangePresets",children:jsx(Oo,{children:i.map(p=>jsx(So,{onClick:a=>{a.preventDefault(),n(p.value);},children:o(p.id)},p.id))})})}var Q=e=>e===0?12:e<=12?e:e-12,be=e=>e>=12?"PM":"AM",Ce=(e,o)=>o==="AM"&&e===12?0:o==="PM"&&e!==12?e+12:e,$o=()=>new Date().getMinutes(),_o=()=>Q(new Date().getHours());var Ko=styled(y)(()=>({width:157,padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"})),Uo=styled(j,{shouldForwardProp:e=>e!=="open"&&e!=="size"})(({theme:e,open:o,size:t})=>{let{base:n,grey:i,brand:p}=e.v2.palette;return {fontSize:"11px",fontWeight:500,background:n.white,border:`1px solid ${i[100]}`,borderRadius:"19px",height:t==="large"?32:24,width:t==="large"?74:58,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{boxShadow:"0px 0px 4px 0px #1F88D080",borderColor:p[500]}}}),J=styled(y)(()=>({textAlign:"center",cursor:"pointer",userSelect:"none"})),qo=styled(j,{shouldForwardProp:e=>e!=="selected"})(({theme:e,selected:o})=>{let{base:t,grey:n,brand:i}=e.v2.palette;return {fontSize:"11px",fontWeight:500,background:t.white,border:`1px solid ${n[100]}`,borderRadius:"4px",height:24,width:33,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{borderColor:"transparent",color:i[500],backgroundColor:alpha(i[500],.1)}}}),Qo=styled(y)(()=>({display:"flex",flexDirection:"column",gap:"4px"})),Xo=styled(y)(()=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px"})),We=styled(y)(()=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"6px"})),Fe=styled(L)(()=>({flexGrow:1,maxWidth:"100%",".MuiInput-input":{fontWeight:"500",fontSize:"11px",textAlign:"center"},".MuiInput-root":{paddingInline:"8px"},height:32,width:32}));var $t=["AM","PM"],he=12,Ge=59;function Te({onChange:e,defaultTime:o,enableRealTimeChange:t,size:n="large"}){let i=Vb(useId(),"time-picker"),[p,a]=useState(null),[l,r]=useState(o?.period??(new Date().getHours()>=he?"PM":"AM")),[g,c]=useState(o?.hour??_o()),[x,m]=useState(o?.minute??$o()),T=!!p;useEffect(()=>{t&&e?.({hour:g,minute:x,period:l});},[g,x,l,t]);let G=s=>{a(s.currentTarget);},te=()=>{a(null),e?.({hour:g,minute:x,period:l});},D=s=>s<10?`0${s}`:s.toString(),re=s=>{let k=ea(D(Number(s.target.value)));if(k>he){s.preventDefault();return}c(k);},V=()=>{c(s=>s===he?1:s+1);},ne=()=>{c(s=>s===1?he:s-1);},ae=s=>{let k=ea(D(Number(s.target.value)));if(k>Ge){s.preventDefault();return}m(k);},S=()=>{m(s=>s===Ge?(V(),0):s+1);},L=()=>{m(s=>s===0?(ne(),Ge):s-1);};return jsx(yt,{onClickAway:te,children:jsxs(y,{id:i,"data-testid":"TimePicker",children:[jsx(Uo,{size:n,open:T,onClick:G,children:`${D(g)}:${D(x)}${l.toLowerCase()}`}),jsx(R$1,{open:T,anchorEl:p,placement:"top-start",sx:{marginTop:"8px",marginBottom:"8px"},children:jsxs(Ko,{children:[jsxs(Xo,{children:[jsxs(We,{children:[jsx(J,{onClick:V,children:jsx("img",{src:el,alt:"arrow"})}),jsx(Fe,{type:"number",hideArrows:true,disableFocusRing:true,value:D(g),onChange:re}),jsx(J,{onClick:ne,children:jsx("img",{src:fl,alt:"arrow"})})]}),jsx(j,{children:":"}),jsxs(We,{children:[jsx(J,{onClick:S,children:jsx("img",{src:el,alt:"arrow"})}),jsx(Fe,{type:"number",hideArrows:true,disableFocusRing:true,value:D(x),onChange:ae}),jsx(J,{onClick:L,children:jsx("img",{src:fl,alt:"arrow"})})]})]}),jsx(Qo,{children:$t.map(s=>jsx(qo,{onClick:()=>r(s),selected:l===s,children:s},s))})]})})]})})}function Kt(){let{t:e}=useTranslation(),{draft:o,isAllDay:t,setTimes:n,setAllDay:i}=v(),p=new DateObject(o[0]),a=new DateObject(o[1]),l=({hour:g,minute:c,period:x})=>{n([p.setHour(Ce(g,x??"AM")).setMinute(c).setSecond(0),a]);},r=({hour:g,minute:c,period:x})=>{n([p,a.setHour(Ce(g,x??"AM")).setMinute(c).setSecond(59)]);};return jsx(Zo,{children:jsxs(Ao,{children:[jsxs(Eo,{isAllDay:t,children:[jsx("span",{className:"label",children:e("allDay")}),jsx(h,{checked:t,onChange:g=>i(g.target.checked)})]}),!t&&jsxs(Io,{children:[jsx(Te,{defaultTime:{hour:Q(p.hour),minute:p.minute,period:be(p.hour)},size:"small",onChange:l,enableRealTimeChange:true},`${o[0]?.toString()}-start`),jsx(Te,{defaultTime:{hour:Q(a.hour),minute:a.minute,period:be(a.hour)},size:"small",onChange:r,enableRealTimeChange:true},`${o[1]?.toString()}-end`)]})]})})}var et=Kt;function Jt(e){let{calendarMode:o="gregorian",onCalendarModeChange:t,defaultCountryZone:n,countryCodes:i,groupBy:p}=e,{t:a}=useTranslation(),l=Vb(useId(),"date-range-calendar"),r=Wo(e),g=c=>{c.key==="Enter"&&r.draft[1]&&!r.isError?(c.stopPropagation(),r.apply()):c.key==="Escape"&&(c.stopPropagation(),r.closePicker());};return jsx(ze.Provider,{value:r,children:jsxs(To,{id:l,"data-testid":"DateRangeCalendar",children:[jsx(bo,{onClick:r.openPicker,open:r.open,children:r.rangeLabel}),r.open&&jsx(B$1,{onClick:c=>{c.stopPropagation(),r.closePicker();}}),jsx(ut,{open:r.open,anchorEl:r.anchorEl,placement:"bottom-end",children:jsxs(fo,{onKeyDown:g,children:[jsxs(Do,{children:[jsx(He,{calendarMode:o}),jsxs(ko,{children:[p&&jsx(Yo,{}),jsx(Oe,{calendarMode:o,onCalendarModeChange:t})]})]}),jsxs(y,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(No,{calendarMode:o}),jsx(x$1,{in:r.isError&&r.maxRangeDays>0,children:jsx(b$1,{severity:"error",message:a("dateRangeError",{number:r.maxRangeDays}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(Co,{sx:{borderBottomLeftRadius:"8px"},children:[n&&i&&jsx(ho,{children:jsx(Se,{zone:r.pickedZone,onChange:r.pickZone,defaultCountryZone:n,countryCodes:i},String(r.open))}),r.isSameDay&&jsx(et,{}),jsxs(yo,{children:[jsx(go,{variant:"contained",onClick:r.closePicker,children:a("cancel")}),jsx(xo,{variant:"contained",onClick:r.apply,disabled:!r.draft[1],children:a("okay")})]})]})]})]})})]})})}var ot=Jt;function or({value:e,zone:o,format:t,...n}){let i=useMemo(()=>m(e,o,t),[e,o,t]);return jsx(a,{...n,children:i})}var tr=or;var tt=styled(y)({display:"flex",alignItems:"center",gap:"12px"});function lr({value:e,zone:o,format:t,rendered:n,tableMode:i,...p}){let a$1=useMemo(()=>n??m(e,o,t),[n,e,o,t]);return jsx(a,{...p,children:jsx(tt,{children:jsx(y,{sx:{...qa(i)&&{fontSize:"11px"}},children:a$1})})})}var Ne=lr;function cr({value:e,zone:o,hintZone:t,format:n,tableMode:i,...p$1}){let a=useMemo(()=>{if(!(!t||e==null||e===""))return b$2(o,t,e)?m(e,t):void 0},[e,o,t]);return jsxs(y,{sx:{display:"flex",gap:"8px"},children:[jsx(Ne,{value:e,zone:o,format:n,tableMode:i,...p$1}),a!==void 0&&jsx(p,{title:a,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}var mr=cr;export{ot as DateRangeCalendar,Se as ZonePicker,tr as ZonedDateCell,mr as ZonedDateHintViewer,Ne as ZonedDateViewer};
|
package/build/datetime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {k,c}from'../_chunks/chunk-BE2RKFQJ.js';export{t as UTC,D as asHostTimezone,z as asZoneRef,h as calendarDaysBetween,j as epochToInstant,m as formatInZone,k as instantToEpoch,f as isSameDayInZone,g as isSameYearInZone,B as isSameZone,o as isWholeDayRange,u as isZoneId,q as lastNDays,r as lastNMonths,x as localZone,c as offsetLabelAt,a as offsetMinutesAt,b as offsetsDifferAt,d as parseWallClock,l as plainFormats,i as toInstant,n as toInstantRange,e as toWallClock,p as toWholeDayRange,s as toWireRange,w as zoneByCountry,v as zoneById,C as zoneLabelAt,y as zoneRef,A as zoneRefByCountry}from'../_chunks/chunk-BE2RKFQJ.js';var E=(o,t,s=o[1])=>{let r=k(o[0],t),a=k(o[1],t),f=c(t,s);if(!(r===void 0||a===void 0||!f))return {from:r,to:a,offset:f}};export{E as toWirePeriod};
|
|
@@ -7,9 +7,8 @@ export interface WirePeriod {
|
|
|
7
7
|
offset: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* A placed range → the wire pair **and** the token that names its
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* one end by the difference. `undefined` for an unknown zone, like `offsetLabelAt`.
|
|
10
|
+
* A placed range → the wire pair **and** the token that names its zone. Each bound is written at its own
|
|
11
|
+
* offset, so both ends keep the picked wall clock when a window crosses a DST change; the token names the
|
|
12
|
+
* zone the request is read in. `undefined` for an unknown zone, like `toWireRange`.
|
|
14
13
|
*/
|
|
15
14
|
export declare const toWirePeriod: (range: readonly [Date, Date], zone: ZoneId, at?: Instant) => WirePeriod | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { useViewportSize } from './useViewportSize';
|
|
2
|
+
export type { ViewportSize } from './useViewportSize';
|
|
3
|
+
export { useElementSize } from './useElementSize';
|
|
4
|
+
export type { ElementSize } from './useElementSize';
|
|
5
|
+
export { useScrollState } from './useScrollState';
|
|
6
|
+
export type { ScrollState, UseScrollStateOptions } from './useScrollState';
|
|
7
|
+
export { useScrollShadow } from './useScrollShadow';
|
|
8
|
+
export type { ScrollShadow } from './useScrollShadow';
|
|
9
|
+
export { useIntersectionObserver } from './useIntersectionObserver';
|
|
10
|
+
export type { IntersectionState } from './useIntersectionObserver';
|
|
11
|
+
export { useCountdown } from './useCountdown';
|
|
12
|
+
export type { Countdown, UseCountdownOptions } from './useCountdown';
|
|
13
|
+
export { useDelayedVisibility } from './useDelayedVisibility';
|
|
14
|
+
export { useKeyDown } from './useKeyDown';
|
|
15
|
+
export type { KeyDownHandlers } from './useKeyDown';
|
|
16
|
+
export { useNetworkStatus } from './useNetworkStatus';
|
|
17
|
+
export type { NetworkStatus, UseNetworkStatusOptions } from './useNetworkStatus';
|
|
18
|
+
export { useThemeMode } from './useThemeMode';
|
|
19
|
+
export type { ThemeModeState } from './useThemeMode';
|
|
20
|
+
export { useCountMap } from './useCountMap';
|
|
21
|
+
export type { CountMap } from './useCountMap';
|
|
22
|
+
export { useCustomEventListener } from './useCustomEventListener';
|
|
23
|
+
export { useCustomEventPublisher } from './useCustomEventPublisher';
|
|
24
|
+
export { useToastController } from './useToastController';
|
|
25
|
+
export type { ToastController, ToastDismissEvent, ToastEvent, ToastRemoveEvent, ToastShowEvent, ToastVariant } from './useToastController';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'../../_chunks/chunk-2I5L7ASP.js';export{c as useCountMap,f as useCountdown,h as useCustomEventListener,g as useCustomEventPublisher,b as useDelayedVisibility,n as useElementSize,d as useIntersectionObserver,l as useKeyDown,k as useNetworkStatus,m as useScrollShadow,j as useScrollState,e as useThemeMode,i as useToastController,a as useViewportSize}from'../../_chunks/chunk-OTG5BKW6.js';import'../../_chunks/chunk-DJHXUNB6.js';import'../../_chunks/chunk-FI5H6V55.js';import'../../_chunks/chunk-LS57WE6K.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CountMap {
|
|
2
|
+
counts: Record<string, number>;
|
|
3
|
+
setCount: (key: string, value: number) => void;
|
|
4
|
+
getCount: (key: string) => number | undefined;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Keeps counts keyed by an arbitrary string.
|
|
9
|
+
*
|
|
10
|
+
* `initial` is read only on the first render; use `setCount`/`reset` afterwards.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useCountMap(initial?: Record<string, number>): CountMap;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseCountdownOptions {
|
|
2
|
+
/** Called once when the countdown reaches zero. */
|
|
3
|
+
onComplete?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface Countdown {
|
|
6
|
+
seconds: number;
|
|
7
|
+
formatted: string;
|
|
8
|
+
isRunning: boolean;
|
|
9
|
+
start: (seconds: number) => void;
|
|
10
|
+
stop: () => void;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Deadline-based countdown in seconds.
|
|
15
|
+
*
|
|
16
|
+
* Remaining time is recomputed from an absolute deadline, so a throttled
|
|
17
|
+
* background tab catches up instead of pausing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useCountdown(options?: UseCountdownOptions): Countdown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscribes to a `window` CustomEvent and spreads its `detail` into `handler`.
|
|
3
|
+
*
|
|
4
|
+
* The event contract is `detail: [...args]`. Effects only, so it is safe during
|
|
5
|
+
* server render.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCustomEventListener<TArgs extends unknown[] = unknown[]>(eventName: string, handler: (...args: TArgs) => void): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `true` immediately when `value` becomes true, and stays `true` for
|
|
3
|
+
* `delay` ms after it becomes false. Useful for tooltips and dropdowns that
|
|
4
|
+
* should disappear with a grace period.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDelayedVisibility(value: boolean, delay: number): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RefCallback } from 'react';
|
|
2
|
+
export interface ElementSize {
|
|
3
|
+
/** Border-box width in px (0 until first measured). */
|
|
4
|
+
width: number;
|
|
5
|
+
/** Border-box height in px (0 until first measured). */
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Tracks an element's border-box size via ResizeObserver.
|
|
10
|
+
*
|
|
11
|
+
* Returns a ref callback and the latest size (`{ width: 0, height: 0 }` until
|
|
12
|
+
* first measured). Safe during server render.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const [ref, { width, height }] = useElementSize()
|
|
16
|
+
* return <div ref={ref}>width: {width}</div>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function useElementSize<T extends HTMLElement = HTMLDivElement>(): [RefCallback<T>, ElementSize];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export interface IntersectionState {
|
|
3
|
+
/** `null` until the first observer callback. */
|
|
4
|
+
isIntersecting: boolean | null;
|
|
5
|
+
entry: IntersectionObserverEntry | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Observes an element's intersection with the viewport (or a root element).
|
|
9
|
+
*
|
|
10
|
+
* The ref must be attached on the first render. `isIntersecting` stays `null`
|
|
11
|
+
* until the first callback, so consumers can distinguish "not observed yet"
|
|
12
|
+
* from "not intersecting".
|
|
13
|
+
*/
|
|
14
|
+
export declare function useIntersectionObserver<T extends Element>(ref: RefObject<T>, options?: IntersectionObserverInit): IntersectionState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
export type KeyDownHandlers = Partial<Record<string, (event: KeyboardEvent<HTMLElement>) => void>>;
|
|
3
|
+
/**
|
|
4
|
+
* Returns a stable keydown handler that dispatches to the handler registered
|
|
5
|
+
* for `event.key`.
|
|
6
|
+
*
|
|
7
|
+
* Handlers own `preventDefault()`, so the hook never changes native behavior
|
|
8
|
+
* for keys you did not register.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useKeyDown(handlers: KeyDownHandlers): (event: KeyboardEvent<HTMLElement>) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface UseNetworkStatusOptions {
|
|
2
|
+
/** Endpoint used only while the browser reports offline. Defaults to `/status`. */
|
|
3
|
+
checkUrl?: string;
|
|
4
|
+
/** Poll interval while offline. Defaults to 30s. */
|
|
5
|
+
checkIntervalMs?: number;
|
|
6
|
+
/** Debounce before applying a status change. Defaults to 800ms. */
|
|
7
|
+
debounceMs?: number;
|
|
8
|
+
/** Health-check request timeout. Defaults to 5s. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface NetworkStatus {
|
|
12
|
+
isOnline: boolean;
|
|
13
|
+
isChecking: boolean;
|
|
14
|
+
error: string | null;
|
|
15
|
+
/** Runs a health check immediately. */
|
|
16
|
+
checkNow: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tracks online/offline state from the browser and an optional health endpoint.
|
|
20
|
+
*
|
|
21
|
+
* The browser's `online` event is trusted without a request. While offline, the
|
|
22
|
+
* hook polls `checkUrl` until it succeeds. Client-only; the server snapshot is
|
|
23
|
+
* offline with an explanatory error.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useNetworkStatus(options?: UseNetworkStatusOptions): NetworkStatus;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UIEvent } from 'react';
|
|
2
|
+
export interface ScrollShadow<T extends HTMLElement = HTMLElement> {
|
|
3
|
+
showShadow: boolean;
|
|
4
|
+
onScroll: (event: UIEvent<T>) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Tracks whether a scroll container should show its shadow.
|
|
8
|
+
*
|
|
9
|
+
* `showShadow` is true at the top and false once the container reaches the
|
|
10
|
+
* bottom. State updates only when the boolean changes, so scrolling does not
|
|
11
|
+
* re-render on every pixel.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useScrollShadow<T extends HTMLElement = HTMLElement>(): ScrollShadow<T>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RefObject, UIEvent } from 'react';
|
|
2
|
+
export interface UseScrollStateOptions<T extends HTMLElement = HTMLElement> {
|
|
3
|
+
/** Element to observe on mount and on resize. */
|
|
4
|
+
ref?: RefObject<T>;
|
|
5
|
+
/** Pixel tolerance for the edge flags. Defaults to 10. */
|
|
6
|
+
threshold?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ScrollState {
|
|
9
|
+
scrollTop: number;
|
|
10
|
+
scrollLeft: number;
|
|
11
|
+
scrollHeight: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
clientHeight: number;
|
|
14
|
+
clientWidth: number;
|
|
15
|
+
atTop: boolean;
|
|
16
|
+
atBottom: boolean;
|
|
17
|
+
atStart: boolean;
|
|
18
|
+
atEnd: boolean;
|
|
19
|
+
canScrollY: boolean;
|
|
20
|
+
canScrollX: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Tracks the scroll position and edge flags of a scrollable element.
|
|
24
|
+
*
|
|
25
|
+
* Pass `ref` to measure on mount, resize, and scroll, or call the returned
|
|
26
|
+
* `onScroll`/`measure` from your own handlers. State updates are skipped when
|
|
27
|
+
* nothing changed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useScrollState<T extends HTMLElement = HTMLElement>(options?: UseScrollStateOptions<T>): ScrollState & {
|
|
30
|
+
onScroll: (event: UIEvent<T>) => void;
|
|
31
|
+
measure: (element: T) => void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type ToastVariant = 'default' | 'success' | 'error' | 'loading' | 'custom';
|
|
2
|
+
export interface ToastShowEvent<Message, Options> {
|
|
3
|
+
action: 'show';
|
|
4
|
+
variant: ToastVariant;
|
|
5
|
+
message: Message;
|
|
6
|
+
options?: Options & {
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface ToastDismissEvent {
|
|
11
|
+
action: 'dismiss';
|
|
12
|
+
variant: 'dismiss';
|
|
13
|
+
toastId?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastRemoveEvent {
|
|
16
|
+
action: 'remove';
|
|
17
|
+
variant: 'remove';
|
|
18
|
+
toastId?: string;
|
|
19
|
+
}
|
|
20
|
+
export type ToastEvent<Message, Options> = ToastShowEvent<Message, Options> | ToastDismissEvent | ToastRemoveEvent;
|
|
21
|
+
type WithId<Options> = Options & {
|
|
22
|
+
id?: string;
|
|
23
|
+
};
|
|
24
|
+
export interface ToastController<Message, Options> {
|
|
25
|
+
show: (message: Message, options?: WithId<Options>) => string;
|
|
26
|
+
success: (message: Message, options?: WithId<Options>) => string;
|
|
27
|
+
error: (message: Message, options?: WithId<Options>) => string;
|
|
28
|
+
loading: (message: Message, options?: WithId<Options>) => string;
|
|
29
|
+
custom: (message: Message, options?: WithId<Options>) => string;
|
|
30
|
+
dismiss: (toastId?: string) => void;
|
|
31
|
+
remove: (toastId?: string) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Toast controller over an injected dispatcher.
|
|
35
|
+
*
|
|
36
|
+
* The hook owns ids, variants, and dismiss/remove semantics; the host supplies
|
|
37
|
+
* how a toast event is delivered. No toast implementation is imported here.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useToastController<Message = unknown, Options = Record<string, unknown>>(dispatch: (event: ToastEvent<Message, Options>) => void): ToastController<Message, Options>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ViewportSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Tracks the browser viewport size.
|
|
7
|
+
*
|
|
8
|
+
* SSR-safe: returns `{ width: 0, height: 0 }` on the server. Use CSS media
|
|
9
|
+
* queries for layout decisions that must be correct before hydration.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useViewportSize(): ViewportSize;
|
package/build/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as useAppEventListener,i as useAppEventPublisher,h as useAppsInfo,c as useBadgesCount,o as useColumnFiltersGate,g as useCountdown,b as useDelayToSetValue,r as useElementSizeObserver,p as useFilterKeyDown,n as useNetworkState,q as useScrollWithShadow,m as useScrolledTo,k as useSelectedMerchantDetails,e as useStickyHeaderShadow,d as useTableViews,f as useThemeMode,l as useToast,a as useWindowDimensions}from'../_chunks/chunk-
|
|
1
|
+
export{j as useAppEventListener,i as useAppEventPublisher,h as useAppsInfo,c as useBadgesCount,o as useColumnFiltersGate,g as useCountdown,b as useDelayToSetValue,r as useElementSizeObserver,p as useFilterKeyDown,n as useNetworkState,q as useScrollWithShadow,m as useScrolledTo,k as useSelectedMerchantDetails,e as useStickyHeaderShadow,d as useTableViews,f as useThemeMode,l as useToast,a as useWindowDimensions}from'../_chunks/chunk-CGGZ367Q.js';import'../_chunks/chunk-OTG5BKW6.js';import'../_chunks/chunk-2V7P76GA.js';import'../_chunks/chunk-DJHXUNB6.js';import'../_chunks/chunk-FI5H6V55.js';import'../_chunks/chunk-LS57WE6K.js';
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { AppEventMap } from '../types';
|
|
1
|
+
import type { AppEventMap } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `useCustomEventListener` from `@tap-payments/os-micro-frontend-shared/hooks/core`.
|
|
4
|
+
*/
|
|
2
5
|
export declare function useAppEventListener<K extends keyof AppEventMap>(eventName: K, handler: AppEventMap[K]): void;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { AppEventMap } from '../types';
|
|
1
|
+
import type { AppEventMap } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `useCustomEventPublisher` from `@tap-payments/os-micro-frontend-shared/hooks/core`.
|
|
4
|
+
*/
|
|
2
5
|
export declare function useAppEventPublisher<K extends keyof AppEventMap>(eventName: K): (...args: Parameters<AppEventMap[K]>) => void;
|
|
@@ -8,6 +8,9 @@ interface GetFunction {
|
|
|
8
8
|
serviceCode: string;
|
|
9
9
|
functionCode: string;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Legacy Tap app/service/function lookup; keep domain lookups in the owning MFE.
|
|
13
|
+
*/
|
|
11
14
|
export declare const useAppsInfo: (segmentApps: UserApp[]) => {
|
|
12
15
|
getAppInfo: (appCode: string) => UserApp | undefined;
|
|
13
16
|
getServiceInfo: ({ appCode, serviceCode }: GetService) => AppService | undefined;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { ColumnFiltersGateConfig, IColumnProps } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param columnFilters - Your table filter values object.
|
|
7
|
-
* @param rawColumns - All columns, including filters you may hide at first.
|
|
8
|
-
* @param config - Required keys and which filters stay hidden until then (`ColumnFiltersGateConfig`).
|
|
9
|
-
* @returns An object with `columns` to pass to your table.
|
|
3
|
+
* @deprecated Use the pure helpers in `@utils/columnFiltersGate`
|
|
4
|
+
* (`applyColumnFiltersGate`, `hasActiveColumnFilters`) with your own table wiring.
|
|
10
5
|
*/
|
|
11
6
|
export declare const useColumnFiltersGate: <R>(columnFilters: Record<string, unknown> | undefined, rawColumns: IColumnProps<R>[], config: ColumnFiltersGateConfig) => {
|
|
12
7
|
columns: IColumnProps<R>[];
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import type { RefCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
width: number;
|
|
5
|
-
/** Border-box height in px (0 until first measured). */
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
2
|
+
import type { ElementSize } from './core/useElementSize';
|
|
3
|
+
export type { ElementSize };
|
|
8
4
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Returns a ref to attach and the latest size (`{ width: 0, height: 0 }`
|
|
11
|
-
* until first measured).
|
|
12
|
-
*
|
|
13
|
-
* ```tsx
|
|
14
|
-
* const [elementRef, { width, height }] = useElementSizeObserver()
|
|
15
|
-
* return <div ref={elementRef}>width: {width}</div>
|
|
16
|
-
* ```
|
|
5
|
+
* @deprecated Use `useElementSize` from `@tap-payments/os-micro-frontend-shared/hooks/core`.
|
|
17
6
|
*/
|
|
18
7
|
export declare function useElementSizeObserver<T extends HTMLElement = HTMLDivElement>(): [RefCallback<T>, ElementSize];
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { KeyboardEvent, MouseEvent } from 'react';
|
|
1
|
+
import type { KeyboardEvent, MouseEvent } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* - Enter → calls `confirmFn` then closes the dropdown (also prevents default browser behavior)
|
|
5
|
-
* - Escape → closes the dropdown without confirming
|
|
6
|
-
*
|
|
7
|
-
* Attach to the root element of any filter component.
|
|
3
|
+
* @deprecated Use `useKeyDown` from `@tap-payments/os-micro-frontend-shared/hooks/core`.
|
|
8
4
|
*/
|
|
9
|
-
export declare function useFilterKeyDown(confirmFn: () => void, onCloseDropdown: (e: MouseEvent<HTMLElement>) => void): (
|
|
5
|
+
export declare function useFilterKeyDown(confirmFn: () => void, onCloseDropdown: (e: MouseEvent<HTMLElement>) => void): (event: KeyboardEvent<HTMLElement>) => void;
|