@taxbit/react-sdk 1.0.0-beta.5 → 1.0.0-beta.6
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 +17 -0
- package/dist/src/contexts/QuestionnaireUI/useQuestionnaireUI.d.ts +1 -1
- package/dist/src/contexts/QuestionnaireUI/useQuestionnaireUIContext.d.ts +2 -2
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +2 -3
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +4 -4
- package/dist/src/entry/TaxbitQuestionnaire/TaxbitQuestionnaire.d.ts +7 -5
- package/dist/src/utils/getLanguage.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/widgets/TaxbitQuestionnairePersist/TaxbitQuestionnairePersist.d.ts +4 -2
- package/dist/taxbit-react-sdk.js +1538 -1556
- package/dist/taxbit-react-sdk.umd.cjs +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -205,6 +205,18 @@ or for W-Form status
|
|
|
205
205
|
The Taxbit React SDK renders a form for collecting user data. The form is structured with fairly semantic HTML and CSS classes and can be easily customized to closely match your client's style.
|
|
206
206
|
Classnames are namespaced with "taxbit-" to reduce the chance of conflict.
|
|
207
207
|
|
|
208
|
+
#### Loading Component
|
|
209
|
+
|
|
210
|
+
When the TaxbitQuestionnaire component is fetching the status and tax documentation from the server, the TaxbitQuestionnaire component will display a text message my default "Retrieving interview status...". This can be customized by supplying a `loadingComponent` as a prop.
|
|
211
|
+
|
|
212
|
+
```jsx
|
|
213
|
+
<TaxbitQuestionnaire
|
|
214
|
+
bearerToken="bearer token goes here"
|
|
215
|
+
questionnaire="W-FORM"
|
|
216
|
+
loadingComponent={<div>Loading...</div>}
|
|
217
|
+
/>
|
|
218
|
+
```
|
|
219
|
+
|
|
208
220
|
### Callbacks
|
|
209
221
|
|
|
210
222
|
The Taxbit React SDK provides callbacks for the following events on the `TaxbitQuestionnaire` component. These callbacks can be passed in to the Component and used to trigger other actions in your application.
|
|
@@ -294,6 +306,11 @@ type QuestionnaireType = 'DPS' | 'W-FORM';
|
|
|
294
306
|
|
|
295
307
|
## Changelog
|
|
296
308
|
|
|
309
|
+
### Version 1.0.0-beta.6
|
|
310
|
+
|
|
311
|
+
1. Bugs fixed related to the country drop-downs.
|
|
312
|
+
2. Added a `loadingComponent` prop to the TaxbitQuestionnaire component.
|
|
313
|
+
|
|
297
314
|
### Version 1.0.0-beta.5
|
|
298
315
|
|
|
299
316
|
1. Document Generation modifications. Renamed from "getDocumentUrl" to "generateDocumentUrl".
|
|
@@ -12,7 +12,7 @@ export declare const useQuestionnaireUI: () => {
|
|
|
12
12
|
config: {
|
|
13
13
|
minimumAge: number;
|
|
14
14
|
} | undefined;
|
|
15
|
-
language: "
|
|
15
|
+
language: import("types").Locale;
|
|
16
16
|
getLocalText: (key: import("i18n/types").TextKey) => string;
|
|
17
17
|
getLocalTitle: (key: string) => string;
|
|
18
18
|
getLocalSubTitle: (key: import("i18n/types").SubTitleKey) => string;
|
|
@@ -3,7 +3,7 @@ export declare const useQuestionnaireUIContext: () => {
|
|
|
3
3
|
config: {
|
|
4
4
|
minimumAge: number;
|
|
5
5
|
} | undefined;
|
|
6
|
-
language: "
|
|
6
|
+
language: import("../../types").Locale;
|
|
7
7
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
8
8
|
getLocalTitle: (key: string) => string;
|
|
9
9
|
getLocalSubTitle: (key: import("../../i18n/types").SubTitleKey) => string;
|
|
@@ -39,7 +39,7 @@ export declare const useQuestionnaireUIContext: () => {
|
|
|
39
39
|
config: {
|
|
40
40
|
minimumAge: number;
|
|
41
41
|
} | undefined;
|
|
42
|
-
language: "
|
|
42
|
+
language: import("../../types").Locale;
|
|
43
43
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
44
44
|
getLocalTitle: (key: string) => string;
|
|
45
45
|
getLocalSubTitle: (key: import("../../i18n/types").SubTitleKey) => string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ClientTaxDocumentation } from '@taxbit/utilities';
|
|
3
2
|
import type { InputStep, Locale, Progress, Questionnaire, TaxDocumentation } from 'types';
|
|
4
3
|
import type { StepId } from 'types/StepId';
|
|
@@ -32,8 +31,8 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
|
|
|
32
31
|
data: TaxDocumentation;
|
|
33
32
|
originalClientData: TaxDocumentation;
|
|
34
33
|
initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
35
|
-
setLanguage:
|
|
36
|
-
language:
|
|
34
|
+
setLanguage: (lang: Locale) => void;
|
|
35
|
+
language: Locale;
|
|
37
36
|
questionnaire: Questionnaire;
|
|
38
37
|
externalValidations: ExternalValidations | undefined;
|
|
39
38
|
config: InterviewConfig | undefined;
|
|
@@ -15,8 +15,8 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
15
15
|
data: import("../../types").TaxDocumentation;
|
|
16
16
|
originalClientData: import("../../types").TaxDocumentation;
|
|
17
17
|
initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
18
|
-
setLanguage: import("
|
|
19
|
-
language: "
|
|
18
|
+
setLanguage: (lang: import("../../types").Locale) => void;
|
|
19
|
+
language: import("../../types").Locale;
|
|
20
20
|
questionnaire: import("../../types").Questionnaire;
|
|
21
21
|
externalValidations: import("../../types/client").ExternalValidations | undefined;
|
|
22
22
|
config: {
|
|
@@ -39,8 +39,8 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
39
39
|
data: import("../../types").TaxDocumentation;
|
|
40
40
|
originalClientData: import("../../types").TaxDocumentation;
|
|
41
41
|
initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
42
|
-
setLanguage: import("
|
|
43
|
-
language: "
|
|
42
|
+
setLanguage: (lang: import("../../types").Locale) => void;
|
|
43
|
+
language: import("../../types").Locale;
|
|
44
44
|
questionnaire: import("../../types").Questionnaire;
|
|
45
45
|
externalValidations: import("../../types/client").ExternalValidations | undefined;
|
|
46
46
|
config: {
|
|
@@ -11,16 +11,18 @@ export type TaxbitQuestionnaireProps = {
|
|
|
11
11
|
} & ({
|
|
12
12
|
demoMode: true;
|
|
13
13
|
bearerToken?: never;
|
|
14
|
-
onSuccess?: never;
|
|
15
|
-
onSettled?: never;
|
|
16
14
|
onError?: never;
|
|
15
|
+
loadingComponent?: never;
|
|
16
|
+
onSettled?: never;
|
|
17
|
+
onSuccess?: never;
|
|
17
18
|
staging?: never;
|
|
18
19
|
} | {
|
|
19
20
|
demoMode?: false | undefined;
|
|
20
21
|
bearerToken: TaxbitQuestionnairePersistProps['bearerToken'];
|
|
21
|
-
onSuccess?: TaxbitQuestionnairePersistProps['onSuccess'];
|
|
22
|
-
onSettled?: TaxbitQuestionnairePersistProps['onSettled'];
|
|
23
22
|
onError?: TaxbitQuestionnairePersistProps['onError'];
|
|
23
|
+
loadingComponent?: TaxbitQuestionnairePersistProps['loadingComponent'];
|
|
24
|
+
onSettled?: TaxbitQuestionnairePersistProps['onSettled'];
|
|
25
|
+
onSuccess?: TaxbitQuestionnairePersistProps['onSuccess'];
|
|
24
26
|
staging?: TaxbitQuestionnairePersistProps['staging'];
|
|
25
27
|
});
|
|
26
|
-
export declare const TaxbitQuestionnaire: ({
|
|
28
|
+
export declare const TaxbitQuestionnaire: ({ bearerToken, data, demoMode, language, onError, loadingComponent, onProgress, onSettled, onSubmit, onSuccess, questionnaire, staging, }: TaxbitQuestionnaireProps) => React.JSX.Element;
|
|
@@ -5,6 +5,7 @@ export * from './formatUsTin';
|
|
|
5
5
|
export * from './getFieldsState';
|
|
6
6
|
export * from './getFormStatus';
|
|
7
7
|
export * from './getHeaders';
|
|
8
|
+
export * from './getLanguage';
|
|
8
9
|
export * from './getMaskedContent';
|
|
9
10
|
export * from './getMonthlyDayCount';
|
|
10
11
|
export * from './getPromptKeyMap';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { UseTaxDocumentationProps } from '../../contexts';
|
|
3
3
|
import { UseTaxbitPersistProps } from './useTaxbitPersist';
|
|
4
|
-
export type TaxbitQuestionnairePersistProps = UseTaxDocumentationProps & UseTaxbitPersistProps
|
|
5
|
-
|
|
4
|
+
export type TaxbitQuestionnairePersistProps = UseTaxDocumentationProps & UseTaxbitPersistProps & {
|
|
5
|
+
loadingComponent?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const TaxbitQuestionnairePersist: ({ staging, data, bearerToken, language, questionnaire, loadingComponent, onProgress, onSubmit, onSettled, onSuccess, onError, }: TaxbitQuestionnairePersistProps) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element;
|