@atomsolution/sdk-merchant 1.0.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/README.md +93 -0
- package/dist/App.d.ts +3 -0
- package/dist/assets/locales/en/common.json.d.ts +18 -0
- package/dist/assets/locales/en/digistore-id.json.d.ts +32 -0
- package/dist/assets/locales/en/download-sample.json.d.ts +59 -0
- package/dist/assets/locales/en/file.json.d.ts +48 -0
- package/dist/assets/locales/en/form.json.d.ts +85 -0
- package/dist/assets/locales/en/merchant-batch-create-form.json.d.ts +92 -0
- package/dist/assets/locales/en/table.json.d.ts +36 -0
- package/dist/assets/locales/vi/common.json.d.ts +18 -0
- package/dist/assets/locales/vi/digistore-id.json.d.ts +32 -0
- package/dist/assets/locales/vi/download-sample.json.d.ts +59 -0
- package/dist/assets/locales/vi/file.json.d.ts +48 -0
- package/dist/assets/locales/vi/form.json.d.ts +85 -0
- package/dist/assets/locales/vi/merchant-batch-create-form.json.d.ts +92 -0
- package/dist/assets/locales/vi/table.json.d.ts +35 -0
- package/dist/bvbLogo.png +0 -0
- package/dist/components/MerchantBatchCreateForm/DownloadSampleFile.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/FileUpload/fileUploadButton.d.ts +6 -0
- package/dist/components/MerchantBatchCreateForm/FileUpload/sheetDropDown.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/Layout/Layout.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/CategoryCell.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/UploadImageCell.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/index.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/index.d.ts +2 -0
- package/dist/components/MerchantBatchCreateForm/fieldMappingPopup.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/fileUploadTab.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/hook/useFileValidator.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/index.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/mergeAndCheckData.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/modals/CreateProductConfirmModal.d.ts +10 -0
- package/dist/components/MerchantBatchCreateForm/modals/CreateProductSuccessModal.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/modals/DeleteImageConfirmModal.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/CategoriesInput/index.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/ActionButtons.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/AddOptionComponent.d.ts +13 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/OptionItem/EditOptionComponent.d.ts +14 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/OptionItem/index.d.ts +18 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/SelectButton.d.ts +11 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/index.d.ts +22 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/index.d.ts +4 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/utils/LocalStorage.d.ts +6 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/utils/validation.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/index.d.ts +10 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UploadImage.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/index.d.ts +16 -0
- package/dist/components/MerchantBatchCreateForm/store/useMappingStore.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/store/useUploadStore.d.ts +27 -0
- package/dist/components/MerchantBatchCreateForm/utils/download.d.ts +4 -0
- package/dist/components/MerchantBatchCreateForm/utils/upload.d.ts +5 -0
- package/dist/components/MerchantEdit/AddressFields.d.ts +16 -0
- package/dist/components/MerchantEdit/FileUpload.d.ts +13 -0
- package/dist/components/MerchantEdit/Header.d.ts +9 -0
- package/dist/components/MerchantEdit/UserTypeForm.d.ts +22 -0
- package/dist/components/MerchantEdit/index.d.ts +10 -0
- package/dist/components/MerchantRegistrationForm/AddressFields.d.ts +16 -0
- package/dist/components/MerchantRegistrationForm/FileUpload.d.ts +12 -0
- package/dist/components/MerchantRegistrationForm/Header.d.ts +9 -0
- package/dist/components/MerchantRegistrationForm/IndustrySelect.d.ts +8 -0
- package/dist/components/MerchantRegistrationForm/MerchantRegistrationForm.d.ts +37 -0
- package/dist/components/MerchantRegistrationForm/UserTypeForm.d.ts +21 -0
- package/dist/components/MerchantTable/index.d.ts +11 -0
- package/dist/components/MerchantTable/merchantTableAction.d.ts +8 -0
- package/dist/components/MerchantTable/merchantTableFilter.d.ts +16 -0
- package/dist/components/MerchantTable/merchantTableHeader.d.ts +6 -0
- package/dist/components/MerchantView/AddressFields.d.ts +16 -0
- package/dist/components/MerchantView/FileUpload.d.ts +13 -0
- package/dist/components/MerchantView/Header.d.ts +9 -0
- package/dist/components/MerchantView/UserTypeForm.d.ts +22 -0
- package/dist/components/MerchantView/index.d.ts +10 -0
- package/dist/components/NewAccountCreate/FormHeader.d.ts +8 -0
- package/dist/components/NewAccountCreate/Icon.d.ts +6 -0
- package/dist/components/NewAccountCreate/InputField.d.ts +21 -0
- package/dist/components/NewAccountCreate/PasswordRequirements.d.ts +6 -0
- package/dist/components/NewAccountCreate/RequirementItem.d.ts +6 -0
- package/dist/components/NewAccountCreate/SubmitButton.d.ts +11 -0
- package/dist/components/NewAccountCreate/index.d.ts +8 -0
- package/dist/components/NewAccountCreate/types.d.ts +7 -0
- package/dist/components/common/button.d.ts +11 -0
- package/dist/components/common/custom-toast/index.d.ts +6 -0
- package/dist/components/common/dataTable/dataTable.d.ts +25 -0
- package/dist/components/common/dataTable/pagination.d.ts +14 -0
- package/dist/components/common/dataTable/statusBadge.d.ts +9 -0
- package/dist/components/common/dataTable/tableBody.d.ts +8 -0
- package/dist/components/common/dataTable/tableHeader.d.ts +6 -0
- package/dist/components/common/dataTable/tableSkeleton.d.ts +7 -0
- package/dist/components/common/datePicker.d.ts +10 -0
- package/dist/components/common/dropdownMenu.d.ts +27 -0
- package/dist/components/common/dropdownMenuAbsolute.d.ts +4 -0
- package/dist/components/common/form/error-message.d.ts +14 -0
- package/dist/components/common/input.d.ts +3 -0
- package/dist/components/common/label.d.ts +6 -0
- package/dist/components/common/modals/ConfirmModal.d.ts +13 -0
- package/dist/components/common/modals/ExitConfirmGuard.d.ts +11 -0
- package/dist/components/common/modals/WrapModal.d.ts +9 -0
- package/dist/components/common/number-input.d.ts +5 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/confirmModal.d.ts +10 -0
- package/dist/components/ui/error-modal.d.ts +8 -0
- package/dist/components/ui/input.d.ts +18 -0
- package/dist/components/ui/success-modal.d.ts +8 -0
- package/dist/configs/portalAxiosClient.d.ts +2 -0
- package/dist/configs/wesapAxiosClient.d.ts +2 -0
- package/dist/constants/merchant-batch-create-form.constant.d.ts +4 -0
- package/dist/fonts/inter/Inter_18pt-Bold.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-Medium.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-Regular.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-SemiBold.ttf +0 -0
- package/dist/hooks/use-address.d.ts +9 -0
- package/dist/hooks/use-create-merchant.d.ts +20 -0
- package/dist/hooks/use-edit-merchant.d.ts +20 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-merchant-table.d.ts +13 -0
- package/dist/hooks/use-translation.d.ts +10 -0
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useMCCList.d.ts +6 -0
- package/dist/hooks/useMerchantDetail.d.ts +8 -0
- package/dist/hooks/usePasswordValidation.d.ts +9 -0
- package/dist/index.cjs +73887 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.esm.js +73871 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/main.d.ts +0 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/toast-provider.d.ts +2 -0
- package/dist/services/MCCList.d.ts +2 -0
- package/dist/services/addressService.d.ts +10 -0
- package/dist/services/create-products.service.d.ts +6 -0
- package/dist/services/createDigistoreAccountService.d.ts +7 -0
- package/dist/services/editFormService.d.ts +5 -0
- package/dist/services/merchantFormService.d.ts +5 -0
- package/dist/services/merchantService.d.ts +3 -0
- package/dist/store/use-external-config.store.d.ts +10 -0
- package/dist/store/use-portal-api-config.store.d.ts +8 -0
- package/dist/store/use-unsaved-changes.store.d.ts +11 -0
- package/dist/store/use-wesap-api-config.store.d.ts +10 -0
- package/dist/style.css +2971 -0
- package/dist/types/MCCList.d.ts +5 -0
- package/dist/types/addressType.d.ts +17 -0
- package/dist/types/formData.d.ts +58 -0
- package/dist/types/global.d.ts +3 -0
- package/dist/types/merchant-batch-create-form/product-info-preview.d.ts +45 -0
- package/dist/types/merchant-batch-create-form/sheet-product-validation.d.ts +10 -0
- package/dist/types/merchant-batch-create-form/table.d.ts +1 -0
- package/dist/types/merchant-batch-create-form/unit-select.d.ts +14 -0
- package/dist/types/merchantDetail.d.ts +30 -0
- package/dist/types/merchantTableData.d.ts +16 -0
- package/dist/types/user.d.ts +23 -0
- package/dist/utils/commonFunctions.d.ts +2 -0
- package/dist/utils/datetime.d.ts +8 -0
- package/dist/utils/form.d.ts +1 -0
- package/dist/utils/mapLicenseData.d.ts +25 -0
- package/dist/utils/merchantTableData.d.ts +3 -0
- package/dist/utils/tokenManager.d.ts +2 -0
- package/dist/utils/translations.d.ts +685 -0
- package/dist/vite.svg +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormData } from '../../types/formData';
|
|
3
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
4
|
+
interface UserTypeFormProps {
|
|
5
|
+
formData: FormData;
|
|
6
|
+
onInputChange: (field: keyof FormData, value: string) => void;
|
|
7
|
+
businessLicenseFile: File | null;
|
|
8
|
+
taxDocumentFile: File | null;
|
|
9
|
+
onFileUpload: (type: "businessLicense" | "taxDocument", event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
autofilledFields?: string[];
|
|
11
|
+
onParsedData?: (data: ILicenseData) => void;
|
|
12
|
+
onRemoveFile?: (type: "businessLicense" | "taxDocument") => void;
|
|
13
|
+
errors?: Partial<Record<keyof FormData, string>>;
|
|
14
|
+
fileErrors?: {
|
|
15
|
+
businessLicense?: string;
|
|
16
|
+
taxDocument?: string;
|
|
17
|
+
};
|
|
18
|
+
initialData?: Partial<FormData>;
|
|
19
|
+
lang?: "vi" | "en";
|
|
20
|
+
}
|
|
21
|
+
export declare const UserTypeForm: React.FC<UserTypeFormProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MerchantEditProps {
|
|
3
|
+
accessToken?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
merchantId?: string;
|
|
6
|
+
isHeader?: boolean;
|
|
7
|
+
lang?: "vi" | "en";
|
|
8
|
+
}
|
|
9
|
+
export declare const MerchantEdit: React.FC<MerchantEditProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MerchantFormData {
|
|
3
|
+
country: string;
|
|
4
|
+
city: string;
|
|
5
|
+
district: string;
|
|
6
|
+
ward: string;
|
|
7
|
+
address: string;
|
|
8
|
+
}
|
|
9
|
+
interface AddressFieldsProps {
|
|
10
|
+
formData: MerchantFormData;
|
|
11
|
+
onInputChange: (field: keyof MerchantFormData, value: string) => void;
|
|
12
|
+
errors?: Partial<Record<keyof MerchantFormData, string>>;
|
|
13
|
+
lang?: "vi" | "en";
|
|
14
|
+
}
|
|
15
|
+
export declare const AddressFields: React.FC<AddressFieldsProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
3
|
+
interface FileUploadProps {
|
|
4
|
+
label: string;
|
|
5
|
+
file: File | null;
|
|
6
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
onParsedData?: (data: ILicenseData) => void;
|
|
8
|
+
onRemoveFile?: () => void;
|
|
9
|
+
lang?: "vi" | "en";
|
|
10
|
+
}
|
|
11
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface MerchantHeaderProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
statusLabel?: string;
|
|
5
|
+
statusType?: "draft" | "pending" | "approved" | "rejected";
|
|
6
|
+
lang?: "vi" | "en";
|
|
7
|
+
}
|
|
8
|
+
export default function MerchantHeader({ title, subtitle, statusLabel, statusType, lang, }: MerchantHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormData } from '../../types/formData';
|
|
3
|
+
interface SubmitPayload {
|
|
4
|
+
entity_type: "PERSON" | "BUSINESS_HOUSEHOLD" | "ENTERPRISE";
|
|
5
|
+
tax_code: string;
|
|
6
|
+
full_name: string;
|
|
7
|
+
brand_name?: string;
|
|
8
|
+
phone_number: string;
|
|
9
|
+
business_registration_number?: string;
|
|
10
|
+
email: string;
|
|
11
|
+
referral_code?: string;
|
|
12
|
+
industry: string;
|
|
13
|
+
representative_name: string;
|
|
14
|
+
country: string;
|
|
15
|
+
city: string;
|
|
16
|
+
district: string;
|
|
17
|
+
ward: string;
|
|
18
|
+
street_address: string;
|
|
19
|
+
business_license: File | null;
|
|
20
|
+
tax_license: File | null;
|
|
21
|
+
merchant_id?: string;
|
|
22
|
+
}
|
|
23
|
+
interface MerchantRegistrationFormProps {
|
|
24
|
+
accessToken?: string;
|
|
25
|
+
onClose?: () => void;
|
|
26
|
+
onSubmit?: (data: SubmitPayload) => Promise<void>;
|
|
27
|
+
onSuccess?: (data?: SubmitPayload) => void;
|
|
28
|
+
onError?: (err: Error) => void;
|
|
29
|
+
defaultValues?: Partial<FormData>;
|
|
30
|
+
successIconSrc?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
merchantId?: string;
|
|
33
|
+
isHeader?: boolean;
|
|
34
|
+
lang?: "vi" | "en";
|
|
35
|
+
}
|
|
36
|
+
export declare const MerchantRegistrationForm: React.FC<MerchantRegistrationFormProps>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormData } from '../../types/formData';
|
|
3
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
4
|
+
interface UserTypeFormProps {
|
|
5
|
+
formData: FormData;
|
|
6
|
+
onInputChange: (field: keyof FormData, value: string) => void;
|
|
7
|
+
businessLicenseFile: File | null;
|
|
8
|
+
taxDocumentFile: File | null;
|
|
9
|
+
onFileUpload: (type: "businessLicense" | "taxDocument", event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
autofilledFields?: string[];
|
|
11
|
+
onParsedData?: (data: ILicenseData) => void;
|
|
12
|
+
onRemoveFile?: (type: "businessLicense" | "taxDocument") => void;
|
|
13
|
+
errors?: Partial<Record<keyof FormData, string>>;
|
|
14
|
+
fileErrors?: {
|
|
15
|
+
businessLicense?: string;
|
|
16
|
+
taxDocument?: string;
|
|
17
|
+
};
|
|
18
|
+
lang?: "vi" | "en";
|
|
19
|
+
}
|
|
20
|
+
export declare const UserTypeForm: React.FC<UserTypeFormProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface MerchantTableProps {
|
|
2
|
+
authToken: string;
|
|
3
|
+
isHeader?: boolean;
|
|
4
|
+
createRoute: string;
|
|
5
|
+
onAddNew?: () => void;
|
|
6
|
+
onViewMerchant: (merchantId: string) => void;
|
|
7
|
+
onEditMerchant: (merchantId: string) => void;
|
|
8
|
+
lang?: 'vi' | 'en' | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function MerchantTable({ authToken, isHeader, createRoute, onAddNew, onViewMerchant, onEditMerchant, lang, }: MerchantTableProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Applicant } from '../../types/merchantTableData';
|
|
2
|
+
interface MerchantTableActionsProps {
|
|
3
|
+
applicant: Applicant;
|
|
4
|
+
onView: (merchantId: string) => void;
|
|
5
|
+
onEdit: (merchantId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export default function MerchantTableActions({ applicant, onView, onEdit, }: MerchantTableActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Option } from '../common/dropdownMenu';
|
|
2
|
+
interface MerchantFiltersProps {
|
|
3
|
+
selectedApplicantType: string | number;
|
|
4
|
+
selectedStatus: string | number;
|
|
5
|
+
dateRange: [Date | null, Date | null];
|
|
6
|
+
searchString: string;
|
|
7
|
+
onApplicantTypeChange: (option: Option) => void;
|
|
8
|
+
onStatusChange: (option: Option) => void;
|
|
9
|
+
onDateRangeChange: (range: [Date | null, Date | null]) => void;
|
|
10
|
+
onSearchChange: (value: string) => void;
|
|
11
|
+
onApplyFilters: () => void;
|
|
12
|
+
onResetFilters: () => void;
|
|
13
|
+
lang?: "vi" | "en";
|
|
14
|
+
}
|
|
15
|
+
export default function MerchantFilters({ selectedApplicantType, selectedStatus, dateRange, searchString, onApplicantTypeChange, onStatusChange, onDateRangeChange, onSearchChange, onApplyFilters, onResetFilters, lang, }: MerchantFiltersProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MerchantFormData {
|
|
3
|
+
country: string;
|
|
4
|
+
city: string;
|
|
5
|
+
district: string;
|
|
6
|
+
ward: string;
|
|
7
|
+
address: string;
|
|
8
|
+
}
|
|
9
|
+
interface AddressFieldsProps {
|
|
10
|
+
formData: MerchantFormData;
|
|
11
|
+
errors?: Partial<Record<keyof MerchantFormData, string>>;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
lang?: "vi" | "en";
|
|
14
|
+
}
|
|
15
|
+
export declare const AddressFields: React.FC<AddressFieldsProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
3
|
+
interface FileUploadProps {
|
|
4
|
+
label: string;
|
|
5
|
+
file: File | null;
|
|
6
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
onParsedData?: (data: ILicenseData) => void;
|
|
8
|
+
onRemoveFile?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
lang?: "vi" | "en";
|
|
11
|
+
}
|
|
12
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface MerchantHeaderProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
statusLabel?: string;
|
|
5
|
+
statusType?: "draft" | "pending" | "approved" | "rejected" | null;
|
|
6
|
+
lang?: "vi" | "en";
|
|
7
|
+
}
|
|
8
|
+
export default function MerchantHeader({ title, subtitle, statusLabel, statusType, lang, }: MerchantHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormData } from '../../types/formData';
|
|
3
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
4
|
+
interface UserTypeFormProps {
|
|
5
|
+
formData: FormData;
|
|
6
|
+
onInputChange: (field: keyof FormData, value: string) => void;
|
|
7
|
+
businessLicenseFile: File | null;
|
|
8
|
+
taxDocumentFile: File | null;
|
|
9
|
+
onFileUpload: (type: "businessLicense" | "taxDocument", event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
autofilledFields?: string[];
|
|
11
|
+
onParsedData?: (data: ILicenseData) => void;
|
|
12
|
+
onRemoveFile?: (type: "businessLicense" | "taxDocument") => void;
|
|
13
|
+
errors?: Partial<Record<keyof FormData, string>>;
|
|
14
|
+
fileErrors?: {
|
|
15
|
+
businessLicense?: string;
|
|
16
|
+
taxDocument?: string;
|
|
17
|
+
};
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
lang?: "vi" | "en";
|
|
20
|
+
}
|
|
21
|
+
export declare const UserTypeForm: React.FC<UserTypeFormProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MerchantViewProps {
|
|
3
|
+
accessToken?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
merchantId?: string;
|
|
6
|
+
isHeader?: boolean;
|
|
7
|
+
lang?: "vi" | "en";
|
|
8
|
+
}
|
|
9
|
+
export declare const MerchantView: React.FC<MerchantViewProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface FormHeaderProps {
|
|
3
|
+
logoSrc: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function FormHeader({ logoSrc, title, description }: FormHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface IconProps {
|
|
2
|
+
className: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const EyeIcon: ({ className }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const EyeSlashIcon: ({ className }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PasswordRequirements {
|
|
2
|
+
length: boolean;
|
|
3
|
+
special: boolean;
|
|
4
|
+
upper: boolean;
|
|
5
|
+
lower: boolean;
|
|
6
|
+
number: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface InputFieldProps {
|
|
9
|
+
label: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
showPasswordToggle?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function InputField({ label, type, value, onChange, placeholder, required, showPasswordToggle, className, disabled, error }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PasswordRequirements as PasswordRequirementsType } from './types';
|
|
2
|
+
interface PasswordRequirementsProps {
|
|
3
|
+
requirements: PasswordRequirementsType;
|
|
4
|
+
}
|
|
5
|
+
export declare function PasswordRequirements({ requirements, }: PasswordRequirementsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SubmitButtonProps {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
loadingText?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function SubmitButton({ onClick, disabled, isLoading, children, loadingText, className, }: SubmitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface NewAccountCreate {
|
|
2
|
+
logo: string;
|
|
3
|
+
username: string;
|
|
4
|
+
userPassword: string;
|
|
5
|
+
redirectFunction?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function NewAccountCreate({ username, userPassword, logo, redirectFunction, }: NewAccountCreate): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
loadingText?: string;
|
|
7
|
+
leftIcon?: React.ReactNode;
|
|
8
|
+
rightIcon?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export default Button;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Option } from '../dropdownMenu';
|
|
3
|
+
export interface TableHeader<T> {
|
|
4
|
+
key: keyof T | string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
width?: string;
|
|
7
|
+
minWidth?: string;
|
|
8
|
+
render?: (item: T, index: number) => React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
interface ReusableTableProps<T> {
|
|
11
|
+
headers: TableHeader<T>[];
|
|
12
|
+
data: T[];
|
|
13
|
+
totalItems: number;
|
|
14
|
+
page: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
onPageChange: (page: number) => void;
|
|
17
|
+
onRowsPerPageChange: (option: Option) => void;
|
|
18
|
+
lang?: 'vi' | 'en';
|
|
19
|
+
cardView?: boolean;
|
|
20
|
+
translate?: (key: string) => string;
|
|
21
|
+
customDropdown?: React.FC<import('./pagination').DropdownMenuProps>;
|
|
22
|
+
showPagination?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function ReusableTable<T extends object>({ headers, data, totalItems, page, pageSize, onPageChange, onRowsPerPageChange, lang, cardView, translate, customDropdown, showPagination, }: ReusableTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default ReusableTable;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Option, DropdownMenuProps } from '../dropdownMenu';
|
|
3
|
+
interface PaginationProps {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
rowsPerPageState: string;
|
|
7
|
+
onPageChange: (page: number) => void;
|
|
8
|
+
onRowsPerPageChange: (option: Option) => void;
|
|
9
|
+
lang?: "vi" | "en";
|
|
10
|
+
customDropdown?: React.FC<DropdownMenuProps>;
|
|
11
|
+
}
|
|
12
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
13
|
+
export default Pagination;
|
|
14
|
+
export type { DropdownMenuProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type StatusType = "approved" | "rejected" | "draft" | "pending";
|
|
3
|
+
interface StatusBadgeProps {
|
|
4
|
+
status: StatusType;
|
|
5
|
+
text: string;
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
}
|
|
8
|
+
declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
9
|
+
export default StatusBadge;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableHeader } from './dataTable';
|
|
2
|
+
interface TableBodyProps<T> {
|
|
3
|
+
data: T[];
|
|
4
|
+
headers: TableHeader<T>[];
|
|
5
|
+
lang?: 'vi' | 'en';
|
|
6
|
+
}
|
|
7
|
+
declare const TableBody: <T extends object>({ data, headers, lang, }: TableBodyProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default TableBody;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TableHeader } from './dataTable';
|
|
2
|
+
interface TableHeaderProps<T> {
|
|
3
|
+
headers: TableHeader<T>[];
|
|
4
|
+
}
|
|
5
|
+
declare const TableHeaderComponent: <T extends object>({ headers, }: TableHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default TableHeaderComponent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface DateRangePickerProps {
|
|
3
|
+
startDate: Date | null;
|
|
4
|
+
endDate: Date | null;
|
|
5
|
+
onChange: (dates: [Date | null, Date | null]) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
lang?: "vi" | "en";
|
|
8
|
+
}
|
|
9
|
+
declare const DateRangePicker: React.FC<DateRangePickerProps>;
|
|
10
|
+
export default DateRangePicker;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface BaseOption {
|
|
3
|
+
name: string;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export type Option<T extends BaseOption = BaseOption> = T;
|
|
7
|
+
interface DropdownMenuProps<T extends BaseOption = BaseOption> {
|
|
8
|
+
options: Option<T>[];
|
|
9
|
+
value?: string | number;
|
|
10
|
+
onChange?: (option: Option<T>) => void;
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
horizontal?: boolean;
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
className?: string;
|
|
19
|
+
containerClassName?: string;
|
|
20
|
+
dropdownClassName?: string;
|
|
21
|
+
optionClassName?: string;
|
|
22
|
+
paddingX?: string;
|
|
23
|
+
triggerClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const DropdownMenu: React.FC<DropdownMenuProps>;
|
|
26
|
+
export default DropdownMenu;
|
|
27
|
+
export type { DropdownMenuProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NestedKeyOf } from '../../../types/global';
|
|
2
|
+
import { ErrorMessage as ErrorMessagePrimitive, FieldValuesFromFieldErrors } from '@hookform/error-message';
|
|
3
|
+
import { FieldErrors, FieldName, FieldValues, Message, MultipleFieldErrors } from 'react-hook-form';
|
|
4
|
+
type Props<T extends FieldValues> = {
|
|
5
|
+
name?: NestedKeyOf<T> & FieldName<FieldValuesFromFieldErrors<T>>;
|
|
6
|
+
errors: FieldErrors<T>;
|
|
7
|
+
multipleErrors?: boolean;
|
|
8
|
+
render?: (data: {
|
|
9
|
+
message: Message;
|
|
10
|
+
messages?: MultipleFieldErrors;
|
|
11
|
+
}) => React.ReactNode;
|
|
12
|
+
} & React.ComponentPropsWithoutRef<typeof ErrorMessagePrimitive>;
|
|
13
|
+
declare const ErrorMessage: <T extends FieldValues>({ errors, name, multipleErrors, render, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
disable?: boolean;
|
|
4
|
+
cancelText?: string;
|
|
5
|
+
confirmText?: string;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const ConfirmModal: ({ disable, cancelText, confirmText, open, children, onClose, onConfirm, onCancel, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default ConfirmModal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
confirmText?: string;
|
|
6
|
+
cancelText?: string;
|
|
7
|
+
onConfirm?: () => void;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function ExitConfirmGuard({ enabled, title, message, confirmText, cancelText, onConfirm, onCancel, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const WrapModal: ({ open, className, onClose, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default WrapModal;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const NumberInput: React.ForwardRefExoticComponent<{
|
|
3
|
+
onChangeNumber?: (value: number) => void;
|
|
4
|
+
} & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export default NumberInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface SubmitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
type?: 'submit' | 'button' | 'reset';
|
|
4
|
+
variant?: 'primary' | 'outline';
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: React.FC<SubmitButtonProps>;
|
|
12
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ConfirmModalProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
lang?: 'vi' | 'en';
|
|
8
|
+
}
|
|
9
|
+
export declare const ConfirmModal: ({ open, title, description, onConfirm, onCancel, lang, }: ConfirmModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface InputProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
isAutofilled?: boolean;
|
|
10
|
+
labelClassname?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
export declare const Input: React.FC<InputProps>;
|
|
18
|
+
export {};
|