@medicus.ai/medicus-report-pdf-generator 1.0.208 → 1.0.209

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,94 +1,153 @@
1
- body {
2
- font-family: 'Cairo' !important;
1
+ .report-header,
2
+ .first-page .logo{
3
+ padding-left: 0px;
4
+ padding-right: 50px;
3
5
  }
4
6
 
5
- .header-info {
6
- padding-right: 20px;
7
+ /*second page*/
8
+ .single-section {
9
+ padding-left: 0px;
10
+ padding-right: 50px;
7
11
  }
8
12
 
9
- .header-info .company-logo {
10
- float: left;
13
+ .section-title {
14
+ padding-right: 0px;
15
+ padding-left: 50px;
16
+ }
17
+
18
+ .side-chart-container {
19
+ float: right;
20
+ }
21
+
22
+ td.bar-title {
23
+ width: 35.7%;
24
+ border-right: 1px solid;
25
+ border-left: 0;
26
+ padding-right: 12px;
27
+ padding-left: 0;
28
+ }
29
+
30
+ td.bar-title span {
31
+ text-align: left;
32
+ direction: rtl;
33
+ }
34
+ .page:not(.first-page) {
35
+ page-break-inside: avoid;
36
+ }
37
+ .participant-analytics-section.single-section.page {
38
+ margin-top: 0px;
39
+ }
40
+ .participant-analytics-section .container .side-chart-container:nth-child(odd) .bar-title span {
41
+ text-align: right;
11
42
  }
12
43
 
13
44
  .container {
14
- padding-right: 0;
45
+ padding-right: 0px;
15
46
  padding-left: 50px;
16
47
  }
17
48
 
18
- .section-title {
19
- padding-right: 12px;
20
- padding-top: 25px;
49
+ .bar-chart {
50
+ float: left;
51
+ border-top-right-radius: 20px;
52
+ border-bottom-right-radius: 20px;
53
+ border-top-left-radius: 0;
54
+ border-bottom-left-radius: 0;
21
55
  }
22
56
 
23
- .side-chart-container {
57
+ .participant-analytics-section .container .side-chart-container:nth-child(even) table {
24
58
  direction: ltr;
25
59
  }
26
60
 
27
- .relations-section {
28
- display: flex;
61
+ .participant-analytics-section .container .side-chart-container:nth-child(even) {
62
+ float: left;
63
+ }
64
+
65
+ .participant-analytics-section .container .side-chart-container:nth-child(even) table td.bar-title {
66
+ border-left: 1px solid;
67
+ border-right: 0;
68
+ padding-left: 13px;
69
+ padding-right: 0;
29
70
  }
30
71
 
31
- .element-side-container {
32
- display: flex;
33
- flex-direction: row-reverse;
72
+ .participant-analytics-section .container .side-chart-container:nth-child(even) table .bar-chart {
73
+ float: right;
74
+ border-radius: 20px 0 0 20px;
75
+ }
76
+
77
+ /*other pages*/
78
+ .element-summary-container {
79
+ float: left;
34
80
  }
35
81
 
36
82
  .other .container .side-chart-container table {
37
83
  direction: ltr;
38
84
  }
39
85
 
40
- .other .container .side-chart-container table .bar-chart {
86
+ .other .container .side-chart-container {
41
87
  float: right;
42
- border-radius: 20px 0 0 20px;
43
- text-align: left;
44
88
  }
45
89
 
46
90
  .other .container .side-chart-container table td.bar-title {
47
- border-left: 1px solid;
48
91
  border-right: 0;
49
- padding-right: 85px;
92
+ border-left: 1px solid;
93
+ padding-right: 0;
94
+ padding-left:13px;
50
95
  }
51
96
 
52
- .other .side-chart.side-chart-with-border table tr td:last-child {
53
- width: 30%;
97
+ .other .container .side-chart-container table .bar-chart {
98
+ float: right;
99
+ border-radius: 20px 0 0 20px;
54
100
  }
55
101
 
56
- table.data-by-gender tr th:first-child {
57
- width: 0%;
58
- }
59
102
 
60
- table.data-by-gender th {
103
+ .other .side-chart-container .chart_title {
61
104
  text-align: right;
62
105
  }
63
106
 
64
- td {
65
- text-align: right;
66
- }
67
107
 
68
- .bottom-section {
69
- display: flex;
108
+ .relations-section .single-relation {
109
+ float: right;
110
+ padding: 1% 1% 0% 1%;
111
+ margin-right: 0;
112
+ margin-left: 3%;
70
113
  }
71
114
 
72
- .recommends-section {
73
- border-radius: 20px 0 0 20px;
74
- transform: skewY(-3deg);
75
- padding-bottom: 3%;
115
+ .relations-section .single-relation:nth-child(4n) {
116
+ margin-right: 0;
117
+ margin-left: 5%;
76
118
  }
77
119
 
78
- .recommends-section-content {
79
- transform: skewY(2deg);
80
- margin-right: 25px;
120
+ .relation-content-bottom-bg {
121
+ border-bottom-right-radius: 0;
122
+ border-bottom-left-radius: 30px;
81
123
  }
82
124
 
83
- .sources-section {
84
- margin-right: 70px
125
+ table.data-by-gender {
126
+ float: right;
127
+ text-align: right;
85
128
  }
86
129
 
87
- .single-section {
88
- padding-left: 0;
130
+ .recommends-section {
131
+ float: right;
132
+ margin-left: 0px;
133
+ margin-right: -50px;
134
+ padding-left: 0px;
89
135
  padding-right: 50px;
136
+ border-top-right-radius: 0px;
137
+ border-top-left-radius: 20px;
138
+ border-bottom-right-radius: 0px;
139
+ border-bottom-left-radius: 20px;
90
140
  }
91
141
 
92
- .second-footer-logo {
93
- direction: ltr;
142
+ .recommends-section li img {
143
+ margin-right: 0;
144
+ margin-left: 7px;
145
+ }
146
+
147
+ .sources-section {
148
+ float: left;
149
+ }
150
+
151
+ .sources-section span {
152
+ float: right;
94
153
  }
@@ -89,8 +89,7 @@ let generateHTMLCorporateReport = async (data, isDebugging) => {
89
89
  /*check if the language is an RTL language*/
90
90
  if (!data.language) {
91
91
  localeService.setLocale("en")
92
- }
93
- else {
92
+ } else {
94
93
  if (data.language.indexOf('ar') !== -1) {
95
94
  data.language = 'ar-SA';
96
95
  isRTL = true;
@@ -100,7 +99,7 @@ let generateHTMLCorporateReport = async (data, isDebugging) => {
100
99
  }
101
100
  /*choose the right template*/
102
101
  let html = !isRTL ? fs.readFileSync(path.resolve(__dirname + '/../templates/corporate_report/ltr_no_pages.html'), 'utf8') :
103
- fs.readFileSync(path.resolve(__dirname + '/../templates/corporate_report/rtl_no_pages.html'), 'utf8')
102
+ fs.readFileSync(path.resolve(__dirname + '/../templates/corporate_report/rtl_no_pages.html'), 'utf8')
104
103
 
105
104
  let coverPageTemplate = fs.readFileSync(path.resolve(__dirname + '/../templates/corporate_report/cover_page.html'), 'utf8');
106
105
  let participantAnalyticsTemplate = fs.readFileSync(path.resolve(__dirname + '/../templates/corporate_report/participant_analytics.html'), 'utf8');
@@ -361,34 +360,37 @@ const empty = (value) => {
361
360
 
362
361
 
363
362
  let renderBarChart = (data) => {
364
- let total = 100
365
- let barChart = "<div class='side-chart-container'>"
366
- if (!empty(data.title)) {
367
- barChart += "<div class='chart_title'>" + data.title + "</div>"
368
- if (data.title === "Activity") {
369
- total = data.data[1].value
363
+ let total = 100;
364
+ let barChart = ""
365
+ if (!empty(data) && !empty(data.data)) {
366
+ barChart = "<div class='side-chart-container'>"
367
+ if (!empty(data.title)) {
368
+ barChart += "<div class='chart_title'>" + data.title + "</div>"
369
+ if (data.title === "Activity") {
370
+ total = data.data[1].value
371
+ }
370
372
  }
371
- }
372
- if (!empty(data.data)) {
373
- barChart += "<div class='side-chart side-chart-with-border'><table>"
374
- let dataLength = data.data.length
375
- let barChartClass = ''
376
- if (dataLength > 5) {
377
- barChartClass = 'divide-bar'
373
+ if (!empty(data.data)) {
374
+ barChart += "<div class='side-chart side-chart-with-border'><table>"
375
+ let dataLength = data.data.length
376
+ let barChartClass = ''
377
+ if (dataLength > 5) {
378
+ barChartClass = 'divide-bar'
379
+ }
380
+ data.data.map((chartData) => {
381
+ barChart += "<tr>"
382
+ barChart += "<td>" +
383
+ "<div class='bar-chart " + barChartClass + "' style='background: " + chartData.color + "' data-value='" + chartData.value + "' data-total='" + total + "'>" + chartData.value + "</div>\n" +
384
+ "</td>"
385
+ barChart += "<td class='bar-title'><span>" + chartData.title + "</span></td>"
386
+ barChart += "</tr>"
387
+ })
388
+
389
+ barChart += "</table></div>";
378
390
  }
379
- data.data.map((chartData) => {
380
- barChart += "<tr>"
381
- barChart += "<td>" +
382
- "<div class='bar-chart " + barChartClass + "' style='background: " + chartData.color + "' data-value='" + chartData.value + "' data-total='" + total + "'>" + chartData.value + "</div>\n" +
383
- "</td>"
384
- barChart += "<td class='bar-title'><span>" + chartData.title + "</span></td>"
385
- barChart += "</tr>"
386
- })
387
391
 
388
- barChart += "</table></div>";
392
+ barChart += "</div>";
389
393
  }
390
-
391
- barChart += "</div>";
392
394
  return barChart;
393
395
  }
394
396
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medicus.ai/medicus-report-pdf-generator",
3
- "version": "1.0.208",
3
+ "version": "1.0.209",
4
4
  "description": "Nasco corporate report - latest update in 2/11/2022 - Fix sanusx coprorate report issues",
5
5
  "main": "index.js",
6
6
  "scripts": {