@taxbit/react-sdk 0.3.2 → 0.4.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 +61 -2
- package/dist/basic.css +6 -4
- package/dist/inline.css +6 -4
- package/dist/minimal.css +0 -4
- package/dist/src/components/Address/Address.d.ts +2 -3
- package/dist/src/components/Form/Form.d.ts +2 -1
- package/dist/src/components/ProgressStatus/ProgressStatus.d.ts +5 -0
- package/dist/src/components/ProgressStatus/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/contexts/FormUI/getLocal.d.ts +21 -0
- package/dist/src/contexts/FormUI/useFormUI.d.ts +20 -22
- package/dist/src/contexts/FormUI/useFormUIContext.d.ts +43 -47
- package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +3 -3
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +8 -5
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +12 -8
- package/dist/src/entry/index.d.ts +1 -0
- package/dist/src/i18n/index.d.ts +1 -1
- package/dist/src/i18n/types/LocalizationKey.d.ts +1 -2
- package/dist/src/i18n/types/PropertyFile.d.ts +1 -4
- package/dist/src/i18n/utils/getText.d.ts +2 -3
- package/dist/src/types/InputStep.d.ts +5 -0
- package/dist/src/types/Progress.d.ts +9 -0
- package/dist/src/types/TaxDocumentation.d.ts +4 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/ui/DateOfBirthInput/DateOfBirthInput.d.ts +2 -2
- package/dist/src/ui/Password/Password.d.ts +2 -1
- package/dist/src/ui/TextInput/TextInput.d.ts +2 -2
- package/dist/src/utils/getFieldsState.d.ts +1 -0
- package/dist/src/utils/getHintKeyMap.d.ts +4 -0
- package/dist/src/utils/getPromptKeyMap.d.ts +4 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/mergeDeep.d.ts +1 -0
- package/dist/src/validations/getInvalidFields.d.ts +2 -2
- package/dist/src/validations/getRequiredFields.d.ts +1 -1
- package/dist/src/validations/getVisibleFields.d.ts +2 -2
- package/dist/src/validations/index.d.ts +1 -2
- package/dist/src/validations/invalidFieldRules.d.ts +1 -1
- package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +3 -2
- package/dist/src/wizard/AddressInput/AddressInput.d.ts +1 -1
- package/dist/src/wizard/ResidenceInput/ResidenceInput.d.ts +2 -2
- package/dist/src/wizard/RowInput/AddressRow/AddressRow.d.ts +7 -0
- package/dist/src/wizard/RowInput/AddressRow/index.d.ts +1 -0
- package/dist/src/wizard/RowInput/VisibleRow/VisibleRow.d.ts +1 -2
- package/dist/src/wizard/RowInput/index.d.ts +1 -0
- package/dist/src/wizard/TaxBitFormUI/Confirmation/Confirmation.d.ts +2 -0
- package/dist/src/wizard/TaxBitFormUI/Confirmation/index.d.ts +1 -0
- package/dist/src/wizard/TaxBitFormUI/Summary/Summary.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +1 -1
- package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +3 -2
- package/dist/src/wizard/TaxBitFormUI/steps.d.ts +1 -0
- package/dist/taxbit-react-sdk.js +2218 -2137
- package/dist/taxbit-react-sdk.umd.cjs +10 -10
- package/package.json +1 -1
- package/dist/src/components/Notification/Notification.d.ts +0 -5
- package/dist/src/components/Notification/index.d.ts +0 -1
- package/dist/src/validations/getNotifiedFields.d.ts +0 -10
- package/dist/src/validations/requiredFieldRules.d.ts +0 -7
|
@@ -121,6 +121,10 @@ export type SummaryData = {
|
|
|
121
121
|
};
|
|
122
122
|
export type CalculatedData = {
|
|
123
123
|
accountHolderTaxResidences?: YesNo;
|
|
124
|
+
accountHolderAddress?: string;
|
|
125
|
+
accountHolderMailingAddress?: string;
|
|
126
|
+
regardedOwnerAddress?: string;
|
|
127
|
+
regardedOwnerMailingAddress?: string;
|
|
124
128
|
};
|
|
125
129
|
export type TaxDocumentation = AccountHolderContactData & AccountHolderTaxData & AccountHolderClassificationData & RegardedOwnerContactData & RegardedOwnerClassificationData & RegardedOwnerTaxData & SummaryData & CalculatedData;
|
|
126
130
|
export type TaxDocumentationKey = keyof TaxDocumentation;
|
|
@@ -2,8 +2,10 @@ export * from './AccountType';
|
|
|
2
2
|
export * from './CaProvinceCode';
|
|
3
3
|
export * from './CamelCaseKeys';
|
|
4
4
|
export * from './CountryCode';
|
|
5
|
+
export * from './InputStep';
|
|
5
6
|
export * from './Locale';
|
|
6
7
|
export * from './MonthCode';
|
|
8
|
+
export * from './Progress';
|
|
7
9
|
export * from './TaxDocumentation';
|
|
8
10
|
export * from './TaxForm';
|
|
9
11
|
export * from './UsStateCode';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { TaxDocumentationKey } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TaxDocumentationKey } from 'types/TaxDocumentation';
|
|
3
3
|
export type DateOfBirthInputProps = {
|
|
4
4
|
name: TaxDocumentationKey;
|
|
5
5
|
className?: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type PasswordProps = {
|
|
3
3
|
value?: string;
|
|
4
|
+
name?: string;
|
|
4
5
|
mask?: string;
|
|
5
6
|
onChange?: (val: string) => void;
|
|
6
7
|
show?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare const Password: ({ value, mask, onChange, disabled, show, ...inputProps }: PasswordProps) => React.JSX.Element;
|
|
11
|
+
export declare const Password: ({ value, mask, name, onChange, disabled, show, ...inputProps }: PasswordProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -106,4 +106,8 @@ export declare const getHintKeyMap: () => {
|
|
|
106
106
|
regardedOwnerForeignTinIsNotRequired?: "dateOfBirth" | undefined;
|
|
107
107
|
regardedOwnerUsTin?: "dateOfBirth" | undefined;
|
|
108
108
|
accountHolderTaxResidences?: "dateOfBirth" | undefined;
|
|
109
|
+
accountHolderAddress?: "dateOfBirth" | undefined;
|
|
110
|
+
accountHolderMailingAddress?: "dateOfBirth" | undefined;
|
|
111
|
+
regardedOwnerAddress?: "dateOfBirth" | undefined;
|
|
112
|
+
regardedOwnerMailingAddress?: "dateOfBirth" | undefined;
|
|
109
113
|
};
|
|
@@ -106,4 +106,8 @@ export declare const getPromptKeyMap: (data: TaxDocumentation) => {
|
|
|
106
106
|
regardedOwnerForeignTinIsNotRequired?: PromptKey | undefined;
|
|
107
107
|
regardedOwnerUsTin?: PromptKey | undefined;
|
|
108
108
|
accountHolderTaxResidences?: PromptKey | undefined;
|
|
109
|
+
accountHolderAddress?: PromptKey | undefined;
|
|
110
|
+
accountHolderMailingAddress?: PromptKey | undefined;
|
|
111
|
+
regardedOwnerAddress?: PromptKey | undefined;
|
|
112
|
+
regardedOwnerMailingAddress?: PromptKey | undefined;
|
|
109
113
|
};
|
|
@@ -7,6 +7,7 @@ export * from './getMonthlyDayCount';
|
|
|
7
7
|
export * from './getPromptKeyMap';
|
|
8
8
|
export * from './isBlank';
|
|
9
9
|
export * from './kebabCase';
|
|
10
|
+
export * from './mergeDeep';
|
|
10
11
|
export * from './snakeCaseKeys';
|
|
11
12
|
export * from './transformForClient';
|
|
12
13
|
export * from './transformInbound';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mergeDeep: <T extends object = object>(target: T | undefined, source: T | undefined) => T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TaxDocumentationErrorFile
|
|
1
|
+
import { TaxDocumentationErrorFile } from '../contexts';
|
|
2
2
|
import { TaxDocumentation } from '../types';
|
|
3
|
-
export declare const getInvalidFields: (fields: TaxDocumentation
|
|
3
|
+
export declare const getInvalidFields: (fields: TaxDocumentation) => TaxDocumentationErrorFile;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TaxDocumentationPropertyFile } from '../contexts';
|
|
2
2
|
import { TaxDocumentation } from '../types';
|
|
3
|
-
export declare const getRequiredFields: (fields: TaxDocumentation
|
|
3
|
+
export declare const getRequiredFields: (fields: TaxDocumentation) => TaxDocumentationPropertyFile;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TaxDocumentation } from 'types';
|
|
1
|
+
import type { TaxDocumentation, TaxForm } from 'types';
|
|
2
2
|
import { TaxDocumentationPropertyFile } from '../contexts';
|
|
3
|
-
export declare const getVisibleFields: (fields: TaxDocumentation | undefined,
|
|
3
|
+
export declare const getVisibleFields: (fields: TaxDocumentation | undefined, supportedForms: TaxForm[]) => TaxDocumentationPropertyFile;
|
|
@@ -2,5 +2,4 @@ export * from './getInvalidFields';
|
|
|
2
2
|
export * from './getRequiredFields';
|
|
3
3
|
export * from './getSupportedFields';
|
|
4
4
|
export * from './getVisibleFields';
|
|
5
|
-
export * from './invalidFieldRules
|
|
6
|
-
export * from './requiredFieldRules';
|
|
5
|
+
export * from './invalidFieldRules';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ErrorKey } from 'i18n/types';
|
|
2
2
|
import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
|
|
3
|
-
export type FormUIValidation = (fields: TaxDocumentation) => ErrorKey | undefined;
|
|
3
|
+
export type FormUIValidation = (fields: TaxDocumentation) => ErrorKey[] | undefined;
|
|
4
4
|
export type FormUIValidations = {
|
|
5
5
|
[key in TaxDocumentationKey]?: FormUIValidation;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Locale, TaxForm } from 'types';
|
|
2
|
+
import { Locale, Progress, TaxForm } from 'types';
|
|
3
3
|
import { ClientTaxDocumentation } from 'types/client';
|
|
4
4
|
export type TaxBitFormProps = {
|
|
5
5
|
data?: ClientTaxDocumentation;
|
|
@@ -7,7 +7,8 @@ export type TaxBitFormProps = {
|
|
|
7
7
|
bearerToken: string;
|
|
8
8
|
language?: Locale;
|
|
9
9
|
taxForms?: TaxForm[];
|
|
10
|
+
onProgress?: (progress: Progress) => void;
|
|
10
11
|
onSubmit?: (data?: ClientTaxDocumentation) => void;
|
|
11
12
|
onSuccess?: (data?: ClientTaxDocumentation) => void;
|
|
12
13
|
};
|
|
13
|
-
export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onSubmit, onSuccess, }: TaxBitFormProps) => React.JSX.Element;
|
|
14
|
+
export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onProgress, onSubmit, onSuccess, }: TaxBitFormProps) => React.JSX.Element;
|
|
@@ -4,5 +4,5 @@ type AddressProps = {
|
|
|
4
4
|
showIf?: boolean;
|
|
5
5
|
prefix: 'accountHolderAddress' | 'accountHolderMailingAddress' | 'regardedOwnerAddress' | 'regardedOwnerMailingAddress';
|
|
6
6
|
};
|
|
7
|
-
export declare const AddressInput: ({ prompt, prefix, showIf, }: AddressProps) => React.JSX.Element
|
|
7
|
+
export declare const AddressInput: ({ prompt, prefix, showIf, }: AddressProps) => React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CountryCode } from 'types';
|
|
3
|
-
type
|
|
3
|
+
type ResidenceInputProps = {
|
|
4
4
|
index: 1 | 2 | 3 | 4 | 5;
|
|
5
5
|
showIf?: boolean;
|
|
6
6
|
more?: true;
|
|
@@ -10,5 +10,5 @@ type AddressProps = {
|
|
|
10
10
|
label: string;
|
|
11
11
|
}>;
|
|
12
12
|
};
|
|
13
|
-
export declare const ResidenceInput: ({ index, showIf, onShow, more, countryOptions, }:
|
|
13
|
+
export declare const ResidenceInput: ({ index, showIf, onShow, more, countryOptions, }: ResidenceInputProps) => React.JSX.Element | null;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AddressRowProps = {
|
|
3
|
+
onEdit?: () => void;
|
|
4
|
+
name: 'accountHolderAddress' | 'accountHolderMailingAddress' | 'regardedOwnerAddress' | 'regardedOwnerMailingAddress';
|
|
5
|
+
};
|
|
6
|
+
export declare const AddressRow: ({ onEdit, name }: AddressRowProps) => React.JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AddressRow';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TaxDocumentationKey } from 'types';
|
|
3
|
-
export declare const VisibleRow: ({ label, subLabel, name, children, onEdit,
|
|
3
|
+
export declare const VisibleRow: ({ label, subLabel, name, children, onEdit, }: {
|
|
4
4
|
label?: boolean | undefined;
|
|
5
5
|
subLabel?: boolean | undefined;
|
|
6
|
-
notification?: boolean | undefined;
|
|
7
6
|
name: TaxDocumentationKey;
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
onEdit?: (() => void) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Confirmation';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TaxBitFormUIProps } from './TaxBitFormUI';
|
|
3
3
|
export type TaxDocumentationDAC7PathProps = Omit<TaxBitFormUIProps, 'taxForms'>;
|
|
4
|
-
export declare const TaxBitDAC7FormUI: ({ data, onSubmit, language, complete, }: TaxDocumentationDAC7PathProps) => React.JSX.Element;
|
|
4
|
+
export declare const TaxBitDAC7FormUI: ({ data, onSubmit, onProgress, language, complete, }: TaxDocumentationDAC7PathProps) => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Locale, TaxForm } from '../../types';
|
|
2
|
+
import type { Locale, Progress, TaxForm } from '../../types';
|
|
3
3
|
import { ClientTaxDocumentation } from '../../types/client';
|
|
4
4
|
export type TaxBitFormUIProps = {
|
|
5
5
|
data?: ClientTaxDocumentation;
|
|
@@ -7,5 +7,6 @@ export type TaxBitFormUIProps = {
|
|
|
7
7
|
language?: Locale;
|
|
8
8
|
taxForms?: TaxForm[];
|
|
9
9
|
complete?: boolean;
|
|
10
|
+
onProgress?: (progress: Progress) => void;
|
|
10
11
|
};
|
|
11
|
-
export declare const TaxBitFormUI: ({ data, onSubmit, language, taxForms, complete, }: TaxBitFormUIProps) => React.JSX.Element;
|
|
12
|
+
export declare const TaxBitFormUI: ({ data, onSubmit, language, taxForms, complete, onProgress, }: TaxBitFormUIProps) => React.JSX.Element;
|
|
@@ -2,6 +2,7 @@ export * from './AccountHolderClassification';
|
|
|
2
2
|
export * from './AccountHolderContact';
|
|
3
3
|
export * from './AccountHolderTax';
|
|
4
4
|
export * from './AccountHolderTaxClarification';
|
|
5
|
+
export * from './Confirmation';
|
|
5
6
|
export * from './Exemptions';
|
|
6
7
|
export * from './RegardedOwnerClassification';
|
|
7
8
|
export * from './RegardedOwnerContact';
|