@gusto/embedded-react-sdk 0.43.0 → 0.44.1
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 +108 -0
- package/README.md +23 -5
- package/dist/assets/icons/edit-02.svg.js +10 -0
- package/dist/assets/icons/edit-02.svg.js.map +1 -0
- package/dist/components/Base/useBaseSubmit.js +6 -6
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +86 -64
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +52 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.module.scss.js +18 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.module.scss.js.map +1 -0
- package/dist/components/Common/Fields/hooks/FieldElementRegistryProvider.d.ts +13 -0
- package/dist/components/Common/Fields/hooks/FieldElementRegistryProvider.js +12 -0
- package/dist/components/Common/Fields/hooks/FieldElementRegistryProvider.js.map +1 -0
- package/dist/components/Common/Fields/hooks/fieldElementRegistry.d.ts +21 -0
- package/dist/components/Common/Fields/hooks/fieldElementRegistry.js +29 -0
- package/dist/components/Common/Fields/hooks/fieldElementRegistry.js.map +1 -0
- package/dist/components/Common/Fields/hooks/useField.js +43 -37
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/Flex/Flex.d.ts +2 -1
- package/dist/components/Common/Flex/Flex.js +14 -12
- package/dist/components/Common/Flex/Flex.js.map +1 -1
- package/dist/components/Common/Flex/Flex.module.scss.js +4 -4
- package/dist/components/Common/TaxInputs/TaxInputs.js +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +2 -2
- package/dist/components/Common/UI/Dialog/Dialog.js +35 -36
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +2 -2
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +7 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +7 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +9 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +7 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -12
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +7 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -8
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +26 -25
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +3 -2
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +10 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +12 -13
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/index.d.ts +2 -0
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +7 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +8 -7
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -7
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +7 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +7 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +6 -6
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +2 -3
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +9 -9
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +3 -3
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +58 -57
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +12 -11
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +67 -63
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +7 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +6 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +57 -26
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +7 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +3 -0
- package/dist/components/Company/exports/companyOnboarding.js +21 -15
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
- package/dist/components/Company/index.d.ts +1 -0
- package/dist/components/Company/index.js +14 -12
- package/dist/components/Company/index.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +18 -19
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/Head.js +7 -6
- package/dist/components/Contractor/Address/Head.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +9 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +8 -8
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +6 -5
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +5 -5
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +8 -7
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +35 -34
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +23 -21
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.d.ts +7 -4
- package/dist/components/Employee/Compensation/Compensation.js +72 -179
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/CompensationFlowComponents.d.ts +27 -0
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js +61 -0
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +14 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +128 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +17 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +224 -0
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +1 -0
- package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +5 -0
- package/dist/components/Employee/Compensation/JobsList/JobsList.d.ts +5 -0
- package/dist/components/Employee/Compensation/JobsList/JobsList.js +47 -0
- package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +1 -0
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.d.ts +11 -0
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js +98 -0
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +1 -0
- package/dist/components/Employee/Compensation/JobsList/index.d.ts +5 -0
- package/dist/components/Employee/Compensation/{useCompensation.d.ts → compensationSchema.d.ts} +0 -22
- package/dist/components/Employee/Compensation/{useCompensation.js → compensationSchema.js} +9 -12
- package/dist/components/Employee/Compensation/compensationSchema.js.map +1 -0
- package/dist/components/Employee/Compensation/compensationStateMachine.d.ts +6 -0
- package/dist/components/Employee/Compensation/compensationStateMachine.js +73 -0
- package/dist/components/Employee/Compensation/compensationStateMachine.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +62 -36
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +81 -57
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +5 -12
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +22 -35
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +5 -3
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +55 -13
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +216 -226
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +15 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +27 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.d.ts +19 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +29 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +7 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +43 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +37 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +13 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +26 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +56 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +180 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +15 -13
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +33 -15
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +13 -11
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +11 -9
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/TaxesView.js +21 -19
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +54 -33
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +6 -6
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +3 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +7 -7
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +36 -33
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +48 -41
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +1 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +23 -20
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +30 -30
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +13 -14
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +7 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +15 -14
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +5 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -7
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js +69 -68
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +8 -7
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +18 -17
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/index.d.ts +3 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +8 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +71 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/management/index.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +8 -0
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +55 -0
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +15 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +104 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/index.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +41 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js +40 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +18 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +31 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/index.d.ts +5 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +37 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js +140 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +2 -3
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +2 -2
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +14 -14
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +9 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.d.ts +6 -0
- package/dist/components/Employee/Profile/management/Profile.js +122 -0
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -0
- package/dist/components/Employee/Profile/management/Profile.module.scss.js +8 -0
- package/dist/components/Employee/Profile/management/Profile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/{AdminProfile.js → onboarding/AdminProfile.js} +15 -15
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -0
- package/dist/components/Employee/Profile/{EmployeeProfile.js → onboarding/EmployeeProfile.js} +14 -14
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -0
- package/dist/components/Employee/Profile/{Profile.d.ts → onboarding/Profile.d.ts} +2 -2
- package/dist/components/Employee/Profile/{Profile.js → onboarding/Profile.js} +4 -4
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +9 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +61 -58
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +40 -39
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +47 -46
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +14 -14
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/index.d.ts +2 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +6 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +59 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -0
- package/dist/components/Employee/StateTaxes/management/index.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +8 -0
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +49 -0
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -0
- package/dist/components/Employee/StateTaxes/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +14 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +32 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -0
- package/dist/components/Employee/StateTaxes/shared/index.d.ts +3 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/stateTaxesFixtures.d.ts +8 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/toWireFormat.d.ts +36 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +56 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js +116 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +12 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +76 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +14 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js +23 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMeta.d.ts +6 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +39 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +46 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js +93 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/index.d.ts +6 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +36 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +159 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -0
- package/dist/components/Employee/Taxes/Actions.js +9 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +7 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +11 -11
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +4 -4
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +3 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +2 -3
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +3 -0
- package/dist/components/Employee/exports/employeeManagement.js +16 -10
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/Employee/exports/employeeOnboarding.js +19 -19
- package/dist/components/Employee/index.d.ts +2 -1
- package/dist/components/Employee/index.js +37 -37
- package/dist/components/Flow/FlowHeader.js +8 -8
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +61 -65
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +5 -5
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +17 -17
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +7 -7
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +3 -2
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +23 -21
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +3 -2
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +7 -6
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -2
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +20 -20
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -2
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -25
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +2 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +4 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +2 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +17 -16
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +4 -4
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +3 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +9 -9
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +7 -7
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +7 -7
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +3 -2
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +9 -9
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +1 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +21 -18
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +2 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/AddEmployeesToPolicy/AddEmployeesToPolicy.js +3 -2
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +6 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +149 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +2 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +80 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +21 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/index.d.ts +5 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/HolidaySelectionForm/HolidaySelectionForm.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +115 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/HolidaySelectionForm/HolidaySelectionFormPresentation.js +9 -7
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js +103 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +135 -0
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyList/PolicyListTypes.d.ts +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js +70 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.module.scss.js +16 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +164 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicySettings/PolicySettingsTypes.d.ts +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +31 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +68 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -3
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +117 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +9 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js +25 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffFlow/timeOffStateMachine.d.ts +4 -2
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +487 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +158 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +85 -76
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +6 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +143 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +103 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +41 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +9 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +216 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +2 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +64 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +9 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +56 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +5 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +251 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +10 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js.map +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +143 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +52 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/index.d.ts +7 -0
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js +9 -0
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -0
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +6 -0
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js +9 -0
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -0
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js +9 -0
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/index.d.ts +5 -4
- package/dist/components/TimeOff/index.js +27 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +95 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +3 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +86 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +27 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/index.d.ts +3 -0
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/holidayHelpers.d.ts +1 -1
- package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/holidayHelpers.js +8 -8
- package/dist/components/TimeOff/shared/holidayHelpers.js.map +1 -0
- package/dist/components/TimeOff/shared/holidayHelpers.test.d.ts +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +11 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +2 -0
- package/dist/helpers/dateFormatting.js +4 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/I18n.js +11 -10
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +12 -14
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +18 -16
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +14 -0
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +24 -16
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +14 -14
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +46 -42
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +16 -10
- package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.Profile.json.js +24 -20
- package/dist/i18n/en/Employee.Profile.json.js.map +1 -1
- package/dist/i18n/en/Employee.StateTaxes.json.js +14 -6
- package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -10
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +118 -93
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/SDKFormProvider.js +18 -14
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
- package/dist/partner-hook-utils/form/buildFormSchema.js +41 -41
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +10 -6
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +49 -26
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +27 -23
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -29
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +37 -33
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +32 -28
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +34 -30
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +23 -19
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +31 -27
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/withFieldElementRegistry.d.ts +10 -0
- package/dist/partner-hook-utils/form/fields/withFieldElementRegistry.js +9 -0
- package/dist/partner-hook-utils/form/fields/withFieldElementRegistry.js.map +1 -0
- package/dist/partner-hook-utils/form/index.d.ts +3 -0
- package/dist/partner-hook-utils/form/resolveFieldError.js +10 -7
- package/dist/partner-hook-utils/form/resolveFieldError.js.map +1 -1
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js +10 -7
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +1 -1
- package/dist/partner-hook-utils/form/useHookFieldResolution.d.ts +10 -3
- package/dist/partner-hook-utils/form/useHookFieldResolution.js +6 -6
- package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -1
- package/dist/partner-hook-utils/form/useHookFormInternals.d.ts +22 -0
- package/dist/partner-hook-utils/form/useHookFormInternals.js +12 -0
- package/dist/partner-hook-utils/form/useHookFormInternals.js.map +1 -0
- package/dist/partner-hook-utils/types.d.ts +15 -0
- package/dist/shared/constants.d.ts +22 -0
- package/dist/shared/constants.js +41 -30
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +62 -14
- package/docs/reference/endpoint-inventory.json +313 -122
- package/package.json +19 -17
- package/dist/components/Employee/Compensation/Actions.d.ts +0 -1
- package/dist/components/Employee/Compensation/Actions.js +0 -39
- package/dist/components/Employee/Compensation/Actions.js.map +0 -1
- package/dist/components/Employee/Compensation/Edit.d.ts +0 -5
- package/dist/components/Employee/Compensation/Edit.js +0 -179
- package/dist/components/Employee/Compensation/Edit.js.map +0 -1
- package/dist/components/Employee/Compensation/Head.d.ts +0 -1
- package/dist/components/Employee/Compensation/Head.js +0 -22
- package/dist/components/Employee/Compensation/Head.js.map +0 -1
- package/dist/components/Employee/Compensation/List.d.ts +0 -1
- package/dist/components/Employee/Compensation/List.js +0 -72
- package/dist/components/Employee/Compensation/List.js.map +0 -1
- package/dist/components/Employee/Compensation/useCompensation.js.map +0 -1
- package/dist/components/Employee/FederalTaxes/Actions.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +0 -14
- package/dist/components/Employee/FederalTaxes/Actions.js.map +0 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +0 -12
- package/dist/components/Employee/FederalTaxes/FederalForm.js +0 -110
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +0 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.d.ts +0 -6
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +0 -84
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +0 -1
- package/dist/components/Employee/FederalTaxes/Head.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/Head.js +0 -24
- package/dist/components/Employee/FederalTaxes/Head.js.map +0 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.d.ts +0 -5
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +0 -21
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +0 -1
- package/dist/components/Employee/Profile/AdminProfile.js.map +0 -1
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +0 -1
- package/dist/components/Employee/Profile/Profile.js.map +0 -1
- package/dist/components/Employee/Profile/index.d.ts +0 -2
- package/dist/components/Employee/StateTaxes/Actions.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/Actions.js +0 -14
- package/dist/components/Employee/StateTaxes/Actions.js.map +0 -1
- package/dist/components/Employee/StateTaxes/StateForm.d.ts +0 -6
- package/dist/components/Employee/StateTaxes/StateForm.js +0 -34
- package/dist/components/Employee/StateTaxes/StateForm.js.map +0 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.d.ts +0 -7
- package/dist/components/Employee/StateTaxes/StateTaxes.js +0 -98
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +0 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.d.ts +0 -8
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +0 -21
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +0 -49
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +0 -107
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +0 -125
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js +0 -66
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +0 -16
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +0 -154
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +0 -29
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +0 -67
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +0 -112
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +0 -317
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +0 -72
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployees.d.ts +0 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +0 -6
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +0 -66
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +0 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +0 -82
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +0 -24
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +0 -7
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +0 -70
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTypes.d.ts +0 -24
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +0 -56
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js +0 -35
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js +0 -35
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.d.ts +0 -5
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js +0 -35
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.d.ts +0 -5
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js +0 -35
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/index.js +0 -27
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +0 -2
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.js +0 -90
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +0 -1
- /package/dist/components/Employee/{Compensation/shared/useCompensationForm/compensationSchemaParity.test.d.ts → FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.test.d.ts} +0 -0
- /package/dist/components/Employee/Profile/{AdminProfile.d.ts → onboarding/AdminProfile.d.ts} +0 -0
- /package/dist/components/Employee/Profile/{AdminProfile.module.scss.js → onboarding/AdminProfile.module.scss.js} +0 -0
- /package/dist/components/Employee/Profile/{AdminProfile.module.scss.js.map → onboarding/AdminProfile.module.scss.js.map} +0 -0
- /package/dist/components/Employee/Profile/{EmployeeProfile.d.ts → onboarding/EmployeeProfile.d.ts} +0 -0
- /package/dist/components/Employee/Profile/{EmployeeProfile.module.scss.js → onboarding/EmployeeProfile.module.scss.js} +0 -0
- /package/dist/components/Employee/Profile/{EmployeeProfile.module.scss.js.map → onboarding/EmployeeProfile.module.scss.js.map} +0 -0
- /package/dist/components/{UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.test.d.ts → Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.test.d.ts} +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/AddEmployeesHoliday/AddEmployeesHoliday.js +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyList/PolicyList.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyList/PolicyListPresentation.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyList/PolicyListPresentation.module.scss.js +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyList/PolicyListPresentation.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicySettings/PolicySettings.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicySettings/PolicySettings.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicySettings/PolicySettingsPresentation.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/PolicyTypeSelector/PolicyTypeSelector.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffFlow/TimeOffFlow.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffFlow/TimeOffFlow.js +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffFlow/index.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts → TimeOff/TimeOffFlow/timeOffStateMachine.test.d.ts} +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/TimeOffManagement/PolicyConfigurationForm/index.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/index.js.map +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/EmployeeTable/EmployeeTable.module.scss.js +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/EmployeeTable/EmployeeTable.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_TimeOff → TimeOff}/shared/EmployeeTable/index.d.ts +0 -0
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
import { z as h } from "zod";
|
|
2
|
-
function
|
|
2
|
+
function D(e, r) {
|
|
3
3
|
const {
|
|
4
4
|
mode: i,
|
|
5
5
|
requiredFieldsConfig: u = {},
|
|
6
6
|
requiredErrorCode: c = "REQUIRED",
|
|
7
|
-
excludeFields:
|
|
8
|
-
} = r, f = new Set(
|
|
9
|
-
|
|
10
|
-
),
|
|
11
|
-
for (const [n, s] of Object.entries(
|
|
7
|
+
excludeFields: p = []
|
|
8
|
+
} = r, f = new Set(p.map(String)), a = new Set((r.fieldsWithRedactedValues ?? []).map(String)), m = new Set(
|
|
9
|
+
x(r.optionalFieldsToRequire, i)
|
|
10
|
+
), R = {}, d = [], y = [], g = u;
|
|
11
|
+
for (const [n, s] of Object.entries(e)) {
|
|
12
12
|
if (f.has(n)) continue;
|
|
13
13
|
y.push(n);
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const o =
|
|
17
|
-
typeof
|
|
14
|
+
const t = g[n] ?? "always";
|
|
15
|
+
if (R[n] = b(s), !a.has(n)) {
|
|
16
|
+
const o = m.has(n);
|
|
17
|
+
typeof t == "function" ? d.push({
|
|
18
18
|
name: n,
|
|
19
|
-
predicate: o ? () => !0 :
|
|
20
|
-
}) : (
|
|
19
|
+
predicate: o ? () => !0 : t
|
|
20
|
+
}) : (t === "always" || t === i || o) && d.push({ name: n, predicate: () => !0 });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
|
|
23
|
+
const w = d.length > 0 || r.superRefine;
|
|
24
|
+
let l = h.object(R);
|
|
25
|
+
w && (l = l.superRefine(
|
|
26
26
|
(n, s) => {
|
|
27
|
-
for (const { name:
|
|
28
|
-
o(n, i) &&
|
|
27
|
+
for (const { name: t, predicate: o } of d)
|
|
28
|
+
o(n, i) && q(n[t]) && s.addIssue({
|
|
29
29
|
code: h.ZodIssueCode.custom,
|
|
30
|
-
path: [
|
|
30
|
+
path: [t],
|
|
31
31
|
message: c
|
|
32
32
|
});
|
|
33
33
|
r.superRefine?.(n, s);
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
const
|
|
37
|
-
function
|
|
36
|
+
const S = P(d, i);
|
|
37
|
+
function F(n) {
|
|
38
38
|
const s = {};
|
|
39
|
-
for (const
|
|
40
|
-
const o = g[
|
|
41
|
-
|
|
42
|
-
name:
|
|
39
|
+
for (const t of y) {
|
|
40
|
+
const o = g[t] ?? "always";
|
|
41
|
+
m.has(t) ? s[t] = { name: t, isRequired: !0 } : typeof o == "function" ? s[t] = { name: t, isRequired: n ? o(n, i) : !1 } : s[t] = {
|
|
42
|
+
name: t,
|
|
43
43
|
isRequired: o === "always" || o === i
|
|
44
|
-
}, a.has(
|
|
44
|
+
}, a.has(t) && (s[t].hasRedactedValue = !0);
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
48
|
return [
|
|
49
|
-
|
|
50
|
-
{ getFieldsMetadata:
|
|
49
|
+
l,
|
|
50
|
+
{ getFieldsMetadata: F, predicateDeps: S }
|
|
51
51
|
];
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
53
|
+
function x(e, r) {
|
|
54
|
+
return e ? (r === "create" ? e.create : e.update) ?? [] : [];
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return h.preprocess((r) => r
|
|
56
|
+
function b(e) {
|
|
57
|
+
return h.preprocess((r) => q(r) ? void 0 : r, e.optional());
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function q(e) {
|
|
60
|
+
return !!(e == null || typeof e == "string" && e.trim() === "" || typeof e == "number" && Number.isNaN(e));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function P(e, r) {
|
|
63
63
|
const i = /* @__PURE__ */ new Set();
|
|
64
|
-
for (const { predicate: u } of
|
|
65
|
-
if (
|
|
66
|
-
const c = [],
|
|
64
|
+
for (const { predicate: u } of e) {
|
|
65
|
+
if (C(u)) continue;
|
|
66
|
+
const c = [], p = new Proxy({}, {
|
|
67
67
|
get(f, a) {
|
|
68
68
|
typeof a == "string" && c.push(a);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
try {
|
|
72
|
-
u(
|
|
72
|
+
u(p, r);
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
for (const f of c) i.add(f);
|
|
76
76
|
}
|
|
77
77
|
return [...i];
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function C(e) {
|
|
80
80
|
const r = [], i = new Proxy({}, {
|
|
81
81
|
get(u, c) {
|
|
82
82
|
typeof c == "string" && r.push(c);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
try {
|
|
86
|
-
|
|
86
|
+
e(i, "create");
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
89
|
return r.length === 0;
|
|
90
90
|
}
|
|
91
91
|
export {
|
|
92
|
-
|
|
92
|
+
D as buildFormSchema
|
|
93
93
|
};
|
|
94
94
|
//# sourceMappingURL=buildFormSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFormSchema.js","sources":["../../../src/partner-hook-utils/form/buildFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FieldMetadata } from '../types'\n\n// ── Types ────────────────────────────────────────────────────────────\n\nexport type FormMode = 'create' | 'update'\n\nexport type RequiredFieldRule<TData = Record<string, unknown>> =\n | 'create'\n | 'update'\n | 'always'\n | 'never'\n | ((data: TData, mode: FormMode) => boolean)\n\nexport type RequiredFieldConfig<TSchema extends Record<string, z.ZodType>> = Partial<{\n [K in keyof TSchema & string]: RequiredFieldRule<{\n [F in keyof TSchema]: z.infer<TSchema[F]>\n }>\n}>\n\ntype OptionalOnCreate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'update' | 'never' ? K : never\n}[keyof TConfig & string]\n\ntype OptionalOnUpdate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'create' | 'never' ? K : never\n}[keyof TConfig & string]\n\nexport type OptionalFieldsToRequire<TConfig> = {\n create?: Array<OptionalOnCreate<TConfig>>\n update?: Array<OptionalOnUpdate<TConfig>>\n}\n\n// ── buildFormSchema ──────────────────────────────────────────────────\n\ninterface BuildFormSchemaOptions<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n> {\n requiredFieldsConfig?: TConfig\n requiredErrorCode?: string\n mode: FormMode\n optionalFieldsToRequire?: OptionalFieldsToRequire<TConfig>\n excludeFields?: Array<keyof T & string>\n /** Fields with existing server-side values that are redacted in the API response\n * (e.g. SSN, EIN). These fields remain in the schema for format validation and\n * appear in metadata (with `hasRedactedValue: true`) but are exempt from required\n * validation — an empty submission is valid because a value already exists. */\n fieldsWithRedactedValues?: Array<keyof T & string>\n superRefine?: (data: { [K in keyof T]: z.infer<T[K]> }, ctx: z.RefinementCtx) => void\n}\n\nexport interface FieldsMetadataConfig<T extends Record<string, z.ZodType>> {\n getFieldsMetadata: (data?: Record<string, unknown>) => Record<keyof T, FieldMetadata>\n /** Form field names that predicate-based requiredness rules read at runtime. */\n predicateDeps: string[]\n}\n\ntype FormDataFromValidators<T extends Record<string, z.ZodType>> = {\n [K in keyof T]: z.infer<T[K]>\n}\n\nexport type BuildFormSchemaResult<T extends Record<string, z.ZodType>> = [\n schema: z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n metadataConfig: FieldsMetadataConfig<T>,\n]\n\nexport function buildFormSchema<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n>(fieldValidators: T, options: BuildFormSchemaOptions<T, TConfig>): BuildFormSchemaResult<T> {\n const {\n mode,\n requiredFieldsConfig = {} as Record<string, RequiredFieldRule>,\n requiredErrorCode = 'REQUIRED',\n excludeFields = [],\n } = options\n const excluded = new Set(excludeFields.map(String))\n const redacted = new Set((options.fieldsWithRedactedValues ?? []).map(String))\n const partnerRequired = new Set(\n resolveOptionalFieldsToRequire(options.optionalFieldsToRequire, mode),\n )\n\n const shape: Record<string, z.ZodType> = {}\n const dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }> = []\n const includedFieldNames: string[] = []\n const config = requiredFieldsConfig as Record<string, RequiredFieldRule>\n\n for (const [name, validator] of Object.entries(fieldValidators)) {\n if (excluded.has(name)) continue\n includedFieldNames.push(name)\n\n const effectiveRule = config[name] ?? 'always'\n\n shape[name] = makeOptional(validator)\n\n if (!redacted.has(name)) {\n const isPartnerRequired = partnerRequired.has(name)\n\n if (typeof effectiveRule === 'function') {\n dynamicRequired.push({\n name,\n predicate: isPartnerRequired ? () => true : effectiveRule,\n })\n } else {\n const isRequired = effectiveRule === 'always' || effectiveRule === mode || isPartnerRequired\n if (isRequired) {\n dynamicRequired.push({ name, predicate: () => true })\n }\n }\n }\n }\n\n const hasSuperRefine = dynamicRequired.length > 0 || options.superRefine\n let schema: z.ZodType = z.object(shape)\n\n if (hasSuperRefine) {\n schema = (schema as z.ZodObject).superRefine(\n (data: Record<string, unknown>, ctx: z.RefinementCtx) => {\n for (const { name, predicate } of dynamicRequired) {\n if (predicate(data, mode) && isEmpty(data[name])) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [name],\n message: requiredErrorCode,\n })\n }\n }\n\n options.superRefine?.(data as { [K in keyof T]: z.infer<T[K]> }, ctx)\n },\n )\n }\n\n const predicateDeps = detectPredicateDeps(dynamicRequired, mode)\n\n function getFieldsMetadata(data?: Record<string, unknown>) {\n const metadata: Record<string, FieldMetadata> = {}\n\n for (const name of includedFieldNames) {\n const effectiveRule = config[name] ?? 'always'\n\n if (partnerRequired.has(name)) {\n metadata[name] = { name, isRequired: true }\n } else if (typeof effectiveRule === 'function') {\n metadata[name] = { name, isRequired: data ? effectiveRule(data, mode) : false }\n } else {\n metadata[name] = {\n name,\n isRequired: effectiveRule === 'always' || effectiveRule === mode,\n }\n }\n\n if (redacted.has(name)) {\n metadata[name].hasRedactedValue = true\n }\n }\n\n return metadata as Record<keyof T, FieldMetadata>\n }\n\n // makeOptional wraps fields with z.preprocess, which causes z.input to infer\n // `unknown`. Cast the schema to carry the original field types so zodResolver\n // infers correct form data types — consumers don't need per-hook casts.\n return [\n schema as z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n { getFieldsMetadata, predicateDeps },\n ]\n}\n\n// ── Internal helpers ─────────────────────────────────────────────────\n\nfunction resolveOptionalFieldsToRequire<TConfig>(\n value: OptionalFieldsToRequire<TConfig> | undefined,\n mode: FormMode,\n): string[] {\n if (!value) return []\n return ((mode === 'create' ? value.create : value.update) ?? []) as string[]\n}\n\nfunction makeOptional(validator: z.ZodType): z.ZodType {\n return z.preprocess(v => (v === '' || v === null ? undefined : v), validator.optional())\n}\n\nfunction isEmpty(value: unknown): boolean {\n if (value === undefined || value === null) return true\n if (typeof value === 'string' && value.trim() === '') return true\n return false\n}\n\n/**\n * Determines which form field names are read by predicate-based requiredness\n * rules. This enables `useDeriveFieldsMetadata` to watch only the specific\n * fields that predicates depend on, rather than subscribing to every form\n * value change (which defeats react-hook-form's per-field render optimization).\n *\n * Works by running each predicate against a recording Proxy. The Proxy\n * intercepts property access and logs the keys, giving us the dependency list\n * without requiring manual declaration.\n *\n * Limitation: JavaScript short-circuit evaluation (`a && b`) can prevent the\n * Proxy from seeing later operands when earlier ones are falsy. In practice\n * this is acceptable — our predicate rules read a single form value each\n * (e.g. `data => data.adjustForMinimumWage`). Multi-field predicates with\n * equality guards should be expressed as `superRefine` rules instead.\n */\nfunction detectPredicateDeps(\n dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }>,\n mode: FormMode,\n): string[] {\n const deps = new Set<string>()\n\n for (const { predicate } of dynamicRequired) {\n if (isConstantPredicate(predicate)) continue\n\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n\n try {\n predicate(proxy, mode)\n } catch {\n /* Predicate may throw on undefined values — that's fine, we already captured the property accesses */\n }\n\n for (const key of accessed) deps.add(key)\n }\n\n return [...deps]\n}\n\n/**\n * Static predicates (e.g. `() => true` from 'always' / mode rules / partner\n * overrides) don't access form data, so we skip them during dependency\n * detection. We identify them by running against an empty proxy and checking\n * whether any properties were accessed.\n */\nfunction isConstantPredicate(\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean,\n): boolean {\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n try {\n predicate(proxy, 'create')\n } catch {\n /* ignore */\n }\n return accessed.length === 0\n}\n"],"names":["buildFormSchema","fieldValidators","options","mode","requiredFieldsConfig","requiredErrorCode","excludeFields","excluded","redacted","partnerRequired","resolveOptionalFieldsToRequire","shape","dynamicRequired","includedFieldNames","config","name","validator","effectiveRule","makeOptional","isPartnerRequired","hasSuperRefine","schema","z","data","ctx","predicate","isEmpty","predicateDeps","detectPredicateDeps","getFieldsMetadata","metadata","value","v","deps","isConstantPredicate","accessed","proxy","_target","prop","key"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"buildFormSchema.js","sources":["../../../src/partner-hook-utils/form/buildFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FieldMetadata } from '../types'\n\n// ── Types ────────────────────────────────────────────────────────────\n\nexport type FormMode = 'create' | 'update'\n\nexport type RequiredFieldRule<TData = Record<string, unknown>> =\n | 'create'\n | 'update'\n | 'always'\n | 'never'\n | ((data: TData, mode: FormMode) => boolean)\n\nexport type RequiredFieldConfig<TSchema extends Record<string, z.ZodType>> = Partial<{\n [K in keyof TSchema & string]: RequiredFieldRule<{\n [F in keyof TSchema]: z.infer<TSchema[F]>\n }>\n}>\n\ntype OptionalOnCreate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'update' | 'never' ? K : never\n}[keyof TConfig & string]\n\ntype OptionalOnUpdate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'create' | 'never' ? K : never\n}[keyof TConfig & string]\n\nexport type OptionalFieldsToRequire<TConfig> = {\n create?: Array<OptionalOnCreate<TConfig>>\n update?: Array<OptionalOnUpdate<TConfig>>\n}\n\n// ── buildFormSchema ──────────────────────────────────────────────────\n\ninterface BuildFormSchemaOptions<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n> {\n requiredFieldsConfig?: TConfig\n requiredErrorCode?: string\n mode: FormMode\n optionalFieldsToRequire?: OptionalFieldsToRequire<TConfig>\n excludeFields?: Array<keyof T & string>\n /** Fields with existing server-side values that are redacted in the API response\n * (e.g. SSN, EIN). These fields remain in the schema for format validation and\n * appear in metadata (with `hasRedactedValue: true`) but are exempt from required\n * validation — an empty submission is valid because a value already exists. */\n fieldsWithRedactedValues?: Array<keyof T & string>\n superRefine?: (data: { [K in keyof T]: z.infer<T[K]> }, ctx: z.RefinementCtx) => void\n}\n\nexport interface FieldsMetadataConfig<T extends Record<string, z.ZodType>> {\n getFieldsMetadata: (data?: Record<string, unknown>) => Record<keyof T, FieldMetadata>\n /** Form field names that predicate-based requiredness rules read at runtime. */\n predicateDeps: string[]\n}\n\ntype FormDataFromValidators<T extends Record<string, z.ZodType>> = {\n [K in keyof T]: z.infer<T[K]>\n}\n\nexport type BuildFormSchemaResult<T extends Record<string, z.ZodType>> = [\n schema: z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n metadataConfig: FieldsMetadataConfig<T>,\n]\n\nexport function buildFormSchema<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n>(fieldValidators: T, options: BuildFormSchemaOptions<T, TConfig>): BuildFormSchemaResult<T> {\n const {\n mode,\n requiredFieldsConfig = {} as Record<string, RequiredFieldRule>,\n requiredErrorCode = 'REQUIRED',\n excludeFields = [],\n } = options\n const excluded = new Set(excludeFields.map(String))\n const redacted = new Set((options.fieldsWithRedactedValues ?? []).map(String))\n const partnerRequired = new Set(\n resolveOptionalFieldsToRequire(options.optionalFieldsToRequire, mode),\n )\n\n const shape: Record<string, z.ZodType> = {}\n const dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }> = []\n const includedFieldNames: string[] = []\n const config = requiredFieldsConfig as Record<string, RequiredFieldRule>\n\n for (const [name, validator] of Object.entries(fieldValidators)) {\n if (excluded.has(name)) continue\n includedFieldNames.push(name)\n\n const effectiveRule = config[name] ?? 'always'\n\n shape[name] = makeOptional(validator)\n\n if (!redacted.has(name)) {\n const isPartnerRequired = partnerRequired.has(name)\n\n if (typeof effectiveRule === 'function') {\n dynamicRequired.push({\n name,\n predicate: isPartnerRequired ? () => true : effectiveRule,\n })\n } else {\n const isRequired = effectiveRule === 'always' || effectiveRule === mode || isPartnerRequired\n if (isRequired) {\n dynamicRequired.push({ name, predicate: () => true })\n }\n }\n }\n }\n\n const hasSuperRefine = dynamicRequired.length > 0 || options.superRefine\n let schema: z.ZodType = z.object(shape)\n\n if (hasSuperRefine) {\n schema = (schema as z.ZodObject).superRefine(\n (data: Record<string, unknown>, ctx: z.RefinementCtx) => {\n for (const { name, predicate } of dynamicRequired) {\n if (predicate(data, mode) && isEmpty(data[name])) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [name],\n message: requiredErrorCode,\n })\n }\n }\n\n options.superRefine?.(data as { [K in keyof T]: z.infer<T[K]> }, ctx)\n },\n )\n }\n\n const predicateDeps = detectPredicateDeps(dynamicRequired, mode)\n\n function getFieldsMetadata(data?: Record<string, unknown>) {\n const metadata: Record<string, FieldMetadata> = {}\n\n for (const name of includedFieldNames) {\n const effectiveRule = config[name] ?? 'always'\n\n if (partnerRequired.has(name)) {\n metadata[name] = { name, isRequired: true }\n } else if (typeof effectiveRule === 'function') {\n metadata[name] = { name, isRequired: data ? effectiveRule(data, mode) : false }\n } else {\n metadata[name] = {\n name,\n isRequired: effectiveRule === 'always' || effectiveRule === mode,\n }\n }\n\n if (redacted.has(name)) {\n metadata[name].hasRedactedValue = true\n }\n }\n\n return metadata as Record<keyof T, FieldMetadata>\n }\n\n // makeOptional wraps fields with z.preprocess, which causes z.input to infer\n // `unknown`. Cast the schema to carry the original field types so zodResolver\n // infers correct form data types — consumers don't need per-hook casts.\n return [\n schema as z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n { getFieldsMetadata, predicateDeps },\n ]\n}\n\n// ── Internal helpers ─────────────────────────────────────────────────\n\nfunction resolveOptionalFieldsToRequire<TConfig>(\n value: OptionalFieldsToRequire<TConfig> | undefined,\n mode: FormMode,\n): string[] {\n if (!value) return []\n return ((mode === 'create' ? value.create : value.update) ?? []) as string[]\n}\n\nfunction makeOptional(validator: z.ZodType): z.ZodType {\n return z.preprocess(v => (isEmpty(v) ? undefined : v), validator.optional())\n}\n\nfunction isEmpty(value: unknown): boolean {\n if (value === undefined || value === null) return true\n if (typeof value === 'string' && value.trim() === '') return true\n if (typeof value === 'number' && Number.isNaN(value)) return true\n return false\n}\n\n/**\n * Determines which form field names are read by predicate-based requiredness\n * rules. This enables `useDeriveFieldsMetadata` to watch only the specific\n * fields that predicates depend on, rather than subscribing to every form\n * value change (which defeats react-hook-form's per-field render optimization).\n *\n * Works by running each predicate against a recording Proxy. The Proxy\n * intercepts property access and logs the keys, giving us the dependency list\n * without requiring manual declaration.\n *\n * Limitation: JavaScript short-circuit evaluation (`a && b`) can prevent the\n * Proxy from seeing later operands when earlier ones are falsy. In practice\n * this is acceptable — our predicate rules read a single form value each\n * (e.g. `data => data.adjustForMinimumWage`). Multi-field predicates with\n * equality guards should be expressed as `superRefine` rules instead.\n */\nfunction detectPredicateDeps(\n dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }>,\n mode: FormMode,\n): string[] {\n const deps = new Set<string>()\n\n for (const { predicate } of dynamicRequired) {\n if (isConstantPredicate(predicate)) continue\n\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n\n try {\n predicate(proxy, mode)\n } catch {\n /* Predicate may throw on undefined values — that's fine, we already captured the property accesses */\n }\n\n for (const key of accessed) deps.add(key)\n }\n\n return [...deps]\n}\n\n/**\n * Static predicates (e.g. `() => true` from 'always' / mode rules / partner\n * overrides) don't access form data, so we skip them during dependency\n * detection. We identify them by running against an empty proxy and checking\n * whether any properties were accessed.\n */\nfunction isConstantPredicate(\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean,\n): boolean {\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n try {\n predicate(proxy, 'create')\n } catch {\n /* ignore */\n }\n return accessed.length === 0\n}\n"],"names":["buildFormSchema","fieldValidators","options","mode","requiredFieldsConfig","requiredErrorCode","excludeFields","excluded","redacted","partnerRequired","resolveOptionalFieldsToRequire","shape","dynamicRequired","includedFieldNames","config","name","validator","effectiveRule","makeOptional","isPartnerRequired","hasSuperRefine","schema","z","data","ctx","predicate","isEmpty","predicateDeps","detectPredicateDeps","getFieldsMetadata","metadata","value","v","deps","isConstantPredicate","accessed","proxy","_target","prop","key"],"mappings":"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"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { HookErrorHandling } from '../types';
|
|
3
|
+
import { HookErrorHandling, HookFormInternals } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Minimal shape required for a form hook result to participate in `composeSubmitHandler`.
|
|
6
6
|
* Any hook returning `BaseFormHookReady` satisfies this interface.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* `formMethods` is declared with method-call syntax (rather than reused from
|
|
9
|
+
* `HookFormInternals`) so TypeScript applies bivariant parameter checking,
|
|
9
10
|
* allowing hooks with specific form data generics to be passed without casts.
|
|
11
|
+
* `_fieldElementRegistry` is reused directly since its type doesn't depend on
|
|
12
|
+
* the form's generic.
|
|
10
13
|
*/
|
|
11
14
|
interface ComposableFormHookResult {
|
|
12
15
|
form: {
|
|
13
|
-
hookFormInternals: {
|
|
16
|
+
hookFormInternals: Pick<HookFormInternals, '_fieldElementRegistry'> & {
|
|
14
17
|
formMethods: {
|
|
15
|
-
handleSubmit(onValid: () => void, onInvalid?: () => void): () => Promise<void>;
|
|
18
|
+
handleSubmit(onValid: () => void, onInvalid?: (errors: Record<string, unknown>) => void): () => Promise<void>;
|
|
16
19
|
setFocus(name: string): void;
|
|
17
20
|
formState: {
|
|
18
21
|
errors: Record<string, unknown>;
|
|
@@ -39,8 +42,9 @@ export interface ComposeSubmitHandlerResult {
|
|
|
39
42
|
* Coordinates validation and submission across multiple form hooks on the same page, and
|
|
40
43
|
* returns aggregated `errorHandling` for those forms so you can drive a single error surface.
|
|
41
44
|
*
|
|
42
|
-
* Validates all forms simultaneously via `handleSubmit()`, then focuses the first
|
|
43
|
-
* field across all forms (
|
|
45
|
+
* Validates all forms simultaneously via `handleSubmit()`, then focuses the visually first
|
|
46
|
+
* invalid field across all forms (sorted by `getBoundingClientRect()`). Only calls
|
|
47
|
+
* `onAllValid` when every form passes.
|
|
44
48
|
*
|
|
45
49
|
* Uses `handleSubmit` rather than `trigger` so that react-hook-form sets
|
|
46
50
|
* `formState.isSubmitted = true`, which enables `reValidateMode` (default: `onChange`).
|
|
@@ -1,40 +1,63 @@
|
|
|
1
|
-
import { composeErrorHandler as
|
|
2
|
-
function
|
|
3
|
-
return "handleSubmit" in
|
|
1
|
+
import { composeErrorHandler as u } from "../composeErrorHandler.js";
|
|
2
|
+
function f(e) {
|
|
3
|
+
return "handleSubmit" in e && typeof e.handleSubmit == "function";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function h(e) {
|
|
6
|
+
return f(e) ? e : e.form.hookFormInternals.formMethods;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
function g(e) {
|
|
9
|
+
const i = [];
|
|
10
|
+
for (const { input: n, formMethods: s, errors: o } of e) {
|
|
11
|
+
if (f(n)) continue;
|
|
12
|
+
const t = n.form.hookFormInternals._fieldElementRegistry;
|
|
13
|
+
if (t)
|
|
14
|
+
for (const r of Object.keys(o)) {
|
|
15
|
+
const l = t.get(r);
|
|
16
|
+
l && i.push({ formMethods: s, name: r, element: l });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (i.length > 0) {
|
|
20
|
+
i.sort((s, o) => {
|
|
21
|
+
const t = s.element.getBoundingClientRect(), r = o.element.getBoundingClientRect();
|
|
22
|
+
return t.top - r.top || t.left - r.left;
|
|
23
|
+
}), i[0].element.focus();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
for (const { formMethods: n, errors: s } of e) {
|
|
27
|
+
const o = Object.keys(s)[0];
|
|
28
|
+
if (o) {
|
|
29
|
+
n.setFocus(o);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function F(e, i) {
|
|
35
|
+
const n = e.filter((t) => !f(t)), s = async (t) => {
|
|
36
|
+
t.preventDefault();
|
|
37
|
+
const r = await Promise.all(
|
|
38
|
+
e.map(
|
|
39
|
+
(c) => new Promise((m) => {
|
|
40
|
+
const a = h(c);
|
|
41
|
+
a.handleSubmit(
|
|
14
42
|
() => {
|
|
15
|
-
|
|
43
|
+
m({ input: c, formMethods: a, valid: !0, errors: {} });
|
|
16
44
|
},
|
|
17
|
-
() => {
|
|
18
|
-
|
|
45
|
+
(d) => {
|
|
46
|
+
m({ input: c, formMethods: a, valid: !1, errors: d });
|
|
19
47
|
}
|
|
20
48
|
)();
|
|
21
49
|
})
|
|
22
50
|
)
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (o) {
|
|
27
|
-
t.setFocus(o);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
51
|
+
);
|
|
52
|
+
if (!r.every((c) => c.valid)) {
|
|
53
|
+
g(r);
|
|
31
54
|
return;
|
|
32
55
|
}
|
|
33
|
-
await
|
|
34
|
-
},
|
|
35
|
-
return { handleSubmit:
|
|
56
|
+
await i();
|
|
57
|
+
}, o = u(n);
|
|
58
|
+
return { handleSubmit: s, errorHandling: o };
|
|
36
59
|
}
|
|
37
60
|
export {
|
|
38
|
-
|
|
61
|
+
F as composeSubmitHandler
|
|
39
62
|
};
|
|
40
63
|
//# sourceMappingURL=composeSubmitHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeSubmitHandler.js","sources":["../../../src/partner-hook-utils/form/composeSubmitHandler.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\nimport type { FieldValues, UseFormReturn } from 'react-hook-form'\nimport { composeErrorHandler } from '../composeErrorHandler'\nimport type { HookErrorHandling } from '../types'\n\n/**\n * Minimal shape required for a form hook result to participate in `composeSubmitHandler`.\n * Any hook returning `BaseFormHookReady` satisfies this interface.\n *\n *
|
|
1
|
+
{"version":3,"file":"composeSubmitHandler.js","sources":["../../../src/partner-hook-utils/form/composeSubmitHandler.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\nimport type { FieldValues, UseFormReturn } from 'react-hook-form'\nimport { composeErrorHandler } from '../composeErrorHandler'\nimport type { HookErrorHandling, HookFormInternals } from '../types'\n\n/**\n * Minimal shape required for a form hook result to participate in `composeSubmitHandler`.\n * Any hook returning `BaseFormHookReady` satisfies this interface.\n *\n * `formMethods` is declared with method-call syntax (rather than reused from\n * `HookFormInternals`) so TypeScript applies bivariant parameter checking,\n * allowing hooks with specific form data generics to be passed without casts.\n * `_fieldElementRegistry` is reused directly since its type doesn't depend on\n * the form's generic.\n */\ninterface ComposableFormHookResult {\n form: {\n hookFormInternals: Pick<HookFormInternals, '_fieldElementRegistry'> & {\n formMethods: {\n handleSubmit(\n onValid: () => void,\n onInvalid?: (errors: Record<string, unknown>) => void,\n ): () => Promise<void>\n setFocus(name: string): void\n formState: { errors: Record<string, unknown> }\n }\n }\n }\n errorHandling: HookErrorHandling\n}\n\n/**\n * Accepted input for a single slot of `composeSubmitHandler`'s `forms` array.\n *\n * - SDK form hook results (anything matching `ComposableFormHookResult`) are composed directly.\n * - A raw `react-hook-form` `UseFormReturn<T>` is supported for screen-local auxiliary forms\n * that don't warrant a dedicated SDK hook. Raw forms contribute validation/focus behavior\n * but no `errorHandling` (fields surface their own inline errors via react-hook-form).\n */\nexport type ComposeSubmitInput<T extends FieldValues = FieldValues> =\n | ComposableFormHookResult\n | UseFormReturn<T>\n\ninterface FormValidationResult {\n input: ComposeSubmitInput\n formMethods: FormMethods\n valid: boolean\n errors: Record<string, unknown>\n}\n\nexport interface ComposeSubmitHandlerResult {\n handleSubmit: (e: SyntheticEvent) => Promise<void>\n errorHandling: HookErrorHandling\n}\n\ntype FormMethods = ComposableFormHookResult['form']['hookFormInternals']['formMethods']\n\nfunction isRawUseForm<T extends FieldValues>(\n input: ComposeSubmitInput<T>,\n): input is UseFormReturn<T> {\n return 'handleSubmit' in input && typeof input.handleSubmit === 'function'\n}\n\nfunction extractFormMethods<T extends FieldValues>(input: ComposeSubmitInput<T>): FormMethods {\n if (isRawUseForm(input)) return input as unknown as FormMethods\n return input.form.hookFormInternals.formMethods\n}\n\n/**\n * Picks the visually first invalid field across all composed forms using live\n * `getBoundingClientRect()` positions, then focuses its DOM element. Falls back\n * to array-order (first form's first error) when no element can be resolved —\n * raw `UseFormReturn` inputs have no registry, and forms rendered without\n * `SDKFormProvider` or a HookField wrapper won't have their fields registered\n * either, so we let react-hook-form's `setFocus` attempt it instead.\n *\n * Consumes `results` (captured from each form's `onInvalid` callback) rather\n * than reading `formState.errors` — the latter is a proxy that returns `{}`\n * when accessed outside a component subscription.\n */\nfunction focusFirstInvalidAcrossForms(results: FormValidationResult[]): void {\n type Candidate = {\n formMethods: FormMethods\n name: string\n element: HTMLElement\n }\n const candidates: Candidate[] = []\n for (const { input, formMethods, errors } of results) {\n if (isRawUseForm(input)) continue\n const registry = input.form.hookFormInternals._fieldElementRegistry\n if (!registry) continue\n for (const name of Object.keys(errors)) {\n const element = registry.get(name)\n if (element) {\n candidates.push({ formMethods, name, element })\n }\n }\n }\n\n if (candidates.length > 0) {\n candidates.sort((a, b) => {\n const ar = a.element.getBoundingClientRect()\n const br = b.element.getBoundingClientRect()\n return ar.top - br.top || ar.left - br.left\n })\n const winner = candidates[0]!\n // Focus the DOM element directly. Bypasses react-hook-form's `setFocus`,\n // which depends on `_fields[name]._f.ref` and isn't reliably populated\n // when fields are rendered through libraries like react-aria-components.\n winner.element.focus()\n return\n }\n\n for (const { formMethods, errors } of results) {\n const firstErrorField = Object.keys(errors)[0]\n if (firstErrorField) {\n formMethods.setFocus(firstErrorField)\n return\n }\n }\n}\n\n/**\n * Coordinates validation and submission across multiple form hooks on the same page, and\n * returns aggregated `errorHandling` for those forms so you can drive a single error surface.\n *\n * Validates all forms simultaneously via `handleSubmit()`, then focuses the visually first\n * invalid field across all forms (sorted by `getBoundingClientRect()`). Only calls\n * `onAllValid` when every form passes.\n *\n * Uses `handleSubmit` rather than `trigger` so that react-hook-form sets\n * `formState.isSubmitted = true`, which enables `reValidateMode` (default: `onChange`).\n * Without this, errors set by manual `trigger()` calls would never clear as the user types.\n *\n * Each hook passed to `forms` should be initialized with `shouldFocusError: false` so that\n * react-hook-form's built-in per-form focus is disabled and `composeSubmitHandler` can manage\n * cross-form focus instead.\n *\n * The returned `errorHandling` is the same shape every SDK hook returns, so the whole result\n * can be passed back into `composeErrorHandler` when you need to add extra\n * `@gusto/embedded-api` queries or screen-level submit state.\n *\n * @example\n * ```ts\n * const detailsForm = useEmployeeDetailsForm({ employeeId, shouldFocusError: false })\n * const addressForm = useHomeAddressForm({ employeeId, shouldFocusError: false })\n *\n * const { handleSubmit, errorHandling } = composeSubmitHandler(\n * [detailsForm, addressForm],\n * async () => {\n * await detailsForm.actions.onSubmit()\n * await addressForm.actions.onSubmit()\n * },\n * )\n *\n * // With extra queries or screen-level submit state:\n * // const errorHandling = composeErrorHandler([submitResult, extraQuery], { submitError, setSubmitError })\n *\n * return <form onSubmit={handleSubmit}>...</form>\n * ```\n */\nexport function composeSubmitHandler<TForms extends readonly FieldValues[]>(\n forms: readonly [...{ [K in keyof TForms]: ComposeSubmitInput<TForms[K]> }],\n onAllValid: () => Promise<void>,\n): ComposeSubmitHandlerResult {\n const errorSources = forms.filter((form): form is ComposableFormHookResult => !isRawUseForm(form))\n\n const handleSubmit = async (e: SyntheticEvent) => {\n e.preventDefault()\n\n const validationResults = await Promise.all(\n forms.map(\n input =>\n new Promise<FormValidationResult>(resolve => {\n const formMethods = extractFormMethods(input)\n void formMethods.handleSubmit(\n () => {\n resolve({ input, formMethods, valid: true, errors: {} })\n },\n errors => {\n resolve({ input, formMethods, valid: false, errors })\n },\n )()\n }),\n ),\n )\n\n const allValid = validationResults.every(r => r.valid)\n\n if (!allValid) {\n focusFirstInvalidAcrossForms(validationResults)\n return\n }\n\n await onAllValid()\n }\n\n const errorHandling = composeErrorHandler(errorSources)\n\n return { handleSubmit, errorHandling }\n}\n"],"names":["isRawUseForm","input","extractFormMethods","focusFirstInvalidAcrossForms","results","candidates","formMethods","errors","registry","name","element","a","b","ar","br","firstErrorField","composeSubmitHandler","forms","onAllValid","errorSources","form","handleSubmit","e","validationResults","resolve","r","errorHandling","composeErrorHandler"],"mappings":";AAyDA,SAASA,EACPC,GAC2B;AAC3B,SAAO,kBAAkBA,KAAS,OAAOA,EAAM,gBAAiB;AAClE;AAEA,SAASC,EAA0CD,GAA2C;AAC5F,SAAID,EAAaC,CAAK,IAAUA,IACzBA,EAAM,KAAK,kBAAkB;AACtC;AAcA,SAASE,EAA6BC,GAAuC;AAM3E,QAAMC,IAA0B,CAAA;AAChC,aAAW,EAAE,OAAAJ,GAAO,aAAAK,GAAa,QAAAC,EAAA,KAAYH,GAAS;AACpD,QAAIJ,EAAaC,CAAK,EAAG;AACzB,UAAMO,IAAWP,EAAM,KAAK,kBAAkB;AAC9C,QAAKO;AACL,iBAAWC,KAAQ,OAAO,KAAKF,CAAM,GAAG;AACtC,cAAMG,IAAUF,EAAS,IAAIC,CAAI;AACjC,QAAIC,KACFL,EAAW,KAAK,EAAE,aAAAC,GAAa,MAAAG,GAAM,SAAAC,GAAS;AAAA,MAElD;AAAA,EACF;AAEA,MAAIL,EAAW,SAAS,GAAG;AACzB,IAAAA,EAAW,KAAK,CAACM,GAAGC,MAAM;AACxB,YAAMC,IAAKF,EAAE,QAAQ,sBAAA,GACfG,IAAKF,EAAE,QAAQ,sBAAA;AACrB,aAAOC,EAAG,MAAMC,EAAG,OAAOD,EAAG,OAAOC,EAAG;AAAA,IACzC,CAAC,GACcT,EAAW,CAAC,EAIpB,QAAQ,MAAA;AACf;AAAA,EACF;AAEA,aAAW,EAAE,aAAAC,GAAa,QAAAC,EAAA,KAAYH,GAAS;AAC7C,UAAMW,IAAkB,OAAO,KAAKR,CAAM,EAAE,CAAC;AAC7C,QAAIQ,GAAiB;AACnB,MAAAT,EAAY,SAASS,CAAe;AACpC;AAAA,IACF;AAAA,EACF;AACF;AAyCO,SAASC,EACdC,GACAC,GAC4B;AAC5B,QAAMC,IAAeF,EAAM,OAAO,CAACG,MAA2C,CAACpB,EAAaoB,CAAI,CAAC,GAE3FC,IAAe,OAAOC,MAAsB;AAChD,IAAAA,EAAE,eAAA;AAEF,UAAMC,IAAoB,MAAM,QAAQ;AAAA,MACtCN,EAAM;AAAA,QACJ,CAAAhB,MACE,IAAI,QAA8B,CAAAuB,MAAW;AAC3C,gBAAMlB,IAAcJ,EAAmBD,CAAK;AAC5C,UAAKK,EAAY;AAAA,YACf,MAAM;AACJ,cAAAkB,EAAQ,EAAE,OAAAvB,GAAO,aAAAK,GAAa,OAAO,IAAM,QAAQ,CAAA,GAAI;AAAA,YACzD;AAAA,YACA,CAAAC,MAAU;AACR,cAAAiB,EAAQ,EAAE,OAAAvB,GAAO,aAAAK,GAAa,OAAO,IAAO,QAAAC,GAAQ;AAAA,YACtD;AAAA,UAAA,EACF;AAAA,QACF,CAAC;AAAA,MAAA;AAAA,IACL;AAKF,QAAI,CAFagB,EAAkB,MAAM,CAAAE,MAAKA,EAAE,KAAK,GAEtC;AACb,MAAAtB,EAA6BoB,CAAiB;AAC9C;AAAA,IACF;AAEA,UAAML,EAAA;AAAA,EACR,GAEMQ,IAAgBC,EAAoBR,CAAY;AAEtD,SAAO,EAAE,cAAAE,GAAc,eAAAK,EAAA;AACzB;"}
|
|
@@ -7,4 +7,4 @@ export interface CheckboxHookFieldProps<TErrorCode extends string = never> exten
|
|
|
7
7
|
validationMessages?: ValidationMessages<TErrorCode>;
|
|
8
8
|
FieldComponent?: ComponentType<CheckboxProps>;
|
|
9
9
|
}
|
|
10
|
-
export declare function CheckboxHookField<TErrorCode extends string>({ name, formHookResult, label, description, validationMessages, FieldComponent, }: CheckboxHookFieldProps<TErrorCode>): import(
|
|
10
|
+
export declare function CheckboxHookField<TErrorCode extends string>({ name, formHookResult, label, description, validationMessages, FieldComponent, }: CheckboxHookFieldProps<TErrorCode>): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useHookFieldResolution as p } from "../useHookFieldResolution.js";
|
|
3
|
-
import "
|
|
3
|
+
import { withFieldElementRegistry as c } from "./withFieldElementRegistry.js";
|
|
4
4
|
import "classnames";
|
|
5
|
+
import "../../../shared/constants.js";
|
|
5
6
|
import { CheckboxField as u } from "../../../components/Common/Fields/CheckboxField/CheckboxField.js";
|
|
6
|
-
function
|
|
7
|
-
name:
|
|
8
|
-
formHookResult:
|
|
9
|
-
label:
|
|
10
|
-
description:
|
|
7
|
+
function h({
|
|
8
|
+
name: e,
|
|
9
|
+
formHookResult: o,
|
|
10
|
+
label: t,
|
|
11
|
+
description: r,
|
|
11
12
|
validationMessages: s,
|
|
12
13
|
FieldComponent: d
|
|
13
14
|
}) {
|
|
14
|
-
const { metadata: l, control:
|
|
15
|
+
const { metadata: l, control: m, errorMessage: a, fieldElementRegistry: f } = p(
|
|
16
|
+
e,
|
|
15
17
|
o,
|
|
16
|
-
i,
|
|
17
18
|
s
|
|
18
|
-
),
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
), i = l[e];
|
|
20
|
+
return c(
|
|
21
|
+
f,
|
|
22
|
+
/* @__PURE__ */ n(
|
|
23
|
+
u,
|
|
24
|
+
{
|
|
25
|
+
name: e,
|
|
26
|
+
control: m,
|
|
27
|
+
label: t,
|
|
28
|
+
description: r,
|
|
29
|
+
errorMessage: a,
|
|
30
|
+
isRequired: i?.isRequired,
|
|
31
|
+
isDisabled: i?.isDisabled,
|
|
32
|
+
FieldComponent: d
|
|
33
|
+
}
|
|
34
|
+
)
|
|
31
35
|
);
|
|
32
36
|
}
|
|
33
37
|
export {
|
|
34
|
-
|
|
38
|
+
h as CheckboxHookField
|
|
35
39
|
};
|
|
36
40
|
//# sourceMappingURL=CheckboxHookField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/CheckboxHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\nimport { CheckboxField } from '@/components/Common'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\n\nexport interface CheckboxHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n formHookResult?: FormHookResult\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<CheckboxProps>\n}\n\nexport function CheckboxHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: CheckboxHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <CheckboxField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n
|
|
1
|
+
{"version":3,"file":"CheckboxHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/CheckboxHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\nimport { withFieldElementRegistry } from './withFieldElementRegistry'\nimport { CheckboxField } from '@/components/Common'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\n\nexport interface CheckboxHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n formHookResult?: FormHookResult\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<CheckboxProps>\n}\n\nexport function CheckboxHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: CheckboxHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage, fieldElementRegistry } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return withFieldElementRegistry(\n fieldElementRegistry,\n <CheckboxField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n />,\n )\n}\n"],"names":["CheckboxHookField","name","formHookResult","label","description","validationMessages","FieldComponent","metadata","control","errorMessage","fieldElementRegistry","useHookFieldResolution","fieldMetadata","withFieldElementRegistry","jsx","CheckboxField"],"mappings":";;;;;;AAcO,SAASA,EAA6C;AAAA,EAC3D,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAuC;AACrC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,GAAc,sBAAAC,MAAyBC;AAAA,IAChEV;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIO,IAAgBL,EAASN,CAAI;AAEnC,SAAOY;AAAA,IACLH;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAd;AAAA,QACA,SAAAO;AAAA,QACA,OAAAL;AAAA,QACA,aAAAC;AAAA,QACA,cAAAK;AAAA,QACA,YAAYG,GAAe;AAAA,QAC3B,YAAYA,GAAe;AAAA,QAC3B,gBAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -9,4 +9,4 @@ export interface DatePickerHookFieldProps<TErrorCode extends string = never> ext
|
|
|
9
9
|
/** When used inside a modal, pass the modal backdrop ref's element so the calendar popover stacks correctly. */
|
|
10
10
|
portalContainer?: DatePickerProps['portalContainer'];
|
|
11
11
|
}
|
|
12
|
-
export declare function DatePickerHookField<TErrorCode extends string>({ name, formHookResult, label, description, validationMessages, FieldComponent, portalContainer, minDate, maxDate, }: DatePickerHookFieldProps<TErrorCode>): import(
|
|
12
|
+
export declare function DatePickerHookField<TErrorCode extends string>({ name, formHookResult, label, description, validationMessages, FieldComponent, portalContainer, minDate, maxDate, }: DatePickerHookFieldProps<TErrorCode>): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useHookFieldResolution as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useHookFieldResolution as R } from "../useHookFieldResolution.js";
|
|
3
|
+
import { withFieldElementRegistry as k } from "./withFieldElementRegistry.js";
|
|
4
|
+
import { DatePickerField as D } from "../../../components/Common/Fields/DatePickerField/DatePickerField.js";
|
|
5
|
+
function x({
|
|
5
6
|
name: e,
|
|
6
|
-
formHookResult:
|
|
7
|
-
label:
|
|
8
|
-
description:
|
|
7
|
+
formHookResult: t,
|
|
8
|
+
label: o,
|
|
9
|
+
description: r,
|
|
9
10
|
validationMessages: s,
|
|
10
11
|
FieldComponent: d,
|
|
11
|
-
portalContainer:
|
|
12
|
-
minDate:
|
|
13
|
-
maxDate:
|
|
12
|
+
portalContainer: l,
|
|
13
|
+
minDate: a,
|
|
14
|
+
maxDate: m
|
|
14
15
|
}) {
|
|
15
|
-
const { metadata:
|
|
16
|
+
const { metadata: f, control: n, errorMessage: c, fieldElementRegistry: u } = R(
|
|
16
17
|
e,
|
|
17
|
-
|
|
18
|
+
t,
|
|
18
19
|
s
|
|
19
|
-
), i =
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
), i = f[e];
|
|
21
|
+
return k(
|
|
22
|
+
u,
|
|
23
|
+
/* @__PURE__ */ p(
|
|
24
|
+
D,
|
|
25
|
+
{
|
|
26
|
+
name: e,
|
|
27
|
+
control: n,
|
|
28
|
+
label: o,
|
|
29
|
+
description: r,
|
|
30
|
+
errorMessage: c,
|
|
31
|
+
isRequired: i?.isRequired,
|
|
32
|
+
isDisabled: i?.isDisabled,
|
|
33
|
+
FieldComponent: d,
|
|
34
|
+
portalContainer: l,
|
|
35
|
+
minDate: a,
|
|
36
|
+
maxDate: m
|
|
37
|
+
}
|
|
38
|
+
)
|
|
35
39
|
);
|
|
36
40
|
}
|
|
37
41
|
export {
|
|
38
|
-
|
|
42
|
+
x as DatePickerHookField
|
|
39
43
|
};
|
|
40
44
|
//# sourceMappingURL=DatePickerHookField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/DatePickerHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\nimport { DatePickerField } from '@/components/Common/Fields/DatePickerField'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\n\nexport interface DatePickerHookFieldProps<TErrorCode extends string = never>\n extends BaseFieldProps, Pick<DatePickerProps, 'portalContainer' | 'minDate' | 'maxDate'> {\n name: string\n formHookResult?: FormHookResult\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<DatePickerProps>\n /** When used inside a modal, pass the modal backdrop ref's element so the calendar popover stacks correctly. */\n portalContainer?: DatePickerProps['portalContainer']\n}\n\nexport function DatePickerHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n portalContainer,\n minDate,\n maxDate,\n}: DatePickerHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <DatePickerField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n portalContainer={portalContainer}\n minDate={minDate}\n maxDate={maxDate}\n
|
|
1
|
+
{"version":3,"file":"DatePickerHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/DatePickerHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\nimport { withFieldElementRegistry } from './withFieldElementRegistry'\nimport { DatePickerField } from '@/components/Common/Fields/DatePickerField'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\n\nexport interface DatePickerHookFieldProps<TErrorCode extends string = never>\n extends BaseFieldProps, Pick<DatePickerProps, 'portalContainer' | 'minDate' | 'maxDate'> {\n name: string\n formHookResult?: FormHookResult\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<DatePickerProps>\n /** When used inside a modal, pass the modal backdrop ref's element so the calendar popover stacks correctly. */\n portalContainer?: DatePickerProps['portalContainer']\n}\n\nexport function DatePickerHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n portalContainer,\n minDate,\n maxDate,\n}: DatePickerHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage, fieldElementRegistry } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return withFieldElementRegistry(\n fieldElementRegistry,\n <DatePickerField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n portalContainer={portalContainer}\n minDate={minDate}\n maxDate={maxDate}\n />,\n )\n}\n"],"names":["DatePickerHookField","name","formHookResult","label","description","validationMessages","FieldComponent","portalContainer","minDate","maxDate","metadata","control","errorMessage","fieldElementRegistry","useHookFieldResolution","fieldMetadata","withFieldElementRegistry","jsx","DatePickerField"],"mappings":";;;;AAiBO,SAASA,EAA+C;AAAA,EAC7D,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AACF,GAAyC;AACvC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,GAAc,sBAAAC,MAAyBC;AAAA,IAChEb;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIU,IAAgBL,EAAST,CAAI;AAEnC,SAAOe;AAAA,IACLH;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAjB;AAAA,QACA,SAAAU;AAAA,QACA,OAAAR;AAAA,QACA,aAAAC;AAAA,QACA,cAAAQ;AAAA,QACA,YAAYG,GAAe;AAAA,QAC3B,YAAYA,GAAe;AAAA,QAC3B,gBAAAT;AAAA,QACA,iBAAAC;AAAA,QACA,SAAAC;AAAA,QACA,SAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -10,4 +10,4 @@ export interface NumberInputHookFieldProps<TErrorCode extends string = never> ex
|
|
|
10
10
|
validationMessages?: ValidationMessages<TErrorCode>;
|
|
11
11
|
FieldComponent?: ComponentType<NumberInputProps>;
|
|
12
12
|
}
|
|
13
|
-
export declare function NumberInputHookField<TErrorCode extends string>({ name, formHookResult, label, description, format, min, max, validationMessages, FieldComponent, }: NumberInputHookFieldProps<TErrorCode>): import(
|
|
13
|
+
export declare function NumberInputHookField<TErrorCode extends string>({ name, formHookResult, label, description, format, min, max, validationMessages, FieldComponent, }: NumberInputHookFieldProps<TErrorCode>): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|