@vaadin/charts 25.0.0-alpha2 → 25.0.0-alpha20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/charts",
3
- "version": "25.0.0-alpha2",
3
+ "version": "25.0.0-alpha20",
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-alpha2",
39
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
40
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
41
- "highcharts": "9.2.2",
37
+ "@vaadin/component-base": "25.0.0-alpha20",
38
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
39
+ "highcharts": "12.2.0",
42
40
  "lit": "^3.0.0"
43
41
  },
44
42
  "devDependencies": {
45
- "@vaadin/chai-plugins": "25.0.0-alpha2",
46
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
43
+ "@vaadin/chai-plugins": "25.0.0-alpha20",
44
+ "@vaadin/test-runner-commands": "25.0.0-alpha20",
47
45
  "@vaadin/testing-helpers": "^2.0.0",
48
- "sinon": "^18.0.0"
46
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha20",
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": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
54
+ "gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
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;