@gusto/embedded-react-sdk 0.8.0 → 0.8.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.
- package/CHANGELOG.md +20 -3
- package/dist/components/Base/Base.d.ts +6 -5
- package/dist/components/Base/Base.js +40 -39
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -0
- package/dist/components/Common/ActionsLayout/index.d.ts +1 -0
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/index.d.ts +1 -0
- package/dist/components/Common/DataView/index.d.ts +1 -0
- package/dist/components/Common/DocumentList/index.d.ts +1 -0
- package/dist/components/Common/DocumentViewer/index.d.ts +1 -0
- package/dist/components/Common/FadeIn/FadeIn.module.scss.js +4 -4
- package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.js +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -0
- package/dist/components/Common/{UI/FieldCaption → FieldCaption}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.js +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -0
- package/dist/components/Common/{UI/FieldDescription → FieldDescription}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.js +1 -1
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -0
- package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.js +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -0
- package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +52 -0
- package/dist/components/Common/{UI/FieldLayout → FieldLayout}/index.d.ts +1 -0
- package/dist/components/Common/Fields/CheckboxField/index.d.ts +1 -0
- package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +1 -0
- package/dist/components/Common/Fields/ComboBoxField/index.d.ts +1 -0
- package/dist/components/Common/Fields/DatePickerField/index.d.ts +1 -0
- package/dist/components/Common/Fields/NumberInputField/index.d.ts +1 -0
- package/dist/components/Common/Fields/RadioGroupField/index.d.ts +1 -0
- package/dist/components/Common/Fields/SelectField/index.d.ts +1 -0
- package/dist/components/Common/Fields/SwitchField/index.d.ts +1 -0
- package/dist/components/Common/Fields/TextInputField/index.d.ts +1 -0
- package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.js +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -0
- package/dist/components/Common/{UI/Fieldset → Fieldset}/index.d.ts +1 -0
- package/dist/components/Common/Flex/index.d.ts +1 -0
- package/dist/components/Common/Form/index.d.ts +1 -0
- package/dist/components/Common/HamburgerMenu/index.d.ts +1 -0
- package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.js +2 -2
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -0
- package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/index.d.ts +1 -0
- package/dist/components/Common/PaginationControl/index.d.ts +1 -0
- package/dist/components/Common/ReorderableList/index.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +12 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/index.d.ts +1 -0
- package/dist/components/Common/TaxInputs/index.d.ts +1 -0
- package/dist/components/Common/UI/Alert/Alert.d.ts +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +13 -12
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +16 -4
- package/dist/components/Common/UI/Alert/index.d.ts +1 -0
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +6 -0
- package/dist/components/Common/UI/Button/Button.js +28 -27
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +29 -4
- package/dist/components/Common/UI/Button/index.d.ts +1 -0
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +24 -0
- package/dist/components/Common/UI/CalendarPreview/index.d.ts +1 -0
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +12 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js +4 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +16 -1
- package/dist/components/Common/UI/Checkbox/index.d.ts +1 -0
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js +4 -4
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/CheckboxGroup/index.d.ts +1 -0
- package/dist/components/Common/UI/ComboBox/ComboBox.js +8 -8
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +31 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +13 -13
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +25 -1
- package/dist/components/Common/UI/DatePicker/index.d.ts +1 -0
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +12 -0
- package/dist/components/Common/UI/Heading/index.d.ts +1 -0
- package/dist/components/Common/UI/Input/index.d.ts +1 -0
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +53 -1
- package/dist/components/Common/UI/Link/index.d.ts +1 -0
- package/dist/components/Common/UI/List/ListTypes.d.ts +3 -5
- package/dist/components/Common/UI/List/index.d.ts +1 -0
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +30 -0
- package/dist/components/Common/UI/Menu/index.d.ts +1 -0
- package/dist/components/Common/UI/NumberInput/NumberInput.js +4 -4
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +34 -1
- package/dist/components/Common/UI/NumberInput/index.d.ts +1 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +12 -0
- package/dist/components/Common/UI/ProgressBar/index.d.ts +1 -0
- package/dist/components/Common/UI/Radio/Radio.js +1 -1
- package/dist/components/Common/UI/Radio/Radio.js.map +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +16 -1
- package/dist/components/Common/UI/Radio/index.d.ts +1 -0
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js +4 -4
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/RadioGroup/index.d.ts +1 -0
- package/dist/components/Common/UI/Select/Select.js +8 -8
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +34 -1
- package/dist/components/Common/UI/Select/index.d.ts +1 -0
- package/dist/components/Common/UI/Switch/Switch.js +1 -1
- package/dist/components/Common/UI/Switch/Switch.js.map +1 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +25 -1
- package/dist/components/Common/UI/Switch/index.d.ts +1 -0
- package/dist/components/Common/UI/Table/TableTypes.d.ts +21 -0
- package/dist/components/Common/UI/Table/index.d.ts +1 -0
- package/dist/components/Common/UI/Text/TextTypes.d.ts +18 -0
- package/dist/components/Common/UI/Text/index.d.ts +1 -0
- package/dist/components/Common/UI/TextInput/TextInput.js +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +22 -1
- package/dist/components/Common/UI/TextInput/index.d.ts +1 -0
- package/dist/components/Common/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/Common/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +3 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +26 -25
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +41 -15
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js +17 -20
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +10 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +17 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +42 -45
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +10 -0
- package/dist/components/Company/BankAccount/BankAccount.js +32 -0
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -0
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +10 -10
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +17 -17
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +63 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/index.d.ts +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +12 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +41 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +14 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +72 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/index.d.ts +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -0
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -0
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Company/DocumentSigner/index.d.ts +2 -0
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -4
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +31 -31
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/index.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +18 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -15
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +1 -1
- package/dist/components/Company/Industry/Industry.js +29 -28
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Industry/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +27 -11
- package/dist/components/Company/Locations/LocationForm/Form.js +24 -24
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +24 -24
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +9 -0
- package/dist/components/Company/Locations/Locations.js +27 -0
- package/dist/components/Company/Locations/Locations.js.map +1 -0
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +3 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +27 -32
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +13 -13
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +3 -3
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +15 -15
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +68 -67
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +28 -31
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js +8 -0
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/_parts/index.d.ts +1 -0
- package/dist/components/Company/PaySchedule/index.d.ts +1 -0
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +31 -13
- package/dist/components/Company/PaySchedule/usePaySchedule.js +13 -19
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +9 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js +27 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -0
- package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.js → StateTaxesComponents.js} +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +66 -77
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/index.d.ts +7 -6
- package/dist/components/Company/index.js +18 -18
- package/dist/components/Employee/Compensation/Compensation.d.ts +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +48 -47
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +10 -10
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/useCompensation.d.ts +53 -45
- package/dist/components/Employee/Compensation/useCompensation.js +59 -68
- package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +11 -7
- package/dist/components/Employee/Deductions/Deductions.js +76 -74
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/index.d.ts +1 -0
- package/dist/components/Employee/Deductions/useDeductions.d.ts +34 -14
- package/dist/components/Employee/Deductions/useDeductions.js +10 -29
- package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +11 -0
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +27 -0
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/index.d.ts +2 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +38 -38
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +1 -1
- package/dist/components/Employee/Landing/Landing.js +5 -5
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/Landing/index.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +27 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +29 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +107 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -0
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +30 -30
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/index.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +22 -10
- package/dist/components/Employee/PaymentMethod/BankAccount.js +9 -9
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +74 -74
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +10 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -8
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +92 -37
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +31 -39
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +68 -31
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +33 -46
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +33 -13
- package/dist/components/Employee/Profile/HomeAddress.js +39 -38
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +81 -32
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +60 -74
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.d.ts +1 -1
- package/dist/components/Employee/Profile/Profile.js +69 -72
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +44 -15
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +18 -21
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/index.d.ts +1 -0
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +17 -0
- package/dist/components/{Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js → Employee/SelfOnboardingFlow/SelfOnboardingComponents.js} +7 -7
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +2 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +22 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
- package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.js → Employee/SelfOnboardingFlow/selfOnboardingMachine.js} +4 -4
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
- package/dist/components/Employee/Taxes/FederalForm.d.ts +28 -12
- package/dist/components/Employee/Taxes/FederalForm.js +28 -28
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +9 -5
- package/dist/components/Employee/Taxes/StateForm.js +6 -6
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +78 -77
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/index.d.ts +1 -0
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/index.d.ts +4 -1
- package/dist/components/Employee/index.js +20 -16
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +2 -1
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +34 -0
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -0
- package/dist/contexts/GustoApiProvider/index.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +26 -24
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +2 -1
- package/dist/contexts/LocaleProvider/index.d.ts +1 -0
- package/dist/contexts/ThemeProvider/index.d.ts +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/helpers/validations.d.ts +6 -5
- package/dist/helpers/validations.js +10 -17
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useForkRef/index.d.ts +1 -0
- package/dist/i18n/I18n.d.ts +2 -0
- package/dist/i18n/I18n.js +27 -21
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +7 -13
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +14 -0
- package/dist/types/i18next.d.ts +60 -61
- package/package.json +7 -4
- package/dist/components/Common/UI/FieldCaption/FieldCaption.js.map +0 -1
- package/dist/components/Common/UI/FieldDescription/FieldDescription.js.map +0 -1
- package/dist/components/Common/UI/FieldErrorMessage/FieldErrorMessage.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayout.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayoutTypes.d.ts +0 -19
- package/dist/components/Common/UI/Fieldset/Fieldset.js.map +0 -1
- package/dist/components/Common/UI/HorizontalFieldLayout/HorizontalFieldLayout.js.map +0 -1
- package/dist/components/Company/BankAccount/BankAccountFlow.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountFlow.js +0 -24
- package/dist/components/Company/BankAccount/BankAccountFlow.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.d.ts +0 -13
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js +0 -69
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/Head.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/List.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/ManageSignatories.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/useDocumentList.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.d.ts +0 -6
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js +0 -35
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Form.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Head.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.d.ts +0 -17
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +0 -78
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/assignSignatoryState.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/index.d.ts +0 -1
- package/dist/components/Company/DocumentSignerFlow/stateMachine.js.map +0 -1
- package/dist/components/Company/Locations/LocationsFlow.d.ts +0 -5
- package/dist/components/Company/Locations/LocationsFlow.js +0 -21
- package/dist/components/Company/Locations/LocationsFlow.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesFlow.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesFlow.js +0 -21
- package/dist/components/Company/StateTaxes/StateTaxesFlow.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesFlowComponents.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js +0 -21
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js.map +0 -1
- package/dist/components/Flow/EmployeeOnboardingFlow.d.ts +0 -27
- package/dist/components/Flow/EmployeeOnboardingFlow.js +0 -29
- package/dist/components/Flow/EmployeeOnboardingFlow.js.map +0 -1
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.d.ts +0 -5
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js.map +0 -1
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.d.ts +0 -13
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js +0 -26
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js.map +0 -1
- package/dist/components/Flow/StateMachines/employeeOnboarding.js +0 -136
- package/dist/components/Flow/StateMachines/employeeOnboarding.js.map +0 -1
- package/dist/components/Flow/StateMachines/employeeSelfOnboarding.js.map +0 -1
- package/dist/components/Flow/StateMachines/index.d.ts +0 -2
- package/dist/components/Flow/index.d.ts +0 -2
- package/dist/components/Flow/index.js +0 -7
- package/dist/components/Flow/index.js.map +0 -1
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.d.ts +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayoutTypes.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js.map +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow/useDocumentSignerFlow.d.ts → DocumentSigner/useDocumentSigner.d.ts} +0 -0
- /package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.d.ts → StateTaxesComponents.d.ts} +0 -0
- /package/dist/components/{Flow/StateMachines/employeeOnboarding.d.ts → Employee/OnboardingFlow/onboardingStateMachine.d.ts} +0 -0
- /package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.d.ts → Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport {\n useIndustrySelectionGetSuspense,\n invalidateAllIndustrySelectionGet,\n} from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport { useQueryClient } from '@
|
|
1
|
+
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport {\n useIndustrySelectionGetSuspense,\n invalidateAllIndustrySelectionGet,\n} from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { Actions } from './Actions'\nimport { Head } from './Head'\nimport type { IndustryFormFields } from './Edit'\nimport { Edit } from './Edit'\nimport { IndustryApiStateProvider } from './Context'\nimport { IndustrySelect } from './IndustrySelect'\nimport { componentEvents } from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\nexport type IndustryProps<T> = Pick<\n BaseComponentInterface<'Company.Industry'>,\n 'onEvent' | 'dictionary'\n> &\n Partial<Pick<HTMLAttributes<T>, 'children' | 'className'>> & {\n companyId: string\n }\n\nfunction Root<T>({ children, className, companyId, dictionary }: IndustryProps<T>) {\n useComponentDictionary('Company.Industry', dictionary)\n const { baseSubmitHandler, onEvent } = useBase()\n const queryClient = useQueryClient()\n\n const {\n data: { industry },\n } = useIndustrySelectionGetSuspense({ companyId })\n\n const { isPending, mutateAsync: mutateIndustry } = useIndustrySelectionUpdateMutation()\n\n const onValid = useCallback(\n async (data: IndustryFormFields) => {\n await baseSubmitHandler(data, async ({ naics_code }) => {\n const response = await mutateIndustry({\n request: { companyId, requestBody: { naicsCode: naics_code } },\n })\n await invalidateAllIndustrySelectionGet(queryClient)\n onEvent(componentEvents.COMPANY_INDUSTRY_SELECTED, response.industry)\n })\n },\n [baseSubmitHandler, companyId, mutateIndustry, onEvent, queryClient],\n )\n\n return (\n <section className={className}>\n <IndustryApiStateProvider value={{ isPending }}>\n <IndustrySelect naics_code={industry?.naicsCode} onValid={onValid}>\n {children}\n </IndustrySelect>\n </IndustryApiStateProvider>\n </section>\n )\n}\n\nexport function Industry<T>(props: IndustryProps<T>) {\n useI18n('Company.Industry')\n\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nIndustry.Actions = Actions\nIndustry.Edit = Edit\nIndustry.Head = Head\n"],"names":["Root","children","className","companyId","dictionary","useComponentDictionary","baseSubmitHandler","onEvent","useBase","queryClient","useQueryClient","industry","useIndustrySelectionGetSuspense","isPending","mutateIndustry","useIndustrySelectionUpdateMutation","onValid","useCallback","data","naics_code","response","invalidateAllIndustrySelectionGet","componentEvents","jsx","IndustryApiStateProvider","IndustrySelect","Industry","props","useI18n","BaseComponent","Actions","Edit","Head"],"mappings":";;;;;;;;;;;;;;AAyBA,SAASA,EAAQ,EAAE,UAAAC,GAAU,WAAAC,GAAW,WAAAC,GAAW,YAAAC,KAAgC;AACjF,EAAAC,EAAuB,oBAAoBD,CAAU;AACrD,QAAM,EAAE,mBAAAE,GAAmB,SAAAC,EAAQ,IAAIC,EAAQ,GACzCC,IAAcC,EAAe,GAE7B;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,EAAA,IACfC,EAAgC,EAAE,WAAAT,GAAW,GAE3C,EAAE,WAAAU,GAAW,aAAaC,EAAA,IAAmBC,EAAmC,GAEhFC,IAAUC;AAAA,IACd,OAAOC,MAA6B;AAClC,YAAMZ,EAAkBY,GAAM,OAAO,EAAE,YAAAC,QAAiB;AAChD,cAAAC,IAAW,MAAMN,EAAe;AAAA,UACpC,SAAS,EAAE,WAAAX,GAAW,aAAa,EAAE,WAAWgB,EAAa,EAAA;AAAA,QAAA,CAC9D;AACD,cAAME,EAAkCZ,CAAW,GAC3CF,EAAAe,EAAgB,2BAA2BF,EAAS,QAAQ;AAAA,MAAA,CACrE;AAAA,IACH;AAAA,IACA,CAACd,GAAmBH,GAAWW,GAAgBP,GAASE,CAAW;AAAA,EACrE;AAEA,2BACG,WAAQ,EAAA,WAAAP,GACP,UAAC,gBAAAqB,EAAAC,GAAA,EAAyB,OAAO,EAAE,WAAAX,EACjC,GAAA,UAAA,gBAAAU,EAACE,KAAe,YAAYd,GAAU,WAAW,SAAAK,GAC9C,UAAAf,EAAA,CACH,EACF,CAAA,GACF;AAEJ;AAEO,SAASyB,EAAYC,GAAyB;AACnD,SAAAC,EAAQ,kBAAkB,GAGxB,gBAAAL,EAACM,KAAe,GAAGF,GACjB,4BAAC3B,GAAM,EAAA,GAAG2B,GAAO,EACnB,CAAA;AAEJ;AAEAD,EAAS,UAAUI;AACnBJ,EAAS,OAAOK;AAChBL,EAAS,OAAOM;"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const LocationFormSchema:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocationFormSchema: z.ZodObject<{
|
|
3
|
+
phoneNumber: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
4
|
+
street1: z.ZodString;
|
|
5
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
6
|
+
city: z.ZodString;
|
|
7
|
+
state: z.ZodString;
|
|
8
|
+
zip: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
addressType: z.ZodOptional<z.ZodArray<z.ZodEnum<["mailingAddress", "filingAddress"]>, "many">>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
street1: string;
|
|
12
|
+
city: string;
|
|
13
|
+
state: string;
|
|
14
|
+
zip: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
street2?: string | undefined;
|
|
17
|
+
addressType?: ("filingAddress" | "mailingAddress")[] | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
street1: string;
|
|
20
|
+
city: string;
|
|
21
|
+
state: string;
|
|
22
|
+
zip: string;
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
street2?: string | undefined;
|
|
25
|
+
addressType?: ("filingAddress" | "mailingAddress")[] | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type LocationFormInputs = z.infer<typeof LocationFormSchema>;
|
|
12
28
|
export declare function Form(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { z as i } from "zod";
|
|
3
3
|
import { useTranslation as l } from "react-i18next";
|
|
4
4
|
import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { Grid as
|
|
5
|
+
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import { Grid as p } from "../../../Common/Grid/Grid.js";
|
|
7
7
|
import { STATES_ABBR as c } from "../../../../shared/constants.js";
|
|
8
|
-
import { useMaskedTransform as
|
|
8
|
+
import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
|
|
9
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
|
-
const
|
|
12
|
+
const q = i.object({
|
|
13
13
|
phoneNumber: m,
|
|
14
|
-
street1:
|
|
15
|
-
street2:
|
|
16
|
-
city:
|
|
17
|
-
state:
|
|
14
|
+
street1: i.string().min(1),
|
|
15
|
+
street2: i.string().optional(),
|
|
16
|
+
city: i.string().min(1),
|
|
17
|
+
state: i.string().min(1),
|
|
18
18
|
zip: n,
|
|
19
|
-
addressType:
|
|
19
|
+
addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
|
|
20
20
|
});
|
|
21
|
-
function
|
|
22
|
-
const { t: e } = l("Company.Locations"), o = b
|
|
23
|
-
return /* @__PURE__ */ t(
|
|
21
|
+
function k() {
|
|
22
|
+
const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
|
|
23
|
+
return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
|
|
24
24
|
/* @__PURE__ */ t(
|
|
25
|
-
|
|
25
|
+
p,
|
|
26
26
|
{
|
|
27
27
|
gap: { base: 20, small: 8 },
|
|
28
28
|
gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] },
|
|
29
29
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ r(
|
|
31
31
|
s,
|
|
32
32
|
{
|
|
33
33
|
name: "street1",
|
|
@@ -36,8 +36,8 @@ function q() {
|
|
|
36
36
|
errorMessage: e("validations.street1")
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ r(s, { name: "street2", label: e("street2Label") }),
|
|
40
|
+
/* @__PURE__ */ r(
|
|
41
41
|
s,
|
|
42
42
|
{
|
|
43
43
|
name: "city",
|
|
@@ -46,7 +46,7 @@ function q() {
|
|
|
46
46
|
errorMessage: e("validations.city")
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
50
|
f,
|
|
51
51
|
{
|
|
52
52
|
name: "state",
|
|
@@ -60,7 +60,7 @@ function q() {
|
|
|
60
60
|
isRequired: !0
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ r(
|
|
64
64
|
s,
|
|
65
65
|
{
|
|
66
66
|
name: "zip",
|
|
@@ -69,7 +69,7 @@ function q() {
|
|
|
69
69
|
errorMessage: e("validations.zip")
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ r(
|
|
73
73
|
s,
|
|
74
74
|
{
|
|
75
75
|
name: "phoneNumber",
|
|
@@ -82,7 +82,7 @@ function q() {
|
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ r(
|
|
86
86
|
g,
|
|
87
87
|
{
|
|
88
88
|
name: "addressType",
|
|
@@ -104,7 +104,7 @@ function q() {
|
|
|
104
104
|
] });
|
|
105
105
|
}
|
|
106
106
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
k as Form,
|
|
108
|
+
q as LocationFormSchema
|
|
109
109
|
};
|
|
110
110
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\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('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UACvC;AAAA,4BACCS,GAAe,EAAA,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOT,EAAE,WAAW;AAAA,cACpB,YAAU;AAAA,cACV,cAAcA,EAAE,kBAAkB;AAAA,YAAA;AAAA,UACpC;AAAA,UACA,gBAAAQ;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASC,EAAY,IAAI,CAACC,OAA6C;AAAA,gBACrE,OAAOZ,EAAE,cAAcY,CAAS,IAAI,EAAE,IAAI,UAAU;AAAA,gBACpD,OAAOA;AAAA,cAAA,EACP;AAAA,cACF,OAAOZ,EAAE,YAAY;AAAA,cACrB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UACZ;AAAA,UACA,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UACnC;AAAA,UACA,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,kBAAkB;AAAA,cAC3B,cAAcA,EAAE,mBAAmB;AAAA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAC5C;AAAA,UACA;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as o, jsxs as O, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useForm as q, FormProvider as x } from "react-hook-form";
|
|
3
|
-
import {
|
|
3
|
+
import { zodResolver as R } from "@hookform/resolvers/zod";
|
|
4
4
|
import { useLocationsUpdateMutation as w } from "@gusto/embedded-api/react-query/locationsUpdate";
|
|
5
5
|
import { useLocationsRetrieveSuspense as B } from "@gusto/embedded-api/react-query/locationsRetrieve";
|
|
6
6
|
import { invalidateAllLocationsGet as I } from "@gusto/embedded-api/react-query/locationsGet";
|
|
7
7
|
import { useLocationsCreateMutation as M } from "@gusto/embedded-api/react-query/locationsCreate";
|
|
8
|
-
import { useQueryClient as _ } from "@
|
|
9
|
-
import { Head as
|
|
10
|
-
import { LocationFormSchema as
|
|
8
|
+
import { useQueryClient as _ } from "@tanstack/react-query";
|
|
9
|
+
import { Head as f } from "./Head.js";
|
|
10
|
+
import { LocationFormSchema as z, Form as l } from "./Form.js";
|
|
11
11
|
import { Actions as A } from "./Actions.js";
|
|
12
|
-
import { LocationsFormProvider as
|
|
13
|
-
import { Form as
|
|
14
|
-
import { Flex as
|
|
12
|
+
import { LocationsFormProvider as H } from "./useLocationForm.js";
|
|
13
|
+
import { Form as U } from "../../../Common/Form/Form.js";
|
|
14
|
+
import { Flex as j } from "../../../Common/Flex/Flex.js";
|
|
15
15
|
import { BaseComponent as Y } from "../../../Base/Base.js";
|
|
16
16
|
import { useBase as G } from "../../../Base/useBase.js";
|
|
17
17
|
import { useI18n as Q } from "../../../../i18n/I18n.js";
|
|
18
|
-
import { componentEvents as
|
|
18
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
19
19
|
function V(t) {
|
|
20
20
|
const {
|
|
21
21
|
data: { location: e }
|
|
@@ -29,8 +29,8 @@ function y({
|
|
|
29
29
|
children: r
|
|
30
30
|
}) {
|
|
31
31
|
Q("Company.Locations");
|
|
32
|
-
const { onEvent: i, baseSubmitHandler:
|
|
33
|
-
resolver: R(
|
|
32
|
+
const { onEvent: i, baseSubmitHandler: C } = G(), { mutateAsync: L, isPending: g } = M(), { mutateAsync: v, isPending: h } = w(), F = _(), P = ["mailingAddress", "filingAddress"], { control: T, ...c } = q({
|
|
33
|
+
resolver: R(z),
|
|
34
34
|
defaultValues: {
|
|
35
35
|
city: e?.city ?? "",
|
|
36
36
|
phoneNumber: e?.phoneNumber ?? "",
|
|
@@ -40,42 +40,42 @@ function y({
|
|
|
40
40
|
zip: e?.zip ?? "",
|
|
41
41
|
addressType: P.filter((n) => e?.[n] ?? !1)
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
44
|
-
i(
|
|
43
|
+
}), b = () => {
|
|
44
|
+
i(a.CANCEL);
|
|
45
45
|
}, D = async (n) => {
|
|
46
|
-
await
|
|
46
|
+
await C(n, async (E) => {
|
|
47
47
|
const { addressType: u, ...N } = E, p = {
|
|
48
48
|
...N,
|
|
49
49
|
mailingAddress: u?.includes("mailingAddress"),
|
|
50
50
|
filingAddress: u?.includes("filingAddress")
|
|
51
51
|
};
|
|
52
52
|
if (e && e.version !== void 0) {
|
|
53
|
-
const { location:
|
|
53
|
+
const { location: m } = await v({
|
|
54
54
|
request: {
|
|
55
55
|
locationId: e.uuid,
|
|
56
56
|
requestBody: { ...p, version: e.version }
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
i(
|
|
59
|
+
i(a.COMPANY_LOCATION_UPDATED, m);
|
|
60
60
|
} else {
|
|
61
|
-
const { location:
|
|
61
|
+
const { location: m } = await L({
|
|
62
62
|
request: {
|
|
63
63
|
companyId: t,
|
|
64
64
|
requestBody: p
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
i(
|
|
67
|
+
i(a.COMPANY_LOCATION_CREATED, m);
|
|
68
68
|
}
|
|
69
69
|
await I(F);
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(x, { ...c, control:
|
|
73
|
-
|
|
72
|
+
return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(x, { ...c, control: T, children: /* @__PURE__ */ o(U, { onSubmit: c.handleSubmit(D), children: /* @__PURE__ */ o(
|
|
73
|
+
H,
|
|
74
74
|
{
|
|
75
|
-
value: { handleCancel:
|
|
76
|
-
children: /* @__PURE__ */ o(
|
|
77
|
-
/* @__PURE__ */ o(l, {}),
|
|
75
|
+
value: { handleCancel: b, isPending: g || h },
|
|
76
|
+
children: /* @__PURE__ */ o(j, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ O(S, { children: [
|
|
78
77
|
/* @__PURE__ */ o(f, {}),
|
|
78
|
+
/* @__PURE__ */ o(l, {}),
|
|
79
79
|
/* @__PURE__ */ o(A, {})
|
|
80
80
|
] }) })
|
|
81
81
|
}
|
|
@@ -90,8 +90,8 @@ function d({
|
|
|
90
90
|
}) {
|
|
91
91
|
return /* @__PURE__ */ o(Y, { ...i, children: e ? /* @__PURE__ */ o(V, { companyId: t, locationId: e, className: s, children: r }) : /* @__PURE__ */ o(y, { companyId: t, className: s, children: r }) });
|
|
92
92
|
}
|
|
93
|
-
d.Head =
|
|
94
|
-
d.Form =
|
|
93
|
+
d.Head = f;
|
|
94
|
+
d.Form = l;
|
|
95
95
|
d.Actions = A;
|
|
96
96
|
export {
|
|
97
97
|
d as LocationForm
|
|
@@ -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 {
|
|
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 { invalidateAllLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { useQueryClient } from '@tanstack/react-query'\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 queryClient = useQueryClient()\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 // Invalidate cache after mutation\n await invalidateAllLocationsGet(queryClient)\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\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","queryClient","useQueryClient","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","invalidateAllLocationsGet","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,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,IAAcC,EAAe,GAC7BC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMxB,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,aAAamB,EAAY,OAAO,OAAOnB,IAAWyB,CAAG,KAAK,EAAK;AAAA,IAAA;AAAA,EACjE,CACD,GAEKC,IAAe,MAAM;AACzB,IAAAlB,EAAQmB,EAAgB,MAAM;AAAA,EAChC,GACMC,IAAW,OAAOC,MAA6B;AAC7C,UAAApB,EAAkBoB,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,UAAAnB,KAAYA,EAAS,YAAY,QAAW;AAE9C,cAAM,EAAE,UAAUiC,EAAa,IAAI,MAAMnB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,YAAYd,EAAS;AAAA,YACrB,aAAa,EAAE,GAAGgC,GAAa,SAAShC,EAAS,QAAQ;AAAA,UAAA;AAAA,QAC3D,CACD;AACO,QAAAQ,EAAAmB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA,OACzD;AAEL,cAAM,EAAE,UAAUA,EAAa,IAAI,MAAMtB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,WAAAP;AAAA,YACA,aAAA4B;AAAA,UAAA;AAAA,QACF,CACD;AACO,QAAAxB,EAAAmB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA;AAIhE,YAAMC,EAA0BjB,CAAW;AAAA,IAAA,CAC5C;AAAA,EACH;AAEA,SACG,gBAAAf,EAAA,WAAA,EAAQ,WAAAG,GACP,UAAA,gBAAAH,EAACiC,KAAc,GAAGd,GAAS,SAAAD,GACzB,UAAA,gBAAAlB,EAACkC,GAAS,EAAA,UAAUf,EAAQ,aAAaO,CAAQ,GAC/C,UAAA,gBAAA1B;AAAA,IAACmC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,cAAAX,GAAc,WAAWd,KAAmBG,EAAgB;AAAA,MAErE,UAAA,gBAAAb,EAACoC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAhC,KAIG,gBAAAiC,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAtC,EAACuC,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,EAAa;AAAA,EAC3B,WAAAxC;AAAA,EACA,YAAAyC;AAAA,EACA,WAAAxC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG+C,GAAe,EAAA,GAAG/C,GAChB,UAAA8C,sBACE/C,GAAiB,EAAA,WAAAM,GAAsB,YAAAyC,GAAwB,WAAAxC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;AAEAsC,EAAa,OAAOH;AACpBG,EAAa,OAAOF;AACpBE,EAAa,UAAUD;"}
|
|
@@ -7,13 +7,12 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
7
7
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
8
|
import "../../../Base/useBase.js";
|
|
9
9
|
import "dompurify";
|
|
10
|
-
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
11
|
+
const [C, u] = o(
|
|
13
12
|
"CompanyDocumentFormContext"
|
|
14
13
|
);
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
u as LocationsFormProvider,
|
|
16
|
+
C as useLocationsForm
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=useLocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAOM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../Base';
|
|
2
|
+
export interface LocationsProps extends BaseComponentInterface<'Company.Locations'> {
|
|
3
|
+
companyId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function Locations({ companyId, onEvent, dictionary }: LocationsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace Locations {
|
|
7
|
+
var LocationsList: typeof import("./LocationsList").LocationsList;
|
|
8
|
+
var LocationForm: typeof import("./LocationForm/LocationForm").LocationForm;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as c } from "robot3";
|
|
3
|
+
import { locationsStateMachine as e } from "./stateMachine.js";
|
|
4
|
+
import { LocationsListContextual as s } from "./locationsStateMachine.js";
|
|
5
|
+
import { LocationForm as p } from "./LocationForm/LocationForm.js";
|
|
6
|
+
import { Flow as L } from "../../Flow/Flow.js";
|
|
7
|
+
import { useComponentDictionary as f } from "../../../i18n/I18n.js";
|
|
8
|
+
import { LocationsList as u } from "./LocationsList/LocationsList.js";
|
|
9
|
+
function o({ companyId: t, onEvent: i, dictionary: n }) {
|
|
10
|
+
f("Company.Locations", n);
|
|
11
|
+
const m = c(
|
|
12
|
+
"index",
|
|
13
|
+
e,
|
|
14
|
+
(r) => ({
|
|
15
|
+
...r,
|
|
16
|
+
component: s,
|
|
17
|
+
companyId: t
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ a(L, { machine: m, onEvent: i });
|
|
21
|
+
}
|
|
22
|
+
o.LocationsList = u;
|
|
23
|
+
o.LocationForm = p;
|
|
24
|
+
export {
|
|
25
|
+
o as Locations
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Locations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Locations.js","sources":["../../../../src/components/Company/Locations/Locations.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { type LocationsContextInterface } from './locationsStateMachine'\nimport { locationsStateMachine } from './stateMachine'\nimport { LocationsListContextual } from './locationsStateMachine'\nimport { LocationsList } from './LocationsList'\nimport { LocationForm } from './LocationForm/LocationForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface LocationsProps extends BaseComponentInterface<'Company.Locations'> {\n companyId: string\n}\n\nexport function Locations({ companyId, onEvent, dictionary }: LocationsProps) {\n useComponentDictionary('Company.Locations', dictionary)\n\n const manageLocations = createMachine(\n 'index',\n locationsStateMachine,\n (initialContext: LocationsContextInterface) => ({\n ...initialContext,\n component: LocationsListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageLocations} onEvent={onEvent} />\n}\n\nLocations.LocationsList = LocationsList\nLocations.LocationForm = LocationForm\n"],"names":["Locations","companyId","onEvent","dictionary","useComponentDictionary","manageLocations","createMachine","locationsStateMachine","initialContext","LocationsListContextual","jsx","Flow","LocationsList","LocationForm"],"mappings":";;;;;;;;AAcO,SAASA,EAAU,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA8B;AAC5E,EAAAC,EAAuB,qBAAqBD,CAAU;AAEtD,QAAME,IAAkBC;AAAA,IACtB;AAAA,IACAC;AAAA,IACA,CAACC,OAA+C;AAAA,MAC9C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAiB,SAAAH,EAAkB,CAAA;AAC3D;AAEAF,EAAU,gBAAgBY;AAC1BZ,EAAU,eAAea;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface LocationsListProps extends
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base/Base';
|
|
2
|
+
interface LocationsListProps extends BaseComponentInterface {
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function LocationsList(
|
|
5
|
+
export declare function LocationsList(props: LocationsListProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare namespace LocationsList {
|
|
7
7
|
var Head: typeof import("./Head").Head;
|
|
8
8
|
var List: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,72 +1,67 @@
|
|
|
1
1
|
import { jsx as e, jsxs as C, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { useLocationsGetSuspense as N } from "@gusto/embedded-api/react-query/locationsGet";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Head as
|
|
5
|
-
import { List as
|
|
6
|
-
import { Actions as
|
|
3
|
+
import { useState as d } from "react";
|
|
4
|
+
import { Head as l } from "./Head.js";
|
|
5
|
+
import { List as h } from "./List.js";
|
|
6
|
+
import { Actions as P } from "./Actions.js";
|
|
7
7
|
import { LocationsListProvider as O } from "./useLocationsList.js";
|
|
8
8
|
import { useI18n as x } from "../../../../i18n/I18n.js";
|
|
9
9
|
import { BaseComponent as E } from "../../../Base/Base.js";
|
|
10
10
|
import { useBase as I } from "../../../Base/useBase.js";
|
|
11
11
|
import { Flex as v } from "../../../Common/Flex/Flex.js";
|
|
12
|
-
import { companyEvents as
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
className: r,
|
|
16
|
-
children: n,
|
|
17
|
-
...o
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ e(E, { ...o, children: /* @__PURE__ */ e(M, { companyId: s, className: r, children: n }) });
|
|
12
|
+
import { companyEvents as s } from "../../../../shared/constants.js";
|
|
13
|
+
function i(o) {
|
|
14
|
+
return /* @__PURE__ */ e(E, { ...o, children: /* @__PURE__ */ e(M, { ...o, children: o.children }) });
|
|
20
15
|
}
|
|
21
|
-
function M({ companyId:
|
|
16
|
+
function M({ companyId: o, className: g, children: c }) {
|
|
22
17
|
x("Company.Locations");
|
|
23
|
-
const { onEvent:
|
|
18
|
+
const { onEvent: a } = I(), [m, n] = d(1), [p, L] = d(5), {
|
|
24
19
|
data: { locationList: u, httpMeta: f }
|
|
25
|
-
} = N({ companyId:
|
|
26
|
-
return /* @__PURE__ */ e("section", { className:
|
|
20
|
+
} = N({ companyId: o, page: m, per: p }), r = Number(f.response.headers.get("x-total-pages") ?? 1);
|
|
21
|
+
return /* @__PURE__ */ e("section", { className: g, children: /* @__PURE__ */ e(
|
|
27
22
|
O,
|
|
28
23
|
{
|
|
29
24
|
value: {
|
|
30
25
|
locationList: u ?? [],
|
|
31
|
-
currentPage:
|
|
32
|
-
totalPages:
|
|
26
|
+
currentPage: m,
|
|
27
|
+
totalPages: r,
|
|
33
28
|
handleFirstPage: () => {
|
|
34
|
-
|
|
29
|
+
n(1);
|
|
35
30
|
},
|
|
36
31
|
handlePreviousPage: () => {
|
|
37
|
-
|
|
32
|
+
n((t) => Math.max(t - 1, 1));
|
|
38
33
|
},
|
|
39
34
|
handleNextPage: () => {
|
|
40
|
-
|
|
35
|
+
n((t) => Math.min(t + 1, r));
|
|
41
36
|
},
|
|
42
37
|
handleLastPage: () => {
|
|
43
|
-
|
|
38
|
+
n(r);
|
|
44
39
|
},
|
|
45
40
|
handleItemsPerPageChange: (t) => {
|
|
46
41
|
L(t);
|
|
47
42
|
},
|
|
48
43
|
handleAddLocation: () => {
|
|
49
|
-
|
|
44
|
+
a(s.COMPANY_LOCATION_CREATE);
|
|
50
45
|
},
|
|
51
46
|
handleEditLocation: (t) => {
|
|
52
|
-
|
|
47
|
+
a(s.COMPANY_LOCATION_EDIT, { uuid: t });
|
|
53
48
|
},
|
|
54
49
|
handleContinue: () => {
|
|
55
|
-
|
|
50
|
+
a(s.COMPANY_LOCATION_DONE);
|
|
56
51
|
}
|
|
57
52
|
},
|
|
58
|
-
children: /* @__PURE__ */ e(v, { flexDirection: "column", gap: 32, children:
|
|
53
|
+
children: /* @__PURE__ */ e(v, { flexDirection: "column", gap: 32, children: c || /* @__PURE__ */ C(A, { children: [
|
|
54
|
+
/* @__PURE__ */ e(l, {}),
|
|
59
55
|
/* @__PURE__ */ e(h, {}),
|
|
60
|
-
/* @__PURE__ */ e(P, {})
|
|
61
|
-
/* @__PURE__ */ e(p, {})
|
|
56
|
+
/* @__PURE__ */ e(P, {})
|
|
62
57
|
] }) })
|
|
63
58
|
}
|
|
64
59
|
) });
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
i.Head = l;
|
|
62
|
+
i.List = h;
|
|
63
|
+
i.Actions = P;
|
|
69
64
|
export {
|
|
70
|
-
|
|
65
|
+
i as LocationsList
|
|
71
66
|
};
|
|
72
67
|
//# 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
|
|
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\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\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;AAEA9B,EAAc,OAAO4B;AACrB5B,EAAc,OAAO6B;AACrB7B,EAAc,UAAU8B;"}
|
|
@@ -7,13 +7,12 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
7
7
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
8
|
import "../../../Base/useBase.js";
|
|
9
9
|
import "dompurify";
|
|
10
|
-
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
11
|
+
const [a, C] = o(
|
|
13
12
|
"CompanyDocumentListContext"
|
|
14
13
|
);
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
C as LocationsListProvider,
|
|
16
|
+
a as useLocationsList
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAiBM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|