meemup-library 1.8.2 → 1.8.4

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.
@@ -116,9 +116,9 @@ class LabelPreviewController {
116
116
  row.extras.filter(i => !i.doNotPrintOnReceipt).forEach(element => {
117
117
  let extraText = this.pizzaSideText(element.pizzaSide) + element.quantity + "X " + element.extraItemTitle;
118
118
  let extraAmount = template.showPrices ? MoneyController.format(element.totalAmount, currencySymbol) : "";
119
- content += `<div style="display: flex; flex-direction: row; justify-content: flex-start; padding-left: 16px">
120
- <p style="font-size:${template.fontSize}px; flex: 1; width: 100%; text-align: left;">${extraText}</p>
121
- <p style="font-size:${template.fontSize}px; max-width: 90px; text-align: right;">${extraAmount}</p>
119
+ content += `<div style="display: flex; flex-direction: row; justify-content: flex-start; padding-left: 16px">
120
+ <p style="font-size:${template.fontSize}px; flex: 1; width: 100%; text-align: left;">${extraText}</p>
121
+ <p style="font-size:${template.fontSize}px; max-width: 90px; text-align: right;">${extraAmount}</p>
122
122
  </div>`;
123
123
  });
124
124
  content += `</div>`;
@@ -306,61 +306,61 @@ class _PreviewContentController {
306
306
  }
307
307
  paymentFailed(detail, currency) {
308
308
  var _a, _b, _c;
309
- return `<div style="padding-top: 16px; padding-bottom: 16px;">
310
- <div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
311
- <img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
312
- style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
313
- </div>
314
- <div
315
- style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 10%; margin-right: 10%; margin-top: 16px; padding-left: 16px; padding-right: 16px;">
316
- <strong style="font-size: 18px;">AMOUNT</strong>
317
- <strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
318
- </div>
319
- <div
320
- style="display: flex; flex-direction: row; align-items: center; justify-content: center; border-bottom: 2px solid black; margin-left: 10%; margin-right: 10%; padding: 16px;">
321
- <strong style="font-size: 18px; padding-right: 16px;"></strong>
322
- <strong style="font-size: 18px;">#0</strong>
323
- </div>
324
- <div
325
- style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
326
- <strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
327
- <p style="font-size: 12px; font-weight: bold; margin-top: 8px; padding-bottom: 16px;">${(_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.message}</p>
328
- </div>
329
- <div style="margin-left: 16px; margin-right: 16px;">
330
- ${(_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata.map(i => (`<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 8px;">
331
- <strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
332
- <strong style="font-size: 12px;">${i.value}</strong>
333
- </div>`))}
334
-
335
- </div>
309
+ return `<div style="padding-top: 16px; padding-bottom: 16px;">
310
+ <div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
311
+ <img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
312
+ style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
313
+ </div>
314
+ <div
315
+ style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 10%; margin-right: 10%; margin-top: 16px; padding-left: 16px; padding-right: 16px;">
316
+ <strong style="font-size: 18px;">AMOUNT</strong>
317
+ <strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
318
+ </div>
319
+ <div
320
+ style="display: flex; flex-direction: row; align-items: center; justify-content: center; border-bottom: 2px solid black; margin-left: 10%; margin-right: 10%; padding: 16px;">
321
+ <strong style="font-size: 18px; padding-right: 16px;"></strong>
322
+ <strong style="font-size: 18px;">#0</strong>
323
+ </div>
324
+ <div
325
+ style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
326
+ <strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
327
+ <p style="font-size: 12px; font-weight: bold; margin-top: 8px; padding-bottom: 16px;">${(_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.message}</p>
328
+ </div>
329
+ <div style="margin-left: 16px; margin-right: 16px;">
330
+ ${(_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata.map(i => (`<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 8px;">
331
+ <strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
332
+ <strong style="font-size: 12px;">${i.value}</strong>
333
+ </div>`))}
334
+
335
+ </div>
336
336
  </div>`;
337
337
  }
338
338
  packageLabel(detail, template) {
339
339
  const { font, fontSize, width, paper } = template;
340
340
  const mediumFontSize = (fontSize * 1.5).toFixed(0);
341
341
  const largeFontSize = (fontSize * 2.5).toFixed(0);
342
- return `<div style="font-family : ${font}; font-size: ${fontSize + "px"};font-weight : normal; padding : 10px; border: 1px solid black; width: ${this.calculatePaperSize(paper, width)};">
343
- <div
344
- style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid black;">
345
- <strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
346
- <strong style="font-size: ${mediumFontSize + "px"};">#${detail.order.orderNumber}</strong>
347
- </div>
348
- <div style="border-bottom: 1px solid black; padding: 8px 0;">
349
- ${detail.products.map((i) => (`<div style="padding : 2px 0;">${i.title}</div>`)).join("")}
350
- </div>
351
- <div
352
- style="margin-top: 16px; margin-bottom: 6px; padding-bottom: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid black;">
353
- <strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
354
- <strong style="font-size: ${largeFontSize + "px"};">${detail.order.orderNumber}</strong>
355
- <div>${detail.customer.fullName}</div>
356
- </div>
357
- <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 10%; margin-right: 10%;">
358
- <div>${this.formatDateTime(detail.order.desiredDate)}</div>
359
- <div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
360
- <img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
361
- style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
362
- </div>
363
- </div>
342
+ return `<div style="font-family : ${font}; font-size: ${fontSize + "px"};font-weight : normal; padding : 10px; border: 1px solid black; width: ${this.calculatePaperSize(paper, width)};">
343
+ <div
344
+ style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid black;">
345
+ <strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
346
+ <strong style="font-size: ${mediumFontSize + "px"};">#${detail.order.orderNumber}</strong>
347
+ </div>
348
+ <div style="border-bottom: 1px solid black; padding: 8px 0;">
349
+ ${detail.products.map((i) => (`<div style="padding : 2px 0;">${i.title}</div>`)).join("")}
350
+ </div>
351
+ <div
352
+ style="margin-top: 16px; margin-bottom: 6px; padding-bottom: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid black;">
353
+ <strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
354
+ <strong style="font-size: ${largeFontSize + "px"};">${detail.order.orderNumber}</strong>
355
+ <div>${detail.customer.fullName}</div>
356
+ </div>
357
+ <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 10%; margin-right: 10%;">
358
+ <div>${this.formatDateTime(detail.order.desiredDate)}</div>
359
+ <div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
360
+ <img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
361
+ style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
362
+ </div>
363
+ </div>
364
364
  </div>`;
365
365
  }
366
366
  preview(account, detail, template) {
@@ -651,50 +651,50 @@ class _PreviewContentController {
651
651
  });
652
652
  }
653
653
  standardHtmlContainer(strHtml) {
654
- return `<!DOCTYPE html>
655
- <html>
656
- <head>
657
- <meta charset="UTF-8">
658
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
659
- <style>
660
-
661
- html {
662
- font-size: 14px;
663
- }
664
-
665
- * {
666
- padding: 0;
667
- margin: 0;
668
- }
669
-
670
- p,strong {
671
- line-height: 1.5rem;
672
- font-weight : 500;
673
- }
674
-
675
- td{
676
- padding-top: 2px;
677
- padding-bottom: 2px;
678
- line-height: 1.6rem;
679
- }
680
-
681
- body {
682
- width : 76mm;
683
- margin: 0;
684
- padding: 0;
685
- background-color: #ffffff;
686
- font-family: 'Roboto', 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Oxygen',
687
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
688
- sans-serif , -apple-system, BlinkMacSystemFont;
689
- -webkit-font-smoothing: antialiased;
690
- -moz-osx-font-smoothing: grayscale;
691
- }
692
-
693
- </style>
694
- </head>
695
- <body>
696
- ${strHtml}
697
- </body>
654
+ return `<!DOCTYPE html>
655
+ <html>
656
+ <head>
657
+ <meta charset="UTF-8">
658
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
659
+ <style>
660
+
661
+ html {
662
+ font-size: 14px;
663
+ }
664
+
665
+ * {
666
+ padding: 0;
667
+ margin: 0;
668
+ }
669
+
670
+ p,strong {
671
+ line-height: 1.5rem;
672
+ font-weight : 500;
673
+ }
674
+
675
+ td{
676
+ padding-top: 2px;
677
+ padding-bottom: 2px;
678
+ line-height: 1.6rem;
679
+ }
680
+
681
+ body {
682
+ width : 76mm;
683
+ margin: 0;
684
+ padding: 0;
685
+ background-color: #ffffff;
686
+ font-family: 'Roboto', 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Oxygen',
687
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
688
+ sans-serif , -apple-system, BlinkMacSystemFont;
689
+ -webkit-font-smoothing: antialiased;
690
+ -moz-osx-font-smoothing: grayscale;
691
+ }
692
+
693
+ </style>
694
+ </head>
695
+ <body>
696
+ ${strHtml}
697
+ </body>
698
698
  </html>`;
699
699
  }
700
700
  createClosingWorkDay(data, companyTitle) {
@@ -823,14 +823,14 @@ class _PreviewContentController {
823
823
  content += `<p style="display:block; font-size: ${template.fontSize * 2}px; text-align: left; margin-bottom:16px;">${total + ", " + afterTotal}</p>`;
824
824
  content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Reg. date &nbsp;&nbsp; ${dayjs(detail.order.registrationDate).format(Formats.displayDateTime)}</p>`;
825
825
  content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Order &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REF:${detail.order.id} , #${detail.order.orderNumber}</p>`;
826
- content += `<div style="display:flex; flex-direction : row; justify-content: space-between; align-items :center; ">
827
- <p style="font-size: ${template.fontSize * 2}px; text-align: left;">Total, ${afterTotal}</p>
828
- <p style="font-size: ${template.fontSize * 2}px; text-align: right;">${total}</p>
826
+ content += `<div style="display:flex; flex-direction : row; justify-content: space-between; align-items :center; ">
827
+ <p style="font-size: ${template.fontSize * 2}px; text-align: left;">Total, ${afterTotal}</p>
828
+ <p style="font-size: ${template.fontSize * 2}px; text-align: right;">${total}</p>
829
829
  </div>`;
830
- content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:16px; margin-bottom: 16px;">
831
- <div style="border-top:1px solid black; flex:1;"></div>
832
- <p style="font-size: ${template.fontSize}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
833
- <div style="border-top:1px solid black; flex:1;"></div>
830
+ content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:16px; margin-bottom: 16px;">
831
+ <div style="border-top:1px solid black; flex:1;"></div>
832
+ <p style="font-size: ${template.fontSize}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
833
+ <div style="border-top:1px solid black; flex:1;"></div>
834
834
  </div>`;
835
835
  if (detail.paymentInfo !== null && Array.isArray((_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.metadata) && ((_d = (_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.length) > 0) {
836
836
  content += `<div style="margin-bottom:16px;">`;