@vaadin/charts 25.0.0-alpha2 → 25.0.0-alpha21
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 -10
- package/src/helpers.js +57 -0
- package/src/styles/vaadin-chart-base-styles.d.ts +13 -0
- package/src/styles/vaadin-chart-base-styles.js +1402 -0
- package/src/vaadin-chart-mixin.d.ts +9 -2
- package/src/vaadin-chart-mixin.js +127 -72
- package/src/vaadin-chart-series.d.ts +11 -11
- package/src/vaadin-chart-series.js +11 -11
- package/src/vaadin-chart.d.ts +46 -72
- package/src/vaadin-chart.js +59 -85
- package/vaadin-chart.js +1 -1
- package/web-types.json +9 -5
- package/web-types.lit.json +12 -5
- package/theme/lumo/vaadin-chart-styles.d.ts +0 -6
- package/theme/lumo/vaadin-chart-styles.js +0 -97
- package/theme/lumo/vaadin-chart.d.ts +0 -2
- package/theme/lumo/vaadin-chart.js +0 -2
- package/theme/vaadin-chart-base-theme.js +0 -1062
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-alpha21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"theme",
|
|
25
24
|
"vaadin-*.d.ts",
|
|
26
25
|
"vaadin-*.js",
|
|
27
26
|
"web-types.json",
|
|
@@ -35,22 +34,22 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/component-base": "25.0.0-
|
|
39
|
-
"@vaadin/vaadin-
|
|
40
|
-
"
|
|
41
|
-
"highcharts": "9.2.2",
|
|
37
|
+
"@vaadin/component-base": "25.0.0-alpha21",
|
|
38
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha21",
|
|
39
|
+
"highcharts": "12.2.0",
|
|
42
40
|
"lit": "^3.0.0"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
46
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
43
|
+
"@vaadin/chai-plugins": "25.0.0-alpha21",
|
|
44
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha21",
|
|
47
45
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
48
|
-
"
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha21",
|
|
47
|
+
"sinon": "^21.0.0"
|
|
49
48
|
},
|
|
50
49
|
"cvdlName": "vaadin-chart",
|
|
51
50
|
"web-types": [
|
|
52
51
|
"web-types.json",
|
|
53
52
|
"web-types.lit.json"
|
|
54
53
|
],
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "8fb9e9710c01449edf623a1aaac4655cdc11a933"
|
|
56
55
|
}
|
package/src/helpers.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
|
|
1
12
|
export function inflateFunctions(config) {
|
|
2
13
|
if (Array.isArray(config)) {
|
|
3
14
|
config.forEach(inflateFunctions);
|
|
@@ -46,3 +57,49 @@ export function deepMerge(target, source) {
|
|
|
46
57
|
|
|
47
58
|
return target;
|
|
48
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
import type { CSSResult } from 'lit';
|
|
12
|
+
|
|
13
|
+
export const chartStyles: CSSResult;
|