@licklist/design 0.71.18-dev.11 → 0.71.18-dev.13
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/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +5 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +4 -6
- package/package.json +1 -1
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +11 -9
- package/yarn.lock +9 -9
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems';
|
|
2
|
+
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct';
|
|
3
|
+
interface IOrderProduct extends OrderItem {
|
|
4
|
+
orderProductModifiers?: OrderModifierByProduct[] | null;
|
|
5
|
+
}
|
|
2
6
|
type ProductSummaryProps = {
|
|
3
7
|
name?: string;
|
|
4
8
|
productQuantityError?: string;
|
|
5
|
-
orderProduct:
|
|
9
|
+
orderProduct: IOrderProduct;
|
|
6
10
|
};
|
|
7
11
|
export declare const ProductSummary: ({ name, productQuantityError, orderProduct, }: ProductSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;
|
|
1
|
+
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAKrG,UAAU,aAAc,SAAQ,SAAS;IACvC,qBAAqB,CAAC,EAAG,sBAAsB,EAAE,GAAG,IAAI,CAAC;CAC1D;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,4CAyCrB,CAAA"}
|
|
@@ -2,16 +2,14 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import * as Config from '@licklist/core/dist/Config';
|
|
5
|
-
import { calculateTotalModifiersPrice } from '../../utils/index.js';
|
|
6
5
|
import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier.js';
|
|
7
6
|
|
|
8
7
|
var ProductSummary = function(param) {
|
|
9
8
|
var name = param.name, productQuantityError = param.productQuantityError, orderProduct = param.orderProduct;
|
|
10
|
-
var _orderProduct_orderModifiersSets;
|
|
11
9
|
var t = useTranslation('Design').t;
|
|
12
10
|
var formatNumber = useIntl().formatNumber;
|
|
13
11
|
var priceForOneProduct = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.price;
|
|
14
|
-
var
|
|
12
|
+
var modifiersSets = (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderModifiersSets) || (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderProductModifiers);
|
|
15
13
|
var fullPrice = formatNumber(priceForOneProduct * (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.quantity), {
|
|
16
14
|
style: 'currency',
|
|
17
15
|
currency: Config.Currency.GBP
|
|
@@ -34,14 +32,14 @@ var ProductSummary = function(param) {
|
|
|
34
32
|
orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.quantity
|
|
35
33
|
]
|
|
36
34
|
}),
|
|
37
|
-
|
|
35
|
+
/*#__PURE__*/ jsx("p", {
|
|
38
36
|
className: "price",
|
|
39
37
|
children: fullPrice
|
|
40
38
|
})
|
|
41
39
|
]
|
|
42
40
|
}),
|
|
43
|
-
!!
|
|
44
|
-
children:
|
|
41
|
+
!!modifiersSets.length && /*#__PURE__*/ jsx(Fragment, {
|
|
42
|
+
children: modifiersSets.map(function(modifier, index) {
|
|
45
43
|
return /*#__PURE__*/ jsx(ProductWithModifier, {
|
|
46
44
|
modifier: modifier,
|
|
47
45
|
modifierKey: index,
|
package/package.json
CHANGED
|
@@ -2,13 +2,19 @@ import { useTranslation } from 'react-i18next'
|
|
|
2
2
|
import { useIntl } from 'react-intl'
|
|
3
3
|
import * as Config from '@licklist/core/dist/Config'
|
|
4
4
|
import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
|
|
5
|
+
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
5
6
|
import { calculateTotalModifiersPrice } from '../../utils'
|
|
6
7
|
import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier'
|
|
7
8
|
|
|
9
|
+
|
|
10
|
+
interface IOrderProduct extends OrderItem {
|
|
11
|
+
orderProductModifiers?: OrderModifierByProduct[] | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
type ProductSummaryProps = {
|
|
9
15
|
name?: string
|
|
10
16
|
productQuantityError?: string
|
|
11
|
-
orderProduct:
|
|
17
|
+
orderProduct: IOrderProduct
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
export const ProductSummary = ({
|
|
@@ -18,19 +24,15 @@ export const ProductSummary = ({
|
|
|
18
24
|
}: ProductSummaryProps) => {
|
|
19
25
|
const { t } = useTranslation('Design')
|
|
20
26
|
const { formatNumber } = useIntl()
|
|
21
|
-
|
|
22
27
|
const priceForOneProduct = orderProduct?.price
|
|
23
28
|
|
|
24
|
-
const
|
|
25
|
-
orderProduct?.orderModifiersSets,
|
|
26
|
-
)
|
|
29
|
+
const modifiersSets = orderProduct?.orderModifiersSets || orderProduct?.orderProductModifiers
|
|
27
30
|
|
|
28
31
|
const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
|
|
29
32
|
style: 'currency',
|
|
30
33
|
currency: Config.Currency.GBP,
|
|
31
34
|
})
|
|
32
35
|
|
|
33
|
-
|
|
34
36
|
return (
|
|
35
37
|
<div className='product'>
|
|
36
38
|
<p className='m-0 name'>{name ?? orderProduct?.name}</p>
|
|
@@ -39,12 +41,12 @@ export const ProductSummary = ({
|
|
|
39
41
|
{t('shortQuantity')}: {orderProduct?.quantity}
|
|
40
42
|
</p>
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
<p className='price'>{fullPrice}</p>
|
|
43
45
|
</div>
|
|
44
46
|
|
|
45
|
-
{!!
|
|
47
|
+
{!!modifiersSets.length && (
|
|
46
48
|
<>
|
|
47
|
-
{
|
|
49
|
+
{modifiersSets.map((modifier, index) => (
|
|
48
50
|
<ProductWithModifier
|
|
49
51
|
key={modifier.productQuantity.toString()}
|
|
50
52
|
modifier={modifier}
|
package/yarn.lock
CHANGED
|
@@ -9889,9 +9889,9 @@ __metadata:
|
|
|
9889
9889
|
linkType: hard
|
|
9890
9890
|
|
|
9891
9891
|
"electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.5.73":
|
|
9892
|
-
version: 1.5.
|
|
9893
|
-
resolution: "electron-to-chromium@npm:1.5.
|
|
9894
|
-
checksum: 10c0/
|
|
9892
|
+
version: 1.5.102
|
|
9893
|
+
resolution: "electron-to-chromium@npm:1.5.102"
|
|
9894
|
+
checksum: 10c0/db07dab3ee3b7fbc39ad26203925669ade86b12a62d09fa14ae48a354a0f34d162ac9a2ca9d6f70ceb1b16821b01b155e56467702bcc915da1e1dd147dd034b4
|
|
9895
9895
|
languageName: node
|
|
9896
9896
|
linkType: hard
|
|
9897
9897
|
|
|
@@ -11203,9 +11203,9 @@ __metadata:
|
|
|
11203
11203
|
linkType: hard
|
|
11204
11204
|
|
|
11205
11205
|
"flatted@npm:^3.2.9":
|
|
11206
|
-
version: 3.3.
|
|
11207
|
-
resolution: "flatted@npm:3.3.
|
|
11208
|
-
checksum: 10c0/
|
|
11206
|
+
version: 3.3.3
|
|
11207
|
+
resolution: "flatted@npm:3.3.3"
|
|
11208
|
+
checksum: 10c0/e957a1c6b0254aa15b8cce8533e24165abd98fadc98575db082b786b5da1b7d72062b81bfdcd1da2f4d46b6ed93bec2434e62333e9b4261d79ef2e75a10dd538
|
|
11209
11209
|
languageName: node
|
|
11210
11210
|
linkType: hard
|
|
11211
11211
|
|
|
@@ -14273,11 +14273,11 @@ __metadata:
|
|
|
14273
14273
|
linkType: hard
|
|
14274
14274
|
|
|
14275
14275
|
"markdown-to-jsx@npm:^7.1.3":
|
|
14276
|
-
version: 7.7.
|
|
14277
|
-
resolution: "markdown-to-jsx@npm:7.7.
|
|
14276
|
+
version: 7.7.4
|
|
14277
|
+
resolution: "markdown-to-jsx@npm:7.7.4"
|
|
14278
14278
|
peerDependencies:
|
|
14279
14279
|
react: ">= 0.14.0"
|
|
14280
|
-
checksum: 10c0/
|
|
14280
|
+
checksum: 10c0/692323e3cb5573ecce5f1f40c3b1a8d67bca40f2b4907ec266c23e7dffa2dcab466f738ea6569f8a5e6234ddcdccacbfeeb97b5e2f647b94bf29fa441f0083be
|
|
14281
14281
|
languageName: node
|
|
14282
14282
|
linkType: hard
|
|
14283
14283
|
|