@gusto/embedded-react-sdk 0.56.2 → 0.56.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 +25 -0
- package/dist/components/Common/FieldCaption/FieldCaption.js +18 -24
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +3 -5
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +66 -62
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +9 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +6 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PaySchedule.js +60 -0
- package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js +67 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +59 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +57 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +46 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +101 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +81 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js +18 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +56 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +34 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js +77 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js +10 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +66 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +75 -57
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +6 -3
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js +15 -0
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js.map +1 -0
- package/dist/components/Company/exports/companyManagement.js +7 -0
- package/dist/components/Company/exports/companyManagement.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +6 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +28 -27
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +51 -58
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +12 -7
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +87 -85
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +55 -54
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +66 -62
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +129 -125
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +30 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +41 -30
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +159 -152
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +61 -59
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -31
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +16 -16
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +61 -61
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +192 -193
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +27 -22
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +55 -53
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -41
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.js +72 -67
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +37 -25
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +23 -22
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js +30 -0
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js.map +1 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +9 -8
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +2 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -0
- package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +18 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/i18n/en/common.json.js +36 -38
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +137 -135
- package/dist/index.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +39 -31
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +24 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.d.ts +10 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +35 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +29 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.d.ts +7 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.d.ts +12 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +20 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverview.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.d.ts +18 -0
- package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.d.ts +12 -0
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.d.ts +18 -0
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.test.d.ts +1 -0
- package/dist/src/components/Company/exports/companyManagement.d.ts +2 -0
- package/dist/src/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +12 -0
- package/dist/src/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +6 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +2 -2
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +6 -1
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +7 -1
- package/dist/src/components/Payroll/helpers.d.ts +34 -0
- package/dist/src/components/Payroll/usePreparedPayrollData.d.ts +6 -1
- package/dist/src/components/index.d.ts +12 -0
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.d.ts +14 -0
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.test.d.ts +1 -0
- package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +2 -0
- package/dist/src/helpers/dateFormatting.d.ts +2 -2
- package/dist/src/helpers/formattedStrings.d.ts +15 -0
- package/dist/src/i18n/en/common.json.d.ts +0 -1
- package/dist/src/i18n/types.d.ts +96 -6
- package/dist/src/models/external.d.ts +12 -0
- package/dist/src/shared/constants.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/types/sdkError.js +32 -21
- package/dist/types/sdkError.js.map +1 -1
- package/docs/guides/endpoint-inventory.json +59 -10
- package/package.json +7 -7
|
@@ -9,18 +9,21 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
|
9
9
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
|
+
import "dompurify";
|
|
13
|
+
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
12
14
|
import "../../../shared/constants.js";
|
|
13
15
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
17
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
18
|
+
const [v, x] = t("IndustryItems", {
|
|
16
19
|
items: []
|
|
17
|
-
}), [
|
|
20
|
+
}), [C, S] = t("IndustryApi", {
|
|
18
21
|
isPending: !1
|
|
19
22
|
});
|
|
20
23
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
S as IndustryApiStateProvider,
|
|
25
|
+
x as IndustryItemsProvider,
|
|
26
|
+
C as useIndustryApiState,
|
|
27
|
+
v as useIndustryItems
|
|
25
28
|
};
|
|
26
29
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
|
|
@@ -9,14 +9,17 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
|
9
9
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
|
+
import "dompurify";
|
|
13
|
+
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
12
14
|
import "../../../../shared/constants.js";
|
|
13
15
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
17
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
18
|
+
const [v, y] = o(
|
|
16
19
|
"CompanyDocumentFormContext"
|
|
17
20
|
);
|
|
18
21
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
y as LocationsFormProvider,
|
|
23
|
+
v as useLocationsForm
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=useLocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -9,14 +9,17 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
|
9
9
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
|
+
import "dompurify";
|
|
13
|
+
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
12
14
|
import "../../../../shared/constants.js";
|
|
13
15
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
17
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
18
|
+
const [y, D] = o(
|
|
16
19
|
"CompanyDocumentListContext"
|
|
17
20
|
);
|
|
18
21
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
D as LocationsListProvider,
|
|
23
|
+
y as useLocationsList
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n isFetching?: boolean\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n isFetching?: boolean\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -9,12 +9,15 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
|
9
9
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
|
+
import "dompurify";
|
|
13
|
+
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
12
14
|
import "../../../shared/constants.js";
|
|
13
15
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
17
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
18
|
+
const [s, u] = o("OnboardingOverviewContext");
|
|
16
19
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
u as OnboardingOverviewProvider,
|
|
21
|
+
s as useOnboardingOverview
|
|
19
22
|
};
|
|
20
23
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as p } from "robot3";
|
|
3
|
+
import { useState as h, useMemo as S } from "react";
|
|
4
|
+
import { usePaySchedulesGetAllSuspense as d } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
|
|
5
|
+
import { payScheduleManagementStateMachine as f } from "./payScheduleManagementStateMachine.js";
|
|
6
|
+
import { PayScheduleOverviewContextual as y, PayScheduleEditFormContextual as C } from "./PayScheduleManagementComponents.js";
|
|
7
|
+
import { BaseComponent as P } from "../../../Base/Base.js";
|
|
8
|
+
import { useBase as g } from "../../../Base/useBase.js";
|
|
9
|
+
import { useI18n as u, useComponentDictionary as v } from "../../../../i18n/I18n.js";
|
|
10
|
+
import { Flow as w } from "../../../Flow/Flow.js";
|
|
11
|
+
import { useUnstableFeature as M } from "../../../../contexts/UnstableFeaturesProvider/useUnstableFeature.js";
|
|
12
|
+
const k = ({
|
|
13
|
+
companyId: e,
|
|
14
|
+
enableAutoPilot: t,
|
|
15
|
+
enableMultipleSchedules: o,
|
|
16
|
+
dictionary: a,
|
|
17
|
+
...r
|
|
18
|
+
}) => (M("managePaySchedules", { throwIfDisabled: !0 }), /* @__PURE__ */ m(P, { ...r, children: /* @__PURE__ */ m(
|
|
19
|
+
x,
|
|
20
|
+
{
|
|
21
|
+
companyId: e,
|
|
22
|
+
enableAutoPilot: t,
|
|
23
|
+
enableMultipleSchedules: o,
|
|
24
|
+
dictionary: a
|
|
25
|
+
}
|
|
26
|
+
) }));
|
|
27
|
+
function x({
|
|
28
|
+
companyId: e,
|
|
29
|
+
enableAutoPilot: t,
|
|
30
|
+
enableMultipleSchedules: o,
|
|
31
|
+
dictionary: a
|
|
32
|
+
}) {
|
|
33
|
+
u("Company.Management.PaySchedule"), v("Company.Management.PaySchedule", a), u("Company.PaySchedule");
|
|
34
|
+
const { onEvent: r } = g(), { data: c } = d({ companyId: e }), [{ initialState: i, initialComponent: s }] = h(() => {
|
|
35
|
+
const n = (c.payScheduleShowResponse?.length ?? 0) > 0;
|
|
36
|
+
return {
|
|
37
|
+
initialState: n ? "overview" : "createSchedule",
|
|
38
|
+
initialComponent: n ? y : C
|
|
39
|
+
};
|
|
40
|
+
}), l = S(
|
|
41
|
+
() => p(
|
|
42
|
+
i,
|
|
43
|
+
f,
|
|
44
|
+
(n) => ({
|
|
45
|
+
...n,
|
|
46
|
+
component: s,
|
|
47
|
+
companyId: e,
|
|
48
|
+
enableAutoPilot: t,
|
|
49
|
+
enableMultipleSchedules: o,
|
|
50
|
+
successAlert: null
|
|
51
|
+
})
|
|
52
|
+
),
|
|
53
|
+
[e, t, o, i, s]
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ m(w, { machine: l, onEvent: r });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
k as PaySchedule
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=PaySchedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaySchedule.js","sources":["../../../../../src/components/Company/PaySchedule/management/PaySchedule.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { payScheduleManagementStateMachine } from './payScheduleManagementStateMachine'\nimport type { PayScheduleManagementContextInterface } from './PayScheduleManagementComponents'\nimport {\n PayScheduleOverviewContextual,\n PayScheduleEditFormContextual,\n} from './PayScheduleManagementComponents'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useUnstableFeature } from '@/contexts/UnstableFeaturesProvider/useUnstableFeature'\n\n/**\n * Props for {@link PaySchedule}.\n *\n * @alpha\n */\nexport interface PayScheduleProps extends BaseComponentInterface<'Company.Management.PaySchedule'> {\n /** Company whose pay schedule is managed. */\n companyId: string\n /** Shows the AutoPilot row and its Edit action. */\n enableAutoPilot?: boolean\n /** Shows the Manage action. */\n enableMultipleSchedules?: boolean\n}\n\n/**\n * Manages a company's pay schedule after onboarding.\n *\n * @remarks\n * Renders the overview when the company already has a pay schedule, or the create form\n * directly when it doesn't.\n *\n * @alpha\n */\nexport const PaySchedule = ({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n ...props\n}: PayScheduleProps) => {\n useUnstableFeature('managePaySchedules', { throwIfDisabled: true })\n\n return (\n <BaseComponent {...props}>\n <Root\n companyId={companyId}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n dictionary={dictionary}\n />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n}: Omit<PayScheduleProps, BaseComponentKeys>) {\n useI18n('Company.Management.PaySchedule')\n useComponentDictionary('Company.Management.PaySchedule', dictionary)\n // PayScheduleEditFormContextual reuses the onboarding PayScheduleForm, whose translations\n // live under its own namespace and are otherwise never loaded from this flow.\n useI18n('Company.PaySchedule')\n const { onEvent } = useBase()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n\n /**\n * Freeze the initial routing decision. Recomputing it after a later refetch (e.g. once the\n * first schedule is created) would re-seat the machine and orphan its interpreter.\n */\n const [{ initialState, initialComponent }] = useState<{\n initialState: keyof typeof payScheduleManagementStateMachine\n initialComponent: typeof PayScheduleOverviewContextual | typeof PayScheduleEditFormContextual\n }>(() => {\n const hasSchedules = (paySchedules.payScheduleShowResponse?.length ?? 0) > 0\n return {\n initialState: hasSchedules ? 'overview' : 'createSchedule',\n initialComponent: hasSchedules\n ? PayScheduleOverviewContextual\n : PayScheduleEditFormContextual,\n }\n })\n\n const machine = useMemo(\n () =>\n createMachine(\n initialState,\n payScheduleManagementStateMachine,\n (initialContext: PayScheduleManagementContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert: null,\n }),\n ),\n [companyId, enableAutoPilot, enableMultipleSchedules, initialState, initialComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["PaySchedule","companyId","enableAutoPilot","enableMultipleSchedules","dictionary","props","useUnstableFeature","jsx","BaseComponent","Root","useI18n","useComponentDictionary","onEvent","useBase","paySchedules","usePaySchedulesGetAllSuspense","initialState","initialComponent","useState","hasSchedules","PayScheduleOverviewContextual","PayScheduleEditFormContextual","machine","useMemo","createMachine","payScheduleManagementStateMachine","initialContext","Flow"],"mappings":";;;;;;;;;;;AAwCO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,EAAmB,sBAAsB,EAAE,iBAAiB,GAAA,CAAM,GAGhE,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GACjB,UAAA,gBAAAE;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAAR;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,YAAAC;AAAA,EAAA;AAAA,GAEJ;AAIJ,SAASK,EAAK;AAAA,EACZ,WAAAR;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAC;AACF,GAA8C;AAC5C,EAAAM,EAAQ,gCAAgC,GACxCC,EAAuB,kCAAkCP,CAAU,GAGnEM,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAE,EAAA,IAAYC,EAAA,GACd,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAd,GAAW,GAMpE,CAAC,EAAE,cAAAe,GAAc,kBAAAC,GAAkB,IAAIC,EAG1C,MAAM;AACP,UAAMC,KAAgBL,EAAa,yBAAyB,UAAU,KAAK;AAC3E,WAAO;AAAA,MACL,cAAcK,IAAe,aAAa;AAAA,MAC1C,kBAAkBA,IACdC,IACAC;AAAA,IAAA;AAAA,EAER,CAAC,GAEKC,IAAUC;AAAA,IACd,MACEC;AAAA,MACER;AAAA,MACAS;AAAA,MACA,CAACC,OAA2D;AAAA,QAC1D,GAAGA;AAAA,QACH,WAAWT;AAAA,QACX,WAAAhB;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,QACA,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAEJ,CAACF,GAAWC,GAAiBC,GAAyBa,GAAcC,CAAgB;AAAA,EAAA;AAGtF,SAAO,gBAAAV,EAACoB,GAAA,EAAK,SAAAL,GAAkB,SAAAV,EAAA,CAAkB;AACnD;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
|
+
import { Flex as d } from "../../../../Common/Flex/Flex.js";
|
|
4
|
+
import { ActionsLayout as m } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as p } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { useDateFormatter as y } from "../../../../../hooks/useDateFormatter.js";
|
|
7
|
+
import { useDataView as P } from "../../../../Common/DataView/useDataView.js";
|
|
8
|
+
import { DataView as c } from "../../../../Common/DataView/DataView.js";
|
|
9
|
+
function f({
|
|
10
|
+
employeeChanges: r
|
|
11
|
+
}) {
|
|
12
|
+
const { t } = l("Company.Management.PayScheduleAssignment"), a = y(), o = P({
|
|
13
|
+
data: r,
|
|
14
|
+
columns: [
|
|
15
|
+
{
|
|
16
|
+
title: t("reviewStep.nameLabel"),
|
|
17
|
+
key: "firstName",
|
|
18
|
+
render: (e) => [e.firstName, e.lastName].filter(Boolean).join(" ")
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: t("reviewStep.payFrequencyLabel"),
|
|
22
|
+
key: "payFrequency",
|
|
23
|
+
render: (e) => e.payFrequency
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: t("reviewStep.firstPayPeriodLabel"),
|
|
27
|
+
key: "firstPayPeriod",
|
|
28
|
+
render: (e) => e.firstPayPeriod ? a.formatPayPeriodRange(
|
|
29
|
+
e.firstPayPeriod.startDate,
|
|
30
|
+
e.firstPayPeriod.endDate
|
|
31
|
+
) : null
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: t("reviewStep.transitionPayPeriodLabel"),
|
|
35
|
+
key: "transitionPayPeriod",
|
|
36
|
+
render: (e) => e.transitionPayPeriod ? a.formatPayPeriodRange(
|
|
37
|
+
e.transitionPayPeriod.startDate,
|
|
38
|
+
e.transitionPayPeriod.endDate
|
|
39
|
+
) : t("reviewStep.noTransitionNeeded")
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ i(c, { label: t("reviewStep.employeeChangesHeading"), ...o });
|
|
44
|
+
}
|
|
45
|
+
function b({
|
|
46
|
+
employeeChanges: r,
|
|
47
|
+
isSubmitting: t,
|
|
48
|
+
onBack: a,
|
|
49
|
+
onSubmit: o
|
|
50
|
+
}) {
|
|
51
|
+
const { t: e } = l("Company.Management.PayScheduleAssignment"), n = p();
|
|
52
|
+
return /* @__PURE__ */ s(d, { flexDirection: "column", gap: 32, children: [
|
|
53
|
+
/* @__PURE__ */ i(n.Heading, { as: "h2", children: r.length === 0 ? e("reviewStep.noChangesHeading") : e("reviewStep.heading") }),
|
|
54
|
+
r.length === 0 ? /* @__PURE__ */ i(n.Text, { variant: "supporting", children: e("reviewStep.noChangesDescription") }) : /* @__PURE__ */ s(d, { flexDirection: "column", gap: 16, children: [
|
|
55
|
+
/* @__PURE__ */ i(n.Text, { weight: "semibold", children: e("reviewStep.employeeChangesHeading") }),
|
|
56
|
+
/* @__PURE__ */ i(f, { employeeChanges: r })
|
|
57
|
+
] }),
|
|
58
|
+
/* @__PURE__ */ s(m, { children: [
|
|
59
|
+
/* @__PURE__ */ i(n.Button, { variant: "secondary", onClick: a, isDisabled: t, children: e("backCta") }),
|
|
60
|
+
/* @__PURE__ */ i(n.Button, { variant: "primary", onClick: o, isLoading: t, children: e("submitCta") })
|
|
61
|
+
] })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
b as AssignmentReviewStepPresentation
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=AssignmentReviewStepPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignmentReviewStepPresentation.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleAssignmentEmployeeChange } from '@gusto/embedded-api/models/components/payscheduleassignmentemployeechange'\nimport { Flex, ActionsLayout, DataView, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\n/** @internal */\nexport interface AssignmentReviewStepPresentationProps {\n employeeChanges: PayScheduleAssignmentEmployeeChange[]\n isSubmitting: boolean\n onBack: () => void\n onSubmit: () => void\n}\n\nfunction EmployeeChangesTable({\n employeeChanges,\n}: {\n employeeChanges: PayScheduleAssignmentEmployeeChange[]\n}) {\n const { t } = useTranslation('Company.Management.PayScheduleAssignment')\n const dateFormatter = useDateFormatter()\n\n const dataViewProps = useDataView({\n data: employeeChanges,\n columns: [\n {\n title: t('reviewStep.nameLabel'),\n key: 'firstName',\n render: change => [change.firstName, change.lastName].filter(Boolean).join(' '),\n },\n {\n title: t('reviewStep.payFrequencyLabel'),\n key: 'payFrequency',\n render: change => change.payFrequency,\n },\n {\n title: t('reviewStep.firstPayPeriodLabel'),\n key: 'firstPayPeriod',\n render: change =>\n change.firstPayPeriod\n ? dateFormatter.formatPayPeriodRange(\n change.firstPayPeriod.startDate,\n change.firstPayPeriod.endDate,\n )\n : null,\n },\n {\n title: t('reviewStep.transitionPayPeriodLabel'),\n key: 'transitionPayPeriod',\n render: change =>\n change.transitionPayPeriod\n ? dateFormatter.formatPayPeriodRange(\n change.transitionPayPeriod.startDate,\n change.transitionPayPeriod.endDate,\n )\n : t('reviewStep.noTransitionNeeded'),\n },\n ],\n })\n\n return <DataView label={t('reviewStep.employeeChangesHeading')} {...dataViewProps} />\n}\n\n/** @internal */\nexport function AssignmentReviewStepPresentation({\n employeeChanges,\n isSubmitting,\n onBack,\n onSubmit,\n}: AssignmentReviewStepPresentationProps) {\n const { t } = useTranslation('Company.Management.PayScheduleAssignment')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">\n {employeeChanges.length === 0 ? t('reviewStep.noChangesHeading') : t('reviewStep.heading')}\n </Components.Heading>\n {employeeChanges.length === 0 ? (\n <Components.Text variant=\"supporting\">\n {t('reviewStep.noChangesDescription')}\n </Components.Text>\n ) : (\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Text weight=\"semibold\">\n {t('reviewStep.employeeChangesHeading')}\n </Components.Text>\n <EmployeeChangesTable employeeChanges={employeeChanges} />\n </Flex>\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack} isDisabled={isSubmitting}>\n {t('backCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" onClick={onSubmit} isLoading={isSubmitting}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["EmployeeChangesTable","employeeChanges","useTranslation","dateFormatter","useDateFormatter","dataViewProps","useDataView","change","DataView","AssignmentReviewStepPresentation","isSubmitting","onBack","onSubmit","t","Components","useComponentContext","jsxs","Flex","jsx","ActionsLayout"],"mappings":";;;;;;;;AAcA,SAASA,EAAqB;AAAA,EAC5B,iBAAAC;AACF,GAEG;AACD,QAAM,EAAE,EAAA,IAAMC,EAAe,0CAA0C,GACjEC,IAAgBC,EAAA,GAEhBC,IAAgBC,EAAY;AAAA,IAChC,MAAML;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAO,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAAM,MAAU,CAACA,EAAO,WAAWA,EAAO,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAAA;AAAA,MAEhF;AAAA,QACE,OAAO,EAAE,8BAA8B;AAAA,QACvC,KAAK;AAAA,QACL,QAAQ,OAAUA,EAAO;AAAA,MAAA;AAAA,MAE3B;AAAA,QACE,OAAO,EAAE,gCAAgC;AAAA,QACzC,KAAK;AAAA,QACL,QAAQ,CAAAA,MACNA,EAAO,iBACHJ,EAAc;AAAA,UACZI,EAAO,eAAe;AAAA,UACtBA,EAAO,eAAe;AAAA,QAAA,IAExB;AAAA,MAAA;AAAA,MAER;AAAA,QACE,OAAO,EAAE,qCAAqC;AAAA,QAC9C,KAAK;AAAA,QACL,QAAQ,CAAAA,MACNA,EAAO,sBACHJ,EAAc;AAAA,UACZI,EAAO,oBAAoB;AAAA,UAC3BA,EAAO,oBAAoB;AAAA,QAAA,IAE7B,EAAE,+BAA+B;AAAA,MAAA;AAAA,IACzC;AAAA,EACF,CACD;AAED,2BAAQC,GAAA,EAAS,OAAO,EAAE,mCAAmC,GAAI,GAAGH,GAAe;AACrF;AAGO,SAASI,EAAiC;AAAA,EAC/C,iBAAAR;AAAA,EACA,cAAAS;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AACF,GAA0C;AACxC,QAAM,EAAE,GAAAC,EAAA,IAAMX,EAAe,0CAA0C,GACjEY,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACJ,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAb,EAAgB,WAAW,IAAIY,EAAE,6BAA6B,IAAIA,EAAE,oBAAoB,GAC3F;AAAA,IACCZ,EAAgB,WAAW,sBACzBa,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAAD,EAAE,iCAAiC,GACtC,IAEA,gBAAAG,EAACC,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,MAAA,gBAAAC,EAACJ,EAAW,MAAX,EAAgB,QAAO,YACrB,UAAAD,EAAE,mCAAmC,GACxC;AAAA,MACA,gBAAAK,EAAClB,KAAqB,iBAAAC,EAAA,CAAkC;AAAA,IAAA,GAC1D;AAAA,sBAEDkB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAAQ,YAAYD,GACjE,UAAAG,EAAE,SAAS,EAAA,CACd;AAAA,MACA,gBAAAK,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASF,GAAU,WAAWF,GAChE,UAAAG,EAAE,WAAW,EAAA,CAChB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { z as l } from "zod";
|
|
3
|
+
import { useForm as h, FormProvider as f } from "react-hook-form";
|
|
4
|
+
import { zodResolver as S } from "@hookform/resolvers/zod";
|
|
5
|
+
import { useTranslation as y } from "react-i18next";
|
|
6
|
+
import { Flex as d } from "../../../../Common/Flex/Flex.js";
|
|
7
|
+
import { ActionsLayout as b } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
|
+
import { Form as g } from "../../../../Common/Form/Form.js";
|
|
9
|
+
import { useComponentContext as v } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { SelectField as C } from "../../../../Common/Fields/SelectField/SelectField.js";
|
|
11
|
+
const P = l.object({
|
|
12
|
+
defaultPayScheduleUuid: l.string().min(1)
|
|
13
|
+
});
|
|
14
|
+
function x(t) {
|
|
15
|
+
return [t.customName, t.frequency].filter(Boolean).join(" — ");
|
|
16
|
+
}
|
|
17
|
+
function q({
|
|
18
|
+
schedules: t,
|
|
19
|
+
defaultPayScheduleUuid: c,
|
|
20
|
+
onBack: u,
|
|
21
|
+
onAddPaySchedule: m,
|
|
22
|
+
onContinue: s
|
|
23
|
+
}) {
|
|
24
|
+
const { t: o } = y("Company.Management.PayScheduleAssignment"), n = v(), a = h({
|
|
25
|
+
resolver: S(P),
|
|
26
|
+
defaultValues: { defaultPayScheduleUuid: c ?? t[0]?.uuid ?? "" }
|
|
27
|
+
}), p = a.handleSubmit(({ defaultPayScheduleUuid: i }) => {
|
|
28
|
+
s(i);
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ e(f, { ...a, children: /* @__PURE__ */ e(g, { onSubmit: () => {
|
|
31
|
+
p();
|
|
32
|
+
}, children: /* @__PURE__ */ r(d, { flexDirection: "column", gap: 32, children: [
|
|
33
|
+
/* @__PURE__ */ e(n.Heading, { as: "h2", children: o("scheduleStep.heading") }),
|
|
34
|
+
/* @__PURE__ */ r(d, { flexDirection: "column", gap: 12, children: [
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
C,
|
|
37
|
+
{
|
|
38
|
+
name: "defaultPayScheduleUuid",
|
|
39
|
+
label: o("scheduleStep.payScheduleLabel"),
|
|
40
|
+
description: o("scheduleStep.payScheduleDescription"),
|
|
41
|
+
placeholder: "",
|
|
42
|
+
options: t.map((i) => ({
|
|
43
|
+
value: i.uuid,
|
|
44
|
+
label: x(i)
|
|
45
|
+
}))
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(n.Button, { variant: "secondary", onClick: m, children: o("scheduleStep.addPayScheduleCta") }) })
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ r(b, { children: [
|
|
51
|
+
/* @__PURE__ */ e(n.Button, { variant: "secondary", onClick: u, children: o("backCta") }),
|
|
52
|
+
/* @__PURE__ */ e(n.Button, { variant: "primary", type: "submit", isDisabled: t.length === 0, children: o("continueCta") })
|
|
53
|
+
] })
|
|
54
|
+
] }) }) });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
q as AssignmentScheduleStepPresentation
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=AssignmentScheduleStepPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignmentScheduleStepPresentation.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useForm, FormProvider } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { Flex, SelectField, ActionsLayout } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport interface AssignmentScheduleStepPresentationProps {\n schedules: PayScheduleShow[]\n defaultPayScheduleUuid?: string\n onBack: () => void\n onAddPaySchedule: () => void\n onContinue: (defaultPayScheduleUuid: string) => void\n}\n\nconst ScheduleStepSchema = z.object({\n defaultPayScheduleUuid: z.string().min(1),\n})\n\ntype ScheduleStepInputs = z.infer<typeof ScheduleStepSchema>\n\nfunction scheduleLabel(schedule: PayScheduleShow): string {\n return [schedule.customName, schedule.frequency].filter(Boolean).join(' — ')\n}\n\n/** @internal */\nexport function AssignmentScheduleStepPresentation({\n schedules,\n defaultPayScheduleUuid,\n onBack,\n onAddPaySchedule,\n onContinue,\n}: AssignmentScheduleStepPresentationProps) {\n const { t } = useTranslation('Company.Management.PayScheduleAssignment')\n const Components = useComponentContext()\n\n const formMethods = useForm<ScheduleStepInputs>({\n resolver: zodResolver(ScheduleStepSchema),\n defaultValues: { defaultPayScheduleUuid: defaultPayScheduleUuid ?? schedules[0]?.uuid ?? '' },\n })\n\n const handleSubmit = formMethods.handleSubmit(({ defaultPayScheduleUuid: uuid }) => {\n onContinue(uuid)\n })\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{t('scheduleStep.heading')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={12}>\n <SelectField\n name=\"defaultPayScheduleUuid\"\n label={t('scheduleStep.payScheduleLabel')}\n description={t('scheduleStep.payScheduleDescription')}\n placeholder=\"\"\n options={schedules.map(schedule => ({\n value: schedule.uuid,\n label: scheduleLabel(schedule),\n }))}\n />\n <div>\n <Components.Button variant=\"secondary\" onClick={onAddPaySchedule}>\n {t('scheduleStep.addPayScheduleCta')}\n </Components.Button>\n </div>\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={schedules.length === 0}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["ScheduleStepSchema","z","scheduleLabel","schedule","AssignmentScheduleStepPresentation","schedules","defaultPayScheduleUuid","onBack","onAddPaySchedule","onContinue","t","useTranslation","Components","useComponentContext","formMethods","useForm","zodResolver","handleSubmit","uuid","FormProvider","jsx","Form","jsxs","Flex","SelectField","ActionsLayout"],"mappings":";;;;;;;;;;AAkBA,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EAClC,wBAAwBA,EAAE,OAAA,EAAS,IAAI,CAAC;AAC1C,CAAC;AAID,SAASC,EAAcC,GAAmC;AACxD,SAAO,CAACA,EAAS,YAAYA,EAAS,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK;AAC7E;AAGO,SAASC,EAAmC;AAAA,EACjD,WAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,YAAAC;AACF,GAA4C;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0CAA0C,GACjEC,IAAaC,EAAA,GAEbC,IAAcC,EAA4B;AAAA,IAC9C,UAAUC,EAAYhB,CAAkB;AAAA,IACxC,eAAe,EAAE,wBAAwBM,KAA0BD,EAAU,CAAC,GAAG,QAAQ,GAAA;AAAA,EAAG,CAC7F,GAEKY,IAAeH,EAAY,aAAa,CAAC,EAAE,wBAAwBI,QAAW;AAClF,IAAAT,EAAWS,CAAI;AAAA,EACjB,CAAC;AAED,2BACGC,GAAA,EAAc,GAAGL,GAChB,UAAA,gBAAAM,EAACC,KAAK,UAAU,MAAA;AAAM,IAAKJ;KACzB,UAAA,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,sBAAsB,GAAE;AAAA,IACvD,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,MAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOd,EAAE,+BAA+B;AAAA,UACxC,aAAaA,EAAE,qCAAqC;AAAA,UACpD,aAAY;AAAA,UACZ,SAASL,EAAU,IAAI,CAAAF,OAAa;AAAA,YAClC,OAAOA,EAAS;AAAA,YAChB,OAAOD,EAAcC,CAAQ;AAAA,UAAA,EAC7B;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJ,gBAAAiB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAAE,EAAE,gCAAgC,GACrC,EAAA,CACF;AAAA,IAAA,GACF;AAAA,sBACCe,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASL,GAC7C,UAAAG,EAAE,SAAS,EAAA,CACd;AAAA,MACA,gBAAAU,EAACR,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYP,EAAU,WAAW,GACjF,UAAAK,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { z as p } from "zod";
|
|
3
|
+
import { useForm as u, FormProvider as y } from "react-hook-form";
|
|
4
|
+
import { zodResolver as h } from "@hookform/resolvers/zod";
|
|
5
|
+
import { useTranslation as f } from "react-i18next";
|
|
6
|
+
import { PayScheduleAssignmentBodyType as i } from "@gusto/embedded-api/models/components/payscheduleassignmentbody";
|
|
7
|
+
import { Flex as l } from "../../../../Common/Flex/Flex.js";
|
|
8
|
+
import { ActionsLayout as S } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
+
import { Form as g } from "../../../../Common/Form/Form.js";
|
|
10
|
+
import { useComponentContext as b } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { RadioGroupField as v } from "../../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
12
|
+
const x = p.object({
|
|
13
|
+
type: p.literal(i.Single)
|
|
14
|
+
});
|
|
15
|
+
function L({
|
|
16
|
+
defaultType: m = i.Single,
|
|
17
|
+
onBack: a,
|
|
18
|
+
onContinue: s
|
|
19
|
+
}) {
|
|
20
|
+
const { t: e } = f("Company.Management.PayScheduleAssignment"), o = b(), r = u({
|
|
21
|
+
resolver: h(x),
|
|
22
|
+
defaultValues: { type: m }
|
|
23
|
+
}), c = r.handleSubmit(({ type: d }) => {
|
|
24
|
+
s(d);
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ t(y, { ...r, children: /* @__PURE__ */ t(g, { onSubmit: () => {
|
|
27
|
+
c();
|
|
28
|
+
}, children: /* @__PURE__ */ n(l, { flexDirection: "column", gap: 32, children: [
|
|
29
|
+
/* @__PURE__ */ n(l, { flexDirection: "column", gap: 4, children: [
|
|
30
|
+
/* @__PURE__ */ t(o.Heading, { as: "h2", children: e("typeStep.heading") }),
|
|
31
|
+
/* @__PURE__ */ t(o.Text, { variant: "supporting", children: e("typeStep.description") })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ t(
|
|
34
|
+
v,
|
|
35
|
+
{
|
|
36
|
+
name: "type",
|
|
37
|
+
label: e("typeStep.heading"),
|
|
38
|
+
shouldVisuallyHideLabel: !0,
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
value: i.Single,
|
|
42
|
+
label: e("typeStep.options.single.label"),
|
|
43
|
+
description: e("typeStep.options.single.description")
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ n(S, { children: [
|
|
49
|
+
/* @__PURE__ */ t(o.Button, { variant: "secondary", onClick: a, children: e("backCta") }),
|
|
50
|
+
/* @__PURE__ */ t(o.Button, { variant: "primary", type: "submit", children: e("continueCta") })
|
|
51
|
+
] })
|
|
52
|
+
] }) }) });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
L as AssignmentTypeStepPresentation
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=AssignmentTypeStepPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignmentTypeStepPresentation.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useForm, FormProvider } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTranslation } from 'react-i18next'\nimport { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody'\nimport { Flex, RadioGroupField, ActionsLayout } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport interface AssignmentTypeStepPresentationProps {\n defaultType?: typeof PayScheduleAssignmentBodyType.Single\n onBack: () => void\n onContinue: (type: PayScheduleAssignmentBodyType) => void\n}\n\nconst TypeStepSchema = z.object({\n type: z.literal(PayScheduleAssignmentBodyType.Single),\n})\n\ntype TypeStepInputs = z.infer<typeof TypeStepSchema>\n\n/** @internal */\nexport function AssignmentTypeStepPresentation({\n defaultType = PayScheduleAssignmentBodyType.Single,\n onBack,\n onContinue,\n}: AssignmentTypeStepPresentationProps) {\n const { t } = useTranslation('Company.Management.PayScheduleAssignment')\n const Components = useComponentContext()\n\n const formMethods = useForm<TypeStepInputs>({\n resolver: zodResolver(TypeStepSchema),\n defaultValues: { type: defaultType },\n })\n\n const handleSubmit = formMethods.handleSubmit(({ type }) => {\n onContinue(type)\n })\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">{t('typeStep.heading')}</Components.Heading>\n <Components.Text variant=\"supporting\">{t('typeStep.description')}</Components.Text>\n </Flex>\n <RadioGroupField\n name=\"type\"\n label={t('typeStep.heading')}\n shouldVisuallyHideLabel\n options={[\n {\n value: PayScheduleAssignmentBodyType.Single,\n label: t('typeStep.options.single.label'),\n description: t('typeStep.options.single.description'),\n },\n ]}\n />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["TypeStepSchema","z","PayScheduleAssignmentBodyType","AssignmentTypeStepPresentation","defaultType","onBack","onContinue","t","useTranslation","Components","useComponentContext","formMethods","useForm","zodResolver","handleSubmit","type","FormProvider","jsx","Form","jsxs","Flex","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,IAAiBC,EAAE,OAAO;AAAA,EAC9B,MAAMA,EAAE,QAAQC,EAA8B,MAAM;AACtD,CAAC;AAKM,SAASC,EAA+B;AAAA,EAC7C,aAAAC,IAAcF,EAA8B;AAAA,EAC5C,QAAAG;AAAA,EACA,YAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0CAA0C,GACjEC,IAAaC,EAAA,GAEbC,IAAcC,EAAwB;AAAA,IAC1C,UAAUC,EAAYb,CAAc;AAAA,IACpC,eAAe,EAAE,MAAMI,EAAA;AAAA,EAAY,CACpC,GAEKU,IAAeH,EAAY,aAAa,CAAC,EAAE,MAAAI,QAAW;AAC1D,IAAAT,EAAWS,CAAI;AAAA,EACjB,CAAC;AAED,2BACGC,GAAA,EAAc,GAAGL,GAChB,UAAA,gBAAAM,EAACC,KAAK,UAAU,MAAA;AAAM,IAAKJ;KACzB,UAAA,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAH,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,kBAAkB,GAAE;AAAA,MACnD,gBAAAU,EAACR,EAAW,MAAX,EAAgB,SAAQ,cAAc,UAAAF,EAAE,sBAAsB,EAAA,CAAE;AAAA,IAAA,GACnE;AAAA,IACA,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOd,EAAE,kBAAkB;AAAA,QAC3B,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAOL,EAA8B;AAAA,YACrC,OAAOK,EAAE,+BAA+B;AAAA,YACxC,aAAaA,EAAE,qCAAqC;AAAA,UAAA;AAAA,QACtD;AAAA,MACF;AAAA,IAAA;AAAA,sBAEDe,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAAE,EAAE,SAAS,EAAA,CACd;AAAA,MACA,gBAAAU,EAACR,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UACvC,UAAAF,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as p } from "robot3";
|
|
3
|
+
import { useEffect as u, useMemo as f } from "react";
|
|
4
|
+
import { useGustoEmbeddedContext as l } from "@gusto/embedded-api/react-query/_context";
|
|
5
|
+
import { payScheduleAssignmentStateMachine as d } from "./payScheduleAssignmentStateMachine.js";
|
|
6
|
+
import { AssignmentTypeStep as h } from "./PayScheduleAssignmentComponents.js";
|
|
7
|
+
import { stripNullAssignmentPreviewFields as i } from "./stripNullAssignmentPreviewFields.js";
|
|
8
|
+
import { Flow as g } from "../../../../Flow/Flow.js";
|
|
9
|
+
import { BaseComponent as y } from "../../../../Base/Base.js";
|
|
10
|
+
import { useBase as S } from "../../../../Base/useBase.js";
|
|
11
|
+
import { useI18n as a, useComponentDictionary as A } from "../../../../../i18n/I18n.js";
|
|
12
|
+
import { useUnstableFeature as C } from "../../../../../contexts/UnstableFeaturesProvider/useUnstableFeature.js";
|
|
13
|
+
const j = ({
|
|
14
|
+
companyId: o,
|
|
15
|
+
dictionary: t,
|
|
16
|
+
...n
|
|
17
|
+
}) => (C("managePaySchedules", { throwIfDisabled: !0 }), /* @__PURE__ */ s(y, { ...n, children: /* @__PURE__ */ s(P, { companyId: o, dictionary: t }) }));
|
|
18
|
+
function P({ companyId: o, dictionary: t }) {
|
|
19
|
+
a("Company.Management.PayScheduleAssignment"), A("Company.Management.PayScheduleAssignment", t), a("Company.PaySchedule");
|
|
20
|
+
const { onEvent: n } = S(), r = l();
|
|
21
|
+
u(() => {
|
|
22
|
+
const e = r._options.hooks;
|
|
23
|
+
if (e)
|
|
24
|
+
return e.registerAfterSuccessHook(i), () => {
|
|
25
|
+
const m = e.afterSuccessHooks.indexOf(i);
|
|
26
|
+
m !== -1 && e.afterSuccessHooks.splice(m, 1);
|
|
27
|
+
};
|
|
28
|
+
}, [r]);
|
|
29
|
+
const c = f(
|
|
30
|
+
() => p(
|
|
31
|
+
"assignmentType",
|
|
32
|
+
d,
|
|
33
|
+
(e) => ({
|
|
34
|
+
...e,
|
|
35
|
+
component: h,
|
|
36
|
+
companyId: o
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
[o]
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ s(g, { machine: c, onEvent: n });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
j as PayScheduleAssignment
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=PayScheduleAssignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayScheduleAssignment.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useEffect, useMemo } from 'react'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport { payScheduleAssignmentStateMachine } from './payScheduleAssignmentStateMachine'\nimport { AssignmentTypeStep } from './PayScheduleAssignmentComponents'\nimport type { PayScheduleAssignmentContextInterface } from './usePayScheduleAssignment'\nimport { stripNullAssignmentPreviewFields } from './stripNullAssignmentPreviewFields'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useUnstableFeature } from '@/contexts/UnstableFeaturesProvider/useUnstableFeature'\n\n/**\n * Props for {@link PayScheduleAssignment}.\n *\n * @alpha\n */\nexport interface PayScheduleAssignmentProps extends BaseComponentInterface<'Company.Management.PayScheduleAssignment'> {\n /** Company whose pay schedule assignment is managed. */\n companyId: string\n}\n\n/**\n * Assigns a company's employees to a pay schedule.\n *\n * @remarks\n * Walks through choosing an assignment type, picking (or creating) a pay schedule, and reviewing\n * the employees and transition payrolls affected before submitting. Only the single-schedule\n * assignment type is currently supported. Can be mounted directly or launched from\n * `CompanyManagement.PaySchedule`'s Manage action.\n *\n * The internal step-to-step selection events (assignment type chosen, schedule picked) also\n * bubble through `onEvent` as a side effect of how the underlying `Flow` re-emits every event —\n * they carry no information a host needs mid-flow, since `assigned` reports the final outcome,\n * so they're intentionally left out of the table below.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `paySchedule/create` | The user chose to add a new pay schedule from the picker step | — |\n * | `paySchedule/created` | A new pay schedule was created from the picker step | `{ paySchedule: PayScheduleShow }` |\n * | `paySchedule/management/assignment/cancel` | The user backed out of the flow entirely, from the first step | — |\n * | `paySchedule/management/assignment/assigned` | The assignment was submitted successfully | `{ type: PayScheduleAssignmentBodyType; defaultPayScheduleUuid: string; employeeChanges: PayScheduleAssignmentEmployeeChange[] }` |\n *\n * @alpha\n */\nexport const PayScheduleAssignment = ({\n companyId,\n dictionary,\n ...props\n}: PayScheduleAssignmentProps) => {\n useUnstableFeature('managePaySchedules', { throwIfDisabled: true })\n\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} dictionary={dictionary} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, dictionary }: Omit<PayScheduleAssignmentProps, BaseComponentKeys>) {\n useI18n('Company.Management.PayScheduleAssignment')\n useComponentDictionary('Company.Management.PayScheduleAssignment', dictionary)\n // AssignmentCreateScheduleStep reuses the onboarding PayScheduleForm, whose translations live\n // under its own namespace and are otherwise never loaded from this flow.\n useI18n('Company.PaySchedule')\n const { onEvent } = useBase()\n\n // Temporary: patch the assignment-preview response before the SDK validates it, and log\n // request/error details for debugging. See stripNullAssignmentPreviewFields for why —\n // remove both alongside it once the OAS is fixed upstream.\n const client = useGustoEmbeddedContext()\n useEffect(() => {\n const hooks = client._options.hooks\n if (!hooks) return\n hooks.registerAfterSuccessHook(stripNullAssignmentPreviewFields)\n\n return () => {\n // Remove only the single instance this effect registered — filtering the array would\n // also drop another concurrently-mounted instance's registration of the same hook.\n const index = hooks.afterSuccessHooks.indexOf(stripNullAssignmentPreviewFields)\n if (index !== -1) {\n hooks.afterSuccessHooks.splice(index, 1)\n }\n }\n }, [client])\n\n const machine = useMemo(\n () =>\n createMachine(\n 'assignmentType',\n payScheduleAssignmentStateMachine,\n (initialContext: PayScheduleAssignmentContextInterface) => ({\n ...initialContext,\n component: AssignmentTypeStep,\n companyId,\n }),\n ),\n [companyId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["PayScheduleAssignment","companyId","dictionary","props","useUnstableFeature","jsx","BaseComponent","Root","useI18n","useComponentDictionary","onEvent","useBase","client","useGustoEmbeddedContext","useEffect","hooks","stripNullAssignmentPreviewFields","index","machine","useMemo","createMachine","payScheduleAssignmentStateMachine","initialContext","AssignmentTypeStep","Flow"],"mappings":";;;;;;;;;;;;AAgDO,MAAMA,IAAwB,CAAC;AAAA,EACpC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,EAAmB,sBAAsB,EAAE,iBAAiB,GAAA,CAAM,GAGhE,gBAAAC,EAACC,KAAe,GAAGH,GACjB,4BAACI,GAAA,EAAK,WAAAN,GAAsB,YAAAC,GAAwB,EAAA,CACtD;AAIJ,SAASK,EAAK,EAAE,WAAAN,GAAW,YAAAC,KAAmE;AAC5F,EAAAM,EAAQ,0CAA0C,GAClDC,EAAuB,4CAA4CP,CAAU,GAG7EM,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAE,EAAA,IAAYC,EAAA,GAKdC,IAASC,EAAA;AACf,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAQH,EAAO,SAAS;AAC9B,QAAKG;AACL,aAAAA,EAAM,yBAAyBC,CAAgC,GAExD,MAAM;AAGX,cAAMC,IAAQF,EAAM,kBAAkB,QAAQC,CAAgC;AAC9E,QAAIC,MAAU,MACZF,EAAM,kBAAkB,OAAOE,GAAO,CAAC;AAAA,MAE3C;AAAA,EACF,GAAG,CAACL,CAAM,CAAC;AAEX,QAAMM,IAAUC;AAAA,IACd,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAA2D;AAAA,QAC1D,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAtB;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAS;AAAA,EAAA;AAGZ,SAAO,gBAAAI,EAACmB,GAAA,EAAK,SAAAN,GAAkB,SAAAR,EAAA,CAAkB;AACnD;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useMemo as P, useEffect as h } from "react";
|
|
3
|
+
import { usePaySchedulesGetAllSuspense as C } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
|
|
4
|
+
import { usePaySchedulesPreviewAssignmentMutation as _ } from "@gusto/embedded-api/react-query/paySchedulesPreviewAssignment";
|
|
5
|
+
import { usePaySchedulesAssignMutation as v } from "@gusto/embedded-api/react-query/paySchedulesAssign";
|
|
6
|
+
import { PayScheduleAssignmentBodyType as p } from "@gusto/embedded-api/models/components/payscheduleassignmentbody";
|
|
7
|
+
import { AssignmentTypeStepPresentation as T } from "./AssignmentTypeStepPresentation.js";
|
|
8
|
+
import { AssignmentScheduleStepPresentation as L } from "./AssignmentScheduleStepPresentation.js";
|
|
9
|
+
import { AssignmentReviewStepPresentation as I } from "./AssignmentReviewStepPresentation.js";
|
|
10
|
+
import { PayScheduleForm as U } from "../../PayScheduleForm.js";
|
|
11
|
+
import { useFlow as d } from "../../../../Flow/useFlow.js";
|
|
12
|
+
import { BaseLayout as N } from "../../../../Base/Base.js";
|
|
13
|
+
import { useBase as D } from "../../../../Base/useBase.js";
|
|
14
|
+
import { ensureRequired as u } from "../../../../../helpers/ensureRequired.js";
|
|
15
|
+
import { componentEvents as s } from "../../../../../shared/constants.js";
|
|
16
|
+
function J() {
|
|
17
|
+
const { assignmentType: e, onEvent: n } = d();
|
|
18
|
+
return /* @__PURE__ */ a(
|
|
19
|
+
T,
|
|
20
|
+
{
|
|
21
|
+
defaultType: e === p.Single ? e : void 0,
|
|
22
|
+
onBack: () => {
|
|
23
|
+
n(s.PAY_SCHEDULE_ASSIGNMENT_CANCEL);
|
|
24
|
+
},
|
|
25
|
+
onContinue: (t) => {
|
|
26
|
+
n(s.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED, { type: t });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function O() {
|
|
32
|
+
const { companyId: e, defaultPayScheduleUuid: n, onEvent: t } = d(), { data: m } = C({
|
|
33
|
+
companyId: u(e)
|
|
34
|
+
}), i = m.payScheduleShowResponse ?? [], S = i.find((o) => o.active);
|
|
35
|
+
return /* @__PURE__ */ a(
|
|
36
|
+
L,
|
|
37
|
+
{
|
|
38
|
+
schedules: i,
|
|
39
|
+
defaultPayScheduleUuid: n ?? S?.uuid,
|
|
40
|
+
onBack: () => {
|
|
41
|
+
t(s.PAY_SCHEDULE_ASSIGNMENT_BACK);
|
|
42
|
+
},
|
|
43
|
+
onAddPaySchedule: () => {
|
|
44
|
+
t(s.PAY_SCHEDULE_CREATE);
|
|
45
|
+
},
|
|
46
|
+
onContinue: (o) => {
|
|
47
|
+
t(s.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, {
|
|
48
|
+
defaultPayScheduleUuid: o
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function Q() {
|
|
55
|
+
const { companyId: e, onEvent: n } = d();
|
|
56
|
+
return /* @__PURE__ */ a(U, { companyId: u(e), onEvent: n });
|
|
57
|
+
}
|
|
58
|
+
function V() {
|
|
59
|
+
const { companyId: e, assignmentType: n, defaultPayScheduleUuid: t, onEvent: m } = d(), { baseSubmitHandler: i, error: S } = D(), [o, y] = g(null), { mutateAsync: c, isPending: l } = _(), { mutateAsync: E, isPending: A } = v(), r = P(
|
|
60
|
+
() => ({
|
|
61
|
+
type: n ?? p.Single,
|
|
62
|
+
defaultPayScheduleUuid: t
|
|
63
|
+
}),
|
|
64
|
+
[n, t]
|
|
65
|
+
);
|
|
66
|
+
return h(() => {
|
|
67
|
+
i(void 0, async () => {
|
|
68
|
+
const f = await c({
|
|
69
|
+
request: { companyId: u(e), payScheduleAssignmentBody: r }
|
|
70
|
+
});
|
|
71
|
+
y(f.payScheduleAssignmentPreview?.employeeChanges ?? []);
|
|
72
|
+
});
|
|
73
|
+
}, [e, r, c, i]), S ? null : l || !o ? /* @__PURE__ */ a(N, { isLoading: !0 }) : /* @__PURE__ */ a(
|
|
74
|
+
I,
|
|
75
|
+
{
|
|
76
|
+
employeeChanges: o,
|
|
77
|
+
isSubmitting: A,
|
|
78
|
+
onBack: () => {
|
|
79
|
+
m(s.PAY_SCHEDULE_ASSIGNMENT_BACK);
|
|
80
|
+
},
|
|
81
|
+
onSubmit: () => {
|
|
82
|
+
i(void 0, async () => {
|
|
83
|
+
await E({
|
|
84
|
+
request: { companyId: u(e), payScheduleAssignmentBody: r }
|
|
85
|
+
}), m(s.PAY_SCHEDULE_ASSIGNED, {
|
|
86
|
+
type: r.type,
|
|
87
|
+
defaultPayScheduleUuid: u(t),
|
|
88
|
+
employeeChanges: o
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
Q as AssignmentCreateScheduleStep,
|
|
97
|
+
V as AssignmentReviewStep,
|
|
98
|
+
O as AssignmentScheduleStep,
|
|
99
|
+
J as AssignmentTypeStep
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=PayScheduleAssignmentComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayScheduleAssignmentComponents.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesPreviewAssignmentMutation } from '@gusto/embedded-api/react-query/paySchedulesPreviewAssignment'\nimport { usePaySchedulesAssignMutation } from '@gusto/embedded-api/react-query/paySchedulesAssign'\nimport { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody'\nimport type { PayScheduleAssignmentBody } from '@gusto/embedded-api/models/components/payscheduleassignmentbody'\nimport type { PayScheduleAssignmentEmployeeChange } from '@gusto/embedded-api/models/components/payscheduleassignmentemployeechange'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { AssignmentTypeStepPresentation } from './AssignmentTypeStepPresentation'\nimport { AssignmentScheduleStepPresentation } from './AssignmentScheduleStepPresentation'\nimport { AssignmentReviewStepPresentation } from './AssignmentReviewStepPresentation'\nimport type { PayScheduleAssignmentContextInterface } from './usePayScheduleAssignment'\nimport { PayScheduleForm } from '@/components/Company/PaySchedule/PayScheduleForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useBase, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport type EventPayloads = {\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED]: { type: PayScheduleAssignmentBodyType }\n [componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED]: { defaultPayScheduleUuid: string }\n [componentEvents.PAY_SCHEDULE_CREATED]: { paySchedule: PayScheduleShow }\n [componentEvents.PAY_SCHEDULE_ASSIGNED]: {\n type: PayScheduleAssignmentBodyType\n defaultPayScheduleUuid: string\n employeeChanges: PayScheduleAssignmentEmployeeChange[]\n }\n}\n\n/** @internal */\nexport function AssignmentTypeStep() {\n const { assignmentType, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return (\n <AssignmentTypeStepPresentation\n defaultType={\n assignmentType === PayScheduleAssignmentBodyType.Single ? assignmentType : undefined\n }\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_CANCEL)\n }}\n onContinue={type => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED, { type })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentScheduleStep() {\n const { companyId, defaultPayScheduleUuid, onEvent } =\n useFlow<PayScheduleAssignmentContextInterface>()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId: ensureRequired(companyId),\n })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n const activeSchedule = schedules.find(s => s.active)\n\n return (\n <AssignmentScheduleStepPresentation\n schedules={schedules}\n defaultPayScheduleUuid={defaultPayScheduleUuid ?? activeSchedule?.uuid}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onAddPaySchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_CREATE)\n }}\n onContinue={uuid => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED, {\n defaultPayScheduleUuid: uuid,\n })\n }}\n />\n )\n}\n\n/** @internal */\nexport function AssignmentCreateScheduleStep() {\n const { companyId, onEvent } = useFlow<PayScheduleAssignmentContextInterface>()\n\n return <PayScheduleForm companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function AssignmentReviewStep() {\n const { companyId, assignmentType, defaultPayScheduleUuid, onEvent } =\n useFlow<PayScheduleAssignmentContextInterface>()\n const { baseSubmitHandler, error } = useBase()\n const [employeeChanges, setEmployeeChanges] = useState<\n PayScheduleAssignmentEmployeeChange[] | null\n >(null)\n const { mutateAsync: previewAssignment, isPending: isPreviewLoading } =\n usePaySchedulesPreviewAssignmentMutation()\n const { mutateAsync: assignSchedules, isPending: isAssigning } = usePaySchedulesAssignMutation()\n\n const payScheduleAssignmentBody: PayScheduleAssignmentBody = useMemo(\n () => ({\n type: assignmentType ?? PayScheduleAssignmentBodyType.Single,\n defaultPayScheduleUuid,\n }),\n [assignmentType, defaultPayScheduleUuid],\n )\n\n useEffect(() => {\n void baseSubmitHandler(undefined, async () => {\n const response = await previewAssignment({\n request: { companyId: ensureRequired(companyId), payScheduleAssignmentBody },\n })\n setEmployeeChanges(response.payScheduleAssignmentPreview?.employeeChanges ?? [])\n })\n }, [companyId, payScheduleAssignmentBody, previewAssignment, baseSubmitHandler])\n\n // The enclosing BaseComponent's own BaseLayout already renders `error` for this whole\n // component tree, so surface only the loading state here to avoid rendering it twice.\n if (error) {\n return null\n }\n if (isPreviewLoading || !employeeChanges) {\n return <BaseLayout isLoading />\n }\n\n return (\n <AssignmentReviewStepPresentation\n employeeChanges={employeeChanges}\n isSubmitting={isAssigning}\n onBack={() => {\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK)\n }}\n onSubmit={() => {\n void baseSubmitHandler(undefined, async () => {\n await assignSchedules({\n request: { companyId: ensureRequired(companyId), payScheduleAssignmentBody },\n })\n onEvent(componentEvents.PAY_SCHEDULE_ASSIGNED, {\n type: payScheduleAssignmentBody.type,\n defaultPayScheduleUuid: ensureRequired(defaultPayScheduleUuid),\n employeeChanges,\n })\n })\n }}\n />\n )\n}\n"],"names":["AssignmentTypeStep","assignmentType","onEvent","useFlow","jsx","AssignmentTypeStepPresentation","PayScheduleAssignmentBodyType","componentEvents","type","AssignmentScheduleStep","companyId","defaultPayScheduleUuid","paySchedules","usePaySchedulesGetAllSuspense","ensureRequired","schedules","activeSchedule","s","AssignmentScheduleStepPresentation","uuid","AssignmentCreateScheduleStep","PayScheduleForm","AssignmentReviewStep","baseSubmitHandler","error","useBase","employeeChanges","setEmployeeChanges","useState","previewAssignment","isPreviewLoading","usePaySchedulesPreviewAssignmentMutation","assignSchedules","isAssigning","usePaySchedulesAssignMutation","payScheduleAssignmentBody","useMemo","useEffect","response","BaseLayout","AssignmentReviewStepPresentation"],"mappings":";;;;;;;;;;;;;;;AA+BO,SAASA,IAAqB;AACnC,QAAM,EAAE,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA;AAEpC,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aACEJ,MAAmBK,EAA8B,SAASL,IAAiB;AAAA,MAE7E,QAAQ,MAAM;AACZ,QAAAC,EAAQK,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,YAAY,CAAAC,MAAQ;AAClB,QAAAN,EAAQK,EAAgB,uCAAuC,EAAE,MAAAC,EAAA,CAAM;AAAA,MACzE;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASC,IAAyB;AACvC,QAAM,EAAE,WAAAC,GAAW,wBAAAC,GAAwB,SAAAT,EAAA,IACzCC,EAAA,GACI,EAAE,MAAMS,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAWC,EAAeJ,CAAS;AAAA,EAAA,CACpC,GACKK,IAAYH,EAAa,2BAA2B,CAAA,GACpDI,IAAiBD,EAAU,KAAK,CAAAE,MAAKA,EAAE,MAAM;AAEnD,SACE,gBAAAb;AAAA,IAACc;AAAA,IAAA;AAAA,MACC,WAAAH;AAAA,MACA,wBAAwBJ,KAA0BK,GAAgB;AAAA,MAClE,QAAQ,MAAM;AACZ,QAAAd,EAAQK,EAAgB,4BAA4B;AAAA,MACtD;AAAA,MACA,kBAAkB,MAAM;AACtB,QAAAL,EAAQK,EAAgB,mBAAmB;AAAA,MAC7C;AAAA,MACA,YAAY,CAAAY,MAAQ;AAClB,QAAAjB,EAAQK,EAAgB,2CAA2C;AAAA,UACjE,wBAAwBY;AAAA,QAAA,CACzB;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASC,IAA+B;AAC7C,QAAM,EAAE,WAAAV,GAAW,SAAAR,EAAA,IAAYC,EAAA;AAE/B,2BAAQkB,GAAA,EAAgB,WAAWP,EAAeJ,CAAS,GAAG,SAAAR,GAAkB;AAClF;AAGO,SAASoB,IAAuB;AACrC,QAAM,EAAE,WAAAZ,GAAW,gBAAAT,GAAgB,wBAAAU,GAAwB,SAAAT,EAAA,IACzDC,EAAA,GACI,EAAE,mBAAAoB,GAAmB,OAAAC,EAAA,IAAUC,EAAA,GAC/B,CAACC,GAAiBC,CAAkB,IAAIC,EAE5C,IAAI,GACA,EAAE,aAAaC,GAAmB,WAAWC,EAAA,IACjDC,EAAA,GACI,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAAgBC,EAAA,GAE3DC,IAAuDC;AAAA,IAC3D,OAAO;AAAA,MACL,MAAMnC,KAAkBK,EAA8B;AAAA,MACtD,wBAAAK;AAAA,IAAA;AAAA,IAEF,CAACV,GAAgBU,CAAsB;AAAA,EAAA;AAczC,SAXA0B,EAAU,MAAM;AACd,IAAKd,EAAkB,QAAW,YAAY;AAC5C,YAAMe,IAAW,MAAMT,EAAkB;AAAA,QACvC,SAAS,EAAE,WAAWf,EAAeJ,CAAS,GAAG,2BAAAyB,EAAA;AAAA,MAA0B,CAC5E;AACD,MAAAR,EAAmBW,EAAS,8BAA8B,mBAAmB,CAAA,CAAE;AAAA,IACjF,CAAC;AAAA,EACH,GAAG,CAAC5B,GAAWyB,GAA2BN,GAAmBN,CAAiB,CAAC,GAI3EC,IACK,OAELM,KAAoB,CAACJ,IAChB,gBAAAtB,EAACmC,GAAA,EAAW,WAAS,GAAA,CAAC,IAI7B,gBAAAnC;AAAA,IAACoC;AAAA,IAAA;AAAA,MACC,iBAAAd;AAAA,MACA,cAAcO;AAAA,MACd,QAAQ,MAAM;AACZ,QAAA/B,EAAQK,EAAgB,4BAA4B;AAAA,MACtD;AAAA,MACA,UAAU,MAAM;AACd,QAAKgB,EAAkB,QAAW,YAAY;AAC5C,gBAAMS,EAAgB;AAAA,YACpB,SAAS,EAAE,WAAWlB,EAAeJ,CAAS,GAAG,2BAAAyB,EAAA;AAAA,UAA0B,CAC5E,GACDjC,EAAQK,EAAgB,uBAAuB;AAAA,YAC7C,MAAM4B,EAA0B;AAAA,YAChC,wBAAwBrB,EAAeH,CAAsB;AAAA,YAC7D,iBAAAe;AAAA,UAAA,CACD;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|