@gusto/embedded-react-sdk 0.52.2 → 0.53.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 +36 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -2
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +42 -43
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/Fields/PercentageField/PercentageField.js +44 -42
- package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.js +6 -6
- package/dist/components/Common/UI/Box/Box.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +8 -8
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +16 -14
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.js +29 -28
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.d.ts +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.js +9 -8
- package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +8 -6
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +5 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -10
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +18 -21
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +8 -9
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +20 -21
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -12
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/stateMachine.d.ts +0 -1
- package/dist/components/Company/BankAccount/stateMachine.js +33 -35
- package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -14
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/DocumentSigner/stateMachine.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/stateMachine.js +27 -29
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -10
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +6 -8
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -12
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -10
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -5
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +47 -51
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +0 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +26 -28
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +2 -1
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js +29 -16
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +21 -32
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +67 -75
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +62 -47
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -23
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +12 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js +36 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +10 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +110 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +18 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +55 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +47 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js +108 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.d.ts +25 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +22 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/index.d.ts +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.d.ts +29 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +34 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +17 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js +24 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -0
- package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.d.ts +1 -1
- package/dist/components/Company/StateTaxes/shared/applicableIf.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/applicableIf.test.d.ts +1 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.d.ts +19 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js +38 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.d.ts +2 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.js +7 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.d.ts +23 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.js +13 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.test.d.ts +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +33 -11
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +1 -0
- package/dist/components/Company/exports/companyOnboarding.js +12 -10
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +11 -12
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +39 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +90 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +22 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +247 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -0
- package/dist/components/Contractor/ContractorList/{index.d.ts → onboarding/ContractorList.d.ts} +3 -3
- package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js +51 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js.map +1 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +16 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +113 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js.map +1 -0
- package/dist/components/Contractor/ContractorList/shared/index.d.ts +1 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.d.ts +87 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js +110 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.d.ts +0 -1
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +18 -20
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +2 -3
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +8 -8
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +9 -10
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +162 -251
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +45 -44
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +32 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +107 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.test.d.ts +1 -0
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +6 -7
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +18 -19
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
- package/dist/components/Contractor/Submit/Submit.js +2 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
- package/dist/components/Contractor/exports/contractorManagement.js +12 -10
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.js +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +32 -33
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +2 -3
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +6 -7
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +14 -15
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/management/DocumentManager.js +6 -7
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +6 -7
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +10 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +5 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js +8 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -21
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -7
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +15 -16
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +6 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +11 -12
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +7 -8
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +29 -23
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +26 -20
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +133 -99
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +19 -20
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +92 -86
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +65 -64
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +7 -8
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +7 -7
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +6 -6
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +11 -12
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +9 -10
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +6 -7
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +44 -45
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +23 -22
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +27 -27
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -10
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +16 -17
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/Flow/FlowHeader.js +3 -4
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +8 -9
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +37 -37
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +7 -8
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +3 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +54 -50
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +80 -69
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +20 -18
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +138 -136
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -12
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -3
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +34 -36
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +24 -25
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +29 -28
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LocaleProvider/useLocale.d.ts +1 -9
- package/dist/contexts/LocaleProvider/useLocale.js +5 -15
- package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
- package/dist/contexts/NonceProvider/index.d.ts +1 -0
- package/dist/contexts/NonceProvider/useNonce.d.ts +37 -0
- package/dist/contexts/NonceProvider/useNonce.js +7 -0
- package/dist/contexts/NonceProvider/useNonce.js.map +1 -0
- package/dist/contexts/ThemeProvider/ThemeProvider.js +25 -24
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +12 -7
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +25 -21
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -1
- package/dist/i18n/I18n.js +1 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +6 -4
- package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +14 -12
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.ManagementContractorList.json.js +60 -0
- package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -0
- package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js +18 -16
- package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.Management.PaymentMethodSplitForm.json.js +2 -2
- package/dist/i18n/en/Employee.PaymentMethod.json.js +74 -72
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/Employee.SplitPaymentsFormBody.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +8 -8
- package/dist/i18n/en/Payroll.PayrollList.json.js +23 -23
- package/dist/i18n/types.d.ts +193 -11
- package/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/models/external.d.ts +4 -0
- package/dist/partner-hook-utils/form/SDKFormProvider.js +39 -24
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +12 -15
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +16 -19
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -16
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +12 -15
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +18 -21
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +9 -12
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/preprocessors.d.ts +2 -2
- package/dist/partner-hook-utils/form/preprocessors.js +8 -7
- package/dist/partner-hook-utils/form/preprocessors.js.map +1 -1
- package/dist/partner-hook-utils/form/preprocessors.test.d.ts +1 -0
- package/dist/shared/constants.d.ts +12 -0
- package/dist/shared/constants.js +23 -17
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +61 -0
- package/package.json +16 -14
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +0 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +0 -1
- package/dist/components/Contractor/ContractorList/index.js +0 -141
- package/dist/components/Contractor/ContractorList/index.js.map +0 -1
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +0 -18
- package/dist/components/Contractor/ContractorList/useContractorList.js +0 -15
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +0 -1
- /package/dist/components/Company/StateTaxes/{StateTaxesForm/applicableIf.test.d.ts → TaxRateManagement/toHistoryRows.test.d.ts} +0 -0
- /package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toHistoryRows.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\n\n/** @internal */\nexport type HistoryRowStatus = 'current' | 'scheduled' | 'historical'\n\n/** @internal */\nexport interface HistoryRow {\n id: string\n effectiveFrom: string\n status: HistoryRowStatus\n values: Record<string, string>\n}\n\n/** @internal */\nexport interface RequirementColumn {\n key: string\n label?: string\n}\n\nfunction isEffectiveDated(\n set: TaxRequirementSet,\n): set is TaxRequirementSet & { effectiveFrom: string } {\n return typeof set.effectiveFrom === 'string' && set.effectiveFrom.length > 0\n}\n\n/**\n * Tags each effective-dated requirement set for a key as current, scheduled (future), or\n * historical (past), relative to today.\n *\n * @internal\n */\nexport function toHistoryRows(sets: TaxRequirementSet[]): HistoryRow[] {\n const today = formatDateToStringDate(new Date()) ?? ''\n const sorted = sets\n .filter(isEffectiveDated)\n .sort((a, b) => a.effectiveFrom.localeCompare(b.effectiveFrom))\n\n const currentIndex = sorted.reduce(\n (acc, set, idx) => (set.effectiveFrom <= today ? idx : acc),\n -1,\n )\n\n return sorted.map((set, idx) => {\n const values: Record<string, string> = {}\n for (const requirement of set.requirements ?? []) {\n if (!requirement.key || requirement.editable === false) continue\n values[requirement.key] =\n requirement.value === null || requirement.value === undefined\n ? ''\n : String(requirement.value)\n }\n const status: HistoryRowStatus =\n idx === currentIndex ? 'current' : idx > currentIndex ? 'scheduled' : 'historical'\n return {\n id: `${set.key ?? 'set'}-${set.effectiveFrom}-${idx}`,\n effectiveFrom: set.effectiveFrom,\n status,\n values,\n }\n })\n}\n\n/**\n * Builds the union of editable requirement keys/labels across a set of requirement sets,\n * in first-seen order, for use as dynamic table columns.\n *\n * @internal\n */\nexport function extractRequirementColumns(sets: TaxRequirementSet[]): RequirementColumn[] {\n const seen = new Map<string, RequirementColumn>()\n for (const set of sets) {\n for (const requirement of set.requirements ?? []) {\n if (requirement.key && requirement.editable !== false && !seen.has(requirement.key)) {\n seen.set(requirement.key, { key: requirement.key, label: requirement.label })\n }\n }\n }\n return Array.from(seen.values())\n}\n"],"names":["isEffectiveDated","set","toHistoryRows","sets","today","formatDateToStringDate","sorted","a","b","currentIndex","acc","idx","values","requirement","status","extractRequirementColumns","seen"],"mappings":";AAoBA,SAASA,EACPC,GACsD;AACtD,SAAO,OAAOA,EAAI,iBAAkB,YAAYA,EAAI,cAAc,SAAS;AAC7E;AAQO,SAASC,EAAcC,GAAyC;AACrE,QAAMC,IAAQC,EAAuB,oBAAI,KAAA,CAAM,KAAK,IAC9CC,IAASH,EACZ,OAAOH,CAAgB,EACvB,KAAK,CAACO,GAAGC,MAAMD,EAAE,cAAc,cAAcC,EAAE,aAAa,CAAC,GAE1DC,IAAeH,EAAO;AAAA,IAC1B,CAACI,GAAKT,GAAKU,MAASV,EAAI,iBAAiBG,IAAQO,IAAMD;AAAA,IACvD;AAAA,EAAA;AAGF,SAAOJ,EAAO,IAAI,CAACL,GAAKU,MAAQ;AAC9B,UAAMC,IAAiC,CAAA;AACvC,eAAWC,KAAeZ,EAAI,gBAAgB,CAAA;AAC5C,MAAI,CAACY,EAAY,OAAOA,EAAY,aAAa,OACjDD,EAAOC,EAAY,GAAG,IACpBA,EAAY,UAAU,QAAQA,EAAY,UAAU,SAChD,KACA,OAAOA,EAAY,KAAK;AAEhC,UAAMC,IACJH,MAAQF,IAAe,YAAYE,IAAMF,IAAe,cAAc;AACxE,WAAO;AAAA,MACL,IAAI,GAAGR,EAAI,OAAO,KAAK,IAAIA,EAAI,aAAa,IAAIU,CAAG;AAAA,MACnD,eAAeV,EAAI;AAAA,MACnB,QAAAa;AAAA,MACA,QAAAF;AAAA,IAAA;AAAA,EAEJ,CAAC;AACH;AAQO,SAASG,EAA0BZ,GAAgD;AACxF,QAAMa,wBAAW,IAAA;AACjB,aAAWf,KAAOE;AAChB,eAAWU,KAAeZ,EAAI,gBAAgB,CAAA;AAC5C,MAAIY,EAAY,OAAOA,EAAY,aAAa,MAAS,CAACG,EAAK,IAAIH,EAAY,GAAG,KAChFG,EAAK,IAAIH,EAAY,KAAK,EAAE,KAAKA,EAAY,KAAK,OAAOA,EAAY,MAAA,CAAO;AAIlF,SAAO,MAAM,KAAKG,EAAK,OAAA,CAAQ;AACjC;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement';
|
|
2
|
+
interface RequirementFieldsProps {
|
|
3
|
+
/** Requirements to render as inputs, nested under `requirementSetKey` in the form's RHF path. */
|
|
4
|
+
requirements: TaxRequirement[] | undefined;
|
|
5
|
+
/** RHF path segment the requirements are nested under, e.g. `taxrates` or `fields`. */
|
|
6
|
+
requirementSetKey: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders one form field per editable, currently-applicable requirement, filtering
|
|
10
|
+
* out non-editable requirements, requirements with no `key` (the API doesn't guarantee one, and
|
|
11
|
+
* without it there's no stable form path to register), and requirements whose `applicableIf`
|
|
12
|
+
* constraints aren't satisfied by the form's current values.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function RequirementFields({ requirements, requirementSetKey }: RequirementFieldsProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as o, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { useFormContext as p, useWatch as l } from "react-hook-form";
|
|
3
|
+
import { getUniqueRhfKey as s } from "./rhfKey.js";
|
|
4
|
+
import { isRequirementApplicable as c } from "./applicableIf.js";
|
|
5
|
+
import { QuestionInput as m } from "../../../Common/TaxInputs/TaxInputs.js";
|
|
6
|
+
function k({ requirements: r, requirementSetKey: e }) {
|
|
7
|
+
const { control: i } = p(), n = l({ control: i });
|
|
8
|
+
return /* @__PURE__ */ o(f, { children: r?.flatMap((t, a) => t.key ? t.editable === !1 ? [] : c(t, e, n) ? [
|
|
9
|
+
/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
|
|
10
|
+
m,
|
|
11
|
+
{
|
|
12
|
+
requirement: {
|
|
13
|
+
...t,
|
|
14
|
+
key: `${e}.${s(t, a, r)}`
|
|
15
|
+
},
|
|
16
|
+
questionType: t.metadata?.type ?? "Text"
|
|
17
|
+
}
|
|
18
|
+
) }, `${t.key}-${a}`)
|
|
19
|
+
] : [] : []) });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
k as RequirementFields
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=RequirementFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequirementFields.js","sources":["../../../../../src/components/Company/StateTaxes/shared/RequirementFields.tsx"],"sourcesContent":["import { Fragment } from 'react/jsx-runtime'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport type { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { getUniqueRhfKey } from './rhfKey'\nimport { isRequirementApplicable, type StateTaxesFormValues } from './applicableIf'\nimport { QuestionInput } from '@/components/Common/TaxInputs/TaxInputs'\n\ninterface RequirementFieldsProps {\n /** Requirements to render as inputs, nested under `requirementSetKey` in the form's RHF path. */\n requirements: TaxRequirement[] | undefined\n /** RHF path segment the requirements are nested under, e.g. `taxrates` or `fields`. */\n requirementSetKey: string\n}\n\n/**\n * Renders one form field per editable, currently-applicable requirement, filtering\n * out non-editable requirements, requirements with no `key` (the API doesn't guarantee one, and\n * without it there's no stable form path to register), and requirements whose `applicableIf`\n * constraints aren't satisfied by the form's current values.\n *\n * @internal\n */\nexport function RequirementFields({ requirements, requirementSetKey }: RequirementFieldsProps) {\n const { control } = useFormContext()\n const watchedValues = useWatch({ control }) as StateTaxesFormValues\n\n return (\n <>\n {requirements?.flatMap((requirement, index) => {\n if (!requirement.key) return []\n if (requirement.editable === false) return []\n if (!isRequirementApplicable(requirement, requirementSetKey, watchedValues)) return []\n return [\n <Fragment key={`${requirement.key}-${index}`}>\n <QuestionInput\n requirement={{\n ...requirement,\n key: `${requirementSetKey}.${getUniqueRhfKey(requirement, index, requirements)}`,\n }}\n questionType={requirement.metadata?.type ?? 'Text'}\n />\n </Fragment>,\n ]\n })}\n </>\n )\n}\n"],"names":["RequirementFields","requirements","requirementSetKey","control","useFormContext","watchedValues","useWatch","jsx","Fragment","requirement","index","isRequirementApplicable","QuestionInput","getUniqueRhfKey"],"mappings":";;;;;AAsBO,SAASA,EAAkB,EAAE,cAAAC,GAAc,mBAAAC,KAA6C;AAC7F,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAgBC,EAAS,EAAE,SAAAH,GAAS;AAE1C,SACE,gBAAAI,EAAAC,GAAA,EACG,UAAAP,GAAc,QAAQ,CAACQ,GAAaC,MAC9BD,EAAY,MACbA,EAAY,aAAa,KAAc,CAAA,IACtCE,EAAwBF,GAAaP,GAAmBG,CAAa,IACnE;AAAA,IACL,gBAAAE,EAACC,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,aAAa;AAAA,UACX,GAAGH;AAAA,UACH,KAAK,GAAGP,CAAiB,IAAIW,EAAgBJ,GAAaC,GAAOT,CAAY,CAAC;AAAA,QAAA;AAAA,QAEhF,cAAcQ,EAAY,UAAU,QAAQ;AAAA,MAAA;AAAA,IAAA,KANjC,GAAGA,EAAY,GAAG,IAAIC,CAAK,EAQ1C;AAAA,EAAA,IAVkF,CAAA,IAFvD,CAAA,CAc9B,EAAA,CACH;AAEJ;"}
|
|
@@ -7,4 +7,4 @@ import { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequire
|
|
|
7
7
|
*/
|
|
8
8
|
export type StateTaxesFormValues = Record<string, Record<string, unknown> | undefined>;
|
|
9
9
|
/** @internal */
|
|
10
|
-
export declare function isRequirementApplicable(requirement: TaxRequirement,
|
|
10
|
+
export declare function isRequirementApplicable(requirement: TaxRequirement, requirementSetKey: string, formValues: StateTaxesFormValues): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applicableIf.js","sources":["../../../../../src/components/Company/StateTaxes/shared/applicableIf.ts"],"sourcesContent":["import type { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { toRhfKey } from './rhfKey'\n\n/**\n * Map of `applicable_if` set key to its values, keyed by RHF-encoded field key.\n * Internal shape used by {@link isRequirementApplicable}.\n *\n * @internal\n */\nexport type StateTaxesFormValues = Record<string, Record<string, unknown> | undefined>\n\n/** @internal */\nexport function isRequirementApplicable(\n requirement: TaxRequirement,\n requirementSetKey: string,\n formValues: StateTaxesFormValues,\n): boolean {\n const constraints = requirement.applicableIf\n if (!constraints || constraints.length === 0) return true\n\n const setValues = formValues[requirementSetKey]\n if (!setValues) return false\n\n return constraints.every(({ key, value }) => {\n if (!key) return true\n return setValues[toRhfKey(key)] === value\n })\n}\n"],"names":["isRequirementApplicable","requirement","requirementSetKey","formValues","constraints","setValues","key","value","toRhfKey"],"mappings":";AAYO,SAASA,EACdC,GACAC,GACAC,GACS;AACT,QAAMC,IAAcH,EAAY;AAChC,MAAI,CAACG,KAAeA,EAAY,WAAW,EAAG,QAAO;AAErD,QAAMC,IAAYF,EAAWD,CAAiB;AAC9C,SAAKG,IAEED,EAAY,MAAM,CAAC,EAAE,KAAAE,GAAK,OAAAC,QAC1BD,IACED,EAAUG,EAASF,CAAG,CAAC,MAAMC,IADnB,EAElB,IALsB;AAMzB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
3
|
+
import { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement';
|
|
4
|
+
/** @internal */
|
|
5
|
+
export interface RequirementSchema {
|
|
6
|
+
shape: Record<string, z.ZodType>;
|
|
7
|
+
defaults: Record<string, string | boolean | number | undefined>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Builds a dynamic Zod shape and default values for a single set of tax requirements.
|
|
11
|
+
*
|
|
12
|
+
* @param requirements - The requirements to build a schema for.
|
|
13
|
+
* @param t - A translator scoped so that `t('validations.oneOf', ...)` resolves to
|
|
14
|
+
* `Company.StateTaxes`'s `form.validations.oneOf` key (i.e. call
|
|
15
|
+
* `useTranslation('Company.StateTaxes', { keyPrefix: 'form' })` even from callers whose own
|
|
16
|
+
* copy lives under a different keyPrefix).
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildRequirementSchema(requirements: TaxRequirement[] | undefined, t: TFunction<'Company.StateTaxes', 'form'>): RequirementSchema;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { getUniqueRhfKey as y } from "./rhfKey.js";
|
|
3
|
+
function N(f, l) {
|
|
4
|
+
const u = {}, d = {};
|
|
5
|
+
return f?.forEach((a, r) => {
|
|
6
|
+
if (!a.key) return;
|
|
7
|
+
const n = y(a, r, f), c = a.metadata?.type === "tax_rate" || a.metadata?.type === "percent";
|
|
8
|
+
a.metadata?.type === "radio" ? d[n] = a.value ?? void 0 : a.metadata?.type === "workers_compensation_rate" ? d[n] = a.value !== null && a.value !== void 0 ? Number(a.value) : void 0 : d[n] = a.value ? String(a.value) : "";
|
|
9
|
+
let s = e.string().optional();
|
|
10
|
+
const o = a.metadata?.validation;
|
|
11
|
+
if (o) {
|
|
12
|
+
if (c && o.type === "one_of") {
|
|
13
|
+
const t = o.rates;
|
|
14
|
+
s = e.string().optional().refine((i) => !i || t.includes(i), {
|
|
15
|
+
message: l("validations.oneOf", { values: t.join(", ") })
|
|
16
|
+
});
|
|
17
|
+
} else if (c && o.type === "min_max") {
|
|
18
|
+
const t = o.min !== void 0 ? Number(o.min) : void 0, i = o.max !== void 0 ? Number(o.max) : void 0;
|
|
19
|
+
s = e.string().optional().superRefine((p, v) => {
|
|
20
|
+
if (!p) return;
|
|
21
|
+
const m = Number(p);
|
|
22
|
+
Number.isNaN(m) || (t !== void 0 && m < t ? v.addIssue({
|
|
23
|
+
code: e.ZodIssueCode.custom,
|
|
24
|
+
message: l("validations.minValue", { min: Number((t * 100).toFixed(4)) })
|
|
25
|
+
}) : i !== void 0 && m > i && v.addIssue({
|
|
26
|
+
code: e.ZodIssueCode.custom,
|
|
27
|
+
message: l("validations.maxValue", { max: Number((i * 100).toFixed(4)) })
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
a.metadata?.type === "radio" ? s = e.boolean().optional() : a.metadata?.type === "workers_compensation_rate" && (s = e.number().optional()), u[n] = s;
|
|
33
|
+
}), { shape: u, defaults: d };
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
N as buildRequirementSchema
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=buildRequirementSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRequirementSchema.js","sources":["../../../../../src/components/Company/StateTaxes/shared/buildRequirementSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { TFunction } from 'i18next'\nimport type { TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { getUniqueRhfKey } from './rhfKey'\n\n/** @internal */\nexport interface RequirementSchema {\n shape: Record<string, z.ZodType>\n defaults: Record<string, string | boolean | number | undefined>\n}\n\n/**\n * Builds a dynamic Zod shape and default values for a single set of tax requirements.\n *\n * @param requirements - The requirements to build a schema for.\n * @param t - A translator scoped so that `t('validations.oneOf', ...)` resolves to\n * `Company.StateTaxes`'s `form.validations.oneOf` key (i.e. call\n * `useTranslation('Company.StateTaxes', { keyPrefix: 'form' })` even from callers whose own\n * copy lives under a different keyPrefix).\n * @internal\n */\nexport function buildRequirementSchema(\n requirements: TaxRequirement[] | undefined,\n t: TFunction<'Company.StateTaxes', 'form'>,\n): RequirementSchema {\n const shape: Record<string, z.ZodType> = {}\n const defaults: Record<string, string | boolean | number | undefined> = {}\n\n requirements?.forEach((requirement, index) => {\n if (!requirement.key) return\n\n const requirementKey = getUniqueRhfKey(requirement, index, requirements)\n\n const isPercentField =\n requirement.metadata?.type === 'tax_rate' || requirement.metadata?.type === 'percent'\n\n if (requirement.metadata?.type === 'radio') {\n defaults[requirementKey] = requirement.value ?? undefined\n } else if (requirement.metadata?.type === 'workers_compensation_rate') {\n defaults[requirementKey] =\n requirement.value !== null && requirement.value !== undefined\n ? Number(requirement.value)\n : undefined\n } else {\n defaults[requirementKey] = requirement.value ? String(requirement.value) : ''\n }\n\n let fieldSchema: z.ZodType = z.string().optional()\n\n const validation = requirement.metadata?.validation\n\n if (validation) {\n if (isPercentField && validation.type === 'one_of') {\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string()\n .optional()\n .refine(val => !val || oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n } else if (isPercentField && validation.type === 'min_max') {\n const min = validation.min !== undefined ? Number(validation.min) : undefined\n const max = validation.max !== undefined ? Number(validation.max) : undefined\n // Backstops PercentageField's own on-blur min/max check (which handles the\n // interactive case) in case a value ever reaches submission without a blur.\n fieldSchema = z\n .string()\n .optional()\n .superRefine((val, ctx) => {\n if (!val) return\n const num = Number(val)\n if (Number.isNaN(num)) return\n if (min !== undefined && num < min) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: t('validations.minValue', { min: Number((min * 100).toFixed(4)) }),\n })\n } else if (max !== undefined && num > max) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: t('validations.maxValue', { max: Number((max * 100).toFixed(4)) }),\n })\n }\n })\n }\n }\n\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean().optional()\n } else if (requirement.metadata?.type === 'workers_compensation_rate') {\n fieldSchema = z.number().optional()\n }\n shape[requirementKey] = fieldSchema\n })\n\n return { shape, defaults }\n}\n"],"names":["buildRequirementSchema","requirements","t","shape","defaults","requirement","index","requirementKey","getUniqueRhfKey","isPercentField","fieldSchema","z","validation","oneOfValues","val","min","max","ctx","num"],"mappings":";;AAqBO,SAASA,EACdC,GACAC,GACmB;AACnB,QAAMC,IAAmC,CAAA,GACnCC,IAAkE,CAAA;AAExE,SAAAH,GAAc,QAAQ,CAACI,GAAaC,MAAU;AAC5C,QAAI,CAACD,EAAY,IAAK;AAEtB,UAAME,IAAiBC,EAAgBH,GAAaC,GAAOL,CAAY,GAEjEQ,IACJJ,EAAY,UAAU,SAAS,cAAcA,EAAY,UAAU,SAAS;AAE9E,IAAIA,EAAY,UAAU,SAAS,UACjCD,EAASG,CAAc,IAAIF,EAAY,SAAS,SACvCA,EAAY,UAAU,SAAS,8BACxCD,EAASG,CAAc,IACrBF,EAAY,UAAU,QAAQA,EAAY,UAAU,SAChD,OAAOA,EAAY,KAAK,IACxB,SAEND,EAASG,CAAc,IAAIF,EAAY,QAAQ,OAAOA,EAAY,KAAK,IAAI;AAG7E,QAAIK,IAAyBC,EAAE,OAAA,EAAS,SAAA;AAExC,UAAMC,IAAaP,EAAY,UAAU;AAEzC,QAAIO;AACF,UAAIH,KAAkBG,EAAW,SAAS,UAAU;AAClD,cAAMC,IAAcD,EAAW;AAC/B,QAAAF,IAAcC,EACX,SACA,SAAA,EACA,OAAO,CAAAG,MAAO,CAACA,KAAOD,EAAY,SAASC,CAAG,GAAG;AAAA,UAChD,SAASZ,EAAE,qBAAqB,EAAE,QAAQW,EAAY,KAAK,IAAI,EAAA,CAAG;AAAA,QAAA,CACnE;AAAA,MACL,WAAWJ,KAAkBG,EAAW,SAAS,WAAW;AAC1D,cAAMG,IAAMH,EAAW,QAAQ,SAAY,OAAOA,EAAW,GAAG,IAAI,QAC9DI,IAAMJ,EAAW,QAAQ,SAAY,OAAOA,EAAW,GAAG,IAAI;AAGpE,QAAAF,IAAcC,EACX,SACA,SAAA,EACA,YAAY,CAACG,GAAKG,MAAQ;AACzB,cAAI,CAACH,EAAK;AACV,gBAAMI,IAAM,OAAOJ,CAAG;AACtB,UAAI,OAAO,MAAMI,CAAG,MAChBH,MAAQ,UAAaG,IAAMH,IAC7BE,EAAI,SAAS;AAAA,YACX,MAAMN,EAAE,aAAa;AAAA,YACrB,SAAST,EAAE,wBAAwB,EAAE,KAAK,QAAQa,IAAM,KAAK,QAAQ,CAAC,CAAC,EAAA,CAAG;AAAA,UAAA,CAC3E,IACQC,MAAQ,UAAaE,IAAMF,KACpCC,EAAI,SAAS;AAAA,YACX,MAAMN,EAAE,aAAa;AAAA,YACrB,SAAST,EAAE,wBAAwB,EAAE,KAAK,QAAQc,IAAM,KAAK,QAAQ,CAAC,CAAC,EAAA,CAAG;AAAA,UAAA,CAC3E;AAAA,QAEL,CAAC;AAAA,MACL;AAAA;AAGF,IAAIX,EAAY,UAAU,SAAS,UACjCK,IAAcC,EAAE,QAAA,EAAU,SAAA,IACjBN,EAAY,UAAU,SAAS,gCACxCK,IAAcC,EAAE,OAAA,EAAS,SAAA,IAE3BR,EAAMI,CAAc,IAAIG;AAAA,EAC1B,CAAC,GAEM,EAAE,OAAAP,GAAO,UAAAC,EAAA;AAClB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirementValue.js","sources":["../../../../../src/components/Company/StateTaxes/shared/requirementValue.ts"],"sourcesContent":["/** @internal */\nexport function stringifyRequirementValue(value: unknown): string {\n if (value === undefined || value === null) return ''\n if (typeof value === 'number') return isNaN(value) ? '' : String(value)\n if (typeof value === 'string') return value\n if (typeof value === 'boolean') return String(value)\n return ''\n}\n"],"names":["stringifyRequirementValue","value"],"mappings":"AACO,SAASA,EAA0BC,GAAwB;AAChE,SAA2BA,KAAU,OAAa,KAC9C,OAAOA,KAAU,WAAiB,MAAMA,CAAK,IAAI,KAAK,OAAOA,CAAK,IAClE,OAAOA,KAAU,WAAiBA,IAClC,OAAOA,KAAU,YAAkB,OAAOA,CAAK,IAC5C;AACT;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export declare const toRhfKey: (key: string) => string;
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare const fromRhfKey: (key: string) => string;
|
|
5
|
+
/**
|
|
6
|
+
* `toRhfKey(requirement.key)`, disambiguated with a numeric suffix if an earlier requirement in
|
|
7
|
+
* the same `requirements` array has the same `key`.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The API doesn't guarantee `TaxRequirement.key` is unique within a single requirement set. Two
|
|
11
|
+
* fields sharing a raw key would otherwise register under the identical react-hook-form field
|
|
12
|
+
* name and silently share state (editing one would overwrite the other). Call this — instead of
|
|
13
|
+
* `toRhfKey` directly — everywhere a requirement's key becomes a form field name, and use the
|
|
14
|
+
* same `(requirement, index, requirements)` triple both when building the field and when reading
|
|
15
|
+
* its value back out of the submitted payload.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function getUniqueRhfKey(requirement: {
|
|
20
|
+
key?: string;
|
|
21
|
+
}, index: number, requirements: {
|
|
22
|
+
key?: string;
|
|
23
|
+
}[]): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const f = "__PIPE__", l = (e) => e.replaceAll("|", f);
|
|
2
|
+
function r(e, y, c) {
|
|
3
|
+
let t = 0;
|
|
4
|
+
for (let o = 0; o < y; o++)
|
|
5
|
+
c[o]?.key === e.key && t++;
|
|
6
|
+
const n = l(e.key ?? "");
|
|
7
|
+
return t === 0 ? n : `${n}--dup${t}`;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
r as getUniqueRhfKey,
|
|
11
|
+
l as toRhfKey
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=rhfKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rhfKey.js","sources":["../../../../../src/components/Company/StateTaxes/shared/rhfKey.ts"],"sourcesContent":["// react-hook-form's path parser strips `|`, `\"`, `'`, and `]` from field names\n// (see its stringToPath regex), which silently re-routes writes to a different\n// path than reads. Tax requirement keys like `wa_wc_hourly_rate|010103` need\n// the pipe replaced to round-trip through RHF state without losing values.\nconst PIPE_PLACEHOLDER = '__PIPE__'\n\n/** @internal */\nexport const toRhfKey = (key: string): string => key.replaceAll('|', PIPE_PLACEHOLDER)\n/** @internal */\nexport const fromRhfKey = (key: string): string => key.replaceAll(PIPE_PLACEHOLDER, '|')\n\n/**\n * `toRhfKey(requirement.key)`, disambiguated with a numeric suffix if an earlier requirement in\n * the same `requirements` array has the same `key`.\n *\n * @remarks\n * The API doesn't guarantee `TaxRequirement.key` is unique within a single requirement set. Two\n * fields sharing a raw key would otherwise register under the identical react-hook-form field\n * name and silently share state (editing one would overwrite the other). Call this — instead of\n * `toRhfKey` directly — everywhere a requirement's key becomes a form field name, and use the\n * same `(requirement, index, requirements)` triple both when building the field and when reading\n * its value back out of the submitted payload.\n *\n * @internal\n */\nexport function getUniqueRhfKey(\n requirement: { key?: string },\n index: number,\n requirements: { key?: string }[],\n): string {\n let priorSameKeyCount = 0\n for (let i = 0; i < index; i++) {\n if (requirements[i]?.key === requirement.key) priorSameKeyCount++\n }\n const base = toRhfKey(requirement.key ?? '')\n return priorSameKeyCount === 0 ? base : `${base}--dup${priorSameKeyCount}`\n}\n"],"names":["PIPE_PLACEHOLDER","toRhfKey","key","getUniqueRhfKey","requirement","index","requirements","priorSameKeyCount","i","base"],"mappings":"AAIA,MAAMA,IAAmB,YAGZC,IAAW,CAACC,MAAwBA,EAAI,WAAW,KAAKF,CAAgB;AAkB9E,SAASG,EACdC,GACAC,GACAC,GACQ;AACR,MAAIC,IAAoB;AACxB,WAASC,IAAI,GAAGA,IAAIH,GAAOG;AACzB,IAAIF,EAAaE,CAAC,GAAG,QAAQJ,EAAY,OAAKG;AAEhD,QAAME,IAAOR,EAASG,EAAY,OAAO,EAAE;AAC3C,SAAOG,MAAsB,IAAIE,IAAO,GAAGA,CAAI,QAAQF,CAAiB;AAC1E;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
import { state as
|
|
2
|
-
import { StateTaxesListContextual as
|
|
1
|
+
import { state as s, transition as e, reduce as a } from "robot3";
|
|
2
|
+
import { StateTaxesListContextual as T, StateTaxesFormContextual as i, TaxRateManagementContextual as m } from "./StateTaxesComponents.js";
|
|
3
3
|
import { componentEvents as o } from "../../../shared/constants.js";
|
|
4
|
-
const
|
|
5
|
-
viewStateTaxes:
|
|
4
|
+
const p = {
|
|
5
|
+
viewStateTaxes: s(
|
|
6
6
|
e(
|
|
7
7
|
o.COMPANY_STATE_TAX_EDIT,
|
|
8
8
|
"editStateTaxes",
|
|
9
9
|
a(
|
|
10
|
-
(t,
|
|
10
|
+
(t, n) => ({
|
|
11
11
|
...t,
|
|
12
12
|
component: i,
|
|
13
|
-
state:
|
|
13
|
+
state: n.payload.state
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
),
|
|
17
|
+
e(
|
|
18
|
+
o.COMPANY_STATE_TAX_MANAGE_RATES,
|
|
19
|
+
"manageTaxRates",
|
|
20
|
+
a(
|
|
21
|
+
(t, n) => ({
|
|
22
|
+
...t,
|
|
23
|
+
component: m,
|
|
24
|
+
state: n.payload.state
|
|
14
25
|
})
|
|
15
26
|
)
|
|
16
27
|
)
|
|
17
28
|
),
|
|
18
|
-
editStateTaxes:
|
|
29
|
+
editStateTaxes: s(
|
|
19
30
|
e(
|
|
20
31
|
o.COMPANY_STATE_TAX_UPDATED,
|
|
21
32
|
"viewStateTaxes",
|
|
22
33
|
a(
|
|
23
|
-
(t,
|
|
34
|
+
(t, n) => ({
|
|
24
35
|
...t,
|
|
25
|
-
component:
|
|
36
|
+
component: T,
|
|
26
37
|
state: void 0
|
|
27
38
|
})
|
|
28
39
|
)
|
|
@@ -32,13 +43,24 @@ const S = {
|
|
|
32
43
|
"viewStateTaxes",
|
|
33
44
|
a((t) => ({
|
|
34
45
|
...t,
|
|
35
|
-
component:
|
|
46
|
+
component: T,
|
|
47
|
+
state: void 0
|
|
48
|
+
}))
|
|
49
|
+
)
|
|
50
|
+
),
|
|
51
|
+
manageTaxRates: s(
|
|
52
|
+
e(
|
|
53
|
+
o.CANCEL,
|
|
54
|
+
"viewStateTaxes",
|
|
55
|
+
a((t) => ({
|
|
56
|
+
...t,
|
|
57
|
+
component: T,
|
|
36
58
|
state: void 0
|
|
37
59
|
}))
|
|
38
60
|
)
|
|
39
61
|
)
|
|
40
62
|
};
|
|
41
63
|
export {
|
|
42
|
-
|
|
64
|
+
p as stateTaxesStateMachine
|
|
43
65
|
};
|
|
44
66
|
//# sourceMappingURL=stateTaxesStateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport {
|
|
1
|
+
{"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport {\n StateTaxesFormContextual,\n StateTaxesListContextual,\n TaxRateManagementContextual,\n} from './StateTaxesComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.COMPANY_STATE_TAX_UPDATED]: undefined\n [componentEvents.COMPANY_STATE_TAX_EDIT]: { state: string }\n [componentEvents.COMPANY_STATE_TAX_MANAGE_RATES]: { state: string }\n}\n\n/** @internal */\nexport const stateTaxesStateMachine = {\n viewStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_EDIT,\n 'editStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_EDIT>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesFormContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n transition(\n componentEvents.COMPANY_STATE_TAX_MANAGE_RATES,\n 'manageTaxRates',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.COMPANY_STATE_TAX_MANAGE_RATES\n >,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: TaxRateManagementContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n ),\n editStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_UPDATED,\n 'viewStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_UPDATED>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce((ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n })),\n ),\n ),\n manageTaxRates: state<MachineTransition>(\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce((ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n })),\n ),\n ),\n}\n"],"names":["stateTaxesStateMachine","state","transition","componentEvents","reduce","ctx","ev","StateTaxesFormContextual","TaxRateManagementContextual","StateTaxesListContextual"],"mappings":";;;AAkBO,MAAMA,IAAyB;AAAA,EACpC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,OAAOD,EAAG,QAAQ;AAAA,QAAA;AAAA,MACpB;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OAIgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWG;AAAA,UACX,OAAOF,EAAG,QAAQ;AAAA,QAAA;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,gBAAgBL;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWI;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEFP;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAiE;AAAA,QACvE,GAAGA;AAAA,QACH,WAAWI;AAAA,QACX,OAAO;AAAA,MAAA,EACP;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,gBAAgBR;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAiE;AAAA,QACvE,GAAGA;AAAA,QACH,WAAWI;AAAA,QACX,OAAO;AAAA,MAAA,EACP;AAAA,IAAA;AAAA,EACJ;AAEJ;"}
|
|
@@ -13,6 +13,7 @@ export { FederalTaxes, type FederalTaxesProps, type FederalTaxesDefaultValues, }
|
|
|
13
13
|
export { StateTaxes, type StateTaxesProps } from '../StateTaxes/StateTaxes';
|
|
14
14
|
export { StateTaxesForm, type StateTaxesFormProps } from '../StateTaxes/StateTaxesForm';
|
|
15
15
|
export { StateTaxesList, type StateTaxesListProps } from '../StateTaxes/StateTaxesList';
|
|
16
|
+
export { TaxRateManagement, type TaxRateManagementProps } from '../StateTaxes/TaxRateManagement';
|
|
16
17
|
export { AssignSignatory, type AssignSignatoryProps, type AssignSignatoryDefaultValues, } from '../AssignSignatory';
|
|
17
18
|
export { CreateSignatory, type CreateSignatoryProps, type CreateSignatoryDefaultValues, } from '../AssignSignatory/CreateSignatory';
|
|
18
19
|
export { InviteSignatory, type InviteSignatoryProps, type InviteSignatoryDefaultValues, } from '../AssignSignatory/InviteSignatory';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OnboardingFlow as t } from "../OnboardingFlow/OnboardingFlow.js";
|
|
2
2
|
import { OnboardingOverview as m } from "../OnboardingOverview/OnboardingOverview.js";
|
|
3
|
-
import { BankAccount as
|
|
3
|
+
import { BankAccount as x } from "../BankAccount/BankAccount.js";
|
|
4
4
|
import { Locations as f } from "../Locations/Locations.js";
|
|
5
5
|
import { StateTaxes as i } from "../StateTaxes/StateTaxes.js";
|
|
6
|
-
import { AssignSignatory as
|
|
7
|
-
import { CreateSignatory as
|
|
6
|
+
import { AssignSignatory as g } from "../AssignSignatory/AssignSignatory.js";
|
|
7
|
+
import { CreateSignatory as c } from "../AssignSignatory/CreateSignatory/CreateSignatory.js";
|
|
8
8
|
import { DocumentList as L } from "../DocumentSigner/DocumentList/DocumentList.js";
|
|
9
9
|
import { DocumentSigner as y } from "../DocumentSigner/DocumentSigner.js";
|
|
10
10
|
import { FederalTaxes as T } from "../FederalTaxes/FederalTaxes.js";
|
|
@@ -14,12 +14,13 @@ import { LocationForm as A } from "../Locations/LocationForm/LocationForm.js";
|
|
|
14
14
|
import { LocationsList as I } from "../Locations/LocationsList/LocationsList.js";
|
|
15
15
|
import { PaySchedule as k } from "../PaySchedule/PaySchedule.js";
|
|
16
16
|
import { SignatureForm as C } from "../DocumentSigner/SignatureForm/SignatureForm.js";
|
|
17
|
-
import { StateTaxesForm as
|
|
18
|
-
import { StateTaxesList as
|
|
17
|
+
import { StateTaxesForm as P } from "../StateTaxes/StateTaxesForm/StateTaxesForm.js";
|
|
18
|
+
import { StateTaxesList as j } from "../StateTaxes/StateTaxesList/StateTaxesList.js";
|
|
19
|
+
import { TaxRateManagement as z } from "../StateTaxes/TaxRateManagement/TaxRateManagement.js";
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
g as AssignSignatory,
|
|
22
|
+
x as BankAccount,
|
|
23
|
+
c as CreateSignatory,
|
|
23
24
|
L as DocumentList,
|
|
24
25
|
y as DocumentSigner,
|
|
25
26
|
T as FederalTaxes,
|
|
@@ -33,7 +34,8 @@ export {
|
|
|
33
34
|
k as PaySchedule,
|
|
34
35
|
C as SignatureForm,
|
|
35
36
|
i as StateTaxes,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
P as StateTaxesForm,
|
|
38
|
+
j as StateTaxesList,
|
|
39
|
+
z as TaxRateManagement
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=companyOnboarding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companyOnboarding.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"companyOnboarding.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,30 +11,29 @@ import { Flex as f } from "../../Common/Flex/Flex.js";
|
|
|
11
11
|
import { Grid as y } from "../../Common/Grid/Grid.js";
|
|
12
12
|
import { ActionsLayout as I } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
13
13
|
import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "react";
|
|
15
14
|
import { useComponentDictionary as x, useI18n as _ } from "../../../i18n/I18n.js";
|
|
16
15
|
import { contractorEvents as g } from "../../../shared/constants.js";
|
|
17
16
|
import { useContractorHasSignedW9 as F } from "../shared/useContractorHasSignedW9.js";
|
|
18
17
|
const L = {
|
|
19
18
|
update: ["street1", "city", "state", "zip"]
|
|
20
19
|
};
|
|
21
|
-
function
|
|
22
|
-
return /* @__PURE__ */ t(S, { componentName: "Contractor.Address", FallbackComponent: i, children: /* @__PURE__ */ t(B, { onEvent:
|
|
20
|
+
function $({ onEvent: o, FallbackComponent: i, ...s }) {
|
|
21
|
+
return /* @__PURE__ */ t(S, { componentName: "Contractor.Address", FallbackComponent: i, children: /* @__PURE__ */ t(B, { onEvent: o, ...s }) });
|
|
23
22
|
}
|
|
24
|
-
function N({ contractorId:
|
|
25
|
-
const i = F(
|
|
26
|
-
return i ? /* @__PURE__ */ t(d.Alert, { status: "warning", disableScrollIntoView: !0, label:
|
|
23
|
+
function N({ contractorId: o }) {
|
|
24
|
+
const i = F(o), { t: s } = m("Contractor.Address"), d = h();
|
|
25
|
+
return i ? /* @__PURE__ */ t(d.Alert, { status: "warning", disableScrollIntoView: !0, label: s("w9EditWarning.label"), children: /* @__PURE__ */ t(d.Text, { children: s("w9EditWarning.body") }) }) : null;
|
|
27
26
|
}
|
|
28
27
|
function B({
|
|
29
|
-
contractorId:
|
|
28
|
+
contractorId: o,
|
|
30
29
|
defaultValues: i,
|
|
31
|
-
onEvent:
|
|
30
|
+
onEvent: s,
|
|
32
31
|
dictionary: d,
|
|
33
32
|
className: D
|
|
34
33
|
}) {
|
|
35
34
|
x("Contractor.Address", d), _("Contractor.Address");
|
|
36
35
|
const { t: r } = m("Contractor.Address"), { t: A } = m("common"), c = h(), e = E({
|
|
37
|
-
contractorId:
|
|
36
|
+
contractorId: o,
|
|
38
37
|
optionalFieldsToRequire: L,
|
|
39
38
|
defaultValues: i
|
|
40
39
|
});
|
|
@@ -42,12 +41,12 @@ function B({
|
|
|
42
41
|
return /* @__PURE__ */ t(p, { isLoading: !0, error: e.errorHandling.errors });
|
|
43
42
|
const { Fields: n } = e.form, u = e.data.contractorType === "Business", C = async () => {
|
|
44
43
|
const a = await e.actions.onSubmit();
|
|
45
|
-
a && (
|
|
44
|
+
a && (s(g.CONTRACTOR_ADDRESS_UPDATED, a.data), s(g.CONTRACTOR_ADDRESS_DONE));
|
|
46
45
|
};
|
|
47
46
|
return /* @__PURE__ */ t("section", { className: R(b.container, D), children: /* @__PURE__ */ t(p, { error: e.errorHandling.errors, children: /* @__PURE__ */ t(v, { formHookResult: e, children: /* @__PURE__ */ l(T, { onSubmit: () => {
|
|
48
47
|
C();
|
|
49
48
|
}, children: [
|
|
50
|
-
/* @__PURE__ */ t(N, { contractorId:
|
|
49
|
+
/* @__PURE__ */ t(N, { contractorId: o }),
|
|
51
50
|
/* @__PURE__ */ l(f, { flexDirection: "column", gap: 32, alignItems: "stretch", children: [
|
|
52
51
|
/* @__PURE__ */ t("header", { children: /* @__PURE__ */ l(f, { flexDirection: "column", gap: 4, children: [
|
|
53
52
|
/* @__PURE__ */ t(c.Heading, { as: "h2", children: r(u ? "businessAddressTitle" : "homeAddressTitle") }),
|
|
@@ -94,6 +93,6 @@ function B({
|
|
|
94
93
|
] }) }) }) });
|
|
95
94
|
}
|
|
96
95
|
export {
|
|
97
|
-
|
|
96
|
+
$ as Address
|
|
98
97
|
};
|
|
99
98
|
//# sourceMappingURL=Address.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type { FallbackProps } from 'react-error-boundary'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { Form } from '@/components/Common/Form'\nimport { Flex, Grid, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\nimport { contractorEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useContractorHasSignedW9 } from '@/components/Contractor/shared/useContractorHasSignedW9'\n\n// The hook defaults to the API contract, which treats every address field as\n// optional. The SDK's address form has always required a complete mailing\n// address, so it opts those fields back into being required here.\nconst SDK_REQUIRED_ADDRESS_FIELDS: ContractorAddressOptionalFieldsToRequire = {\n update: ['street1', 'city', 'state', 'zip'],\n}\n\n/**\n * Props for {@link Address}.\n *\n * @public\n */\nexport interface AddressProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Pre-fill values for address fields. Server data takes precedence when the contractor already has an address on file. */\n defaultValues?: AddressDefaultValues\n /** Callback invoked each time the component emits an event. */\n onEvent: OnEventType<EventType, unknown>\n /** Overrides for the component's i18n strings. */\n dictionary?: ResourceDictionary<'Contractor.Address'>\n /** Optional class applied to the wrapping `<section>`. */\n className?: string\n /** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n}\n\n/**\n * Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/address/updated` | Fired after the address is saved | The updated `ContractorAddress` entity |\n * | `contractor/address/done` | Fired after a successful save so the parent flow can advance | — |\n *\n * @param props - See {@link AddressProps}.\n * @returns The contractor address form.\n * @public\n *\n * @example\n * ```tsx\n * import { ContractorOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <ContractorOnboarding.Address\n * contractorId=\"contractor-uuid\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps) {\n return (\n <BaseBoundaries componentName=\"Contractor.Address\" FallbackComponent={FallbackComponent}>\n <AddressRoot onEvent={onEvent} {...rootProps} />\n </BaseBoundaries>\n )\n}\n\nfunction ContractorAddressW9Warning({ contractorId }: { contractorId: string }) {\n const hasSignedW9 = useContractorHasSignedW9(contractorId)\n const { t } = useTranslation('Contractor.Address')\n const Components = useComponentContext()\n if (!hasSignedW9) return null\n return (\n <Components.Alert status=\"warning\" disableScrollIntoView label={t('w9EditWarning.label')}>\n <Components.Text>{t('w9EditWarning.body')}</Components.Text>\n </Components.Alert>\n )\n}\n\nfunction AddressRoot({\n contractorId,\n defaultValues,\n onEvent,\n dictionary,\n className,\n}: Omit<AddressProps, 'FallbackComponent'>) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const { t } = useTranslation('Contractor.Address')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n const contractorAddress = useContractorAddressForm({\n contractorId,\n optionalFieldsToRequire: SDK_REQUIRED_ADDRESS_FIELDS,\n defaultValues,\n })\n\n if (contractorAddress.isLoading) {\n return <BaseLayout isLoading error={contractorAddress.errorHandling.errors} />\n }\n\n const { Fields } = contractorAddress.form\n const isBusiness = contractorAddress.data.contractorType === 'Business'\n\n const handleSubmit = async () => {\n const result = await contractorAddress.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, result.data)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n }\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={contractorAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={contractorAddress}>\n <Form onSubmit={() => void handleSubmit()}>\n <ContractorAddressW9Warning contractorId={contractorId} />\n\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <header>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {isBusiness ? t('businessAddressTitle') : t('homeAddressTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {isBusiness ? t('businessAddressDescription') : t('homeAddressDescription')}\n </Components.Text>\n </Flex>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <Fields.Street1\n label={t('street1')}\n validationMessages={{ REQUIRED: t('validations.street1') }}\n />\n <Fields.Street2 label={t('street2')} />\n <Fields.City\n label={t('city')}\n validationMessages={{ REQUIRED: t('validations.city') }}\n />\n <Fields.State\n label={t('state')}\n placeholder={t('statePlaceholder')}\n validationMessages={{ REQUIRED: t('validations.state') }}\n getOptionLabel={(abbr: string) =>\n tCommon(`statesHash.${abbr}`, { defaultValue: abbr })\n }\n />\n <Fields.Zip\n label={t('zip')}\n validationMessages={{\n REQUIRED: t('validations.zip'),\n INVALID_ZIP: t('validations.zipInvalid'),\n }}\n />\n </Grid>\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isDisabled={contractorAddress.status.isPending}>\n {contractorAddress.status.isPending ? t('submitting') : t('submit')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SDK_REQUIRED_ADDRESS_FIELDS","Address","onEvent","FallbackComponent","rootProps","jsx","BaseBoundaries","AddressRoot","ContractorAddressW9Warning","contractorId","hasSignedW9","useContractorHasSignedW9","t","useTranslation","Components","useComponentContext","defaultValues","dictionary","className","useComponentDictionary","useI18n","tCommon","contractorAddress","useContractorAddressForm","BaseLayout","Fields","isBusiness","handleSubmit","result","contractorEvents","classNames","styles","SDKFormProvider","jsxs","Form","Flex","Grid","abbr","ActionsLayout"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type { FallbackProps } from 'react-error-boundary'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { Form } from '@/components/Common/Form'\nimport { Flex, Grid, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\nimport { contractorEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useContractorHasSignedW9 } from '@/components/Contractor/shared/useContractorHasSignedW9'\n\n// The hook defaults to the API contract, which treats every address field as\n// optional. The SDK's address form has always required a complete mailing\n// address, so it opts those fields back into being required here.\nconst SDK_REQUIRED_ADDRESS_FIELDS: ContractorAddressOptionalFieldsToRequire = {\n update: ['street1', 'city', 'state', 'zip'],\n}\n\n/**\n * Props for {@link Address}.\n *\n * @public\n */\nexport interface AddressProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Pre-fill values for address fields. Server data takes precedence when the contractor already has an address on file. */\n defaultValues?: AddressDefaultValues\n /** Callback invoked each time the component emits an event. */\n onEvent: OnEventType<EventType, unknown>\n /** Overrides for the component's i18n strings. */\n dictionary?: ResourceDictionary<'Contractor.Address'>\n /** Optional class applied to the wrapping `<section>`. */\n className?: string\n /** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n}\n\n/**\n * Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/address/updated` | Fired after the address is saved | The updated `ContractorAddress` entity |\n * | `contractor/address/done` | Fired after a successful save so the parent flow can advance | — |\n *\n * @param props - See {@link AddressProps}.\n * @returns The contractor address form.\n * @public\n *\n * @example\n * ```tsx\n * import { ContractorOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <ContractorOnboarding.Address\n * contractorId=\"contractor-uuid\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps) {\n return (\n <BaseBoundaries componentName=\"Contractor.Address\" FallbackComponent={FallbackComponent}>\n <AddressRoot onEvent={onEvent} {...rootProps} />\n </BaseBoundaries>\n )\n}\n\nfunction ContractorAddressW9Warning({ contractorId }: { contractorId: string }) {\n const hasSignedW9 = useContractorHasSignedW9(contractorId)\n const { t } = useTranslation('Contractor.Address')\n const Components = useComponentContext()\n if (!hasSignedW9) return null\n return (\n <Components.Alert status=\"warning\" disableScrollIntoView label={t('w9EditWarning.label')}>\n <Components.Text>{t('w9EditWarning.body')}</Components.Text>\n </Components.Alert>\n )\n}\n\nfunction AddressRoot({\n contractorId,\n defaultValues,\n onEvent,\n dictionary,\n className,\n}: Omit<AddressProps, 'FallbackComponent'>) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const { t } = useTranslation('Contractor.Address')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n const contractorAddress = useContractorAddressForm({\n contractorId,\n optionalFieldsToRequire: SDK_REQUIRED_ADDRESS_FIELDS,\n defaultValues,\n })\n\n if (contractorAddress.isLoading) {\n return <BaseLayout isLoading error={contractorAddress.errorHandling.errors} />\n }\n\n const { Fields } = contractorAddress.form\n const isBusiness = contractorAddress.data.contractorType === 'Business'\n\n const handleSubmit = async () => {\n const result = await contractorAddress.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, result.data)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n }\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={contractorAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={contractorAddress}>\n <Form onSubmit={() => void handleSubmit()}>\n <ContractorAddressW9Warning contractorId={contractorId} />\n\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <header>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {isBusiness ? t('businessAddressTitle') : t('homeAddressTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {isBusiness ? t('businessAddressDescription') : t('homeAddressDescription')}\n </Components.Text>\n </Flex>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <Fields.Street1\n label={t('street1')}\n validationMessages={{ REQUIRED: t('validations.street1') }}\n />\n <Fields.Street2 label={t('street2')} />\n <Fields.City\n label={t('city')}\n validationMessages={{ REQUIRED: t('validations.city') }}\n />\n <Fields.State\n label={t('state')}\n placeholder={t('statePlaceholder')}\n validationMessages={{ REQUIRED: t('validations.state') }}\n getOptionLabel={(abbr: string) =>\n tCommon(`statesHash.${abbr}`, { defaultValue: abbr })\n }\n />\n <Fields.Zip\n label={t('zip')}\n validationMessages={{\n REQUIRED: t('validations.zip'),\n INVALID_ZIP: t('validations.zipInvalid'),\n }}\n />\n </Grid>\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isDisabled={contractorAddress.status.isPending}>\n {contractorAddress.status.isPending ? t('submitting') : t('submit')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SDK_REQUIRED_ADDRESS_FIELDS","Address","onEvent","FallbackComponent","rootProps","jsx","BaseBoundaries","AddressRoot","ContractorAddressW9Warning","contractorId","hasSignedW9","useContractorHasSignedW9","t","useTranslation","Components","useComponentContext","defaultValues","dictionary","className","useComponentDictionary","useI18n","tCommon","contractorAddress","useContractorAddressForm","BaseLayout","Fields","isBusiness","handleSubmit","result","contractorEvents","classNames","styles","SDKFormProvider","jsxs","Form","Flex","Grid","abbr","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAMA,IAAwE;AAAA,EAC5E,QAAQ,CAAC,WAAW,QAAQ,SAAS,KAAK;AAC5C;AAiDO,SAASC,EAAQ,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,GAAGC,KAA2B;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,eAAc,sBAAqB,mBAAAH,GACjD,4BAACI,GAAA,EAAY,SAAAL,GAAmB,GAAGE,EAAA,CAAW,EAAA,CAChD;AAEJ;AAEA,SAASI,EAA2B,EAAE,cAAAC,KAA0C;AAC9E,QAAMC,IAAcC,EAAyBF,CAAY,GACnD,EAAE,GAAAG,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA;AACnB,SAAKL,sBAEFI,EAAW,OAAX,EAAiB,QAAO,WAAU,uBAAqB,IAAC,OAAOF,EAAE,qBAAqB,GACrF,4BAACE,EAAW,MAAX,EAAiB,UAAAF,EAAE,oBAAoB,GAAE,GAC5C,IAJuB;AAM3B;AAEA,SAASL,EAAY;AAAA,EACnB,cAAAE;AAAA,EACA,eAAAO;AAAA,EACA,SAAAd;AAAA,EACA,YAAAe;AAAA,EACA,WAAAC;AACF,GAA4C;AAC1C,EAAAC,EAAuB,sBAAsBF,CAAU,GACvDG,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAR,EAAA,IAAMC,EAAe,oBAAoB,GAC3C,EAAE,GAAGQ,MAAYR,EAAe,QAAQ,GACxCC,IAAaC,EAAA,GAEbO,IAAoBC,EAAyB;AAAA,IACjD,cAAAd;AAAA,IACA,yBAAyBT;AAAA,IACzB,eAAAgB;AAAA,EAAA,CACD;AAED,MAAIM,EAAkB;AACpB,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAkB,cAAc,QAAQ;AAG9E,QAAM,EAAE,QAAAG,MAAWH,EAAkB,MAC/BI,IAAaJ,EAAkB,KAAK,mBAAmB,YAEvDK,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMN,EAAkB,QAAQ,SAAA;AAC/C,IAAIM,MACF1B,EAAQ2B,EAAiB,4BAA4BD,EAAO,IAAI,GAChE1B,EAAQ2B,EAAiB,uBAAuB;AAAA,EAEpD;AAEA,SACE,gBAAAxB,EAAC,WAAA,EAAQ,WAAWyB,EAAWC,EAAO,WAAWb,CAAS,GACxD,UAAA,gBAAAb,EAACmB,GAAA,EAAW,OAAOF,EAAkB,cAAc,QACjD,UAAA,gBAAAjB,EAAC2B,GAAA,EAAgB,gBAAgBV,GAC/B,UAAA,gBAAAW,EAACC,KAAK,UAAU,MAAA;AAAM,IAAKP,EAAA;AAAA,KACzB,UAAA;AAAA,IAAA,gBAAAtB,EAACG,KAA2B,cAAAC,GAA4B;AAAA,sBAEvD0B,GAAA,EAAK,eAAc,UAAS,KAAK,IAAI,YAAW,WAC/C,UAAA;AAAA,MAAA,gBAAA9B,EAAC,YACC,UAAA,gBAAA4B,EAACE,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,QAAA,gBAAA9B,EAACS,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAaF,EAAbc,IAAe,yBAA4B,kBAAN,EAAwB,CAChE;AAAA,QACA,gBAAArB,EAACS,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAaF,EAAbc,IAAe,+BAAkC,wBAAN,EAA8B,CAC5E;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,MAEA,gBAAAO,EAACG,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA,GAAK,KAAK,IACtE,UAAA;AAAA,QAAA,gBAAA/B;AAAA,UAACoB,EAAO;AAAA,UAAP;AAAA,YACC,OAAOb,EAAE,SAAS;AAAA,YAClB,oBAAoB,EAAE,UAAUA,EAAE,qBAAqB,EAAA;AAAA,UAAE;AAAA,QAAA;AAAA,0BAE1Da,EAAO,SAAP,EAAe,OAAOb,EAAE,SAAS,GAAG;AAAA,QACrC,gBAAAP;AAAA,UAACoB,EAAO;AAAA,UAAP;AAAA,YACC,OAAOb,EAAE,MAAM;AAAA,YACf,oBAAoB,EAAE,UAAUA,EAAE,kBAAkB,EAAA;AAAA,UAAE;AAAA,QAAA;AAAA,QAExD,gBAAAP;AAAA,UAACoB,EAAO;AAAA,UAAP;AAAA,YACC,OAAOb,EAAE,OAAO;AAAA,YAChB,aAAaA,EAAE,kBAAkB;AAAA,YACjC,oBAAoB,EAAE,UAAUA,EAAE,mBAAmB,EAAA;AAAA,YACrD,gBAAgB,CAACyB,MACfhB,EAAQ,cAAcgB,CAAI,IAAI,EAAE,cAAcA,EAAA,CAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxD,gBAAAhC;AAAA,UAACoB,EAAO;AAAA,UAAP;AAAA,YACC,OAAOb,EAAE,KAAK;AAAA,YACd,oBAAoB;AAAA,cAClB,UAAUA,EAAE,iBAAiB;AAAA,cAC7B,aAAaA,EAAE,wBAAwB;AAAA,YAAA;AAAA,UACzC;AAAA,QAAA;AAAA,MACF,GACF;AAAA,MAEA,gBAAAP,EAACiC,KACC,UAAA,gBAAAjC,EAACS,EAAW,QAAX,EAAkB,MAAK,UAAS,YAAYQ,EAAkB,OAAO,WACnE,UAAAA,EAAkB,OAAO,YAAYV,EAAE,YAAY,IAAIA,EAAE,QAAQ,EAAA,CACpE,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base/Base';
|
|
2
|
+
/**
|
|
3
|
+
* The tab currently selected on {@link ManagementContractorList}.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type ContractorTab = 'active' | 'onboarding' | 'dismissed';
|
|
8
|
+
/**
|
|
9
|
+
* Props for {@link ManagementContractorList}.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ManagementContractorListProps extends BaseComponentInterface<'Contractor.ManagementContractorList'> {
|
|
14
|
+
/** The associated company identifier. */
|
|
15
|
+
companyId: string;
|
|
16
|
+
/** Tab to render first: Active, Onboarding, or Dismissed. Defaults to `'active'`. */
|
|
17
|
+
initialTab?: ContractorTab;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a tabbed list of a company's contractors split across Active, Onboarding, and Dismissed
|
|
21
|
+
* tabs, with per-row actions tailored to each tab (edit, delete, view details, dismiss, rehire,
|
|
22
|
+
* cancel a scheduled dismissal or rehire).
|
|
23
|
+
*
|
|
24
|
+
* @events
|
|
25
|
+
* | Event | Description | Data |
|
|
26
|
+
* | ----- | ----------- | ---- |
|
|
27
|
+
* | `contractor/create` | Fired when the user clicks "Add contractor". | — |
|
|
28
|
+
* | `contractor/update` | Fired when the user selects "Edit"/"Review" on an onboarding-tab row. | `{ contractorId: string }` |
|
|
29
|
+
* | `contractor/view` | Fired when the user selects "View details" on an active or dismissed row. | `{ contractorId: string }` |
|
|
30
|
+
* | `contractor/deleted` | Fired after an onboarding-tab row's "Remove" action completes. | `{ contractorId: string }` |
|
|
31
|
+
* | `contractor/selfOnboarding/cancelled` | Fired after the "Cancel self-onboarding" action updates a contractor's onboarding status. | The updated `contractorOnboardingStatus` returned by the API. |
|
|
32
|
+
* | `contractor/dismiss` | Fired when the user selects "Dismiss" on an active row. No mutation is performed by this component. | `{ contractorId: string }` |
|
|
33
|
+
* | `contractor/rehire` | Fired when the user selects "Rehire" on a dismissed row. No mutation is performed by this component. | `{ contractorId: string }` |
|
|
34
|
+
* | `contractor/dismissal/cancelled` | Fired after a scheduled dismissal is cancelled via the confirm dialog. | `{ contractorId: string }` |
|
|
35
|
+
* | `contractor/rehire/cancelled` | Fired after a scheduled rehire is cancelled via the confirm dialog. | `{ contractorId: string }` |
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare function ManagementContractorList({ FallbackComponent, ...props }: ManagementContractorListProps): import("react").JSX.Element;
|