@graphcommerce/magento-cart-shipping-address 3.4.4 → 3.4.7

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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`104103bc2`](https://github.com/graphcommerce-org/graphcommerce/commit/104103bc2a0fbaa510af2e26b6b00ddc63e8495b)]:
8
+ - @graphcommerce/next-ui@4.24.0
9
+ - @graphcommerce/ecommerce-ui@1.3.2
10
+ - @graphcommerce/magento-cart@4.8.1
11
+ - @graphcommerce/magento-customer@4.11.1
12
+ - @graphcommerce/magento-store@4.2.33
13
+
14
+ ## 3.4.6
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`c1b8b0352`](https://github.com/graphcommerce-org/graphcommerce/commit/c1b8b03520532223f7b572ff23f1d368a4dfe306), [`8d5207288`](https://github.com/graphcommerce-org/graphcommerce/commit/8d52072887f124831ed85d28ec79998f0ce55f1c)]:
19
+ - @graphcommerce/magento-customer@4.11.0
20
+ - @graphcommerce/magento-cart@4.8.0
21
+ - @graphcommerce/ecommerce-ui@1.3.1
22
+
23
+ ## 3.4.5
24
+
25
+ ### Patch Changes
26
+
27
+ - [#1579](https://github.com/graphcommerce-org/graphcommerce/pull/1579) [`e8639ec5f`](https://github.com/graphcommerce-org/graphcommerce/commit/e8639ec5f6759504211d70a966f5c348c6b3a7f6) Thanks [@paales](https://github.com/paales)! - New FormComponents added which combines react-hook-form and mui's form components for easier form handling
28
+
29
+ - Updated dependencies [[`e8639ec5f`](https://github.com/graphcommerce-org/graphcommerce/commit/e8639ec5f6759504211d70a966f5c348c6b3a7f6)]:
30
+ - @graphcommerce/ecommerce-ui@1.3.0
31
+ - @graphcommerce/magento-customer@4.10.5
32
+ - @graphcommerce/magento-cart@4.7.5
33
+
3
34
  ## 3.4.4
4
35
 
5
36
  ### Patch Changes
@@ -1,3 +1,11 @@
1
+ import {
2
+ phonePattern,
3
+ useFormAutoSubmit,
4
+ useFormCompose,
5
+ UseFormComposeOptions,
6
+ useFormPersist,
7
+ TextFieldElement,
8
+ } from '@graphcommerce/ecommerce-ui'
1
9
  import { useQuery } from '@graphcommerce/graphql'
2
10
  import {
3
11
  ApolloCartErrorAlert,
@@ -5,19 +13,17 @@ import {
5
13
  useFormGqlMutationCart,
6
14
  } from '@graphcommerce/magento-cart'
7
15
  import { CartAddressFragment } from '@graphcommerce/magento-cart/components/CartAddress/CartAddress.gql'
8
- import { AddressFields, CustomerDocument, NameFields } from '@graphcommerce/magento-customer'
16
+ import {
17
+ AddressFields,
18
+ CustomerDocument,
19
+ NameFields,
20
+ useCustomerQuery,
21
+ } from '@graphcommerce/magento-customer'
9
22
  import { CountryRegionsDocument, StoreConfigDocument } from '@graphcommerce/magento-store'
10
23
  import { Form, FormRow, InputCheckmark } from '@graphcommerce/next-ui'
11
- import {
12
- phonePattern,
13
- useFormAutoSubmit,
14
- useFormCompose,
15
- UseFormComposeOptions,
16
- useFormPersist,
17
- } from '@graphcommerce/react-hook-form'
18
24
  import { i18n } from '@lingui/core'
19
25
  import { Trans } from '@lingui/react'
20
- import { SxProps, TextField, Theme } from '@mui/material'
26
+ import { SxProps, Theme } from '@mui/material'
21
27
  import React from 'react'
22
28
  import { isSameAddress } from '../../utils/isSameAddress'
23
29
  import { GetAddressesDocument } from './GetAddresses.gql'
@@ -35,7 +41,7 @@ export const ShippingAddressForm = React.memo<ShippingAddressFormProps>((props)
35
41
  const { data: cartQuery } = useCartQuery(GetAddressesDocument)
36
42
  const { data: config } = useQuery(StoreConfigDocument)
37
43
  const { data: countriesData } = useQuery(CountryRegionsDocument)
38
- const { data: customerQuery } = useQuery(CustomerDocument, { fetchPolicy: 'cache-only' })
44
+ const { data: customerQuery } = useCustomerQuery(CustomerDocument)
39
45
 
40
46
  const shopCountry = config?.storeConfig?.locale?.split('_')?.[1].toUpperCase()
41
47
 
@@ -103,7 +109,7 @@ export const ShippingAddressForm = React.memo<ShippingAddressFormProps>((props)
103
109
  }
104
110
  },
105
111
  })
106
- const { muiRegister, handleSubmit, valid, formState, required, error } = form
112
+ const { handleSubmit, valid, formState, required, error } = form
107
113
  const submit = handleSubmit(() => {})
108
114
 
109
115
  useFormPersist({ form, name: 'ShippingAddressForm' })
@@ -121,17 +127,16 @@ export const ShippingAddressForm = React.memo<ShippingAddressFormProps>((props)
121
127
  <NameFields form={form} key='name' readOnly={readOnly} />
122
128
  <AddressFields form={form} key='addressfields' readOnly={readOnly} />
123
129
  <FormRow key='telephone'>
124
- <TextField
130
+ <TextFieldElement
131
+ control={form.control}
132
+ name='telephone'
125
133
  variant='outlined'
126
134
  type='text'
127
- error={!!formState.errors.telephone}
128
135
  required={required.telephone}
129
- label={<Trans id='Telephone' />}
130
- {...muiRegister('telephone', {
131
- required: required.telephone,
136
+ validation={{
132
137
  pattern: { value: phonePattern, message: i18n._(/* i18n */ 'Invalid phone number') },
133
- })}
134
- helperText={formState.isSubmitted && formState.errors.telephone?.message}
138
+ }}
139
+ label={<Trans id='Telephone' />}
135
140
  InputProps={{
136
141
  readOnly,
137
142
  endAdornment: <InputCheckmark show={valid.telephone} />,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-shipping-address",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.4.4",
5
+ "version": "3.4.7",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,13 +18,13 @@
18
18
  "@playwright/test": "^1.21.1"
19
19
  },
20
20
  "dependencies": {
21
+ "@graphcommerce/ecommerce-ui": "1.3.2",
21
22
  "@graphcommerce/graphql": "3.4.8",
22
23
  "@graphcommerce/image": "3.1.9",
23
- "@graphcommerce/magento-cart": "4.7.4",
24
- "@graphcommerce/magento-customer": "4.10.4",
25
- "@graphcommerce/magento-store": "4.2.32",
26
- "@graphcommerce/next-ui": "4.23.1",
27
- "@graphcommerce/react-hook-form": "3.3.2"
24
+ "@graphcommerce/magento-cart": "4.8.1",
25
+ "@graphcommerce/magento-customer": "4.11.1",
26
+ "@graphcommerce/magento-store": "4.2.33",
27
+ "@graphcommerce/next-ui": "4.24.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@lingui/react": "^3.13.2",