@gusto/embedded-react-sdk 0.10.2 → 0.10.3-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/Base/Base.d.ts +3 -2
  3. package/dist/components/Base/Base.js +31 -31
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Company/BankAccount/BankAccountComponents.js +16 -9
  6. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  7. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +22 -8
  8. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  9. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -0
  10. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +23 -25
  11. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  12. package/dist/components/Company/BankAccount/BankAccountForm/context.d.ts +4 -0
  13. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +14 -13
  15. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  16. package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -1
  17. package/dist/components/Company/BankAccount/stateMachine.js +13 -5
  18. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  19. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -42
  20. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  21. package/dist/components/Company/FederalTaxes/Head.js +11 -11
  22. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  23. package/dist/components/Company/Industry/Industry.js +30 -31
  24. package/dist/components/Company/Industry/Industry.js.map +1 -1
  25. package/dist/components/Company/Locations/LocationForm/LocationForm.js +34 -37
  26. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  27. package/dist/components/Company/Locations/Locations.d.ts +1 -1
  28. package/dist/components/Company/Locations/Locations.js +19 -17
  29. package/dist/components/Company/Locations/Locations.js.map +1 -1
  30. package/dist/components/Company/Locations/LocationsList/List.js +5 -2
  31. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  32. package/dist/components/Company/PaySchedule/PaySchedule.js +70 -71
  33. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  34. package/dist/components/Contractor/Address/Address.js +37 -38
  35. package/dist/components/Contractor/Address/Address.js.map +1 -1
  36. package/dist/components/Contractor/List/index.js +47 -50
  37. package/dist/components/Contractor/List/index.js.map +1 -1
  38. package/dist/components/Contractor/NewHireReport/NewHireReport.js +57 -58
  39. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  40. package/dist/components/Employee/Compensation/Compensation.js +123 -132
  41. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  42. package/dist/components/Employee/Deductions/Deductions.js +74 -79
  43. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  44. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +36 -42
  45. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  46. package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -58
  47. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  48. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +95 -97
  49. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  50. package/dist/components/Employee/Profile/Profile.js +118 -124
  51. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  52. package/dist/components/Employee/Taxes/FederalForm.js +4 -4
  53. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  54. package/dist/components/Employee/Taxes/Taxes.js +59 -60
  55. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  56. package/dist/contexts/ApiProvider/ApiProvider.js +16 -14
  57. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  58. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +5 -0
  59. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
  60. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +19 -17
  61. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  62. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +7 -0
  63. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js +10 -0
  64. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -0
  65. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +6 -0
  66. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +11 -0
  67. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -0
  68. package/dist/i18n/en/Company.Locations.json.js +2 -2
  69. package/dist/shared/constants.d.ts +2 -0
  70. package/dist/shared/constants.js +10 -9
  71. package/dist/shared/constants.js.map +1 -1
  72. package/dist/style.css +1 -1
  73. package/dist/types/i18next.d.ts +1 -1
  74. package/package.json +8 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/List/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractors } from './useContractorList'\nimport { DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\n\nexport type ContractorListDisplay = Pick<\n Contractor,\n 'onboardingStatus' | 'firstName' | 'lastName' | 'onboarded'\n>\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const { Badge, Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Badge>{count}</Badge>\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCTA')}\n </Button>\n )}\n </Flex>\n )\n}\n\nexport interface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nexport function EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData>\n <h1>{t('emptyTableTitle')}</h1>\n {t('emptyTableDescription')}\n <Button onClick={handleAdd}>{t('addContractorCTA')}</Button>\n </EmptyData>\n )\n}\n\nexport interface ContractorListProps {\n contractors: ContractorListDisplay[]\n handleAdd: () => void\n handleEdit: () => void\n totalCount: number\n}\n\nexport function ContractorList({\n contractors,\n handleAdd,\n handleEdit,\n totalCount,\n}: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n const { t } = useTranslation('Contractor.ContractorList')\n\n const dataViewProps = useDataView<ContractorListDisplay>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: () => (\n <HamburgerMenu\n items={[{ label: t('editCTA'), icon: <PencilSvg aria-hidden />, onClick: handleEdit }]}\n triggerLabel={t('editCTA')}\n isLoading={false}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n })\n\n return (\n <>\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n </>\n )\n}\n\nexport interface ContractorListWithApiProps {\n companyId: string\n handleAdd: () => void\n handleEdit: () => void\n}\n\nexport function ContractorListWithApi({\n companyId,\n handleAdd,\n handleEdit,\n}: ContractorListWithApiProps) {\n const contractorProps = useContractors({ companyUuid: companyId, handleAdd })\n\n return <ContractorList handleEdit={handleEdit} {...contractorProps} />\n}\n"],"names":["Head","count","handleAdd","Badge","Button","Heading","useComponentContext","t","useTranslation","Flex","jsx","EmptyDataContractorsList","EmptyData","ContractorList","contractors","handleEdit","totalCount","useI18n","dataViewProps","useDataView","contractor","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","jsxs","Fragment","DataView","ContractorListWithApi","companyId","contractorProps","useContractors"],"mappings":";;;;;;;;;;;;;AAoBO,SAASA,EAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AACpD,QAAM,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAoB,GACjD,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,2BACGC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACL,GAAQ,EAAA,IAAG,MAAM,UAAAE,EAAE,OAAO,GAAE;AAAA,IAC7B,gBAAAG,EAACP,KAAO,UAAMF,EAAA,CAAA;AAAA,IACbA,MAAU,KACT,gBAAAS,EAACN,GAAO,EAAA,SAAQ,aAAY,SAASF,GAClC,UAAEK,EAAA,eAAe,EACpB,CAAA;AAAA,EAAA,GAEJ;AAEJ;AAKgB,SAAAI,EAAyB,EAAE,WAAAT,KAA4C;AAC/E,QAAA,EAAE,QAAAE,EAAO,IAAIE,EAAoB,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,2BACGI,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAF,EAAA,MAAA,EAAI,UAAEH,EAAA,iBAAiB,EAAE,CAAA;AAAA,IACzBA,EAAE,uBAAuB;AAAA,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W,EAAe,CAAA;AAAA,EAAA,GAChE;AAEJ;AAQO,SAASY,EAAsB;AAAA,EACpC,WAAAC;AAAA,EACA,WAAA7B;AAAA,EACA,YAAAa;AACF,GAA+B;AAC7B,QAAMiB,IAAkBC,EAAe,EAAE,aAAaF,GAAW,WAAA7B,GAAW;AAE5E,SAAQ,gBAAAQ,EAAAG,GAAA,EAAe,YAAAE,GAAyB,GAAGiB,EAAiB,CAAA;AACtE;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/List/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, Grid, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\n\nexport type ContractorListDisplay = Pick<\n Contractor,\n 'onboardingStatus' | 'firstName' | 'lastName' | 'onboarded'\n>\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCTA')}\n </Button>\n )}\n </Flex>\n )\n}\n\nexport interface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nexport function EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCTA')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\nexport interface ContractorListProps {\n contractors: ContractorListDisplay[]\n handleAdd: () => void\n handleEdit: () => void\n totalCount: number\n}\n\nexport function ContractorList({\n contractors,\n handleAdd,\n handleEdit,\n totalCount,\n}: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n const { t } = useTranslation('Contractor.ContractorList')\n\n const dataViewProps = useDataView<ContractorListDisplay>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: () => (\n <HamburgerMenu\n items={[{ label: t('editCTA'), icon: <PencilSvg aria-hidden />, onClick: handleEdit }]}\n triggerLabel={t('editCTA')}\n isLoading={false}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n })\n\n return (\n <Grid gap={20}>\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n </Grid>\n )\n}\n\nexport interface ContractorListWithApiProps {\n companyId: string\n handleAdd: () => void\n handleEdit: () => void\n}\n\nexport function ContractorListWithApi({\n companyId,\n handleAdd,\n handleEdit,\n}: ContractorListWithApiProps) {\n const contractorProps = useContractors({ companyUuid: companyId, handleAdd })\n\n return <ContractorList handleEdit={handleEdit} {...contractorProps} />\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","contractors","handleEdit","totalCount","useI18n","dataViewProps","useDataView","contractor","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","Grid","DataView","ContractorListWithApi","companyId","contractorProps","useContractors"],"mappings":";;;;;;;;;;;;;;;AAoBO,SAASA,EAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AACpD,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAQ,IAAIC,EAAoB,GAC1C,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACG,gBAAAC,EAAAC,GAAA,EAAK,YAAW,UAAS,gBAAe,iBACvC,UAAA;AAAA,IAAA,gBAAAC,EAACN,GAAQ,EAAA,IAAG,MAAM,UAAAE,EAAE,OAAO,GAAE;AAAA,IAE5BL,MAAU,KACT,gBAAAS,EAACP,GAAO,EAAA,SAAQ,aAAY,SAASD,GAClC,UAAEI,EAAA,eAAe,EACpB,CAAA;AAAA,EAAA,GAEJ;AAEJ;AAKgB,SAAAK,EAAyB,EAAE,WAAAT,KAA4C;AAC/E,QAAA,EAAE,QAAAC,EAAO,IAAIE,EAAoB,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAGtD,SAAA,gBAAAG,EAACE,KAAU,OAAON,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAA,gBAAAI,EAACG,KAAc,gBAAe,UAC5B,4BAACV,GAAO,EAAA,SAASD,GAAY,UAAEI,EAAA,kBAAkB,EAAE,CAAA,EAAA,CACrD,EACF,CAAA;AAEJ;AASO,SAASQ,EAAe;AAAA,EAC7B,aAAAC;AAAA,EACA,WAAAb;AAAA,EACA,YAAAc;AAAA,EACA,YAAAC;AACF,GAAwB;AACtB,EAAAC,EAAQ,2BAA2B;AACnC,QAAM,EAAE,GAAAZ,EAAA,IAAMC,EAAe,2BAA2B,GAElDY,IAAgBC,EAAmC;AAAA,IACvD,SAAS;AAAA,MACP;AAAA,QACE,OAAOd,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CACNe,MAAAC,EAAc,EAAE,YAAYD,EAAW,WAAW,WAAWA,EAAW,SAAU,CAAA;AAAA,MACtF;AAAA,MACA;AAAA,QACE,OAAOf,EAAE,oBAAoB;AAAA,QAC7B,QAAQ,CAAC,EAAE,WAAAiB,GAAW,kBAAAC,EACpB,MAAA,gBAAAd;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,WAAAF;AAAA,YACA,kBAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAGN;AAAA,IACA,MAAMT;AAAA,IACN,UAAU,MACR,gBAAAL;AAAA,MAACgB;AAAA,MAAA;AAAA,QACC,OAAO,CAAC,EAAE,OAAOpB,EAAE,SAAS,GAAG,MAAM,gBAAAI,EAACiB,KAAU,eAAW,GAAA,CAAC,GAAI,SAASX,GAAY;AAAA,QACrF,cAAcV,EAAE,SAAS;AAAA,QACzB,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF,YAAY,MAAO,gBAAAI,EAAAC,GAAA,EAAyB,WAAAT,EAAsB,CAAA;AAAA,EAAA,CACnE;AAGC,SAAA,gBAAAM,EAACoB,GAAK,EAAA,KAAK,IACT,UAAA;AAAA,IAAC,gBAAAlB,EAAAV,GAAA,EAAK,OAAOiB,GAAY,WAAAf,EAAsB,CAAA;AAAA,sBAC9C2B,GAAS,EAAA,OAAOvB,EAAE,qBAAqB,GAAI,GAAGa,EAAe,CAAA;AAAA,EAAA,GAChE;AAEJ;AAQO,SAASW,EAAsB;AAAA,EACpC,WAAAC;AAAA,EACA,WAAA7B;AAAA,EACA,YAAAc;AACF,GAA+B;AAC7B,QAAMgB,IAAkBC,EAAe,EAAE,aAAaF,GAAW,WAAA7B,GAAW;AAE5E,SAAQ,gBAAAQ,EAAAI,GAAA,EAAe,YAAAE,GAAyB,GAAGgB,EAAiB,CAAA;AACtE;"}
@@ -1,111 +1,110 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { useTranslation as S } from "react-i18next";
3
- import { useForm as E, useWatch as T, FormProvider as y } from "react-hook-form";
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useTranslation as v } from "react-i18next";
3
+ import { useForm as S, useWatch as E, FormProvider as T } from "react-hook-form";
4
4
  import { useMemo as O } from "react";
5
5
  import r from "zod";
6
6
  import { zodResolver as _ } from "@hookform/resolvers/zod";
7
- import { useContractorsGetSuspense as D, invalidateContractorsGet as F } from "@gusto/embedded-api/react-query/contractorsGet";
8
- import { useContractorsUpdateMutation as x } from "@gusto/embedded-api/react-query/contractorsUpdate";
9
- import { useQueryClient as g } from "@tanstack/react-query";
10
- import { useComponentDictionary as A, useI18n as B } from "../../../i18n/I18n.js";
11
- import { BaseComponent as P } from "../../Base/Base.js";
12
- import { useBase as j } from "../../Base/useBase.js";
13
- import { useComponentContext as q } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import { Form as L } from "../../Common/Form/Form.js";
15
- import { STATES_ABBR as M, componentEvents as u } from "../../../shared/constants.js";
16
- import { ActionsLayout as U } from "../../Common/ActionsLayout/ActionsLayout.js";
17
- import { Flex as G } from "../../Common/Flex/Flex.js";
18
- import { RadioGroupField as W } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
19
- import { SelectField as k } from "../../Common/Fields/SelectField/SelectField.js";
20
- const z = r.union([
7
+ import { useContractorsGetSuspense as y } from "@gusto/embedded-api/react-query/contractorsGet";
8
+ import { useContractorsUpdateMutation as D } from "@gusto/embedded-api/react-query/contractorsUpdate";
9
+ import { useComponentDictionary as F, useI18n as x } from "../../../i18n/I18n.js";
10
+ import { BaseComponent as g } from "../../Base/Base.js";
11
+ import { useBase as A } from "../../Base/useBase.js";
12
+ import { useComponentContext as B } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import { Form as P } from "../../Common/Form/Form.js";
14
+ import { STATES_ABBR as j, componentEvents as u } from "../../../shared/constants.js";
15
+ import { ActionsLayout as L } from "../../Common/ActionsLayout/ActionsLayout.js";
16
+ import { Flex as M } from "../../Common/Flex/Flex.js";
17
+ import { RadioGroupField as U } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
18
+ import { SelectField as q } from "../../Common/Fields/SelectField/SelectField.js";
19
+ const W = r.union([
21
20
  r.object({
22
- fileNewHireReport: r.boolean().refine((e) => e),
21
+ fileNewHireReport: r.boolean().refine((o) => o),
23
22
  state: r.string().min(1)
24
23
  }),
25
24
  r.object({
26
- fileNewHireReport: r.boolean().refine((e) => !e)
25
+ fileNewHireReport: r.boolean().refine((o) => !o)
27
26
  })
28
27
  ]);
29
- function ue(e) {
30
- return /* @__PURE__ */ t(P, { ...e, children: /* @__PURE__ */ t(V, { ...e, children: e.children }) });
28
+ function ae(o) {
29
+ return /* @__PURE__ */ e(g, { ...o, children: /* @__PURE__ */ e(k, { ...o, children: o.children }) });
31
30
  }
32
- function V({ contractorId: e, className: p, dictionary: d }) {
33
- A("Contractor.NewHireReport", d), B("Contractor.NewHireReport");
34
- const { t: o } = S("Contractor.NewHireReport"), { onEvent: m, baseSubmitHandler: f } = j(), a = q(), R = g(), {
35
- data: { contractor: h }
36
- } = D({ contractorUuid: e }), i = h, { mutateAsync: C, isPending: w } = x(), H = O(
31
+ function k({ contractorId: o, className: p, dictionary: d }) {
32
+ F("Contractor.NewHireReport", d), x("Contractor.NewHireReport");
33
+ const { t } = v("Contractor.NewHireReport"), { onEvent: m, baseSubmitHandler: f } = A(), s = B(), {
34
+ data: { contractor: R }
35
+ } = y({ contractorUuid: o }), n = R, { mutateAsync: h, isPending: H } = D(), w = O(
37
36
  () => ({
38
- fileNewHireReport: i.fileNewHireReport || !1,
39
- state: i.workState || null
37
+ fileNewHireReport: n.fileNewHireReport || !1,
38
+ state: n.workState || null
40
39
  }),
41
- [i]
42
- ), s = E({
43
- resolver: _(z),
44
- defaultValues: H
45
- }), N = T({ control: s.control, name: "fileNewHireReport" }), b = async (n) => {
46
- await f(n, async (l) => {
47
- const v = await C({
40
+ [n]
41
+ ), a = S({
42
+ resolver: _(W),
43
+ defaultValues: w
44
+ }), N = E({ control: a.control, name: "fileNewHireReport" }), b = async (i) => {
45
+ await f(i, async (l) => {
46
+ const C = await h({
48
47
  request: {
49
- contractorUuid: e,
48
+ contractorUuid: o,
50
49
  requestBody: {
51
50
  fileNewHireReport: l.fileNewHireReport,
52
51
  workState: "state" in l ? l.state : null,
53
- version: i.version
52
+ version: n.version
54
53
  }
55
54
  }
56
55
  });
57
- await F(R, [e]), m(u.CONTRACTOR_NEW_HIRE_REPORT_UPDATED, v), m(u.CONTRACTOR_NEW_HIRE_REPORT_DONE);
56
+ m(u.CONTRACTOR_NEW_HIRE_REPORT_UPDATED, C), m(u.CONTRACTOR_NEW_HIRE_REPORT_DONE);
58
57
  });
59
58
  };
60
- return /* @__PURE__ */ t("section", { className: p, children: /* @__PURE__ */ t(y, { ...s, children: /* @__PURE__ */ t(L, { onSubmit: s.handleSubmit(b), children: /* @__PURE__ */ c(G, { flexDirection: "column", children: [
59
+ return /* @__PURE__ */ e("section", { className: p, children: /* @__PURE__ */ e(T, { ...a, children: /* @__PURE__ */ e(P, { onSubmit: a.handleSubmit(b), children: /* @__PURE__ */ c(M, { flexDirection: "column", children: [
61
60
  /* @__PURE__ */ c("header", { children: [
62
- /* @__PURE__ */ t(a.Heading, { as: "h2", children: o("title") }),
63
- /* @__PURE__ */ t(a.Text, { children: o("description") })
61
+ /* @__PURE__ */ e(s.Heading, { as: "h2", children: t("title") }),
62
+ /* @__PURE__ */ e(s.Text, { children: t("description") })
64
63
  ] }),
65
- /* @__PURE__ */ t(
66
- W,
64
+ /* @__PURE__ */ e(
65
+ U,
67
66
  {
68
67
  name: "fileNewHireReport",
69
- label: o("doFileLegend"),
68
+ label: t("doFileLegend"),
70
69
  shouldVisuallyHideLabel: !0,
71
70
  options: [
72
71
  {
73
72
  value: !0,
74
- label: o("yesOption")
73
+ label: t("yesOption")
75
74
  },
76
75
  {
77
76
  value: !1,
78
- label: o("noOption")
77
+ label: t("noOption")
79
78
  }
80
79
  ]
81
80
  }
82
81
  ),
83
- N && /* @__PURE__ */ t(
84
- k,
82
+ N && /* @__PURE__ */ e(
83
+ q,
85
84
  {
86
85
  name: "state",
87
- options: M.map((n) => ({
88
- label: o(`statesHash.${n}`, { ns: "common" }),
89
- value: n
86
+ options: j.map((i) => ({
87
+ label: t(`statesHash.${i}`, { ns: "common" }),
88
+ value: i
90
89
  })),
91
- label: o("stateSelectionLabel"),
90
+ label: t("stateSelectionLabel"),
92
91
  placeholder: "",
93
- errorMessage: o("validations.state"),
92
+ errorMessage: t("validations.state"),
94
93
  isRequired: !0
95
94
  }
96
95
  ),
97
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(
98
- a.Button,
96
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
97
+ s.Button,
99
98
  {
100
99
  type: "submit",
101
100
  variant: "primary",
102
- isDisabled: w,
103
- children: o("submitCta")
101
+ isDisabled: H,
102
+ children: t("submitCta")
104
103
  }
105
104
  ) })
106
105
  ] }) }) }) });
107
106
  }
108
107
  export {
109
- ue as NewHireReport
108
+ ae as NewHireReport
110
109
  };
111
110
  //# sourceMappingURL=NewHireReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NewHireReport.js","sources":["../../../../src/components/Contractor/NewHireReport/NewHireReport.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n invalidateContractorsGet,\n useContractorsGetSuspense,\n} from '@gusto/embedded-api/react-query/contractorsGet'\nimport { useContractorsUpdateMutation } from '@gusto/embedded-api/react-query/contractorsUpdate'\nimport { useQueryClient } from '@tanstack/react-query'\nimport type { NewHireReportProps } from './types'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { componentEvents, STATES_ABBR } from '@/shared/constants'\nimport { ActionsLayout } from '@/components/Common/ActionsLayout'\nimport { Flex, RadioGroupField, SelectField } from '@/components/Common'\n\nconst NewHireReportSchema = z.union([\n z.object({\n fileNewHireReport: z.boolean().refine(v => v),\n state: z.string().min(1),\n }),\n z.object({\n fileNewHireReport: z.boolean().refine(v => !v),\n }),\n])\n\nexport type NewHireReportSchemaInputs = z.input<typeof NewHireReportSchema>\n\nexport function NewHireReport(props: NewHireReportProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, className, dictionary }: NewHireReportProps) {\n useComponentDictionary('Contractor.NewHireReport', dictionary)\n useI18n('Contractor.NewHireReport')\n const { t } = useTranslation('Contractor.NewHireReport')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n const queryClient = useQueryClient()\n\n const {\n data: { contractor },\n } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractorDetails = contractor!\n\n const { mutateAsync: updateContractor, isPending: updateContractorPending } =\n useContractorsUpdateMutation()\n\n const defaultValues = useMemo(\n () => ({\n fileNewHireReport: contractorDetails.fileNewHireReport || false,\n state: contractorDetails.workState || null,\n }),\n [contractorDetails],\n )\n\n const formMethods = useForm({\n resolver: zodResolver(NewHireReportSchema),\n defaultValues: defaultValues,\n })\n\n const watchedDoFile = useWatch({ control: formMethods.control, name: 'fileNewHireReport' })\n const onSubmit: SubmitHandler<NewHireReportSchemaInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const contractorResponse = await updateContractor({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n fileNewHireReport: payload.fileNewHireReport,\n workState: 'state' in payload ? payload.state : null,\n version: contractorDetails.version!,\n },\n },\n })\n await invalidateContractorsGet(queryClient, [contractorId])\n onEvent(componentEvents.CONTRACTOR_NEW_HIRE_REPORT_UPDATED, contractorResponse)\n onEvent(componentEvents.CONTRACTOR_NEW_HIRE_REPORT_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection={'column'}>\n <header>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>{t('description')}</Components.Text>\n </header>\n <RadioGroupField\n name=\"fileNewHireReport\"\n label={t('doFileLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: true,\n label: t('yesOption'),\n },\n {\n value: false,\n label: t('noOption'),\n },\n ]}\n />\n {watchedDoFile && (\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateSelectionLabel')}\n placeholder={''}\n errorMessage={t('validations.state')}\n isRequired\n />\n )}\n <ActionsLayout>\n <Components.Button\n type=\"submit\"\n variant=\"primary\"\n isDisabled={updateContractorPending}\n >\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["NewHireReportSchema","z","v","NewHireReport","props","jsx","BaseComponent","Root","contractorId","className","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","queryClient","useQueryClient","contractor","useContractorsGetSuspense","contractorDetails","updateContractor","updateContractorPending","useContractorsUpdateMutation","defaultValues","useMemo","formMethods","useForm","zodResolver","watchedDoFile","useWatch","onSubmit","data","payload","contractorResponse","invalidateContractorsGet","componentEvents","FormProvider","Form","jsxs","Flex","RadioGroupField","SelectField","STATES_ABBR","stateAbbr","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,IAAsBC,EAAE,MAAM;AAAA,EAClCA,EAAE,OAAO;AAAA,IACP,mBAAmBA,EAAE,QAAA,EAAU,OAAO,OAAKC,CAAC;AAAA,IAC5C,OAAOD,E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AAAA,QAAA,EACP;AAAA,QACF,OAAOnC,EAAE,qBAAqB;AAAA,QAC9B,aAAa;AAAA,QACb,cAAcA,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,sBAEDoC,GACC,EAAA,UAAA,gBAAA5C;AAAA,MAACa,EAAW;AAAA,MAAX;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,YAAYQ;AAAA,QAEX,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAElB,CAAA;AAAA,EAAA,GACF,EAAA,CACF,EACF,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"NewHireReport.js","sources":["../../../../src/components/Contractor/NewHireReport/NewHireReport.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { useContractorsUpdateMutation } from '@gusto/embedded-api/react-query/contractorsUpdate'\nimport type { NewHireReportProps } from './types'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { componentEvents, STATES_ABBR } from '@/shared/constants'\nimport { ActionsLayout } from '@/components/Common/ActionsLayout'\nimport { Flex, RadioGroupField, SelectField } from '@/components/Common'\n\nconst NewHireReportSchema = z.union([\n z.object({\n fileNewHireReport: z.boolean().refine(v => v),\n state: z.string().min(1),\n }),\n z.object({\n fileNewHireReport: z.boolean().refine(v => !v),\n }),\n])\n\nexport type NewHireReportSchemaInputs = z.input<typeof NewHireReportSchema>\n\nexport function NewHireReport(props: NewHireReportProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, className, dictionary }: NewHireReportProps) {\n useComponentDictionary('Contractor.NewHireReport', dictionary)\n useI18n('Contractor.NewHireReport')\n const { t } = useTranslation('Contractor.NewHireReport')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { contractor },\n } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractorDetails = contractor!\n\n const { mutateAsync: updateContractor, isPending: updateContractorPending } =\n useContractorsUpdateMutation()\n\n const defaultValues = useMemo(\n () => ({\n fileNewHireReport: contractorDetails.fileNewHireReport || false,\n state: contractorDetails.workState || null,\n }),\n [contractorDetails],\n )\n\n const formMethods = useForm({\n resolver: zodResolver(NewHireReportSchema),\n defaultValues: defaultValues,\n })\n\n const watchedDoFile = useWatch({ control: formMethods.control, name: 'fileNewHireReport' })\n const onSubmit: SubmitHandler<NewHireReportSchemaInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const contractorResponse = await updateContractor({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n fileNewHireReport: payload.fileNewHireReport,\n workState: 'state' in payload ? payload.state : null,\n version: contractorDetails.version!,\n },\n },\n })\n onEvent(componentEvents.CONTRACTOR_NEW_HIRE_REPORT_UPDATED, contractorResponse)\n onEvent(componentEvents.CONTRACTOR_NEW_HIRE_REPORT_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection={'column'}>\n <header>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>{t('description')}</Components.Text>\n </header>\n <RadioGroupField\n name=\"fileNewHireReport\"\n label={t('doFileLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: true,\n label: t('yesOption'),\n },\n {\n value: false,\n label: t('noOption'),\n },\n ]}\n />\n {watchedDoFile && (\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateSelectionLabel')}\n placeholder={''}\n errorMessage={t('validations.state')}\n isRequired\n />\n )}\n <ActionsLayout>\n <Components.Button\n type=\"submit\"\n variant=\"primary\"\n isDisabled={updateContractorPending}\n >\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["NewHireReportSchema","z","v","NewHireReport","props","jsx","BaseComponent","Root","contractorId","className","dictionary","useComponentDictionary","useI18n","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","contractor","useContractorsGetSuspense","contractorDetails","updateContractor","updateContractorPending","useContractorsUpdateMutation","defaultValues","useMemo","formMethods","useForm","zodResolver","watchedDoFile","useWatch","onSubmit","data","payload","contractorResponse","componentEvents","FormProvider","Form","jsxs","Flex","RadioGroupField","SelectField","STATES_ABBR","stateAbbr","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAsBC,EAAE,MAAM;AAAA,EAClCA,EAAE,OAAO;AAAA,IACP,mBAAmBA,EAAE,QAAA,EAAU,OAAO,OAAKC,CAAC;AAAA,IAC5C,OAAOD,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAAA,CACxB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,mBAAmBA,EAAE,QAAA,EAAU,OAAO,CAAAC,MAAK,CAACA,CAAC;AAAA,EAC9C,CAAA;AACH,CAAC;AAIM,SAASC,GAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,cAAAC,GAAc,WAAAC,GAAW,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,4BAA4BD,CAAU,GA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ACnB,UAAA;AAAA,IAAA,gBAAAD,EAAC,UACC,EAAA,UAAA;AAAA,MAAA,gBAAAlC,EAACY,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,OAAO,GAAE;AAAA,wBACvCA,EAAW,MAAX,EAAiB,UAAA,EAAE,aAAa,EAAE,CAAA;AAAA,IAAA,GACrC;AAAA,IACA,gBAAAZ;AAAA,MAACoC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAO,EAAE,cAAc;AAAA,QACvB,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAO,EAAE,WAAW;AAAA,UACtB;AAAA,UACA;AAAA,YACE,OAAO;AAAA,YACP,OAAO,EAAE,UAAU;AAAA,UAAA;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,IACCX,KACC,gBAAAzB;AAAA,MAACqC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASC,EAAY,IAAI,CAACC,OAA6C;AAAA,UACrE,OAAO,EAAE,cAAcA,CAAS,IAAI,EAAE,IAAI,UAAU;AAAA,UACpD,OAAOA;AAAA,QAAA,EACP;AAAA,QACF,OAAO,EAAE,qBAAqB;AAAA,QAC9B,aAAa;AAAA,QACb,cAAc,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,sBAEDC,GACC,EAAA,UAAA,gBAAAxC;AAAA,MAACY,EAAW;AAAA,MAAX;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,YAAYM;AAAA,QAEX,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAElB,CAAA;AAAA,EAAA,GACF,EAAA,CACF,EACF,CAAA,GACF;AAEJ;"}
@@ -1,143 +1,134 @@
1
- import { jsx as s, jsxs as ue, Fragment as me } from "react/jsx-runtime";
2
- import { zodResolver as de } from "@hookform/resolvers/zod";
3
- import { useState as N, useMemo as j, useEffect as le } from "react";
4
- import { useForm as ce, FormProvider as fe } from "react-hook-form";
5
- import { useTranslation as pe } from "react-i18next";
6
- import { useJobsAndCompensationsGetJobsSuspense as Ce, invalidateJobsAndCompensationsGetJobs as T } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
7
- import { useJobsAndCompensationsCreateJobMutation as Ee } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob";
8
- import { useJobsAndCompensationsUpdateMutation as Se } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdate";
9
- import { useJobsAndCompensationsDeleteMutation as he } from "@gusto/embedded-api/react-query/jobsAndCompensationsDelete";
10
- import { useJobsAndCompensationsUpdateCompensationMutation as Ae } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
11
- import { useLocationsGetMinimumWagesSuspense as De } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
12
- import { useEmployeeAddressesGetWorkAddressesSuspense as Oe } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
13
- import { useQueryClient as ye } from "@tanstack/react-query";
14
- import { useFederalTaxDetailsGetSuspense as be } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
15
- import { useEmployeesGetSuspense as Te } from "@gusto/embedded-api/react-query/employeesGet";
16
- import { List as Y } from "./List.js";
17
- import { Head as k } from "./Head.js";
18
- import { Edit as q } from "./Edit.js";
19
- import { Actions as x } from "./Actions.js";
20
- import { CompensationSchema as Ie, CompensationProvider as Me } from "./useCompensation.js";
21
- import { Form as Pe } from "../../Common/Form/Form.js";
22
- import { FlsaStatus as S, componentEvents as C } from "../../../shared/constants.js";
23
- import { useComponentDictionary as We, useI18n as ge } from "../../../i18n/I18n.js";
24
- import { BaseComponent as Ne } from "../../Base/Base.js";
25
- import { useBase as _e } from "../../Base/useBase.js";
26
- import { useFlow as Le } from "../../Flow/useFlow.js";
27
- function h(e) {
28
- return We("Employee.Compensation", e.dictionary), /* @__PURE__ */ s(Ne, { ...e, children: /* @__PURE__ */ s(Je, { ...e, children: e.children }) });
1
+ import { jsx as s, jsxs as re, Fragment as ie } from "react/jsx-runtime";
2
+ import { zodResolver as me } from "@hookform/resolvers/zod";
3
+ import { useState as W, useMemo as F, useEffect as ue } from "react";
4
+ import { useForm as de, FormProvider as le } from "react-hook-form";
5
+ import { useTranslation as ce } from "react-i18next";
6
+ import { useJobsAndCompensationsGetJobsSuspense as pe } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
7
+ import { useJobsAndCompensationsCreateJobMutation as fe } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob";
8
+ import { useJobsAndCompensationsUpdateMutation as Ee } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdate";
9
+ import { useJobsAndCompensationsDeleteMutation as Ce } from "@gusto/embedded-api/react-query/jobsAndCompensationsDelete";
10
+ import { useJobsAndCompensationsUpdateCompensationMutation as he } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
11
+ import { useLocationsGetMinimumWagesSuspense as Ae } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
12
+ import { useEmployeeAddressesGetWorkAddressesSuspense as De } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
13
+ import { useFederalTaxDetailsGetSuspense as Oe } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
14
+ import { useEmployeesGetSuspense as Se } from "@gusto/embedded-api/react-query/employeesGet";
15
+ import { List as j } from "./List.js";
16
+ import { Head as V } from "./Head.js";
17
+ import { Edit as Y } from "./Edit.js";
18
+ import { Actions as k } from "./Actions.js";
19
+ import { CompensationSchema as ye, CompensationProvider as Ie } from "./useCompensation.js";
20
+ import { Form as Te } from "../../Common/Form/Form.js";
21
+ import { FlsaStatus as h, componentEvents as E } from "../../../shared/constants.js";
22
+ import { useComponentDictionary as be, useI18n as Me } from "../../../i18n/I18n.js";
23
+ import { BaseComponent as Pe } from "../../Base/Base.js";
24
+ import { useBase as We } from "../../Base/useBase.js";
25
+ import { useFlow as ge } from "../../Flow/useFlow.js";
26
+ function A(t) {
27
+ return be("Employee.Compensation", t.dictionary), /* @__PURE__ */ s(Pe, { ...t, children: /* @__PURE__ */ s(Ne, { ...t, children: t.children }) });
29
28
  }
30
- const V = (e) => e?.compensations?.find((l) => l.uuid === e.currentCompensationUuid), Je = ({ employeeId: e, startDate: l, className: A, children: D, ...u }) => {
31
- ge("Employee.Compensation");
32
- const { baseSubmitHandler: G, onEvent: c } = _e(), O = ye(), { data: R } = Ce({ employeeId: e }), n = R.jobList, { data: H } = Oe({ employeeId: e }), _ = H.employeeWorkAddressesList.find((t) => t.active), {
33
- data: { minimumWageList: X }
34
- } = De({
35
- locationUuid: _.locationUuid
36
- }), z = X, {
37
- data: { employee: L }
38
- } = Te({ employeeId: e });
39
- if (!L)
29
+ const B = (t) => t?.compensations?.find((l) => l.uuid === t.currentCompensationUuid), Ne = ({ employeeId: t, startDate: l, className: D, children: O, ...m }) => {
30
+ Me("Employee.Compensation");
31
+ const { baseSubmitHandler: x, onEvent: c } = We(), { data: q } = pe({ employeeId: t }), n = q.jobList, { data: G } = De({ employeeId: t }), g = G.employeeWorkAddressesList.find((e) => e.active), {
32
+ data: { minimumWageList: R }
33
+ } = Ae({
34
+ locationUuid: g.locationUuid
35
+ }), H = R, {
36
+ data: { employee: N }
37
+ } = Se({ employeeId: t });
38
+ if (!N)
40
39
  throw new Error("Employee not found");
41
- const { data: Q } = be({ companyId: L.companyUuid }), K = Q.federalTaxDetails.taxPayerType === "S-Corporation", J = Ae({
42
- onSettled: () => T(O, [e])
43
- }), v = Ee({
44
- onSettled: () => T(O, [e])
45
- }), w = Se({
46
- onSettled: () => T(O, [e])
47
- }), U = he({
48
- onSettled: () => T(O, [e])
49
- }), [o, y] = N(
40
+ const { data: X } = Oe({ companyId: N.companyUuid }), z = X.federalTaxDetails.taxPayerType === "S-Corporation", _ = he(), L = fe(), J = Ee(), w = Ce(), [o, S] = W(
50
41
  n.length === 1 ? n[0] ?? null : null
51
- ), [I, f] = N(() => {
42
+ ), [I, p] = W(() => {
52
43
  if (!n.length)
53
44
  return "ADD_INITIAL_JOB";
54
- const t = V(n[0]);
55
- return n.length === 1 && t?.flsaStatus !== S.NONEXEMPT ? "EDIT_INITIAL_JOB" : "LIST";
56
- }), [Z, F] = N(!1), a = V(o), M = j(() => n.reduce((t, r) => {
57
- const m = r.compensations?.find(
58
- (b) => b.uuid === r.currentCompensationUuid
45
+ const e = B(n[0]);
46
+ return n.length === 1 && e?.flsaStatus !== h.NONEXEMPT ? "EDIT_INITIAL_JOB" : "LIST";
47
+ }), [K, v] = W(!1), a = B(o), T = F(() => n.reduce((e, r) => {
48
+ const u = r.compensations?.find(
49
+ (y) => y.uuid === r.currentCompensationUuid
59
50
  );
60
- return !r.primary || !m ? t : m.flsaStatus ?? t;
61
- }, void 0), [n]), p = j(() => ({
62
- jobTitle: o?.title && o.title !== "" ? o.title : u.defaultValues?.title ?? "",
63
- flsaStatus: a?.flsaStatus ?? M ?? u.defaultValues?.flsaStatus,
64
- rate: Number(a?.rate ?? u.defaultValues?.rate ?? 0),
51
+ return !r.primary || !u ? e : u.flsaStatus ?? e;
52
+ }, void 0), [n]), f = F(() => ({
53
+ jobTitle: o?.title && o.title !== "" ? o.title : m.defaultValues?.title ?? "",
54
+ flsaStatus: a?.flsaStatus ?? T ?? m.defaultValues?.flsaStatus,
55
+ rate: Number(a?.rate ?? m.defaultValues?.rate ?? 0),
65
56
  adjustForMinimumWage: a?.adjustForMinimumWage ?? !1,
66
57
  minimumWageId: a?.minimumWages?.[0]?.uuid ?? "",
67
- paymentUnit: a?.paymentUnit ?? u.defaultValues?.paymentUnit ?? "Hour",
58
+ paymentUnit: a?.paymentUnit ?? m.defaultValues?.paymentUnit ?? "Hour",
68
59
  stateWcCovered: o?.stateWcCovered ?? !1,
69
60
  stateWcClassCode: o?.stateWcClassCode ?? ""
70
- }), [o, a, M, u.defaultValues]), B = ce({
71
- resolver: de(Ie),
72
- defaultValues: p
73
- }), { resetField: P, setValue: W, handleSubmit: $, reset: E } = B;
74
- le(() => {
75
- E(p);
76
- }, [o, p, E]);
77
- const ee = async (t) => {
78
- if (I === "LIST" && t === "PROCEED") {
79
- c(C.EMPLOYEE_COMPENSATION_DONE);
61
+ }), [o, a, T, m.defaultValues]), U = de({
62
+ resolver: me(ye),
63
+ defaultValues: f
64
+ }), { resetField: b, setValue: M, handleSubmit: Q, reset: C } = U;
65
+ ue(() => {
66
+ C(f);
67
+ }, [o, f, C]);
68
+ const Z = async (e) => {
69
+ if (I === "LIST" && e === "PROCEED") {
70
+ c(E.EMPLOYEE_COMPENSATION_DONE);
80
71
  return;
81
72
  }
82
73
  if (!o && I === "LIST") {
83
- f("ADD_ADDITIONAL_JOB");
74
+ p("ADD_ADDITIONAL_JOB");
84
75
  return;
85
76
  }
86
- await $(async (r) => {
87
- switch (await re(r), t) {
77
+ await Q(async (r) => {
78
+ switch (await se(r), e) {
88
79
  case "LIST":
89
- f("LIST"), y(null), E(p);
80
+ p("LIST"), S(null), C(f);
90
81
  break;
91
82
  default:
92
- c(C.EMPLOYEE_COMPENSATION_DONE);
83
+ c(E.EMPLOYEE_COMPENSATION_DONE);
93
84
  }
94
85
  })();
95
- }, te = () => {
96
- f("ADD_ADDITIONAL_JOB"), y(null), E(p);
97
- }, oe = () => {
98
- n.length > 0 ? f("LIST") : f("ADD_INITIAL_JOB"), y(null), E(p);
99
- }, ne = (t) => {
100
- const r = n.find((m) => t === m.uuid);
101
- r && (f("EDIT_ADDITIONAL_JOB"), y(r));
102
- }, se = async (t) => {
103
- await U.mutateAsync({ request: { jobId: t } }), c(C.EMPLOYEE_JOB_DELETED);
104
- }, ae = (t) => {
105
- a?.flsaStatus === S.NONEXEMPT && n.length > 1 && F(!0), t === S.OWNER ? (W("paymentUnit", "Paycheck"), P("rate", { defaultValue: Number(a?.rate) })) : t === S.COMMISSION_ONLY_NONEXEMPT || t === S.COMMISSION_ONLY_EXEMPT ? (W("paymentUnit", "Year"), W("rate", 0)) : (P("paymentUnit", { defaultValue: a?.paymentUnit }), P("rate", { defaultValue: Number(a?.rate) }));
106
- }, re = async (t) => {
107
- await G(t, async (r) => {
108
- const { jobTitle: m, twoPercentShareholder: b, ...i } = r;
86
+ }, $ = () => {
87
+ p("ADD_ADDITIONAL_JOB"), S(null), C(f);
88
+ }, ee = () => {
89
+ n.length > 0 ? p("LIST") : p("ADD_INITIAL_JOB"), S(null), C(f);
90
+ }, te = (e) => {
91
+ const r = n.find((u) => e === u.uuid);
92
+ r && (p("EDIT_ADDITIONAL_JOB"), S(r));
93
+ }, oe = async (e) => {
94
+ await w.mutateAsync({ request: { jobId: e } }), c(E.EMPLOYEE_JOB_DELETED);
95
+ }, ne = (e) => {
96
+ a?.flsaStatus === h.NONEXEMPT && n.length > 1 && v(!0), e === h.OWNER ? (M("paymentUnit", "Paycheck"), b("rate", { defaultValue: Number(a?.rate) })) : e === h.COMMISSION_ONLY_NONEXEMPT || e === h.COMMISSION_ONLY_EXEMPT ? (M("paymentUnit", "Year"), M("rate", 0)) : (b("paymentUnit", { defaultValue: a?.paymentUnit }), b("rate", { defaultValue: Number(a?.rate) }));
97
+ }, se = async (e) => {
98
+ await x(e, async (r) => {
99
+ const { jobTitle: u, twoPercentShareholder: y, ...i } = r;
109
100
  let d;
110
- o ? (d = (await w.mutateAsync({
101
+ o ? (d = (await J.mutateAsync({
111
102
  request: {
112
103
  jobId: o.uuid,
113
104
  requestBody: {
114
- title: m,
105
+ title: u,
115
106
  version: o.version,
116
107
  hireDate: l,
117
108
  stateWcClassCode: i.stateWcCovered ? i.stateWcClassCode : null,
118
109
  stateWcCovered: i.stateWcCovered,
119
- twoPercentShareholder: b ?? !1
110
+ twoPercentShareholder: y ?? !1
120
111
  }
121
112
  }
122
- })).job, c(C.EMPLOYEE_JOB_UPDATED, d)) : (d = (await v.mutateAsync({
113
+ })).job, c(E.EMPLOYEE_JOB_UPDATED, d)) : (d = (await L.mutateAsync({
123
114
  request: {
124
- employeeId: e,
115
+ employeeId: t,
125
116
  requestBody: {
126
- title: m,
117
+ title: u,
127
118
  hireDate: l,
128
119
  stateWcCovered: i.stateWcCovered,
129
120
  stateWcClassCode: i.stateWcCovered ? i.stateWcClassCode : null,
130
- twoPercentShareholder: b ?? !1
121
+ twoPercentShareholder: y ?? !1
131
122
  }
132
123
  }
133
- })).job, c(C.EMPLOYEE_JOB_CREATED, d));
134
- const { compensation: ie } = await J.mutateAsync({
124
+ })).job, c(E.EMPLOYEE_JOB_CREATED, d));
125
+ const { compensation: ae } = await _.mutateAsync({
135
126
  request: {
136
127
  compensationId: d.currentCompensationUuid,
137
128
  requestBody: {
138
129
  // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
139
130
  version: d.compensations?.find(
140
- (g) => g.uuid === d.currentCompensationUuid
131
+ (P) => P.uuid === d.currentCompensationUuid
141
132
  )?.version,
142
133
  ...i,
143
134
  rate: String(i.rate),
@@ -145,64 +136,64 @@ const V = (e) => e?.compensations?.find((l) => l.uuid === e.currentCompensationU
145
136
  }
146
137
  }
147
138
  });
148
- F(!1), c(C.EMPLOYEE_COMPENSATION_UPDATED, ie);
139
+ v(!1), c(E.EMPLOYEE_COMPENSATION_UPDATED, ae);
149
140
  });
150
141
  };
151
- return /* @__PURE__ */ s("section", { className: A, children: /* @__PURE__ */ s(
152
- Me,
142
+ return /* @__PURE__ */ s("section", { className: D, children: /* @__PURE__ */ s(
143
+ Ie,
153
144
  {
154
145
  value: {
155
146
  employeeJobs: n,
156
147
  currentJob: o,
157
- primaryFlsaStatus: M,
158
- showFlsaChangeWarning: Z,
148
+ primaryFlsaStatus: T,
149
+ showFlsaChangeWarning: K,
159
150
  mode: I,
160
- minimumWages: z,
161
- handleFlsaChange: ae,
162
- handleDelete: se,
163
- handleEdit: ne,
164
- handleAdd: te,
165
- submitWithEffect: ee,
166
- handleCancelAddJob: oe,
167
- isPending: J.isPending || v.isPending || w.isPending || U.isPending,
168
- state: _.state,
169
- showTwoPercentStakeholder: K
151
+ minimumWages: H,
152
+ handleFlsaChange: ne,
153
+ handleDelete: oe,
154
+ handleEdit: te,
155
+ handleAdd: $,
156
+ submitWithEffect: Z,
157
+ handleCancelAddJob: ee,
158
+ isPending: _.isPending || L.isPending || J.isPending || w.isPending,
159
+ state: g.state,
160
+ showTwoPercentStakeholder: z
170
161
  },
171
- children: /* @__PURE__ */ s(fe, { ...B, children: /* @__PURE__ */ s(Pe, { children: D || /* @__PURE__ */ ue(me, { children: [
172
- /* @__PURE__ */ s(k, {}),
162
+ children: /* @__PURE__ */ s(le, { ...U, children: /* @__PURE__ */ s(Te, { children: O || /* @__PURE__ */ re(ie, { children: [
163
+ /* @__PURE__ */ s(V, {}),
164
+ /* @__PURE__ */ s(j, {}),
173
165
  /* @__PURE__ */ s(Y, {}),
174
- /* @__PURE__ */ s(q, {}),
175
- /* @__PURE__ */ s(x, {})
166
+ /* @__PURE__ */ s(k, {})
176
167
  ] }) }) })
177
168
  }
178
169
  ) });
179
170
  };
180
- h.Head = k;
181
- h.List = Y;
182
- h.Actions = x;
183
- h.Edit = q;
184
- const it = () => {
185
- const { employeeId: e, onEvent: l, startDate: A, defaultValues: D } = Le(), { t: u } = pe("common");
186
- if (!e || !A)
171
+ A.Head = V;
172
+ A.List = j;
173
+ A.Actions = k;
174
+ A.Edit = Y;
175
+ const nt = () => {
176
+ const { employeeId: t, onEvent: l, startDate: D, defaultValues: O } = ge(), { t: m } = ce("common");
177
+ if (!t || !D)
187
178
  throw new Error(
188
- u("errors.missingParamsOrContext", {
179
+ m("errors.missingParamsOrContext", {
189
180
  component: "Compensation",
190
- param: e ? "startDate" : "employeeId",
181
+ param: t ? "startDate" : "employeeId",
191
182
  provider: "FlowProvider"
192
183
  })
193
184
  );
194
185
  return /* @__PURE__ */ s(
195
- h,
186
+ A,
196
187
  {
197
- employeeId: e,
198
- startDate: A,
188
+ employeeId: t,
189
+ startDate: D,
199
190
  onEvent: l,
200
- defaultValues: D?.compensation
191
+ defaultValues: O?.compensation
201
192
  }
202
193
  );
203
194
  };
204
195
  export {
205
- h as Compensation,
206
- it as CompensationContextual
196
+ A as Compensation,
197
+ nt as CompensationContextual
207
198
  };
208
199
  //# sourceMappingURL=Compensation.js.map