meemup-library 1.0.67 → 1.0.69

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,10 +1,7 @@
1
- declare class MoneyController {
2
- private dollarUSLocale;
3
- constructor();
1
+ declare const _default: {
4
2
  round: (money: number | string) => number;
5
3
  format(money: number | string, currency?: string, preText?: string): string;
6
4
  sum(values: Array<number>): number;
7
5
  sumAndFormat(values: number[], currency?: string, preText?: string): string;
8
- }
9
- declare const _default: MoneyController;
6
+ };
10
7
  export default _default;
@@ -1,6 +1,5 @@
1
- class MoneyController {
1
+ export default new class MoneyController {
2
2
  constructor() {
3
- this.dollarUSLocale = null;
4
3
  this.round = (money) => {
5
4
  try {
6
5
  let decimalPlaces = 2;
@@ -22,10 +21,9 @@ class MoneyController {
22
21
  return +(money + "");
23
22
  }
24
23
  };
25
- this.dollarUSLocale = Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
26
24
  }
27
25
  format(money, currency = "$", preText = "") {
28
- return `${preText}${currency}${this.dollarUSLocale.format(money)}`;
26
+ return `${preText}${currency}${Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(this.round(money))}`;
29
27
  }
30
28
  sum(values) {
31
29
  let sum = 0;
@@ -33,8 +31,6 @@ class MoneyController {
33
31
  return sum;
34
32
  }
35
33
  sumAndFormat(values, currency = "$", preText = "") {
36
- return this.format(this.sum(values), currency, preText);
34
+ return this.format(this.round(this.sum(values)), currency, preText);
37
35
  }
38
- }
39
- ;
40
- export default new MoneyController();
36
+ }();
@@ -308,9 +308,9 @@ export default new class {
308
308
  <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.orderAmount, symbol)}</div>
309
309
  </div>
310
310
 
311
- <div style="display : ${order.orderType === 1 && order.deliveryCosts > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
311
+ <div style="display : ${order.orderType === 1 && order.deliveryCost > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
312
312
  <div style="min-width : 150px; flex-grow : 1; text-align: end;">Delivery costs : </div>
313
- <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.deliveryCosts, symbol)}</div>
313
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.deliveryCost, symbol)}</div>
314
314
  </div>
315
315
 
316
316
  <div style="display : ${order.discountAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
@@ -10,7 +10,7 @@ interface IOrderDetailOrder {
10
10
  serviceFee: number;
11
11
  companyFee: number;
12
12
  totalAmountWithoutServiceFee: number;
13
- deliveryCosts: number;
13
+ deliveryCost: number;
14
14
  discountAmount: number;
15
15
  tipAmount: number;
16
16
  tipPercentage: number;
@@ -11,7 +11,7 @@ export const initOrderDetailOrder = {
11
11
  serviceFee: 0,
12
12
  companyFee: 0,
13
13
  totalAmountWithoutServiceFee: 0,
14
- deliveryCosts: 0,
14
+ deliveryCost: 0,
15
15
  discountAmount: 0,
16
16
  tipAmount: 0,
17
17
  tipPercentage: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",