@gusto/embedded-react-sdk 0.36.0 → 0.37.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 +58 -0
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -101
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -9
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -10
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -7
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -7
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -9
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -9
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +41 -38
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +14 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -7
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +38 -36
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -7
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -7
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +53 -53
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -7
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +31 -31
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +18 -15
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +69 -69
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +2 -1
- package/dist/components/Payroll/helpers.js +98 -87
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +151 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +114 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +71 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +13 -13
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +279 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +16 -16
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldsMetadata as c } from "../useFieldsMetadata.js";
|
|
3
|
+
import { useFieldErrorMessage as F } from "../useFieldErrorMessage.js";
|
|
4
|
+
import { getFieldWithOptions as M } from "../getFieldWithOptions.js";
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import { RadioGroupField as R } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
|
+
import "react-i18next";
|
|
9
|
+
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import "react";
|
|
11
|
+
function E({
|
|
12
|
+
name: i,
|
|
13
|
+
label: e,
|
|
14
|
+
description: s,
|
|
15
|
+
validationMessages: a,
|
|
16
|
+
getOptionLabel: t,
|
|
17
|
+
FieldComponent: p
|
|
18
|
+
}) {
|
|
19
|
+
const d = c(), o = M(d, i), m = F(i, a), r = o?.options ?? [], l = t && o?.entries ? o.entries.map((n, u) => ({
|
|
20
|
+
value: r[u]?.value ?? "",
|
|
21
|
+
label: t(n)
|
|
22
|
+
})) : r;
|
|
23
|
+
return /* @__PURE__ */ f(
|
|
24
|
+
R,
|
|
25
|
+
{
|
|
26
|
+
name: i,
|
|
27
|
+
label: e,
|
|
28
|
+
description: s,
|
|
29
|
+
errorMessage: m,
|
|
30
|
+
isRequired: o?.isRequired,
|
|
31
|
+
isDisabled: o?.isDisabled,
|
|
32
|
+
options: l,
|
|
33
|
+
FieldComponent: p
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
E as RadioGroupHookField
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=RadioGroupHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroupHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { BaseFieldProps, ValidationMessages } from '../types'\nimport { useFieldsMetadata } from '../useFieldsMetadata'\nimport { useFieldErrorMessage } from '../useFieldErrorMessage'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport { RadioGroupField } from '@/components/Common'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\n\nexport interface RadioGroupHookFieldProps<\n TErrorCode extends string = never,\n TEntry = unknown,\n> extends BaseFieldProps {\n name: string\n validationMessages?: ValidationMessages<TErrorCode>\n getOptionLabel?: (entry: TEntry) => string\n FieldComponent?: ComponentType<RadioGroupProps>\n}\n\nexport function RadioGroupHookField<TErrorCode extends string, TEntry = unknown>({\n name,\n label,\n description,\n validationMessages,\n getOptionLabel,\n FieldComponent,\n}: RadioGroupHookFieldProps<TErrorCode, TEntry>) {\n const metadata = useFieldsMetadata()\n const fieldMetadata = getFieldWithOptions<TEntry>(metadata, name)\n const errorMessage = useFieldErrorMessage(name, validationMessages)\n\n const defaultOptions = fieldMetadata?.options ?? []\n const options =\n getOptionLabel && fieldMetadata?.entries\n ? fieldMetadata.entries.map((entry, index) => ({\n value: defaultOptions[index]?.value ?? '',\n label: getOptionLabel(entry),\n }))\n : defaultOptions\n\n return (\n <RadioGroupField\n name={name}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n options={options}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["RadioGroupHookField","name","label","description","validationMessages","getOptionLabel","FieldComponent","metadata","useFieldsMetadata","fieldMetadata","getFieldWithOptions","errorMessage","useFieldErrorMessage","defaultOptions","options","entry","index","jsx","RadioGroupField"],"mappings":";;;;;;;;;;AAkBO,SAASA,EAAiE;AAAA,EAC/E,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAAiD;AAC/C,QAAMC,IAAWC,EAAA,GACXC,IAAgBC,EAA4BH,GAAUN,CAAI,GAC1DU,IAAeC,EAAqBX,GAAMG,CAAkB,GAE5DS,IAAiBJ,GAAe,WAAW,CAAA,GAC3CK,IACJT,KAAkBI,GAAe,UAC7BA,EAAc,QAAQ,IAAI,CAACM,GAAOC,OAAW;AAAA,IAC3C,OAAOH,EAAeG,CAAK,GAAG,SAAS;AAAA,IACvC,OAAOX,EAAeU,CAAK;AAAA,EAAA,EAC3B,IACFF;AAEN,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAjB;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,cAAAQ;AAAA,MACA,YAAYF,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,SAAAK;AAAA,MACA,gBAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages } from '../types';
|
|
3
|
+
import { SelectProps } from '../../../Common/UI/Select/SelectTypes';
|
|
4
|
+
export interface SelectHookFieldProps<TErrorCode extends string = never, TEntry = unknown> extends BaseFieldProps {
|
|
5
|
+
name: string;
|
|
6
|
+
validationMessages?: ValidationMessages<TErrorCode>;
|
|
7
|
+
getOptionLabel?: (entry: TEntry) => string;
|
|
8
|
+
FieldComponent?: ComponentType<SelectProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare function SelectHookField<TErrorCode extends string, TEntry = unknown>({ name, label, description, validationMessages, getOptionLabel, FieldComponent, }: SelectHookFieldProps<TErrorCode, TEntry>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldsMetadata as f } from "../useFieldsMetadata.js";
|
|
3
|
+
import { useFieldErrorMessage as F } from "../useFieldErrorMessage.js";
|
|
4
|
+
import { getFieldWithOptions as M } from "../getFieldWithOptions.js";
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import { SelectField as b } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
11
|
+
function E({
|
|
12
|
+
name: t,
|
|
13
|
+
label: r,
|
|
14
|
+
description: s,
|
|
15
|
+
validationMessages: a,
|
|
16
|
+
getOptionLabel: i,
|
|
17
|
+
FieldComponent: m
|
|
18
|
+
}) {
|
|
19
|
+
const p = f(), e = M(p, t), d = F(t, a), o = e?.options ?? [], l = i && e?.entries ? e.entries.map((n, u) => ({
|
|
20
|
+
value: o[u]?.value ?? "",
|
|
21
|
+
label: i(n)
|
|
22
|
+
})) : o;
|
|
23
|
+
return /* @__PURE__ */ c(
|
|
24
|
+
b,
|
|
25
|
+
{
|
|
26
|
+
name: t,
|
|
27
|
+
label: r,
|
|
28
|
+
description: s,
|
|
29
|
+
errorMessage: d,
|
|
30
|
+
isRequired: e?.isRequired,
|
|
31
|
+
isDisabled: e?.isDisabled,
|
|
32
|
+
options: l,
|
|
33
|
+
FieldComponent: m
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
E as SelectHookField
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=SelectHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/SelectHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { BaseFieldProps, ValidationMessages } from '../types'\nimport { useFieldsMetadata } from '../useFieldsMetadata'\nimport { useFieldErrorMessage } from '../useFieldErrorMessage'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport { SelectField } from '@/components/Common'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\n\nexport interface SelectHookFieldProps<\n TErrorCode extends string = never,\n TEntry = unknown,\n> extends BaseFieldProps {\n name: string\n validationMessages?: ValidationMessages<TErrorCode>\n getOptionLabel?: (entry: TEntry) => string\n FieldComponent?: ComponentType<SelectProps>\n}\n\nexport function SelectHookField<TErrorCode extends string, TEntry = unknown>({\n name,\n label,\n description,\n validationMessages,\n getOptionLabel,\n FieldComponent,\n}: SelectHookFieldProps<TErrorCode, TEntry>) {\n const metadata = useFieldsMetadata()\n const fieldMetadata = getFieldWithOptions<TEntry>(metadata, name)\n const errorMessage = useFieldErrorMessage(name, validationMessages)\n\n const defaultOptions = fieldMetadata?.options ?? []\n const options =\n getOptionLabel && fieldMetadata?.entries\n ? fieldMetadata.entries.map((entry, index) => ({\n value: defaultOptions[index]?.value ?? '',\n label: getOptionLabel(entry),\n }))\n : defaultOptions\n\n return (\n <SelectField\n name={name}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n options={options}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["SelectHookField","name","label","description","validationMessages","getOptionLabel","FieldComponent","metadata","useFieldsMetadata","fieldMetadata","getFieldWithOptions","errorMessage","useFieldErrorMessage","defaultOptions","options","entry","index","jsx","SelectField"],"mappings":";;;;;;;;;;AAkBO,SAASA,EAA6D;AAAA,EAC3E,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAA6C;AAC3C,QAAMC,IAAWC,EAAA,GACXC,IAAgBC,EAA4BH,GAAUN,CAAI,GAC1DU,IAAeC,EAAqBX,GAAMG,CAAkB,GAE5DS,IAAiBJ,GAAe,WAAW,CAAA,GAC3CK,IACJT,KAAkBI,GAAe,UAC7BA,EAAc,QAAQ,IAAI,CAACM,GAAOC,OAAW;AAAA,IAC3C,OAAOH,EAAeG,CAAK,GAAG,SAAS;AAAA,IACvC,OAAOX,EAAeU,CAAK;AAAA,EAAA,EAC3B,IACFF;AAEN,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAjB;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,cAAAQ;AAAA,MACA,YAAYF,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,SAAAK;AAAA,MACA,gBAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages } from '../types';
|
|
3
|
+
import { SwitchProps } from '../../../Common/UI/Switch/SwitchTypes';
|
|
4
|
+
export interface SwitchHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {
|
|
5
|
+
name: string;
|
|
6
|
+
validationMessages?: ValidationMessages<TErrorCode>;
|
|
7
|
+
FieldComponent?: ComponentType<SwitchProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare function SwitchHookField<TErrorCode extends string>({ name, label, description, validationMessages, FieldComponent, }: SwitchHookFieldProps<TErrorCode>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldsMetadata as m } from "../useFieldsMetadata.js";
|
|
3
|
+
import { useFieldErrorMessage as p } from "../useFieldErrorMessage.js";
|
|
4
|
+
import "../../../../shared/constants.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { SwitchField as l } from "../../../Common/Fields/SwitchField/SwitchField.js";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import "react";
|
|
10
|
+
function w({
|
|
11
|
+
name: i,
|
|
12
|
+
label: r,
|
|
13
|
+
description: e,
|
|
14
|
+
validationMessages: o,
|
|
15
|
+
FieldComponent: s
|
|
16
|
+
}) {
|
|
17
|
+
const t = m()[i], a = p(i, o);
|
|
18
|
+
return /* @__PURE__ */ d(
|
|
19
|
+
l,
|
|
20
|
+
{
|
|
21
|
+
name: i,
|
|
22
|
+
label: r,
|
|
23
|
+
description: e,
|
|
24
|
+
errorMessage: a,
|
|
25
|
+
isRequired: t?.isRequired,
|
|
26
|
+
isDisabled: t?.isDisabled,
|
|
27
|
+
FieldComponent: s
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
w as SwitchHookField
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=SwitchHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/SwitchHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { BaseFieldProps, ValidationMessages } from '../types'\nimport { useFieldsMetadata } from '../useFieldsMetadata'\nimport { useFieldErrorMessage } from '../useFieldErrorMessage'\nimport { SwitchField } from '@/components/Common'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\n\nexport interface SwitchHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<SwitchProps>\n}\n\nexport function SwitchHookField<TErrorCode extends string>({\n name,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: SwitchHookFieldProps<TErrorCode>) {\n const metadata = useFieldsMetadata()\n const fieldMetadata = metadata[name]\n const errorMessage = useFieldErrorMessage(name, validationMessages)\n\n return (\n <SwitchField\n name={name}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["SwitchHookField","name","label","description","validationMessages","FieldComponent","fieldMetadata","useFieldsMetadata","errorMessage","useFieldErrorMessage","jsx","SwitchField"],"mappings":";;;;;;;;;AAaO,SAASA,EAA2C;AAAA,EACzD,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAqC;AAEnC,QAAMC,IADWC,EAAA,EACcN,CAAI,GAC7BO,IAAeC,EAAqBR,GAAMG,CAAkB;AAElE,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAV;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,cAAAK;AAAA,MACA,YAAYF,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,gBAAAD;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages } from '../types';
|
|
3
|
+
import { TextInputProps } from '../../../Common/UI/TextInput/TextInputTypes';
|
|
4
|
+
export interface TextInputHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {
|
|
5
|
+
name: string;
|
|
6
|
+
validationMessages?: ValidationMessages<TErrorCode>;
|
|
7
|
+
transform?: (value: string) => string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
FieldComponent?: ComponentType<TextInputProps>;
|
|
10
|
+
}
|
|
11
|
+
export declare function TextInputHookField<TErrorCode extends string>({ name, label, description, validationMessages, transform, placeholder, FieldComponent, }: TextInputHookFieldProps<TErrorCode>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldsMetadata as u } from "../useFieldsMetadata.js";
|
|
3
|
+
import { useFieldErrorMessage as l } from "../useFieldErrorMessage.js";
|
|
4
|
+
import "../../../../shared/constants.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { TextInputField as f } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import "react";
|
|
10
|
+
function R({
|
|
11
|
+
name: t,
|
|
12
|
+
label: r,
|
|
13
|
+
description: i,
|
|
14
|
+
validationMessages: o,
|
|
15
|
+
transform: s,
|
|
16
|
+
placeholder: a,
|
|
17
|
+
FieldComponent: d
|
|
18
|
+
}) {
|
|
19
|
+
const e = u()[t], m = l(t, o);
|
|
20
|
+
return /* @__PURE__ */ p(
|
|
21
|
+
f,
|
|
22
|
+
{
|
|
23
|
+
name: t,
|
|
24
|
+
label: r,
|
|
25
|
+
description: i,
|
|
26
|
+
errorMessage: m,
|
|
27
|
+
isRequired: e?.isRequired,
|
|
28
|
+
isDisabled: e?.isDisabled,
|
|
29
|
+
transform: s,
|
|
30
|
+
placeholder: a,
|
|
31
|
+
FieldComponent: d
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
R as TextInputHookField
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TextInputHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/TextInputHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { BaseFieldProps, ValidationMessages } from '../types'\nimport { useFieldsMetadata } from '../useFieldsMetadata'\nimport { useFieldErrorMessage } from '../useFieldErrorMessage'\nimport { TextInputField } from '@/components/Common'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\n\nexport interface TextInputHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n validationMessages?: ValidationMessages<TErrorCode>\n transform?: (value: string) => string\n placeholder?: string\n FieldComponent?: ComponentType<TextInputProps>\n}\n\nexport function TextInputHookField<TErrorCode extends string>({\n name,\n label,\n description,\n validationMessages,\n transform,\n placeholder,\n FieldComponent,\n}: TextInputHookFieldProps<TErrorCode>) {\n const metadata = useFieldsMetadata()\n const fieldMetadata = metadata[name]\n const errorMessage = useFieldErrorMessage(name, validationMessages)\n\n return (\n <TextInputField\n name={name}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n transform={transform}\n placeholder={placeholder}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["TextInputHookField","name","label","description","validationMessages","transform","placeholder","FieldComponent","fieldMetadata","useFieldsMetadata","errorMessage","useFieldErrorMessage","jsx","TextInputField"],"mappings":";;;;;;;;;AAeO,SAASA,EAA8C;AAAA,EAC5D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,GAAwC;AAEtC,QAAMC,IADWC,EAAA,EACcR,CAAI,GAC7BS,IAAeC,EAAqBV,GAAMG,CAAkB;AAElE,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,cAAAO;AAAA,MACA,YAAYF,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,WAAAH;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { TextInputHookField, type TextInputHookFieldProps } from './TextInputHookField';
|
|
3
|
+
export { SelectHookField, type SelectHookFieldProps } from './SelectHookField';
|
|
4
|
+
export { CheckboxHookField, type CheckboxHookFieldProps } from './CheckboxHookField';
|
|
5
|
+
export { NumberInputHookField, type NumberInputHookFieldProps } from './NumberInputHookField';
|
|
6
|
+
export { DatePickerHookField, type DatePickerHookFieldProps } from './DatePickerHookField';
|
|
7
|
+
export { RadioGroupHookField, type RadioGroupHookFieldProps } from './RadioGroupHookField';
|
|
8
|
+
export { SwitchHookField, type SwitchHookFieldProps } from './SwitchHookField';
|
|
9
|
+
export type { TextInputProps } from '../../../Common/UI/TextInput/TextInputTypes';
|
|
10
|
+
export type { SelectProps, SelectOption } from '../../../Common/UI/Select/SelectTypes';
|
|
11
|
+
export type { CheckboxProps } from '../../../Common/UI/Checkbox/CheckboxTypes';
|
|
12
|
+
export type { NumberInputProps } from '../../../Common/UI/NumberInput/NumberInputTypes';
|
|
13
|
+
export type { DatePickerProps } from '../../../Common/UI/DatePicker/DatePickerTypes';
|
|
14
|
+
export type { RadioGroupProps, RadioGroupOption, } from '../../../Common/UI/RadioGroup/RadioGroupTypes';
|
|
15
|
+
export type { SwitchProps } from '../../../Common/UI/Switch/SwitchTypes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFieldWithOptions.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/getFieldWithOptions.ts"],"sourcesContent":["import type { FieldMetadataWithOptions, FieldsMetadata } from './types'\n\nexport function getFieldWithOptions<TEntry = unknown>(\n metadata: FieldsMetadata,\n name: string,\n): FieldMetadataWithOptions<TEntry> | undefined {\n const field = metadata[name]\n if (field && 'options' in field) return field as FieldMetadataWithOptions<TEntry>\n return undefined\n}\n"],"names":["getFieldWithOptions","metadata","name","field"],"mappings":"AAEO,SAASA,EACdC,GACAC,GAC8C;AAC9C,QAAMC,IAAQF,EAASC,CAAI;AAC3B,MAAIC,KAAS,aAAaA,EAAO,QAAOA;AAE1C;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { ZodTypeAny } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a typed getter that returns the current form values parsed through
|
|
5
|
+
* the Zod schema. The result matches what `handleSubmit` would provide to its
|
|
6
|
+
* valid callback — all preprocessing transforms (e.g. string→boolean coercion)
|
|
7
|
+
* are applied.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` when the current form state does not satisfy the schema
|
|
10
|
+
* (e.g. required fields are empty, cross-field rules fail). This is safe to call
|
|
11
|
+
* at any time — it never throws.
|
|
12
|
+
*
|
|
13
|
+
* **Side effects:** None. `getValues()` is a synchronous read from react-hook-form's
|
|
14
|
+
* internal store — it does not trigger re-renders, mutate form state, or update
|
|
15
|
+
* validation errors. `safeParse()` is a pure validation/transform that creates
|
|
16
|
+
* a new object without mutating the input.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createGetFormSubmissionValues<TFormData extends FieldValues, TFormOutputs>(formMethods: UseFormReturn<TFormData, unknown, TFormOutputs>, schema: ZodTypeAny): () => TFormOutputs | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFormSubmissionValues.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/getFormSubmissionValues.ts"],"sourcesContent":["import type { FieldValues, UseFormReturn } from 'react-hook-form'\nimport type { ZodTypeAny } from 'zod'\n\n/**\n * Creates a typed getter that returns the current form values parsed through\n * the Zod schema. The result matches what `handleSubmit` would provide to its\n * valid callback — all preprocessing transforms (e.g. string→boolean coercion)\n * are applied.\n *\n * Returns `undefined` when the current form state does not satisfy the schema\n * (e.g. required fields are empty, cross-field rules fail). This is safe to call\n * at any time — it never throws.\n *\n * **Side effects:** None. `getValues()` is a synchronous read from react-hook-form's\n * internal store — it does not trigger re-renders, mutate form state, or update\n * validation errors. `safeParse()` is a pure validation/transform that creates\n * a new object without mutating the input.\n */\nexport function createGetFormSubmissionValues<TFormData extends FieldValues, TFormOutputs>(\n formMethods: UseFormReturn<TFormData, unknown, TFormOutputs>,\n schema: ZodTypeAny,\n): () => TFormOutputs | undefined {\n return () => {\n const result = schema.safeParse(formMethods.getValues())\n return result.success ? (result.data as TFormOutputs) : undefined\n }\n}\n"],"names":["createGetFormSubmissionValues","formMethods","schema","result"],"mappings":"AAkBO,SAASA,EACdC,GACAC,GACgC;AAChC,SAAO,MAAM;AACX,UAAMC,IAASD,EAAO,UAAUD,EAAY,WAAW;AACvD,WAAOE,EAAO,UAAWA,EAAO,OAAwB;AAAA,EAC1D;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export type { FieldMetadata, FieldMetadataWithOptions, FieldsMetadata, ValidationMessages, BaseFieldProps, HookFieldProps, } from './types';
|
|
3
|
+
export { withOptions } from './withOptions';
|
|
4
|
+
export type { FormFieldsMetadataContextValue } from './FormFieldsMetadataContext';
|
|
5
|
+
export { FormFieldsMetadataProvider } from './FormFieldsMetadataProvider';
|
|
6
|
+
export { SDKFormProvider } from './SDKFormProvider';
|
|
7
|
+
export { useFieldsMetadata } from './useFieldsMetadata';
|
|
8
|
+
export { useFieldErrorMessage } from './useFieldErrorMessage';
|
|
9
|
+
export { deriveFieldsMetadata } from './deriveFieldsMetadata';
|
|
10
|
+
export { composeFormSchema } from './composeFormSchema';
|
|
11
|
+
export { resolveRequiredFields, filterRequiredFields, type RequiredFields, } from './resolveRequiredFields';
|
|
12
|
+
export { composeSubmitHandler } from './composeSubmitHandler';
|
|
13
|
+
export { createGetFormSubmissionValues } from './getFormSubmissionValues';
|
|
14
|
+
export { TextInputHookField, type TextInputHookFieldProps, SelectHookField, type SelectHookFieldProps, CheckboxHookField, type CheckboxHookFieldProps, NumberInputHookField, type NumberInputHookFieldProps, DatePickerHookField, type DatePickerHookFieldProps, RadioGroupHookField, type RadioGroupHookFieldProps, type TextInputProps, type SelectProps, type SelectOption, type CheckboxProps, type NumberInputProps, type DatePickerProps, type RadioGroupProps, type RadioGroupOption, SwitchHookField, type SwitchHookFieldProps, type SwitchProps, } from './fields';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type RequiredFields<T> = T[] | {
|
|
2
|
+
create?: T[];
|
|
3
|
+
update?: T[];
|
|
4
|
+
};
|
|
5
|
+
export declare function resolveRequiredFields<T>(requiredFields: RequiredFields<T> | undefined, mode: 'create' | 'update'): T[];
|
|
6
|
+
export declare function filterRequiredFields<T>(requiredFields: RequiredFields<T> | undefined, exclude: T): RequiredFields<T> | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function f(t, a) {
|
|
2
|
+
return t ? Array.isArray(t) ? t : (a === "create" ? t.create : t.update) ?? [] : [];
|
|
3
|
+
}
|
|
4
|
+
function n(t, a) {
|
|
5
|
+
return t && (Array.isArray(t) ? t.filter((r) => r !== a) : {
|
|
6
|
+
...t.create && { create: t.create.filter((r) => r !== a) },
|
|
7
|
+
...t.update && { update: t.update.filter((r) => r !== a) }
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
n as filterRequiredFields,
|
|
12
|
+
f as resolveRequiredFields
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=resolveRequiredFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRequiredFields.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/resolveRequiredFields.ts"],"sourcesContent":["export type RequiredFields<T> = T[] | { create?: T[]; update?: T[] }\n\nexport function resolveRequiredFields<T>(\n requiredFields: RequiredFields<T> | undefined,\n mode: 'create' | 'update',\n): T[] {\n if (!requiredFields) return []\n if (Array.isArray(requiredFields)) return requiredFields\n return (mode === 'create' ? requiredFields.create : requiredFields.update) ?? []\n}\n\nexport function filterRequiredFields<T>(\n requiredFields: RequiredFields<T> | undefined,\n exclude: T,\n): RequiredFields<T> | undefined {\n if (!requiredFields) return requiredFields\n if (Array.isArray(requiredFields)) return requiredFields.filter(f => f !== exclude)\n return {\n ...(requiredFields.create && { create: requiredFields.create.filter(f => f !== exclude) }),\n ...(requiredFields.update && { update: requiredFields.update.filter(f => f !== exclude) }),\n }\n}\n"],"names":["resolveRequiredFields","requiredFields","mode","filterRequiredFields","exclude","f"],"mappings":"AAEO,SAASA,EACdC,GACAC,GACK;AACL,SAAKD,IACD,MAAM,QAAQA,CAAc,IAAUA,KAClCC,MAAS,WAAWD,EAAe,SAASA,EAAe,WAAW,CAAA,IAFlD,CAAA;AAG9B;AAEO,SAASE,EACdF,GACAG,GAC+B;AAC/B,SAAKH,MACD,MAAM,QAAQA,CAAc,IAAUA,EAAe,OAAO,CAAAI,MAAKA,MAAMD,CAAO,IAC3E;AAAA,IACL,GAAIH,EAAe,UAAU,EAAE,QAAQA,EAAe,OAAO,OAAO,CAAAI,MAAKA,MAAMD,CAAO,EAAA;AAAA,IACtF,GAAIH,EAAe,UAAU,EAAE,QAAQA,EAAe,OAAO,OAAO,CAAAI,MAAKA,MAAMD,CAAO,EAAA;AAAA,EAAE;AAE5F;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FieldMetadata {
|
|
3
|
+
name: string;
|
|
4
|
+
isRequired?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
hasRedactedValue?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldMetadataWithOptions<TEntry = unknown> extends FieldMetadata {
|
|
9
|
+
options: Array<{
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}>;
|
|
13
|
+
entries?: TEntry[];
|
|
14
|
+
}
|
|
15
|
+
export type FieldsMetadata = {
|
|
16
|
+
[key: string]: FieldMetadata | FieldMetadataWithOptions;
|
|
17
|
+
};
|
|
18
|
+
/** Maps every error code a schema field can produce to a partner-supplied display string. */
|
|
19
|
+
export type ValidationMessages<TErrorCode extends string> = Record<TErrorCode, string>;
|
|
20
|
+
export interface BaseFieldProps {
|
|
21
|
+
label: string;
|
|
22
|
+
description?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/** Strips `name` from a HookField props type for domain-specific field components that bind `name` internally. */
|
|
25
|
+
export type HookFieldProps<TProps extends {
|
|
26
|
+
name: string;
|
|
27
|
+
}> = Omit<TProps, 'name'>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useFormContext as i } from "react-hook-form";
|
|
2
|
+
import { useFormFieldsMetadataContext as m } from "./FormFieldsMetadataContext.js";
|
|
3
|
+
function E(o, e) {
|
|
4
|
+
const {
|
|
5
|
+
formState: { errors: t }
|
|
6
|
+
} = i(), { errors: n } = m(), r = t[o]?.message;
|
|
7
|
+
if (r && e?.[r])
|
|
8
|
+
return e[r];
|
|
9
|
+
for (const f of n) {
|
|
10
|
+
const s = f.fieldErrors.find((d) => d.field === o);
|
|
11
|
+
if (s?.message) return s.message;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
E as useFieldErrorMessage
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useFieldErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldErrorMessage.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/useFieldErrorMessage.ts"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\nimport type { ValidationMessages } from './types'\n\nexport function useFieldErrorMessage<TErrorCode extends string>(\n fieldName: string,\n validationMessages?: ValidationMessages<TErrorCode>,\n): string | undefined {\n const {\n formState: { errors },\n } = useFormContext()\n const { errors: sdkErrors } = useFormFieldsMetadataContext()\n\n const errorCode = errors[fieldName]?.message as TErrorCode | undefined\n if (errorCode && validationMessages?.[errorCode]) {\n return validationMessages[errorCode]\n }\n\n for (const sdkError of sdkErrors) {\n const fieldError = sdkError.fieldErrors.find(fe => fe.field === fieldName)\n if (fieldError?.message) return fieldError.message\n }\n\n return undefined\n}\n"],"names":["useFieldErrorMessage","fieldName","validationMessages","errors","useFormContext","sdkErrors","useFormFieldsMetadataContext","errorCode","sdkError","fieldError","fe"],"mappings":";;AAIO,SAASA,EACdC,GACAC,GACoB;AACpB,QAAM;AAAA,IACJ,WAAW,EAAE,QAAAC,EAAA;AAAA,EAAO,IAClBC,EAAA,GACE,EAAE,QAAQC,EAAA,IAAcC,EAAA,GAExBC,IAAYJ,EAAOF,CAAS,GAAG;AACrC,MAAIM,KAAaL,IAAqBK,CAAS;AAC7C,WAAOL,EAAmBK,CAAS;AAGrC,aAAWC,KAAYH,GAAW;AAChC,UAAMI,IAAaD,EAAS,YAAY,KAAK,CAAAE,MAAMA,EAAG,UAAUT,CAAS;AACzE,QAAIQ,GAAY,QAAS,QAAOA,EAAW;AAAA,EAC7C;AAGF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldsMetadata.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/useFieldsMetadata.ts"],"sourcesContent":["import type { FieldMetadata, FieldMetadataWithOptions, FieldsMetadata } from './types'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\n\nexport function useFieldsMetadata<\n TFieldsMetadata extends {\n [K in keyof TFieldsMetadata]: FieldMetadata | FieldMetadataWithOptions\n } = FieldsMetadata,\n>(): TFieldsMetadata {\n const { metadata } = useFormFieldsMetadataContext()\n return metadata as TFieldsMetadata\n}\n"],"names":["useFieldsMetadata","metadata","useFormFieldsMetadataContext"],"mappings":";AAGO,SAASA,IAIK;AACnB,QAAM,EAAE,UAAAC,EAAA,IAAaC,EAAA;AACrB,SAAOD;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withOptions.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/withOptions.ts"],"sourcesContent":["import type { FieldMetadata, FieldMetadataWithOptions } from './types'\n\nexport function withOptions<TEntry = unknown>(\n base: FieldMetadata,\n options: Array<{ label: string; value: string }>,\n entries?: TEntry[],\n): FieldMetadataWithOptions<TEntry> {\n if (entries !== undefined) {\n return { ...base, options, entries }\n }\n return { ...base, options }\n}\n"],"names":["withOptions","base","options","entries"],"mappings":"AAEO,SAASA,EACdC,GACAC,GACAC,GACkC;AAClC,SAAIA,MAAY,SACP,EAAE,GAAGF,GAAM,SAAAC,GAAS,SAAAC,EAAA,IAEtB,EAAE,GAAGF,GAAM,SAAAC,EAAA;AACpB;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseCompensationFormProps } from './useCompensationForm';
|
|
2
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
3
|
+
export interface CompensationFormProps extends UseCompensationFormProps, Omit<BaseComponentInterface, 'defaultValues'> {
|
|
4
|
+
}
|
|
5
|
+
export declare function CompensationForm({ FallbackComponent, ...props }: CompensationFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as R, Trans as C } from "react-i18next";
|
|
3
|
+
import { SDKFormProvider as D } from "../../form/SDKFormProvider.js";
|
|
4
|
+
import { useCompensationForm as f } from "./useCompensationForm.js";
|
|
5
|
+
import { useComponentContext as b } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { BaseBoundaries as L, BaseLayout as d } from "../../../Base/Base.js";
|
|
7
|
+
import "../../../Base/useBase.js";
|
|
8
|
+
import { Form as M } from "../../../Common/Form/Form.js";
|
|
9
|
+
import { FLSA_OVERTIME_SALARY_LIMIT as U, componentEvents as r } from "../../../../shared/constants.js";
|
|
10
|
+
import "classnames";
|
|
11
|
+
import { ActionsLayout as T } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import { useI18n as I, useComponentDictionary as S } from "../../../../i18n/I18n.js";
|
|
14
|
+
import g from "../../../../hooks/useNumberFormatter.js";
|
|
15
|
+
function W({ onEvent: n, dictionary: l, ...E }) {
|
|
16
|
+
I("UNSTABLE.CompensationForm"), S("UNSTABLE.CompensationForm", l);
|
|
17
|
+
const { t: e } = R("UNSTABLE.CompensationForm"), m = b(), c = g("currency"), a = f(E);
|
|
18
|
+
if (a.isLoading)
|
|
19
|
+
return /* @__PURE__ */ t(d, { isLoading: !0, error: a.errorHandling.errors });
|
|
20
|
+
const { Fields: i } = a.form, p = async () => {
|
|
21
|
+
const o = await a.actions.onSubmit({
|
|
22
|
+
onJobCreated: (s) => {
|
|
23
|
+
n(r.EMPLOYEE_JOB_CREATED, s);
|
|
24
|
+
},
|
|
25
|
+
onJobUpdated: (s) => {
|
|
26
|
+
n(r.EMPLOYEE_JOB_UPDATED, s);
|
|
27
|
+
},
|
|
28
|
+
onCompensationUpdated: (s) => {
|
|
29
|
+
n(r.EMPLOYEE_COMPENSATION_UPDATED, s);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
o && n(r.EMPLOYEE_COMPENSATION_DONE, o.data);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ t(d, { error: a.errorHandling.errors, children: /* @__PURE__ */ t(D, { formHookResult: a, children: /* @__PURE__ */ u(
|
|
35
|
+
M,
|
|
36
|
+
{
|
|
37
|
+
onSubmit: (o) => {
|
|
38
|
+
o.preventDefault(), p();
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ t(m.Heading, { as: "h2", children: a.status.mode === "create" ? e("addTitle") : e("editTitle") }),
|
|
42
|
+
i.StartDate && /* @__PURE__ */ t(
|
|
43
|
+
i.StartDate,
|
|
44
|
+
{
|
|
45
|
+
label: e("startDateLabel"),
|
|
46
|
+
validationMessages: {
|
|
47
|
+
REQUIRED: e("fieldValidations.startDate.REQUIRED")
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ t(
|
|
52
|
+
i.JobTitle,
|
|
53
|
+
{
|
|
54
|
+
label: e("jobTitle"),
|
|
55
|
+
validationMessages: {
|
|
56
|
+
REQUIRED: e("fieldValidations.jobTitle.REQUIRED")
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
i.FlsaStatus && /* @__PURE__ */ t(
|
|
61
|
+
i.FlsaStatus,
|
|
62
|
+
{
|
|
63
|
+
label: e("employeeClassification"),
|
|
64
|
+
description: /* @__PURE__ */ t(
|
|
65
|
+
C,
|
|
66
|
+
{
|
|
67
|
+
t: e,
|
|
68
|
+
i18nKey: "classificationLink",
|
|
69
|
+
components: {
|
|
70
|
+
ClassificationLink: /* @__PURE__ */ t(m.Link, {})
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
getOptionLabel: (o) => e(`flsaStatusLabels.${o}`, o),
|
|
75
|
+
validationMessages: {
|
|
76
|
+
REQUIRED: e("fieldValidations.flsaStatus.REQUIRED")
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ t(
|
|
81
|
+
i.Rate,
|
|
82
|
+
{
|
|
83
|
+
label: e("amount"),
|
|
84
|
+
validationMessages: {
|
|
85
|
+
REQUIRED: e("fieldValidations.rate.REQUIRED"),
|
|
86
|
+
RATE_MINIMUM: e("fieldValidations.rate.RATE_MINIMUM"),
|
|
87
|
+
RATE_EXEMPT_THRESHOLD: e("fieldValidations.rate.RATE_EXEMPT_THRESHOLD", {
|
|
88
|
+
limit: c(U)
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ t(
|
|
94
|
+
i.PaymentUnit,
|
|
95
|
+
{
|
|
96
|
+
label: e("paymentUnitLabel"),
|
|
97
|
+
description: e("paymentUnitDescription"),
|
|
98
|
+
getOptionLabel: (o) => e(`paymentUnitOptions.${o}`, o),
|
|
99
|
+
validationMessages: {
|
|
100
|
+
REQUIRED: e("fieldValidations.paymentUnit.REQUIRED")
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
i.AdjustForMinimumWage && /* @__PURE__ */ t(
|
|
105
|
+
i.AdjustForMinimumWage,
|
|
106
|
+
{
|
|
107
|
+
label: e("adjustForMinimumWage"),
|
|
108
|
+
description: e("adjustForMinimumWageDescription")
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
i.MinimumWageId && /* @__PURE__ */ t(
|
|
112
|
+
i.MinimumWageId,
|
|
113
|
+
{
|
|
114
|
+
label: e("minimumWageLabel"),
|
|
115
|
+
description: e("minimumWageDescription"),
|
|
116
|
+
validationMessages: {
|
|
117
|
+
REQUIRED: e("fieldValidations.minimumWageId.REQUIRED")
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
i.TwoPercentShareholder && /* @__PURE__ */ t(i.TwoPercentShareholder, { label: e("twoPercentStakeholderLabel") }),
|
|
122
|
+
i.StateWcCovered && /* @__PURE__ */ t(
|
|
123
|
+
i.StateWcCovered,
|
|
124
|
+
{
|
|
125
|
+
label: e("stateWcCoveredLabel"),
|
|
126
|
+
description: e("stateWcCoveredDescription"),
|
|
127
|
+
getOptionLabel: (o) => e(o === "yes" ? "stateWcCoveredYes" : "stateWcCoveredNo")
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
i.StateWcClassCode && /* @__PURE__ */ t(
|
|
131
|
+
i.StateWcClassCode,
|
|
132
|
+
{
|
|
133
|
+
label: e("stateWcClassCodeLabel"),
|
|
134
|
+
description: e("stateWcClassCodeDescription"),
|
|
135
|
+
validationMessages: {
|
|
136
|
+
REQUIRED: e("fieldValidations.stateWcClassCode.REQUIRED")
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(m.Button, { type: "submit", isLoading: a.status.isPending, children: e("saveNewJobCta") }) })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
) }) });
|
|
144
|
+
}
|
|
145
|
+
function J({ FallbackComponent: n, ...l }) {
|
|
146
|
+
return /* @__PURE__ */ t(L, { componentName: "UNSTABLE.CompensationForm", FallbackComponent: n, children: /* @__PURE__ */ t(W, { ...l }) });
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
J as CompensationForm
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=CompensationForm.js.map
|