@gusto/embedded-react-sdk 0.11.0 → 0.11.1
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 +7 -0
- package/dist/components/Base/Base.js +18 -19
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +20 -20
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +6 -7
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +6 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -5
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -4
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -8
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +3 -4
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -12
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +6 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -7
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +20 -18
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
- package/dist/components/Contractor/Submit/index.js +9 -11
- package/dist/components/Contractor/Submit/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -6
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +29 -29
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +10 -12
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +10 -12
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +5 -7
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +11 -12
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +6 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -7
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +14 -15
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
- package/dist/components/Employee/Landing/Landing.js +12 -13
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -10
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +10 -11
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -9
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +51 -49
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +1 -1
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +13 -14
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js +34 -23
- package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/hooks/useDebounce/useDebounce.js +0 -19
- package/dist/hooks/useDebounce/useDebounce.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;AA+BO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAAC,EAAK,IAAIC,EAAgC,EAAE,WAAAX,GAAW,GACxDY,IAAoBF,EAAK,mBAEzB,EAAE,aAAaG,GAAyB,WAAAC,EAAA,IAAcC,EAAmC,GAEzFC,IAAcC,EAA8B;AAAA,IAChD,UAAUC,EAAYC,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,YAAYP,EAAkB,SAAS,SAAY;AAAA,MACnD,cAAcA,EAAkB,eAC3BA,EAAkB,eACnBT,GAAe;AAAA,MACnB,YAAYS,EAAkB,aACzBA,EAAkB,aACnBT,GAAe;AAAA,MACnB,WAAWS,EAAkB,aAAaT,GAAe;AAAA,IAAA;AAAA,EAC3D,CACD,GAEKiB,IAAe,OAAOV,MAA+B;AACnD,UAAAF,EAAkBE,GAAM,OAAMW,MAAW;AACvC,YAAAC,IAAkC,MAAMT,EAAwB;AAAA,QACpE,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,KAAKqB,EAAQ;AAAA,YACb,cAAcA,EAAQ;AAAA,YACtB,YAAYA,EAAQ;AAAA,YACpB,WAAWA,EAAQ;AAAA,YACnB,SAAST,EAAkB;AAAA,UAAA;AAAA,QAC7B;AAAA,MACF,CACD;AAED,MAAAL;AAAA,QACEgB,EAAc;AAAA,QACdD,EAAgC;AAAA,MAClC,GACAf,EAAQgB,EAAc,0BAA0B;AAAA,IAAA,CACjD;AAAA,EACH;AAGE,SAAA,gBAAA1B,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAV;AAAA,QACA,mBAAAF;AAAA,MACF;AAAA,MAEA,4BAACa,GAAc,EAAA,GAAGT,GAChB,UAAC,gBAAAnB,EAAA6B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAvB,EAAC8B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA1B,KAIG,gBAAA2B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -4,13 +4,11 @@ import { useTranslation as c, Trans as t } from "react-i18next";
|
|
|
4
4
|
import { TaxPayerType as _, FilingForm as y } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
|
|
5
5
|
import { useFederalTaxes as u } from "./useFederalTaxes.js";
|
|
6
6
|
import { Flex as b } from "../../Common/Flex/Flex.js";
|
|
7
|
-
import "classnames";
|
|
8
|
-
import "../../../shared/constants.js";
|
|
9
|
-
import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
7
|
import { usePlaceholderEin as g, normalizeEin as x } from "../../../helpers/federalEin.js";
|
|
11
8
|
import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
10
|
import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
-
function
|
|
11
|
+
function O() {
|
|
14
12
|
const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = F(), m = g(s?.hasEin), p = n(
|
|
15
13
|
() => Object.values(_).map((o) => ({
|
|
16
14
|
value: o,
|
|
@@ -101,6 +99,6 @@ function v() {
|
|
|
101
99
|
] });
|
|
102
100
|
}
|
|
103
101
|
export {
|
|
104
|
-
|
|
102
|
+
O as Form
|
|
105
103
|
};
|
|
106
104
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAkB,IAAIC,EAAgB,GACxCC,IAAaC,EAAoB,GAEjCC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAUC,OAAA;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ,GAEMY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAUF,OAAA;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ;AAEA,SACG,gBAAAc,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IACA,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
|
|
@@ -10,9 +10,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import "../../Base/useBase.js";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
|
-
import "classnames";
|
|
14
13
|
import "dompurify";
|
|
15
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
16
16
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
17
17
|
const C = o.object({
|
|
18
18
|
federalEin: o.string().optional(),
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useIndustryApiState as
|
|
4
|
-
import "classnames";
|
|
5
|
-
import "../../../shared/constants.js";
|
|
2
|
+
import { useTranslation as s } from "react-i18next";
|
|
3
|
+
import { useIndustryApiState as i } from "./Context.js";
|
|
6
4
|
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
5
|
import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
const
|
|
9
|
-
const { t: o } =
|
|
6
|
+
const f = () => {
|
|
7
|
+
const { t: o } = s("Company.Industry"), { isPending: n } = i(), r = e();
|
|
10
8
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
11
9
|
};
|
|
12
10
|
export {
|
|
13
|
-
|
|
11
|
+
f as Actions
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAU,IAAIC,EAAoB,GACpCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAEF,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../Base/useBase.js";
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
15
|
const [A, P] = t("IndustryItems", {
|
|
16
16
|
items: []
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useIndustryItems as
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ t(
|
|
10
|
-
i,
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as t } from "react-i18next";
|
|
3
|
+
import { useIndustryItems as s } from "./Context.js";
|
|
4
|
+
import { ComboBoxField as m } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
5
|
+
const p = () => {
|
|
6
|
+
const { t: o } = t("Company.Industry"), { items: e } = s();
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
|
+
m,
|
|
11
9
|
{
|
|
12
10
|
isRequired: !0,
|
|
13
|
-
options:
|
|
11
|
+
options: e,
|
|
14
12
|
label: o("label"),
|
|
15
13
|
name: "naics_code",
|
|
16
14
|
placeholder: o("placeholder")
|
|
@@ -18,6 +16,6 @@ const c = () => {
|
|
|
18
16
|
);
|
|
19
17
|
};
|
|
20
18
|
export {
|
|
21
|
-
|
|
19
|
+
p as Edit
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=Edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAM,IAAIC,EAAiB;AAGjC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import { useLocationsForm as e } from "./useLocationForm.js";
|
|
4
|
-
import "
|
|
5
|
-
import "../../../../
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = c();
|
|
10
|
-
return /* @__PURE__ */ r(m, { children: [
|
|
4
|
+
import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
const f = () => {
|
|
7
|
+
const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
|
|
8
|
+
return /* @__PURE__ */ r(c, { children: [
|
|
11
9
|
/* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
|
|
12
10
|
/* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
|
|
13
11
|
] });
|
|
14
12
|
};
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
f as Actions
|
|
17
15
|
};
|
|
18
16
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,9 +4,9 @@ import { useTranslation as l } from "react-i18next";
|
|
|
4
4
|
import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { Grid as p } from "../../../Common/Grid/Grid.js";
|
|
7
|
-
import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
8
7
|
import { STATES_ABBR as c } from "../../../../shared/constants.js";
|
|
9
8
|
import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
|
|
9
|
+
import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
10
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
11
11
|
import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
|
|
12
12
|
const q = i.object({
|
|
@@ -10,11 +10,10 @@ import { Actions as I } from "./Actions.js";
|
|
|
10
10
|
import { LocationsFormProvider as M } from "./useLocationForm.js";
|
|
11
11
|
import { Form as _ } from "../../../Common/Form/Form.js";
|
|
12
12
|
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
13
|
-
import "classnames";
|
|
14
|
-
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
15
13
|
import { BaseComponent as z } from "../../../Base/Base.js";
|
|
16
14
|
import { useBase as U } from "../../../Base/useBase.js";
|
|
17
15
|
import { useI18n as j } from "../../../../i18n/I18n.js";
|
|
16
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
18
17
|
function H(t) {
|
|
19
18
|
const {
|
|
20
19
|
data: { location: e }
|
|
@@ -79,7 +78,7 @@ function p({
|
|
|
79
78
|
}
|
|
80
79
|
) }) }) });
|
|
81
80
|
}
|
|
82
|
-
function
|
|
81
|
+
function ne({
|
|
83
82
|
companyId: t,
|
|
84
83
|
locationId: e,
|
|
85
84
|
className: n,
|
|
@@ -89,6 +88,6 @@ function ie({
|
|
|
89
88
|
return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: n, children: r }) });
|
|
90
89
|
}
|
|
91
90
|
export {
|
|
92
|
-
|
|
91
|
+
ne as LocationForm
|
|
93
92
|
};
|
|
94
93
|
//# sourceMappingURL=LocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzF,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzFC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,GAAU,QAAQ;AAAA,MACxB,aAAaA,GAAU,eAAe;AAAA,MACtC,SAASA,GAAU,WAAW;AAAA,MAC9B,SAASA,GAAU,WAAW;AAAA,MAC9B,OAAOA,GAAU,SAAS;AAAA,MAC1B,KAAKA,GAAU,OAAO;AAAA,MACtB,aAAaiB,EAAY,OAAO,OAAOjB,IAAWuB,CAAG,KAAK,EAAK;AAAA,IAAA;AAAA,EACjE,CACD,GAEKC,IAAe,MAAM;AACzB,IAAAhB,EAAQiB,EAAgB,MAAM;AAAA,EAChC,GACMC,IAAW,OAAOC,MAA6B;AAC7C,UAAAlB,EAAkBkB,GAAM,OAAMC,MAAa;AAC/C,YAAM,EAAE,aAAAX,GAAa,GAAGY,EAAY,IAAAD,GAE9BE,IAAc;AAAA,QAClB,GAAGD;AAAA,QACH,gBAAgBZ,GAAa,SAAS,gBAAgB;AAAA,QACtD,eAAeA,GAAa,SAAS,eAAe;AAAA,MACtD;AAEI,UAAAjB,KAAYA,EAAS,YAAY,QAAW;AAE9C,cAAM,EAAE,UAAU+B,EAAa,IAAI,MAAMjB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,YAAYd,EAAS;AAAA,YACrB,aAAa,EAAE,GAAG8B,GAAa,SAAS9B,EAAS,QAAQ;AAAA,UAAA;AAAA,QAC3D,CACD;AACO,QAAAQ,EAAAiB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA,OACzD;AAEL,cAAM,EAAE,UAAUA,EAAa,IAAI,MAAMpB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,WAAAP;AAAA,YACA,aAAA0B;AAAA,UAAA;AAAA,QACF,CACD;AACO,QAAAtB,EAAAiB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA;AAAA,IAChE,CACD;AAAA,EACH;AAEA,SACG,gBAAA7B,EAAA,WAAA,EAAQ,WAAAG,GACP,UAAA,gBAAAH,EAAC8B,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAAhB,EAAC+B,GAAS,EAAA,UAAUd,EAAQ,aAAaO,CAAQ,GAC/C,UAAA,gBAAAxB;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,cAAAV,GAAc,WAAWZ,KAAmBG,EAAgB;AAAA,MAErE,UAAA,gBAAAb,EAACiC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAIG,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEO,SAASC,GAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAe,EAAA,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAiB,EAAA,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [d, L] = o(
|
|
16
16
|
"CompanyDocumentFormContext"
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { useLocationsList as a } from "./useLocationsList.js";
|
|
4
|
-
import "classnames";
|
|
5
|
-
import "../../../../shared/constants.js";
|
|
6
4
|
import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
5
|
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
function
|
|
9
|
-
const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(),
|
|
6
|
+
function f() {
|
|
7
|
+
const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
|
|
10
8
|
return /* @__PURE__ */ c(e, { children: [
|
|
11
|
-
/* @__PURE__ */ n
|
|
12
|
-
/* @__PURE__ */ n
|
|
9
|
+
/* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
|
|
10
|
+
/* @__PURE__ */ t(n.Button, { onClick: r, children: o("continueCta") })
|
|
13
11
|
] });
|
|
14
12
|
}
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
f as Actions
|
|
17
15
|
};
|
|
18
16
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
|
|
@@ -2,8 +2,6 @@ import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as L } from "react-i18next";
|
|
3
3
|
import { useLocationsList as C } from "./useLocationsList.js";
|
|
4
4
|
import P from "../../../../assets/icons/pencil.svg.js";
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "../../../../shared/constants.js";
|
|
7
5
|
import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
|
|
8
6
|
import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
7
|
import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
@@ -11,7 +9,7 @@ import { getStreet as T, getCityStateZip as A } from "../../../../helpers/format
|
|
|
11
9
|
import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
12
10
|
import { useDataView as D } from "../../../Common/DataView/useDataView.js";
|
|
13
11
|
import { DataView as S } from "../../../Common/DataView/DataView.js";
|
|
14
|
-
const
|
|
12
|
+
const N = () => {
|
|
15
13
|
const a = y(), {
|
|
16
14
|
locationList: o,
|
|
17
15
|
handleEditLocation: s,
|
|
@@ -78,6 +76,6 @@ const q = () => {
|
|
|
78
76
|
return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
|
|
79
77
|
};
|
|
80
78
|
export {
|
|
81
|
-
|
|
79
|
+
N as List
|
|
82
80
|
};
|
|
83
81
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACC,EAAA,UAAA;AAAA,UAAA,gBAAAD,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAQ,UAAAoB,EAAUH,CAAQ,GAAE;AAAA,4BAC/C,MAAG,EAAA;AAAA,UACJ,gBAAAC,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAO,MAAK,MAC7B,UAAgBqB,EAAAJ,CAAQ,EAC3B,CAAA;AAAA,QAAA,EAAA,CACF,EACF,CAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAT,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAYI,MAGb,gBAAAM,EAAAJ,GAAA,EAAA,UAAA;AAAA,UAASF,EAAA,oCACPjB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAEa,EAAA,gBAAgB,EAAE,CAAA;AAAA,UAExDI,EAAS,iBAEL,gBAAAM,EAAAJ,GAAA,EAAA,UAAA;AAAA,YAAA;AAAA,YACD,gBAAAD,EAAClB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAAa,EAAE,eAAe,EAAE,CAAA;AAAA,UAAA,EACxD,CAAA;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAYI,MAElB,gBAAAC;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAOX,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAV,EAAmBc,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAC,EAACO,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QAEnB;AAAA,QACA,eAAY;AAAA,QACZ,cAAcZ,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAClC;AAAA,IAGJ,YAAY;AAAA,MACV,gBAAAJ;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,IACF;AAAA,IACA,YAAY,MACT,gBAAAa,EAAAQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
|
|
@@ -9,12 +9,11 @@ import { useI18n as O } from "../../../../i18n/I18n.js";
|
|
|
9
9
|
import { BaseComponent as x } from "../../../Base/Base.js";
|
|
10
10
|
import { useBase as E } from "../../../Base/useBase.js";
|
|
11
11
|
import { Flex as I } from "../../../Common/Flex/Flex.js";
|
|
12
|
-
import "
|
|
13
|
-
|
|
14
|
-
function U(o) {
|
|
12
|
+
import { companyEvents as s } from "../../../../shared/constants.js";
|
|
13
|
+
function Q(o) {
|
|
15
14
|
return /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
|
|
16
15
|
}
|
|
17
|
-
function v({ companyId: o, className: d, children:
|
|
16
|
+
function v({ companyId: o, className: d, children: i }) {
|
|
18
17
|
O("Company.Locations");
|
|
19
18
|
const { onEvent: a } = E(), [c, n] = m(1), [l, h] = m(5), {
|
|
20
19
|
data: { locationList: P, httpMeta: g }
|
|
@@ -42,16 +41,16 @@ function v({ companyId: o, className: d, children: s }) {
|
|
|
42
41
|
h(t);
|
|
43
42
|
},
|
|
44
43
|
handleAddLocation: () => {
|
|
45
|
-
a(
|
|
44
|
+
a(s.COMPANY_LOCATION_CREATE);
|
|
46
45
|
},
|
|
47
46
|
handleEditLocation: (t) => {
|
|
48
|
-
a(
|
|
47
|
+
a(s.COMPANY_LOCATION_EDIT, { uuid: t });
|
|
49
48
|
},
|
|
50
49
|
handleContinue: () => {
|
|
51
|
-
a(
|
|
50
|
+
a(s.COMPANY_LOCATION_DONE);
|
|
52
51
|
}
|
|
53
52
|
},
|
|
54
|
-
children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children:
|
|
53
|
+
children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ p(u, { children: [
|
|
55
54
|
/* @__PURE__ */ e(f, {}),
|
|
56
55
|
/* @__PURE__ */ e(C, {}),
|
|
57
56
|
/* @__PURE__ */ e(A, {})
|
|
@@ -60,6 +59,6 @@ function v({ companyId: o, className: d, children: s }) {
|
|
|
60
59
|
) });
|
|
61
60
|
}
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
Q as LocationsList
|
|
64
63
|
};
|
|
65
64
|
//# sourceMappingURL=LocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\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 }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\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 return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\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","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\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 }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\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 return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\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","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAgBO,SAASA,EAAcC,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,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAAA,EAAA,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK,IAAa,OAAOF,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC;AA6B3E,SAAA,gBAAAf,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAcJ,KAAgB,CAAC;AAAA,QAC/B,aAAAL;AAAA,QACA,YAAAQ;AAAA,QACA,iBA9BgB,MAAM;AAC5B,UAAAP,EAAe,CAAC;AAAA,QAClB;AAAA,QA6BQ,oBA5BmB,MAAM;AAC/B,UAAAA,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAG,CAAC,CAAC;AAAA,QACtD;AAAA,QA2BQ,gBA1Be,MAAM;AAC3B,UAAAT,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAGF,CAAU,CAAC;AAAA,QAC/D;AAAA,QAyBQ,gBAxBe,MAAM;AAC3B,UAAAP,EAAeO,CAAU;AAAA,QAC3B;AAAA,QAuBQ,0BArCyB,CAACG,MAAqB;AACrD,UAAAP,EAAgBO,CAAQ;AAAA,QAC1B;AAAA,QAoCQ,mBAnBkB,MAAM;AAC9B,UAAAb,EAAQc,EAAc,uBAAuB;AAAA,QAC/C;AAAA,QAkBQ,oBAjBmB,CAACC,MAAiB;AAC3C,UAAAf,EAAQc,EAAc,uBAAuB,EAAE,MAAAC,EAAA,CAAM;AAAA,QACvD;AAAA,QAgBQ,gBAxBe,MAAM;AAC3B,UAAAf,EAAQc,EAAc,qBAAqB;AAAA,QAC7C;AAAA,MAuBM;AAAA,MAEA,UAAA,gBAAArB,EAACuB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlB,KAIG,gBAAAmB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [d, f] = o(
|
|
16
16
|
"CompanyDocumentListContext"
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useOnboardingOverview as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */ n("p", { children: o("onboardingCompletedDescription") }),
|
|
13
|
-
/* @__PURE__ */ n(e.Button, { variant: "secondary", onClick: r, children: o("onboardingCompletedCta") })
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
|
+
import { useOnboardingOverview as m } from "./context.js";
|
|
4
|
+
import { Flex as a } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
const u = () => {
|
|
7
|
+
const e = d(), { onboardingCompleted: t, handleDone: r } = m(), { t: n } = l("Company.OnboardingOverview");
|
|
8
|
+
return t ? /* @__PURE__ */ i(a, { alignItems: "center", flexDirection: "column", gap: 8, children: [
|
|
9
|
+
/* @__PURE__ */ o(e.Heading, { as: "h2", textAlign: "center", children: n("onboardingCompletedTitle") }),
|
|
10
|
+
/* @__PURE__ */ o("p", { children: n("onboardingCompletedDescription") }),
|
|
11
|
+
/* @__PURE__ */ o(e.Button, { variant: "secondary", onClick: r, children: n("onboardingCompletedCta") })
|
|
14
12
|
] }) : null;
|
|
15
13
|
};
|
|
16
14
|
export {
|
|
17
|
-
|
|
15
|
+
u as Completed
|
|
18
16
|
};
|
|
19
17
|
//# sourceMappingURL=Completed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as p } from "react-i18next";
|
|
3
3
|
import { useOnboardingOverview as a } from "./context.js";
|
|
4
4
|
import { Flex as c } from "../../Common/Flex/Flex.js";
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "../../../shared/constants.js";
|
|
7
5
|
import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
6
|
import { RequirementsList as d } from "../../Common/RequirementsList/RequirementsList.js";
|
|
9
7
|
import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
-
const
|
|
11
|
-
const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } =
|
|
8
|
+
const S = () => {
|
|
9
|
+
const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = p("Company.OnboardingOverview");
|
|
12
10
|
if (s)
|
|
13
11
|
return null;
|
|
14
12
|
const o = !n?.some((i) => i.required && i.completed);
|
|
15
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ l(c, { flexDirection: "column", alignItems: "flex-start", gap: 8, children: [
|
|
16
14
|
/* @__PURE__ */ t(r.Heading, { as: "h2", children: e(o ? "initialSetupTitle" : "missingRequirementsTitle") }),
|
|
17
15
|
/* @__PURE__ */ t("p", { children: e(o ? "initialSetupDescription" : "missingRequirementsDescription") }),
|
|
18
16
|
n && /* @__PURE__ */ t(
|
|
@@ -29,6 +27,6 @@ const D = () => {
|
|
|
29
27
|
] });
|
|
30
28
|
};
|
|
31
29
|
export {
|
|
32
|
-
|
|
30
|
+
S as MissingRequirements
|
|
33
31
|
};
|
|
34
32
|
//# sourceMappingURL=MissingRequirements.js.map
|