meemup-library 1.4.53 → 1.4.54

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.
@@ -28,6 +28,7 @@ declare const _default: {
28
28
  createPrintFromTurnoverDetail(data: ITurnover, currency: string, printParts: IPointOfSalePrintParts): Promise<string>;
29
29
  createCashDrawerPaidInOutMarkup(device: IPointOfSaleActionFormCashDrawer, setting: IPointOfSaleSetting, member: IPointOfSaleTeamMember): Promise<string>;
30
30
  openCashDrawerMarkup(label?: string): Promise<string>;
31
+ standardHtmlContainer(strHtml: string): string;
31
32
  createClosingWorkDay(data: IPointOfSaleApiClosingWorkDay, companyTitle: string): Promise<string>;
32
33
  createCashDrawerReport(device: IPointOfSaleCashDrawer, form: IPointOfSaleCashDrawerReportForm, records: IPointOfSaleCashDrawerReportRecord[], company: string, currency: string, member: IPointOfSaleTeamMember, formatDate: (value: string) => string): Promise<string>;
33
34
  };
@@ -346,50 +346,7 @@ export default new class PreviewContentController {
346
346
  content = `<div> template.layout : ${template.layout}</div>`;
347
347
  break;
348
348
  }
349
- return `<!DOCTYPE html>
350
- <html>
351
- <head>
352
- <meta charset="UTF-8">
353
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
354
- <style>
355
-
356
- html {
357
- font-size: 14px;
358
- }
359
-
360
- * {
361
- padding: 0;
362
- margin: 0;
363
- }
364
-
365
- p,strong {
366
- line-height: 1.5rem;
367
- }
368
-
369
- td{
370
- padding-top: 2px;
371
- padding-bottom: 2px;
372
- line-height: 1.6rem;
373
- }
374
-
375
- body {
376
- width : 100%;
377
- margin: 0;
378
- padding: 0;
379
- background-color: #ffffff;
380
- font-family: -apple-system, BlinkMacSystemFont, 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Roboto', 'Oxygen',
381
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
382
- sans-serif;
383
- -webkit-font-smoothing: antialiased;
384
- -moz-osx-font-smoothing: grayscale;
385
- }
386
-
387
- </style>
388
- </head>
389
- <body>
390
- ${content}
391
- </body>
392
- </html>`;
349
+ return this.standardHtmlContainer(content);
393
350
  }
394
351
  createPrintFromTurnoverDetail(data, currency, printParts) {
395
352
  return __awaiter(this, void 0, void 0, function* () {
@@ -593,7 +550,7 @@ export default new class PreviewContentController {
593
550
  ${printPoweredBy}
594
551
  </div>`;
595
552
  content += `</div>`;
596
- return (`<div style="display: flex;"><div style="width : auto;">${content}</div></div>`);
553
+ return this.standardHtmlContainer(content);
597
554
  }
598
555
  catch (e) {
599
556
  console.log(e);
@@ -617,8 +574,8 @@ export default new class PreviewContentController {
617
574
  content += SimplePreviewController.printSolidLine();
618
575
  content += SimplePreviewController.createText(`Reason: ${device.reason}`);
619
576
  content += SimplePreviewController.footer();
577
+ return this.standardHtmlContainer(content);
620
578
  }
621
- return content;
622
579
  }
623
580
  catch (error) {
624
581
  console.log(`Error: ${String(error)}`);
@@ -631,6 +588,52 @@ export default new class PreviewContentController {
631
588
  return `<div>${label}</div>`;
632
589
  });
633
590
  }
591
+ standardHtmlContainer(strHtml) {
592
+ return `<!DOCTYPE html>
593
+ <html>
594
+ <head>
595
+ <meta charset="UTF-8">
596
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
597
+ <style>
598
+
599
+ html {
600
+ font-size: 14px;
601
+ }
602
+
603
+ * {
604
+ padding: 0;
605
+ margin: 0;
606
+ }
607
+
608
+ p,strong {
609
+ line-height: 1.5rem;
610
+ }
611
+
612
+ td{
613
+ padding-top: 2px;
614
+ padding-bottom: 2px;
615
+ line-height: 1.6rem;
616
+ }
617
+
618
+ body {
619
+ width : 100%;
620
+ margin: 0;
621
+ padding: 0;
622
+ background-color: #ffffff;
623
+ font-family: -apple-system, BlinkMacSystemFont, 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Roboto', 'Oxygen',
624
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
625
+ sans-serif;
626
+ -webkit-font-smoothing: antialiased;
627
+ -moz-osx-font-smoothing: grayscale;
628
+ }
629
+
630
+ </style>
631
+ </head>
632
+ <body>
633
+ ${strHtml}
634
+ </body>
635
+ </html>`;
636
+ }
634
637
  createClosingWorkDay(data, companyTitle) {
635
638
  return __awaiter(this, void 0, void 0, function* () {
636
639
  let content = "";
@@ -659,31 +662,35 @@ export default new class PreviewContentController {
659
662
  }
660
663
  }
661
664
  if (summaryList.length > 0) {
665
+ content += SimplePreviewController.printSpace(20);
662
666
  content += SimplePreviewController.createTitle("Summaries");
663
667
  for (let index = 0; index < summaryList.length; index++) {
664
668
  content += SimplePreviewController.createTextValueSpaceBetween(summaryList[index].text, summaryList[index].value);
665
669
  }
666
670
  }
667
671
  if (detailList.length > 0) {
672
+ content += SimplePreviewController.printSpace(20);
668
673
  content += SimplePreviewController.createTitle("Details");
669
674
  for (let index = 0; index < detailList.length; index++) {
670
675
  content += SimplePreviewController.createTextValueSpaceBetween(detailList[index].text, detailList[index].value);
671
676
  }
672
677
  }
673
678
  if (paymentMethodList.length > 0) {
679
+ content += SimplePreviewController.printSpace(20);
674
680
  content += SimplePreviewController.createTitle("Payments");
675
681
  for (let index = 0; index < paymentMethodList.length; index++) {
676
682
  content += SimplePreviewController.createTextValueSpaceBetween(paymentMethodList[index].text, paymentMethodList[index].value);
677
683
  }
678
684
  }
679
685
  if (categoryList.length > 0) {
686
+ content += SimplePreviewController.printSpace(20);
680
687
  content += SimplePreviewController.createTitle("Categories");
681
688
  for (let index = 0; index < categoryList.length; index++) {
682
689
  content += SimplePreviewController.createTextValueSpaceBetween(categoryList[index].text, categoryList[index].value);
683
690
  }
684
691
  }
685
692
  content += SimplePreviewController.footer();
686
- return content;
693
+ return this.standardHtmlContainer(content);
687
694
  }
688
695
  catch (e) {
689
696
  console.log(e);
@@ -714,7 +721,7 @@ export default new class PreviewContentController {
714
721
  });
715
722
  content += SimplePreviewController.createTextValueSpaceBetween('Total:', MoneyController.format(sum, currency));
716
723
  content += SimplePreviewController.footer();
717
- return content;
724
+ return this.standardHtmlContainer(content);
718
725
  }
719
726
  catch (error) {
720
727
  console.log(`Error: ${String(error)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.4.53",
3
+ "version": "1.4.54",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "remove:one": "rimraf dist",
12
12
  "remove:two": "rimraf ./src/dist",
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "commit": "git add . && git commit -m \"version.1.4.53\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.4.54\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"