mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
7.8 KiB
JSON
1 line
7.8 KiB
JSON
|
|
{"ast":null,"code":"import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-7a8b7a1c.js';\nimport { b as getIonMode } from './ionic-global-63a97a32.js';\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}\";\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' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'isIntersecting' in window.IntersectionObserverEntry.prototype) {\n this.removeIO();\n this.io = new IntersectionObserver(data => {\n /**\n * On slower devices, it is possible for an intersection observer entry to contain multiple\n * objects in the array. This happens when quickly scrolling an image into view and then out of\n * view. In this case, the last object represents the current state of the component.\n */\n if (data[data.length - 1].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n this.io.observe(this.el);\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, {\n class: getIonMode(this)\n }, h(\"img\", {\n decoding: \"async\",\n src: this.loadSrc,\n alt: this.alt,\n onLoad: this.onLoad,\n onError: this.loadError,\n part: \"image\"\n }));\n }\n get el() {\n return getElement(this);\n }\n static get watchers() {\n return {\n \"src\": [\"srcChanged\"]\n };\n }\n};\nImg.style = imgCss;\nexport { Img as ion_img };","map":{"version":3,"names":["r","registerInstance","e","createEvent","h","H","Host","i","getElement","b","getIonMode","imgCss","Img","constructor","hostRef","ionImgWillLoad","ionImgDidLoad","ionError","onLoad","emit","onError","srcChanged","addIO","componentDidLoad","src","undefined","window","IntersectionObserverEntry","prototype","removeIO","io","IntersectionObserver","data","length","isIntersecting","load","observe","el","setTimeout","loadError","loadSrc","disconnect","render","class","decoding","alt","part","watchers","style","ion_img"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@ionic/core/dist/esm/ion-img.entry.js"],"sourcesContent":["import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-7a8b7a1c.js';\nimport { b as getIonMode } from './ionic-global-63a97a32.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
|