@vaadin/charts 25.0.0-alpha9 → 25.0.0-beta2
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/package.json +9 -12
- package/src/helpers.js +46 -0
- package/src/styles/vaadin-chart-base-styles.js +488 -310
- package/src/vaadin-chart-mixin.d.ts +9 -2
- package/src/vaadin-chart-mixin.js +137 -73
- package/src/vaadin-chart-series.d.ts +11 -11
- package/src/vaadin-chart-series.js +11 -11
- package/src/vaadin-chart.d.ts +46 -67
- package/src/vaadin-chart.js +50 -69
- package/vaadin-chart.js +1 -1
- package/web-types.json +9 -5
- package/web-types.lit.json +12 -5
- package/src/styles/vaadin-chart-core-styles.d.ts +0 -13
- package/src/styles/vaadin-chart-core-styles.js +0 -1063
- package/theme/lumo/vaadin-chart-styles.d.ts +0 -5
- package/theme/lumo/vaadin-chart-styles.js +0 -96
- package/theme/lumo/vaadin-chart.d.ts +0 -2
- package/theme/lumo/vaadin-chart.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/charts",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/styles/*-base-styles.d.ts",
|
|
25
|
-
"!src/styles/*-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -37,22 +34,22 @@
|
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/component-base": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-
|
|
42
|
-
"
|
|
43
|
-
"highcharts": "9.2.2",
|
|
37
|
+
"@vaadin/component-base": "25.0.0-beta2",
|
|
38
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta2",
|
|
39
|
+
"highcharts": "12.2.0",
|
|
44
40
|
"lit": "^3.0.0"
|
|
45
41
|
},
|
|
46
42
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
43
|
+
"@vaadin/chai-plugins": "25.0.0-beta2",
|
|
44
|
+
"@vaadin/test-runner-commands": "25.0.0-beta2",
|
|
49
45
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta2",
|
|
47
|
+
"sinon": "^21.0.0"
|
|
51
48
|
},
|
|
52
49
|
"cvdlName": "vaadin-chart",
|
|
53
50
|
"web-types": [
|
|
54
51
|
"web-types.json",
|
|
55
52
|
"web-types.lit.json"
|
|
56
53
|
],
|
|
57
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e078f8371ae266f05c7ca1ec25686cc489c83f24"
|
|
58
55
|
}
|
package/src/helpers.js
CHANGED
|
@@ -57,3 +57,49 @@ export function deepMerge(target, source) {
|
|
|
57
57
|
|
|
58
58
|
return target;
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
export function prepareExport(chart) {
|
|
62
|
+
// Guard against another print 'before print' event coming before
|
|
63
|
+
// the 'after print' event.
|
|
64
|
+
if (!chart.tempBodyStyle) {
|
|
65
|
+
let effectiveCss = '';
|
|
66
|
+
|
|
67
|
+
// LitElement uses `adoptedStyleSheets` for adding styles
|
|
68
|
+
if (chart.shadowRoot.adoptedStyleSheets) {
|
|
69
|
+
chart.shadowRoot.adoptedStyleSheets.forEach((sheet) => {
|
|
70
|
+
effectiveCss += `${[...sheet.cssRules].map((rule) => rule.cssText).join('\n')}\n`;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Strip off host selectors that target individual instances
|
|
75
|
+
effectiveCss = effectiveCss.replace(/:host\(.+?\)/gu, (match) => {
|
|
76
|
+
const selector = match.substr(6, match.length - 7);
|
|
77
|
+
return chart.matches(selector) ? '' : match;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Zoom out a bit to avoid clipping the chart's edge on paper
|
|
81
|
+
effectiveCss =
|
|
82
|
+
`${effectiveCss}body {` +
|
|
83
|
+
` -moz-transform: scale(0.9, 0.9);` + // Mozilla
|
|
84
|
+
` zoom: 0.9;` + // Others
|
|
85
|
+
` zoom: 90%;` + // Webkit
|
|
86
|
+
`}`;
|
|
87
|
+
|
|
88
|
+
chart.tempBodyStyle = document.createElement('style');
|
|
89
|
+
chart.tempBodyStyle.textContent = effectiveCss;
|
|
90
|
+
document.body.appendChild(chart.tempBodyStyle);
|
|
91
|
+
if (chart.options.chart.styledMode) {
|
|
92
|
+
document.body.setAttribute('styled-mode', '');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function cleanupExport(chart) {
|
|
98
|
+
if (chart.tempBodyStyle) {
|
|
99
|
+
document.body.removeChild(chart.tempBodyStyle);
|
|
100
|
+
delete chart.tempBodyStyle;
|
|
101
|
+
if (chart.options.chart.styledMode) {
|
|
102
|
+
document.body.removeAttribute('styled-mode');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|