tp-react-elements-dev 1.12.1 → 1.12.3

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.
@@ -2,10 +2,60 @@ export declare const handleDownloadReactTableDataExcel: (fileName: string, rowDa
2
2
  export declare function getUsernameFromEmail(email: string): string;
3
3
  export declare function getInitials(name: string): string;
4
4
  export declare function findMenuHierarchy(menuData: any[], currentUrl: string, URLProjectNameWithSlash: string): any;
5
- export declare const getDesiredDate: (daysToAdd?: number, baseDate?: string | null) => string;
6
- export declare function calculateTotalArrayValueTotal(array: any[], key: string): any;
7
- export declare function CheckIsDateIsBefore(dateStr1: string, dateStr2: string): boolean;
5
+ /**
6
+ * Calculates a date by adding/subtracting days from today or a base date
7
+ * @param dayOffset - Days to add (positive) or subtract (negative) (default: 0)
8
+ * @param baseDate - Base date in DD/MM/YYYY format (default: today)
9
+ * @returns Formatted date string in DD/MM/YYYY format
10
+ */
11
+ export declare const getDesiredDate: (dayOffset?: number, baseDate?: string | null) => string;
12
+ /**
13
+ * Calculates sum of numeric values for a specific property across array objects
14
+ * @param array - Array of objects to sum
15
+ * @param key - Property name to sum
16
+ * @returns Total sum of numeric values
17
+ */
18
+ export declare function calculateTotalArrayValueTotal<T extends Record<string, any>>(array: T[], key: keyof T): number;
19
+ /**
20
+ * Checks if first date comes before second date
21
+ * @param dateStr1 - First date in DD/MM/YYYY format
22
+ * @param dateStr2 - Second date in DD/MM/YYYY format
23
+ * @returns True if dateStr1 is before dateStr2
24
+ */
25
+ export declare function checkIsDateIsBefore(dateStr1: string, dateStr2: string): boolean;
26
+ /**
27
+ * Lightens a hex color by a specified percentage
28
+ * @param color - Hex color string (with or without #)
29
+ * @param percent - Percentage to lighten (0-100)
30
+ * @returns Lightened hex color string
31
+ */
8
32
  export declare function lightenColor(color: string, percent: number): string;
9
- export declare function getFormattedDate(offset?: number): string;
33
+ /**
34
+ * Gets formatted date with optional day offset
35
+ * @param dayOffset - Days to add (positive) or subtract (negative) from today (default: 0)
36
+ * @returns Date string in DD/MM/YYYY format
37
+ */
38
+ export declare function getFormattedDate(dayOffset?: number): string;
39
+ /**
40
+ * Encrypts text or objects using AES encryption and Base64 encoding
41
+ * @param text - String to encrypt (objects will be JSON.stringify'd)
42
+ * @param SECRET_KEY - Secret key for encryption
43
+ * @returns Base64 encoded encrypted string
44
+ * @example
45
+ * ```typescript
46
+ * const encrypted = encryptText("Hello World", "myKey");
47
+ * const encryptedObj = encryptText({name: "John"}, "myKey");
48
+ * ```
49
+ */
10
50
  export declare const encryptText: (text: string, SECRET_KEY: string) => string;
51
+ /**
52
+ * Decrypts Base64 encoded AES encrypted text back to original string
53
+ * @param ciphertext - Base64 encoded encrypted string from encryptText
54
+ * @param SECRET_KEY - Same secret key used for encryption
55
+ * @returns Original decrypted text
56
+ * @example
57
+ * ```typescript
58
+ * const decrypted = decryptText(encryptedString, "myKey");
59
+ * ```
60
+ */
11
61
  export declare const decryptText: (ciphertext: string, SECRET_KEY: string) => string;
@@ -1,6 +1,5 @@
1
1
  import { useForm } from "react-hook-form";
2
2
  import { yupResolver } from "@hookform/resolvers/yup";
3
- import { calculateTotalArrayValueTotal, CheckIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor } from "./Utilities/Constants/FunctionConstants";
4
3
  export { default as RenderForm } from "./components/Form/FormRenderWrapper";
5
4
  export { default as useFormValidatingContext } from "./components/Form/FormConstants";
6
5
  export { default as DeleteField } from "./components/DeleteComponent/DeleteField";
@@ -32,9 +31,12 @@ export * as IdleTimer from "react-idle-timer";
32
31
  export { default as CacheBuster } from "react-cache-buster";
33
32
  export { default as DatePicker } from "react-datepicker";
34
33
  export * from "@mui/x-date-pickers";
35
- export * as ReactRedux from "react-redux";
36
- export * as ReduxToolkit from "@reduxjs/toolkit";
37
- export * as ReduxPersist from "redux-persist";
38
- export * as ReactQuery from "@tanstack/react-query";
39
- export * as RouterDom from "react-router-dom";
40
- export { handleDownloadReactTableDataExcel, getUsernameFromEmail, getInitials, findMenuHierarchy, getDesiredDate, calculateTotalArrayValueTotal, CheckIsDateIsBefore, lightenColor, getFormattedDate, };
34
+ export { useDispatch, useSelector, useStore, Provider } from "react-redux";
35
+ export type { ProviderProps } from "react-redux";
36
+ export type { TypedUseSelectorHook } from "react-redux";
37
+ export * from "@reduxjs/toolkit";
38
+ export * from "redux-persist";
39
+ export * from "@tanstack/react-query";
40
+ export { BrowserRouter, Routes, Route, Navigate, NavLink, Outlet, useNavigate, useParams, useLocation, useSearchParams, createBrowserRouter, RouterProvider, Link as RouterLink } from "react-router-dom";
41
+ export type { LinkProps as RouterLinkProps } from "react-router-dom";
42
+ export * from './Utilities/Constants/FunctionConstants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tp-react-elements-dev",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
4
4
  "main": "dist/index.js",
5
5
  "private": false,
6
6
  "types": "dist/index.d.ts",
@@ -9,6 +9,17 @@
9
9
  "dist/*.css",
10
10
  "dist/**/*.d.ts"
11
11
  ],
12
+ "exports": {
13
+ ".": "./index.js",
14
+ "./react-router-dom": "./react-router-dom.js",
15
+ "./react-redux": "./react-redux.js",
16
+ "./@reduxjs/toolkit": "./@reduxjs/toolkit.js",
17
+ "./redux-persist": "./redux-persist.js",
18
+ "./@tanstack/react-query": "./@tanstack/react-query",
19
+ "./material-react-table": "./material-react-table",
20
+ "./@mui/material": "./@mui/material",
21
+ "./yup": "./yup"
22
+ },
12
23
  "dependencies": {
13
24
  "@emotion/react": "^11.14.0",
14
25
  "@emotion/styled": "^11.14.1",