@springmicro/cart 0.7.7 → 0.7.9
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 +2647 -2636
- package/dist/index.umd.cjs +53 -53
- package/package.json +3 -3
- package/src/checkout/ReviewCartAndCalculateTaxes.tsx +11 -1
- package/src/checkout/index.tsx +3 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/cart",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.9",
|
|
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.7.
|
|
27
|
+
"@springmicro/utils": "^0.7.9",
|
|
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": "86e08f964bc21176fdd0c2048f830fb522ce96ff"
|
|
53
53
|
}
|
|
@@ -146,6 +146,7 @@ export default function ReviewAndCalculateTaxes({
|
|
|
146
146
|
defaultValues = {},
|
|
147
147
|
dev,
|
|
148
148
|
hideFields = [],
|
|
149
|
+
disableFields = [],
|
|
149
150
|
}) {
|
|
150
151
|
// dev && console.log({ products, prices });
|
|
151
152
|
const [formDisabled, setFormDisabled] = useState(true);
|
|
@@ -433,6 +434,7 @@ export default function ReviewAndCalculateTaxes({
|
|
|
433
434
|
prices={prices}
|
|
434
435
|
products={products}
|
|
435
436
|
hideFields={hideFields}
|
|
437
|
+
disableFields={disableFields}
|
|
436
438
|
/>
|
|
437
439
|
<AddCard
|
|
438
440
|
cardRequired={cardRequired}
|
|
@@ -446,6 +448,7 @@ export default function ReviewAndCalculateTaxes({
|
|
|
446
448
|
formError,
|
|
447
449
|
}}
|
|
448
450
|
hideFields={hideFields}
|
|
451
|
+
// disableFields={disableFields} TODO
|
|
449
452
|
/>
|
|
450
453
|
</Box>
|
|
451
454
|
)}
|
|
@@ -455,7 +458,13 @@ export default function ReviewAndCalculateTaxes({
|
|
|
455
458
|
);
|
|
456
459
|
}
|
|
457
460
|
|
|
458
|
-
function CheckoutActionFields({
|
|
461
|
+
function CheckoutActionFields({
|
|
462
|
+
formik,
|
|
463
|
+
products,
|
|
464
|
+
prices,
|
|
465
|
+
hideFields = [],
|
|
466
|
+
disableFields = [],
|
|
467
|
+
}) {
|
|
459
468
|
const checkoutFields: Record<string, CheckoutFieldsType> = [
|
|
460
469
|
...Object.keys(products).flatMap((productKey) =>
|
|
461
470
|
(products[productKey].actions ?? []).flatMap(
|
|
@@ -509,6 +518,7 @@ function CheckoutActionFields({ formik, products, prices, hideFields = [] }) {
|
|
|
509
518
|
return (
|
|
510
519
|
<TextField
|
|
511
520
|
fullWidth
|
|
521
|
+
disabled={disableFields.includes(name)}
|
|
512
522
|
name={name}
|
|
513
523
|
label={label}
|
|
514
524
|
required={required === true || required === "true"}
|
package/src/checkout/index.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export default function Checkout({
|
|
|
25
25
|
CollectExtraInfo,
|
|
26
26
|
defaultValues,
|
|
27
27
|
hideFields = [],
|
|
28
|
+
disableFields = [],
|
|
28
29
|
dev,
|
|
29
30
|
}: {
|
|
30
31
|
apiBaseUrl: string;
|
|
@@ -35,6 +36,7 @@ export default function Checkout({
|
|
|
35
36
|
CollectExtraInfo?: React.FC<{ formik: FormikConfig<any> }>;
|
|
36
37
|
defaultValues?: Record<string, any>;
|
|
37
38
|
hideFields?: string[];
|
|
39
|
+
disableFields?: string[];
|
|
38
40
|
dev?: boolean;
|
|
39
41
|
}) {
|
|
40
42
|
const store = useStore(cartStore);
|
|
@@ -230,6 +232,7 @@ export default function Checkout({
|
|
|
230
232
|
defaultValues={defaultValues}
|
|
231
233
|
dev={dev}
|
|
232
234
|
hideFields={hideFields}
|
|
235
|
+
disableFields={disableFields}
|
|
233
236
|
/>
|
|
234
237
|
)}
|
|
235
238
|
{status === 2 && order !== undefined && (
|