@js-smart/react-kit 5.18.1 → 5.20.0
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/index.d.ts +2 -1
- package/index.js +18 -18
- package/index.mjs +7444 -2448
- package/lib/components/DismissibleAlert.d.ts +1 -0
- package/lib/components/NextLink.d.ts +1 -0
- package/lib/components/OpenInNewIconLink.d.ts +1 -0
- package/lib/components/buttons/CancelButton.d.ts +5 -4
- package/lib/components/buttons/DeleteButton.d.ts +5 -4
- package/lib/components/buttons/EditIconButton.d.ts +1 -0
- package/lib/components/buttons/ExcelButton.d.ts +1 -0
- package/lib/components/buttons/GoBackButton.d.ts +1 -0
- package/lib/components/buttons/HistoryButton.d.ts +1 -0
- package/lib/components/buttons/LoadingSuccessButton.d.ts +5 -4
- package/lib/components/buttons/ManageButton.d.ts +1 -0
- package/lib/components/buttons/SuccessButton.d.ts +1 -0
- package/lib/constants/AppConstants.d.ts +14 -1
- package/lib/utils/DateUtil.d.ts +75 -0
- package/package.json +1 -1
- package/lib/utils/DateUtils.d.ts +0 -22
|
@@ -12,6 +12,7 @@ type DismissibleAlertProps = {
|
|
|
12
12
|
dismissible?: boolean;
|
|
13
13
|
dismissOnTimeOut?: boolean;
|
|
14
14
|
dismissTimeOut?: number;
|
|
15
|
+
ariaLabel?: string;
|
|
15
16
|
};
|
|
16
17
|
export declare function DismissibleAlert(props: Readonly<DismissibleAlertProps>): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Reusable Success Button component properties
|
|
5
5
|
*
|
|
@@ -12,11 +12,12 @@ interface CancelButtonProps {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
dataCy?: string;
|
|
14
14
|
sx?: SxProps<Theme>;
|
|
15
|
-
type?:
|
|
16
|
-
variant?:
|
|
17
|
-
color?:
|
|
15
|
+
type?: 'button' | 'submit' | 'reset';
|
|
16
|
+
variant?: 'text' | 'outlined' | 'contained';
|
|
17
|
+
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
18
18
|
onClick: () => void;
|
|
19
19
|
startIcon?: React.ReactNode;
|
|
20
|
+
ariaLabel?: string;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Reusable Cancel Button component
|
|
@@ -3,14 +3,15 @@ interface DeleteButtonProps {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
label?: string;
|
|
5
5
|
loadingLabel?: string;
|
|
6
|
-
loadingPosition?:
|
|
7
|
-
type?:
|
|
8
|
-
variant?:
|
|
9
|
-
color?:
|
|
6
|
+
loadingPosition?: 'start' | 'end' | 'center';
|
|
7
|
+
type?: 'button' | 'submit' | 'reset' | undefined;
|
|
8
|
+
variant?: 'text' | 'outlined' | 'contained';
|
|
9
|
+
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
10
10
|
name?: string;
|
|
11
11
|
dataCy?: string;
|
|
12
12
|
startIcon?: React.ReactNode;
|
|
13
13
|
onClick: () => void;
|
|
14
|
+
ariaLabel?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare function DeleteButton(props: DeleteButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -3,6 +3,7 @@ interface EditIconButtonProps {
|
|
|
3
3
|
tooltipTitle: string;
|
|
4
4
|
onClick: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
5
|
color?: 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
6
|
+
ariaLabel?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function EditIconButton(props: Readonly<EditIconButtonProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -5,6 +5,7 @@ interface GoBackButtonProps {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
navigate: NavigateFunction;
|
|
7
7
|
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
8
|
+
ariaLabel?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare function GoBackButton(props: GoBackButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -17,6 +17,7 @@ interface HistoryButtonProps {
|
|
|
17
17
|
startIcon?: React.ReactNode;
|
|
18
18
|
variant?: 'text' | 'outlined' | 'contained';
|
|
19
19
|
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
20
|
+
ariaLabel?: string;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Reusable History Button component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Reusable Success Button component properties
|
|
5
5
|
*
|
|
@@ -8,15 +8,16 @@ import { SxProps, Theme } from '@mui/material';
|
|
|
8
8
|
*/
|
|
9
9
|
interface Props {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
type?:
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
12
|
name?: string;
|
|
13
13
|
loading: boolean;
|
|
14
14
|
dataCy?: string;
|
|
15
15
|
startIcon?: React.ReactNode;
|
|
16
16
|
sx?: SxProps<Theme>;
|
|
17
17
|
onClick?: () => void;
|
|
18
|
-
variant?:
|
|
19
|
-
color?:
|
|
18
|
+
variant?: 'text' | 'outlined' | 'contained';
|
|
19
|
+
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
20
|
+
ariaLabel?: string;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Reusable Success Loading Button
|
|
@@ -9,6 +9,7 @@ interface ManageButtonProps {
|
|
|
9
9
|
startIcon?: React.ReactNode;
|
|
10
10
|
onClick: () => void;
|
|
11
11
|
children?: React.ReactNode;
|
|
12
|
+
ariaLabel?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare function ManageButton(props: ManageButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -17,6 +17,7 @@ interface SuccessButtonProps {
|
|
|
17
17
|
startIcon?: React.ReactNode;
|
|
18
18
|
variant?: "text" | "outlined" | "contained";
|
|
19
19
|
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
20
|
+
ariaLabel?: string;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Reusable Success Button component
|
|
@@ -10,6 +10,19 @@ export declare enum SystemConfig {
|
|
|
10
10
|
SYSTEM_DATE_FORMAT = "MM/dd/yyyy",
|
|
11
11
|
SYSTEM_DATE_TIME_FORMAT = "MM/dd/yyyy hh:mm:ss a",
|
|
12
12
|
ISO_DATE_FORMAT = "yyyy-MM-dd",
|
|
13
|
-
SYSTEM_COOKIE_TIMEOUT_HOURS = 24,
|
|
14
13
|
SYSTEM_COOKIE_TIMEOUT_MILLI_SECONDS = 3600000
|
|
15
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Temporal Date Format Options
|
|
17
|
+
*
|
|
18
|
+
* @author Pavan Kumar Jadda
|
|
19
|
+
* @since 1.10.2
|
|
20
|
+
*/
|
|
21
|
+
export declare const TEMPORAL_DATE_FORMAT: Intl.DateTimeFormatOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Temporal Date Time Format Options
|
|
24
|
+
*
|
|
25
|
+
* @author Pavan Kumar Jadda
|
|
26
|
+
* @since 1.10.2
|
|
27
|
+
*/
|
|
28
|
+
export declare const TEMPORAL_DATE_TIME_FORMAT: Intl.DateTimeFormatOptions;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format date using Temporal API to App Date Time Format
|
|
3
|
+
*
|
|
4
|
+
* @author Pavan Kumar Jadda
|
|
5
|
+
* @since 1.10.2
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatToAppDateTime: (date: Date | string | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Format date using Temporal API to App Date Format
|
|
10
|
+
*
|
|
11
|
+
* @author Pavan Kumar Jadda
|
|
12
|
+
* @since 1.10.2
|
|
13
|
+
*/
|
|
14
|
+
export declare const formatToAppDate: (date: Date | string | undefined) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Format ISO formatted date to App Date Format
|
|
17
|
+
*
|
|
18
|
+
* @param date - The ISO formatted date to format
|
|
19
|
+
* @returns The formatted date
|
|
20
|
+
*
|
|
21
|
+
* @author Pavan Kumar Jadda
|
|
22
|
+
* @since 1.10.2
|
|
23
|
+
*/
|
|
24
|
+
export declare const formatIsoToAppDate: (date: string | undefined) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Format old date to ISO format date string (YYYY-MM-DD)
|
|
27
|
+
*
|
|
28
|
+
* @param date - The old date to format
|
|
29
|
+
* @returns The formatted date
|
|
30
|
+
*
|
|
31
|
+
* @author Pavan Kumar Jadda
|
|
32
|
+
* @since 1.10.2
|
|
33
|
+
*/
|
|
34
|
+
export declare const formatOldDateToIsoString: (date: Date | string | undefined | null) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Format old date to ISO format date string (YYYY-MM-DD)
|
|
37
|
+
*
|
|
38
|
+
* @param date - The old date to format
|
|
39
|
+
* @returns The formatted date
|
|
40
|
+
*
|
|
41
|
+
* @author Pavan Kumar Jadda
|
|
42
|
+
* @since 0.2.30
|
|
43
|
+
*/
|
|
44
|
+
export declare const formatOldDateToIsoDate: (date: Date | string | undefined) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Parse ISO formatted date to old date object
|
|
47
|
+
*
|
|
48
|
+
* @param date - The ISO formatted date to parse
|
|
49
|
+
* @returns The parsed date
|
|
50
|
+
*
|
|
51
|
+
* @author Pavan Kumar Jadda
|
|
52
|
+
* @since 1.10.2
|
|
53
|
+
*/
|
|
54
|
+
export declare const parseIsoDate: (date: string | undefined | null) => Date | null;
|
|
55
|
+
/**
|
|
56
|
+
* Format Unix time to old date object
|
|
57
|
+
*
|
|
58
|
+
* @param date - The Unix time to format
|
|
59
|
+
* @returns The formatted date
|
|
60
|
+
*
|
|
61
|
+
* @author Pavan Kumar Jadda
|
|
62
|
+
* @since 1.10.2
|
|
63
|
+
*/
|
|
64
|
+
export declare const formatUnixTimeToOldDate: (date: number | string | undefined) => Date | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Check if date1 is after date2
|
|
67
|
+
*
|
|
68
|
+
* @param date1 - The first date to compare
|
|
69
|
+
* @param date2 - The second date to compare
|
|
70
|
+
* @returns True if date1 is after date2, false otherwise
|
|
71
|
+
*
|
|
72
|
+
* @author Pavan Kumar Jadda
|
|
73
|
+
* @since 1.10.2
|
|
74
|
+
*/
|
|
75
|
+
export declare const isAfter: (date1: Date | string | undefined, date2: Date | string | undefined) => boolean;
|
package/package.json
CHANGED
package/lib/utils/DateUtils.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sets Cookie expiration to 24 hours. By default, server sets 60 minutes expiration but after each API request it extends to another 60 minutes. In client side set 24 hours as expiration date,
|
|
3
|
-
* if the user hasn't refreshed web page in 60 minutes, they would get HTTP 401 isError and redirected to login page. And redirect URL will be stored in cookie
|
|
4
|
-
*
|
|
5
|
-
* @author Pavan Kumar Jadda
|
|
6
|
-
* @since 0.2.30
|
|
7
|
-
*/
|
|
8
|
-
export declare const setCookieExpirationDate: () => Date;
|
|
9
|
-
/**
|
|
10
|
-
* Convert String format browser Date Time to ISO Date
|
|
11
|
-
*
|
|
12
|
-
* @author Pavan Kumar Jadda
|
|
13
|
-
* @since 0.2.30
|
|
14
|
-
*/
|
|
15
|
-
export declare const convertToIsoDate: (currentDateTime: string) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Convert String format browser Date Time to ISO Date
|
|
18
|
-
*
|
|
19
|
-
* @author Pavan Kumar Jadda
|
|
20
|
-
* @since 0.2.30
|
|
21
|
-
*/
|
|
22
|
-
export declare const formatDate: (date: string | undefined, newFormat: string) => string;
|