@everymatrix/ui-image 0.2.1 → 1.62.3
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/cjs/index.cjs.js +1 -1
- package/dist/cjs/{ui-image-008021e8.js → ui-image-35abc002.js} +2 -1
- package/dist/cjs/ui-image_2.cjs.entry.js +1 -1
- package/dist/collection/components/ui-image/ui-image.js +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{ui-image-3911756b.js → ui-image-7da92f1f.js} +2 -1
- package/dist/esm/ui-image_2.entry.js +1 -1
- package/dist/ui-image/index.esm.js +1 -1
- package/dist/ui-image/{p-40c68e79.entry.js → p-53050e17.entry.js} +1 -1
- package/dist/ui-image/p-8bd751b6.js +1 -0
- package/dist/ui-image/ui-image.esm.js +1 -1
- package/package.json +2 -2
- package/dist/ui-image/p-de18b4b5.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -26,6 +26,7 @@ const UiImage = class {
|
|
|
26
26
|
if (this.image) {
|
|
27
27
|
this.image.src = this.src;
|
|
28
28
|
this.imgLoaded = true;
|
|
29
|
+
preloadedImage.onload = null;
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
preloadedImage.src = this.src;
|
|
@@ -55,7 +56,7 @@ const UiImage = class {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
render() {
|
|
58
|
-
return (index.h(index.Host, { key: '
|
|
59
|
+
return (index.h(index.Host, { key: 'f506ba73852f257ad80bf59ca177d2065a5f365e', class: "HostContainer" }, !this.imgLoaded && (index.h("ui-skeleton", { key: '564ebfab701f827ddc2debccb7615926dbc9e876', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), index.h("img", { key: '2188ca4494c10587f064acc5459ffc468948f497', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
59
60
|
}
|
|
60
61
|
get el() { return index.getElement(this); }
|
|
61
62
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const uiImage = require('./ui-image-
|
|
5
|
+
const uiImage = require('./ui-image-35abc002.js');
|
|
6
6
|
const index = require('./index-e835971b.js');
|
|
7
7
|
|
|
8
8
|
const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
@@ -20,6 +20,7 @@ export class UiImage {
|
|
|
20
20
|
if (this.image) {
|
|
21
21
|
this.image.src = this.src;
|
|
22
22
|
this.imgLoaded = true;
|
|
23
|
+
preloadedImage.onload = null;
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
preloadedImage.src = this.src;
|
|
@@ -49,7 +50,7 @@ export class UiImage {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: 'f506ba73852f257ad80bf59ca177d2065a5f365e', class: "HostContainer" }, !this.imgLoaded && (h("ui-skeleton", { key: '564ebfab701f827ddc2debccb7615926dbc9e876', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { key: '2188ca4494c10587f064acc5459ffc468948f497', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
53
54
|
}
|
|
54
55
|
static get is() { return "ui-image"; }
|
|
55
56
|
static get originalStyleUrls() {
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { U as UiImage } from './ui-image-
|
|
1
|
+
export { U as UiImage } from './ui-image-7da92f1f.js';
|
|
2
2
|
import './index-97d17652.js';
|
|
@@ -24,6 +24,7 @@ const UiImage = class {
|
|
|
24
24
|
if (this.image) {
|
|
25
25
|
this.image.src = this.src;
|
|
26
26
|
this.imgLoaded = true;
|
|
27
|
+
preloadedImage.onload = null;
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
preloadedImage.src = this.src;
|
|
@@ -53,7 +54,7 @@ const UiImage = class {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
render() {
|
|
56
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: 'f506ba73852f257ad80bf59ca177d2065a5f365e', class: "HostContainer" }, !this.imgLoaded && (h("ui-skeleton", { key: '564ebfab701f827ddc2debccb7615926dbc9e876', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { key: '2188ca4494c10587f064acc5459ffc468948f497', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
57
58
|
}
|
|
58
59
|
get el() { return getElement(this); }
|
|
59
60
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as ui_image } from './ui-image-
|
|
1
|
+
export { U as ui_image } from './ui-image-7da92f1f.js';
|
|
2
2
|
import { r as registerInstance, h, H as Host } from './index-97d17652.js';
|
|
3
3
|
|
|
4
4
|
const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{U as UiImage}from"./p-
|
|
1
|
+
export{U as UiImage}from"./p-8bd751b6.js";import"./p-381d4568.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{U as ui_image}from"./p-
|
|
1
|
+
export{U as ui_image}from"./p-8bd751b6.js";import{r as e,h as t,H as n}from"./p-381d4568.js";const o=class{constructor(t){e(this,t),this.structure=void 0,this.width=void 0,this.height=void 0,this.borderRadius=void 0,this.marginBottom=void 0,this.marginTop=void 0,this.marginLeft=void 0,this.marginRight=void 0,this.animation=!0,this.rows=void 0,this.size=void 0,this.color=void 0,this.primaryColor=void 0,this.secondaryColor=void 0}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.width};\n --emw-skeleton-logo-height: ${this.height};\n --emw-skeleton-logo-border-radius: ${this.borderRadius}px;\n --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-logo-margin-top: ${this.marginTop}px;\n --emw-skeleton-logo-margin-left: ${this.marginLeft}px;\n --emw-skeleton-logo-margin-right: ${this.marginRight}px;\n --emw-skeleton-logo-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.width};\n --emw-skeleton-image-height: ${this.height};\n --emw-skeleton-image-border-radius: ${this.borderRadius}px;\n --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-image-margin-top: ${this.marginTop}px;\n --emw-skeleton-image-margin-left: ${this.marginLeft}px;\n --emw-skeleton-image-margin-right: ${this.marginRight}px;\n --emw-skeleton-image-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.width};\n --emw-skeleton-title-height: ${this.height};\n --emw-skeleton-title-border-radius: ${this.borderRadius}px;\n --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-title-margin-top: ${this.marginTop}px;\n --emw-skeleton-title-margin-left: ${this.marginLeft}px;\n --emw-skeleton-title-margin-right: ${this.marginRight}px;\n --emw-skeleton-title-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.width};\n --emw-skeleton-text-height: ${this.height};\n --emw-skeleton-text-border-radius: ${this.borderRadius}px;\n --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-text-margin-top: ${this.marginTop}px;\n --emw-skeleton-text-margin-left: ${this.marginLeft}px;\n --emw-skeleton-text-margin-right: ${this.marginRight}px;\n --emw-skeleton-text-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.width};\n --emw-skeleton-rectangle-height: ${this.height};\n --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;\n --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;\n --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;\n --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;\n --emw-skeleton-rectangle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.size};\n --emw-skeleton-circle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;default:e=""}return t(n,{key:"3bb792a149db7fe732d5cbfa092cdb4d6ca0689e"},t("style",{key:"a4607599b60659f385ae2660513e38b383739674"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};o.style=":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";export{o as ui_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as t,H as s,g as e}from"./p-381d4568.js";const n=class{constructor(t){i(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const i=new Image;i.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0,i.onload=null)},i.src=this.src}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const t=i.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(i.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t(s,{key:"f506ba73852f257ad80bf59ca177d2065a5f365e",class:"HostContainer"},!this.imgLoaded&&t("ui-skeleton",{key:"564ebfab701f827ddc2debccb7615926dbc9e876",class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{key:"2188ca4494c10587f064acc5459ffc468948f497",ref:i=>this.image=i,src:this.shouldLoad?this.src:void 0,onLoad:()=>this.imgLoaded=!0,style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}get el(){return e(this)}static get watchers(){return{src:["handleSrc"]}}};n.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";export{n as U}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,b as t}from"./p-381d4568.js";export{s as setNonce}from"./p-381d4568.js";import{g as o}from"./p-e1255160.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),r(o)})().then((async r=>(await o(),t([["p-
|
|
1
|
+
import{p as r,b as t}from"./p-381d4568.js";export{s as setNonce}from"./p-381d4568.js";import{g as o}from"./p-e1255160.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),r(o)})().then((async r=>(await o(),t([["p-53050e17",[[0,"ui-image",{src:[1],width:[1],height:[1],alt:[1],styles:[8],detectDistance:[1,"detect-distance"],imgLoaded:[32],shouldLoad:[32]},null,{src:["handleSrc"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[2,"border-radius"],marginBottom:[2,"margin-bottom"],marginTop:[2,"margin-top"],marginLeft:[2,"margin-left"],marginRight:[2,"margin-right"],animation:[4],rows:[2],size:[1],color:[1],primaryColor:[1,"primary-color"],secondaryColor:[1,"secondary-color"]},null,{structure:["handleStructureChange"]}]]]],r))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/ui-image",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.62.3",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@everymatrix/ui-skeleton": "1.62.
|
|
27
|
+
"@everymatrix/ui-skeleton": "1.62.3"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as s,g as e}from"./p-381d4568.js";const n=class{constructor(t){i(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const i=new Image;i.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0)},i.src=this.src}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const t=i.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(i.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t(s,{key:"527318220c6b48375943e897fe0e53e0f33e67ed",class:"HostContainer"},!this.imgLoaded&&t("ui-skeleton",{key:"e5c49a781ff2fac5c796cb6a3f8d334dce7be35b",class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{key:"09dfbf8f52c2c899246590790f2780a84bdeefc3",ref:i=>this.image=i,src:this.shouldLoad?this.src:void 0,onLoad:()=>this.imgLoaded=!0,style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}get el(){return e(this)}static get watchers(){return{src:["handleSrc"]}}};n.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";export{n as U}
|