@gusto/embedded-react-sdk 0.9.0 → 0.10.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/CHANGELOG.md +82 -2
- package/dist/components/Common/OnboardingStatusBadge/index.d.ts +21 -0
- package/dist/components/Common/OnboardingStatusBadge/index.js +17 -0
- package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -0
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -7
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +5 -4
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +42 -36
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +6 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +11 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -4
- package/dist/components/Contractor/List/index.d.ts +25 -0
- package/dist/components/Contractor/List/index.js +84 -0
- package/dist/components/Contractor/List/index.js.map +1 -0
- package/dist/components/Contractor/List/useContractorList.d.ts +20 -0
- package/dist/components/Contractor/List/useContractorList.js +31 -0
- package/dist/components/Contractor/List/useContractorList.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.d.ts +2 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +53 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +31 -0
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +108 -0
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +11 -0
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +35 -0
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/types.d.ts +8 -0
- package/dist/components/Contractor/index.d.ts +2 -0
- package/dist/components/Contractor/index.js +6 -2
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +59 -56
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +6 -5
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/useCompensation.d.ts +2 -0
- package/dist/components/Employee/Compensation/useCompensation.js +16 -14
- package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +9 -8
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +14 -5
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +25 -25
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +5 -4
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +58 -53
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +48 -43
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +3 -4
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +88 -76
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +29 -25
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +49 -20
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +27 -25
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -9
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +124 -120
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +1 -1
- package/dist/components/Employee/Taxes/StateForm.js +27 -25
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +77 -73
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/I18n.js +15 -15
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +25 -0
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -0
- package/dist/i18n/en/Contractor.PaymentMethod.json.js +35 -0
- package/dist/i18n/en/Contractor.PaymentMethod.json.js.map +1 -0
- package/dist/i18n/en/Employee.Compensation.json.js +22 -20
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +18 -17
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +21 -9
- package/dist/i18n/en/common.json.js +35 -23
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/shared/constants.d.ts +14 -0
- package/dist/shared/constants.js +26 -15
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +52 -1
- package/package.json +4 -3
- package/dist/components/Employee/PaymentMethod/Constants.d.ts +0 -8
- package/dist/components/Employee/PaymentMethod/Constants.js +0 -6
- package/dist/components/Employee/PaymentMethod/Constants.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Added contractor payment method with custom validation, including handling for masked account numbers
|
|
8
|
+
- Added `annualMaximum` field to DeductionForm with comprehensive tests
|
|
9
|
+
- Added PaymentMethod percentage validation tests
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- Correctly set version for employee taxes
|
|
14
|
+
- Set correct mode on deductions cancel
|
|
15
|
+
- Skip state taxes for states that only have questions for admins
|
|
16
|
+
- Allow special characters in user name
|
|
17
|
+
- Fix split validation
|
|
18
|
+
- Fix withholding allowance of 0 causing error on state tax submission
|
|
19
|
+
- Restore proper SSN validation
|
|
20
|
+
- Update rate to not be labeled optional when it is required
|
|
21
|
+
|
|
22
|
+
### Chores & Maintenance
|
|
23
|
+
|
|
24
|
+
- Upgrade embedded API version to 0.6.4
|
|
25
|
+
- Update changelog with breaking changes and update docs
|
|
26
|
+
|
|
3
27
|
## 0.9.0
|
|
4
28
|
|
|
5
29
|
- Added new Contractor.Address form component for managing contractor address information
|
|
@@ -9,6 +33,10 @@
|
|
|
9
33
|
- Fixed state tax boolean validation issues
|
|
10
34
|
- Updated Gusto embedded-api version to the latest
|
|
11
35
|
|
|
36
|
+
### Breaking changes
|
|
37
|
+
|
|
38
|
+
Be sure to note the breaking change listed below for version 0.8.2 around component renaming and removal of the top level Flow component.
|
|
39
|
+
|
|
12
40
|
## 0.8.2
|
|
13
41
|
|
|
14
42
|
- Refactored employee flow components structure and improved organization within Employee namespace
|
|
@@ -17,6 +45,56 @@
|
|
|
17
45
|
- Fixed commission Zod schema validation issues
|
|
18
46
|
- Fixed issue with headers not being passed properly through our API client
|
|
19
47
|
|
|
48
|
+
### Breaking changes
|
|
49
|
+
|
|
50
|
+
> Note: We are pre alpha and are regularly iterating on the SDK as we learn more about our consumers and their needs which sometimes involves breaking changes. [Read more about our current versioning strategy here](./docs/04/01/versioning.md).
|
|
51
|
+
|
|
52
|
+
#### Rename components to remove the "Flow" naming suffix
|
|
53
|
+
|
|
54
|
+
The following components have been updated to remove the "Flow" naming suffix.
|
|
55
|
+
|
|
56
|
+
| Old name | Updated name |
|
|
57
|
+
| ----------------------------- | ------------------------- |
|
|
58
|
+
| `Employee.DocumentSignerFlow` | `Employee.DocumentSigner` |
|
|
59
|
+
| `Company.LocationsFlow` | `Company.Locations` |
|
|
60
|
+
| `Company.BankAccountFlow` | `Company.BankAccount` |
|
|
61
|
+
| `Company.StateTaxesFlow` | `Company.StateTaxes` |
|
|
62
|
+
| `Company.DocumentSignerFlow` | `Company.DocumentSigner` |
|
|
63
|
+
|
|
64
|
+
#### Removed top level Flow component and renamed flow subcomponents
|
|
65
|
+
|
|
66
|
+
We have removed the top level `Flow` component and have migrated the flow subcomponents to `Employee` and `Company` respectively.
|
|
67
|
+
|
|
68
|
+
| Old name | Updated name |
|
|
69
|
+
| --------------------------------- | ----------------------------- |
|
|
70
|
+
| `Flow.EmployeeOnboardingFlow` | `Employee.OnboardingFlow` |
|
|
71
|
+
| `Flow.EmployeeSelfOnboardingFlow` | `Employee.SelfOnboardingFlow` |
|
|
72
|
+
|
|
73
|
+
Some examples of before/after:
|
|
74
|
+
|
|
75
|
+
_Before_
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { Flow } from '@gusto/embedded-react-sdk'
|
|
79
|
+
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
<Flow.EmployeeOnboardingFlow ... />
|
|
83
|
+
<Flow.EmployeeSelfOnboardingFlow ... />
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
_After_
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { Employee } from '@gusto/embedded-react-sdk'
|
|
91
|
+
|
|
92
|
+
...
|
|
93
|
+
|
|
94
|
+
<Employee.OnboardingFlow ... />
|
|
95
|
+
<Employee.SelfOnboardingFlow ... />
|
|
96
|
+
```
|
|
97
|
+
|
|
20
98
|
## 0.8.1
|
|
21
99
|
|
|
22
100
|
- Replaced Valibot with Zod for bundle size reduction. Also included zod as a dependency
|
|
@@ -125,7 +203,9 @@ You would do the following instead::
|
|
|
125
203
|
>
|
|
126
204
|
```
|
|
127
205
|
|
|
128
|
-
#### DocumentSigner has been renamed to
|
|
206
|
+
#### DocumentSigner has been renamed to DocumentSignerFlow
|
|
207
|
+
|
|
208
|
+
> This was actually reverted in 0.8.2. If you have DocumentSigner as the component name, you can continue to use that if you are on 0.8.2 or later. Between 0.7.0 up until 0.8.2 the naming is DocumentSignerFlow
|
|
129
209
|
|
|
130
210
|
Where you would previously do
|
|
131
211
|
|
|
@@ -136,7 +216,7 @@ Where you would previously do
|
|
|
136
216
|
You should update the naming as follows:
|
|
137
217
|
|
|
138
218
|
```tsx
|
|
139
|
-
<Employee.
|
|
219
|
+
<Employee.DocumentSignerFlow employeeId="some-id" onEvent={() => {}} />
|
|
140
220
|
```
|
|
141
221
|
|
|
142
222
|
## 0.6.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
import { ContractorOnboardingStatus1 } from '@gusto/embedded-api/models/components/contractor';
|
|
3
|
+
import { OnboardingStatus } from '@gusto/embedded-api/models/components/employee';
|
|
4
|
+
type OnboardingStatuses = ContractorOnboardingStatus1 | OnboardingStatus;
|
|
5
|
+
interface OnboardingStatusBadgeProps<T extends OnboardingStatuses> {
|
|
6
|
+
onboarded?: boolean;
|
|
7
|
+
onboardingEntity: 'contractor' | 'employee';
|
|
8
|
+
onboardingStatus?: T | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const OnboardingStatusBadge: <T extends OnboardingStatuses>({ onboarded, onboardingEntity, onboardingStatus, }: OnboardingStatusBadgeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface ContractorOnboardingStatusBadgeProps {
|
|
12
|
+
onboarded?: boolean;
|
|
13
|
+
onboardingStatus?: ContractorOnboardingStatus1 | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const ContractorOnboardingStatusBadge: (props: ContractorOnboardingStatusBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface EmployeeOnboardingStatusBadgeProps {
|
|
17
|
+
onboarded?: boolean;
|
|
18
|
+
onboardingStatus?: OnboardingStatus | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const EmployeeOnboardingStatusBadge: (props: EmployeeOnboardingStatusBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as i } from "react-i18next";
|
|
3
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
const o = ({
|
|
5
|
+
onboarded: t,
|
|
6
|
+
onboardingEntity: r,
|
|
7
|
+
onboardingStatus: a
|
|
8
|
+
}) => {
|
|
9
|
+
const { Badge: e } = d(), { t: s } = i();
|
|
10
|
+
return /* @__PURE__ */ n(e, { status: t ? "success" : "warning", children: s(`onboardingStatus.${r}.${a ?? "undefined"}`) });
|
|
11
|
+
}, m = (t) => /* @__PURE__ */ n(o, { ...t, onboardingEntity: "contractor" }), p = (t) => /* @__PURE__ */ n(o, { ...t, onboardingEntity: "employee" });
|
|
12
|
+
export {
|
|
13
|
+
m as ContractorOnboardingStatusBadge,
|
|
14
|
+
p as EmployeeOnboardingStatusBadge,
|
|
15
|
+
o as OnboardingStatusBadge
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Common/OnboardingStatusBadge/index.tsx"],"sourcesContent":["import type { ContractorOnboardingStatus1 } from '@gusto/embedded-api/models/components/contractor'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/components/employee'\nimport { useTranslation } from 'react-i18next'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype OnboardingStatuses = ContractorOnboardingStatus1 | OnboardingStatus\n\ninterface OnboardingStatusBadgeProps<T extends OnboardingStatuses> {\n onboarded?: boolean\n onboardingEntity: 'contractor' | 'employee'\n onboardingStatus?: T | null\n}\nexport const OnboardingStatusBadge = <T extends OnboardingStatuses>({\n onboarded,\n onboardingEntity,\n onboardingStatus,\n}: OnboardingStatusBadgeProps<T>) => {\n const { Badge } = useComponentContext()\n const { t } = useTranslation()\n\n //HACK: `never` should instead be a better type\n return (\n <Badge status={onboarded ? 'success' : 'warning'}>\n {t(`onboardingStatus.${onboardingEntity}.${onboardingStatus ?? 'undefined'}` as never)}\n </Badge>\n )\n}\n\ninterface ContractorOnboardingStatusBadgeProps {\n onboarded?: boolean\n onboardingStatus?: ContractorOnboardingStatus1 | null\n}\nexport const ContractorOnboardingStatusBadge = (props: ContractorOnboardingStatusBadgeProps) => (\n <OnboardingStatusBadge {...props} onboardingEntity=\"contractor\" />\n)\n\ninterface EmployeeOnboardingStatusBadgeProps {\n onboarded?: boolean\n onboardingStatus?: OnboardingStatus | null\n}\nexport const EmployeeOnboardingStatusBadge = (props: EmployeeOnboardingStatusBadgeProps) => (\n <OnboardingStatusBadge {...props} onboardingEntity=\"employee\" />\n)\n"],"names":["OnboardingStatusBadge","onboarded","onboardingEntity","onboardingStatus","Badge","useComponentContext","t","useTranslation","jsx","ContractorOnboardingStatusBadge","props","EmployeeOnboardingStatusBadge"],"mappings":";;;AAYO,MAAMA,IAAwB,CAA+B;AAAA,EAClE,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACF,MAAqC;AAC7B,QAAA,EAAE,OAAAC,EAAM,IAAIC,EAAoB,GAChC,EAAE,GAAAC,EAAE,IAAIC,EAAe;AAG7B,SACG,gBAAAC,EAAAJ,GAAA,EAAM,QAAQH,IAAY,YAAY,WACpC,UAAEK,EAAA,oBAAoBJ,CAAgB,IAAIC,KAAoB,WAAW,EAAW,GACvF;AAEJ,GAMaM,IAAkC,CAACC,MAC9C,gBAAAF,EAACR,KAAuB,GAAGU,GAAO,kBAAiB,aAAa,CAAA,GAOrDC,IAAgC,CAACD,MAC5C,gBAAAF,EAACR,KAAuB,GAAGU,GAAO,kBAAiB,WAAW,CAAA;"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "../../../shared/constants.js";
|
|
3
|
+
import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
|
|
4
|
+
import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
function l({
|
|
5
6
|
onBack: t,
|
|
6
7
|
backLabel: r,
|
|
7
8
|
submitLabel: e,
|
|
8
9
|
isLoading: i = !1
|
|
9
10
|
}) {
|
|
10
|
-
const o =
|
|
11
|
-
return /* @__PURE__ */ s
|
|
11
|
+
const o = p();
|
|
12
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
12
13
|
t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
|
|
13
14
|
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
|
|
14
15
|
] });
|
|
15
16
|
}
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
l as SignatureFormActions
|
|
18
19
|
};
|
|
19
20
|
//# 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,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../../shared/constants.js";
|
|
2
3
|
import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
|
|
3
4
|
import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
|
|
4
|
-
function
|
|
5
|
+
function c({
|
|
5
6
|
signatureLabel: r,
|
|
6
7
|
signatureDescription: i = "",
|
|
7
8
|
signatureError: t = "",
|
|
8
9
|
confirmationLabel: o,
|
|
9
10
|
confirmationError: n = ""
|
|
10
11
|
}) {
|
|
11
|
-
return /* @__PURE__ */ s
|
|
12
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
12
13
|
/* @__PURE__ */ e(
|
|
13
14
|
a,
|
|
14
15
|
{
|
|
@@ -31,6 +32,6 @@ function p({
|
|
|
31
32
|
] });
|
|
32
33
|
}
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
c as SignatureFormFields
|
|
35
36
|
};
|
|
36
37
|
//# 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;"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import v from "dompurify";
|
|
3
3
|
import { useTranslation as w } from "react-i18next";
|
|
4
|
-
import { SelectField as
|
|
5
|
-
import { TextInputField as
|
|
4
|
+
import { SelectField as y } from "../Fields/SelectField/SelectField.js";
|
|
5
|
+
import { TextInputField as b } from "../Fields/TextInputField/TextInputField.js";
|
|
6
6
|
import { NumberInputField as k } from "../Fields/NumberInputField/NumberInputField.js";
|
|
7
7
|
import { RadioGroupField as _ } from "../Fields/RadioGroupField/RadioGroupField.js";
|
|
8
8
|
import { DatePickerField as D } from "../Fields/DatePickerField/DatePickerField.js";
|
|
9
|
-
import { useComponentContext as
|
|
10
|
-
import { useMaskedTransform as
|
|
11
|
-
const
|
|
9
|
+
import { useComponentContext as R } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { useMaskedTransform as h } from "../../../helpers/mask.js";
|
|
11
|
+
const C = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
|
|
12
12
|
function V({
|
|
13
13
|
questionType: t,
|
|
14
14
|
...e
|
|
15
15
|
}) {
|
|
16
16
|
switch (t.toLowerCase()) {
|
|
17
17
|
case "date":
|
|
18
|
-
return /* @__PURE__ */ r(g, { ...e });
|
|
19
|
-
case "radio":
|
|
20
18
|
return /* @__PURE__ */ r(I, { ...e });
|
|
19
|
+
case "radio":
|
|
20
|
+
return /* @__PURE__ */ r(x, { ...e });
|
|
21
21
|
case "text":
|
|
22
22
|
case "account_number":
|
|
23
|
-
return /* @__PURE__ */ r(
|
|
23
|
+
return /* @__PURE__ */ r(f, { ...e });
|
|
24
24
|
case "select":
|
|
25
|
-
return /* @__PURE__ */ r(
|
|
25
|
+
return /* @__PURE__ */ r(T, { ...e });
|
|
26
26
|
case "number":
|
|
27
27
|
return /* @__PURE__ */ r(d, { ...e });
|
|
28
28
|
case "workers_compensation_rate":
|
|
@@ -33,38 +33,40 @@ function V({
|
|
|
33
33
|
case "currency":
|
|
34
34
|
return /* @__PURE__ */ r(d, { ...e, isCurrency: !0 });
|
|
35
35
|
default:
|
|
36
|
-
return /* @__PURE__ */ r(
|
|
36
|
+
return /* @__PURE__ */ r(f, { ...e });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function T({ question: t, requirement: e, isDisabled: s = !1 }) {
|
|
40
40
|
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value, o = t ? t.inputQuestionFormat : e.metadata;
|
|
41
41
|
if (!o?.options) throw new Error("Select input must have options");
|
|
42
42
|
return a ? /* @__PURE__ */ r(
|
|
43
|
-
|
|
43
|
+
y,
|
|
44
44
|
{
|
|
45
|
+
isRequired: !0,
|
|
45
46
|
name: a,
|
|
46
47
|
defaultValue: n,
|
|
47
48
|
label: i,
|
|
48
49
|
description: l,
|
|
49
50
|
isDisabled: a.includes("fileNewHireReport") ? n !== void 0 : s,
|
|
50
|
-
options: o.options.map((
|
|
51
|
-
value:
|
|
52
|
-
label:
|
|
51
|
+
options: o.options.map((u, c) => ({
|
|
52
|
+
value: u.value,
|
|
53
|
+
label: u.label
|
|
53
54
|
}))
|
|
54
55
|
}
|
|
55
56
|
) : null;
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value, o = e?.metadata?.mask ?? null,
|
|
58
|
+
function f({ question: t, requirement: e, isDisabled: s = !1 }) {
|
|
59
|
+
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value, o = e?.metadata?.mask ?? null, u = h(o);
|
|
59
60
|
return a ? /* @__PURE__ */ r(
|
|
60
|
-
|
|
61
|
+
b,
|
|
61
62
|
{
|
|
63
|
+
isRequired: !0,
|
|
62
64
|
name: a,
|
|
63
65
|
label: i,
|
|
64
66
|
defaultValue: n,
|
|
65
67
|
description: l,
|
|
66
68
|
isDisabled: s,
|
|
67
|
-
transform: o ?
|
|
69
|
+
transform: o ? u : void 0,
|
|
68
70
|
placeholder: o || void 0
|
|
69
71
|
}
|
|
70
72
|
) : null;
|
|
@@ -76,16 +78,17 @@ function d({
|
|
|
76
78
|
isPercent: a,
|
|
77
79
|
isDisabled: i = !1
|
|
78
80
|
}) {
|
|
79
|
-
const { t: l } = w("common"), { key: n, label: o, description:
|
|
81
|
+
const { t: l } = w("common"), { key: n, label: o, description: u } = t || e, c = t ? t.answers[0]?.value : e.value;
|
|
80
82
|
if (!n) return null;
|
|
81
|
-
const
|
|
83
|
+
const m = e?.metadata?.type === "workers_compensation_rate" && e.metadata.riskClassCode !== void 0 ? `${e.metadata.riskClassCode}: ${e.metadata.riskClassDescription}` : null, p = e?.metadata?.rateType === "currency_per_hour" ? l("inputs.workersCompensationRatePerHourAdornment") : void 0;
|
|
82
84
|
return /* @__PURE__ */ r(
|
|
83
85
|
k,
|
|
84
86
|
{
|
|
87
|
+
isRequired: !0,
|
|
85
88
|
name: n,
|
|
86
89
|
label: o,
|
|
87
|
-
description:
|
|
88
|
-
defaultValue: Number(
|
|
90
|
+
description: u ?? m,
|
|
91
|
+
defaultValue: typeof c < "u" ? Number(c) : void 0,
|
|
89
92
|
format: s ? "currency" : a ? "percent" : "decimal",
|
|
90
93
|
isDisabled: i,
|
|
91
94
|
maximumFractionDigits: a ? 4 : void 0,
|
|
@@ -93,38 +96,41 @@ function d({
|
|
|
93
96
|
}
|
|
94
97
|
);
|
|
95
98
|
}
|
|
96
|
-
function
|
|
97
|
-
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value, { Text: o } =
|
|
98
|
-
if (!
|
|
99
|
+
function x({ question: t, requirement: e, isDisabled: s = !1 }) {
|
|
100
|
+
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value, { Text: o } = R(), u = t ? t.inputQuestionFormat : e.metadata;
|
|
101
|
+
if (!u?.options) throw new Error(`RadioInput must have options:${JSON.stringify(t)}`);
|
|
99
102
|
return a ? /* @__PURE__ */ r(
|
|
100
103
|
_,
|
|
101
104
|
{
|
|
105
|
+
isRequired: !0,
|
|
102
106
|
name: a,
|
|
103
107
|
isDisabled: a.includes("fileNewHireReport") ? n !== void 0 : s,
|
|
104
108
|
description: l && /* @__PURE__ */ r(o, { as: "span", children: /* @__PURE__ */ r(
|
|
105
109
|
"span",
|
|
106
110
|
{
|
|
107
|
-
dangerouslySetInnerHTML: { __html: v.sanitize(l,
|
|
111
|
+
dangerouslySetInnerHTML: { __html: v.sanitize(l, C) }
|
|
108
112
|
}
|
|
109
113
|
) }),
|
|
110
114
|
label: i,
|
|
111
|
-
options:
|
|
112
|
-
value:
|
|
113
|
-
label:
|
|
115
|
+
options: u.options.map((c) => ({
|
|
116
|
+
value: c.value,
|
|
117
|
+
label: c.label
|
|
114
118
|
}))
|
|
115
119
|
}
|
|
116
120
|
) : null;
|
|
117
121
|
}
|
|
118
|
-
function
|
|
122
|
+
function I({
|
|
119
123
|
question: t,
|
|
120
124
|
requirement: e,
|
|
121
125
|
isDisabled: s = !1
|
|
122
126
|
}) {
|
|
123
127
|
const { key: a, label: i, description: l } = t || e, n = t ? t.answers[0]?.value : e.value;
|
|
124
|
-
if (typeof n != "string"
|
|
128
|
+
if (typeof n != "string" && typeof n < "u")
|
|
129
|
+
throw new Error("Expecting value to be string for DateInput");
|
|
125
130
|
return a ? /* @__PURE__ */ r(
|
|
126
131
|
D,
|
|
127
132
|
{
|
|
133
|
+
isRequired: !0,
|
|
128
134
|
name: a,
|
|
129
135
|
defaultValue: n ? new Date(n) : null,
|
|
130
136
|
label: i,
|
|
@@ -134,11 +140,11 @@ function g({
|
|
|
134
140
|
) : null;
|
|
135
141
|
}
|
|
136
142
|
export {
|
|
137
|
-
|
|
143
|
+
I as DateField,
|
|
138
144
|
d as NumberInput,
|
|
139
145
|
V as QuestionInput,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
x as RadioInput,
|
|
147
|
+
T as SelectInput,
|
|
148
|
+
f as TextInput
|
|
143
149
|
};
|
|
144
150
|
//# 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 <NumberInput {...props} isPercent />\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 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 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}\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 name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={Number(value)}\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 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') throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\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"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","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"],"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,I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G,QAAQC,EAAY;AAClE,MAAI,OAAOK,KAAU,SAAgB,OAAA,IAAI,MAAM,4CAA4C;AAEvF,SAACH,IAGH,gBAAAT;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,MAAMvB;AAAA,MACN,cAAcG,IAAQ,IAAI,KAAKA,CAAK,IAAI;AAAA,MACxC,OAAAF;AAAA,MACA,aAAAC;AAAA,MACA,YAAAH;AAAA,IAAA;AAAA,EACF,IATe;AAWnB;"}
|
|
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 <NumberInput {...props} isPercent />\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}\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"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","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"],"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;AACH,aAAQ,gBAAAC,EAAAK,GAAA,EAAa,GAAGN,GAAO,WAAS,IAAC;AAAA,IAC3C,KAAK;AACH,aAAQ,gBAAAC,EAAAK,GAAA,EAAa,GAAGN,GAAO,YAAU,IAAC;AAAA,IAC5C;AACS,aAAA,gBAAAC,EAACG,GAAW,EAAA,GAAGJ,EAAO,CAAA;AAAA,EAAA;AAGnC;AAEO,SAASK,EAAY,EAAE,UAAAE,GAAU,aAAAC,GAAa,YAAAC,IAAa,MAAuB;AACvF,QAAM,EAAE,KAAAC,GAAK,OAAAC,GAAO,aAAAC,EAAY,IAAIL,KAAsBC,GACpDK,IAAQN,IAAWA,EAAS,QAAQ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A4B,GAAA,EAAK,IAAG,QACP,UAAA,gBAAA5B;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,yBAAyB,EAAE,QAAQ+B,EAAU,SAASpB,GAAaf,CAAe,EAAE;AAAA,QAAA;AAAA,MAAA,GAExF;AAAA,MAGJ,OAAAc;AAAA,MACA,SAASG,EAAK,QAAQ,IAAI,CAASE,OAAA;AAAA,QACjC,OAAOA,EAAK;AAAA,QACZ,OAAOA,EAAK;AAAA,MAAA,EACZ;AAAA,IAAA;AAAA,EACJ,IAxBe;AA0BnB;AAEO,SAASd,EAAU;AAAA,EACxB,UAAAK;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AACf,GAAsC;AACpC,QAAM,EAAE,KAAAC,GAAK,OAAAC,GAAO,aAAAC,EAAY,IAAIL,KAAsBC,GACpDK,IAAQN,IAAWA,EAAS,QAAQ,CAAC,GAAG,QAAQC,EAAY;AAClE,MAAI,OAAOK,KAAU,YAAY,OAAOA,IAAU;AAC1C,UAAA,IAAI,MAAM,4CAA4C;AAE1D,SAACH,IAGH,gBAAAT;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,MAAMvB;AAAA,MACN,cAAcG,IAAQ,IAAI,KAAKA,CAAK,IAAI;AAAA,MACxC,OAAAF;AAAA,MACA,aAAAC;AAAA,MACA,YAAAH;AAAA,IAAA;AAAA,EACF,IAVe;AAYnB;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
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
|
-
|
|
4
|
+
import r from "./AssignSignatorySelection.module.scss.js";
|
|
5
|
+
import "../../../shared/constants.js";
|
|
6
|
+
import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
7
|
+
const u = () => {
|
|
7
8
|
const { t: n } = e("Company.AssignSignatory"), { onSignatoryAssignmentModeChange: t } = s();
|
|
8
|
-
return /* @__PURE__ */ i("section", { className:
|
|
9
|
-
|
|
9
|
+
return /* @__PURE__ */ i("section", { className: r.container, children: /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
10
11
|
{
|
|
11
12
|
onChange: t,
|
|
12
13
|
label: n("signingOptions.label"),
|
|
@@ -26,6 +27,6 @@ const c = () => {
|
|
|
26
27
|
) });
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
u as AssignSignatorySelection
|
|
30
31
|
};
|
|
31
32
|
//# 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,13 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useCreateSignatory as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useTranslation as r } from "react-i18next";
|
|
3
|
+
import { useCreateSignatory as s } from "./useCreateSignatory.js";
|
|
4
|
+
import "../../../../shared/constants.js";
|
|
5
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
|
+
import { useComponentContext as e } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
const y = () => {
|
|
8
|
+
const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = e();
|
|
9
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
y as Actions
|
|
12
13
|
};
|
|
13
14
|
//# 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,13 +1,14 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
4
|
+
import "../../../../shared/constants.js";
|
|
5
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
|
+
import { useComponentContext as e } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
const f = () => {
|
|
8
|
+
const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = e();
|
|
9
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.inviteSignatory") }) });
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
f as Actions
|
|
12
13
|
};
|
|
13
14
|
//# 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,13 +1,14 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { useBankAccountForm as m } from "./context.js";
|
|
4
|
+
import "../../../../shared/constants.js";
|
|
4
5
|
import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
6
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
function
|
|
7
|
+
function C() {
|
|
7
8
|
const { t: o } = r("Company.BankAccount"), { isPending: n } = m(), i = c();
|
|
8
9
|
return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: n, "data-testid": "bank-account-submit", children: o("continueCta") }) });
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
C as Actions
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useBankAccountForm","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useBankAccountForm","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,EAAU,IAAIC,EAAmB,GACnCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,uBAChE,UAAEF,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
|