@vaadin/charts 23.6.5 → 23.6.7
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 +6 -6
- package/src/highcharts-patches.js +68 -0
- package/src/vaadin-chart.js +1 -0
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/charts",
|
|
3
|
-
"version": "23.6.
|
|
3
|
+
"version": "23.6.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/component-base": "~23.6.
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "~23.6.
|
|
41
|
-
"@vaadin/vaadin-material-styles": "~23.6.
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "~23.6.
|
|
39
|
+
"@vaadin/component-base": "~23.6.7",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "~23.6.7",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "~23.6.7",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "~23.6.7",
|
|
43
43
|
"highcharts": "9.2.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"web-types.json",
|
|
53
53
|
"web-types.lit.json"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "add0b5d410d6f749c901f7b86502cc6b9debf786"
|
|
56
56
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2024 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 Highcharts from 'highcharts/es-modules/masters/highstock.src.js';
|
|
12
|
+
|
|
13
|
+
// TODO: Remove when upgrading Highcharts, see vaadin/web-components#12213
|
|
14
|
+
|
|
15
|
+
const { Chart, Point } = Highcharts;
|
|
16
|
+
|
|
17
|
+
const RESERVED_KEYS = ['__proto__', 'constructor'];
|
|
18
|
+
|
|
19
|
+
const isReservedKey = (key) => RESERVED_KEYS.includes(key);
|
|
20
|
+
|
|
21
|
+
const UNSUPPORTED_SCHEMES = ['javascript', 'vbscript', 'data'];
|
|
22
|
+
|
|
23
|
+
const isUnsupportedLink = (value) => {
|
|
24
|
+
if (typeof value !== 'string') {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
// The URL parser normalizes case and whitespace the same way as navigation does
|
|
29
|
+
return UNSUPPORTED_SCHEMES.includes(new URL(value, document.baseURI).protocol.slice(0, -1));
|
|
30
|
+
} catch (_) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/* eslint-disable no-invalid-this, prefer-arrow-callback */
|
|
36
|
+
|
|
37
|
+
// Skip reserved option names in point objects
|
|
38
|
+
Highcharts.wrap(Point.prototype, 'optionsToObject', function (proceed, options) {
|
|
39
|
+
if (
|
|
40
|
+
options &&
|
|
41
|
+
typeof options === 'object' &&
|
|
42
|
+
!Array.isArray(options) &&
|
|
43
|
+
RESERVED_KEYS.some((key) => Object.prototype.hasOwnProperty.call(options, key))
|
|
44
|
+
) {
|
|
45
|
+
options = Object.fromEntries(Object.entries(options).filter(([key]) => !isReservedKey(key)));
|
|
46
|
+
}
|
|
47
|
+
return proceed.call(this, options);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Skip reserved path segments in point keys
|
|
51
|
+
Highcharts.wrap(Point.prototype, 'setNestedProperty', function (proceed, object, value, key) {
|
|
52
|
+
if (String(key).split('.').some(isReservedKey)) {
|
|
53
|
+
return object;
|
|
54
|
+
}
|
|
55
|
+
return proceed.call(this, object, value, key);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Ignore credits links that use an unsupported URL scheme
|
|
59
|
+
Highcharts.wrap(Chart.prototype, 'addCredits', function (proceed, credits) {
|
|
60
|
+
const options = Highcharts.merge(true, this.options.credits, credits);
|
|
61
|
+
if (options?.href && isUnsupportedLink(options.href)) {
|
|
62
|
+
Highcharts.error(33, false, this, { 'Invalid attribute in config': 'credits.href' });
|
|
63
|
+
delete options.href;
|
|
64
|
+
}
|
|
65
|
+
return proceed.call(this, options);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/* eslint-enable no-invalid-this, prefer-arrow-callback */
|
package/src/vaadin-chart.js
CHANGED
|
@@ -25,6 +25,7 @@ import 'highcharts/es-modules/masters/modules/timeline.src.js';
|
|
|
25
25
|
import 'highcharts/es-modules/masters/modules/organization.src.js';
|
|
26
26
|
import 'highcharts/es-modules/masters/modules/xrange.src.js';
|
|
27
27
|
import 'highcharts/es-modules/masters/modules/bullet.src.js';
|
|
28
|
+
import './highcharts-patches.js';
|
|
28
29
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
29
30
|
import { beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
30
31
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
package/web-types.json
CHANGED