wave-ui 3.23.1 → 3.25.0
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.css +1 -1
- package/dist/wave-ui.es.js +24 -6
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-image.vue +11 -3
- package/src/wave-ui/scss/_layout.scss +5 -0
- package/src/wave-ui/utils/config.js +1 -0
- package/src/wave-ui/utils/dynamic-css.js +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0",
|
|
4
4
|
"description": "A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
component.w-image(
|
|
2
|
+
component.w-image(
|
|
3
|
+
:is="wrapperTag"
|
|
4
|
+
ref="imageWrap"
|
|
5
|
+
:class="wrapperClasses"
|
|
6
|
+
:style="wrapperStyles"
|
|
7
|
+
@error="error = true")
|
|
3
8
|
transition(:name="transition" appear)
|
|
4
9
|
component.w-image__image(
|
|
5
10
|
v-if="loaded"
|
|
@@ -60,6 +65,7 @@ export default {
|
|
|
60
65
|
return {
|
|
61
66
|
loading: false,
|
|
62
67
|
loaded: false,
|
|
68
|
+
error: false,
|
|
63
69
|
// The computed image source, and real image dimensions.
|
|
64
70
|
computedImg: {
|
|
65
71
|
src: '',
|
|
@@ -92,7 +98,8 @@ export default {
|
|
|
92
98
|
return {
|
|
93
99
|
'w-image--absolute': this.absolute,
|
|
94
100
|
'w-image--fixed': this.fixed,
|
|
95
|
-
'w-image--has-ratio': this.normalized.ratio
|
|
101
|
+
'w-image--has-ratio': this.normalized.ratio,
|
|
102
|
+
'w-image--error': this.error
|
|
96
103
|
}
|
|
97
104
|
},
|
|
98
105
|
|
|
@@ -160,7 +167,8 @@ export default {
|
|
|
160
167
|
return resolve(img)
|
|
161
168
|
}
|
|
162
169
|
img.onerror = error => {
|
|
163
|
-
this
|
|
170
|
+
this.error = true
|
|
171
|
+
this.$emit('error', error, this.$refs.imageWrap)
|
|
164
172
|
// If a fallback is provided & not already trying to load it, load the fallback src.
|
|
165
173
|
if (this.fallback && !loadFallback) {
|
|
166
174
|
this.loading = false
|
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
.ovv {overflow: visible;}
|
|
60
60
|
.ova {overflow: auto;}
|
|
61
61
|
|
|
62
|
+
.por {position: relative;}
|
|
63
|
+
.poa {position: absolute;}
|
|
64
|
+
.pof {position: fixed;}
|
|
65
|
+
.pos {position: sticky;}
|
|
66
|
+
|
|
62
67
|
.op05 {opacity: 0.05;}
|
|
63
68
|
@for $i from 0 through 9 {
|
|
64
69
|
.op#{$i} {opacity: $i * 0.1;}
|
|
@@ -10,6 +10,7 @@ const config = reactive({
|
|
|
10
10
|
xl: 9999 // Xl only needs a greater value than lg but starts from lg and goes to infinity.
|
|
11
11
|
},
|
|
12
12
|
css: {
|
|
13
|
+
prepend: false, // Prepend the CSS to the head instead of appending it.
|
|
13
14
|
// Generate shades for custom colors and status colors.
|
|
14
15
|
// Note: the color palette shades are always generated separately from SCSS.
|
|
15
16
|
colorShades: true,
|
|
@@ -156,6 +156,10 @@ const genBreakpointLayoutClasses = breakpoints => {
|
|
|
156
156
|
'd-iflex{display:inline-flex}',
|
|
157
157
|
'd-block{display:block}',
|
|
158
158
|
'd-iblock{display:inline-block}',
|
|
159
|
+
'por{position:relative}',
|
|
160
|
+
'poa{position:absolute}',
|
|
161
|
+
'pof{position:fixed}',
|
|
162
|
+
'pos{position:sticky}',
|
|
159
163
|
'text-left{text-align:left}',
|
|
160
164
|
'text-center{text-align:center}',
|
|
161
165
|
'text-right{text-align:right}',
|
|
@@ -171,6 +175,8 @@ const genBreakpointLayoutClasses = breakpoints => {
|
|
|
171
175
|
'no-wrap{flex-wrap: nowrap}',
|
|
172
176
|
'fill-width{width:100%}',
|
|
173
177
|
'fill-height{height:100%}',
|
|
178
|
+
'h-auto{height:auto}',
|
|
179
|
+
'h-screen{height:100vh}',
|
|
174
180
|
'basis-zero{flex-basis:0}',
|
|
175
181
|
'align-start{align-items:flex-start}',
|
|
176
182
|
'align-center{align-items:center}',
|
|
@@ -265,9 +271,18 @@ export const injectCSSInDOM = $waveui => {
|
|
|
265
271
|
css.id = 'wave-ui-styles'
|
|
266
272
|
css.innerHTML = doDynamicCSS(config)
|
|
267
273
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
274
|
+
// Prepend or append the CSS to the head based on the config.css.prependCss option.
|
|
275
|
+
const stylesheets = document.head.querySelectorAll('style,link[rel="stylesheet"]')
|
|
276
|
+
if (config.css.prependCss) {
|
|
277
|
+
const firstStyle = stylesheets[0]
|
|
278
|
+
if (firstStyle) firstStyle.before(css)
|
|
279
|
+
else document.head.prepend(css)
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
const lastStyle = stylesheets[stylesheets.length - 1]
|
|
283
|
+
if (lastStyle) lastStyle.after(css)
|
|
284
|
+
else document.head.appendChild(css)
|
|
285
|
+
}
|
|
271
286
|
}
|
|
272
287
|
|
|
273
288
|
getBreakpoint($waveui)
|