wave-ui 3.0.0 → 3.0.2
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/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.es.js +361 -363
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/core.js +11 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
package/src/wave-ui/core.js
CHANGED
|
@@ -56,7 +56,7 @@ export default class WaveUI {
|
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
// Callable from this.$waveui.
|
|
59
|
-
switchTheme (theme) {
|
|
59
|
+
switchTheme (theme, skipFlatten = false) {
|
|
60
60
|
this.theme = theme
|
|
61
61
|
document.documentElement.setAttribute('data-theme', theme)
|
|
62
62
|
document.head.querySelector('#wave-ui-colors')?.remove?.()
|
|
@@ -104,12 +104,9 @@ export default class WaveUI {
|
|
|
104
104
|
wApp.classList.add('w-app')
|
|
105
105
|
|
|
106
106
|
let themeColors = config.colors[config.theme]
|
|
107
|
-
if (config.theme === 'auto')
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
$waveui.colors = flattenColors(themeColors, colorPalette)
|
|
111
|
-
}
|
|
112
|
-
injectColorsCSSInDOM(themeColors)
|
|
107
|
+
if (config.theme === 'auto') detectOSDarkMode($waveui) // Also switches the theme.
|
|
108
|
+
else switchTheme(config.theme, true)
|
|
109
|
+
|
|
113
110
|
injectCSSInDOM($waveui)
|
|
114
111
|
injectNotifManagerInDOM(wApp, components, $waveui)
|
|
115
112
|
|
|
@@ -134,11 +131,13 @@ export default class WaveUI {
|
|
|
134
131
|
if (!options.theme) options.theme = 'light'
|
|
135
132
|
// Move colors inside a theme if there are option.colors without theme.
|
|
136
133
|
// E.g. colors: { primary, ... } & not colors: { light { primary, ... }, dark: { primary, ... } })
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
if (options.colors) {
|
|
135
|
+
const colors = { ...options.colors }
|
|
136
|
+
if (!options.colors.light) options.colors.light = colors
|
|
137
|
+
if (!options.colors.dark) options.colors.dark = colors
|
|
138
|
+
// Cleanup anything else than themes in config.colors.
|
|
139
|
+
options.colors = { light: options.colors.light, dark: options.colors.dark }
|
|
140
|
+
}
|
|
142
141
|
|
|
143
142
|
// Merge user options into the default config.
|
|
144
143
|
let { components, ...config } = options
|