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/dist/wave-ui.es.js
CHANGED
|
@@ -18,6 +18,8 @@ const st = ae({
|
|
|
18
18
|
// Xl only needs a greater value than lg but starts from lg and goes to infinity.
|
|
19
19
|
},
|
|
20
20
|
css: {
|
|
21
|
+
prepend: !1,
|
|
22
|
+
// Prepend the CSS to the head instead of appending it.
|
|
21
23
|
// Generate shades for custom colors and status colors.
|
|
22
24
|
// Note: the color palette shades are always generated separately from SCSS.
|
|
23
25
|
colorShades: !0,
|
|
@@ -534,6 +536,10 @@ const pt = (e, t) => {
|
|
|
534
536
|
"d-iflex{display:inline-flex}",
|
|
535
537
|
"d-block{display:block}",
|
|
536
538
|
"d-iblock{display:inline-block}",
|
|
539
|
+
"por{position:relative}",
|
|
540
|
+
"poa{position:absolute}",
|
|
541
|
+
"pof{position:fixed}",
|
|
542
|
+
"pos{position:sticky}",
|
|
537
543
|
"text-left{text-align:left}",
|
|
538
544
|
"text-center{text-align:center}",
|
|
539
545
|
"text-right{text-align:right}",
|
|
@@ -549,6 +555,8 @@ const pt = (e, t) => {
|
|
|
549
555
|
"no-wrap{flex-wrap: nowrap}",
|
|
550
556
|
"fill-width{width:100%}",
|
|
551
557
|
"fill-height{height:100%}",
|
|
558
|
+
"h-auto{height:auto}",
|
|
559
|
+
"h-screen{height:100vh}",
|
|
552
560
|
"basis-zero{flex-basis:0}",
|
|
553
561
|
"align-start{align-items:flex-start}",
|
|
554
562
|
"align-center{align-items:center}",
|
|
@@ -592,8 +600,14 @@ const pt = (e, t) => {
|
|
|
592
600
|
if (pe = { keys: Object.keys(t.breakpoints), values: Object.values(t.breakpoints) }, !document.getElementById("wave-ui-styles")) {
|
|
593
601
|
const i = document.createElement("style");
|
|
594
602
|
i.id = "wave-ui-styles", i.innerHTML = yt(t);
|
|
595
|
-
const s = document.head.querySelectorAll('style,link[rel="stylesheet"]')
|
|
596
|
-
|
|
603
|
+
const s = document.head.querySelectorAll('style,link[rel="stylesheet"]');
|
|
604
|
+
if (t.css.prependCss) {
|
|
605
|
+
const n = s[0];
|
|
606
|
+
n ? n.before(i) : document.head.prepend(i);
|
|
607
|
+
} else {
|
|
608
|
+
const n = s[s.length - 1];
|
|
609
|
+
n ? n.after(i) : document.head.appendChild(i);
|
|
610
|
+
}
|
|
597
611
|
}
|
|
598
612
|
Ve(e), window.addEventListener("resize", () => Ve(e));
|
|
599
613
|
}, bt = (e, t, i) => {
|
|
@@ -3314,7 +3328,9 @@ function pl(e, t, i, s, n, l) {
|
|
|
3314
3328
|
const a = V("w-progress");
|
|
3315
3329
|
return o(), b(R(l.wrapperTag), {
|
|
3316
3330
|
class: f(["w-image", l.wrapperClasses]),
|
|
3317
|
-
|
|
3331
|
+
ref: "imageWrap",
|
|
3332
|
+
style: x(l.wrapperStyles),
|
|
3333
|
+
onError: t[0] || (t[0] = (r) => n.error = !0)
|
|
3318
3334
|
}, {
|
|
3319
3335
|
default: m(() => [
|
|
3320
3336
|
L(P, {
|
|
@@ -3359,7 +3375,7 @@ function pl(e, t, i, s, n, l) {
|
|
|
3359
3375
|
}, null, 10, cl)) : p("", !0)
|
|
3360
3376
|
]),
|
|
3361
3377
|
_: 3
|
|
3362
|
-
},
|
|
3378
|
+
}, 40, ["class", "style"]);
|
|
3363
3379
|
}
|
|
3364
3380
|
const fl = {
|
|
3365
3381
|
name: "w-image",
|
|
@@ -3389,6 +3405,7 @@ const fl = {
|
|
|
3389
3405
|
return {
|
|
3390
3406
|
loading: !1,
|
|
3391
3407
|
loaded: !1,
|
|
3408
|
+
error: !1,
|
|
3392
3409
|
// The computed image source, and real image dimensions.
|
|
3393
3410
|
computedImg: {
|
|
3394
3411
|
src: "",
|
|
@@ -3417,7 +3434,8 @@ const fl = {
|
|
|
3417
3434
|
return {
|
|
3418
3435
|
"w-image--absolute": this.absolute,
|
|
3419
3436
|
"w-image--fixed": this.fixed,
|
|
3420
|
-
"w-image--has-ratio": this.normalized.ratio
|
|
3437
|
+
"w-image--has-ratio": this.normalized.ratio,
|
|
3438
|
+
"w-image--error": this.error
|
|
3421
3439
|
};
|
|
3422
3440
|
},
|
|
3423
3441
|
wrapperStyles() {
|
|
@@ -3451,7 +3469,7 @@ const fl = {
|
|
|
3451
3469
|
return this.loading = !0, this.loaded = !1, this.$emit("loading", e ? this.fallback : this.src), new Promise((t) => {
|
|
3452
3470
|
const i = new Image();
|
|
3453
3471
|
i.onload = (s) => (this.computedImg.width = s.target.width, this.computedImg.height = s.target.height, this.computedImg.ratio = s.target.height / s.target.width, this.loading = !1, this.loaded = !0, this.computedImg.src = e ? this.fallback : this.src, this.$emit("loaded", this.computedImg.src), t(i)), i.onerror = (s) => {
|
|
3454
|
-
this.$emit("error", s), this.fallback && !e ? (this.loading = !1, this.loadImage(!0)) : (this.loading = !1, this.loaded = !1);
|
|
3472
|
+
this.error = !0, this.$emit("error", s, this.$refs.imageWrap), this.fallback && !e ? (this.loading = !1, this.loadImage(!0)) : (this.loading = !1, this.loaded = !1);
|
|
3455
3473
|
}, i.src = e ? this.fallback : this.src;
|
|
3456
3474
|
});
|
|
3457
3475
|
}
|