@tap-payments/os-micro-frontend-shared 0.1.401 → 0.1.402
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/components/TableCells/CustomCells/DueDateCell/DueDateCell.js +7 -8
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +5 -0
- package/build/components/TableCells/CustomCells/DueDateCell/style.js +7 -0
- package/build/constants/assets.d.ts +3 -0
- package/build/constants/assets.js +3 -0
- package/package.json +1 -1
|
@@ -11,16 +11,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
-
import
|
|
15
|
-
import Tooltip from '../../../
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { buildDueMeta, buildExpiryMeta } from './utils';
|
|
14
|
+
import dayjs from 'dayjs';
|
|
15
|
+
import { TableCell, Tooltip, RightLeftExpandingCenterChip } from '../../../index.js';
|
|
16
|
+
import { formatDate } from './utils';
|
|
17
|
+
import { TextLabel } from './style';
|
|
19
18
|
function DueDateCell(_a) {
|
|
20
19
|
var { dueDate, expiryDate } = _a, props = __rest(_a, ["dueDate", "expiryDate"]);
|
|
21
|
-
const dueMeta = useMemo(() =>
|
|
22
|
-
const expiryMeta = useMemo(() =>
|
|
23
|
-
const renderIcon = (meta) => (_jsx(Tooltip, Object.assign({ title: meta.
|
|
20
|
+
const dueMeta = useMemo(() => ({ label: formatDate(dayjs(dueDate).valueOf()), tooltip: 'Due Date' }), [dueDate]);
|
|
21
|
+
const expiryMeta = useMemo(() => ({ label: formatDate(dayjs(expiryDate).valueOf()), tooltip: 'Expiry Date' }), [expiryDate]);
|
|
22
|
+
const renderIcon = (meta) => (_jsx(Tooltip, Object.assign({ title: meta.tooltip }, { children: _jsx(TextLabel, { children: meta.label }) })));
|
|
24
23
|
const centerIcon = useMemo(() => (dueMeta ? renderIcon(dueMeta) : expiryMeta ? renderIcon(expiryMeta) : null), [dueMeta, expiryMeta]);
|
|
25
24
|
const rightIcons = useMemo(() => (expiryMeta && dueMeta ? [renderIcon(expiryMeta)] : []), [dueMeta, expiryMeta]);
|
|
26
25
|
if (!dueMeta && !expiryMeta)
|
|
@@ -267,3 +267,8 @@ export declare const DueDateCellContainer: import("@emotion/styled").StyledCompo
|
|
|
267
267
|
export declare const DateIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
268
268
|
export declare const ReminderTextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
269
269
|
export declare const ExpiredTextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
270
|
+
export declare const TextLabel: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
271
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
272
|
+
}, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "classes" | "align" | "className" | "style" | "children" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
|
|
273
|
+
component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
274
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Text from '../../../Text';
|
|
1
2
|
import { styled } from '@mui/material';
|
|
2
3
|
import { motion } from 'framer-motion';
|
|
3
4
|
export const DueDateCellContainer = styled(motion.div)(({ theme, background }) => ({
|
|
@@ -34,3 +35,9 @@ export const ExpiredTextLabel = styled('div')(({ theme }) => ({
|
|
|
34
35
|
padding: '2px 0',
|
|
35
36
|
color: theme.palette.error.main,
|
|
36
37
|
}));
|
|
38
|
+
export const TextLabel = styled(Text)(({ theme }) => ({
|
|
39
|
+
fontSize: '11px',
|
|
40
|
+
fontWeight: 500,
|
|
41
|
+
color: '#000',
|
|
42
|
+
cursor: 'default',
|
|
43
|
+
}));
|
|
@@ -66,6 +66,9 @@ export declare const desktopIcon: string;
|
|
|
66
66
|
export declare const mobileIcon: string;
|
|
67
67
|
export declare const tabletIcon: string;
|
|
68
68
|
export declare const invoiceIcon: string;
|
|
69
|
+
export declare const cancelledInvoiceIcon: string;
|
|
70
|
+
export declare const expiredInvoiceIcon: string;
|
|
71
|
+
export declare const invoiceNumberIcon: string;
|
|
69
72
|
export declare const columnIcon: string;
|
|
70
73
|
export declare const sortAzIcon: string;
|
|
71
74
|
export declare const sortZaIcon: string;
|
|
@@ -71,6 +71,9 @@ export const desktopIcon = `${lightUrl}/desktop.svg`;
|
|
|
71
71
|
export const mobileIcon = `${lightUrl}/mobile.svg`;
|
|
72
72
|
export const tabletIcon = `${lightUrl}/tablet.svg`;
|
|
73
73
|
export const invoiceIcon = `${lightUrl}/invoice.svg`;
|
|
74
|
+
export const cancelledInvoiceIcon = `${lightUrl}/cancelledInvoiceIcon.svg`;
|
|
75
|
+
export const expiredInvoiceIcon = `${lightUrl}/expiredInvoiceIcon.svg`;
|
|
76
|
+
export const invoiceNumberIcon = `${lightUrl}/invoiceNumberIcon.svg`;
|
|
74
77
|
export const columnIcon = `${lightUrl}/column.svg`;
|
|
75
78
|
export const sortAzIcon = `${lightUrl}/sortAz.svg`;
|
|
76
79
|
export const sortZaIcon = `${lightUrl}/sortZa.svg`;
|
package/package.json
CHANGED