@springmicro/cart 0.3.5 → 0.4.0
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/dist/index.js +4730 -4721
- package/dist/index.umd.cjs +62 -62
- package/package.json +3 -3
- package/src/checkout/ReviewCartAndCalculateTaxes.tsx +5 -1
- package/src/checkout/index.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/cart",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@nanostores/persistent": "^0.10.1",
|
|
25
25
|
"@nanostores/query": "^0.3.3",
|
|
26
26
|
"@nanostores/react": "^0.7.2",
|
|
27
|
-
"@springmicro/utils": "0.
|
|
27
|
+
"@springmicro/utils": "0.4.0",
|
|
28
28
|
"dotenv": "^16.4.5",
|
|
29
29
|
"nanostores": "^0.10.3",
|
|
30
30
|
"react": "^18.2.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
50
50
|
"yup": "^1.4.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "33c290158c06114e6fd61ddb79f9e65a82128471"
|
|
53
53
|
}
|
|
@@ -110,6 +110,7 @@ export default function ReviewAndCalculateTaxes({
|
|
|
110
110
|
setSuccessData,
|
|
111
111
|
invoiceId = undefined,
|
|
112
112
|
onPlacement = undefined,
|
|
113
|
+
CollectExtraInfo = undefined,
|
|
113
114
|
}) {
|
|
114
115
|
const [formDisabled, setFormDisabled] = useState(true);
|
|
115
116
|
const [formError, setFormError] = useState(undefined);
|
|
@@ -347,7 +348,10 @@ export default function ReviewAndCalculateTaxes({
|
|
|
347
348
|
}}
|
|
348
349
|
/>
|
|
349
350
|
{status === 0 && (
|
|
350
|
-
<Box
|
|
351
|
+
<Box
|
|
352
|
+
sx={{ flexGrow: 1, display: "flex", flexDirection: "column", gap: 2 }}
|
|
353
|
+
>
|
|
354
|
+
{CollectExtraInfo && <CollectExtraInfo formik={formik} />}
|
|
351
355
|
<AddCard
|
|
352
356
|
onSubmit={createOrderAndGetTaxes}
|
|
353
357
|
stacked={stacked}
|
package/src/checkout/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { cartStore, clearCart } from "../utils/storage";
|
|
|
6
6
|
import { StatusBar } from "./components/StatusBar";
|
|
7
7
|
import ReviewAndCalculateTaxes from "./ReviewCartAndCalculateTaxes";
|
|
8
8
|
import Invoice from "./components/Invoice";
|
|
9
|
+
import { FormikConfig } from "formik";
|
|
9
10
|
|
|
10
11
|
export default function Checkout({
|
|
11
12
|
apiBaseUrl,
|
|
@@ -13,12 +14,14 @@ export default function Checkout({
|
|
|
13
14
|
emptyCartLink = "",
|
|
14
15
|
disableProductLink = false,
|
|
15
16
|
disableMissingImage = false,
|
|
17
|
+
CollectExtraInfo,
|
|
16
18
|
}: {
|
|
17
19
|
apiBaseUrl: string;
|
|
18
20
|
taxProvider: string;
|
|
19
21
|
emptyCartLink?: string;
|
|
20
22
|
disableProductLink?: boolean;
|
|
21
23
|
disableMissingImage?: boolean;
|
|
24
|
+
CollectExtraInfo?: React.FC<{ formik: FormikConfig<any> }>;
|
|
22
25
|
}) {
|
|
23
26
|
const cart = JSON.parse(useStore(cartStore));
|
|
24
27
|
|
|
@@ -150,6 +153,7 @@ export default function Checkout({
|
|
|
150
153
|
clearCart();
|
|
151
154
|
setStatus(2);
|
|
152
155
|
}}
|
|
156
|
+
CollectExtraInfo={CollectExtraInfo}
|
|
153
157
|
/>
|
|
154
158
|
)}
|
|
155
159
|
{status === 2 && order !== undefined && (
|