@gusto/embedded-react-sdk 0.45.0 → 0.46.2
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 +64 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +51 -50
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +1 -0
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +8 -1
- package/dist/components/Common/DataView/useDataView.js +20 -17
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +23 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +20 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +22 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +85 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +6 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +212 -187
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +86 -68
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +8 -4
- package/dist/components/Employee/Dashboard/DashboardComponents.js +147 -93
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +304 -264
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +10 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
- package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +152 -142
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +53 -55
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +20 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
- package/dist/components/Employee/exports/employeeManagement.js +18 -16
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/index.d.ts +2 -0
- package/dist/components/Employee/index.js +32 -30
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/FlowHeader.js +34 -31
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +12 -0
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +68 -56
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +21 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +4 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +20 -18
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +45 -11
- package/docs/reference/endpoint-inventory.json +24 -8
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import O from "classnames";
|
|
3
|
+
import { useTranslation as N } from "react-i18next";
|
|
4
|
+
import { useJobForm as S } from "../../shared/useJobForm/useJobForm.js";
|
|
5
|
+
import { useCompensationForm as T } from "../../shared/useCompensationForm/useCompensationForm.js";
|
|
6
|
+
import { ManagementCompensationFormBody as v } from "../ManagementCompensationFormBody.js";
|
|
7
|
+
import L from "./EditPendingCompensation.module.scss.js";
|
|
8
|
+
import { BaseBoundaries as M, BaseLayout as f } from "../../../../Base/Base.js";
|
|
9
|
+
import "../../../../Base/useBase.js";
|
|
10
|
+
import { Form as w } from "../../../../Common/Form/Form.js";
|
|
11
|
+
import { useComponentDictionary as R, useI18n as _ } from "../../../../../i18n/I18n.js";
|
|
12
|
+
import { composeErrorHandler as E } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
13
|
+
import { composeSubmitHandler as B } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
|
|
14
|
+
import { componentEvents as p } from "../../../../../shared/constants.js";
|
|
15
|
+
function W({ dictionary: n, ...r }) {
|
|
16
|
+
return R("Employee.Compensation", n), /* @__PURE__ */ e(M, { componentName: "Employee.Compensation.Management", children: /* @__PURE__ */ e(H, { ...r }) });
|
|
17
|
+
}
|
|
18
|
+
function H({
|
|
19
|
+
employeeId: n,
|
|
20
|
+
jobId: r,
|
|
21
|
+
compensationId: u,
|
|
22
|
+
isNewJob: h,
|
|
23
|
+
isPrimaryJob: g,
|
|
24
|
+
onCancel: C,
|
|
25
|
+
className: F,
|
|
26
|
+
onEvent: s
|
|
27
|
+
}) {
|
|
28
|
+
_("Employee.Compensation");
|
|
29
|
+
const { t: c } = N("Employee.Compensation"), i = h && g, o = S({
|
|
30
|
+
employeeId: n,
|
|
31
|
+
jobId: r,
|
|
32
|
+
withTitleField: !1,
|
|
33
|
+
withHireDateField: i,
|
|
34
|
+
// hireDate is optional by default in update mode — promote it so the form
|
|
35
|
+
// validates it and the label doesn't show "(optional)".
|
|
36
|
+
optionalFieldsToRequire: i ? { update: ["hireDate"] } : void 0,
|
|
37
|
+
shouldFocusError: !1
|
|
38
|
+
}), t = T({
|
|
39
|
+
employeeId: n,
|
|
40
|
+
jobId: r,
|
|
41
|
+
compensationId: u,
|
|
42
|
+
// Primary new job: comp date is set via jobForm's hire date on submit —
|
|
43
|
+
// hide it here to avoid showing two date fields.
|
|
44
|
+
withEffectiveDateField: !i,
|
|
45
|
+
optionalFieldsToRequire: {
|
|
46
|
+
update: i ? ["title", "flsaStatus", "rate", "paymentUnit"] : ["title", "flsaStatus", "rate", "paymentUnit", "effectiveDate"]
|
|
47
|
+
},
|
|
48
|
+
shouldFocusError: !1
|
|
49
|
+
});
|
|
50
|
+
if (o.isLoading || t.isLoading) {
|
|
51
|
+
const a = E([o, t]);
|
|
52
|
+
return /* @__PURE__ */ e(f, { isLoading: !0, error: a.errors });
|
|
53
|
+
}
|
|
54
|
+
const d = B([o, t], async () => {
|
|
55
|
+
const a = i ? o.form.hookFormInternals.formMethods.getValues("hireDate") ?? void 0 : void 0, m = await o.actions.onSubmit();
|
|
56
|
+
if (!m) return;
|
|
57
|
+
s(p.EMPLOYEE_JOB_UPDATED, m.data);
|
|
58
|
+
const b = m.data.compensations?.find(
|
|
59
|
+
(y) => y.uuid === u
|
|
60
|
+
)?.version, l = await t.actions.onSubmit({
|
|
61
|
+
...a ? { effectiveDate: a } : {},
|
|
62
|
+
compensationVersion: b
|
|
63
|
+
});
|
|
64
|
+
l && (s(p.EMPLOYEE_COMPENSATION_UPDATED, l.data), s(p.EMPLOYEE_COMPENSATION_DONE, l.data));
|
|
65
|
+
}), D = E([d]), P = o.status.isPending || t.status.isPending;
|
|
66
|
+
return /* @__PURE__ */ e("section", { className: O(L.container, F), children: /* @__PURE__ */ e(f, { error: D.errors, children: /* @__PURE__ */ e(w, { onSubmit: d.handleSubmit, children: /* @__PURE__ */ e(
|
|
67
|
+
v,
|
|
68
|
+
{
|
|
69
|
+
jobForm: o,
|
|
70
|
+
compensationForm: t,
|
|
71
|
+
title: c("management.editCompensationTitle"),
|
|
72
|
+
submitCtaLabel: c("management.saveCta"),
|
|
73
|
+
isPending: P,
|
|
74
|
+
onCancel: C
|
|
75
|
+
}
|
|
76
|
+
) }) }) });
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
W as EditPendingCompensation
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=EditPendingCompensation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditPendingCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { ManagementCompensationFormBody } from '../ManagementCompensationFormBody'\nimport styles from './EditPendingCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\nexport interface EditPendingCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n jobId: string\n /** The UUID of the pending (future-dated) compensation to update. Always required — this\n * component only operates in update mode. */\n compensationId: string\n /**\n * True when the job has no current (on-or-before-today) compensation — i.e. it hasn't\n * started yet. Drives which date field is shown and how the submit syncs hire_date.\n */\n isNewJob: boolean\n /**\n * True when this is the employee's primary job. Combined with `isNewJob`, determines\n * whether to show a Hire date field (primary) or Effective date field (secondary/change).\n */\n isPrimaryJob: boolean\n onCancel?: () => void\n /** Called with `EMPLOYEE_COMPENSATION_UPDATED` then `EMPLOYEE_COMPENSATION_DONE` on a\n * successful save. Use `EMPLOYEE_COMPENSATION_DONE` to trigger navigation. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function EditPendingCompensation({ dictionary, ...props }: EditPendingCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation.Management\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\ntype RootProps = Omit<EditPendingCompensationProps, 'dictionary'>\n\nfunction Root({\n employeeId,\n jobId,\n compensationId,\n isNewJob,\n isPrimaryJob,\n onCancel,\n className,\n onEvent,\n}: RootProps) {\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n // For a primary new job (hire date in the future, no current comp), the hire\n // date field is shown instead of the effective date field. This keeps\n // hire_date and comp effective_date in sync so the API doesn't auto-create a\n // second compensation when the initial comp moves off the hire date.\n const isPrimaryNewJob = isNewJob && isPrimaryJob\n\n const jobForm = useJobForm({\n employeeId,\n jobId,\n withTitleField: false,\n withHireDateField: isPrimaryNewJob,\n // hireDate is optional by default in update mode — promote it so the form\n // validates it and the label doesn't show \"(optional)\".\n optionalFieldsToRequire: isPrimaryNewJob ? { update: ['hireDate'] } : undefined,\n shouldFocusError: false,\n })\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n // Primary new job: comp date is set via jobForm's hire date on submit —\n // hide it here to avoid showing two date fields.\n withEffectiveDateField: !isPrimaryNewJob,\n optionalFieldsToRequire: {\n update: isPrimaryNewJob\n ? ['title', 'flsaStatus', 'rate', 'paymentUnit']\n : ['title', 'flsaStatus', 'rate', 'paymentUnit', 'effectiveDate'],\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n // For a primary new job, the user edits the hire date field. We read it\n // back here and pass it to the comp submit so both the job's hire_date and\n // the comp's effective_date land on the same value — preventing the API\n // from auto-creating a second compensation to fill the gap at the old date.\n const hireDateOverride = isPrimaryNewJob\n ? (jobForm.form.hookFormInternals.formMethods.getValues('hireDate') ?? undefined)\n : undefined\n\n const jobResult = await jobForm.actions.onSubmit()\n if (!jobResult) return\n\n onEvent(componentEvents.EMPLOYEE_JOB_UPDATED, jobResult.data)\n\n // When the hire date moves forward, the API auto-syncs the compensation's\n // effective_date to the new hire_date as part of the job PUT, which bumps\n // the compensation's version. Read it from the job response so the\n // subsequent compensation PUT doesn't send a stale version.\n const freshCompVersion = jobResult.data.compensations?.find(\n c => c.uuid === compensationId,\n )?.version\n\n const compensationResult = await compensationForm.actions.onSubmit({\n ...(hireDateOverride ? { effectiveDate: hireDateOverride } : {}),\n compensationVersion: freshCompVersion,\n })\n if (!compensationResult) return\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <ManagementCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={t('management.editCompensationTitle')}\n submitCtaLabel={t('management.saveCta')}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditPendingCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","jobId","compensationId","isNewJob","isPrimaryJob","onCancel","className","onEvent","useI18n","t","useTranslation","isPrimaryNewJob","jobForm","useJobForm","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","hireDateOverride","jobResult","componentEvents","freshCompVersion","c","compensationResult","errorHandling","isPending","classNames","styles","Form","ManagementCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AAoCO,SAASA,EAA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,YAAY,UAAU,UAAU,KAAK,SACrE,QAEEU,IAAY,MAAMV,EAAQ,QAAQ,SAAA;AACxC,QAAI,CAACU,EAAW;AAEhB,IAAAf,EAAQgB,EAAgB,sBAAsBD,EAAU,IAAI;AAM5D,UAAME,IAAmBF,EAAU,KAAK,eAAe;AAAA,MACrD,CAAAG,MAAKA,EAAE,SAASvB;AAAA,IAAA,GACf,SAEGwB,IAAqB,MAAMZ,EAAiB,QAAQ,SAAS;AAAA,MACjE,GAAIO,IAAmB,EAAE,eAAeA,EAAA,IAAqB,CAAA;AAAA,MAC7D,qBAAqBG;AAAA,IAAA,CACtB;AACD,IAAKE,MAELnB,EAAQgB,EAAgB,+BAA+BG,EAAmB,IAAI,GAC9EnB,EAAQgB,EAAgB,4BAA4BG,EAAmB,IAAI;AAAA,EAC7E,CAAC,GAEKC,IAAgBV,EAAoB,CAACE,CAAY,CAAC,GAClDS,IAAYhB,EAAQ,OAAO,aAAaE,EAAiB,OAAO;AAEtE,2BACG,WAAA,EAAQ,WAAWe,EAAWC,EAAO,WAAWxB,CAAS,GACxD,UAAA,gBAAAT,EAACqB,GAAA,EAAW,OAAOS,EAAc,QAC/B,4BAACI,GAAA,EAAK,UAAUZ,EAAa,cAC3B,UAAA,gBAAAtB;AAAA,IAACmC;AAAA,IAAA;AAAA,MACC,SAAApB;AAAA,MACA,kBAAAE;AAAA,MACA,OAAOL,EAAE,kCAAkC;AAAA,MAC3C,gBAAgBA,EAAE,oBAAoB;AAAA,MACtC,WAAAmB;AAAA,MACA,UAAAvB;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditPendingCompensation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UseJobFormReady } from '../shared/useJobForm';
|
|
2
|
+
import { UseCompensationFormReady } from '../shared/useCompensationForm';
|
|
3
|
+
export interface ManagementCompensationFormBodyProps {
|
|
4
|
+
jobForm: UseJobFormReady;
|
|
5
|
+
compensationForm: UseCompensationFormReady;
|
|
6
|
+
title: string;
|
|
7
|
+
submitCtaLabel: string;
|
|
8
|
+
isPending: boolean;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the shared field layout used by both `EditCompensation` (schedule a future comp
|
|
13
|
+
* change for a present job) and `EditPendingCompensation` (update an existing future comp).
|
|
14
|
+
* Field visibility is driven entirely by hook configuration — the hooks expose `undefined`
|
|
15
|
+
* for fields that should not render — so this component renders the correct subset for each
|
|
16
|
+
* use case without extra conditional props.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ManagementCompensationFormBody({ jobForm, compensationForm, title, submitCtaLabel, isPending, onCancel, }: ManagementCompensationFormBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as R, Trans as u } from "react-i18next";
|
|
3
|
+
import { Flex as g } from "../../../Common/Flex/Flex.js";
|
|
4
|
+
import "classnames";
|
|
5
|
+
import { FLSA_OVERTIME_SALARY_LIMIT as f } from "../../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as b } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import C from "../../../../hooks/useNumberFormatter.js";
|
|
9
|
+
function H({
|
|
10
|
+
jobForm: l,
|
|
11
|
+
compensationForm: i,
|
|
12
|
+
title: E,
|
|
13
|
+
submitCtaLabel: p,
|
|
14
|
+
isPending: m,
|
|
15
|
+
onCancel: d
|
|
16
|
+
}) {
|
|
17
|
+
const { t: e } = R("Employee.Compensation"), n = b(), r = C("currency"), s = l.form.Fields, a = i.form.Fields;
|
|
18
|
+
return /* @__PURE__ */ c(g, { flexDirection: "column", gap: 32, children: [
|
|
19
|
+
/* @__PURE__ */ t(n.Heading, { as: "h2", children: E }),
|
|
20
|
+
i.status.willDeleteSecondaryJobs && /* @__PURE__ */ t(
|
|
21
|
+
n.Alert,
|
|
22
|
+
{
|
|
23
|
+
label: e("validations.classificationChangeNotification"),
|
|
24
|
+
status: "warning"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ t(
|
|
28
|
+
a.Title,
|
|
29
|
+
{
|
|
30
|
+
label: e("management.jobTitleLabel"),
|
|
31
|
+
validationMessages: { REQUIRED: e("validations.jobTitleSentence") },
|
|
32
|
+
formHookResult: i
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
s.HireDate && /* @__PURE__ */ t(
|
|
36
|
+
s.HireDate,
|
|
37
|
+
{
|
|
38
|
+
label: e("management.hireDateLabel"),
|
|
39
|
+
validationMessages: {
|
|
40
|
+
REQUIRED: e("validations.hireDate")
|
|
41
|
+
},
|
|
42
|
+
formHookResult: l
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
a.FlsaStatus && /* @__PURE__ */ t(
|
|
46
|
+
a.FlsaStatus,
|
|
47
|
+
{
|
|
48
|
+
label: e("employeeClassification"),
|
|
49
|
+
description: /* @__PURE__ */ t(
|
|
50
|
+
u,
|
|
51
|
+
{
|
|
52
|
+
t: e,
|
|
53
|
+
i18nKey: "classificationLink",
|
|
54
|
+
components: { ClassificationLink: /* @__PURE__ */ t(n.Link, {}) }
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
validationMessages: {
|
|
58
|
+
REQUIRED: e("validations.exemptThreshold", {
|
|
59
|
+
limit: r(f)
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
getOptionLabel: (o) => e(`flsaStatusLabels.${o}`),
|
|
63
|
+
formHookResult: i
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ t(
|
|
67
|
+
a.Rate,
|
|
68
|
+
{
|
|
69
|
+
label: e("management.wageLabel"),
|
|
70
|
+
validationMessages: {
|
|
71
|
+
REQUIRED: e("validations.rate"),
|
|
72
|
+
RATE_MINIMUM: e("validations.nonZeroRate"),
|
|
73
|
+
RATE_EXEMPT_THRESHOLD: e("validations.rateExemptThreshold", {
|
|
74
|
+
limit: r(f)
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
formHookResult: i
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ t(
|
|
81
|
+
a.PaymentUnit,
|
|
82
|
+
{
|
|
83
|
+
label: e("management.wageFrequencyLabel"),
|
|
84
|
+
description: e("paymentUnitDescription"),
|
|
85
|
+
validationMessages: { REQUIRED: e("validations.paymentUnit") },
|
|
86
|
+
getOptionLabel: (o) => e(`management.wageFrequencyOptions.${o}`),
|
|
87
|
+
formHookResult: i
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
a.EffectiveDate && /* @__PURE__ */ t(
|
|
91
|
+
a.EffectiveDate,
|
|
92
|
+
{
|
|
93
|
+
label: e("effectiveDateLabel"),
|
|
94
|
+
validationMessages: {
|
|
95
|
+
REQUIRED: e("validations.effectiveDate"),
|
|
96
|
+
EFFECTIVE_DATE_BEFORE_HIRE: e("validations.effectiveDateBeforeHire"),
|
|
97
|
+
EFFECTIVE_DATE_BEFORE_MIN: e("validations.effectiveDateBeforeMin")
|
|
98
|
+
},
|
|
99
|
+
formHookResult: i
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
a.AdjustForMinimumWage && /* @__PURE__ */ t(
|
|
103
|
+
a.AdjustForMinimumWage,
|
|
104
|
+
{
|
|
105
|
+
label: e("adjustForMinimumWage"),
|
|
106
|
+
description: e("adjustForMinimumWageDescription"),
|
|
107
|
+
formHookResult: i
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
a.MinimumWageId && /* @__PURE__ */ t(
|
|
111
|
+
a.MinimumWageId,
|
|
112
|
+
{
|
|
113
|
+
label: e("minimumWageLabel"),
|
|
114
|
+
description: e("minimumWageDescription"),
|
|
115
|
+
validationMessages: { REQUIRED: e("validations.minimumWage") },
|
|
116
|
+
getOptionLabel: (o) => `${r(Number(o.wage))} - ${o.authority}: ${o.notes ?? ""}`,
|
|
117
|
+
formHookResult: i
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
s.TwoPercentShareholder && /* @__PURE__ */ t(
|
|
121
|
+
s.TwoPercentShareholder,
|
|
122
|
+
{
|
|
123
|
+
label: e("management.twoPercentShareholderLabel"),
|
|
124
|
+
formHookResult: l
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
s.StateWcCovered && /* @__PURE__ */ t(
|
|
128
|
+
s.StateWcCovered,
|
|
129
|
+
{
|
|
130
|
+
label: e("stateWcCoveredLabel"),
|
|
131
|
+
description: /* @__PURE__ */ t(
|
|
132
|
+
u,
|
|
133
|
+
{
|
|
134
|
+
t: e,
|
|
135
|
+
i18nKey: "stateWcCoveredDescription",
|
|
136
|
+
components: {
|
|
137
|
+
wcLink: /* @__PURE__ */ t(
|
|
138
|
+
n.Link,
|
|
139
|
+
{
|
|
140
|
+
href: "https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/",
|
|
141
|
+
target: "_blank",
|
|
142
|
+
rel: "noopener noreferrer"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
getOptionLabel: (o) => e(o ? "stateWcCoveredOptions.yes" : "stateWcCoveredOptions.no"),
|
|
149
|
+
formHookResult: l
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
s.StateWcClassCode && /* @__PURE__ */ t(
|
|
153
|
+
s.StateWcClassCode,
|
|
154
|
+
{
|
|
155
|
+
label: e("stateWcClassCodeLabel"),
|
|
156
|
+
description: e("stateWcClassCodeDescription"),
|
|
157
|
+
placeholder: e("stateWcClassCodeLabel"),
|
|
158
|
+
validationMessages: { REQUIRED: e("validations.stateWcClassCode") },
|
|
159
|
+
formHookResult: l
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ c(v, { children: [
|
|
163
|
+
d && /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: d, isDisabled: m, children: e("cancelCta") }),
|
|
164
|
+
/* @__PURE__ */ t(n.Button, { type: "submit", isLoading: m, children: p })
|
|
165
|
+
] })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
H as ManagementCompensationFormBody
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=ManagementCompensationFormBody.js.map
|
package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManagementCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/management/ManagementCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from '../shared/useJobForm'\nimport type { UseCompensationFormReady } from '../shared/useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nexport interface ManagementCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (schedule a future comp\n * change for a present job) and `EditPendingCompensation` (update an existing future comp).\n * Field visibility is driven entirely by hook configuration — the hooks expose `undefined`\n * for fields that should not render — so this component renders the correct subset for each\n * use case without extra conditional props.\n */\nexport function ManagementCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: ManagementCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n />\n )}\n\n <CompFields.Title\n label={t('management.jobTitleLabel')}\n validationMessages={{ REQUIRED: t('validations.jobTitleSentence') }}\n formHookResult={compensationForm}\n />\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('management.hireDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.hireDate'),\n }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n )}\n\n <CompFields.Rate\n label={t('management.wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n\n <CompFields.PaymentUnit\n label={t('management.wageFrequencyLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) =>\n t(`management.wageFrequencyOptions.${unit}` as const)\n }\n formHookResult={compensationForm}\n />\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('management.twoPercentShareholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["ManagementCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AA2BO,SAASA,EAA+B;AAAA,EAC7C,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYZ,EAAQ,KAAK,QACzBa,IAAaZ,EAAiB,KAAK;AAEzC,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,GAAM;AAAA,IAElCD,EAAiB,OAAO,2BACvB,gBAAAe;AAAA,MAACR,EAAW;AAAA,MAAX;AAAA,QACC,OAAOF,EAAE,8CAA8C;AAAA,QACvD,QAAO;AAAA,MAAA;AAAA,IAAA;AAAA,IAIX,gBAAAU;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,OAAOP,EAAE,0BAA0B;AAAA,QACnC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,QAChE,gBAAgBL;AAAA,MAAA;AAAA,IAAA;AAAA,IAGjBW,EAAU,Y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E,gBAAAU;AAAA,gBAACR,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,gBAAgB,CAACc,MACLhB,EAAVgB,IAAY,8BAAiC,0BAAN;AAAA,QAEzC,gBAAgBtB;AAAA,MAAA;AAAA,IAAA;AAAA,IAInBY,EAAU,oBACT,gBAAAI;AAAA,MAACJ,EAAU;AAAA,MAAV;AAAA,QACC,OAAON,EAAE,uBAAuB;AAAA,QAChC,aAAaA,EAAE,6BAA6B;AAAA,QAC5C,aAAaA,EAAE,uBAAuB;AAAA,QACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,QAChE,gBAAgBN;AAAA,MAAA;AAAA,IAAA;AAAA,sBAInBuB,GAAA,EACE,UAAA;AAAA,MAAAlB,KACC,gBAAAW,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAAU,YAAYD,GACnE,UAAAE,EAAE,WAAW,EAAA,CAChB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { EditCompensation as ManagementEditCompensation } from './EditCompensation';
|
|
3
|
+
export type { EditCompensationProps as ManagementEditCompensationProps } from './EditCompensation';
|
|
4
|
+
export { EditPendingCompensation as ManagementEditPendingCompensation } from './EditPendingCompensation/EditPendingCompensation';
|
|
5
|
+
export type { EditPendingCompensationProps as ManagementEditPendingCompensationProps } from './EditPendingCompensation/EditPendingCompensation';
|
|
6
|
+
export * from './AddAnotherJob/AddAnotherJob';
|
package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts
CHANGED
|
@@ -4,7 +4,12 @@ import { OnEventType } from '../../../../Base/useBase';
|
|
|
4
4
|
import { EventType } from '../../../../../shared/constants';
|
|
5
5
|
export interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {
|
|
6
6
|
employeeId: string;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* When provided, the hire date is pre-filled from this value and the hire
|
|
9
|
+
* date field is hidden. When absent (add-job from empty state), the hire
|
|
10
|
+
* date field is rendered so the user can set it explicitly.
|
|
11
|
+
*/
|
|
12
|
+
startDate?: string;
|
|
8
13
|
currentJobId?: string | null;
|
|
9
14
|
title: string;
|
|
10
15
|
submitCtaLabel: string;
|