@gusto/embedded-react-sdk 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -0
- package/dist/assets/icons/percent-circle.svg.js +10 -0
- package/dist/assets/icons/percent-circle.svg.js.map +1 -0
- package/dist/assets/icons/plus-circle.svg.js +1 -1
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +2 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.js +59 -46
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +9 -7
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +4 -2
- package/dist/components/Common/DataView/DataTable/DataTable.js +95 -76
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -3
- package/dist/components/Common/DataView/DataView.js +24 -22
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +33 -6
- package/dist/components/Common/DataView/useDataView.js +23 -20
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DataView/useSelectionState.d.ts +5 -0
- package/dist/components/Common/DataView/useSelectionState.js +8 -0
- package/dist/components/Common/DataView/useSelectionState.js.map +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +3 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +65 -71
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -6
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.d.ts +2 -1
- package/dist/components/Common/EmptyData/EmptyData.js +15 -13
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -4
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.d.ts +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +12 -12
- package/dist/components/Common/UI/Box/Box.d.ts +1 -1
- package/dist/components/Common/UI/Box/Box.js +9 -8
- package/dist/components/Common/UI/Box/Box.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +12 -8
- package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +2 -9
- package/dist/components/Common/UI/BoxHeader/BoxHeader.d.ts +2 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js +23 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js +8 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +10 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js +7 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/index.d.ts +2 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +2 -2
- package/dist/components/Common/UI/Checkbox/Checkbox.js +60 -49
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +10 -6
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +6 -6
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +34 -36
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +12 -12
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +19 -12
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +6 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +6 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +4 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/Heading/Heading.module.scss.js +15 -15
- package/dist/components/Common/UI/Input/Input.js.map +1 -1
- package/dist/components/Common/UI/Menu/Menu.module.scss.js +5 -5
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.js +22 -22
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +1 -1
- package/dist/components/Common/UI/Table/Table.js +12 -12
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +13 -13
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +9 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +14 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/index.d.ts +5 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +25 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js +24 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +32 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +106 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -18
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -6
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +8 -10
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +5 -7
- 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 +3 -5
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +70 -68
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +7 -9
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +37 -32
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -10
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +23 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +37 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/index.d.ts +5 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +55 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js +54 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +33 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +184 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +33 -33
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +14 -14
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +2 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +14 -0
- package/dist/components/Company/exports/companyOnboarding.js +31 -0
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -0
- package/dist/components/Contractor/Address/Address.js +3 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -4
- package/dist/components/Contractor/Address/useAddress.js +5 -7
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +19 -20
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -7
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -126
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +77 -76
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +5 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +83 -84
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +10 -10
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +67 -79
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +10 -12
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +47 -49
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +63 -65
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +4 -4
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +33 -35
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +73 -51
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +7 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js +17 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -0
- package/dist/components/Employee/Compensation/Actions.js +5 -6
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +80 -77
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +27 -28
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +103 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +90 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.d.ts +9 -9
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +5 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +43 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +262 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +107 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +5 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +146 -0
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +12 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js +25 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -0
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +7 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +48 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +22 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js +211 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/TaxesView.js +97 -0
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +8 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/index.d.ts +9 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +17 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +29 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +28 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +52 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +13 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +22 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +17 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +24 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -0
- package/dist/components/Employee/Dashboard/index.d.ts +14 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +17 -19
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -13
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -8
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +5 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -22
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -10
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.d.ts +53 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js +164 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/index.d.ts +5 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +150 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js +152 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +47 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js +179 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -4
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -12
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +14 -15
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -6
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -7
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +10 -11
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/AdminProfile.js +360 -0
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js +211 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/Profile.d.ts +3 -3
- package/dist/components/Employee/Profile/Profile.js +25 -261
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +13 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +51 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.d.ts +8 -7
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/index.d.ts +1 -3
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +45 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +154 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +22 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +36 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +41 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +32 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +5 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +44 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +161 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.d.ts +3 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.js +2 -2
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/index.d.ts +1 -3
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +46 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +135 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.d.ts +6 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js +23 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/Employee/StateTaxes/Actions.js +8 -10
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +10 -12
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -5
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +5 -5
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +14 -16
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +12 -13
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -4
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.js +18 -20
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.d.ts +6 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeListView.d.ts +1 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js +130 -0
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/employee-list/shared/index.d.ts +2 -0
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.d.ts +8 -10
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.js +32 -28
- package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +1 -0
- package/dist/components/Employee/exports/employeeManagement.d.ts +6 -0
- package/dist/components/Employee/exports/employeeManagement.js +15 -0
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -0
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +14 -0
- package/dist/components/Employee/exports/employeeOnboarding.js +31 -0
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -0
- package/dist/components/Employee/index.d.ts +3 -2
- package/dist/components/Employee/index.js +24 -24
- package/dist/components/Flow/Flow.js +16 -18
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +28 -29
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +14 -14
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +11 -12
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -4
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -10
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +12 -14
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +74 -69
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +30 -32
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -13
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +19 -19
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +3 -3
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +13 -13
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -14
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -13
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +17 -17
- 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.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +16 -16
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +28 -28
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +22 -24
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +78 -79
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +1 -1
- 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 +224 -201
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -8
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +79 -80
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +18 -18
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -4
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +104 -117
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +16 -18
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -7
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -4
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +67 -63
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +12 -14
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +5 -5
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +13 -13
- 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 +10 -12
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +45 -42
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +55 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +25 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +2 -2
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +100 -43
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +124 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js +8 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListTypes.d.ts +19 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +166 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsTypes.d.ts +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +3 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +25 -55
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +66 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +71 -66
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +5 -5
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +8 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +71 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +12 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +206 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +20 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +4 -2
- package/dist/components/UNSTABLE_TimeOff/index.js +18 -16
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/EmployeeTableTypes.d.ts +3 -3
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.d.ts +30 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js +97 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +52 -50
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -21
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -12
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useObservability.js +6 -6
- package/dist/contexts/ObservabilityProvider/useObservability.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +2 -0
- package/dist/contexts/ThemeProvider/theme.js +4 -2
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +2 -0
- package/dist/helpers/dateFormatting.js +38 -33
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +40 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useCompanyPaymentSpeed.d.ts +6 -0
- package/dist/hooks/useCompanyPaymentSpeed.js +19 -0
- package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -0
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +9 -9
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +18 -12
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +28 -0
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +32 -26
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -34
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +16 -12
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -0
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollList.json.js +15 -15
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +9 -9
- package/dist/i18n/en/common.json.d.ts +4 -1
- package/dist/i18n/en/common.json.js +5 -5
- package/dist/index.d.ts +16 -0
- package/dist/index.js +102 -26
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/collectErrors.js.map +1 -0
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +24 -0
- package/dist/partner-hook-utils/composeErrorHandler.js +30 -0
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.d.ts +2 -2
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -0
- package/dist/partner-hook-utils/form/buildFormSchema.d.ts +48 -0
- package/dist/partner-hook-utils/form/buildFormSchema.js +94 -0
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.d.ts +29 -3
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +40 -0
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -0
- package/dist/partner-hook-utils/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/CheckboxHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +34 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.js +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +40 -0
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.js +10 -12
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +40 -0
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +34 -0
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +12 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +38 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/index.d.ts +7 -7
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/getFieldWithOptions.js.map +1 -0
- package/dist/partner-hook-utils/form/getFormSubmissionValues.js.map +1 -0
- package/dist/partner-hook-utils/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/index.d.ts +4 -6
- package/dist/partner-hook-utils/form/preprocessors.d.ts +3 -0
- package/dist/partner-hook-utils/form/preprocessors.js +15 -0
- package/dist/partner-hook-utils/form/preprocessors.js.map +1 -0
- package/dist/partner-hook-utils/form/resolveFieldError.d.ts +4 -0
- package/dist/partner-hook-utils/form/resolveFieldError.js +14 -0
- package/dist/partner-hook-utils/form/resolveFieldError.js.map +1 -0
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.d.ts +17 -0
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js +21 -0
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.d.ts +1 -1
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js +17 -0
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.d.ts +2 -2
- package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/withOptions.js.map +1 -0
- package/dist/partner-hook-utils/index.d.ts +5 -0
- package/dist/{types/sdkHooks.d.ts → partner-hook-utils/types.d.ts} +38 -12
- package/dist/shared/constants.d.ts +11 -1
- package/dist/shared/constants.js +30 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +228 -146
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +635 -165
- package/package.json +27 -31
- package/dist/UNSTABLE_Hooks.d.ts +0 -1
- package/dist/UNSTABLE_Hooks.js +0 -53
- package/dist/UNSTABLE_Hooks.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -7
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeListView.js +0 -132
- package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/index.d.ts +0 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +0 -1
- package/dist/components/Employee/Profile/Actions.d.ts +0 -1
- package/dist/components/Employee/Profile/Actions.js +0 -15
- package/dist/components/Employee/Profile/Actions.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +0 -33
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +0 -60
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +0 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/Head.d.ts +0 -1
- package/dist/components/Employee/Profile/Head.js +0 -14
- package/dist/components/Employee/Profile/Head.js.map +0 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +0 -31
- package/dist/components/Employee/Profile/HomeAddress.js +0 -128
- package/dist/components/Employee/Profile/HomeAddress.js.map +0 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +0 -49
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +0 -146
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +0 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +0 -16
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +0 -29
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.d.ts +0 -1
- package/dist/components/Employee/Profile/WorkAddress.js +0 -21
- package/dist/components/Employee/Profile/WorkAddress.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js +0 -8
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.d.ts +0 -2
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js +0 -8
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +0 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +0 -16
- package/dist/components/Employee/Profile/useProfile.js +0 -22
- package/dist/components/Employee/Profile/useProfile.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +0 -26
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +0 -24
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +0 -34
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +0 -3
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +0 -14
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +0 -36
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +0 -42
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +0 -42
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +0 -36
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +0 -12
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +0 -40
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +0 -4
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +0 -13
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +0 -6
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +0 -14
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +0 -17
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +0 -4
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +0 -8
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +0 -150
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +0 -97
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +0 -118
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +0 -7
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +0 -104
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +0 -259
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +0 -113
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +0 -45
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +0 -77
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +0 -153
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +0 -70
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +0 -68
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +0 -129
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +0 -24
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +0 -9
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +0 -6
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +0 -50
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +0 -2
- package/dist/helpers/collectErrors.js.map +0 -1
- package/dist/helpers/requiredIf.d.ts +0 -13
- package/dist/helpers/requiredIf.js +0 -8
- package/dist/helpers/requiredIf.js.map +0 -1
- package/dist/hooks/useErrorHandling.d.ts +0 -9
- package/dist/hooks/useErrorHandling.js +0 -12
- package/dist/hooks/useErrorHandling.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +0 -58
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +0 -34
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +0 -24
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +0 -1
- /package/dist/components/Employee/{Profile/getEmployeeAddressForProfile.test.d.ts → Compensation/shared/useCompensationForm/compensationSchemaParity.test.d.ts} +0 -0
- /package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/index.d.ts +0 -0
- /package/dist/components/{UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts → UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts} +0 -0
- /package/dist/{components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts → hooks/useCompanyPaymentSpeed.test.d.ts} +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.d.ts +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts → partner-hook-utils/composeErrorHandler.test.d.ts} +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.js +0 -0
- /package/dist/{hooks/useErrorHandling.test.d.ts → partner-hook-utils/form/buildFormSchema.test.d.ts} +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OptionalFieldsToRequire } from '../../../../../partner-hook-utils/form/buildFormSchema';
|
|
3
|
+
export declare const PayScheduleErrorCodes: {
|
|
4
|
+
readonly REQUIRED: "REQUIRED";
|
|
5
|
+
readonly DAY_RANGE: "DAY_RANGE";
|
|
6
|
+
};
|
|
7
|
+
export type PayScheduleErrorCode = (typeof PayScheduleErrorCodes)[keyof typeof PayScheduleErrorCodes];
|
|
8
|
+
declare const FREQUENCY_VALUES: readonly ["Every week", "Every other week", "Twice per month", "Monthly"];
|
|
9
|
+
export type PayScheduleFrequency = (typeof FREQUENCY_VALUES)[number];
|
|
10
|
+
declare const fieldValidators: {
|
|
11
|
+
customName: z.ZodString;
|
|
12
|
+
frequency: z.ZodEnum<{
|
|
13
|
+
"Every week": "Every week";
|
|
14
|
+
"Every other week": "Every other week";
|
|
15
|
+
"Twice per month": "Twice per month";
|
|
16
|
+
Monthly: "Monthly";
|
|
17
|
+
}>;
|
|
18
|
+
customTwicePerMonth: z.ZodString;
|
|
19
|
+
anchorPayDate: z.ZodPipe<z.ZodTransform<string | null, unknown>, z.ZodNullable<z.ZodISODate>>;
|
|
20
|
+
anchorEndOfPayPeriod: z.ZodPipe<z.ZodTransform<string | null, unknown>, z.ZodNullable<z.ZodISODate>>;
|
|
21
|
+
day1: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
22
|
+
day2: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
23
|
+
};
|
|
24
|
+
export type PayScheduleField = keyof typeof fieldValidators;
|
|
25
|
+
export type PayScheduleFormData = {
|
|
26
|
+
[K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>;
|
|
27
|
+
};
|
|
28
|
+
export type PayScheduleFormOutputs = PayScheduleFormData;
|
|
29
|
+
declare function needsDay1(data: PayScheduleFormData): boolean;
|
|
30
|
+
declare function needsDay2(data: PayScheduleFormData): boolean;
|
|
31
|
+
declare const requiredFieldsConfig: {
|
|
32
|
+
customTwicePerMonth: "never";
|
|
33
|
+
day1: typeof needsDay1;
|
|
34
|
+
day2: typeof needsDay2;
|
|
35
|
+
};
|
|
36
|
+
export type PayScheduleOptionalFieldsToRequire = OptionalFieldsToRequire<typeof requiredFieldsConfig>;
|
|
37
|
+
interface PayScheduleSchemaOptions {
|
|
38
|
+
mode?: 'create' | 'update';
|
|
39
|
+
optionalFieldsToRequire?: PayScheduleOptionalFieldsToRequire;
|
|
40
|
+
}
|
|
41
|
+
export declare function createPayScheduleSchema(options?: PayScheduleSchemaOptions): import('../../../../../partner-hook-utils/form/buildFormSchema').BuildFormSchemaResult<{
|
|
42
|
+
customName: z.ZodString;
|
|
43
|
+
frequency: z.ZodEnum<{
|
|
44
|
+
"Every week": "Every week";
|
|
45
|
+
"Every other week": "Every other week";
|
|
46
|
+
"Twice per month": "Twice per month";
|
|
47
|
+
Monthly: "Monthly";
|
|
48
|
+
}>;
|
|
49
|
+
customTwicePerMonth: z.ZodString;
|
|
50
|
+
anchorPayDate: z.ZodPipe<z.ZodTransform<string | null, unknown>, z.ZodNullable<z.ZodISODate>>;
|
|
51
|
+
anchorEndOfPayPeriod: z.ZodPipe<z.ZodTransform<string | null, unknown>, z.ZodNullable<z.ZodISODate>>;
|
|
52
|
+
day1: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
53
|
+
day2: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>;
|
|
54
|
+
}>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z as o } from "zod";
|
|
2
|
+
import { buildFormSchema as d } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
|
|
3
|
+
import { coerceNaN as n, coerceToISODate as t } from "../../../../../partner-hook-utils/form/preprocessors.js";
|
|
4
|
+
const c = {
|
|
5
|
+
REQUIRED: "REQUIRED",
|
|
6
|
+
DAY_RANGE: "DAY_RANGE"
|
|
7
|
+
}, m = ["Every week", "Every other week", "Twice per month", "Monthly"], a = {
|
|
8
|
+
customName: o.string(),
|
|
9
|
+
frequency: o.enum(m),
|
|
10
|
+
customTwicePerMonth: o.string(),
|
|
11
|
+
anchorPayDate: o.preprocess(t, o.iso.date().nullable()),
|
|
12
|
+
anchorEndOfPayPeriod: o.preprocess(t, o.iso.date().nullable()),
|
|
13
|
+
day1: o.preprocess(n(0), o.number()),
|
|
14
|
+
day2: o.preprocess(n(0), o.number())
|
|
15
|
+
};
|
|
16
|
+
function u(e) {
|
|
17
|
+
const r = e.frequency, s = e.customTwicePerMonth;
|
|
18
|
+
return r === "Monthly" || r === "Twice per month" && s === "custom";
|
|
19
|
+
}
|
|
20
|
+
function i(e) {
|
|
21
|
+
const r = e.frequency, s = e.customTwicePerMonth;
|
|
22
|
+
return r === "Twice per month" && s === "custom";
|
|
23
|
+
}
|
|
24
|
+
const y = {
|
|
25
|
+
customTwicePerMonth: "never",
|
|
26
|
+
day1: u,
|
|
27
|
+
day2: i
|
|
28
|
+
};
|
|
29
|
+
function E(e, r) {
|
|
30
|
+
u(e) && (e.day1 < 1 || e.day1 > 31) && r.addIssue({
|
|
31
|
+
code: o.ZodIssueCode.custom,
|
|
32
|
+
path: ["day1"],
|
|
33
|
+
message: e.day1 < 1 ? c.REQUIRED : c.DAY_RANGE
|
|
34
|
+
}), i(e) && (e.day2 < 1 || e.day2 > 31) && r.addIssue({
|
|
35
|
+
code: o.ZodIssueCode.custom,
|
|
36
|
+
path: ["day2"],
|
|
37
|
+
message: e.day2 < 1 ? c.REQUIRED : c.DAY_RANGE
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function R(e = {}) {
|
|
41
|
+
const { mode: r = "create", optionalFieldsToRequire: s } = e;
|
|
42
|
+
return d(a, {
|
|
43
|
+
requiredFieldsConfig: y,
|
|
44
|
+
requiredErrorCode: c.REQUIRED,
|
|
45
|
+
mode: r,
|
|
46
|
+
optionalFieldsToRequire: s,
|
|
47
|
+
superRefine: E
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
c as PayScheduleErrorCodes,
|
|
52
|
+
R as createPayScheduleSchema
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=payScheduleSchema.js.map
|
package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payScheduleSchema.js","sources":["../../../../../../src/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const PayScheduleErrorCodes = {\n REQUIRED: 'REQUIRED',\n DAY_RANGE: 'DAY_RANGE',\n} as const\n\nexport type PayScheduleErrorCode =\n (typeof PayScheduleErrorCodes)[keyof typeof PayScheduleErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst FREQUENCY_VALUES = ['Every week', 'Every other week', 'Twice per month', 'Monthly'] as const\nexport type PayScheduleFrequency = (typeof FREQUENCY_VALUES)[number]\n\nconst fieldValidators = {\n customName: z.string(),\n frequency: z.enum(FREQUENCY_VALUES),\n customTwicePerMonth: z.string(),\n anchorPayDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n anchorEndOfPayPeriod: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n day1: z.preprocess(coerceNaN(0), z.number()),\n day2: z.preprocess(coerceNaN(0), z.number()),\n}\n\nexport type PayScheduleField = keyof typeof fieldValidators\n\nexport type PayScheduleFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\nexport type PayScheduleFormOutputs = PayScheduleFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\nfunction needsDay1(data: PayScheduleFormData): boolean {\n const freq = data.frequency\n const custom = data.customTwicePerMonth\n return freq === 'Monthly' || (freq === 'Twice per month' && custom === 'custom')\n}\n\nfunction needsDay2(data: PayScheduleFormData): boolean {\n const freq = data.frequency\n const custom = data.customTwicePerMonth\n return freq === 'Twice per month' && custom === 'custom'\n}\n\nconst requiredFieldsConfig = {\n customTwicePerMonth: 'never',\n day1: needsDay1,\n day2: needsDay2,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n/**\n * coerceNaN(0) maps empty inputs to 0, which `isEmpty` does not catch\n * (it only recognizes undefined/null/blank-string). This superRefine\n * enforces the 1–31 range when the field is applicable, which also\n * rejects the 0 sentinel from empty inputs.\n */\nfunction validateDayRanges(data: PayScheduleFormData, ctx: z.RefinementCtx) {\n if (needsDay1(data) && (data.day1 < 1 || data.day1 > 31)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['day1'],\n message: data.day1 < 1 ? PayScheduleErrorCodes.REQUIRED : PayScheduleErrorCodes.DAY_RANGE,\n })\n }\n if (needsDay2(data) && (data.day2 < 1 || data.day2 > 31)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['day2'],\n message: data.day2 < 1 ? PayScheduleErrorCodes.REQUIRED : PayScheduleErrorCodes.DAY_RANGE,\n })\n }\n}\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\nexport type PayScheduleOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\ninterface PayScheduleSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: PayScheduleOptionalFieldsToRequire\n}\n\nexport function createPayScheduleSchema(options: PayScheduleSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: PayScheduleErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n superRefine: validateDayRanges,\n })\n}\n"],"names":["PayScheduleErrorCodes","FREQUENCY_VALUES","fieldValidators","z","coerceToISODate","coerceNaN","needsDay1","data","freq","custom","needsDay2","requiredFieldsConfig","validateDayRanges","ctx","createPayScheduleSchema","options","mode","optionalFieldsToRequire","buildFormSchema"],"mappings":";;;AAUO,MAAMA,IAAwB;AAAA,EACnC,UAAU;AAAA,EACV,WAAW;AACb,GAOMC,IAAmB,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,GAGlFC,IAAkB;AAAA,EACtB,YAAYC,EAAE,OAAA;AAAA,EACd,WAAWA,EAAE,KAAKF,CAAgB;AAAA,EAClC,qBAAqBE,EAAE,OAAA;AAAA,EACvB,eAAeA,EAAE,WAAWC,GAAiBD,EAAE,IAAI,OAAO,UAAU;AAAA,EACpE,sBAAsBA,EAAE,WAAWC,GAAiBD,EAAE,IAAI,OAAO,UAAU;AAAA,EAC3E,MAAMA,EAAE,WAAWE,EAAU,CAAC,GAAGF,EAAE,QAAQ;AAAA,EAC3C,MAAMA,EAAE,WAAWE,EAAU,CAAC,GAAGF,EAAE,QAAQ;AAC7C;AAWA,SAASG,EAAUC,GAAoC;AACrD,QAAMC,IAAOD,EAAK,WACZE,IAASF,EAAK;AACpB,SAAOC,MAAS,aAAcA,MAAS,qBAAqBC,MAAW;AACzE;AAEA,SAASC,EAAUH,GAAoC;AACrD,QAAMC,IAAOD,EAAK,WACZE,IAASF,EAAK;AACpB,SAAOC,MAAS,qBAAqBC,MAAW;AAClD;AAEA,MAAME,IAAuB;AAAA,EAC3B,qBAAqB;AAAA,EACrB,MAAML;AAAA,EACN,MAAMI;AACR;AAQA,SAASE,EAAkBL,GAA2BM,GAAsB;AAC1E,EAAIP,EAAUC,CAAI,MAAMA,EAAK,OAAO,KAAKA,EAAK,OAAO,OACnDM,EAAI,SAAS;AAAA,IACX,MAAMV,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASI,EAAK,OAAO,IAAIP,EAAsB,WAAWA,EAAsB;AAAA,EAAA,CACjF,GAECU,EAAUH,CAAI,MAAMA,EAAK,OAAO,KAAKA,EAAK,OAAO,OACnDM,EAAI,SAAS;AAAA,IACX,MAAMV,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASI,EAAK,OAAO,IAAIP,EAAsB,WAAWA,EAAsB;AAAA,EAAA,CACjF;AAEL;AAaO,SAASc,EAAwBC,IAAoC,IAAI;AAC9E,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,EAAA,IAA4BF;AAErD,SAAOG,EAAgBhB,GAAiB;AAAA,IACtC,sBAAAS;AAAA,IACA,mBAAmBX,EAAsB;AAAA,IACzC,MAAAgB;AAAA,IACA,yBAAAC;AAAA,IACA,aAAaL;AAAA,EAAA,CACd;AACH;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { PaySchedule } from '@gusto/embedded-api/models/components/payschedule';
|
|
3
|
+
import { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod';
|
|
4
|
+
import { PayScheduleOptionalFieldsToRequire, PayScheduleFormData } from './payScheduleSchema';
|
|
5
|
+
import { BaseFormHookReady, FieldsMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
|
|
6
|
+
export type { PayScheduleOptionalFieldsToRequire } from './payScheduleSchema';
|
|
7
|
+
export interface UsePayScheduleFormProps {
|
|
8
|
+
companyId: string;
|
|
9
|
+
payScheduleId?: string;
|
|
10
|
+
optionalFieldsToRequire?: PayScheduleOptionalFieldsToRequire;
|
|
11
|
+
defaultValues?: Partial<PayScheduleFormData>;
|
|
12
|
+
validationMode?: UseFormProps['mode'];
|
|
13
|
+
shouldFocusError?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UsePayScheduleFormReady extends BaseFormHookReady<FieldsMetadata, PayScheduleFormData> {
|
|
16
|
+
data: {
|
|
17
|
+
paySchedule: PaySchedule | null;
|
|
18
|
+
payPeriodPreview: PaySchedulePreviewPayPeriod[] | null;
|
|
19
|
+
payPreviewLoading: boolean;
|
|
20
|
+
paymentSpeedDays: number | null;
|
|
21
|
+
};
|
|
22
|
+
status: {
|
|
23
|
+
isPending: boolean;
|
|
24
|
+
mode: 'create' | 'update';
|
|
25
|
+
};
|
|
26
|
+
actions: {
|
|
27
|
+
onSubmit: () => Promise<HookSubmitResult<PaySchedule> | undefined>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function usePayScheduleForm({ companyId, payScheduleId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UsePayScheduleFormProps): HookLoadingResult | UsePayScheduleFormReady;
|
|
31
|
+
export type UsePayScheduleFormResult = HookLoadingResult | UsePayScheduleFormReady;
|
|
32
|
+
export type PayScheduleFieldsMetadata = UsePayScheduleFormReady['form']['fieldsMetadata'];
|
|
33
|
+
export type PayScheduleFormFields = UsePayScheduleFormReady['form']['Fields'];
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { useMemo as oe, useEffect as te } from "react";
|
|
2
|
+
import { useForm as ae, useWatch as i } from "react-hook-form";
|
|
3
|
+
import { zodResolver as ne } from "@hookform/resolvers/zod";
|
|
4
|
+
import { usePaySchedulesGet as re } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
5
|
+
import { usePaySchedulesGetPreview as ce } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
|
|
6
|
+
import { usePaySchedulesCreateMutation as se } from "@gusto/embedded-api/react-query/paySchedulesCreate";
|
|
7
|
+
import { usePaySchedulesUpdateMutation as ie } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
|
|
8
|
+
import { usePaymentConfigsGet as de } from "@gusto/embedded-api/react-query/paymentConfigsGet";
|
|
9
|
+
import { RFCDate as d } from "@gusto/embedded-api/types/rfcdate";
|
|
10
|
+
import { createPayScheduleSchema as ue } from "./payScheduleSchema.js";
|
|
11
|
+
import { Day2Field as me, Day1Field as ye, AnchorEndOfPayPeriodField as he, AnchorPayDateField as Pe, CustomTwicePerMonthField as le, FrequencyField as fe, CustomNameField as we } from "./fields.js";
|
|
12
|
+
import { useDeriveFieldsMetadata as pe } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
|
|
13
|
+
import { createGetFormSubmissionValues as Ee } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
|
|
14
|
+
import { withOptions as q } from "../../../../../partner-hook-utils/form/withOptions.js";
|
|
15
|
+
import { composeErrorHandler as Se } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
16
|
+
import { useBaseSubmit as ve } from "../../../../Base/useBaseSubmit.js";
|
|
17
|
+
import { parsePaymentSpeedDays as De } from "../../../../../hooks/useCompanyPaymentSpeed.js";
|
|
18
|
+
import { formatDateToStringDate as Me } from "../../../../../helpers/dateFormatting.js";
|
|
19
|
+
const F = [
|
|
20
|
+
{ value: "Every week", label: "Every week" },
|
|
21
|
+
{ value: "Every other week", label: "Every other week" },
|
|
22
|
+
{ value: "Twice per month", label: "Twice per month" },
|
|
23
|
+
{ value: "Monthly", label: "Monthly" }
|
|
24
|
+
], Te = F.map((e) => e.value), A = [
|
|
25
|
+
{ value: "1st15th", label: "15th and Last day of the month" },
|
|
26
|
+
{ value: "custom", label: "Custom" }
|
|
27
|
+
], Ne = A.map((e) => e.value);
|
|
28
|
+
function C(e) {
|
|
29
|
+
return e instanceof Date ? Me(e) || "" : typeof e == "string" && e ? e : "";
|
|
30
|
+
}
|
|
31
|
+
function Oe(e, s, u) {
|
|
32
|
+
return e !== "Twice per month" ? "" : s === 15 && u === 31 ? "1st15th" : "custom";
|
|
33
|
+
}
|
|
34
|
+
function ze({
|
|
35
|
+
companyId: e,
|
|
36
|
+
payScheduleId: s,
|
|
37
|
+
optionalFieldsToRequire: u,
|
|
38
|
+
defaultValues: n,
|
|
39
|
+
validationMode: R = "onSubmit",
|
|
40
|
+
shouldFocusError: L = !0
|
|
41
|
+
}) {
|
|
42
|
+
const h = re(
|
|
43
|
+
{ companyId: e, payScheduleId: s ?? "" },
|
|
44
|
+
{ enabled: !!s }
|
|
45
|
+
), m = de({ companyUuid: e }), o = h.data?.paySchedule ?? null, V = m.data?.paymentConfigs?.paymentSpeed, _ = De(V), P = !o, p = P ? "create" : "update", [E, k] = oe(
|
|
46
|
+
() => ue({ mode: p, optionalFieldsToRequire: u }),
|
|
47
|
+
[p, u]
|
|
48
|
+
), S = {
|
|
49
|
+
customName: o?.customName ?? n?.customName ?? "",
|
|
50
|
+
frequency: o?.frequency ?? n?.frequency ?? "Every week",
|
|
51
|
+
customTwicePerMonth: Oe(
|
|
52
|
+
o?.frequency ?? n?.frequency,
|
|
53
|
+
o?.day1 ?? n?.day1 ?? void 0,
|
|
54
|
+
o?.day2 ?? n?.day2 ?? void 0
|
|
55
|
+
),
|
|
56
|
+
anchorPayDate: o?.anchorPayDate?.toString() ?? n?.anchorPayDate ?? null,
|
|
57
|
+
anchorEndOfPayPeriod: o?.anchorEndOfPayPeriod?.toString() ?? n?.anchorEndOfPayPeriod ?? null,
|
|
58
|
+
day1: o?.day1 ?? n?.day1 ?? NaN,
|
|
59
|
+
day2: o?.day2 ?? n?.day2 ?? NaN
|
|
60
|
+
}, t = ae({
|
|
61
|
+
resolver: ne(E),
|
|
62
|
+
mode: R,
|
|
63
|
+
shouldFocusError: L,
|
|
64
|
+
defaultValues: S,
|
|
65
|
+
values: S,
|
|
66
|
+
resetOptions: { keepDirtyValues: !0 }
|
|
67
|
+
}), r = i({ control: t.control, name: "frequency" }), y = i({
|
|
68
|
+
control: t.control,
|
|
69
|
+
name: "customTwicePerMonth"
|
|
70
|
+
}), H = i({ control: t.control, name: "anchorPayDate" }), Q = i({
|
|
71
|
+
control: t.control,
|
|
72
|
+
name: "anchorEndOfPayPeriod"
|
|
73
|
+
}), U = i({ control: t.control, name: "day1" }), G = i({ control: t.control, name: "day2" });
|
|
74
|
+
te(() => {
|
|
75
|
+
r === "Twice per month" && y === "1st15th" && (t.setValue("day1", 15), t.setValue("day2", 31));
|
|
76
|
+
}, [r, y, t.setValue]);
|
|
77
|
+
const l = C(H), f = C(Q), v = !!(l && f), D = ce(
|
|
78
|
+
{
|
|
79
|
+
companyId: e,
|
|
80
|
+
frequency: r,
|
|
81
|
+
...l && { anchorPayDate: new d(l) },
|
|
82
|
+
...f && {
|
|
83
|
+
anchorEndOfPayPeriod: new d(f)
|
|
84
|
+
},
|
|
85
|
+
day1: U || void 0,
|
|
86
|
+
day2: G || void 0
|
|
87
|
+
},
|
|
88
|
+
{ enabled: v }
|
|
89
|
+
), W = D.data?.paySchedulePreview?.payPeriods, B = D.isLoading && v, M = se(), T = ie(), I = M.isPending || T.isPending, {
|
|
90
|
+
baseSubmitHandler: Y,
|
|
91
|
+
error: x,
|
|
92
|
+
setError: z
|
|
93
|
+
} = ve("PayScheduleForm"), N = Se(s ? [h, m] : [m], { submitError: x, setSubmitError: z }), j = r === "Twice per month", J = r === "Monthly" || r === "Twice per month" && y === "custom", K = r === "Twice per month" && y === "custom", c = pe(k, t.control), X = {
|
|
94
|
+
customName: c.customName,
|
|
95
|
+
frequency: q(
|
|
96
|
+
c.frequency,
|
|
97
|
+
F,
|
|
98
|
+
Te
|
|
99
|
+
),
|
|
100
|
+
customTwicePerMonth: q(
|
|
101
|
+
c.customTwicePerMonth,
|
|
102
|
+
A,
|
|
103
|
+
Ne
|
|
104
|
+
),
|
|
105
|
+
anchorPayDate: c.anchorPayDate,
|
|
106
|
+
anchorEndOfPayPeriod: c.anchorEndOfPayPeriod,
|
|
107
|
+
day1: c.day1,
|
|
108
|
+
day2: c.day2
|
|
109
|
+
}, Z = async () => {
|
|
110
|
+
let w;
|
|
111
|
+
return await new Promise((O) => {
|
|
112
|
+
t.handleSubmit(
|
|
113
|
+
async ($) => {
|
|
114
|
+
await Y($, async (a) => {
|
|
115
|
+
const b = a.anchorPayDate ?? "", g = a.anchorEndOfPayPeriod ?? "";
|
|
116
|
+
P ? w = { mode: "create", data: (await M.mutateAsync({
|
|
117
|
+
request: {
|
|
118
|
+
companyId: e,
|
|
119
|
+
payScheduleCreateRequest: {
|
|
120
|
+
frequency: a.frequency,
|
|
121
|
+
anchorPayDate: new d(b),
|
|
122
|
+
anchorEndOfPayPeriod: new d(g),
|
|
123
|
+
customName: a.customName,
|
|
124
|
+
day1: a.day1 || void 0,
|
|
125
|
+
day2: a.day2 || void 0
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
})).paySchedule } : w = { mode: "update", data: (await T.mutateAsync({
|
|
129
|
+
request: {
|
|
130
|
+
payScheduleId: o.uuid,
|
|
131
|
+
companyId: e,
|
|
132
|
+
payScheduleUpdateRequest: {
|
|
133
|
+
frequency: a.frequency,
|
|
134
|
+
anchorPayDate: new d(b),
|
|
135
|
+
anchorEndOfPayPeriod: new d(g),
|
|
136
|
+
customName: a.customName,
|
|
137
|
+
day1: a.day1 || void 0,
|
|
138
|
+
day2: a.day2 || void 0,
|
|
139
|
+
version: o.version
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})).paySchedule };
|
|
143
|
+
}), O();
|
|
144
|
+
},
|
|
145
|
+
() => {
|
|
146
|
+
O();
|
|
147
|
+
}
|
|
148
|
+
)();
|
|
149
|
+
}), w;
|
|
150
|
+
};
|
|
151
|
+
return m.isLoading || (s ? h.isLoading : !1) ? { isLoading: !0, errorHandling: N } : {
|
|
152
|
+
isLoading: !1,
|
|
153
|
+
data: {
|
|
154
|
+
paySchedule: o,
|
|
155
|
+
payPeriodPreview: W ?? null,
|
|
156
|
+
payPreviewLoading: B,
|
|
157
|
+
paymentSpeedDays: _
|
|
158
|
+
},
|
|
159
|
+
status: {
|
|
160
|
+
isPending: I,
|
|
161
|
+
mode: P ? "create" : "update"
|
|
162
|
+
},
|
|
163
|
+
actions: { onSubmit: Z },
|
|
164
|
+
errorHandling: N,
|
|
165
|
+
form: {
|
|
166
|
+
Fields: {
|
|
167
|
+
CustomName: we,
|
|
168
|
+
Frequency: fe,
|
|
169
|
+
CustomTwicePerMonth: j ? le : void 0,
|
|
170
|
+
AnchorPayDate: Pe,
|
|
171
|
+
AnchorEndOfPayPeriod: he,
|
|
172
|
+
Day1: J ? ye : void 0,
|
|
173
|
+
Day2: K ? me : void 0
|
|
174
|
+
},
|
|
175
|
+
fieldsMetadata: X,
|
|
176
|
+
hookFormInternals: { formMethods: t },
|
|
177
|
+
getFormSubmissionValues: Ee(t, E)
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export {
|
|
182
|
+
ze as usePayScheduleForm
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=usePayScheduleForm.js.map
|
package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePayScheduleForm.js","sources":["../../../../../../src/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { PaySchedule } from '@gusto/embedded-api/models/components/payschedule'\nimport type { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaymentConfigsGet } from '@gusto/embedded-api/react-query/paymentConfigsGet'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport {\n createPayScheduleSchema,\n type PayScheduleOptionalFieldsToRequire,\n type PayScheduleFormData,\n type PayScheduleFormOutputs,\n type PayScheduleFrequency,\n} from './payScheduleSchema'\nimport {\n CustomNameField,\n FrequencyField,\n CustomTwicePerMonthField,\n AnchorPayDateField,\n AnchorEndOfPayPeriodField,\n Day1Field,\n Day2Field,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { parsePaymentSpeedDays } from '@/hooks/useCompanyPaymentSpeed'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\n\nexport type { PayScheduleOptionalFieldsToRequire } from './payScheduleSchema'\n\nexport interface UsePayScheduleFormProps {\n companyId: string\n payScheduleId?: string\n optionalFieldsToRequire?: PayScheduleOptionalFieldsToRequire\n defaultValues?: Partial<PayScheduleFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport interface UsePayScheduleFormReady extends BaseFormHookReady<\n FieldsMetadata,\n PayScheduleFormData\n> {\n data: {\n paySchedule: PaySchedule | null\n payPeriodPreview: PaySchedulePreviewPayPeriod[] | null\n payPreviewLoading: boolean\n paymentSpeedDays: number | null\n }\n status: { isPending: boolean; mode: 'create' | 'update' }\n actions: {\n onSubmit: () => Promise<HookSubmitResult<PaySchedule> | undefined>\n }\n}\n\nconst FREQUENCY_OPTIONS: Array<{ value: PayScheduleFrequency; label: string }> = [\n { value: 'Every week', label: 'Every week' },\n { value: 'Every other week', label: 'Every other week' },\n { value: 'Twice per month', label: 'Twice per month' },\n { value: 'Monthly', label: 'Monthly' },\n]\n\nconst FREQUENCY_ENTRIES: PayScheduleFrequency[] = FREQUENCY_OPTIONS.map(o => o.value)\n\nconst TWICE_PER_MONTH_OPTIONS = [\n { value: '1st15th', label: '15th and Last day of the month' },\n { value: 'custom', label: 'Custom' },\n]\n\nconst TWICE_PER_MONTH_ENTRIES = TWICE_PER_MONTH_OPTIONS.map(o => o.value)\n\nfunction formatWatchedDate(value: unknown): string {\n if (value instanceof Date) return formatDateToStringDate(value) || ''\n if (typeof value === 'string' && value) return value\n return ''\n}\n\nfunction deriveCustomTwicePerMonth(\n frequency: string | undefined,\n day1: number | undefined,\n day2: number | undefined,\n): string {\n if (frequency !== 'Twice per month') return ''\n if (day1 === 15 && day2 === 31) return '1st15th'\n return 'custom'\n}\n\nexport function usePayScheduleForm({\n companyId,\n payScheduleId,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UsePayScheduleFormProps): HookLoadingResult | UsePayScheduleFormReady {\n const payScheduleQuery = usePaySchedulesGet(\n { companyId, payScheduleId: payScheduleId ?? '' },\n { enabled: !!payScheduleId },\n )\n\n const paymentConfigsQuery = usePaymentConfigsGet({ companyUuid: companyId })\n\n const currentPaySchedule = payScheduleQuery.data?.paySchedule ?? null\n const paymentSpeed = paymentConfigsQuery.data?.paymentConfigs?.paymentSpeed\n const paymentSpeedDays = parsePaymentSpeedDays(paymentSpeed)\n\n const isCreateMode = !currentPaySchedule\n const mode = isCreateMode ? 'create' : 'update'\n\n const [schema, metadataConfig] = useMemo(\n () => createPayScheduleSchema({ mode, optionalFieldsToRequire }),\n [mode, optionalFieldsToRequire],\n )\n\n const resolvedDefaults: PayScheduleFormData = {\n customName: currentPaySchedule?.customName ?? partnerDefaults?.customName ?? '',\n frequency: (currentPaySchedule?.frequency ??\n partnerDefaults?.frequency ??\n 'Every week') as PayScheduleFrequency,\n customTwicePerMonth: deriveCustomTwicePerMonth(\n currentPaySchedule?.frequency ?? partnerDefaults?.frequency,\n currentPaySchedule?.day1 ?? partnerDefaults?.day1 ?? undefined,\n currentPaySchedule?.day2 ?? partnerDefaults?.day2 ?? undefined,\n ),\n anchorPayDate:\n currentPaySchedule?.anchorPayDate?.toString() ?? partnerDefaults?.anchorPayDate ?? null,\n anchorEndOfPayPeriod:\n currentPaySchedule?.anchorEndOfPayPeriod?.toString() ??\n partnerDefaults?.anchorEndOfPayPeriod ??\n null,\n day1: currentPaySchedule?.day1 ?? partnerDefaults?.day1 ?? NaN,\n day2: currentPaySchedule?.day2 ?? partnerDefaults?.day2 ?? NaN,\n }\n\n const formMethods = useForm<PayScheduleFormData, unknown, PayScheduleFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const watchedFrequency = useWatch({ control: formMethods.control, name: 'frequency' })\n const watchedCustomTwicePerMonth = useWatch({\n control: formMethods.control,\n name: 'customTwicePerMonth',\n })\n const watchedAnchorPayDate = useWatch({ control: formMethods.control, name: 'anchorPayDate' })\n const watchedAnchorEndOfPayPeriod = useWatch({\n control: formMethods.control,\n name: 'anchorEndOfPayPeriod',\n })\n const watchedDay1 = useWatch({ control: formMethods.control, name: 'day1' })\n const watchedDay2 = useWatch({ control: formMethods.control, name: 'day2' })\n\n useEffect(() => {\n if (watchedFrequency === 'Twice per month' && watchedCustomTwicePerMonth === '1st15th') {\n formMethods.setValue('day1', 15)\n formMethods.setValue('day2', 31)\n }\n }, [watchedFrequency, watchedCustomTwicePerMonth, formMethods.setValue])\n\n const formattedAnchorPayDate = formatWatchedDate(watchedAnchorPayDate)\n const formattedAnchorEndOfPayPeriod = formatWatchedDate(watchedAnchorEndOfPayPeriod)\n\n const previewEnabled = Boolean(formattedAnchorPayDate && formattedAnchorEndOfPayPeriod)\n\n const previewQuery = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: watchedFrequency,\n ...(formattedAnchorPayDate && { anchorPayDate: new RFCDate(formattedAnchorPayDate) }),\n ...(formattedAnchorEndOfPayPeriod && {\n anchorEndOfPayPeriod: new RFCDate(formattedAnchorEndOfPayPeriod),\n }),\n day1: watchedDay1 || undefined,\n day2: watchedDay2 || undefined,\n } as Parameters<typeof usePaySchedulesGetPreview>[0],\n { enabled: previewEnabled },\n )\n\n const payPeriodPreview: PaySchedulePreviewPayPeriod[] | undefined =\n previewQuery.data?.paySchedulePreview?.payPeriods\n const payPreviewLoading = previewQuery.isLoading && previewEnabled\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const isPending = createPayScheduleMutation.isPending || updatePayScheduleMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('PayScheduleForm')\n\n const queries = payScheduleId ? [payScheduleQuery, paymentConfigsQuery] : [paymentConfigsQuery]\n const errorHandling = composeErrorHandler(queries, { submitError, setSubmitError })\n\n const showCustomTwicePerMonth = watchedFrequency === 'Twice per month'\n const showDay1 =\n watchedFrequency === 'Monthly' ||\n (watchedFrequency === 'Twice per month' && watchedCustomTwicePerMonth === 'custom')\n const showDay2 = watchedFrequency === 'Twice per month' && watchedCustomTwicePerMonth === 'custom'\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const fieldsMetadata = {\n customName: baseMetadata.customName,\n frequency: withOptions<PayScheduleFrequency>(\n baseMetadata.frequency,\n FREQUENCY_OPTIONS,\n FREQUENCY_ENTRIES,\n ),\n customTwicePerMonth: withOptions<string>(\n baseMetadata.customTwicePerMonth,\n TWICE_PER_MONTH_OPTIONS,\n TWICE_PER_MONTH_ENTRIES,\n ),\n anchorPayDate: baseMetadata.anchorPayDate,\n anchorEndOfPayPeriod: baseMetadata.anchorEndOfPayPeriod,\n day1: baseMetadata.day1,\n day2: baseMetadata.day2,\n }\n\n const onSubmit = async (): Promise<HookSubmitResult<PaySchedule> | undefined> => {\n let submitResult: HookSubmitResult<PaySchedule> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: PayScheduleFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const anchorPayDate = payload.anchorPayDate ?? ''\n const anchorEndOfPayPeriod = payload.anchorEndOfPayPeriod ?? ''\n\n if (isCreateMode) {\n const result = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n payScheduleCreateRequest: {\n frequency: payload.frequency,\n anchorPayDate: new RFCDate(anchorPayDate),\n anchorEndOfPayPeriod: new RFCDate(anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1 || undefined,\n day2: payload.day2 || undefined,\n },\n },\n })\n\n submitResult = { mode: 'create', data: result.paySchedule! }\n } else {\n const result = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule.uuid,\n companyId,\n payScheduleUpdateRequest: {\n frequency: payload.frequency,\n anchorPayDate: new RFCDate(anchorPayDate),\n anchorEndOfPayPeriod: new RFCDate(anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1 || undefined,\n day2: payload.day2 || undefined,\n version: currentPaySchedule.version!,\n },\n },\n })\n\n submitResult = { mode: 'update', data: result.paySchedule! }\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading =\n paymentConfigsQuery.isLoading || (payScheduleId ? payScheduleQuery.isLoading : false)\n\n if (isDataLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n paySchedule: currentPaySchedule,\n payPeriodPreview: payPeriodPreview ?? null,\n payPreviewLoading,\n paymentSpeedDays,\n },\n status: {\n isPending,\n mode: isCreateMode ? ('create' as const) : ('update' as const),\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n CustomName: CustomNameField,\n Frequency: FrequencyField,\n CustomTwicePerMonth: showCustomTwicePerMonth ? CustomTwicePerMonthField : undefined,\n AnchorPayDate: AnchorPayDateField,\n AnchorEndOfPayPeriod: AnchorEndOfPayPeriodField,\n Day1: showDay1 ? Day1Field : undefined,\n Day2: showDay2 ? Day2Field : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UsePayScheduleFormResult = HookLoadingResult | UsePayScheduleFormReady\nexport type PayScheduleFieldsMetadata = UsePayScheduleFormReady['form']['fieldsMetadata']\nexport type PayScheduleFormFields = UsePayScheduleFormReady['form']['Fields']\n"],"names":["FREQUENCY_OPTIONS","FREQUENCY_ENTRIES","o","TWICE_PER_MONTH_OPTIONS","TWICE_PER_MONTH_ENTRIES","formatWatchedDate","value","formatDateToStringDate","deriveCustomTwicePerMonth","frequency","day1","day2","usePayScheduleForm","companyId","payScheduleId","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","payScheduleQuery","usePaySchedulesGet","paymentConfigsQuery","usePaymentConfigsGet","currentPaySchedule","paymentSpeed","paymentSpeedDays","parsePaymentSpeedDays","isCreateMode","mode","schema","metadataConfig","useMemo","createPayScheduleSchema","resolvedDefaults","formMethods","useForm","zodResolver","watchedFrequency","useWatch","watchedCustomTwicePerMonth","watchedAnchorPayDate","watchedAnchorEndOfPayPeriod","watchedDay1","watchedDay2","useEffect","formattedAnchorPayDate","formattedAnchorEndOfPayPeriod","previewEnabled","previewQuery","usePaySchedulesGetPreview","RFCDate","payPeriodPreview","payPreviewLoading","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","showCustomTwicePerMonth","showDay1","showDay2","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","submitResult","resolve","data","payload","anchorPayDate","anchorEndOfPayPeriod","CustomNameField","FrequencyField","CustomTwicePerMonthField","AnchorPayDateField","AnchorEndOfPayPeriodField","Day1Field","Day2Field","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;AAqEA,MAAMA,IAA2E;AAAA,EAC/E,EAAE,OAAO,cAAc,OAAO,aAAA;AAAA,EAC9B,EAAE,OAAO,oBAAoB,OAAO,mBAAA;AAAA,EACpC,EAAE,OAAO,mBAAmB,OAAO,kBAAA;AAAA,EACnC,EAAE,OAAO,WAAW,OAAO,UAAA;AAC7B,GAEMC,KAA4CD,EAAkB,IAAI,CAAAE,MAAKA,EAAE,KAAK,GAE9EC,IAA0B;AAAA,EAC9B,EAAE,OAAO,WAAW,OAAO,iCAAA;AAAA,EAC3B,EAAE,OAAO,UAAU,OAAO,SAAA;AAC5B,GAEMC,KAA0BD,EAAwB,IAAI,CAAAD,MAAKA,EAAE,KAAK;AAExE,SAASG,EAAkBC,GAAwB;AACjD,SAAIA,aAAiB,OAAaC,GAAuBD,CAAK,KAAK,KAC/D,OAAOA,KAAU,YAAYA,IAAcA,IACxC;AACT;AAEA,SAASE,GACPC,GACAC,GACAC,GACQ;AACR,SAAIF,MAAc,oBAA0B,KACxCC,MAAS,MAAMC,MAAS,KAAW,YAChC;AACT;AAEO,SAASC,GAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAAyE;AACvE,QAAMC,IAAmBC;AAAA,IACvB,EAAE,WAAAP,GAAW,eAAeC,KAAiB,GAAA;AAAA,IAC7C,EAAE,SAAS,CAAC,CAACA,EAAA;AAAA,EAAc,GAGvBO,IAAsBC,GAAqB,EAAE,aAAaT,GAAW,GAErEU,IAAqBJ,EAAiB,MAAM,eAAe,MAC3DK,IAAeH,EAAoB,MAAM,gBAAgB,cACzDI,IAAmBC,GAAsBF,CAAY,GAErDG,IAAe,CAACJ,GAChBK,IAAOD,IAAe,WAAW,UAEjC,CAACE,GAAQC,CAAc,IAAIC;AAAA,IAC/B,MAAMC,GAAwB,EAAE,MAAAJ,GAAM,yBAAAb,GAAyB;AAAA,IAC/D,CAACa,GAAMb,CAAuB;AAAA,EAAA,GAG1BkB,IAAwC;AAAA,IAC5C,YAAYV,GAAoB,cAAcP,GAAiB,cAAc;AAAA,IAC7E,WAAYO,GAAoB,aAC9BP,GAAiB,aACjB;AAAA,IACF,qBAAqBR;AAAA,MACnBe,GAAoB,aAAaP,GAAiB;AAAA,MAClDO,GAAoB,QAAQP,GAAiB,QAAQ;AAAA,MACrDO,GAAoB,QAAQP,GAAiB,QAAQ;AAAA,IAAA;AAAA,IAEvD,eACEO,GAAoB,eAAe,SAAA,KAAcP,GAAiB,iBAAiB;AAAA,IACrF,sBACEO,GAAoB,sBAAsB,SAAA,KAC1CP,GAAiB,wBACjB;AAAA,IACF,MAAMO,GAAoB,QAAQP,GAAiB,QAAQ;AAAA,IAC3D,MAAMO,GAAoB,QAAQP,GAAiB,QAAQ;AAAA,EAAA,GAGvDkB,IAAcC,GAA8D;AAAA,IAChF,UAAUC,GAAYP,CAAM;AAAA,IAC5B,MAAMZ;AAAA,IACN,kBAAAC;AAAA,IACA,eAAee;AAAA,IACf,QAAQA;AAAA,IACR,cAAc,EAAE,iBAAiB,GAAA;AAAA,EAAK,CACvC,GAEKI,IAAmBC,EAAS,EAAE,SAASJ,EAAY,SAAS,MAAM,aAAa,GAC/EK,IAA6BD,EAAS;AAAA,IAC1C,SAASJ,EAAY;AAAA,IACrB,MAAM;AAAA,EAAA,CACP,GACKM,IAAuBF,EAAS,EAAE,SAASJ,EAAY,SAAS,MAAM,iBAAiB,GACvFO,IAA8BH,EAAS;AAAA,IAC3C,SAASJ,EAAY;AAAA,IACrB,MAAM;AAAA,EAAA,CACP,GACKQ,IAAcJ,EAAS,EAAE,SAASJ,EAAY,SAAS,MAAM,QAAQ,GACrES,IAAcL,EAAS,EAAE,SAASJ,EAAY,SAAS,MAAM,QAAQ;AAE3E,EAAAU,GAAU,MAAM;AACd,IAAIP,MAAqB,qBAAqBE,MAA+B,cAC3EL,EAAY,SAAS,QAAQ,EAAE,GAC/BA,EAAY,SAAS,QAAQ,EAAE;AAAA,EAEnC,GAAG,CAACG,GAAkBE,GAA4BL,EAAY,QAAQ,CAAC;AAEvE,QAAMW,IAAyBxC,EAAkBmC,CAAoB,GAC/DM,IAAgCzC,EAAkBoC,CAA2B,GAE7EM,IAAiB,GAAQF,KAA0BC,IAEnDE,IAAeC;AAAA,IACnB;AAAA,MACE,WAAApC;AAAA,MACA,WAAWwB;AAAA,MACX,GAAIQ,KAA0B,EAAE,eAAe,IAAIK,EAAQL,CAAsB,EAAA;AAAA,MACjF,GAAIC,KAAiC;AAAA,QACnC,sBAAsB,IAAII,EAAQJ,CAA6B;AAAA,MAAA;AAAA,MAEjE,MAAMJ,KAAe;AAAA,MACrB,MAAMC,KAAe;AAAA,IAAA;AAAA,IAEvB,EAAE,SAASI,EAAA;AAAA,EAAe,GAGtBI,IACJH,EAAa,MAAM,oBAAoB,YACnCI,IAAoBJ,EAAa,aAAaD,GAE9CM,IAA4BC,GAAA,GAC5BC,IAA4BC,GAAA,GAE5BC,IAAYJ,EAA0B,aAAaE,EAA0B,WAE7E;AAAA,IACJ,mBAAAG;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,GAAc,iBAAiB,GAG7BC,IAAgBC,GADNjD,IAAgB,CAACK,GAAkBE,CAAmB,IAAI,CAACA,CAAmB,GAC3C,EAAE,aAAAsC,GAAa,gBAAAC,GAAgB,GAE5EI,IAA0B3B,MAAqB,mBAC/C4B,IACJ5B,MAAqB,aACpBA,MAAqB,qBAAqBE,MAA+B,UACtE2B,IAAW7B,MAAqB,qBAAqBE,MAA+B,UAEpF4B,IAAeC,GAAwBtC,GAAgBI,EAAY,OAAO,GAC1EmC,IAAiB;AAAA,IACrB,YAAYF,EAAa;AAAA,IACzB,WAAWG;AAAA,MACTH,EAAa;AAAA,MACbnE;AAAA,MACAC;AAAA,IAAA;AAAA,IAEF,qBAAqBqE;AAAA,MACnBH,EAAa;AAAA,MACbhE;AAAA,MACAC;AAAA,IAAA;AAAA,IAEF,eAAe+D,EAAa;AAAA,IAC5B,sBAAsBA,EAAa;AAAA,IACnC,MAAMA,EAAa;AAAA,IACnB,MAAMA,EAAa;AAAA,EAAA,GAGfI,IAAW,YAAgE;AAC/E,QAAIC;AAEJ,iBAAM,IAAI,QAAc,CAAAC,MAAW;AACjC,MAAKvC,EAAY;AAAA,QACf,OAAOwC,MAAiC;AACtC,gBAAMhB,EAAkBgB,GAAM,OAAMC,MAAW;AAC7C,kBAAMC,IAAgBD,EAAQ,iBAAiB,IACzCE,IAAuBF,EAAQ,wBAAwB;AAE7D,YAAIhD,IAeF6C,IAAe,EAAE,MAAM,UAAU,OAdlB,MAAMnB,EAA0B,YAAY;AAAA,cACzD,SAAS;AAAA,gBACP,WAAAxC;AAAA,gBACA,0BAA0B;AAAA,kBACxB,WAAW8D,EAAQ;AAAA,kBACnB,eAAe,IAAIzB,EAAQ0B,CAAa;AAAA,kBACxC,sBAAsB,IAAI1B,EAAQ2B,CAAoB;AAAA,kBACtD,YAAYF,EAAQ;AAAA,kBACpB,MAAMA,EAAQ,QAAQ;AAAA,kBACtB,MAAMA,EAAQ,QAAQ;AAAA,gBAAA;AAAA,cACxB;AAAA,YACF,CACD,GAE6C,YAAA,IAkB9CH,IAAe,EAAE,MAAM,UAAU,OAhBlB,MAAMjB,EAA0B,YAAY;AAAA,cACzD,SAAS;AAAA,gBACP,eAAehC,EAAmB;AAAA,gBAClC,WAAAV;AAAA,gBACA,0BAA0B;AAAA,kBACxB,WAAW8D,EAAQ;AAAA,kBACnB,eAAe,IAAIzB,EAAQ0B,CAAa;AAAA,kBACxC,sBAAsB,IAAI1B,EAAQ2B,CAAoB;AAAA,kBACtD,YAAYF,EAAQ;AAAA,kBACpB,MAAMA,EAAQ,QAAQ;AAAA,kBACtB,MAAMA,EAAQ,QAAQ;AAAA,kBACtB,SAASpD,EAAmB;AAAA,gBAAA;AAAA,cAC9B;AAAA,YACF,CACD,GAE6C,YAAA;AAAA,UAElD,CAAC,GACDkD,EAAA;AAAA,QACF;AAAA,QACA,MAAM;AACJ,UAAAA,EAAA;AAAA,QACF;AAAA,MAAA,EACF;AAAA,IACF,CAAC,GAEMD;AAAA,EACT;AAKA,SAFEnD,EAAoB,cAAcP,IAAgBK,EAAiB,YAAY,MAGxE,EAAE,WAAW,IAAe,eAAA2C,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,aAAavC;AAAA,MACb,kBAAkB4B,KAAoB;AAAA,MACtC,mBAAAC;AAAA,MACA,kBAAA3B;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAgC;AAAA,MACA,MAAM9B,IAAgB,WAAsB;AAAA,IAAA;AAAA,IAE9C,SAAS,EAAE,UAAA4C,EAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,YAAYgB;AAAA,QACZ,WAAWC;AAAA,QACX,qBAAqBf,IAA0BgB,KAA2B;AAAA,QAC1E,eAAeC;AAAA,QACf,sBAAsBC;AAAA,QACtB,MAAMjB,IAAWkB,KAAY;AAAA,QAC7B,MAAMjB,IAAWkB,KAAY;AAAA,MAAA;AAAA,MAE/B,gBAAAf;AAAA,MACA,mBAAmB,EAAE,aAAAnC,EAAA;AAAA,MACrB,yBAAyBmD,GAA8BnD,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview';
|
|
2
|
+
import { PaySchedule, PaySchedule as PayScheduleType } from '@gusto/embedded-api/models/components/payschedule';
|
|
3
|
+
import { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod';
|
|
5
4
|
import { z } from 'zod';
|
|
6
5
|
import { RequireAtLeastOne } from '../../../types/Helpers';
|
|
7
6
|
export type MODE = 'LIST_PAY_SCHEDULES' | 'ADD_PAY_SCHEDULE' | 'EDIT_PAY_SCHEDULE' | 'PREVIEW_PAY_SCHEDULE';
|
|
@@ -13,11 +12,11 @@ type PayScheduleContextType = {
|
|
|
13
12
|
handleContinue: () => void;
|
|
14
13
|
mode: MODE;
|
|
15
14
|
isPending: boolean;
|
|
16
|
-
paySchedules:
|
|
15
|
+
paySchedules: PaySchedule[] | undefined | null;
|
|
17
16
|
currentPaySchedule: PayScheduleType | undefined | null;
|
|
18
|
-
payPeriodPreview?:
|
|
17
|
+
payPeriodPreview?: PaySchedulePreviewPayPeriod[];
|
|
19
18
|
payPreviewLoading?: boolean;
|
|
20
|
-
|
|
19
|
+
paymentSpeedDays: number;
|
|
21
20
|
};
|
|
22
21
|
export declare const PayScheduleSchema: z.ZodObject<{
|
|
23
22
|
frequency: z.ZodEnum<{
|
|
@@ -11,11 +11,9 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
11
11
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
12
12
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
13
13
|
import "../../../shared/constants.js";
|
|
14
|
-
import "classnames";
|
|
15
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const
|
|
16
|
+
const x = o.object({
|
|
19
17
|
frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
|
|
20
18
|
anchorPayDate: o.date().optional(),
|
|
21
19
|
anchorEndOfPayPeriod: o.date().optional(),
|
|
@@ -23,10 +21,10 @@ const f = o.object({
|
|
|
23
21
|
day2: o.number().min(1).max(31).optional(),
|
|
24
22
|
customName: o.string().optional(),
|
|
25
23
|
customTwicePerMonth: o.string().optional()
|
|
26
|
-
}), [
|
|
24
|
+
}), [S, f] = t("PayScheduleContext");
|
|
27
25
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
f as PayScheduleProvider,
|
|
27
|
+
x as PayScheduleSchema,
|
|
28
|
+
S as usePaySchedule
|
|
31
29
|
};
|
|
32
30
|
//# sourceMappingURL=usePaySchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type {
|
|
1
|
+
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type {\n PaySchedule,\n PaySchedule as PayScheduleType,\n} from '@gusto/embedded-api/models/components/payschedule'\nimport type { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n isPending: boolean\n paySchedules: PaySchedule[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PaySchedulePreviewPayPeriod[]\n payPreviewLoading?: boolean\n paymentSpeedDays: number\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA+BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import { useStateTaxesForm as s } from "./context.js";
|
|
4
|
-
import "../../../../shared/constants.js";
|
|
5
|
-
import "classnames";
|
|
6
4
|
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
5
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
function
|
|
9
|
-
const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel:
|
|
6
|
+
function d() {
|
|
7
|
+
const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: e, isPending: r } = s(), o = c();
|
|
10
8
|
return /* @__PURE__ */ i(m, { children: [
|
|
11
|
-
/* @__PURE__ */ n(o.Button, { variant: "secondary", onClick:
|
|
12
|
-
/* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled:
|
|
9
|
+
/* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: e, children: t("cancelCta") }),
|
|
10
|
+
/* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: r, children: t("saveCta") })
|
|
13
11
|
] });
|
|
14
12
|
}
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
d as Actions
|
|
17
15
|
};
|
|
18
16
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as q, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import { useForm as B, FormProvider as D } from "react-hook-form";
|
|
3
3
|
import { zodResolver as K } from "@hookform/resolvers/zod";
|
|
4
4
|
import { useTaxRequirementsUpdateStateMutation as M } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
|
|
@@ -16,45 +16,45 @@ import { Flex as I } from "../../../Common/Flex/Flex.js";
|
|
|
16
16
|
import { Form as J } from "../../../Common/Form/Form.js";
|
|
17
17
|
import { componentEvents as g } from "../../../../shared/constants.js";
|
|
18
18
|
import { useBase as Q } from "../../../Base/useBase.js";
|
|
19
|
-
function he(
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
function he(n) {
|
|
20
|
+
return /* @__PURE__ */ t(Y, { ...n, children: /* @__PURE__ */ t(W, { ...n, children: n.children }) });
|
|
21
21
|
}
|
|
22
|
-
function W({ companyId:
|
|
22
|
+
function W({ companyId: n, state: c, className: k, children: y }) {
|
|
23
23
|
$("Company.StateTaxes");
|
|
24
|
-
const { onEvent: S, baseSubmitHandler: b } = Q(), { t: h } = H("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = w({ companyUuid:
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
if (!
|
|
28
|
-
const r =
|
|
29
|
-
|
|
24
|
+
const { onEvent: S, baseSubmitHandler: b } = Q(), { t: h } = H("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = w({ companyUuid: n, state: c }), l = P.taxRequirementsState, { mutateAsync: j, isPending: A } = M(), { dynamicSchema: C, defaultValues: E } = z(() => {
|
|
25
|
+
const f = {}, a = {};
|
|
26
|
+
return l.requirementSets?.forEach((o) => {
|
|
27
|
+
if (!o.key) return;
|
|
28
|
+
const r = o.key, i = {}, s = {};
|
|
29
|
+
o.requirements?.forEach((e) => {
|
|
30
30
|
if (!e.key) return;
|
|
31
|
-
const
|
|
32
|
-
e.metadata?.type === "radio" ? s[
|
|
33
|
-
let
|
|
31
|
+
const u = e.key, _ = e.metadata?.type === "tax_rate" || e.metadata?.type === "percent";
|
|
32
|
+
e.metadata?.type === "radio" ? s[u] = e.value ?? void 0 : s[u] = e.value ? String(e.value) : "";
|
|
33
|
+
let d = m.string().optional();
|
|
34
34
|
const p = e.metadata?.validation;
|
|
35
35
|
if (p && _ && p.type === "one_of") {
|
|
36
36
|
const T = p.rates;
|
|
37
|
-
|
|
37
|
+
d = m.string().optional().refine((F) => !F || T.includes(F), {
|
|
38
38
|
message: h("validations.oneOf", { values: T.join(", ") })
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
e.metadata?.type === "radio" && (
|
|
42
|
-
}), Object.keys(i).length > 0 && (
|
|
41
|
+
e.metadata?.type === "radio" && (d = m.boolean().optional()), i[u] = d;
|
|
42
|
+
}), Object.keys(i).length > 0 && (f[r] = m.object(i), a[r] = s);
|
|
43
43
|
}), {
|
|
44
|
-
dynamicSchema: m.object(
|
|
45
|
-
defaultValues:
|
|
44
|
+
dynamicSchema: m.object(f),
|
|
45
|
+
defaultValues: a
|
|
46
46
|
};
|
|
47
|
-
}, [
|
|
47
|
+
}, [l, h]), { control: R, ...v } = B({
|
|
48
48
|
resolver: K(C),
|
|
49
49
|
defaultValues: E
|
|
50
|
-
}), O = async (
|
|
51
|
-
await b(
|
|
52
|
-
const x =
|
|
53
|
-
const r =
|
|
50
|
+
}), O = async (f) => {
|
|
51
|
+
await b(f, async (a) => {
|
|
52
|
+
const x = l.requirementSets?.filter((o) => o.key && a[o.key]).map((o) => {
|
|
53
|
+
const r = o.key, i = a[r];
|
|
54
54
|
return {
|
|
55
|
-
state:
|
|
55
|
+
state: c,
|
|
56
56
|
key: r,
|
|
57
|
-
effectiveFrom:
|
|
57
|
+
effectiveFrom: o.effectiveFrom,
|
|
58
58
|
requirements: Object.entries(i).map(([s, e]) => ({
|
|
59
59
|
key: s,
|
|
60
60
|
value: String(e)
|
|
@@ -63,23 +63,23 @@ function W({ companyId: a, state: f, className: k, children: y }) {
|
|
|
63
63
|
});
|
|
64
64
|
await j({
|
|
65
65
|
request: {
|
|
66
|
-
companyUuid:
|
|
66
|
+
companyUuid: n,
|
|
67
67
|
requestBody: { requirementSets: x },
|
|
68
|
-
state:
|
|
68
|
+
state: c
|
|
69
69
|
}
|
|
70
70
|
}), S(g.COMPANY_STATE_TAX_UPDATED);
|
|
71
71
|
});
|
|
72
72
|
}, U = () => {
|
|
73
73
|
S(g.CANCEL);
|
|
74
74
|
};
|
|
75
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ t("section", { className: k, children: /* @__PURE__ */ t(D, { ...v, control: R, children: /* @__PURE__ */ t(J, { onSubmit: v.handleSubmit(O), children: /* @__PURE__ */ t(
|
|
76
76
|
G,
|
|
77
77
|
{
|
|
78
|
-
value: { stateTaxRequirements:
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
78
|
+
value: { stateTaxRequirements: l, isPending: A, state: c, handleCancel: U },
|
|
79
|
+
children: /* @__PURE__ */ t(I, { flexDirection: "column", gap: 32, children: y || /* @__PURE__ */ q(V, { children: [
|
|
80
|
+
/* @__PURE__ */ t(N, {}),
|
|
81
|
+
/* @__PURE__ */ t(L, {}),
|
|
82
|
+
/* @__PURE__ */ t(X, {})
|
|
83
83
|
] }) })
|
|
84
84
|
}
|
|
85
85
|
) }) }) });
|