@gusto/embedded-react-sdk 0.21.0 → 0.23.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 +62 -0
- package/README.md +32 -17
- package/dist/assets/icons/eye.svg.js +10 -0
- package/dist/assets/icons/eye.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-outline.svg.js +10 -0
- package/dist/assets/icons/icon-file-outline.svg.js.map +1 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js +10 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js.map +1 -0
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +14 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -0
- package/dist/components/Common/FlowBreadcrumbs/index.d.ts +1 -0
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js +7 -7
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.js +10 -7
- package/dist/components/Common/UI/Button/ButtonIcon.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +7 -7
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/index.d.ts +2 -0
- package/dist/components/Company/index.js +20 -16
- package/dist/components/Company/index.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +7 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +7 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +204 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -9
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +140 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +39 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +132 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +139 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +2 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js +6 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +26 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +16 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +31 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/index.d.ts +3 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +7 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +122 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +26 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +17 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +114 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +9 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +49 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +12 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +116 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +10 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/types.d.ts +8 -0
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +26 -26
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +1 -0
- package/dist/components/Contractor/index.js +4 -2
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +62 -77
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +83 -50
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +56 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +159 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/FederalTaxes/FederalForm.js +86 -32
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +62 -46
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +25 -23
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +116 -106
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
- package/dist/components/Employee/Profile/HomeAddress.js +9 -8
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/Taxes/FederalForm.js +86 -32
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +97 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.d.ts +3 -3
- package/dist/components/Flow/Flow.js +35 -31
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +46 -39
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js +8 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +71 -72
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +21 -22
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +19 -19
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +17 -16
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -35
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +75 -68
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +66 -65
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +127 -103
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +254 -185
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/{FastAchThresholdExceeded.d.ts → FastAchSubmissionBlockerBanner.d.ts} +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +55 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -1
- package/dist/components/Payroll/index.js +8 -6
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +9 -11
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LocaleProvider/useLocale.d.ts +6 -3
- package/dist/contexts/LocaleProvider/useLocale.js +12 -9
- package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
- package/dist/helpers/currencyHelpers.d.ts +2 -0
- package/dist/helpers/currencyHelpers.js +6 -0
- package/dist/helpers/currencyHelpers.js.map +1 -0
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +10 -10
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +40 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +24 -0
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +36 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -0
- package/dist/i18n/en/Employee.Deductions.json.js +58 -46
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +49 -41
- package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +53 -45
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +35 -31
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/shared/constants.d.ts +18 -0
- package/dist/shared/constants.js +73 -59
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +182 -125
- package/package.json +18 -18
- package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +0 -19
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +0 -18
- package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +0 -6
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +0 -52
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +0 -24
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAMO,MAAMA,IAA0B;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAeM,CAACC,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [C, d] = o("BankAccountContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as BankAccountFormProvider,
|
|
18
|
+
C as useBankAccountForm
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport { type OnEventType } from '@/components/Base/useBase'\nimport { type EventType } from '@/shared/constants'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n isEditing: boolean\n onEvent: OnEventType<EventType, unknown>\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport { type OnEventType } from '@/components/Base/useBase'\nimport { type EventType } from '@/shared/constants'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n isEditing: boolean\n onEvent: OnEventType<EventType, unknown>\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,oBAAoB;"}
|
|
@@ -11,13 +11,12 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [a, d] = t(
|
|
17
16
|
"CompanyDocumentListContext"
|
|
18
17
|
);
|
|
19
18
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
d as DocumentListProvider,
|
|
20
|
+
a as useDocumentList
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -11,13 +11,12 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = o(
|
|
17
16
|
"CompanySignatureFormContext"
|
|
18
17
|
);
|
|
19
18
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
d as SignatureFormProvider,
|
|
20
|
+
c as useSignatureForm
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=useSignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -13,19 +13,18 @@ import "classnames";
|
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
14
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
15
|
import "dompurify";
|
|
16
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
17
16
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const
|
|
17
|
+
const C = o.object({
|
|
19
18
|
federalEin: o.string().optional(),
|
|
20
19
|
taxPayerType: o.enum(Object.values(e)).optional(),
|
|
21
20
|
filingForm: o.enum(Object.values(r)).optional(),
|
|
22
21
|
legalName: o.string().min(1)
|
|
23
|
-
}), [
|
|
22
|
+
}), [b, j] = t(
|
|
24
23
|
"CompanyFederalTaxesContext"
|
|
25
24
|
);
|
|
26
25
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
C as FederalTaxFormSchema,
|
|
27
|
+
j as FederalTaxesProvider,
|
|
28
|
+
b as useFederalTaxes
|
|
30
29
|
};
|
|
31
30
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -11,17 +11,16 @@ import "classnames";
|
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [A, P] = t("IndustryItems", {
|
|
17
16
|
items: []
|
|
18
|
-
}), [
|
|
17
|
+
}), [f, v] = t("IndustryApi", {
|
|
19
18
|
isPending: !1
|
|
20
19
|
});
|
|
21
20
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
v as IndustryApiStateProvider,
|
|
22
|
+
P as IndustryItemsProvider,
|
|
23
|
+
f as useIndustryApiState,
|
|
24
|
+
A as useIndustryItems
|
|
26
25
|
};
|
|
27
26
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
|
|
@@ -4,6 +4,7 @@ import { useTranslation as l } from "react-i18next";
|
|
|
4
4
|
import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { Grid as p } from "../../../Common/Grid/Grid.js";
|
|
7
|
+
import "classnames";
|
|
7
8
|
import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
8
9
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
10
|
import "react";
|
|
@@ -11,7 +12,7 @@ import { STATES_ABBR as c } from "../../../../shared/constants.js";
|
|
|
11
12
|
import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
|
|
12
13
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
13
14
|
import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
|
|
14
|
-
const
|
|
15
|
+
const j = i.object({
|
|
15
16
|
phoneNumber: m,
|
|
16
17
|
street1: i.string().min(1),
|
|
17
18
|
street2: i.string().optional(),
|
|
@@ -20,7 +21,7 @@ const S = i.object({
|
|
|
20
21
|
zip: n,
|
|
21
22
|
addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
|
|
22
23
|
});
|
|
23
|
-
function
|
|
24
|
+
function C() {
|
|
24
25
|
const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
|
|
25
26
|
return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
|
|
26
27
|
/* @__PURE__ */ t(
|
|
@@ -106,7 +107,7 @@ function j() {
|
|
|
106
107
|
] });
|
|
107
108
|
}
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
C as Form,
|
|
111
|
+
j as LocationFormSchema
|
|
111
112
|
};
|
|
112
113
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAA;AACpE,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAA;AAAA,QACxB,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA;AAAA,QAExD,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEtCS,GA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oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -11,13 +11,12 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [d, L] = o(
|
|
17
16
|
"CompanyDocumentFormContext"
|
|
18
17
|
);
|
|
19
18
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
L as LocationsFormProvider,
|
|
20
|
+
d as useLocationsForm
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=useLocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -11,13 +11,12 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [d, f] = o(
|
|
17
16
|
"CompanyDocumentListContext"
|
|
18
17
|
);
|
|
19
18
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
f as LocationsListProvider,
|
|
20
|
+
d as useLocationsList
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [x, C] = o("OnboardingOverviewContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
C as OnboardingOverviewProvider,
|
|
18
|
+
x as useOnboardingOverview
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.errorKey as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA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ACd,SAAAI;AAAA,YAAA;AAAA,UACF;AAAA,QACF,CACD;AACD,QAAA9C,EAAQuC,EAAgB,sBAAsBQ,CAAyB,GACvEzB,EAAA;AAAA,MACF;AACA,MAAAf,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAZ;AAAA,IAACqD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAA3D;AAAA,QACA,WAAA6C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAhC;AAAA,QACA,cAAcF,EAAa;AAAA,QAC3B,kBAAkB2B,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAvB;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAAC,UAAK,eAAY,0BAChB,4BAACsD,GAAA,EAAc,GAAGjC,GAChB,UAAA,gBAAArB,EAACuD,GAAA,EAAK,UAAUlC,EAAY,aAAawB,CAAQ,GAC9C,UAAA1C,KAGC,gBAAAqD,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.errorKey as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"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A,cACtD,sBAAsBC,EAAkBD,EAAQ,oBAAoB;AAAA,cACpE,YAAYA,EAAQ;AAAA,cACpB,MAAMA,EAAQ;AAAA,cACd,MAAMA,EAAQ;AAAA,cACd,SAAAI;AAAA,YAAA;AAAA,UACF;AAAA,QACF,CACD;AACD,QAAA9C,EAAQuC,EAAgB,sBAAsBQ,CAAyB,GACvEzB,EAAA;AAAA,MACF;AACA,MAAAf,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAZ;AAAA,IAACqD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAA3D;AAAA,QACA,WAAA6C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAhC;AAAA,QACA,cAAcF,EAAa;AAAA,QAC3B,kBAAkB2B,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAvB;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAAC,UAAK,eAAY,0BAChB,4BAACsD,GAAA,EAAc,GAAGjC,GAChB,UAAA,gBAAArB,EAACuD,GAAA,EAAK,UAAUlC,EAAY,aAAawB,CAAQ,GAC9C,UAAA1C,KAGC,gBAAAqD,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -6,6 +6,7 @@ import { usePaySchedule as T } from "../usePaySchedule.js";
|
|
|
6
6
|
import l from "./Edit.module.scss.js";
|
|
7
7
|
import { Flex as y } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { Grid as x } from "../../../Common/Grid/Grid.js";
|
|
9
|
+
import "classnames";
|
|
9
10
|
import { RadioGroupField as E } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
10
11
|
import { TextInputField as N } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
11
12
|
import { DatePickerField as h } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
@@ -13,11 +14,11 @@ import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/N
|
|
|
13
14
|
import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
15
|
import { useDateFormatter as R } from "../../../../hooks/useDateFormatter.js";
|
|
15
16
|
import { SelectField as O } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
16
|
-
const
|
|
17
|
-
const
|
|
17
|
+
const K = () => {
|
|
18
|
+
const o = F(), { t: e } = C("Company.PaySchedule"), P = R(), { payPeriodPreview: r, mode: u, payPreviewLoading: D } = T(), { setValue: d } = q(), [a, v] = g(0), i = p({ name: "frequency" }), n = p({ name: "customTwicePerMonth" }), b = i === "Twice per month" && n === "custom" || i === "Monthly", w = i === "Twice per month" && n === "custom";
|
|
18
19
|
return S(() => {
|
|
19
|
-
i === "Twice per month" &&
|
|
20
|
-
}, [i,
|
|
20
|
+
i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
|
|
21
|
+
}, [i, n, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
|
|
21
22
|
/* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(y, { flexDirection: "column", children: [
|
|
22
23
|
/* @__PURE__ */ t(N, { name: "customName", label: e("labels.name"), isRequired: !0 }),
|
|
23
24
|
/* @__PURE__ */ t(
|
|
@@ -69,7 +70,7 @@ const J = () => {
|
|
|
69
70
|
] }) }),
|
|
70
71
|
/* @__PURE__ */ t(y, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: r && r[a] ? /* @__PURE__ */ m("div", { className: l.calendarContainer, children: [
|
|
71
72
|
!D && /* @__PURE__ */ t(
|
|
72
|
-
|
|
73
|
+
o.Select,
|
|
73
74
|
{
|
|
74
75
|
label: e("labels.preview"),
|
|
75
76
|
isRequired: !0,
|
|
@@ -85,7 +86,7 @@ const J = () => {
|
|
|
85
86
|
}
|
|
86
87
|
),
|
|
87
88
|
/* @__PURE__ */ t(
|
|
88
|
-
|
|
89
|
+
o.CalendarPreview,
|
|
89
90
|
{
|
|
90
91
|
dateRange: {
|
|
91
92
|
start: new Date(r[a].startDate),
|
|
@@ -108,11 +109,11 @@ const J = () => {
|
|
|
108
109
|
a
|
|
109
110
|
)
|
|
110
111
|
] }) : /* @__PURE__ */ t("div", { className: l.calendarContainer, children: /* @__PURE__ */ t(
|
|
111
|
-
|
|
112
|
+
o.Alert,
|
|
112
113
|
{
|
|
113
114
|
status: "info",
|
|
114
115
|
label: e("previewAlert.title", "Pay Schedule Preview"),
|
|
115
|
-
children: /* @__PURE__ */ t(
|
|
116
|
+
children: /* @__PURE__ */ t(o.Text, { children: e(
|
|
116
117
|
"previewAlert.description",
|
|
117
118
|
"Complete all the required fields on the left to see a preview of your pay schedule."
|
|
118
119
|
) })
|
|
@@ -121,6 +122,6 @@ const J = () => {
|
|
|
121
122
|
] }) });
|
|
122
123
|
};
|
|
123
124
|
export {
|
|
124
|
-
|
|
125
|
+
K as Edit
|
|
125
126
|
};
|
|
126
127
|
//# sourceMappingURL=Edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(period.startDate, period.endDate),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAA,GAChD,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFI,IAAiBJ,MAAc,qBAAqBE,MAAwB;AASlF,SAPAG,EAAU,MAAM;AACd,IAAIL,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEvB,GAAG,CAACK,GAAWE,GAAqBP,CAAQ,CAAC,GAEzCH,MAAS,uBAAuBA,MAAS,qBACpC,OAIP,gBAAAc,EAAC,OAAA,EAAI,WAAWC,EAAM,sBACpB,UAAA,gBA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AAKN,EAAiBM,CAAsB,EAAE,OAAiB;AAAA,YACxE,OAAOV,EAAE,sBAAsB,KAAK;AAAA,UAAA;AAAA,UAEtC,gBAAgB;AAAA,YACd;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBM,CAAsB,EAAE,SAAmB;AAAA,cAC3E,gBAAgB;AAAA,cAChB,OAAOV,EAAE,mBAAmB,KAAK;AAAA,YAAA;AAAA,YAEnC;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBM,CAAsB,EAAE,YAAsB;AAAA,cAC9E,gBAAgB;AAAA,cAChB,OAAOV,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKU;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACrB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAmB,EAACrB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(period.startDate, period.endDate),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAA,GAChD,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFI,IAAiBJ,MAAc,qBAAqBE,MAAwB;AASlF,SAPAG,EAAU,MAAM;AACd,IAAIL,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEvB,GAAG,CAACK,GAAWE,GAAqBP,CAAQ,CAAC,GAEzCH,MAAS,uBAAuBA,MAAS,qBACpC,OAIP,gBAAAc,EAAC,OAAA,EAAI,WAAWC,EAAM,sBACpB,UAAA,gBAAAC,EAACC,GAAA,EAAK,KAAK,IAAI,qBAAqB,EAAE,MAAM,OAAO,OAAO,aACxD,UAAA;AAAA,IAAA,gBAAAH,EAAC,SAAI,WAAWC,EAAM,iBACpB,UAAA,gBAAAC,EAACE,GAAA,EAAK,eAAe,UACnB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B;AAAA,cAC3E,gBAAgB;AAAA,cAChB,OAAOV,EAAE,mBAAmB,KAAK;AAAA,YAAA;AAAA,YAEnC;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBM,CAAsB,EAAE,YAAsB;AAAA,cAC9E,gBAAgB;AAAA,cAChB,OAAOV,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKU;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACrB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAmB,EAACrB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -12,9 +12,8 @@ import "classnames";
|
|
|
12
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
13
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import "dompurify";
|
|
15
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
16
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
17
|
-
const
|
|
16
|
+
const x = o.object({
|
|
18
17
|
frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
|
|
19
18
|
anchorPayDate: o.date().optional(),
|
|
20
19
|
anchorEndOfPayPeriod: o.date().optional(),
|
|
@@ -22,10 +21,10 @@ const S = o.object({
|
|
|
22
21
|
day2: o.number().min(1).max(31).optional(),
|
|
23
22
|
customName: o.string().optional(),
|
|
24
23
|
customTwicePerMonth: o.string().optional()
|
|
25
|
-
}), [
|
|
24
|
+
}), [S, f] = t("PayScheduleContext");
|
|
26
25
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
f as PayScheduleProvider,
|
|
27
|
+
x as PayScheduleSchema,
|
|
28
|
+
S as usePaySchedule
|
|
30
29
|
};
|
|
31
30
|
//# sourceMappingURL=usePaySchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesFormContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as StateTaxesFormProvider,
|
|
18
|
+
c as useStateTaxesForm
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesListContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as StateTaxesListProvider,
|
|
18
|
+
c as useStateTaxesList
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
|