@gusto/embedded-react-sdk 0.55.3 → 0.55.4
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 +23 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +18 -17
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -6
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -6
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -9
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -6
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +27 -25
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -6
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -6
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -6
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Flow/Flow.js +22 -22
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/useFlow.js +3 -3
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +68 -53
- package/dist/components/InformationRequests/InformationRequests.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/OffCycleCreation/OffCycleCreation.js +52 -50
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +193 -191
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +31 -31
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +176 -167
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -164
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +12 -15
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/helpers/openPdfInNewTab.d.ts +15 -0
- package/dist/helpers/openPdfInNewTab.js +28 -0
- package/dist/helpers/openPdfInNewTab.js.map +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +43 -41
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/types.d.ts +20 -0
- package/dist/style.css +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { keepPreviousData } from '@tanstack/react-query'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\n/**\n * Props for the {@link LocationsList} component.\n *\n * @public\n */\nexport interface LocationsListProps extends BaseComponentInterface<'Company.Locations'> {\n /** The associated company identifier. */\n companyId: string\n}\n\n/**\n * Displays the list of work locations for a company.\n *\n * @remarks\n * Standalone building block used internally by the orchestrated `Locations` component for its list view. Use this directly when you need full control over navigation between the list and form views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/location/add` | A user chose to add a new location | — |\n * | `company/location/edit` | A user chose to edit a specific location | `{ uuid: string }` |\n * | `company/location/done` | The user chose to proceed to the next step | — |\n *\n * @param props - Component props including the `companyId` whose locations should be listed.\n * @returns The rendered locations list section.\n * @public\n */\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children, LoaderComponent }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const { getPaginationProps } = usePagination()\n\n const { data, isFetching } = useLocationsGet(\n { companyId },\n { placeholderData: keepPreviousData, throwOnError: true },\n )\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n if (!data) {\n return <BaseLayout isLoading LoaderComponent={LoaderComponent} />\n }\n\n const { companyLocationsList, httpMeta } = data\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n ...getPaginationProps(httpMeta.response.headers, isFetching),\n locationList: companyLocationsList ?? [],\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","LoaderComponent","useI18n","onEvent","useBase","getPaginationProps","usePagination","data","isFetching","useLocationsGet","keepPreviousData","handleContinue","companyEvents","handleAddLocation","handleEditLocation","uuid","BaseLayout","companyLocationsList","httpMeta","LocationsListProvider","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;AAwCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,iBAAAC,KAAuC;AACrF,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzB,EAAE,MAAAC,GAAM,YAAAC,EAAA,IAAeC;AAAA,IAC3B,EAAE,WAAAX,EAAA;AAAA,IACF,EAAE,iBAAiBY,GAAkB,cAAc,GAAA;AAAA,EAAK,GAGpDC,IAAiB,MAAM;AAC3B,IAAAR,EAAQS,EAAc,qBAAqB;AAAA,EAC7C,GACMC,IAAoB,MAAM;AAC9B,IAAAV,EAAQS,EAAc,uBAAuB;AAAA,EAC/C,GACME,IAAqB,CAACC,MAAiB;AAC3C,IAAAZ,EAAQS,EAAc,uBAAuB,EAAE,MAAAG,EAAA,CAAM;AAAA,EACvD;AAEA,MAAI,CAACR;AACH,WAAO,gBAAAZ,EAACqB,GAAA,EAAW,WAAS,IAAC,iBAAAf,EAAA,CAAkC;AAGjE,QAAM,EAAE,sBAAAgB,GAAsB,UAAAC,EAAA,IAAaX;AAE3C,SACE,gBAAAZ,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACwB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,GAAGd,EAAmBa,EAAS,SAAS,SAASV,CAAU;AAAA,QAC3D,cAAcS,KAAwB,CAAA;AAAA,QACtC,mBAAAJ;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAH;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAhB,EAACyB,GAAA,EAAK,eAAc,UAAS,KAAK,IAAI,YAAW,WAC9C,UAAApB,KAGC,gBAAAqB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -6,6 +6,7 @@ type LocationsListContextType = {
|
|
|
6
6
|
totalCount: number;
|
|
7
7
|
currentPage: number;
|
|
8
8
|
itemsPerPage: PaginationItemsPerPage;
|
|
9
|
+
isFetching?: boolean;
|
|
9
10
|
handleItemsPerPageChange: (n: PaginationItemsPerPage) => void;
|
|
10
11
|
handleFirstPage: () => void;
|
|
11
12
|
handlePreviousPage: () => void;
|
|
@@ -9,17 +9,14 @@ 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";
|
|
14
12
|
import "../../../../shared/constants.js";
|
|
15
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
18
|
-
const [
|
|
15
|
+
const [d, f] = o(
|
|
19
16
|
"CompanyDocumentListContext"
|
|
20
17
|
);
|
|
21
18
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
f as LocationsListProvider,
|
|
20
|
+
d as useLocationsList
|
|
24
21
|
};
|
|
25
22
|
//# 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 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,15 +9,12 @@ 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";
|
|
14
12
|
import "../../../shared/constants.js";
|
|
15
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const [
|
|
15
|
+
const [x, C] = o("OnboardingOverviewContext");
|
|
19
16
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
C as OnboardingOverviewProvider,
|
|
18
|
+
x as useOnboardingOverview
|
|
22
19
|
};
|
|
23
20
|
//# 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;"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Renders one section per requirement set, skipping sets that have nothing left to edit once
|
|
3
|
+
* non-editable requirements — and requirements resolved as never-applicable against a
|
|
4
|
+
* non-editable sibling — are dropped (mirrors gws-flows' `TaxRequirements::Edit.set_editable?`,
|
|
5
|
+
* which drops such sets from its own edit view entirely).
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function Form(): import("react").JSX.Element | (import("react").JSX.Element | null)[];
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { RequirementFields as
|
|
1
|
+
import { jsxs as u, Fragment as q, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as h } from "react-i18next";
|
|
3
|
+
import { RequirementFields as x } from "../shared/RequirementFields.js";
|
|
4
4
|
import { getUniqueRhfKey as F } from "../shared/rhfKey.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { isRequirementSetEditable as b } from "../shared/prepareRequirements.js";
|
|
6
|
+
import { useStateTaxesForm as y } from "./context.js";
|
|
7
|
+
import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
8
|
import { useDateFormatter as S } from "../../../../hooks/useDateFormatter.js";
|
|
8
|
-
function
|
|
9
|
-
const { t:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
n && /* @__PURE__ */ e(t.Text, { size: "sm", children: s("effectiveFromLabel", { date: a.formatLongWithYear(n) }) })
|
|
9
|
+
function K() {
|
|
10
|
+
const { t: r } = h("Company.StateTaxes", { keyPrefix: "form" }), l = S(), { stateTaxRequirements: f } = y(), n = R(), o = f.requirementSets ?? [], i = o.map((e, c) => {
|
|
11
|
+
const { requirements: m, label: p, effectiveFrom: s, key: d } = e;
|
|
12
|
+
if (!d || !b(m ?? [])) return null;
|
|
13
|
+
const a = F(e, c, o);
|
|
14
|
+
return /* @__PURE__ */ u(q, { children: [
|
|
15
|
+
/* @__PURE__ */ u("div", { children: [
|
|
16
|
+
/* @__PURE__ */ t(n.Heading, { as: "h3", children: p }),
|
|
17
|
+
s && /* @__PURE__ */ t(n.Text, { size: "sm", children: r("effectiveFromLabel", { date: l.formatLongWithYear(s) }) })
|
|
18
18
|
] }),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
] },
|
|
19
|
+
/* @__PURE__ */ t(x, { requirements: m, requirementSetKey: a })
|
|
20
|
+
] }, a);
|
|
21
21
|
});
|
|
22
|
+
return i.every((e) => e === null) ? /* @__PURE__ */ t(n.Alert, { status: "info", label: r("noEditableRequirementsTitle"), children: r("noEditableRequirementsDescription") }) : i;
|
|
22
23
|
}
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
K as Form
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Fragment } from 'react/jsx-runtime'\nimport { RequirementFields } from '../shared/RequirementFields'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { useStateTaxesForm } from './context'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\n
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Fragment } from 'react/jsx-runtime'\nimport { RequirementFields } from '../shared/RequirementFields'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { isRequirementSetEditable } from '../shared/prepareRequirements'\nimport { useStateTaxesForm } from './context'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\n/**\n * Renders one section per requirement set, skipping sets that have nothing left to edit once\n * non-editable requirements — and requirements resolved as never-applicable against a\n * non-editable sibling — are dropped (mirrors gws-flows' `TaxRequirements::Edit.set_editable?`,\n * which drops such sets from its own edit view entirely).\n *\n * @internal\n */\nexport function Form() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const dateFormatter = useDateFormatter()\n const { stateTaxRequirements } = useStateTaxesForm()\n const Components = useComponentContext()\n const requirementSets = stateTaxRequirements.requirementSets ?? []\n\n // A single key (e.g. \"taxrates\") can appear in more than one set when a future-dated set is\n // already scheduled alongside the current one — each rendered section still needs its own\n // disambiguated form path so the two sections' fields don't share state.\n const sections = requirementSets.map((requirementSet, index) => {\n const { requirements, label, effectiveFrom, key } = requirementSet\n if (!key) return null\n if (!isRequirementSetEditable(requirements ?? [])) return null\n const requirementSetPath = getUniqueRhfKey(requirementSet, index, requirementSets)\n return (\n <Fragment key={requirementSetPath}>\n <div>\n <Components.Heading as=\"h3\">{label}</Components.Heading>\n {effectiveFrom && (\n <Components.Text size=\"sm\">\n {t('effectiveFromLabel', { date: dateFormatter.formatLongWithYear(effectiveFrom) })}\n </Components.Text>\n )}\n </div>\n <RequirementFields requirements={requirements} requirementSetKey={requirementSetPath} />\n </Fragment>\n )\n })\n\n if (sections.every(section => section === null)) {\n return (\n <Components.Alert status=\"info\" label={t('noEditableRequirementsTitle')}>\n {t('noEditableRequirementsDescription')}\n </Components.Alert>\n )\n }\n\n return sections\n}\n"],"names":["Form","t","useTranslation","dateFormatter","useDateFormatter","stateTaxRequirements","useStateTaxesForm","Components","useComponentContext","requirementSets","sections","requirementSet","index","requirements","label","effectiveFrom","key","isRequirementSetEditable","requirementSetPath","getUniqueRhfKey","Fragment","jsxs","jsx","RequirementFields","section"],"mappings":";;;;;;;;AAiBO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClEC,IAAgBC,EAAA,GAChB,EAAE,sBAAAC,EAAA,IAAyBC,EAAA,GAC3BC,IAAaC,EAAA,GACbC,IAAkBJ,EAAqB,mBAAmB,CAAA,GAK1DK,IAAWD,EAAgB,IAAI,CAACE,GAAgBC,MAAU;AAC9D,UAAM,EAAE,cAAAC,GAAc,OAAAC,GAAO,eAAAC,GAAe,KAAAC,MAAQL;AAEpD,QADI,CAACK,KACD,CAACC,EAAyBJ,KAAgB,CAAA,CAAE,EAAG,QAAO;AAC1D,UAAMK,IAAqBC,EAAgBR,GAAgBC,GAAOH,CAAe;AACjF,6BACGW,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAAC,EAACf,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAO,GAAM;AAAA,QAClCC,KACC,gBAAAO,EAACf,EAAW,MAAX,EAAgB,MAAK,MACnB,UAAAN,EAAE,sBAAsB,EAAE,MAAME,EAAc,mBAAmBY,CAAa,EAAA,CAAG,EAAA,CACpF;AAAA,MAAA,GAEJ;AAAA,MACA,gBAAAO,EAACC,GAAA,EAAkB,cAAAV,GAA4B,mBAAmBK,EAAA,CAAoB;AAAA,IAAA,EAAA,GATzEA,CAUf;AAAA,EAEJ,CAAC;AAED,SAAIR,EAAS,MAAM,CAAAc,MAAWA,MAAY,IAAI,IAE1C,gBAAAF,EAACf,EAAW,OAAX,EAAiB,QAAO,QAAO,OAAON,EAAE,6BAA6B,GACnE,UAAAA,EAAE,mCAAmC,EAAA,CACxC,IAIGS;AACT;"}
|
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useTaxRequirementsUpdateStateMutation as
|
|
5
|
-
import { useTaxRequirementsGetSuspense as
|
|
1
|
+
import { jsx as t, jsxs as M, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as w, FormProvider as z } from "react-hook-form";
|
|
3
|
+
import { zodResolver as H } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useTaxRequirementsUpdateStateMutation as K } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
|
|
5
|
+
import { useTaxRequirementsGetSuspense as N } from "@gusto/embedded-api/react-query/taxRequirementsGet";
|
|
6
6
|
import { z as b } from "zod";
|
|
7
|
-
import { useMemo as
|
|
8
|
-
import { useTranslation as
|
|
7
|
+
import { useMemo as O } from "react";
|
|
8
|
+
import { useTranslation as G } from "react-i18next";
|
|
9
9
|
import { getUniqueRhfKey as d } from "../shared/rhfKey.js";
|
|
10
|
-
import { isRequirementApplicable as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
import { isRequirementApplicable as L } from "../shared/applicableIf.js";
|
|
11
|
+
import { prepareRequirements as v } from "../shared/prepareRequirements.js";
|
|
12
|
+
import { buildRequirementSchema as X } from "../shared/buildRequirementSchema.js";
|
|
13
|
+
import { stringifyRequirementValue as Y } from "../shared/requirementValue.js";
|
|
14
|
+
import { Head as $ } from "./Head.js";
|
|
15
|
+
import { StateTaxesFormProvider as I } from "./context.js";
|
|
16
|
+
import { Form as J } from "./Form.js";
|
|
17
|
+
import { Actions as Q } from "./Actions.js";
|
|
18
|
+
import { BaseComponent as W } from "../../../Base/Base.js";
|
|
19
|
+
import { useI18n as Z } from "../../../../i18n/I18n.js";
|
|
20
|
+
import { Flex as ee } from "../../../Common/Flex/Flex.js";
|
|
21
|
+
import { Form as te } from "../../../Common/Form/Form.js";
|
|
22
|
+
import { componentEvents as F } from "../../../../shared/constants.js";
|
|
23
|
+
import { useBase as re } from "../../../Base/useBase.js";
|
|
24
|
+
function ke(o) {
|
|
25
|
+
return /* @__PURE__ */ t(W, { ...o, children: /* @__PURE__ */ t(oe, { ...o, children: o.children }) });
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
const { onEvent: y, baseSubmitHandler:
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
if (!
|
|
32
|
-
const r = d(
|
|
33
|
-
Object.keys(
|
|
27
|
+
function oe({ companyId: o, state: c, className: P, children: q }) {
|
|
28
|
+
Z("Company.StateTaxes");
|
|
29
|
+
const { onEvent: y, baseSubmitHandler: g } = re(), { t: x } = G("Company.StateTaxes", { keyPrefix: "form" }), { data: k } = N({ companyUuid: o, state: c }), u = k.taxRequirementsState, { mutateAsync: A, isPending: C } = K(), { dynamicSchema: E, defaultValues: U } = O(() => {
|
|
30
|
+
const f = {}, n = {}, p = u.requirementSets ?? [];
|
|
31
|
+
return p.forEach((i, e) => {
|
|
32
|
+
if (!i.key) return;
|
|
33
|
+
const r = d(i, e, p), s = v(i.requirements ?? []), { shape: a, defaults: h } = X(s, x);
|
|
34
|
+
Object.keys(a).length > 0 && (f[r] = b.object(a), n[r] = h);
|
|
34
35
|
}), {
|
|
35
|
-
dynamicSchema: b.object(
|
|
36
|
-
defaultValues:
|
|
36
|
+
dynamicSchema: b.object(f),
|
|
37
|
+
defaultValues: n
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
-
resolver:
|
|
40
|
-
defaultValues:
|
|
41
|
-
}),
|
|
42
|
-
await
|
|
43
|
-
const
|
|
39
|
+
}, [u, x]), { control: j, ...R } = w({
|
|
40
|
+
resolver: H(E),
|
|
41
|
+
defaultValues: U
|
|
42
|
+
}), B = async (f) => {
|
|
43
|
+
await g(f, async (n) => {
|
|
44
|
+
const p = n, l = u.requirementSets ?? [], i = l.map((e, r) => ({ requirementSet: e, setIndex: r })).filter(({ requirementSet: e, setIndex: r }) => {
|
|
44
45
|
if (!e.key) return !1;
|
|
45
|
-
const
|
|
46
|
-
return !!
|
|
46
|
+
const s = d(e, r, l);
|
|
47
|
+
return !!n[s];
|
|
47
48
|
}).map(({ requirementSet: e, setIndex: r }) => {
|
|
48
|
-
const
|
|
49
|
+
const s = e.key, a = d(e, r, l), h = n[a], T = v(e.requirements ?? []), D = T.map((m, S) => ({ req: m, index: S })).filter(({ req: m }) => L(m, a, p));
|
|
49
50
|
return {
|
|
50
|
-
state:
|
|
51
|
-
key:
|
|
51
|
+
state: c,
|
|
52
|
+
key: s,
|
|
52
53
|
effectiveFrom: e.effectiveFrom,
|
|
53
|
-
requirements:
|
|
54
|
-
key:
|
|
55
|
-
value:
|
|
56
|
-
|
|
54
|
+
requirements: D.map(({ req: m, index: S }) => ({
|
|
55
|
+
key: m.key,
|
|
56
|
+
value: Y(
|
|
57
|
+
h[d(m, S, T)]
|
|
57
58
|
)
|
|
58
59
|
}))
|
|
59
60
|
};
|
|
60
61
|
});
|
|
61
|
-
await
|
|
62
|
+
await A({
|
|
62
63
|
request: {
|
|
63
|
-
companyUuid:
|
|
64
|
-
requestBody: { requirementSets:
|
|
65
|
-
state:
|
|
64
|
+
companyUuid: o,
|
|
65
|
+
requestBody: { requirementSets: i },
|
|
66
|
+
state: c
|
|
66
67
|
}
|
|
67
|
-
}), y(
|
|
68
|
+
}), y(F.COMPANY_STATE_TAX_UPDATED);
|
|
68
69
|
});
|
|
69
|
-
},
|
|
70
|
-
y(
|
|
70
|
+
}, V = () => {
|
|
71
|
+
y(F.CANCEL);
|
|
71
72
|
};
|
|
72
|
-
return /* @__PURE__ */ t("section", { className:
|
|
73
|
-
|
|
73
|
+
return /* @__PURE__ */ t("section", { className: P, children: /* @__PURE__ */ t(z, { ...R, control: j, children: /* @__PURE__ */ t(te, { onSubmit: R.handleSubmit(B), children: /* @__PURE__ */ t(
|
|
74
|
+
I,
|
|
74
75
|
{
|
|
75
|
-
value: { stateTaxRequirements:
|
|
76
|
-
children: /* @__PURE__ */ t(
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
/* @__PURE__ */ t(
|
|
79
|
-
/* @__PURE__ */ t(
|
|
76
|
+
value: { stateTaxRequirements: u, isPending: C, state: c, handleCancel: V },
|
|
77
|
+
children: /* @__PURE__ */ t(ee, { flexDirection: "column", gap: 32, children: q || /* @__PURE__ */ M(_, { children: [
|
|
78
|
+
/* @__PURE__ */ t($, {}),
|
|
79
|
+
/* @__PURE__ */ t(J, {}),
|
|
80
|
+
/* @__PURE__ */ t(Q, {})
|
|
80
81
|
] }) })
|
|
81
82
|
}
|
|
82
83
|
) }) }) });
|
|
83
84
|
}
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
ke as StateTaxesForm
|
|
86
87
|
};
|
|
87
88
|
//# sourceMappingURL=StateTaxesForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { isRequirementApplicable, type StateTaxesFormValues } from '../shared/applicableIf'\nimport { buildRequirementSchema } from '../shared/buildRequirementSchema'\nimport { stringifyRequirementValue } from '../shared/requirementValue'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\n/**\n * Props for {@link StateTaxesForm}.\n *\n * @public\n */\nexport interface StateTaxesFormProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n /** Two-letter code of the state whose tax requirements are edited. */\n state: string\n}\n\n/**\n * Standalone form for editing a company's state tax requirements for a single state.\n *\n * @remarks\n * Lower-level building block used by {@link StateTaxes} for its edit view. Use directly when\n * you need full control over navigation between the list and edit views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/updated` | State tax requirements were saved successfully | Response from the update state tax requirements API |\n * | `CANCEL` | The user cancelled editing | — |\n *\n * @param props - {@link StateTaxesFormProps}\n * @returns The rendered state taxes edit form.\n * @public\n *\n * @example\n * ```tsx\n * import { CompanyOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <CompanyOnboarding.StateTaxesForm\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * state=\"CA\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function StateTaxesForm(props: StateTaxesFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n const requirementSets = stateTaxRequirements.requirementSets ?? []\n\n //Looping through each requirement set. A single key (e.g. \"taxrates\") can appear more than\n //once when a future-dated set is already scheduled alongside the current one, so each set\n //needs its own disambiguated path — otherwise two visually distinct sections would silently\n //share one underlying form field.\n requirementSets.forEach((requirementSet, index) => {\n if (!requirementSet.key) return\n\n const requirementSetPath = getUniqueRhfKey(requirementSet, index, requirementSets)\n const { shape, defaults } = buildRequirementSchema(requirementSet.requirements, t)\n\n if (Object.keys(shape).length > 0) {\n schemaShape[requirementSetPath] = z.object(shape)\n values[requirementSetPath] = defaults\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const formValues = payload as StateTaxesFormValues\n const allRequirementSets = stateTaxRequirements.requirementSets ?? []\n const requirementSets = allRequirementSets\n .map((requirementSet, setIndex) => ({ requirementSet, setIndex }))\n .filter(({ requirementSet, setIndex }) => {\n if (!requirementSet.key) return false\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n return Boolean(payload[requirementSetPath])\n })\n .map(({ requirementSet, setIndex }) => {\n const requirementSetKey = requirementSet.key as string\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n const payloadSet = payload[requirementSetPath] as Record<string, unknown>\n const requirements = requirementSet.requirements ?? []\n\n const applicableRequirements = requirements\n .map((req, index) => ({ req, index }))\n .filter(({ req }) => req.editable !== false)\n .filter(({ req }) => isRequirementApplicable(req, requirementSetPath, formValues))\n\n return {\n state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: applicableRequirements.map(({ req, index }) => ({\n key: req.key as string,\n value: stringifyRequirementValue(\n payloadSet[getUniqueRhfKey(req, index, requirements)],\n ),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSets","requirementSet","index","requirementSetPath","getUniqueRhfKey","shape","defaults","buildRequirementSchema","z","control","methods","useForm","zodResolver","onSubmit","formData","payload","formValues","allRequirementSets","setIndex","requirementSetKey","payloadSet","requirements","applicableRequirements","req","isRequirementApplicable","stringifyRequirementValue","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmEO,SAASA,GAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,GAAA,GACjC,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,MAAAC,MAASC,EAA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AQ,GAC/C,UAAA,gBAAArC;AAAA,IAACsD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAAvC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAA+C,EAAA;AAAA,MAElE,UAAA,gBAAAnD,EAACuD,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjD,KAGC,gBAAAkD,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { isRequirementApplicable, type StateTaxesFormValues } from '../shared/applicableIf'\nimport { prepareRequirements } from '../shared/prepareRequirements'\nimport { buildRequirementSchema } from '../shared/buildRequirementSchema'\nimport { stringifyRequirementValue } from '../shared/requirementValue'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\n/**\n * Props for {@link StateTaxesForm}.\n *\n * @public\n */\nexport interface StateTaxesFormProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n /** Two-letter code of the state whose tax requirements are edited. */\n state: string\n}\n\n/**\n * Standalone form for editing a company's state tax requirements for a single state.\n *\n * @remarks\n * Lower-level building block used by {@link StateTaxes} for its edit view. Use directly when\n * you need full control over navigation between the list and edit views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/updated` | State tax requirements were saved successfully | Response from the update state tax requirements API |\n * | `CANCEL` | The user cancelled editing | — |\n *\n * @param props - {@link StateTaxesFormProps}\n * @returns The rendered state taxes edit form.\n * @public\n *\n * @example\n * ```tsx\n * import { CompanyOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <CompanyOnboarding.StateTaxesForm\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * state=\"CA\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function StateTaxesForm(props: StateTaxesFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n const requirementSets = stateTaxRequirements.requirementSets ?? []\n\n //Looping through each requirement set. A single key (e.g. \"taxrates\") can appear more than\n //once when a future-dated set is already scheduled alongside the current one, so each set\n //needs its own disambiguated path — otherwise two visually distinct sections would silently\n //share one underlying form field.\n requirementSets.forEach((requirementSet, index) => {\n if (!requirementSet.key) return\n\n const requirementSetPath = getUniqueRhfKey(requirementSet, index, requirementSets)\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n const { shape, defaults } = buildRequirementSchema(preparedRequirements, t)\n\n if (Object.keys(shape).length > 0) {\n schemaShape[requirementSetPath] = z.object(shape)\n values[requirementSetPath] = defaults\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const formValues = payload as StateTaxesFormValues\n const allRequirementSets = stateTaxRequirements.requirementSets ?? []\n const requirementSets = allRequirementSets\n .map((requirementSet, setIndex) => ({ requirementSet, setIndex }))\n .filter(({ requirementSet, setIndex }) => {\n if (!requirementSet.key) return false\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n return Boolean(payload[requirementSetPath])\n })\n .map(({ requirementSet, setIndex }) => {\n const requirementSetKey = requirementSet.key as string\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n const payloadSet = payload[requirementSetPath] as Record<string, unknown>\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n\n const applicableRequirements = preparedRequirements\n .map((req, index) => ({ req, index }))\n .filter(({ req }) => isRequirementApplicable(req, requirementSetPath, formValues))\n\n return {\n state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: applicableRequirements.map(({ req, index }) => ({\n key: req.key as string,\n value: stringifyRequirementValue(\n payloadSet[getUniqueRhfKey(req, index, preparedRequirements)],\n ),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSets","requirementSet","index","requirementSetPath","getUniqueRhfKey","preparedRequirements","prepareRequirements","shape","defaults","buildRequirementSchema","z","control","methods","useForm","zodResolver","onSubmit","formData","payload","formValues","allRequirementSets","setIndex","requirementSetKey","payloadSet","applicableRequirements","req","isRequirementApplicable","stringifyRequirementValue","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoEO,SAASA,GAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,OAAAC,GAAO,WAAAC,GAAW,UAAA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2C,EAAgB,MAAM;AAAA,EAChC;AAEA,SACE,gBAAAnD,EAAC,WAAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACqD,KAAc,GAAGjB,GAAS,SAAAD,GACzB,UAAA,gBAAAnC,EAACsD,IAAA,EAAS,UAAUlB,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAAvC;AAAA,IAACuD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAAxC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAAgD,EAAA;AAAA,MAElE,UAAA,gBAAApD,EAACwD,MAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlD,KAGC,gBAAAmD,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA1D,EAAC2D,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -9,15 +9,12 @@ 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";
|
|
14
12
|
import "../../../../shared/constants.js";
|
|
15
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
18
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesFormContext");
|
|
19
16
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
d as StateTaxesFormProvider,
|
|
18
|
+
c as useStateTaxesForm
|
|
22
19
|
};
|
|
23
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
|
|
@@ -9,15 +9,12 @@ 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";
|
|
14
12
|
import "../../../../shared/constants.js";
|
|
15
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
18
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesListContext");
|
|
19
16
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
d as StateTaxesListProvider,
|
|
18
|
+
c as useStateTaxesList
|
|
22
19
|
};
|
|
23
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
|