@licklist/design 0.71.18-dev.11 → 0.71.18-dev.12

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.
@@ -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: OrderItem;
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;AAIlF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,SAAS,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,4CA6CrB,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,4CA8CrB,CAAA"}
@@ -7,11 +7,11 @@ import { ProductWithModifier } from '../../../CategoryProduct/components/Product
7
7
 
8
8
  var ProductSummary = function(param) {
9
9
  var name = param.name, productQuantityError = param.productQuantityError, orderProduct = param.orderProduct;
10
- var _orderProduct_orderModifiersSets;
11
10
  var t = useTranslation('Design').t;
12
11
  var formatNumber = useIntl().formatNumber;
13
12
  var priceForOneProduct = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.price;
14
- var modifierSetsPrice = calculateTotalModifiersPrice(orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderModifiersSets);
13
+ var modifiersSets = (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderModifiersSets) || (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderProductModifiers);
14
+ var modifierSetsPrice = calculateTotalModifiersPrice(modifiersSets);
15
15
  var fullPrice = formatNumber(priceForOneProduct * (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.quantity), {
16
16
  style: 'currency',
17
17
  currency: Config.Currency.GBP
@@ -40,8 +40,8 @@ var ProductSummary = function(param) {
40
40
  })
41
41
  ]
42
42
  }),
43
- !!(orderProduct === null || orderProduct === void 0 ? void 0 : (_orderProduct_orderModifiersSets = orderProduct.orderModifiersSets) === null || _orderProduct_orderModifiersSets === void 0 ? void 0 : _orderProduct_orderModifiersSets.length) && /*#__PURE__*/ jsx(Fragment, {
44
- children: orderProduct.orderModifiersSets.map(function(modifier, index) {
43
+ !!modifiersSets.length && /*#__PURE__*/ jsx(Fragment, {
44
+ children: modifiersSets.map(function(modifier, index) {
45
45
  return /*#__PURE__*/ jsx(ProductWithModifier, {
46
46
  modifier: modifier,
47
47
  modifierKey: index,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.71.18-dev.11",
3
+ "version": "0.71.18-dev.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -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: OrderItem
17
+ orderProduct: IOrderProduct
12
18
  }
13
19
 
14
20
  export const ProductSummary = ({
@@ -18,11 +24,12 @@ 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
 
29
+ const modifiersSets = orderProduct?.orderModifiersSets || orderProduct?.orderProductModifiers
30
+
24
31
  const modifierSetsPrice = calculateTotalModifiersPrice(
25
- orderProduct?.orderModifiersSets,
32
+ modifiersSets
26
33
  )
27
34
 
28
35
  const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
@@ -42,9 +49,9 @@ export const ProductSummary = ({
42
49
  {modifierSetsPrice && <p className='price'>{fullPrice}</p>}
43
50
  </div>
44
51
 
45
- {!!orderProduct?.orderModifiersSets?.length && (
52
+ {!!modifiersSets.length && (
46
53
  <>
47
- {orderProduct.orderModifiersSets.map((modifier, index) => (
54
+ {modifiersSets.map((modifier, index) => (
48
55
  <ProductWithModifier
49
56
  key={modifier.productQuantity.toString()}
50
57
  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.101
9893
- resolution: "electron-to-chromium@npm:1.5.101"
9894
- checksum: 10c0/9c6579e58b09cc27151ad135444253d241b8a354c2d1a122d280086549ce3c78a47388f6c37774d93ee73b353defdc1f215b702de2b18d34d53fcf8ed25e5f53
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.2
11207
- resolution: "flatted@npm:3.3.2"
11208
- checksum: 10c0/24cc735e74d593b6c767fe04f2ef369abe15b62f6906158079b9874bdb3ee5ae7110bb75042e70cd3f99d409d766f357caf78d5ecee9780206f5fdc5edbad334
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.3
14277
- resolution: "markdown-to-jsx@npm:7.7.3"
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/85b1c91a8d3ae03cfe828c6b76309702a913e681dad5a7e3a5324ec97153d89313be00a0ee423ab1c0bd61781ed181d76d4a54840d715b67756734da24211cf5
14280
+ checksum: 10c0/692323e3cb5573ecce5f1f40c3b1a8d67bca40f2b4907ec266c23e7dffa2dcab466f738ea6569f8a5e6234ddcdccacbfeeb97b5e2f647b94bf29fa441f0083be
14281
14281
  languageName: node
14282
14282
  linkType: hard
14283
14283