@gusto/embedded-react-sdk 0.46.0 → 0.46.3
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 +117 -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 +85 -80
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -0
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -0
- 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 +10 -1
- package/dist/components/Common/DataView/useDataView.js +20 -17
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +10 -10
- package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +9 -9
- package/dist/components/Common/PaginationControl/PaginationControl.js +11 -10
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +11 -10
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +4 -4
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +51 -48
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +1 -1
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -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 +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -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 +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +33 -34
- 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.js +60 -202
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +79 -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 +3 -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/onboarding/JobsList/JobsListPresentation.js +36 -36
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.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 +213 -191
- 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/useJobForm.d.ts +6 -5
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +162 -131
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +74 -88
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +86 -72
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -3
- package/dist/components/Employee/Dashboard/DashboardComponents.js +138 -101
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +17 -10
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +359 -313
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +5 -3
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -1
- package/dist/components/Employee/Dashboard/TaxesView.js +114 -101
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +147 -148
- 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 +37 -36
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +2 -2
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +34 -35
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +57 -57
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +14 -5
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +55 -36
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +18 -18
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +3 -3
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -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 +170 -157
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +56 -55
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +20 -20
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- 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/useHomeAddressForm/homeAddressSchema.d.ts +0 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +11 -12
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.test.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +6 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +95 -94
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +6 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +87 -86
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +18 -18
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +3 -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 +96 -89
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +61 -60
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.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 +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
- 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/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 -125
- 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 +60 -91
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +4 -4
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +0 -16
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +139 -225
- 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 +78 -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/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +34 -34
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.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/helpers/breadcrumbHelpers.d.ts +1 -1
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/federalEin.d.ts +1 -0
- package/dist/helpers/federalEin.js.map +1 -1
- package/dist/helpers/mask.d.ts +8 -4
- package/dist/helpers/mask.js.map +1 -1
- package/dist/helpers/rem.d.ts +2 -1
- package/dist/helpers/rem.js.map +1 -1
- package/dist/hooks/useAsyncError.d.ts +1 -0
- package/dist/hooks/useAsyncError.js.map +1 -1
- package/dist/hooks/useForkRef/useForkRef.d.ts +1 -0
- package/dist/hooks/useForkRef/useForkRef.js.map +1 -1
- package/dist/i18n/I18n.d.ts +9 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +14 -14
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +16 -22
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- 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 +66 -58
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +28 -24
- package/dist/i18n/en/Employee.Dashboard.json.js.map +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.PaymentMethod.json.js +25 -25
- package/dist/i18n/en/Employee.StateTaxes.json.js +12 -10
- package/dist/i18n/en/Employee.StateTaxes.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 +14 -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 +2 -0
- package/dist/shared/constants.js +13 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/i18next.d.ts +30 -29
- package/dist/types/observability.d.ts +1 -1
- package/docs/reference/endpoint-inventory.json +24 -8
- package/package.json +30 -27
- package/dist/components/Employee/Dashboard/CompensationCard.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.46.3](https://github.com/Gusto/embedded-react-sdk/compare/v0.46.2...v0.46.3) (2026-06-01)
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- allow searching by department in add-employee tables (SDK-892) ([#1959](https://github.com/Gusto/embedded-react-sdk/issues/1959)) ([e610081](https://github.com/Gusto/embedded-react-sdk/commit/e61008103c4a7ab7317086704b3cc61fb9c8b584))
|
|
8
|
+
- **e2e:** reliability hardening — provisioning, loading waits, retries ([#1914](https://github.com/Gusto/embedded-react-sdk/issues/1914)) ([7356c6b](https://github.com/Gusto/embedded-react-sdk/commit/7356c6b94884312ed6a5bac25a6b2edf446a6291)), closes [employeeFlowDrivers#landOnEmployeeOnboardingHome](https://github.com/Gusto/employeeFlowDrivers/issues/landOnEmployeeOnboardingHome) [contractorFlowDrivers#reviewAndSubmitPayment](https://github.com/Gusto/contractorFlowDrivers/issues/reviewAndSubmitPayment) [payrollFlowDrivers#terminateAndRunDismissalPayroll](https://github.com/Gusto/payrollFlowDrivers/issues/terminateAndRunDismissalPayroll) [employeeFlowDrivers#runEmployeeTermination](https://github.com/Gusto/employeeFlowDrivers/issues/runEmployeeTermination) [#1](https://github.com/Gusto/embedded-react-sdk/issues/1) [#4](https://github.com/Gusto/embedded-react-sdk/issues/4) [#2](https://github.com/Gusto/embedded-react-sdk/issues/2) [#5](https://github.com/Gusto/embedded-react-sdk/issues/5)
|
|
9
|
+
|
|
10
|
+
### Fixes
|
|
11
|
+
|
|
12
|
+
- align wage frequency option copy between add and edit forms (SDK-974) ([#1957](https://github.com/Gusto/embedded-react-sdk/issues/1957)) ([c49aa0e](https://github.com/Gusto/embedded-react-sdk/commit/c49aa0ef298a2571395ba8bf5dfb48d4d7d9f7ee))
|
|
13
|
+
- always show reassignment warning on time off add employees view ([#1960](https://github.com/Gusto/embedded-react-sdk/issues/1960)) ([0d222f9](https://github.com/Gusto/embedded-react-sdk/commit/0d222f97c6925584bb31c56a9d8299131eb6aac7))
|
|
14
|
+
- clear stale compensation field errors when FLSA change disables them ([#1965](https://github.com/Gusto/embedded-react-sdk/issues/1965)) ([16cb010](https://github.com/Gusto/embedded-react-sdk/commit/16cb01048f4fff11ff9f92bc50628a20b3bd0ab0))
|
|
15
|
+
- **Dashboard:** close review modal when all pending changes are cancelled ([#1937](https://github.com/Gusto/embedded-react-sdk/issues/1937)) ([52edc54](https://github.com/Gusto/embedded-react-sdk/commit/52edc540e99a8ff128c363293e4b1b9613cad5c1))
|
|
16
|
+
- **dashboard:** show compensation.title (not job.title) on job & pay row ([#1975](https://github.com/Gusto/embedded-react-sdk/issues/1975)) ([aaaff5a](https://github.com/Gusto/embedded-react-sdk/commit/aaaff5afbce1eac97997fdd6f4439b4266d6ad4f))
|
|
17
|
+
- hide compensation Edit while a pending update exists (SDK-975) ([#1956](https://github.com/Gusto/embedded-react-sdk/issues/1956)) ([5e4bc87](https://github.com/Gusto/embedded-react-sdk/commit/5e4bc87a2dc31430a8091fee80256f7de15dc275))
|
|
18
|
+
- increase default pagination for add-employee flows (SDK-889) ([#1947](https://github.com/Gusto/embedded-react-sdk/issues/1947)) ([44d0540](https://github.com/Gusto/embedded-react-sdk/commit/44d0540b1bd67bcaf687a8b79a7bad8da45a1786))
|
|
19
|
+
- remove confirmation dialog from add employees view (SDK-977) ([#1958](https://github.com/Gusto/embedded-react-sdk/issues/1958)) ([c4dde85](https://github.com/Gusto/embedded-react-sdk/commit/c4dde85651669d5f83ecba051e005a893feb8a19))
|
|
20
|
+
- remove Flex container from job cell in employee dashboard ([#1961](https://github.com/Gusto/embedded-react-sdk/issues/1961)) ([c736551](https://github.com/Gusto/embedded-react-sdk/commit/c736551521644f67e45e3596bd2eabc3c4bc968e))
|
|
21
|
+
- remove Text wrapper from time off balance cell ([#1962](https://github.com/Gusto/embedded-react-sdk/issues/1962)) ([2c69e69](https://github.com/Gusto/embedded-react-sdk/commit/2c69e697daf699105d73e848a74db855a2360e08))
|
|
22
|
+
- render employee steady-state details with DescriptionList ([#1964](https://github.com/Gusto/embedded-react-sdk/issues/1964)) ([2e297db](https://github.com/Gusto/embedded-react-sdk/commit/2e297dbd381a11ddaad962dfad6a11d3d60608ac))
|
|
23
|
+
- **SDK-927:** require Start date in home address creation modal ([#1935](https://github.com/Gusto/embedded-react-sdk/issues/1935)) ([5d2be6c](https://github.com/Gusto/embedded-react-sdk/commit/5d2be6c9034f7f14aca39f0928a1fb156469d7a6))
|
|
24
|
+
- **SDK-928:** reset home address form state when closing the modal ([#1938](https://github.com/Gusto/embedded-react-sdk/issues/1938)) ([50f474d](https://github.com/Gusto/embedded-react-sdk/commit/50f474d434c40967732ec18d536e0055356b9820))
|
|
25
|
+
- **SDK-929:** keep home address modal open on invalid Save ([#1936](https://github.com/Gusto/embedded-react-sdk/issues/1936)) ([9dd04b4](https://github.com/Gusto/embedded-react-sdk/commit/9dd04b4ac8239e5cbf32a707bb59b0132b6b9518))
|
|
26
|
+
- **SDK-933:** track agency-required garnishment fields dynamically ([#1950](https://github.com/Gusto/embedded-react-sdk/issues/1950)) ([df6013c](https://github.com/Gusto/embedded-react-sdk/commit/df6013c30966bc1a3ae731e8923f3db5141794aa))
|
|
27
|
+
- **SDK-934:** stop double-encoding interpolated values in work address banner ([#1953](https://github.com/Gusto/embedded-react-sdk/issues/1953)) ([478d597](https://github.com/Gusto/embedded-react-sdk/commit/478d597907fd8d4d12fae28e2775e48b9082d8a2)), closes [#39](https://github.com/Gusto/embedded-react-sdk/issues/39)
|
|
28
|
+
- **SDK-935:** expose Start date in the home address Edit modal ([#1982](https://github.com/Gusto/embedded-react-sdk/issues/1982)) ([eab07d8](https://github.com/Gusto/embedded-react-sdk/commit/eab07d8d0e93a39fbab1c001130c802a0f8dde65))
|
|
29
|
+
- **SDK-936:** edit just-created home/work address without page-level loading ([#1939](https://github.com/Gusto/embedded-react-sdk/issues/1939)) ([64de9c8](https://github.com/Gusto/embedded-react-sdk/commit/64de9c8631169daf3ea1fb993ec8109d6601c8dc))
|
|
30
|
+
- **SDK-937:** switch Amount helper text when toggling Percentage / Fixed ([#1973](https://github.com/Gusto/embedded-react-sdk/issues/1973)) ([77602a7](https://github.com/Gusto/embedded-react-sdk/commit/77602a7e9374605127634670c2ecb06364c6ffab))
|
|
31
|
+
- **SDK-938:** show a format-specific message for invalid account numbers ([#1951](https://github.com/Gusto/embedded-react-sdk/issues/1951)) ([38a8db5](https://github.com/Gusto/embedded-react-sdk/commit/38a8db55eed510270aaeb1ea07c17a8a9686eea8))
|
|
32
|
+
- **SDK-940:** make Documents tab forms table flush with its container ([#1952](https://github.com/Gusto/embedded-react-sdk/issues/1952)) ([13c3a5f](https://github.com/Gusto/embedded-react-sdk/commit/13c3a5fa46bb5ccc3335447a90a1d25d38d29734))
|
|
33
|
+
- **SDK-942:** handle no-income-tax states in State taxes card and edit form ([#1954](https://github.com/Gusto/embedded-react-sdk/issues/1954)) ([aab92b3](https://github.com/Gusto/embedded-react-sdk/commit/aab92b312d738a20a39480fbf792ff6abc79aab5))
|
|
34
|
+
- **SDK-946:** remount DocumentViewer embed when the PDF url changes ([#1955](https://github.com/Gusto/embedded-react-sdk/issues/1955)) ([5222623](https://github.com/Gusto/embedded-react-sdk/commit/5222623df12c67bf24578cc771cfd9ee38528af6))
|
|
35
|
+
- **SDK-948:** hide PDF viewer black-flash behind page background ([#1974](https://github.com/Gusto/embedded-react-sdk/issues/1974)) ([6368a06](https://github.com/Gusto/embedded-react-sdk/commit/6368a060dfa044f4ad38a5e0f235f63ed4baf39e))
|
|
36
|
+
- **SDK-949:** select existing value when a NumberInput is focused ([#1971](https://github.com/Gusto/embedded-react-sdk/issues/1971)) ([77d7e08](https://github.com/Gusto/embedded-react-sdk/commit/77d7e0878ed2f815c91d95739b8be469f19d251f))
|
|
37
|
+
- **SDK-978:** preserve secondary compensation effective_date when primary hire_date changes ([#1972](https://github.com/Gusto/embedded-react-sdk/issues/1972)) ([38642f6](https://github.com/Gusto/embedded-react-sdk/commit/38642f67e3fe7d79a91e5404fa4b629d3b9853d2))
|
|
38
|
+
- use max-width to constrain starting balance input width (SDK-893) ([#1949](https://github.com/Gusto/embedded-react-sdk/issues/1949)) ([347aba5](https://github.com/Gusto/embedded-react-sdk/commit/347aba509d8118bef73b927421cfcd568a801821))
|
|
39
|
+
|
|
40
|
+
### Chores & Maintenance
|
|
41
|
+
|
|
42
|
+
- colorize ASCII art banners with Gusto coral ([#1966](https://github.com/Gusto/embedded-react-sdk/issues/1966)) ([e593d2c](https://github.com/Gusto/embedded-react-sdk/commit/e593d2c6e81d07aa7ebc6d27ff40bef759886fad)), closes [#F45D48](https://github.com/Gusto/embedded-react-sdk/issues/F45D48)
|
|
43
|
+
- **deps-dev:** bump @commitlint/config-conventional from 21.0.1 to 21.0.2 ([#1978](https://github.com/Gusto/embedded-react-sdk/issues/1978)) ([2f53edc](https://github.com/Gusto/embedded-react-sdk/commit/2f53edc90e9bae3fcc7f8c0f4e2bc209f23af6bc))
|
|
44
|
+
- **deps-dev:** bump @release-it/conventional-changelog from 11.0.0 to 11.0.1 ([#1979](https://github.com/Gusto/embedded-react-sdk/issues/1979)) ([7b7ae8f](https://github.com/Gusto/embedded-react-sdk/commit/7b7ae8fe79e1eef046248c71c05ef4ac62865eff))
|
|
45
|
+
- **deps-dev:** bump @storybook/addon-a11y from 10.4.0 to 10.4.1 ([#1931](https://github.com/Gusto/embedded-react-sdk/issues/1931)) ([3962ee5](https://github.com/Gusto/embedded-react-sdk/commit/3962ee543949d7f3dbdde71c6955e208f2bf87f6))
|
|
46
|
+
- **deps-dev:** bump @storybook/addon-docs from 10.4.0 to 10.4.1 ([#1927](https://github.com/Gusto/embedded-react-sdk/issues/1927)) ([90b9e7e](https://github.com/Gusto/embedded-react-sdk/commit/90b9e7e45fdaf054b5b92755ff110366af090a9d))
|
|
47
|
+
- **deps-dev:** bump @storybook/addon-onboarding from 10.4.0 to 10.4.1 ([#1925](https://github.com/Gusto/embedded-react-sdk/issues/1925)) ([dbdc532](https://github.com/Gusto/embedded-react-sdk/commit/dbdc532a3399e6e39b1390912fb2a32e3bd0c169))
|
|
48
|
+
- **deps-dev:** bump @storybook/react-vite from 10.4.0 to 10.4.1 ([#1929](https://github.com/Gusto/embedded-react-sdk/issues/1929)) ([465768d](https://github.com/Gusto/embedded-react-sdk/commit/465768d18e23431f4733816b6713960c7a9aeea2))
|
|
49
|
+
- **deps-dev:** bump eslint-plugin-storybook from 10.4.0 to 10.4.1 ([#1932](https://github.com/Gusto/embedded-react-sdk/issues/1932)) ([561bcca](https://github.com/Gusto/embedded-react-sdk/commit/561bcca6851723c6032e4fcea193c2ee7d6e73ff))
|
|
50
|
+
- **deps-dev:** bump lint-staged from 17.0.5 to 17.0.7 ([#1981](https://github.com/Gusto/embedded-react-sdk/issues/1981)) ([0e01c04](https://github.com/Gusto/embedded-react-sdk/commit/0e01c04c36a75498cfa86c5548de1abbbd02c2d4))
|
|
51
|
+
- **deps-dev:** bump react-router-dom from 7.15.1 to 7.16.0 ([#1970](https://github.com/Gusto/embedded-react-sdk/issues/1970)) ([6312d9d](https://github.com/Gusto/embedded-react-sdk/commit/6312d9d985c036da25e4bc73017def7aacabdcc8))
|
|
52
|
+
- **deps-dev:** bump release-it from 20.0.1 to 20.2.0 ([#1977](https://github.com/Gusto/embedded-react-sdk/issues/1977)) ([1349ea6](https://github.com/Gusto/embedded-react-sdk/commit/1349ea679b8720333d72364555e83e8a08eb3081))
|
|
53
|
+
- **deps-dev:** bump sass-embedded from 1.99.0 to 1.100.0 ([#1912](https://github.com/Gusto/embedded-react-sdk/issues/1912)) ([b60e3f9](https://github.com/Gusto/embedded-react-sdk/commit/b60e3f98091eed5002984fd3384f8443bc3474d8))
|
|
54
|
+
- **deps-dev:** bump typescript-eslint from 8.59.4 to 8.60.0 ([#1930](https://github.com/Gusto/embedded-react-sdk/issues/1930)) ([4fd978d](https://github.com/Gusto/embedded-react-sdk/commit/4fd978df43e0f2c844ef28c476f89f431614ddc5))
|
|
55
|
+
- **deps-dev:** bump vite-plugin-checker from 0.13.0 to 0.14.1 ([#1945](https://github.com/Gusto/embedded-react-sdk/issues/1945)) ([89eda8a](https://github.com/Gusto/embedded-react-sdk/commit/89eda8ac14d4a8274c21e69011d9a2e10f3d9cb1))
|
|
56
|
+
- **deps:** bump @hookform/resolvers from 5.2.2 to 5.4.0 ([#1911](https://github.com/Gusto/embedded-react-sdk/issues/1911)) ([93fda39](https://github.com/Gusto/embedded-react-sdk/commit/93fda396e2cea94ca4d693bcf0f3e0f68c83d4fb))
|
|
57
|
+
- **deps:** bump @internationalized/date from 3.12.1 to 3.12.2 ([#1969](https://github.com/Gusto/embedded-react-sdk/issues/1969)) ([1c9a377](https://github.com/Gusto/embedded-react-sdk/commit/1c9a377098aecd6479a21b36821ffbc0fcbf39f8))
|
|
58
|
+
- **deps:** bump @internationalized/number from 3.6.6 to 3.6.7 ([#1968](https://github.com/Gusto/embedded-react-sdk/issues/1968)) ([82331bf](https://github.com/Gusto/embedded-react-sdk/commit/82331bf3af9144fe941475d6ff77acdbf7d542cb))
|
|
59
|
+
- **deps:** bump dompurify from 3.4.5 to 3.4.7 ([#1944](https://github.com/Gusto/embedded-react-sdk/issues/1944)) ([bf47a3c](https://github.com/Gusto/embedded-react-sdk/commit/bf47a3cd939eb265512a51467d8d1aeefb1afeee))
|
|
60
|
+
- **deps:** bump i18next from 26.2.0 to 26.3.0 ([#1946](https://github.com/Gusto/embedded-react-sdk/issues/1946)) ([8176319](https://github.com/Gusto/embedded-react-sdk/commit/81763196b355a43dcc53883be1f0792bc410ca03))
|
|
61
|
+
- **deps:** bump react-error-boundary from 6.1.1 to 6.1.2 ([#1926](https://github.com/Gusto/embedded-react-sdk/issues/1926)) ([8097fec](https://github.com/Gusto/embedded-react-sdk/commit/8097fecfd443d3d523e5ea3a9571c5c82ffac2e9))
|
|
62
|
+
- **deps:** bump react-hook-form from 7.76.0 to 7.76.1 ([#1928](https://github.com/Gusto/embedded-react-sdk/issues/1928)) ([e686f90](https://github.com/Gusto/embedded-react-sdk/commit/e686f90e5b3a36703055526ead5a0132cb925269))
|
|
63
|
+
- **lint:** re-enable trivially-clean strict typescript-eslint rules ([#1924](https://github.com/Gusto/embedded-react-sdk/issues/1924)) ([77900d5](https://github.com/Gusto/embedded-react-sdk/commit/77900d5771c70813c86a3b02c22ebbbbd96f1184))
|
|
64
|
+
- remove ReadMe docs publishing pipeline ([#1940](https://github.com/Gusto/embedded-react-sdk/issues/1940)) ([f4a4c99](https://github.com/Gusto/embedded-react-sdk/commit/f4a4c99fd171c539837afe0e2be6c04393f7c124))
|
|
65
|
+
- **SDK-899:** add RFC for autogenerated API docs ([#1942](https://github.com/Gusto/embedded-react-sdk/issues/1942)) ([1380f06](https://github.com/Gusto/embedded-react-sdk/commit/1380f069a894e88514ed28485057b9e1937a0e2d))
|
|
66
|
+
- **SDK-970:** install eslint-plugin-tsdoc to lint comment syntax ([#1963](https://github.com/Gusto/embedded-react-sdk/issues/1963)) ([85fd0f0](https://github.com/Gusto/embedded-react-sdk/commit/85fd0f07e2641b98c4b9afa7a506b7f55c5381c1))
|
|
67
|
+
- **SDK-970:** lint tsdoc coverage and quality ([#1967](https://github.com/Gusto/embedded-react-sdk/issues/1967)) ([7ff453d](https://github.com/Gusto/embedded-react-sdk/commit/7ff453dfffbd814b4cf343f4c39382742e5edc27))
|
|
68
|
+
- stand up Docusaurus site for ongoing docs work ([#1943](https://github.com/Gusto/embedded-react-sdk/issues/1943)) ([a659e82](https://github.com/Gusto/embedded-react-sdk/commit/a659e82f23450630618959fc77b54e3db75a80a9))
|
|
69
|
+
|
|
70
|
+
## [0.46.2](https://github.com/Gusto/embedded-react-sdk/compare/v0.46.0...v0.46.2) (2026-05-22)
|
|
71
|
+
|
|
72
|
+
### Features & Enhancements
|
|
73
|
+
|
|
74
|
+
- **compensation:** enforce effectiveDate floor via Zod schema with distinct error messages ([#1919](https://github.com/Gusto/embedded-react-sdk/issues/1919)) ([c1bfb2c](https://github.com/Gusto/embedded-react-sdk/commit/c1bfb2c796eb05d8ef70c75426dd80ad016b1e6c))
|
|
75
|
+
- **Dashboard:** fix pending compensation edit — route date field by job type ([#1909](https://github.com/Gusto/embedded-react-sdk/issues/1909)) ([362d94f](https://github.com/Gusto/embedded-react-sdk/commit/362d94f9d27e260f4492f1ea1241be31ceda8b04))
|
|
76
|
+
- **dashboard:** show Pending badge for future-dated compensations on job card and table ([#1897](https://github.com/Gusto/embedded-react-sdk/issues/1897)) ([41031b4](https://github.com/Gusto/embedded-react-sdk/commit/41031b48e45b4bf03ea69d0df51c6b59e29230f3))
|
|
77
|
+
- **Dashboard:** wire add-job and add-another-job compensation forms ([#1898](https://github.com/Gusto/embedded-react-sdk/issues/1898)) ([bd0ecff](https://github.com/Gusto/embedded-react-sdk/commit/bd0ecff3b3752b2ce6fd1780df55976f31d24cff))
|
|
78
|
+
- **SDK-517:** add EmployeeListFlow for management employee navigation ([#1921](https://github.com/Gusto/embedded-react-sdk/issues/1921)) ([3304000](https://github.com/Gusto/embedded-react-sdk/commit/330400023966c5b4b641f1d2a65b043acf6f123e))
|
|
79
|
+
|
|
80
|
+
### Fixes
|
|
81
|
+
|
|
82
|
+
- always show Create Policy button in page header ([#1905](https://github.com/Gusto/embedded-react-sdk/issues/1905)) ([962b8a4](https://github.com/Gusto/embedded-react-sdk/commit/962b8a4a88f31d087fd48e0c9a4b341c8c316b03))
|
|
83
|
+
- block switching between unlimited and accrual-based time off policy types ([#1900](https://github.com/Gusto/embedded-react-sdk/issues/1900)) ([b3e737b](https://github.com/Gusto/embedded-react-sdk/commit/b3e737b08a700fdb9426b7b33577fd98b69a6f8a))
|
|
84
|
+
- clarify policy deletion error when pending requests exist ([#1906](https://github.com/Gusto/embedded-react-sdk/issues/1906)) ([d4cdb8a](https://github.com/Gusto/embedded-react-sdk/commit/d4cdb8ac81cb23f9141a60e7b0d531c74b2d2693))
|
|
85
|
+
- close remove-employee modal on error and clear stale errors in balance modal ([#1899](https://github.com/Gusto/embedded-react-sdk/issues/1899)) ([0987443](https://github.com/Gusto/embedded-react-sdk/commit/0987443147881b074a2c224e150e0bbeaf364e21))
|
|
86
|
+
- **Dashboard:** show pending compensation changes including title ([#1908](https://github.com/Gusto/embedded-react-sdk/issues/1908)) ([420e8e3](https://github.com/Gusto/embedded-react-sdk/commit/420e8e3956a50aedc1fa039284b3594525368c8a))
|
|
87
|
+
- **Dashboard:** unblock paystub download — drop noopener and defer blob URL revoke ([#1915](https://github.com/Gusto/embedded-react-sdk/issues/1915)) ([507bb47](https://github.com/Gusto/embedded-react-sdk/commit/507bb47812d915c19fe5163746d9e05af15ff0c2))
|
|
88
|
+
- **Deductions:** await column header render before asserting in DeductionsList test ([#1910](https://github.com/Gusto/embedded-react-sdk/issues/1910)) ([3f005ad](https://github.com/Gusto/embedded-react-sdk/commit/3f005adb802af1b73b8e7c33b8a4d1756d823706))
|
|
89
|
+
- fall back to first job title when no primary job is flagged ([#1902](https://github.com/Gusto/embedded-react-sdk/issues/1902)) ([729dbdb](https://github.com/Gusto/embedded-react-sdk/commit/729dbdb214020fdaba0b94f6f4e6f729e4e11e70))
|
|
90
|
+
- hide assigned employees from time-off add list (SDK-894) ([#1843](https://github.com/Gusto/embedded-react-sdk/issues/1843)) ([acb6194](https://github.com/Gusto/embedded-react-sdk/commit/acb6194e164df578bd23e946b7ccb58c92080134)), closes [#1887](https://github.com/Gusto/embedded-react-sdk/issues/1887) [#1849](https://github.com/Gusto/embedded-react-sdk/issues/1849)
|
|
91
|
+
- preserve carry-over balances when adding employees to policy ([#1907](https://github.com/Gusto/embedded-react-sdk/issues/1907)) ([094a9fc](https://github.com/Gusto/embedded-react-sdk/commit/094a9fc587716efb09a4ec8ed42e4275eb060f9a))
|
|
92
|
+
- preserve date picker state when switching back from unlimited ([#1904](https://github.com/Gusto/embedded-react-sdk/issues/1904)) ([fa9e0b0](https://github.com/Gusto/embedded-react-sdk/commit/fa9e0b08cc978da58357a699ef38cf46ce152ac1))
|
|
93
|
+
- provide descriptive error when balance update exceeds policy max ([#1903](https://github.com/Gusto/embedded-react-sdk/issues/1903)) ([88af535](https://github.com/Gusto/embedded-react-sdk/commit/88af535ff68c613301f0afb0aa1db66889f08db9))
|
|
94
|
+
- route holiday Add Employees back button to policy detail ([#1918](https://github.com/Gusto/embedded-react-sdk/issues/1918)) ([1db88fd](https://github.com/Gusto/embedded-react-sdk/commit/1db88fd17f0d272f0aa45d179ddab166df7cd29a))
|
|
95
|
+
- use fresh compensation version from job PUT response in EditPendingCompensation ([#1920](https://github.com/Gusto/embedded-react-sdk/issues/1920)) ([9de8a5b](https://github.com/Gusto/embedded-react-sdk/commit/9de8a5bb403ecefbe585f62ea61f89209cd0186e))
|
|
96
|
+
|
|
97
|
+
### Chores & Maintenance
|
|
98
|
+
|
|
99
|
+
- release 0.46.1 ([#1916](https://github.com/Gusto/embedded-react-sdk/issues/1916)) ([3acabc3](https://github.com/Gusto/embedded-react-sdk/commit/3acabc3bcbae06c36fdd38a36bd6a675c7967c77))
|
|
100
|
+
|
|
101
|
+
## [0.46.1](https://github.com/Gusto/embedded-react-sdk/compare/v0.46.0...v0.46.1) (2026-05-22)
|
|
102
|
+
|
|
103
|
+
### Features & Enhancements
|
|
104
|
+
|
|
105
|
+
- Route the date field by job type when editing a pending compensation on the Employee Dashboard ([#1909](https://github.com/Gusto/embedded-react-sdk/issues/1909))
|
|
106
|
+
- Show a "Pending" badge on the Employee Dashboard job card and jobs table for compensations with a future effective date ([#1897](https://github.com/Gusto/embedded-react-sdk/issues/1897))
|
|
107
|
+
- Wire up the add-job and add-another-job compensation forms in the Employee Dashboard ([#1898](https://github.com/Gusto/embedded-react-sdk/issues/1898))
|
|
108
|
+
|
|
109
|
+
### Fixes
|
|
110
|
+
|
|
111
|
+
- Fix paystub download from the Employee Dashboard Job and Pay tab — the new tab no longer stays blank ([#1915](https://github.com/Gusto/embedded-react-sdk/issues/1915))
|
|
112
|
+
- Show the job title in pending compensation change alerts on the Employee Dashboard ([#1908](https://github.com/Gusto/embedded-react-sdk/issues/1908))
|
|
113
|
+
- Fall back to the first job's title when no primary job is flagged ([#1902](https://github.com/Gusto/embedded-react-sdk/issues/1902))
|
|
114
|
+
- Always show the Create Policy button in the time-off policy page header ([#1905](https://github.com/Gusto/embedded-react-sdk/issues/1905))
|
|
115
|
+
- Hide already-assigned employees from the time-off policy add-employees list ([#1843](https://github.com/Gusto/embedded-react-sdk/issues/1843))
|
|
116
|
+
- Preserve the date picker selection when switching the time-off policy balance back from unlimited ([#1904](https://github.com/Gusto/embedded-react-sdk/issues/1904))
|
|
117
|
+
- Show a descriptive error when a time-off balance update exceeds the policy maximum ([#1903](https://github.com/Gusto/embedded-react-sdk/issues/1903))
|
|
118
|
+
- Close the remove-employee modal on error and clear stale errors in the balance modal ([#1899](https://github.com/Gusto/embedded-react-sdk/issues/1899))
|
|
119
|
+
|
|
3
120
|
## [0.46.0](https://github.com/Gusto/embedded-react-sdk/compare/v0.45.0...v0.46.0) (2026-05-21)
|
|
4
121
|
|
|
5
122
|
### Features & Enhancements
|
|
@@ -8,9 +8,10 @@ export type DataCardsProps<T> = {
|
|
|
8
8
|
onSelect?: (item: T, checked: boolean) => void;
|
|
9
9
|
onSelectAll?: (checked: boolean, visibleData: T[]) => void;
|
|
10
10
|
getIsItemSelected?: (item: T) => boolean;
|
|
11
|
+
hideSelectAll?: useDataViewPropReturn<T>['hideSelectAll'];
|
|
11
12
|
emptyState?: useDataViewPropReturn<T>['emptyState'];
|
|
12
13
|
footer?: useDataViewPropReturn<T>['footer'];
|
|
13
14
|
selectionMode?: SelectionMode;
|
|
14
15
|
isWithinBox?: TableProps['isWithinBox'];
|
|
15
16
|
};
|
|
16
|
-
export declare const DataCards: <T>({ label, data, columns, itemMenu, onSelect, onSelectAll, getIsItemSelected, emptyState, footer, selectionMode, isWithinBox, }: DataCardsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const DataCards: <T>({ label, data, columns, itemMenu, onSelect, onSelectAll, getIsItemSelected, hideSelectAll, emptyState, footer, selectionMode, isWithinBox, }: DataCardsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import
|
|
4
|
-
import { useTranslation as
|
|
2
|
+
import { useId as T } from "react";
|
|
3
|
+
import j from "classnames";
|
|
4
|
+
import { useTranslation as A } from "react-i18next";
|
|
5
5
|
import a from "./DataCards.module.scss.js";
|
|
6
|
-
import { useSelectionState as
|
|
6
|
+
import { useSelectionState as H } from "../useSelectionState.js";
|
|
7
7
|
import { Flex as N } from "../../Flex/Flex.js";
|
|
8
|
-
import { useComponentContext as
|
|
9
|
-
const
|
|
8
|
+
import { useComponentContext as V } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
const I = ({
|
|
10
10
|
label: x,
|
|
11
11
|
data: s,
|
|
12
12
|
columns: h,
|
|
@@ -14,18 +14,19 @@ const E = ({
|
|
|
14
14
|
onSelect: c,
|
|
15
15
|
onSelectAll: g,
|
|
16
16
|
getIsItemSelected: m,
|
|
17
|
+
hideSelectAll: w,
|
|
17
18
|
emptyState: f,
|
|
18
19
|
footer: v,
|
|
19
20
|
selectionMode: C = "multiple",
|
|
20
21
|
isWithinBox: d
|
|
21
22
|
}) => {
|
|
22
|
-
const o =
|
|
23
|
+
const o = V(), { t: u } = A("common"), L = T(), { allSelected: R } = H(s, m), D = (l, n) => {
|
|
23
24
|
if (!c) return;
|
|
24
25
|
const r = m?.(l) ?? !1;
|
|
25
26
|
return C === "single" ? /* @__PURE__ */ e(
|
|
26
27
|
o.Radio,
|
|
27
28
|
{
|
|
28
|
-
name:
|
|
29
|
+
name: L,
|
|
29
30
|
value: r,
|
|
30
31
|
onChange: () => {
|
|
31
32
|
c(l, !0);
|
|
@@ -45,11 +46,11 @@ const E = ({
|
|
|
45
46
|
}
|
|
46
47
|
);
|
|
47
48
|
};
|
|
48
|
-
return /* @__PURE__ */ t("div", { className:
|
|
49
|
-
c && m && C === "multiple" && s.length > 0 && /* @__PURE__ */ e("div", { className: a.selectAllRow, children: /* @__PURE__ */ e(
|
|
49
|
+
return /* @__PURE__ */ t("div", { className: j(a.root, d && a.withinBox), "data-testid": "data-cards", children: [
|
|
50
|
+
c && m && C === "multiple" && !w && s.length > 0 && /* @__PURE__ */ e("div", { className: a.selectAllRow, children: /* @__PURE__ */ e(
|
|
50
51
|
o.Checkbox,
|
|
51
52
|
{
|
|
52
|
-
value:
|
|
53
|
+
value: R,
|
|
53
54
|
onChange: (l) => g?.(l, s),
|
|
54
55
|
label: u("card.selectAllRowsLabel")
|
|
55
56
|
}
|
|
@@ -60,7 +61,7 @@ const E = ({
|
|
|
60
61
|
o.Card,
|
|
61
62
|
{
|
|
62
63
|
menu: p && p(l),
|
|
63
|
-
action:
|
|
64
|
+
action: D(l),
|
|
64
65
|
className: d ? a.flushCard : void 0,
|
|
65
66
|
children: h.map((r, i) => /* @__PURE__ */ t(N, { flexDirection: "column", gap: 0, children: [
|
|
66
67
|
r.title && /* @__PURE__ */ e("h5", { className: a.columnTitle, children: r.title }),
|
|
@@ -85,6 +86,6 @@ const E = ({
|
|
|
85
86
|
] });
|
|
86
87
|
};
|
|
87
88
|
export {
|
|
88
|
-
|
|
89
|
+
I as DataCards
|
|
89
90
|
};
|
|
90
91
|
//# sourceMappingURL=DataCards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCards.js","sources":["../../../../../src/components/Common/DataView/DataCards/DataCards.tsx"],"sourcesContent":["import { useId } from 'react'\nimport cn from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport styles from './DataCards.module.scss'\nimport type { useDataViewPropReturn, SelectionMode } from '@/components/Common/DataView/useDataView'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { useSelectionState } from '@/components/Common/DataView/useSelectionState'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport type DataCardsProps<T> = {\n label: string\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: (item: T, checked: boolean) => void\n onSelectAll?: (checked: boolean, visibleData: T[]) => void\n getIsItemSelected?: (item: T) => boolean\n emptyState?: useDataViewPropReturn<T>['emptyState']\n footer?: useDataViewPropReturn<T>['footer']\n selectionMode?: SelectionMode\n isWithinBox?: TableProps['isWithinBox']\n}\n\nexport const DataCards = <T,>({\n label,\n data,\n columns,\n itemMenu,\n onSelect,\n onSelectAll,\n getIsItemSelected,\n emptyState,\n footer,\n selectionMode = 'multiple',\n isWithinBox,\n}: DataCardsProps<T>) => {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const radioGroupName = useId()\n const { allSelected } = useSelectionState(data, getIsItemSelected)\n\n const renderAction = (item: T, index: number) => {\n if (!onSelect) return undefined\n\n const isSelected = getIsItemSelected?.(item) ?? false\n\n if (selectionMode === 'single') {\n return (\n <Components.Radio\n name={radioGroupName}\n value={isSelected}\n onChange={() => {\n onSelect(item, true)\n }}\n label={t('card.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n return (\n <Components.Checkbox\n value={isSelected}\n onChange={(checked: boolean) => {\n onSelect(item, checked)\n }}\n label={t('card.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n return (\n <div className={cn(styles.root, isWithinBox && styles.withinBox)} data-testid=\"data-cards\">\n {onSelect
|
|
1
|
+
{"version":3,"file":"DataCards.js","sources":["../../../../../src/components/Common/DataView/DataCards/DataCards.tsx"],"sourcesContent":["import { useId } from 'react'\nimport cn from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport styles from './DataCards.module.scss'\nimport type { useDataViewPropReturn, SelectionMode } from '@/components/Common/DataView/useDataView'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { useSelectionState } from '@/components/Common/DataView/useSelectionState'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport type DataCardsProps<T> = {\n label: string\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: (item: T, checked: boolean) => void\n onSelectAll?: (checked: boolean, visibleData: T[]) => void\n getIsItemSelected?: (item: T) => boolean\n hideSelectAll?: useDataViewPropReturn<T>['hideSelectAll']\n emptyState?: useDataViewPropReturn<T>['emptyState']\n footer?: useDataViewPropReturn<T>['footer']\n selectionMode?: SelectionMode\n isWithinBox?: TableProps['isWithinBox']\n}\n\nexport const DataCards = <T,>({\n label,\n data,\n columns,\n itemMenu,\n onSelect,\n onSelectAll,\n getIsItemSelected,\n hideSelectAll,\n emptyState,\n footer,\n selectionMode = 'multiple',\n isWithinBox,\n}: DataCardsProps<T>) => {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const radioGroupName = useId()\n const { allSelected } = useSelectionState(data, getIsItemSelected)\n\n const renderAction = (item: T, index: number) => {\n if (!onSelect) return undefined\n\n const isSelected = getIsItemSelected?.(item) ?? false\n\n if (selectionMode === 'single') {\n return (\n <Components.Radio\n name={radioGroupName}\n value={isSelected}\n onChange={() => {\n onSelect(item, true)\n }}\n label={t('card.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n return (\n <Components.Checkbox\n value={isSelected}\n onChange={(checked: boolean) => {\n onSelect(item, checked)\n }}\n label={t('card.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n return (\n <div className={cn(styles.root, isWithinBox && styles.withinBox)} data-testid=\"data-cards\">\n {onSelect &&\n getIsItemSelected &&\n selectionMode === 'multiple' &&\n !hideSelectAll &&\n data.length > 0 && (\n <div className={styles.selectAllRow}>\n <Components.Checkbox\n value={allSelected}\n onChange={(checked: boolean) => onSelectAll?.(checked, data)}\n label={t('card.selectAllRowsLabel')}\n />\n </div>\n )}\n <div role=\"list\" aria-label={label}>\n {data.length === 0 && emptyState && (\n <div role=\"listitem\">\n <Components.Card className={isWithinBox ? styles.flushCard : undefined}>\n {emptyState()}\n </Components.Card>\n </div>\n )}\n {data.map((item, index) => (\n <div role=\"listitem\" key={index}>\n <Components.Card\n menu={itemMenu && itemMenu(item)}\n action={renderAction(item, index)}\n className={isWithinBox ? styles.flushCard : undefined}\n >\n {columns.map((column, colIndex) => (\n <Flex key={colIndex} flexDirection=\"column\" gap={0}>\n {column.title && <h5 className={styles.columnTitle}>{column.title}</h5>}\n <div className={styles.columnData}>\n {' '}\n {column.render ? column.render(item) : String(item[column.key as keyof T])}\n </div>\n </Flex>\n ))}\n </Components.Card>\n </div>\n ))}\n {footer && (\n <div role=\"listitem\">\n <Components.Card className={isWithinBox ? styles.flushCard : undefined}>\n {(() => {\n const footerContent = footer()\n\n return Object.entries(footerContent).map(([key, content]) => {\n const columnIndex = key.startsWith('column-')\n ? parseInt(key.replace('column-', ''), 10)\n : -1\n const columnTitle = columnIndex >= 0 ? columns[columnIndex]?.title : undefined\n\n return (\n <Flex key={key} flexDirection=\"column\" gap={0}>\n {columnTitle && <h5 className={styles.columnTitle}>{columnTitle}</h5>}\n <div className={styles.footerItem}>{content}</div>\n </Flex>\n )\n })\n })()}\n </Components.Card>\n </div>\n )}\n </div>\n </div>\n )\n}\n"],"names":["DataCards","label","data","columns","itemMenu","onSelect","onSelectAll","getIsItemSelected","hideSelectAll","emptyState","footer","selectionMode","isWithinBox","Components","useComponentContext","t","useTranslation","radioGroupName","useId","allSelected","useSelectionState","renderAction","item","index","isSelected","jsx","checked","jsxs","cn","styles","column","colIndex","Flex","footerContent","key","content","columnIndex","columnTitle"],"mappings":";;;;;;;;AAyBO,MAAMA,IAAY,CAAK;AAAA,EAC5B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,aAAAC;AACF,MAAyB;AACvB,QAAMC,IAAa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iBACE,gBAAAT,EAACK,GAAA,EAAe,eAAc,UAAS,KAAK,GACzC,UAAA;AAAA,YAAAK,KAAe,gBAAAZ,EAAC,MAAA,EAAG,WAAWI,EAAO,aAAc,UAAAQ,GAAY;AAAA,YAChE,gBAAAZ,EAAC,OAAA,EAAI,WAAWI,EAAO,YAAa,UAAAM,EAAA,CAAQ;AAAA,UAAA,EAAA,GAFnCD,CAGX;AAAA,QAEJ,CAAC;AAAA,MACH,GAAA,GACF,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -8,9 +8,10 @@ export type DataTableProps<T> = {
|
|
|
8
8
|
onSelect?: useDataViewPropReturn<T>['onSelect'];
|
|
9
9
|
onSelectAll?: (checked: boolean, visibleData: T[]) => void;
|
|
10
10
|
getIsItemSelected?: (item: T) => boolean;
|
|
11
|
+
hideSelectAll?: useDataViewPropReturn<T>['hideSelectAll'];
|
|
11
12
|
emptyState?: useDataViewPropReturn<T>['emptyState'];
|
|
12
13
|
footer?: useDataViewPropReturn<T>['footer'];
|
|
13
14
|
isWithinBox?: TableProps['isWithinBox'];
|
|
14
15
|
selectionMode?: SelectionMode;
|
|
15
16
|
};
|
|
16
|
-
export declare const DataTable: <T>({ label, data, columns, itemMenu, onSelect, onSelectAll, getIsItemSelected, emptyState, footer, isWithinBox, selectionMode, }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const DataTable: <T>({ label, data, columns, itemMenu, onSelect, onSelectAll, getIsItemSelected, hideSelectAll, emptyState, footer, isWithinBox, selectionMode, }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useId as T, useState as j } from "react";
|
|
3
|
+
import { useTranslation as E } from "react-i18next";
|
|
4
4
|
import { useSelectionState as F } from "../useSelectionState.js";
|
|
5
|
+
import N from "./DataTable.module.scss.js";
|
|
5
6
|
import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
import { VisuallyHidden as
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return
|
|
7
|
+
import { VisuallyHidden as k } from "../../VisuallyHidden/VisuallyHidden.js";
|
|
8
|
+
function C(a, o) {
|
|
9
|
+
return !o || o === "start" ? a : /* @__PURE__ */ r("div", { className: N.cellEnd, children: a });
|
|
10
|
+
}
|
|
11
|
+
function A(a, o) {
|
|
12
|
+
if (o.render)
|
|
13
|
+
return o.render(a);
|
|
14
|
+
if (o.key) {
|
|
15
|
+
const i = o.key;
|
|
16
|
+
return String(a[i] ?? "");
|
|
13
17
|
}
|
|
14
18
|
return "";
|
|
15
19
|
}
|
|
16
|
-
const
|
|
17
|
-
label:
|
|
18
|
-
data:
|
|
19
|
-
columns:
|
|
20
|
-
itemMenu:
|
|
21
|
-
onSelect:
|
|
22
|
-
onSelectAll:
|
|
23
|
-
getIsItemSelected:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const U = ({
|
|
21
|
+
label: a,
|
|
22
|
+
data: o,
|
|
23
|
+
columns: i,
|
|
24
|
+
itemMenu: u,
|
|
25
|
+
onSelect: l,
|
|
26
|
+
onSelectAll: g,
|
|
27
|
+
getIsItemSelected: d,
|
|
28
|
+
hideSelectAll: R,
|
|
29
|
+
emptyState: p,
|
|
30
|
+
footer: h,
|
|
31
|
+
isWithinBox: m,
|
|
32
|
+
selectionMode: b = "multiple"
|
|
28
33
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
...
|
|
34
|
+
const y = S(), { t: c } = E("common"), D = T(), [$, v] = j(null), { allSelected: w } = F(o, d), H = [
|
|
35
|
+
...l ? [
|
|
31
36
|
{
|
|
32
37
|
key: "select-header",
|
|
33
|
-
content:
|
|
38
|
+
content: b === "multiple" && d && !R && o.length > 0 ? (
|
|
34
39
|
// Stop propagation so the surrounding react-aria-components
|
|
35
40
|
// <Column> press handler doesn't intercept the checkbox click
|
|
36
41
|
// and desync the controlled DOM state. The inner <input> is
|
|
37
42
|
// the actual interactive element; this span is a propagation
|
|
38
43
|
// shield, not a click target itself.
|
|
39
44
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
40
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ r(
|
|
41
46
|
"span",
|
|
42
47
|
{
|
|
43
48
|
onClick: (e) => {
|
|
@@ -49,115 +54,115 @@ const B = ({
|
|
|
49
54
|
onMouseDown: (e) => {
|
|
50
55
|
e.stopPropagation();
|
|
51
56
|
},
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
-
|
|
57
|
+
children: /* @__PURE__ */ r(
|
|
58
|
+
y.Checkbox,
|
|
54
59
|
{
|
|
55
|
-
value:
|
|
56
|
-
onChange: (e) =>
|
|
57
|
-
label:
|
|
60
|
+
value: w,
|
|
61
|
+
onChange: (e) => g?.(e, o),
|
|
62
|
+
label: c("table.selectAllRowsLabel"),
|
|
58
63
|
shouldVisuallyHideLabel: !0
|
|
59
64
|
}
|
|
60
65
|
)
|
|
61
66
|
}
|
|
62
67
|
)
|
|
63
|
-
) : /* @__PURE__ */
|
|
68
|
+
) : /* @__PURE__ */ r(k, { children: c("table.selectRowHeader") })
|
|
64
69
|
}
|
|
65
70
|
] : [],
|
|
66
|
-
...
|
|
71
|
+
...i.map((e, t) => ({
|
|
67
72
|
key: typeof e.key == "string" ? e.key : `header-${t}`,
|
|
68
|
-
content: e.title
|
|
73
|
+
content: C(e.title, e.justify)
|
|
69
74
|
})),
|
|
70
|
-
...
|
|
75
|
+
...u ? [
|
|
71
76
|
{
|
|
72
77
|
key: "actions-header",
|
|
73
|
-
content: /* @__PURE__ */
|
|
78
|
+
content: /* @__PURE__ */ r(k, { children: c("table.actionsColumnHeader") })
|
|
74
79
|
}
|
|
75
80
|
] : []
|
|
76
81
|
], L = (e, t) => {
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
82
|
+
v(t), l?.(e, !0);
|
|
83
|
+
}, x = (e, t) => {
|
|
84
|
+
if (b === "single") {
|
|
85
|
+
const n = d?.(e) ?? $ === t;
|
|
86
|
+
return /* @__PURE__ */ r(
|
|
87
|
+
y.Radio,
|
|
83
88
|
{
|
|
84
|
-
name:
|
|
85
|
-
value:
|
|
89
|
+
name: D,
|
|
90
|
+
value: n,
|
|
86
91
|
onChange: () => {
|
|
87
92
|
L(e, t);
|
|
88
93
|
},
|
|
89
|
-
label:
|
|
94
|
+
label: c("table.selectRowLabel"),
|
|
90
95
|
shouldVisuallyHideLabel: !0
|
|
91
96
|
}
|
|
92
97
|
);
|
|
93
98
|
}
|
|
94
|
-
const
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
|
|
99
|
+
const s = d?.(e) ?? !1;
|
|
100
|
+
return /* @__PURE__ */ r(
|
|
101
|
+
y.Checkbox,
|
|
97
102
|
{
|
|
98
|
-
value:
|
|
99
|
-
onChange: (
|
|
100
|
-
|
|
103
|
+
value: s,
|
|
104
|
+
onChange: (n) => {
|
|
105
|
+
l?.(e, n);
|
|
101
106
|
},
|
|
102
|
-
label:
|
|
107
|
+
label: c("table.selectRowLabel"),
|
|
103
108
|
shouldVisuallyHideLabel: !0
|
|
104
109
|
}
|
|
105
110
|
);
|
|
106
|
-
},
|
|
107
|
-
const
|
|
108
|
-
...
|
|
111
|
+
}, P = o.map((e, t) => {
|
|
112
|
+
const s = [
|
|
113
|
+
...l ? [
|
|
109
114
|
{
|
|
110
115
|
key: `select-${t}`,
|
|
111
|
-
content:
|
|
116
|
+
content: x(e, t)
|
|
112
117
|
}
|
|
113
118
|
] : [],
|
|
114
|
-
...
|
|
115
|
-
key: typeof
|
|
116
|
-
content:
|
|
119
|
+
...i.map((n, f) => ({
|
|
120
|
+
key: typeof n.key == "string" ? n.key : `cell-${f}`,
|
|
121
|
+
content: C(A(e, n), n.justify)
|
|
117
122
|
})),
|
|
118
|
-
...
|
|
123
|
+
...u ? [
|
|
119
124
|
{
|
|
120
125
|
key: `menu-${t}`,
|
|
121
|
-
content:
|
|
126
|
+
content: u(e)
|
|
122
127
|
}
|
|
123
128
|
] : []
|
|
124
129
|
];
|
|
125
130
|
return {
|
|
126
131
|
key: `row-${t}`,
|
|
127
|
-
data:
|
|
132
|
+
data: s
|
|
128
133
|
};
|
|
129
|
-
}),
|
|
130
|
-
if (!
|
|
131
|
-
const e =
|
|
132
|
-
return
|
|
134
|
+
}), V = (() => {
|
|
135
|
+
if (!h) return;
|
|
136
|
+
const e = h(), t = [];
|
|
137
|
+
return l && t.push({
|
|
133
138
|
key: "footer-select",
|
|
134
139
|
content: ""
|
|
135
|
-
}),
|
|
136
|
-
const
|
|
140
|
+
}), i.forEach((s, n) => {
|
|
141
|
+
const f = typeof s.key == "string" ? s.key : `column-${n}`;
|
|
137
142
|
t.push({
|
|
138
|
-
key: `footer-${
|
|
139
|
-
content: e[
|
|
143
|
+
key: `footer-${f}`,
|
|
144
|
+
content: e[f] || ""
|
|
140
145
|
});
|
|
141
|
-
}),
|
|
146
|
+
}), u && t.push({
|
|
142
147
|
key: "footer-actions",
|
|
143
148
|
content: ""
|
|
144
149
|
}), t;
|
|
145
150
|
})();
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
-
|
|
151
|
+
return /* @__PURE__ */ r(
|
|
152
|
+
y.Table,
|
|
148
153
|
{
|
|
149
|
-
"aria-label":
|
|
154
|
+
"aria-label": a,
|
|
150
155
|
"data-testid": "data-table",
|
|
151
156
|
headers: H,
|
|
152
|
-
rows:
|
|
153
|
-
footer:
|
|
154
|
-
emptyState:
|
|
155
|
-
isWithinBox:
|
|
156
|
-
hasCheckboxColumn: !!
|
|
157
|
+
rows: P,
|
|
158
|
+
footer: V,
|
|
159
|
+
emptyState: p ? p() : void 0,
|
|
160
|
+
isWithinBox: m,
|
|
161
|
+
hasCheckboxColumn: !!l
|
|
157
162
|
}
|
|
158
163
|
);
|
|
159
164
|
};
|
|
160
165
|
export {
|
|
161
|
-
|
|
166
|
+
U as DataTable
|
|
162
167
|
};
|
|
163
168
|
//# sourceMappingURL=DataTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","sources":["../../../../../src/components/Common/DataView/DataTable/DataTable.tsx"],"sourcesContent":["import { useId, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { useDataViewPropReturn, SelectionMode } from '../useDataView'\nimport { useSelectionState } from '../useSelectionState'\nimport type { TableData, TableRow, TableProps } from '../../UI/Table/TableTypes'\nimport { VisuallyHidden } from '../../VisuallyHidden'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport type DataTableProps<T> = {\n label: string\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n onSelectAll?: (checked: boolean, visibleData: T[]) => void\n getIsItemSelected?: (item: T) => boolean\n emptyState?: useDataViewPropReturn<T>['emptyState']\n footer?: useDataViewPropReturn<T>['footer']\n isWithinBox?: TableProps['isWithinBox']\n selectionMode?: SelectionMode\n}\n\nfunction getCellContent<T>(\n item: T,\n column: { key?: string | keyof T; render?: (item: T) => React.ReactNode },\n) {\n if (column.render) {\n return column.render(item)\n }\n\n if (column.key) {\n const key = column.key as keyof T\n return String(item[key] ?? '')\n }\n\n return ''\n}\n\nexport const DataTable = <T,>({\n label,\n data,\n columns,\n itemMenu,\n onSelect,\n onSelectAll,\n getIsItemSelected,\n emptyState,\n footer,\n isWithinBox,\n selectionMode = 'multiple',\n}: DataTableProps<T>) => {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const radioGroupName = useId()\n const [selectedRadioIndex, setSelectedRadioIndex] = useState<number | null>(null)\n const { allSelected } = useSelectionState(data, getIsItemSelected)\n\n const headers: TableData[] = [\n ...(onSelect\n ? [\n {\n key: 'select-header',\n content:\n selectionMode === 'multiple' && getIsItemSelected ? (\n // Stop propagation so the surrounding react-aria-components\n // <Column> press handler doesn't intercept the checkbox click\n // and desync the controlled DOM state. The inner <input> is\n // the actual interactive element; this span is a propagation\n // shield, not a click target itself.\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <span\n onClick={e => {\n e.stopPropagation()\n }}\n onPointerDown={e => {\n e.stopPropagation()\n }}\n onMouseDown={e => {\n e.stopPropagation()\n }}\n >\n <Components.Checkbox\n value={allSelected}\n onChange={(checked: boolean) => onSelectAll?.(checked, data)}\n label={t('table.selectAllRowsLabel')}\n shouldVisuallyHideLabel\n />\n </span>\n ) : (\n <VisuallyHidden>{t('table.selectRowHeader')}</VisuallyHidden>\n ),\n },\n ]\n : []),\n ...columns.map((column, index) => ({\n key: typeof column.key === 'string' ? column.key : `header-${index}`,\n content: column.title,\n })),\n ...(itemMenu\n ? [\n {\n key: 'actions-header',\n content: <VisuallyHidden>{t('table.actionsColumnHeader')}</VisuallyHidden>,\n },\n ]\n : []),\n ]\n\n const handleRadioSelect = (item: T, rowIndex: number) => {\n setSelectedRadioIndex(rowIndex)\n onSelect?.(item, true)\n }\n\n const renderSelectionControl = (item: T, rowIndex: number) => {\n if (selectionMode === 'single') {\n const isSelected = getIsItemSelected?.(item) ?? selectedRadioIndex === rowIndex\n return (\n <Components.Radio\n name={radioGroupName}\n value={isSelected}\n onChange={() => {\n handleRadioSelect(item, rowIndex)\n }}\n label={t('table.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n const isSelected = getIsItemSelected?.(item) ?? false\n return (\n <Components.Checkbox\n value={isSelected}\n onChange={(checked: boolean) => {\n onSelect?.(item, checked)\n }}\n label={t('table.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n const rows: TableRow[] = data.map((item, rowIndex) => {\n const rowData: TableData[] = [\n ...(onSelect\n ? [\n {\n key: `select-${rowIndex}`,\n content: renderSelectionControl(item, rowIndex),\n },\n ]\n : []),\n ...columns.map((column, colIndex) => {\n return {\n key: typeof column.key === 'string' ? column.key : `cell-${colIndex}`,\n content: getCellContent(item, column),\n }\n }),\n ...(itemMenu\n ? [\n {\n key: `menu-${rowIndex}`,\n content: itemMenu(item),\n },\n ]\n : []),\n ]\n\n return {\n key: `row-${rowIndex}`,\n data: rowData,\n }\n })\n\n const buildFooterData = () => {\n if (!footer) return undefined\n\n const footerContent = footer()\n const footerCells: TableData[] = []\n\n // Add select column footer (empty)\n if (onSelect) {\n footerCells.push({\n key: 'footer-select',\n content: '',\n })\n }\n\n // Add data column footers\n columns.forEach((column, index) => {\n const columnKey = typeof column.key === 'string' ? column.key : `column-${index}`\n footerCells.push({\n key: `footer-${columnKey}`,\n content: footerContent[columnKey] || '',\n })\n })\n\n // Add actions column footer (empty)\n if (itemMenu) {\n footerCells.push({\n key: 'footer-actions',\n content: '',\n })\n }\n\n return footerCells\n }\n\n const footerData = buildFooterData()\n\n return (\n <Components.Table\n aria-label={label}\n data-testid=\"data-table\"\n headers={headers}\n rows={rows}\n footer={footerData}\n emptyState={emptyState ? emptyState() : undefined}\n isWithinBox={isWithinBox}\n hasCheckboxColumn={!!onSelect}\n />\n )\n}\n"],"names":["getCellContent","item","column","key","DataTable","label","data","columns","itemMenu","onSelect","onSelectAll","getIsItemSelected","emptyState","footer","isWithinBox","selectionMode","Components","useComponentContext","t","useTranslation","radioGroupName","useId","selectedRadioIndex","setSelectedRadioIndex","useState","allSelected","useSelectionState","headers","jsx","checked","VisuallyHidden","index","handleRadioSelect","rowIndex","renderSelectionControl","isSelected","rows","rowData","colIndex","footerData","footerContent","footerCells","columnKey"],"mappings":";;;;;;AAsBA,SAASA,EACPC,GACAC,GACA;AACA,M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AAAA,MACC,cAAYX;AAAA,MACZ,eAAY;AAAA,MACZ,SAAAsB;AAAA,MACA,MAAAS;AAAA,MACA,QAAQG;AAAA,MACR,YAAY3B,IAAaA,EAAA,IAAe;AAAA,MACxC,aAAAE;AAAA,MACA,mBAAmB,CAAC,CAACL;AAAA,IAAA;AAAA,EAAA;AAG3B;"}
|
|
1
|
+
{"version":3,"file":"DataTable.js","sources":["../../../../../src/components/Common/DataView/DataTable/DataTable.tsx"],"sourcesContent":["import { useId, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { useDataViewPropReturn, SelectionMode } from '../useDataView'\nimport { useSelectionState } from '../useSelectionState'\nimport type { TableData, TableRow, TableProps } from '../../UI/Table/TableTypes'\nimport { VisuallyHidden } from '../../VisuallyHidden'\nimport styles from './DataTable.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nfunction withJustify(content: React.ReactNode, justify?: 'start' | 'end') {\n if (!justify || justify === 'start') return content\n return <div className={styles.cellEnd}>{content}</div>\n}\n\nexport type DataTableProps<T> = {\n label: string\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n onSelectAll?: (checked: boolean, visibleData: T[]) => void\n getIsItemSelected?: (item: T) => boolean\n hideSelectAll?: useDataViewPropReturn<T>['hideSelectAll']\n emptyState?: useDataViewPropReturn<T>['emptyState']\n footer?: useDataViewPropReturn<T>['footer']\n isWithinBox?: TableProps['isWithinBox']\n selectionMode?: SelectionMode\n}\n\nfunction getCellContent<T>(\n item: T,\n column: { key?: string | keyof T; render?: (item: T) => React.ReactNode },\n) {\n if (column.render) {\n return column.render(item)\n }\n\n if (column.key) {\n const key = column.key as keyof T\n return String(item[key] ?? '')\n }\n\n return ''\n}\n\nexport const DataTable = <T,>({\n label,\n data,\n columns,\n itemMenu,\n onSelect,\n onSelectAll,\n getIsItemSelected,\n hideSelectAll,\n emptyState,\n footer,\n isWithinBox,\n selectionMode = 'multiple',\n}: DataTableProps<T>) => {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const radioGroupName = useId()\n const [selectedRadioIndex, setSelectedRadioIndex] = useState<number | null>(null)\n const { allSelected } = useSelectionState(data, getIsItemSelected)\n\n const headers: TableData[] = [\n ...(onSelect\n ? [\n {\n key: 'select-header',\n content:\n selectionMode === 'multiple' &&\n getIsItemSelected &&\n !hideSelectAll &&\n data.length > 0 ? (\n // Stop propagation so the surrounding react-aria-components\n // <Column> press handler doesn't intercept the checkbox click\n // and desync the controlled DOM state. The inner <input> is\n // the actual interactive element; this span is a propagation\n // shield, not a click target itself.\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <span\n onClick={e => {\n e.stopPropagation()\n }}\n onPointerDown={e => {\n e.stopPropagation()\n }}\n onMouseDown={e => {\n e.stopPropagation()\n }}\n >\n <Components.Checkbox\n value={allSelected}\n onChange={(checked: boolean) => onSelectAll?.(checked, data)}\n label={t('table.selectAllRowsLabel')}\n shouldVisuallyHideLabel\n />\n </span>\n ) : (\n <VisuallyHidden>{t('table.selectRowHeader')}</VisuallyHidden>\n ),\n },\n ]\n : []),\n ...columns.map((column, index) => ({\n key: typeof column.key === 'string' ? column.key : `header-${index}`,\n content: withJustify(column.title, column.justify),\n })),\n ...(itemMenu\n ? [\n {\n key: 'actions-header',\n content: <VisuallyHidden>{t('table.actionsColumnHeader')}</VisuallyHidden>,\n },\n ]\n : []),\n ]\n\n const handleRadioSelect = (item: T, rowIndex: number) => {\n setSelectedRadioIndex(rowIndex)\n onSelect?.(item, true)\n }\n\n const renderSelectionControl = (item: T, rowIndex: number) => {\n if (selectionMode === 'single') {\n const isSelected = getIsItemSelected?.(item) ?? selectedRadioIndex === rowIndex\n return (\n <Components.Radio\n name={radioGroupName}\n value={isSelected}\n onChange={() => {\n handleRadioSelect(item, rowIndex)\n }}\n label={t('table.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n const isSelected = getIsItemSelected?.(item) ?? false\n return (\n <Components.Checkbox\n value={isSelected}\n onChange={(checked: boolean) => {\n onSelect?.(item, checked)\n }}\n label={t('table.selectRowLabel')}\n shouldVisuallyHideLabel\n />\n )\n }\n\n const rows: TableRow[] = data.map((item, rowIndex) => {\n const rowData: TableData[] = [\n ...(onSelect\n ? [\n {\n key: `select-${rowIndex}`,\n content: renderSelectionControl(item, rowIndex),\n },\n ]\n : []),\n ...columns.map((column, colIndex) => {\n return {\n key: typeof column.key === 'string' ? column.key : `cell-${colIndex}`,\n content: withJustify(getCellContent(item, column), column.justify),\n }\n }),\n ...(itemMenu\n ? [\n {\n key: `menu-${rowIndex}`,\n content: itemMenu(item),\n },\n ]\n : []),\n ]\n\n return {\n key: `row-${rowIndex}`,\n data: rowData,\n }\n })\n\n const buildFooterData = () => {\n if (!footer) return undefined\n\n const footerContent = footer()\n const footerCells: TableData[] = []\n\n // Add select column footer (empty)\n if (onSelect) {\n footerCells.push({\n key: 'footer-select',\n content: '',\n })\n }\n\n // Add data column footers\n columns.forEach((column, index) => {\n const columnKey = typeof column.key === 'string' ? column.key : `column-${index}`\n footerCells.push({\n key: `footer-${columnKey}`,\n content: footerContent[columnKey] || '',\n })\n })\n\n // Add actions column footer (empty)\n if (itemMenu) {\n footerCells.push({\n key: 'footer-actions',\n content: '',\n })\n }\n\n return footerCells\n }\n\n const footerData = buildFooterData()\n\n return (\n <Components.Table\n aria-label={label}\n data-testid=\"data-table\"\n headers={headers}\n rows={rows}\n footer={footerData}\n emptyState={emptyState ? emptyState() : undefined}\n isWithinBox={isWithinBox}\n hasCheckboxColumn={!!onSelect}\n />\n )\n}\n"],"names":["withJustify","content","justify","jsx","styles","getCellContent","item","column","key","DataTable","label","data","columns","itemMenu","onSelect","onSelectAll","getIsItemSelected","hideSelectAll","emptyState","footer","isWithinBox","selectionMode","Components","useComponentContext","t","useTranslation","radioGroupName","useId","selectedRadioIndex","setSelectedRadioIndex","useState","allSelected","useSelectionState","headers","checked","VisuallyHidden","index","handleRadioSelect","rowIndex","renderSelectionControl","isSelected","rows","rowData","colIndex","footerData","footerContent","footerCells","columnKey"],"mappings":";;;;;;;AASA,SAASA,EAAYC,GAA0BC,GAA2B;AACxE,SAAI,CAACA,KAAWA,MAAY,UAAgBD,IACrC,gBAAAE,EAAC,OAAA,EAAI,WAAWC,EAAO,SAAU,UAAAH,GAAQ;AAClD;AAiBA,SAASI,EACPC,GACAC,GACA;AACA,MAAIA,EAAO;AACT,WAAOA,EAAO,OAAOD,CAAI;AAG3B,MAAIC,EAAO,KAAK;AACd,UAAMC,IAAMD,EAAO;AACnB,WAAO,OAAOD,EAAKE,CAAG,KAAK,EAAE;AAAA,EAC/B;AAEA,SAAO;AACT;AAEO,MAAMC,IAAY,CAAK;AAAA,EAC5B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC,IAAgB;AAClB,MAAyB;AACvB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAiBC,EAAA,GACjB,CAACC,GAAoBC,CAAqB,IAAIC,EAAwB,IAAI,GAC1E,EAAE,aAAAC,EAAA,IAAgBC,EAAkBrB,GAAMK,CAAiB,GAE3DiB,IAAuB;AAAA,IAC3B,GAAInB,IACA;AAAA,MACE;AAAA,QACE,KAAK;AAAA,QACL,SACEO,MAAkB,cAClBL,KACA,CAACC,KACDN,EAAK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAOZ,gBAAAR;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAA,MAAK;AACZ,kBAAE,gBAAA;AAAA,cAC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