Skip to content

Commit 1020b8e

Browse files
author
Marko Petzold
committed
chore: update package dependencies and scripts
- Updated dependencies in package.json for improved stability and features. - Changed the start script to run concurrently with watch and wds. - Modified the release script to include build and type generation steps. - Updated devDependencies for eslint, prettier, and rollup to their latest versions. feat: enhance default data structure - Added title and subtitle fields to default-data.json for better context. feat: improve widget value component - Introduced theme support in widget-value.ts to allow dynamic styling. - Updated rendering logic to apply theme colors for background, title, and subtitle. - Refactored styles to remove hardcoded colors and utilize theme properties.
1 parent a05e9b5 commit 1020b8e

7 files changed

Lines changed: 1414 additions & 637 deletions

File tree

demo/index.html

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
padding: 0;
1111
width: 100%;
1212
height: 100%;
13+
background-color: aliceblue;
1314
}
1415

1516
* {
@@ -25,23 +26,27 @@
2526

2627
<script type="module">
2728
import { html, render } from 'lit'
28-
import '../dist/src/widget-value.js'
29-
const response = await fetch('../src/default-data.json')
30-
const data = await response.json()
31-
29+
import '../dist/widget-value.js'
30+
const data = await fetch('../src/default-data.json').then((res) => res.json())
31+
const themeObject = await fetch('themes/chalk.json').then((res) => res.json())
32+
const theme = { theme_name: 'chalk', theme_object: themeObject }
33+
render(
34+
html`
35+
<widget-value-1.1.7 .theme="${theme}" .inputData=${data}>
36+
web component is not registered. Make sure to use the tag with the correct version
37+
string from the package.json
38+
</widget-value-1.1.7>
39+
`,
40+
document.getElementById('demo')
41+
)
42+
const widget = document.getElementById('demo').children[0]
3243
const keyPathsToRandomize = ['dataseries.0.data.0.value', 'settings.title']
33-
setInterval(() => {
44+
const inter = setInterval(() => {
3445
const randomizedObj = randomizeObjectValues(data, keyPathsToRandomize)
3546

36-
// console.log('random', randomizedObj.dataseries[0].data[0]);
37-
render(
38-
html`
39-
<widget-value-versionplaceholder .inputData=${randomizedObj}>
40-
some light-dom
41-
</widget-value-versionplaceholder>
42-
`,
43-
document.querySelector('#demo')
44-
)
47+
// console.log('random', randomizedObj.dataseries[0].data[0])
48+
widget.inputData = randomizedObj
49+
// clearInterval(inter)
4550
}, 1000)
4651
</script>
4752
</body>

0 commit comments

Comments
 (0)