@postnord/pn-marketweb-components 2.0.144 → 2.0.146
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.
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-chart.cjs.entry.js +204 -3
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-stats-info-data.cjs.entry.js +76 -4
- package/cjs/pn-stats-info.cjs.entry.js +3 -6
- package/collection/components/charts/pn-chart/pn-chart-helper.js +6 -2
- package/collection/components/charts/pn-chart/pn-chart.js +6 -3
- package/collection/components/charts/pn-charts-card/pn-charts-card.stories.js +1 -1
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.js +26 -17
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info.css +71 -49
- package/collection/components/data-visualization/pn-stats-info/pn-stats-info.js +2 -5
- package/custom-elements/index.js +284 -14
- package/esm/loader.js +1 -1
- package/esm/pn-chart.entry.js +204 -3
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-stats-info-data.entry.js +76 -4
- package/esm/pn-stats-info.entry.js +3 -6
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-chart.entry.js +9 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-stats-info-data.entry.js +1 -1
- package/esm-es5/pn-stats-info.entry.js +1 -1
- package/package.json +4 -2
- package/pn-market-web-components/p-2e4361e7.entry.js +1 -0
- package/pn-market-web-components/{p-05f6c442.system.entry.js → p-2e507907.system.entry.js} +11 -3
- package/pn-market-web-components/{p-4d29f6a6.entry.js → p-773b59c0.entry.js} +11 -3
- package/pn-market-web-components/p-7d463116.system.entry.js +1 -0
- package/pn-market-web-components/p-a62ddaaa.system.entry.js +1 -0
- package/pn-market-web-components/p-d295ef71.system.js +1 -1
- package/pn-market-web-components/p-fba88e93.entry.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/charts/pn-chart/pn-chart-helper.d.ts +15 -1
- package/types/components/charts/pn-chart/pn-chart.d.ts +1 -0
- package/types/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.d.ts +4 -1
- package/types/components/data-visualization/pn-stats-info/pn-stats-info.d.ts +0 -1
- package/types/components.d.ts +2 -2
- package/umd/pn-marketweb-init.js +1 -1
- package/umd/pn-marketweb-salesforce.js +2 -2
- package/pn-market-web-components/p-00165a55.system.entry.js +0 -1
- package/pn-market-web-components/p-0fbcc2b8.entry.js +0 -1
- package/pn-market-web-components/p-80e58bf9.entry.js +0 -1
- package/pn-market-web-components/p-fd040ac6.system.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const chartCfg = (dataChartType, data) => {
|
|
1
|
+
export const chartCfg = (dataChartType, data, moreThanOneSet = false) => {
|
|
2
2
|
let cfg = {
|
|
3
3
|
type: dataChartType,
|
|
4
4
|
data: data,
|
|
@@ -7,13 +7,14 @@ export const chartCfg = (dataChartType, data) => {
|
|
|
7
7
|
maintainAspectRatio: false,
|
|
8
8
|
aspectRatio: 1,
|
|
9
9
|
legend: {
|
|
10
|
-
display:
|
|
10
|
+
display: moreThanOneSet,
|
|
11
11
|
position: 'bottom',
|
|
12
12
|
labels: { boxWidth: 20, fontFamily: 'sans-serif' },
|
|
13
13
|
},
|
|
14
14
|
tooltip: {
|
|
15
15
|
enabled: true,
|
|
16
16
|
},
|
|
17
|
+
plugins: { deferred: { enabled: true, yOffset: '50%', delay: 300 } },
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
if (dataChartType === 'bar') {
|
|
@@ -27,6 +28,9 @@ export const chartCfg = (dataChartType, data) => {
|
|
|
27
28
|
],
|
|
28
29
|
} }) });
|
|
29
30
|
}
|
|
31
|
+
if (dataChartType === 'doughnut' || dataChartType === 'pie') {
|
|
32
|
+
return Object.assign(Object.assign({}, cfg), { options: Object.assign(Object.assign({}, cfg.options), { legend: Object.assign(Object.assign({}, cfg.options.legend), { display: true }) }) });
|
|
33
|
+
}
|
|
30
34
|
return cfg;
|
|
31
35
|
};
|
|
32
36
|
export const dataSetProps = (set, dataChartType) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Chart } from 'chart.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import ChartDeferred from 'chartjs-plugin-deferred';
|
|
3
|
+
import { h, Host } from '@stencil/core';
|
|
4
|
+
import { chartCfg, dataSetProps } from './pn-chart-helper';
|
|
4
5
|
export class PnChart {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.labels = null;
|
|
@@ -10,6 +11,7 @@ export class PnChart {
|
|
|
10
11
|
}
|
|
11
12
|
dataChangeHandler() {
|
|
12
13
|
this.parsedDataSets = JSON.parse(this.dataSets);
|
|
14
|
+
this.numberOfSetsGreaterThanOne = this.parsedDataSets.length > 1;
|
|
13
15
|
this.parsedDatasetWithDataParsed = this.parsedDataSets.map(set => dataSetProps(set, this.dataChartType));
|
|
14
16
|
this.data = Object.assign(Object.assign({}, this.data), { datasets: this.parsedDatasetWithDataParsed });
|
|
15
17
|
}
|
|
@@ -22,8 +24,9 @@ export class PnChart {
|
|
|
22
24
|
this.labelsChangeHandler();
|
|
23
25
|
}
|
|
24
26
|
componentDidLoad() {
|
|
27
|
+
Chart.plugins.register(ChartDeferred);
|
|
25
28
|
this.myChartCtxRef = this.element.querySelector('#chart-canvas');
|
|
26
|
-
this.myChart = new Chart(this.myChartCtxRef, chartCfg(this.dataChartType, this.data));
|
|
29
|
+
this.myChart = new Chart(this.myChartCtxRef, chartCfg(this.dataChartType, this.data, this.numberOfSetsGreaterThanOne));
|
|
27
30
|
}
|
|
28
31
|
render() {
|
|
29
32
|
return (h(Host, null, h("div", { class: "chart-wrapper" }, h("canvas", { id: "chart-canvas", class: "pnChart" }))));
|
|
@@ -24,7 +24,7 @@ const TemplateChartsCardOne = ({ ...args }) => {
|
|
|
24
24
|
open-in-new-window="${args.openInNewWindow}"
|
|
25
25
|
data-chart-color="blue"
|
|
26
26
|
>
|
|
27
|
-
<pn-chart data-chart-type="bar" slot="chart" labels='["XSmall", "Small", "Medium"]' data-sets='[{ "label": "# of packages in billions", "backgroundColor": ["#E0F8FF", "#8EDDF9", "#00A0D6"], "data": [50, 100, 500] }]'></pn-chart>
|
|
27
|
+
<pn-chart data-chart-type="bar" slot="chart" labels='["XSmall", "Small", "Medium"]' data-sets='[{ "label": "# of packages in billions", "backgroundColor": ["#E0F8FF", "#8EDDF9", "#00A0D6"], "data": [50, 100, 500] }, { "label": "# of packages in billions", "backgroundColor": ["red", "green", "pink"], "data": [70, 110, 600] }]'></pn-chart>
|
|
28
28
|
|
|
29
29
|
</pn-charts-card>
|
|
30
30
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { h, Host } from '@stencil/core';
|
|
2
3
|
import { animateValue } from './animationHelper';
|
|
3
4
|
import { inViewport } from './viewIntersectionHelper';
|
|
4
5
|
export class PnStatsInfoData {
|
|
@@ -11,22 +12,29 @@ export class PnStatsInfoData {
|
|
|
11
12
|
this.data = 0;
|
|
12
13
|
this.unit = null;
|
|
13
14
|
this.preamble = null;
|
|
14
|
-
this.compId = null;
|
|
15
15
|
this.duration = 1000;
|
|
16
|
+
this.index = null;
|
|
16
17
|
this.hasBeenShown = false;
|
|
18
|
+
this.compId = null;
|
|
19
|
+
}
|
|
20
|
+
generateUniqueId() {
|
|
21
|
+
return uuidv4();
|
|
22
|
+
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.compId = this.generateUniqueId();
|
|
17
25
|
}
|
|
18
26
|
watchStateHandlder(newValue, oldValue) {
|
|
19
|
-
const obj = document.getElementById(`pn-stats-info-data-${this.compId}`);
|
|
27
|
+
const obj = document.getElementById(`pn-stats-info-data-${this.compId}-${this.index}`);
|
|
20
28
|
if (obj.classList.contains('is-inViewport') && newValue !== oldValue) {
|
|
21
29
|
animateValue(obj, 0, this.data, this.duration);
|
|
22
30
|
}
|
|
23
31
|
}
|
|
24
32
|
render() {
|
|
25
|
-
return (h(Host, null, h("div", { class: "pn-stats-info-data__container" }, h("div", { class: "pn-stats-info-data__container__content" }, h("div", { class: "pn-stats-info-data__container__content__data", id: `pn-stats-info-data-${this.compId}` }), h("div", { class: "pn-stats-info-data__container__content__unit" }, this.unit)), h("div", { class: "pn-stats-info-data__container__content__preamble" }, this.preamble))));
|
|
33
|
+
return (h(Host, null, h("div", { class: "pn-stats-info-data__container" }, h("div", { class: "pn-stats-info-data__container__content" }, h("div", { class: "pn-stats-info-data__container__content__data", id: `pn-stats-info-data-${this.compId}-${this.index}` }), h("div", { class: "pn-stats-info-data__container__content__unit" }, this.unit)), h("div", { class: "pn-stats-info-data__container__content__preamble" }, this.preamble))));
|
|
26
34
|
}
|
|
27
35
|
componentDidRender() {
|
|
28
36
|
const observer = new IntersectionObserver(entries => inViewport(entries, 'is-inViewport', this.inViewPortCallback));
|
|
29
|
-
const obj = document.getElementById(`pn-stats-info-data-${this.compId}`);
|
|
37
|
+
const obj = document.getElementById(`pn-stats-info-data-${this.compId}-${this.index}`);
|
|
30
38
|
observer.observe(obj);
|
|
31
39
|
}
|
|
32
40
|
static get is() { return "pn-stats-info-data"; }
|
|
@@ -96,25 +104,25 @@ export class PnStatsInfoData {
|
|
|
96
104
|
"reflect": false,
|
|
97
105
|
"defaultValue": "null"
|
|
98
106
|
},
|
|
99
|
-
"
|
|
100
|
-
"type": "
|
|
107
|
+
"duration": {
|
|
108
|
+
"type": "number",
|
|
101
109
|
"mutable": false,
|
|
102
110
|
"complexType": {
|
|
103
|
-
"original": "
|
|
104
|
-
"resolved": "
|
|
111
|
+
"original": "number",
|
|
112
|
+
"resolved": "number",
|
|
105
113
|
"references": {}
|
|
106
114
|
},
|
|
107
115
|
"required": false,
|
|
108
|
-
"optional":
|
|
116
|
+
"optional": true,
|
|
109
117
|
"docs": {
|
|
110
118
|
"tags": [],
|
|
111
119
|
"text": ""
|
|
112
120
|
},
|
|
113
|
-
"attribute": "
|
|
121
|
+
"attribute": "duration",
|
|
114
122
|
"reflect": false,
|
|
115
|
-
"defaultValue": "
|
|
123
|
+
"defaultValue": "1000"
|
|
116
124
|
},
|
|
117
|
-
"
|
|
125
|
+
"index": {
|
|
118
126
|
"type": "number",
|
|
119
127
|
"mutable": false,
|
|
120
128
|
"complexType": {
|
|
@@ -123,20 +131,21 @@ export class PnStatsInfoData {
|
|
|
123
131
|
"references": {}
|
|
124
132
|
},
|
|
125
133
|
"required": false,
|
|
126
|
-
"optional":
|
|
134
|
+
"optional": false,
|
|
127
135
|
"docs": {
|
|
128
136
|
"tags": [],
|
|
129
137
|
"text": ""
|
|
130
138
|
},
|
|
131
|
-
"attribute": "
|
|
139
|
+
"attribute": "index",
|
|
132
140
|
"reflect": false,
|
|
133
|
-
"defaultValue": "
|
|
141
|
+
"defaultValue": "null"
|
|
134
142
|
}
|
|
135
143
|
};
|
|
136
144
|
}
|
|
137
145
|
static get states() {
|
|
138
146
|
return {
|
|
139
|
-
"hasBeenShown": {}
|
|
147
|
+
"hasBeenShown": {},
|
|
148
|
+
"compId": {}
|
|
140
149
|
};
|
|
141
150
|
}
|
|
142
151
|
static get watchers() {
|
|
@@ -13,10 +13,20 @@ pn-stats-info .pn-stats-info__container__content {
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
|
-
padding:
|
|
16
|
+
padding: 2.4rem 2.4rem 1.6rem;
|
|
17
17
|
width: 100%;
|
|
18
18
|
background-color: #0D234B;
|
|
19
|
-
border-radius:
|
|
19
|
+
border-radius: 2.4rem;
|
|
20
|
+
}
|
|
21
|
+
@media screen and (min-width: 992px) {
|
|
22
|
+
pn-stats-info .pn-stats-info__container__content {
|
|
23
|
+
padding: 4rem 2.4rem 1.6rem;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
@media screen and (min-width: 1200px) {
|
|
27
|
+
pn-stats-info .pn-stats-info__container__content {
|
|
28
|
+
padding: 5.6rem 2.4rem 3.2rem;
|
|
29
|
+
}
|
|
20
30
|
}
|
|
21
31
|
pn-stats-info .pn-stats-info__container__content__heading {
|
|
22
32
|
color: #F06365;
|
|
@@ -38,34 +48,54 @@ pn-stats-info .pn-stats-info__container__content__data {
|
|
|
38
48
|
flex-direction: row;
|
|
39
49
|
justify-content: center;
|
|
40
50
|
flex-wrap: wrap;
|
|
41
|
-
min-height: 20rem;
|
|
42
51
|
width: 100%;
|
|
43
52
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(2n),
|
|
54
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(2n) ~ pn-stats-info-data {
|
|
55
|
+
width: 50%;
|
|
56
|
+
}
|
|
57
|
+
@media screen and (min-width: 768px) {
|
|
58
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(1) {
|
|
59
|
+
width: 100%;
|
|
60
|
+
}
|
|
61
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(2),
|
|
62
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(2) ~ pn-stats-info-data {
|
|
63
|
+
width: 50%;
|
|
64
|
+
}
|
|
65
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(3n),
|
|
66
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(3n) ~ pn-stats-info-data {
|
|
67
|
+
width: 33%;
|
|
68
|
+
}
|
|
69
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(8),
|
|
70
|
+
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-data:first-child:nth-last-child(8) ~ pn-stats-info-data {
|
|
71
|
+
width: 25%;
|
|
47
72
|
}
|
|
48
73
|
}
|
|
49
|
-
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-
|
|
50
|
-
|
|
74
|
+
pn-stats-info .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
min-height: 0;
|
|
77
|
+
padding: 2.4rem;
|
|
51
78
|
}
|
|
52
|
-
|
|
53
|
-
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-
|
|
54
|
-
|
|
79
|
+
@media screen and (min-width: 768px) {
|
|
80
|
+
pn-stats-info .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
81
|
+
min-height: 0;
|
|
82
|
+
}
|
|
55
83
|
}
|
|
56
|
-
|
|
57
|
-
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-
|
|
58
|
-
|
|
84
|
+
@media screen and (min-width: 992px) {
|
|
85
|
+
pn-stats-info .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
86
|
+
min-height: 0;
|
|
87
|
+
}
|
|
59
88
|
}
|
|
60
|
-
|
|
61
|
-
pn-stats-info .pn-stats-info__container__content__data pn-stats-info-
|
|
62
|
-
|
|
89
|
+
@media screen and (min-width: 1200px) {
|
|
90
|
+
pn-stats-info .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
91
|
+
min-height: 0;
|
|
92
|
+
}
|
|
63
93
|
}
|
|
64
94
|
|
|
65
95
|
pn-stats-info[data-stats-image=background] .pn-stats-info__container__map {
|
|
66
96
|
display: none;
|
|
67
|
-
border-top-left-radius:
|
|
68
|
-
border-bottom-left-radius:
|
|
97
|
+
border-top-left-radius: 2.4rem;
|
|
98
|
+
border-bottom-left-radius: 2.4rem;
|
|
69
99
|
}
|
|
70
100
|
@media screen and (min-width: 768px) {
|
|
71
101
|
pn-stats-info[data-stats-image=background] .pn-stats-info__container__map {
|
|
@@ -90,40 +120,31 @@ pn-stats-info[data-stats-image=background] .pn-stats-info__container__content {
|
|
|
90
120
|
display: flex;
|
|
91
121
|
flex-direction: column;
|
|
92
122
|
align-items: center;
|
|
93
|
-
padding: 2rem;
|
|
94
123
|
width: 100%;
|
|
95
124
|
background-color: #0D234B;
|
|
96
125
|
background-repeat: no-repeat;
|
|
97
126
|
background-position: bottom left;
|
|
98
127
|
background-size: 50%;
|
|
99
128
|
background-blend-mode: overlay;
|
|
100
|
-
|
|
101
|
-
border-radius: 24px;
|
|
129
|
+
border-radius: 2.4rem;
|
|
102
130
|
}
|
|
103
131
|
@media screen and (min-width: 768px) {
|
|
104
132
|
pn-stats-info[data-stats-image=background] .pn-stats-info__container__content {
|
|
105
|
-
border-top-left-radius:
|
|
106
|
-
border-bottom-left-radius:
|
|
107
|
-
max-width:
|
|
133
|
+
border-top-left-radius: 0;
|
|
134
|
+
border-bottom-left-radius: 0;
|
|
135
|
+
max-width: 54rem;
|
|
108
136
|
background-position: -999px -999px;
|
|
109
137
|
background-size: 0;
|
|
110
|
-
padding-bottom: 4rem;
|
|
111
|
-
padding-right: 4rem;
|
|
112
138
|
}
|
|
113
139
|
}
|
|
114
140
|
@media screen and (min-width: 1200px) {
|
|
115
141
|
pn-stats-info[data-stats-image=background] .pn-stats-info__container__content {
|
|
116
142
|
max-width: 100%;
|
|
117
|
-
padding-bottom: 6rem;
|
|
118
|
-
padding-right: 6rem;
|
|
119
143
|
}
|
|
120
144
|
}
|
|
121
145
|
pn-stats-info[data-stats-image=background] .pn-stats-info__container__content__data {
|
|
122
146
|
min-height: 0;
|
|
123
147
|
}
|
|
124
|
-
pn-stats-info[data-stats-image=background] .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
125
|
-
justify-content: flex-start;
|
|
126
|
-
}
|
|
127
148
|
|
|
128
149
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container {
|
|
129
150
|
flex-direction: column;
|
|
@@ -142,37 +163,39 @@ pn-stats-info[data-stats-image=image] .pn-stats-info-image-container {
|
|
|
142
163
|
position: relative;
|
|
143
164
|
}
|
|
144
165
|
pn-stats-info[data-stats-image=image] .pn-stats-info-image-container [slot=illustration] {
|
|
145
|
-
border-top-left-radius:
|
|
146
|
-
border-top-right-radius:
|
|
166
|
+
border-top-left-radius: 2.4rem;
|
|
167
|
+
border-top-right-radius: 2.4rem;
|
|
147
168
|
}
|
|
148
169
|
pn-stats-info[data-stats-image=image] .pn-stats-info-image-container [slot=illustration] > picture > img {
|
|
149
170
|
width: 100%;
|
|
150
171
|
height: auto;
|
|
151
|
-
border-top-left-radius:
|
|
152
|
-
border-top-right-radius:
|
|
172
|
+
border-top-left-radius: 2.4rem;
|
|
173
|
+
border-top-right-radius: 2.4rem;
|
|
174
|
+
border-bottom-left-radius: 0;
|
|
175
|
+
border-bottom-right-radius: 0;
|
|
153
176
|
}
|
|
154
177
|
@media screen and (min-width: 992px) {
|
|
155
178
|
pn-stats-info[data-stats-image=image] .pn-stats-info-image-container {
|
|
156
179
|
display: flex;
|
|
157
180
|
align-items: center;
|
|
158
181
|
background-color: #0D234B;
|
|
159
|
-
padding-left:
|
|
160
|
-
border-top-left-radius:
|
|
161
|
-
border-bottom-left-radius:
|
|
182
|
+
padding-left: 4rem;
|
|
183
|
+
border-top-left-radius: 2.4rem;
|
|
184
|
+
border-bottom-left-radius: 2.4rem;
|
|
162
185
|
}
|
|
163
186
|
pn-stats-info[data-stats-image=image] .pn-stats-info-image-container [slot=illustration] img {
|
|
164
187
|
clip-path: circle(50%);
|
|
165
188
|
object-fit: cover;
|
|
166
189
|
object-position: center;
|
|
167
190
|
aspect-ratio: 1;
|
|
168
|
-
max-width:
|
|
191
|
+
max-width: 45rem;
|
|
169
192
|
}
|
|
170
193
|
}
|
|
171
194
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container__content {
|
|
172
195
|
width: 100%;
|
|
173
196
|
max-width: 100%;
|
|
174
|
-
border-bottom-right-radius:
|
|
175
|
-
border-bottom-left-radius:
|
|
197
|
+
border-bottom-right-radius: 2.4rem;
|
|
198
|
+
border-bottom-left-radius: 2.4rem;
|
|
176
199
|
border-top-right-radius: 0;
|
|
177
200
|
border-top-left-radius: 0;
|
|
178
201
|
}
|
|
@@ -183,10 +206,9 @@ pn-stats-info[data-stats-image=image] .pn-stats-info__container__content {
|
|
|
183
206
|
}
|
|
184
207
|
@media screen and (min-width: 992px) {
|
|
185
208
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container__content {
|
|
186
|
-
border-top-right-radius:
|
|
187
|
-
border-bottom-right-radius:
|
|
209
|
+
border-top-right-radius: 2.4rem;
|
|
210
|
+
border-bottom-right-radius: 2.4rem;
|
|
188
211
|
border-bottom-left-radius: 0;
|
|
189
|
-
padding: 50px 25px;
|
|
190
212
|
max-width: 100%;
|
|
191
213
|
}
|
|
192
214
|
}
|
|
@@ -202,17 +224,17 @@ pn-stats-info[data-stats-image=image] .pn-stats-info__container__content__data {
|
|
|
202
224
|
}
|
|
203
225
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
204
226
|
justify-content: flex-start;
|
|
205
|
-
min-height:
|
|
227
|
+
min-height: 5.6rem;
|
|
206
228
|
}
|
|
207
229
|
@media screen and (min-width: 768px) {
|
|
208
230
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
209
|
-
min-height:
|
|
231
|
+
min-height: 5.6rem;
|
|
210
232
|
padding: 2.4rem;
|
|
211
233
|
}
|
|
212
234
|
}
|
|
213
235
|
@media screen and (min-width: 1200px) {
|
|
214
236
|
pn-stats-info[data-stats-image=image] .pn-stats-info__container__content__data .pn-stats-info-data__container {
|
|
215
|
-
min-height:
|
|
237
|
+
min-height: 5rem;
|
|
216
238
|
}
|
|
217
239
|
}
|
|
218
240
|
@media screen and (min-width: 992px) {
|
|
@@ -293,7 +315,7 @@ pn-stats-info[data-stats-image=image] .pn-stats-info__container__content__data .
|
|
|
293
315
|
}
|
|
294
316
|
@media screen and (min-width: 768px) {
|
|
295
317
|
.comboquotestatsblock pn-stats-info .pn-stats-info__container__content {
|
|
296
|
-
max-width:
|
|
318
|
+
max-width: 54rem;
|
|
297
319
|
background-position: -999px -999px;
|
|
298
320
|
background-size: 0;
|
|
299
321
|
padding-bottom: 4rem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
const mockStringArray = '[ { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }, { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 },{"preamble": "carbon dioxide emissions since 2009", "data": -44, "unit": "%", "duration": 2000 }, { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }]';
|
|
2
|
+
const mockStringArray = '[ { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }, { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 },{"preamble": "carbon dioxide emissions since 2009", "data": -44, "unit": "%", "duration": 2000 }, { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }, {"preamble": "carbon dioxide emissions since 2009", "data": -44, "unit": "%", "duration": 2000 }, { "preamble": "Million parcels", "data": 226, "unit": null, "duration": 1000 }]';
|
|
3
3
|
export class PnStatsInfo {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.heading = 'Heading';
|
|
@@ -11,13 +11,10 @@ export class PnStatsInfo {
|
|
|
11
11
|
if (newValue)
|
|
12
12
|
this.myParsedArray = JSON.parse(newValue);
|
|
13
13
|
}
|
|
14
|
-
generateUniqueID() {
|
|
15
|
-
return Date.now();
|
|
16
|
-
}
|
|
17
14
|
render() {
|
|
18
15
|
return (h(Host, null, h("div", { class: "pn-stats-info__container" }, h("div", { class: "pn-stats-info__container__map", style: { backgroundImage: `url(${this.backgroundUrl})` } }), h("div", { class: "pn-stats-info-image-container" }, h("slot", { name: "illustration" })), h("div", { class: "pn-stats-info__container__content", style: { backgroundImage: `url(${this.backgroundUrl})` } }, h("h3", { class: "pn-stats-info__container__content__heading" }, this.heading), h("div", { class: "pn-stats-info__container__content__data" }, this.myParsedArray &&
|
|
19
16
|
this.myParsedArray.map((stats, index) => {
|
|
20
|
-
return
|
|
17
|
+
return h("pn-stats-info-data", { index: index, data: stats.data, unit: stats.unit, preamble: stats.preamble, duration: stats.duration });
|
|
21
18
|
}))))));
|
|
22
19
|
}
|
|
23
20
|
static get is() { return "pn-stats-info"; }
|