@sit-onyx/chartjs-plugin 1.0.0-beta.292 → 1.0.0-beta.294
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 +8 -8
- package/src/plugin.ts +2 -1
- package/src/utils.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/chartjs-plugin",
|
|
3
3
|
"description": "A Chart.js plugin for the onyx design system created by Schwarz IT",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.294",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Schwarz IT KG",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"chart.js": ">= 4.0.0",
|
|
30
|
-
"sit-onyx": "^1.0.0-beta.
|
|
30
|
+
"sit-onyx": "^1.0.0-beta.306"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@playwright/experimental-ct-vue": "1.
|
|
34
|
-
"@playwright/test": "1.
|
|
35
|
-
"@vue/compiler-dom": "3.5.
|
|
33
|
+
"@playwright/experimental-ct-vue": "1.55.0",
|
|
34
|
+
"@playwright/test": "1.55.0",
|
|
35
|
+
"@vue/compiler-dom": "3.5.20",
|
|
36
36
|
"chart.js": "4.5.0",
|
|
37
|
-
"vue": "3.5.
|
|
37
|
+
"vue": "3.5.20",
|
|
38
38
|
"vue-chartjs": "^5.3.2",
|
|
39
39
|
"@sit-onyx/shared": "^1.0.0-beta.4",
|
|
40
|
-
"
|
|
41
|
-
"sit-onyx": "^1.0.0-beta.
|
|
40
|
+
"sit-onyx": "^1.0.0-beta.306",
|
|
41
|
+
"@sit-onyx/storybook-utils": "^1.0.0-beta.103"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"dev": "storybook dev -p 6006 --no-open",
|
package/src/plugin.ts
CHANGED
|
@@ -146,6 +146,7 @@ const plugin: Plugin<ChartType, undefined> = {
|
|
|
146
146
|
*/
|
|
147
147
|
afterInit: (chart) => {
|
|
148
148
|
const darkModeObserver = new MutationObserver((mutations) => {
|
|
149
|
+
if (!mutations[0]) return;
|
|
149
150
|
const oldClasses = mutations[0].oldValue ?? "";
|
|
150
151
|
const newClasses = (mutations[0].target as HTMLElement).className;
|
|
151
152
|
|
|
@@ -214,7 +215,7 @@ const COLORS = QUANTITATIVE_COLOR_STEPS.map(
|
|
|
214
215
|
/**
|
|
215
216
|
* Gets a border color.
|
|
216
217
|
*/
|
|
217
|
-
const getBorderColor = (i: number) => getCSSVariableValue(COLORS[i % COLORS.length]);
|
|
218
|
+
const getBorderColor = (i: number) => getCSSVariableValue(COLORS[i % COLORS.length]!);
|
|
218
219
|
|
|
219
220
|
/**
|
|
220
221
|
* Gets a background color (same as border color + 30% transparency).
|
package/src/utils.ts
CHANGED
|
@@ -46,7 +46,7 @@ export const getCSSVariableValue = (variableName: string): string => {
|
|
|
46
46
|
const lightDarkMatch = /^light-dark\(([^,]+),\s*([^)]+)\)$/.exec(computedValue);
|
|
47
47
|
|
|
48
48
|
if (lightDarkMatch) {
|
|
49
|
-
return lightDarkMatch[isDark ? 2 : 1]
|
|
49
|
+
return lightDarkMatch[isDark ? 2 : 1]!.trim();
|
|
50
50
|
} else {
|
|
51
51
|
return computedValue;
|
|
52
52
|
}
|