1 line
4.8 KiB
Plaintext
1 line
4.8 KiB
Plaintext
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-img.entry.js"],"names":["imgCss","Img","hostRef","ionImgWillLoad","ionImgDidLoad","ionError","onLoad","emit","onError","addIO","src","undefined","window","IntersectionObserverEntry","prototype","removeIO","io","IntersectionObserver","data","isIntersecting","load","observe","el","setTimeout","loadError","loadSrc","disconnect","decoding","alt","part","style"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAGA,UAAMA,MAAM,GAAG,oMAAf;;AAEA,UAAMC,GAAG;AACL,qBAAYC,OAAZ,EAAqB;AAAA;;AAAA;;AACjB,uEAAiB,IAAjB,EAAuBA,OAAvB;AACA,eAAKC,cAAL,GAAsB,6DAAY,IAAZ,EAAkB,gBAAlB,EAAoC,CAApC,CAAtB;AACA,eAAKC,aAAL,GAAqB,6DAAY,IAAZ,EAAkB,eAAlB,EAAmC,CAAnC,CAArB;AACA,eAAKC,QAAL,GAAgB,6DAAY,IAAZ,EAAkB,UAAlB,EAA8B,CAA9B,CAAhB;;AACA,eAAKC,MAAL,GAAc,YAAM;AAChB,iBAAI,CAACF,aAAL,CAAmBG,IAAnB;AACH,WAFD;;AAGA,eAAKC,OAAL,GAAe,YAAM;AACjB,iBAAI,CAACH,QAAL,CAAcE,IAAd;AACH,WAFD;AAGH;;AAZI;AAAA;AAAA,uCAaQ;AACT,iBAAKE,KAAL;AACH;AAfI;AAAA;AAAA,6CAgBc;AACf,iBAAKA,KAAL;AACH;AAlBI;AAAA;AAAA,kCAmBG;AAAA;;AACJ,gBAAI,KAAKC,GAAL,KAAaC,SAAjB,EAA4B;AACxB;AACH;;AACD,gBAAI,OAAOC,MAAP,KAAkB,WAAlB,IACA,0BAA0BA,MAD1B,IAEA,+BAA+BA,MAF/B,IAGA,oBAAoBA,MAAM,CAACC,yBAA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A7DC;;AAAA;AAAA,SAAT;;AA+DA5B,SAAG,CAAC6B,KAAJ,GAAY9B,MAAZ","file":"13-es5.js","sourcesContent":["import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-92848855.js';\nimport { b as getIonMode } from './ionic-global-23e7365a.js';\n\nconst imgCss = \":host{display:block;-o-object-fit:contain;object-fit:contain}img{display:block;width:100%;height:100%;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit}\";\n\nconst Img = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n this.ionError = createEvent(this, \"ionError\", 7);\n this.onLoad = () => {\n this.ionImgDidLoad.emit();\n };\n this.onError = () => {\n this.ionError.emit();\n };\n }\n srcChanged() {\n this.addIO();\n }\n componentDidLoad() {\n this.addIO();\n }\n addIO() {\n if (this.src === undefined) {\n return;\n }\n if (typeof window !== 'undefined' &&\n 'IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'isIntersecting' in window.IntersectionObserverEntry.prototype) {\n this.removeIO();\n this.io = new IntersectionObserver(data => {\n // because there will only ever be one instance\n // of the element we are observing\n // we can just use data[0]\n if (data[0].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n this.io.observe(this.el);\n }\n else {\n // fall back to setTimeout for Safari and IE\n setTimeout(() => this.load(), 200);\n }\n }\n load() {\n this.loadError = this.onError;\n this.loadSrc = this.src;\n this.ionImgWillLoad.emit();\n }\n removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n render() {\n return (h(Host, { class: getIonMode(this) }, h(\"img\", { decoding: \"async\", src: this.loadSrc, alt: this.alt, onLoad: this.onLoad, onError: this.loadError, part: \"image\" })));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"src\": [\"srcChanged\"]\n }; }\n};\nImg.style = imgCss;\n\nexport { Img as ion_img };\n"]} |