@gusto/embedded-react-sdk 0.10.6 → 0.10.7-rc.2
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/CHANGELOG.md +7 -0
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +7 -8
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +4 -5
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.d.ts +5 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +64 -56
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -11
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +65 -59
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +8 -9
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -5
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -5
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +2 -1
- package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
- package/dist/types/i18next.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function l({
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { ActionsLayout as m } from "../ActionsLayout/ActionsLayout.js";
|
|
3
|
+
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
function f({
|
|
6
5
|
onBack: t,
|
|
7
6
|
backLabel: r,
|
|
8
7
|
submitLabel: e,
|
|
9
8
|
isLoading: i = !1
|
|
10
9
|
}) {
|
|
11
|
-
const o =
|
|
12
|
-
return /* @__PURE__ */ m
|
|
10
|
+
const o = u();
|
|
11
|
+
return /* @__PURE__ */ s(m, { children: [
|
|
13
12
|
t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
|
|
14
13
|
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
|
|
15
14
|
] });
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
f as SignatureFormActions
|
|
19
18
|
};
|
|
20
19
|
//# sourceMappingURL=SignatureFormActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAoB;AAEvC,2BACGC,GACE,EAAA,UAAA;AAAA,IACCN,KAAA,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UACHC,EAAA,CAAA;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UACHD,EAAA,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "../../../shared/constants.js";
|
|
1
|
+
import { jsxs as s, Fragment as m, jsx as e } from "react/jsx-runtime";
|
|
3
2
|
import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
|
|
4
3
|
import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
|
|
5
|
-
function
|
|
4
|
+
function p({
|
|
6
5
|
signatureLabel: r,
|
|
7
6
|
signatureDescription: i = "",
|
|
8
7
|
signatureError: t = "",
|
|
9
8
|
confirmationLabel: o,
|
|
10
9
|
confirmationError: n = ""
|
|
11
10
|
}) {
|
|
12
|
-
return /* @__PURE__ */ m
|
|
11
|
+
return /* @__PURE__ */ s(m, { children: [
|
|
13
12
|
/* @__PURE__ */ e(
|
|
14
13
|
a,
|
|
15
14
|
{
|
|
@@ -32,6 +31,6 @@ function c({
|
|
|
32
31
|
] });
|
|
33
32
|
}
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
p as SignatureFormFields
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=SignatureFormFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
|
|
@@ -14,11 +14,15 @@ type NumberFieldProps = {
|
|
|
14
14
|
isCurrency?: boolean;
|
|
15
15
|
isPercent?: boolean;
|
|
16
16
|
};
|
|
17
|
+
type TextInputProps = {
|
|
18
|
+
type?: string;
|
|
19
|
+
isPercent?: boolean;
|
|
20
|
+
};
|
|
17
21
|
export declare function QuestionInput({ questionType, ...props }: (EmpQ | CompR) & {
|
|
18
22
|
questionType: string;
|
|
19
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
24
|
export declare function SelectInput({ question, requirement, isDisabled }: EmpQ | CompR): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
-
export declare function TextInput({ question, requirement, isDisabled }: EmpQ | CompR): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
export declare function TextInput({ question, requirement, isDisabled, type, isPercent, }: (EmpQ | CompR) & TextInputProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
26
|
export declare function NumberInput({ question, requirement, isCurrency, isPercent, isDisabled, }: (EmpQ | CompR) & NumberFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
27
|
export declare function RadioInput({ question, requirement, isDisabled }: EmpQ | CompR): import("react/jsx-runtime").JSX.Element | null;
|
|
24
28
|
export declare function DateField({ question, requirement, isDisabled, }: (EmpQ | CompR) & NumberFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import b from "dompurify";
|
|
3
3
|
import { useTranslation as y } from "react-i18next";
|
|
4
|
-
import { SelectField as
|
|
4
|
+
import { SelectField as p } from "../Fields/SelectField/SelectField.js";
|
|
5
5
|
import { TextInputField as w } from "../Fields/TextInputField/TextInputField.js";
|
|
6
6
|
import { NumberInputField as k } from "../Fields/NumberInputField/NumberInputField.js";
|
|
7
7
|
import { RadioGroupField as R } from "../Fields/RadioGroupField/RadioGroupField.js";
|
|
8
8
|
import { DatePickerField as _ } from "../Fields/DatePickerField/DatePickerField.js";
|
|
9
|
-
import { useComponentContext as
|
|
10
|
-
import { useMaskedTransform as
|
|
11
|
-
const
|
|
9
|
+
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { useMaskedTransform as D } from "../../../helpers/mask.js";
|
|
11
|
+
const T = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
|
|
12
12
|
function M({
|
|
13
13
|
questionType: e,
|
|
14
14
|
...t
|
|
@@ -20,99 +20,107 @@ function M({
|
|
|
20
20
|
return /* @__PURE__ */ a(C, { ...t });
|
|
21
21
|
case "text":
|
|
22
22
|
case "account_number":
|
|
23
|
-
return /* @__PURE__ */ a(
|
|
23
|
+
return /* @__PURE__ */ a(d, { ...t });
|
|
24
24
|
case "select":
|
|
25
|
-
return /* @__PURE__ */ a(
|
|
25
|
+
return /* @__PURE__ */ a(h, { ...t });
|
|
26
26
|
case "number":
|
|
27
|
-
return /* @__PURE__ */ a(
|
|
27
|
+
return /* @__PURE__ */ a(m, { ...t });
|
|
28
28
|
case "workers_compensation_rate":
|
|
29
|
-
return /* @__PURE__ */ a(
|
|
29
|
+
return /* @__PURE__ */ a(m, { ...t, isPercent: t.requirement?.metadata?.rateType === "percent" });
|
|
30
30
|
case "percent":
|
|
31
31
|
case "tax_rate":
|
|
32
32
|
return /* @__PURE__ */ a(g, { ...t });
|
|
33
33
|
case "currency":
|
|
34
|
-
return /* @__PURE__ */ a(
|
|
34
|
+
return /* @__PURE__ */ a(m, { ...t, isCurrency: !0 });
|
|
35
35
|
default:
|
|
36
|
-
return /* @__PURE__ */ a(
|
|
36
|
+
return /* @__PURE__ */ a(d, { ...t });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const { key: r, label:
|
|
41
|
-
if (!
|
|
39
|
+
function h({ question: e, requirement: t, isDisabled: l = !1 }) {
|
|
40
|
+
const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, u = e ? e.inputQuestionFormat : t.metadata;
|
|
41
|
+
if (!u?.options) throw new Error("Select input must have options");
|
|
42
42
|
return r ? /* @__PURE__ */ a(
|
|
43
|
-
|
|
43
|
+
p,
|
|
44
44
|
{
|
|
45
45
|
isRequired: !0,
|
|
46
46
|
name: r,
|
|
47
47
|
defaultValue: n,
|
|
48
|
-
label:
|
|
49
|
-
description:
|
|
48
|
+
label: s,
|
|
49
|
+
description: o,
|
|
50
50
|
isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
|
|
51
|
-
options:
|
|
52
|
-
value:
|
|
53
|
-
label:
|
|
51
|
+
options: u.options.map((i, c) => ({
|
|
52
|
+
value: i.value,
|
|
53
|
+
label: i.label
|
|
54
54
|
}))
|
|
55
55
|
}
|
|
56
56
|
) : null;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
function d({
|
|
59
|
+
question: e,
|
|
60
|
+
requirement: t,
|
|
61
|
+
isDisabled: l = !1,
|
|
62
|
+
type: r = "text",
|
|
63
|
+
isPercent: s = !1
|
|
64
|
+
}) {
|
|
65
|
+
const { key: o, label: n, description: u } = e || t, i = e ? e.answers[0]?.value : t.value, c = t?.metadata?.mask ?? null, f = D(c);
|
|
66
|
+
return o ? /* @__PURE__ */ a(
|
|
61
67
|
w,
|
|
62
68
|
{
|
|
63
69
|
isRequired: !0,
|
|
64
|
-
name:
|
|
65
|
-
label:
|
|
66
|
-
defaultValue:
|
|
67
|
-
description:
|
|
70
|
+
name: o,
|
|
71
|
+
label: n,
|
|
72
|
+
defaultValue: i,
|
|
73
|
+
description: u,
|
|
68
74
|
isDisabled: l,
|
|
69
|
-
transform:
|
|
70
|
-
placeholder:
|
|
75
|
+
transform: c ? f : void 0,
|
|
76
|
+
placeholder: c || void 0,
|
|
77
|
+
type: r,
|
|
78
|
+
adornmentEnd: s ? "%" : void 0
|
|
71
79
|
}
|
|
72
80
|
) : null;
|
|
73
81
|
}
|
|
74
|
-
function
|
|
82
|
+
function m({
|
|
75
83
|
question: e,
|
|
76
84
|
requirement: t,
|
|
77
85
|
isCurrency: l,
|
|
78
86
|
isPercent: r,
|
|
79
|
-
isDisabled:
|
|
87
|
+
isDisabled: s = !1
|
|
80
88
|
}) {
|
|
81
|
-
const { t:
|
|
89
|
+
const { t: o } = y("common"), { key: n, label: u, description: i } = e || t, c = e ? e.answers[0]?.value : t.value;
|
|
82
90
|
if (!n) return null;
|
|
83
|
-
const
|
|
91
|
+
const f = t?.metadata?.type === "workers_compensation_rate" && t.metadata.riskClassCode !== void 0 ? `${t.metadata.riskClassCode}: ${t.metadata.riskClassDescription}` : null, v = t?.metadata?.rateType === "currency_per_hour" ? o("inputs.workersCompensationRatePerHourAdornment") : void 0;
|
|
84
92
|
return /* @__PURE__ */ a(
|
|
85
93
|
k,
|
|
86
94
|
{
|
|
87
95
|
isRequired: !0,
|
|
88
96
|
name: n,
|
|
89
|
-
label:
|
|
90
|
-
description:
|
|
97
|
+
label: u,
|
|
98
|
+
description: i ?? f,
|
|
91
99
|
defaultValue: typeof c < "u" ? Number(c) : void 0,
|
|
92
100
|
format: l ? "currency" : r ? "percent" : "decimal",
|
|
93
|
-
isDisabled:
|
|
101
|
+
isDisabled: s,
|
|
94
102
|
maximumFractionDigits: r ? 4 : void 0,
|
|
95
103
|
adornmentEnd: v
|
|
96
104
|
}
|
|
97
105
|
);
|
|
98
106
|
}
|
|
99
107
|
function C({ question: e, requirement: t, isDisabled: l = !1 }) {
|
|
100
|
-
const { key: r, label:
|
|
101
|
-
if (!
|
|
108
|
+
const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, { Text: u } = x(), i = e ? e.inputQuestionFormat : t.metadata;
|
|
109
|
+
if (!i?.options) throw new Error(`RadioInput must have options:${JSON.stringify(e)}`);
|
|
102
110
|
return r ? /* @__PURE__ */ a(
|
|
103
111
|
R,
|
|
104
112
|
{
|
|
105
113
|
isRequired: !0,
|
|
106
114
|
name: r,
|
|
107
115
|
isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
|
|
108
|
-
description:
|
|
116
|
+
description: o && /* @__PURE__ */ a(u, { as: "span", children: /* @__PURE__ */ a(
|
|
109
117
|
"span",
|
|
110
118
|
{
|
|
111
|
-
dangerouslySetInnerHTML: { __html: b.sanitize(
|
|
119
|
+
dangerouslySetInnerHTML: { __html: b.sanitize(o, T) }
|
|
112
120
|
}
|
|
113
121
|
) }),
|
|
114
|
-
label:
|
|
115
|
-
options:
|
|
122
|
+
label: s,
|
|
123
|
+
options: i.options.map((c) => ({
|
|
116
124
|
value: c.value,
|
|
117
125
|
label: c.label
|
|
118
126
|
}))
|
|
@@ -124,7 +132,7 @@ function I({
|
|
|
124
132
|
requirement: t,
|
|
125
133
|
isDisabled: l = !1
|
|
126
134
|
}) {
|
|
127
|
-
const { key: r, label:
|
|
135
|
+
const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value;
|
|
128
136
|
if (typeof n != "string" && typeof n < "u")
|
|
129
137
|
throw new Error("Expecting value to be string for DateInput");
|
|
130
138
|
return r ? /* @__PURE__ */ a(
|
|
@@ -133,38 +141,38 @@ function I({
|
|
|
133
141
|
isRequired: !0,
|
|
134
142
|
name: r,
|
|
135
143
|
defaultValue: n ? new Date(n) : null,
|
|
136
|
-
label:
|
|
137
|
-
description:
|
|
144
|
+
label: s,
|
|
145
|
+
description: o,
|
|
138
146
|
isDisabled: l
|
|
139
147
|
}
|
|
140
148
|
) : null;
|
|
141
149
|
}
|
|
142
150
|
function g({ requirement: e, question: t, ...l }) {
|
|
143
151
|
if (e) {
|
|
144
|
-
const { key: r, metadata:
|
|
145
|
-
return
|
|
146
|
-
|
|
152
|
+
const { key: r, metadata: s, label: o, description: n } = e, { validation: u } = s || {};
|
|
153
|
+
return u?.type === "one_of" ? /* @__PURE__ */ a(
|
|
154
|
+
p,
|
|
147
155
|
{
|
|
148
156
|
isRequired: !0,
|
|
149
157
|
name: r || "",
|
|
150
|
-
label:
|
|
158
|
+
label: o || "",
|
|
151
159
|
description: n,
|
|
152
|
-
options:
|
|
153
|
-
value:
|
|
154
|
-
label:
|
|
160
|
+
options: u.rates?.map((i) => ({
|
|
161
|
+
value: i,
|
|
162
|
+
label: i
|
|
155
163
|
})) || []
|
|
156
164
|
}
|
|
157
|
-
) : /* @__PURE__ */ a(d, { requirement: e, ...l, isPercent: !0 });
|
|
165
|
+
) : /* @__PURE__ */ a(d, { requirement: e, ...l, type: "number", isPercent: !0 });
|
|
158
166
|
}
|
|
159
|
-
return /* @__PURE__ */ a(d, { question: t, ...l, isPercent: !0 });
|
|
167
|
+
return /* @__PURE__ */ a(d, { question: t, ...l, type: "number", isPercent: !0 });
|
|
160
168
|
}
|
|
161
169
|
export {
|
|
162
170
|
I as DateField,
|
|
163
|
-
|
|
171
|
+
m as NumberInput,
|
|
164
172
|
M as QuestionInput,
|
|
165
173
|
C as RadioInput,
|
|
166
|
-
|
|
174
|
+
h as SelectInput,
|
|
167
175
|
g as TaxRateInput,
|
|
168
|
-
|
|
176
|
+
d as TextInput
|
|
169
177
|
};
|
|
170
178
|
//# sourceMappingURL=TaxInputs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useMaskedTransform } from '@/helpers/mask'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\nexport function TextInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n />\n )\n}\n\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={typeof value !== 'undefined' ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n if (requirement) {\n // Covers case for tax rate where the rate is a one_of option and must be submitted as a string\n // of enumerated rate values provided\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n return validation?.type === 'one_of' ? (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: rate,\n })) || []\n }\n />\n ) : (\n <NumberInput requirement={requirement} {...props} isPercent />\n )\n }\n\n return <NumberInput question={question} {...props} isPercent />\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","mask","transform","useMaskedTransform","TextInputField","isCurrency","isPercent","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","metadata","validation","rate"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAE;AAexF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACO,UAAAD,EAAa,YAAe,GAAA;AAAA,IAClC,KAAK;AACI,aAAA,gBAAAE,EAACC,GAAW,EAAA,GAAGF,EAAO,CAAA;AAAA,IAC/B,KAAK;AACI,aAAA,gBAAAC,EAACE,GAAY,EAAA,GAAGH,EAAO,CAAA;AAAA,IAChC,KAAK;AAAA,IACL,KAAK;AACI,aAAA,gBAAAC,EAACG,GAAW,EAAA,GAAGJ,EAAO,CAAA;AAAA,IAC/B,KAAK;AACI,aAAA,gBAAAC,EAACI,GAAa,EAAA,GAAGL,EAAO,CAAA;AAAA,IACjC,KAAK;AACI,aAAA,gBAAAC,EAACK,GAAa,EAAA,GAAGN,EAAO,CAAA;AAAA,IACjC,KAAK;AAED,aAAA,gBAAAC,EAACK,KAAa,GAAGN,GAAO,WAAWA,EAAM,aAAa,UAAU,aAAa,UAAW,CAAA;AAAA,IAE5F,KAAK;AAAA,IACL,KAAK;AACI,aAAA,gBAAAC,EAACM,GAAc,EAAA,GAAGP,EAAO,CAAA;AAAA,IAClC,KAAK;AACH,aAAQ,gBAAAC,EAAAK,GAAA,EAAa,GAAG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E,MAAIS,GAAa;AAGf,UAAM,EAAE,KAAAE,GAAK,UAAAwB,GAAU,OAAAvB,GAAO,aAAAC,EAAgB,IAAAJ,GACxC,EAAE,YAAA2B,MAAeD,KAAY,CAAC;AAC7B,WAAAC,GAAY,SAAS,WAC1B,gBAAAnC;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,YAAU;AAAA,QACV,MAAML,KAAO;AAAA,QACb,OAAOC,KAAS;AAAA,QAChB,aAAAC;AAAA,QACA,SACEuB,EAAW,OAAO,IAAI,CAASC,OAAA;AAAA,UAC7B,OAAOA;AAAA,UACP,OAAOA;AAAA,QACT,EAAE,KAAK,CAAA;AAAA,MAAC;AAAA,IAAA,IAIX,gBAAApC,EAAAK,GAAA,EAAY,aAAAG,GAA2B,GAAGT,GAAO,WAAS,IAAC;AAAA,EAAA;AAIhE,2BAAQM,GAAY,EAAA,UAAAE,GAAqB,GAAGR,GAAO,WAAS,IAAC;AAC/D;"}
|
|
1
|
+
{"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useMaskedTransform } from '@/helpers/mask'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\ntype TextInputProps = { type?: string; isPercent?: boolean }\n\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\nexport function TextInput({\n question,\n requirement,\n isDisabled = false,\n type = 'text',\n isPercent = false,\n}: (EmpQ | CompR) & TextInputProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n type={type}\n adornmentEnd={isPercent ? '%' : undefined}\n />\n )\n}\n\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={typeof value !== 'undefined' ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n if (requirement) {\n // Covers case for tax rate where the rate is a one_of option and must be submitted as a string\n // of enumerated rate values provided\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n return validation?.type === 'one_of' ? (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: rate,\n })) || []\n }\n />\n ) : (\n <TextInput requirement={requirement} {...props} type=\"number\" isPercent />\n )\n }\n\n return <TextInput question={question} {...props} type=\"number\" isPercent />\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","type","isPercent","mask","transform","useMaskedTransform","TextInputField","isCurrency","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","metadata","validation","rate"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAE;AAiBxF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACO,UAAAD,EAAa,YAAe,GAAA;AAAA,IAClC,KAAK;AACI,aAAA,gBAAAE,EAACC,GAAW,EAAA,GAAGF,EAAO,CAAA;AAAA,IAC/B,KAAK;AACI,aAAA,gBAAAC,EAACE,GAAY,EAAA,GAAGH,EAAO,CAAA;A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}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useAssignSignatory as s, SignatoryAssignmentMode as o } from "./useAssignSignatory.js";
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
const u = () => {
|
|
4
|
+
import a from "./AssignSignatorySelection.module.scss.js";
|
|
5
|
+
import { RadioGroupField as r } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
6
|
+
const c = () => {
|
|
8
7
|
const { t: n } = e("Company.AssignSignatory"), { onSignatoryAssignmentModeChange: t } = s();
|
|
9
|
-
return /* @__PURE__ */ i("section", { className:
|
|
10
|
-
|
|
8
|
+
return /* @__PURE__ */ i("section", { className: a.container, children: /* @__PURE__ */ i(
|
|
9
|
+
r,
|
|
11
10
|
{
|
|
12
11
|
onChange: t,
|
|
13
12
|
label: n("signingOptions.label"),
|
|
@@ -27,6 +26,6 @@ const u = () => {
|
|
|
27
26
|
) });
|
|
28
27
|
};
|
|
29
28
|
export {
|
|
30
|
-
|
|
29
|
+
c as AssignSignatorySelection
|
|
31
30
|
};
|
|
32
31
|
//# sourceMappingURL=AssignSignatorySelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":";;;;;AAKO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,iCAAAC,EAAgC,IAAIC,EAAmB;AAE/D,SACG,gBAAAC,EAAA,WAAA,EAAQ,WAAWC,EAAO,WACzB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAUJ;AAAA,MACV,OAAOF,EAAE,sBAAsB;AAAA,MAC/B,yBAAuB;AAAA,MACvB,MAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,OAAOA,EAAE,yBAAyB;AAAA,UAClC,OAAOO,EAAwB;AAAA,QACjC;AAAA,QACA;AAAA,UACE,OAAOP,EAAE,6BAA6B;AAAA,UACtC,OAAOO,EAAwB;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useCreateSignatory as
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
|
|
2
|
+
import { useTranslation as i } from "react-i18next";
|
|
3
|
+
import { useCreateSignatory as r } from "./useCreateSignatory.js";
|
|
4
|
+
import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
const f = () => {
|
|
7
|
+
const { t } = i("Company.AssignSignatory"), { isPending: n } = r(), s = m();
|
|
8
|
+
return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(s.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
|
|
10
9
|
};
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
f as Actions
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAU,IAAIC,EAAmB,GACnCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,uBAAuB,EAC5B,CAAA,GACF;AAEJ;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { useInviteSignatory as s } from "./useInviteSignatory.js";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.inviteSignatory") }) });
|
|
4
|
+
import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
const y = () => {
|
|
7
|
+
const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = m();
|
|
8
|
+
return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.inviteSignatory") }) });
|
|
10
9
|
};
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
y as Actions
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInviteSignatory } from './useInviteSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useInviteSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.inviteSignatory')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useInviteSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInviteSignatory } from './useInviteSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useInviteSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.inviteSignatory')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useInviteSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAU,IAAIC,EAAmB,GACnCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,yBAAyB,EAC9B,CAAA,GACF;AAEJ;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { useBankAccountForm as m } from "./context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { componentEvents as p } from "../../../../shared/constants.js";
|
|
7
7
|
function B() {
|
|
8
|
-
const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n =
|
|
9
|
-
return /* @__PURE__ */ e(
|
|
8
|
+
const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n = u();
|
|
9
|
+
return /* @__PURE__ */ e(a, { children: [
|
|
10
10
|
r && /* @__PURE__ */ o(
|
|
11
11
|
n.Button,
|
|
12
12
|
{
|
|
13
13
|
type: "button",
|
|
14
14
|
variant: "secondary",
|
|
15
15
|
onClick: () => {
|
|
16
|
-
c(
|
|
16
|
+
c(p.COMPANY_BANK_ACCOUNT_CANCEL);
|
|
17
17
|
},
|
|
18
18
|
children: t("cancelCta")
|
|
19
19
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as i } from "react-i18next";
|
|
3
3
|
import { useBankAccount as a } from "./context.js";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ e(m, { children: [
|
|
4
|
+
import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
function d() {
|
|
7
|
+
const { handleContinue: c, handleChange: r } = a(), { t: n } = i("Company.BankAccount"), o = m();
|
|
8
|
+
return /* @__PURE__ */ e(s, { children: [
|
|
10
9
|
/* @__PURE__ */ t(o.Button, { variant: "secondary", onClick: r, children: n("changeBankAccountCta") }),
|
|
11
10
|
/* @__PURE__ */ t(o.Button, { onClick: c, children: n("continueCta") })
|
|
12
11
|
] });
|
|
13
12
|
}
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
d as Actions
|
|
16
15
|
};
|
|
17
16
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { handleContinue, handleChange } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleChange}>\n {t('changeBankAccountCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleContinue","handleChange","useBankAccount","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { handleContinue, handleChange } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleChange}>\n {t('changeBankAccountCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleContinue","handleChange","useBankAccount","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,gBAAAC,GAAgB,cAAAC,EAAa,IAAIC,EAAe,GAClD,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAEE,EAAA,sBAAsB,EAC3B,CAAA;AAAA,IACA,gBAAAK,EAACH,EAAW,QAAX,EAAkB,SAASL,GAAiB,UAAAG,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useBankAccountVerify as r } from "./context.js";
|
|
4
|
-
import "../../../../shared/constants.js";
|
|
5
4
|
import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
5
|
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
-
function
|
|
8
|
-
const { t } = e("Company.BankAccount"), { isPending:
|
|
6
|
+
function y() {
|
|
7
|
+
const { t: n } = e("Company.BankAccount"), { isPending: t, handleCancel: a } = r(), o = m();
|
|
9
8
|
return /* @__PURE__ */ c(s, { children: [
|
|
10
9
|
/* @__PURE__ */ i(
|
|
11
10
|
o.Button,
|
|
12
11
|
{
|
|
13
12
|
variant: "secondary",
|
|
14
|
-
isLoading:
|
|
13
|
+
isLoading: t,
|
|
15
14
|
onClick: a,
|
|
16
15
|
"data-testid": "bank-account-verify-cancel",
|
|
17
|
-
children:
|
|
16
|
+
children: n("cancelCta")
|
|
18
17
|
}
|
|
19
18
|
),
|
|
20
19
|
/* @__PURE__ */ i(
|
|
21
20
|
o.Button,
|
|
22
21
|
{
|
|
23
22
|
type: "submit",
|
|
24
|
-
isLoading:
|
|
23
|
+
isLoading: t,
|
|
25
24
|
"data-testid": "bank-account-verify-submit",
|
|
26
|
-
children:
|
|
25
|
+
children: n("verifyCta")
|
|
27
26
|
}
|
|
28
27
|
)
|
|
29
28
|
] });
|
|
30
29
|
}
|
|
31
30
|
export {
|
|
32
|
-
|
|
31
|
+
y as Actions
|
|
33
32
|
};
|
|
34
33
|
//# sourceMappingURL=Actions.js.map
|