gotrip-fx-transaction-form 1.0.95 → 1.0.96

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -0,0 +1,8 @@
1
+ import { SendEmailData } from '../../hooks/useEmailHistory';
2
+ interface SendEmailModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onSendEmail: (data: SendEmailData) => Promise<void>;
6
+ }
7
+ export declare const SendEmailModal: ({ isOpen, onClose, onSendEmail }: SendEmailModalProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -136,4 +136,8 @@ export declare const ApiUrls: {
136
136
  esimHandlers: {
137
137
  list: string;
138
138
  };
139
+ emailHandlers: {
140
+ list: string;
141
+ send: string;
142
+ };
139
143
  };
@@ -1,2 +1,4 @@
1
1
  export declare const vietnamPhoneRegex: RegExp;
2
+ export declare const vietnamLocalPhoneRegex: RegExp;
3
+ export declare const vietnamInternationalPhoneRegex: RegExp;
2
4
  export declare const idNumberRegex: RegExp;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { PhoneValidationOptions } from '../../hooks/usePhoneValidation';
3
+ export interface PhoneInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
+ validationOptions?: PhoneValidationOptions;
5
+ onPhoneChange?: (phone: string, isValid: boolean, errorMessage?: string) => void;
6
+ formatOnBlur?: boolean;
7
+ normalizeOnChange?: boolean;
8
+ }
9
+ export declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,25 @@
1
+ import { IEmailHistory } from '../types/response.dto';
2
+ export interface SendEmailData {
3
+ title: string;
4
+ content: string;
5
+ sendMethod: 'group' | 'email';
6
+ groupType?: string;
7
+ to: string;
8
+ cc?: string;
9
+ bcc?: string;
10
+ }
11
+ type Props = {
12
+ defaultLimit?: number;
13
+ };
14
+ export declare const useEmailHistory: ({ defaultLimit }?: Props) => {
15
+ emailHistories: IEmailHistory[];
16
+ total: number;
17
+ loading: boolean;
18
+ page: number;
19
+ limit: number;
20
+ refetchData: () => void;
21
+ sendEmail: (data: SendEmailData) => Promise<void>;
22
+ setPage: import('react').Dispatch<import('react').SetStateAction<number>>;
23
+ setLimit: (newLimit: number) => void;
24
+ };
25
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface PhoneValidationOptions {
2
+ allowInternational?: boolean;
3
+ allowLocal?: boolean;
4
+ allow84Format?: boolean;
5
+ required?: boolean;
6
+ customMessage?: string;
7
+ }
8
+ export declare const usePhoneValidation: (options?: PhoneValidationOptions) => {
9
+ validatePhone: (phone: string) => string | undefined;
10
+ normalizePhone: (phone: string, format?: "local" | "international") => string;
11
+ formatPhone: (phone: string) => string;
12
+ isValidVietnamesePhone: (phone: string) => boolean;
13
+ isValidVietnameseLocalPhone: (phone: string) => boolean;
14
+ isValidVietnameseInternationalPhone: (phone: string) => boolean;
15
+ };
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ showLayout?: boolean;
3
+ defaultLimit?: number;
4
+ };
5
+ export declare const EmailHistoryListing: ({ showLayout, defaultLimit }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -394,4 +394,14 @@ export declare enum EDepartmentType {
394
394
  DEPARTMENT = "department",
395
395
  AGENT = "agent"
396
396
  }
397
+ export interface IEmailHistory {
398
+ id: number;
399
+ email: string;
400
+ title: string;
401
+ content: string;
402
+ settings: Record<string, any>;
403
+ response: Record<string, any>;
404
+ createdAt: string;
405
+ updatedAt: string;
406
+ }
397
407
  export {};
@@ -1,9 +1,15 @@
1
+ /**
2
+ * Removes all special characters and spaces except digits and + from phone number
3
+ * @param phone The phone number to clean
4
+ * @returns The cleaned phone number
5
+ */
6
+ export declare const cleanPhoneNumber: (phone: string) => string;
1
7
  /**
2
8
  * Converts a phone number to Vietnamese local format (starting with 0)
3
9
  * Examples:
4
- * - "+84912345678" -> "0912345678"
5
- * - "84912345678" -> "0912345678"
6
- * - "0912345678" -> "0912345678" (remains unchanged)
10
+ * - "+84 912 345 678" -> "0912 345 678"
11
+ * - "84 912 345 678" -> "0912 345 678"
12
+ * - "0912 345 678" -> "0912 345 678" (remains unchanged)
7
13
  * @param phone The phone number to convert
8
14
  * @returns The converted phone number in local format
9
15
  */
@@ -11,11 +17,35 @@ export declare const toLocalPhoneNumber: (phone: string) => string;
11
17
  /**
12
18
  * Converts a phone number to international format (starting with +84)
13
19
  * Examples:
14
- * - "0912345678" -> "+84912345678"
15
- * - "912345678" -> "+84912345678"
16
- * - "+84912345678" -> "+84912345678" (remains unchanged)
17
- * - "84912345678" -> "+84912345678"
20
+ * - "0912 345 678" -> "+84 912 345 678"
21
+ * - "912 345 678" -> "+84 912 345 678"
22
+ * - "+84 912 345 678" -> "+84 912 345 678" (remains unchanged)
23
+ * - "84 912 345 678" -> "+84 912 345 678"
18
24
  * @param phone The phone number to convert
19
25
  * @returns The converted phone number in international format
20
26
  */
21
27
  export declare const toInternationalPhoneNumber: (phone: string) => string;
28
+ /**
29
+ * Validates if a phone number is a valid Vietnamese phone number
30
+ * @param phone The phone number to validate
31
+ * @returns true if valid, false otherwise
32
+ */
33
+ export declare const isValidVietnamesePhone: (phone: string) => boolean;
34
+ /**
35
+ * Validates if a phone number is a valid Vietnamese local phone number (starts with 0)
36
+ * @param phone The phone number to validate
37
+ * @returns true if valid, false otherwise
38
+ */
39
+ export declare const isValidVietnameseLocalPhone: (phone: string) => boolean;
40
+ /**
41
+ * Validates if a phone number is a valid Vietnamese international phone number (starts with +84)
42
+ * @param phone The phone number to validate
43
+ * @returns true if valid, false otherwise
44
+ */
45
+ export declare const isValidVietnameseInternationalPhone: (phone: string) => boolean;
46
+ /**
47
+ * Formats a phone number for display (adds spaces for better readability)
48
+ * @param phone The phone number to format
49
+ * @returns The formatted phone number
50
+ */
51
+ export declare const formatPhoneForDisplay: (phone: string) => string;