@graphcommerce/magento-cart-shipping-method 9.0.4-canary.8 → 9.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -13
- package/components/ShippingMethodForm/ShippingMethodForm.tsx +15 -14
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 9.0.4
|
|
3
|
+
## 9.0.4
|
|
4
4
|
|
|
5
|
-
## 9.0.
|
|
5
|
+
## 9.0.3
|
|
6
6
|
|
|
7
|
-
## 9.0.
|
|
7
|
+
## 9.0.3-canary.0
|
|
8
8
|
|
|
9
|
-
## 9.0.
|
|
10
|
-
|
|
11
|
-
## 9.0.4-canary.4
|
|
12
|
-
|
|
13
|
-
## 9.0.4-canary.3
|
|
14
|
-
|
|
15
|
-
## 9.0.4-canary.2
|
|
9
|
+
## 9.0.2
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
### Patch Changes
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
- [`6b28b60`](https://github.com/graphcommerce-org/graphcommerce/commit/6b28b60db3f4d58b346275dfb8bcbb85744861b9) - Make sure we are correctly selecting the shipping method form when a user selects a previously selected method again. ([@paales](https://github.com/paales))
|
|
20
14
|
|
|
21
|
-
## 9.0.2
|
|
15
|
+
## 9.0.2-canary.0
|
|
22
16
|
|
|
23
17
|
### Patch Changes
|
|
24
18
|
|
|
25
19
|
- [`6b28b60`](https://github.com/graphcommerce-org/graphcommerce/commit/6b28b60db3f4d58b346275dfb8bcbb85744861b9) - Make sure we are correctly selecting the shipping method form when a user selects a previously selected method again. ([@paales](https://github.com/paales))
|
|
26
20
|
|
|
21
|
+
## 9.0.1
|
|
22
|
+
|
|
23
|
+
## 9.0.1-canary.1
|
|
24
|
+
|
|
27
25
|
## 9.0.0
|
|
28
26
|
|
|
29
27
|
### Major Changes
|
|
@@ -25,12 +25,13 @@ import type {
|
|
|
25
25
|
} from './ShippingMethodForm.gql'
|
|
26
26
|
import { ShippingMethodFormDocument } from './ShippingMethodForm.gql'
|
|
27
27
|
|
|
28
|
-
type ShippingMethodFormValues = ShippingMethodFormMutationVariables & { carrierMethod?: string }
|
|
29
|
-
|
|
30
28
|
export type ShippingMethodFormProps = Pick<UseFormComposeOptions, 'step'> & {
|
|
31
29
|
sx?: SxProps<Theme>
|
|
32
30
|
children?: React.ReactNode
|
|
33
|
-
} & UseFormGraphQlOptions<
|
|
31
|
+
} & UseFormGraphQlOptions<
|
|
32
|
+
ShippingMethodFormMutation,
|
|
33
|
+
ShippingMethodFormMutationVariables & { carrierMethod?: string }
|
|
34
|
+
>
|
|
34
35
|
|
|
35
36
|
function notEmpty<TValue>(value: TValue | null | undefined): value is TValue {
|
|
36
37
|
return value !== null && value !== undefined
|
|
@@ -67,17 +68,17 @@ export function ShippingMethodForm(props: ShippingMethodFormProps) {
|
|
|
67
68
|
? `${selectedMethod.carrier_code}-${selectedMethod.method_code}`
|
|
68
69
|
: undefined
|
|
69
70
|
|
|
70
|
-
const form = useFormGqlMutationCart<
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
...options,
|
|
71
|
+
const form = useFormGqlMutationCart<
|
|
72
|
+
ShippingMethodFormMutation,
|
|
73
|
+
ShippingMethodFormMutationVariables & { carrierMethod?: string }
|
|
74
|
+
>(ShippingMethodFormDocument, {
|
|
75
|
+
defaultValues: { carrierMethod },
|
|
76
|
+
onBeforeSubmit: (variables) => {
|
|
77
|
+
const [carrier, method] = (variables.carrierMethod ?? '').split('-')
|
|
78
|
+
return onBeforeSubmit({ ...variables, carrier, method })
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
...options,
|
|
81
|
+
})
|
|
81
82
|
|
|
82
83
|
const { handleSubmit, control, error, setValue } = form
|
|
83
84
|
const submit = handleSubmit(() => {})
|
|
@@ -113,7 +114,7 @@ export function ShippingMethodForm(props: ShippingMethodFormProps) {
|
|
|
113
114
|
}, [shippingAddress, firstCarrierMethod, carrierMethod, setValue])
|
|
114
115
|
|
|
115
116
|
return (
|
|
116
|
-
<FormProvider
|
|
117
|
+
<FormProvider {...form}>
|
|
117
118
|
<FormAutoSubmit
|
|
118
119
|
control={control}
|
|
119
120
|
submit={submit}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart-shipping-method",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.4
|
|
5
|
+
"version": "9.0.4",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^9.0.4
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.4
|
|
17
|
-
"@graphcommerce/framer-scroller": "^9.0.4
|
|
18
|
-
"@graphcommerce/graphql": "^9.0.4
|
|
19
|
-
"@graphcommerce/image": "^9.0.4
|
|
20
|
-
"@graphcommerce/magento-cart": "^9.0.4
|
|
21
|
-
"@graphcommerce/magento-cart-shipping-address": "^9.0.4
|
|
22
|
-
"@graphcommerce/magento-store": "^9.0.4
|
|
23
|
-
"@graphcommerce/next-ui": "^9.0.4
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.4
|
|
25
|
-
"@graphcommerce/react-hook-form": "^9.0.4
|
|
26
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.4
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^9.0.4",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.4",
|
|
17
|
+
"@graphcommerce/framer-scroller": "^9.0.4",
|
|
18
|
+
"@graphcommerce/graphql": "^9.0.4",
|
|
19
|
+
"@graphcommerce/image": "^9.0.4",
|
|
20
|
+
"@graphcommerce/magento-cart": "^9.0.4",
|
|
21
|
+
"@graphcommerce/magento-cart-shipping-address": "^9.0.4",
|
|
22
|
+
"@graphcommerce/magento-store": "^9.0.4",
|
|
23
|
+
"@graphcommerce/next-ui": "^9.0.4",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.4",
|
|
25
|
+
"@graphcommerce/react-hook-form": "^9.0.4",
|
|
26
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.4",
|
|
27
27
|
"@lingui/core": "^4.2.1",
|
|
28
28
|
"@lingui/macro": "^4.2.1",
|
|
29
29
|
"@lingui/react": "^4.2.1",
|