1 |
- {"ast":null,"code":"/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';\nimport { d as inheritAttributes } from './helpers.js';\nimport { b as getIonMode } from './ionic-global.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 IonImgStyle0 = imgCss;\nconst Img = /*@__PURE__*/proxyCustomElement(class Img extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n this.ionError = createEvent(this, \"ionError\", 7);\n this.inheritedAttributes = {};\n this.onLoad = () => {\n this.ionImgDidLoad.emit();\n };\n this.onError = () => {\n this.ionError.emit();\n };\n this.loadSrc = undefined;\n this.loadError = undefined;\n this.alt = undefined;\n this.src = undefined;\n }\n srcChanged() {\n this.addIO();\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['draggable']);\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 const {\n loadSrc,\n alt,\n onLoad,\n loadError,\n inheritedAttributes\n } = this;\n const {\n draggable\n } = inheritedAttributes;\n return h(Host, {\n key: 'da600442894427dee1974a28e545613afac69fca',\n class: getIonMode(this)\n }, h(\"img\", {\n key: '16df0c7069af86c0fa7ce5af598bc0f63b4eb71a',\n decoding: \"async\",\n src: loadSrc,\n alt: alt,\n onLoad: onLoad,\n onError: loadError,\n part: \"image\",\n draggable: isDraggable(draggable)\n }));\n }\n get el() {\n return this;\n }\n static get watchers() {\n return {\n \"src\": [\"srcChanged\"]\n };\n }\n static get style() {\n return IonImgStyle0;\n }\n}, [1, \"ion-img\", {\n \"alt\": [1],\n \"src\": [1],\n \"loadSrc\": [32],\n \"loadError\": [32]\n}, undefined, {\n \"src\": [\"srcChanged\"]\n}]);\n/**\n * Enumerated strings must be set as booleans\n * as Stencil will not render 'false' in the DOM.\n * The need to explicitly render draggable=\"true\"\n * as only certain elements are draggable by default.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable.\n */\nconst isDraggable = draggable => {\n switch (draggable) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n return undefined;\n }\n};\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"ion-img\"];\n components.forEach(tagName => {\n switch (tagName) {\n case \"ion-img\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Img);\n }\n break;\n }\n });\n}\nconst IonImg = Img;\nconst defineCustomElement = defineCustomElement$1;\nexport { IonImg, defineCustomElement };","map":{"version":3,"names":["proxyCustomElement","HTMLElement","createEvent","h","Host","d","inheritAttributes","b","getIonMode","imgCss","IonImgStyle0","Img","constructor","__registerHost","__attachShadow","ionImgWillLoad","ionImgDidLoad","ionError","inheritedAttributes","onLoad","emit","onError","loadSrc","undefined","loadError","alt","src","srcChanged","addIO","componentWillLoad","el","componentDidLoad","window","IntersectionObserverEntry","prototype","removeIO","io","IntersectionObserver","data","length","isIntersecting","load","observe","setTimeout","disconnect","render","draggable","key","class","decoding","part","isDraggable","watchers","style","defineCustomElement$1","customElements","components","forEach","tagName","get","define","IonImg","defineCustomElement"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@ionic/core/components/ion-img.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';\nimport { d as inheritAttributes } from './helpers.js';\nimport { b as getIonMode } from './ionic-global.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}\";\nconst IonImgStyle0 = imgCss;\n\nconst Img = /*@__PURE__*/ proxyCustomElement(class Img extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n this.ionError = createEvent(this, \"ionError\", 7);\n this.inheritedAttributes = {};\n this.onLoad = () => {\n this.ionImgDidLoad.emit();\n };\n this.onError = () => {\n this.ionError.emit();\n };\n this.loadSrc = undefined;\n this.loadError = undefined;\n this.alt = undefined;\n this.src = undefined;\n }\n srcChanged() {\n this.addIO();\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['draggable']);\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 /**\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 }\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 const { loadSrc, alt, onLoad, loadError, inheritedAttributes } = this;\n const { draggable } = inheritedAttributes;\n return (h(Host, { key: 'da600442894427dee1974a28e545613afac69fca', class: getIonMode(this) }, h(\"img\", { key: '16df0c7069af86c0fa7ce5af598bc0f63b4eb71a', decoding: \"async\", src: loadSrc, alt: alt, onLoad: onLoad, onError: loadError, part: \"image\", draggable: isDraggable(draggable) })));\n }\n get el() { return this; }\n static get watchers() { return {\n \"src\": [\"srcChanged\"]\n }; }\n static get style() { return IonImgStyle0; }\n}, [1, \"ion-img\", {\n \"alt\": [1],\n \"src\": [1],\n \"loadSrc\": [32],\n \"loadError\": [32]\n }, undefined, {\n \"src\": [\"srcChanged\"]\n }]);\n/**\n * Enumerated strings must be set as booleans\n * as Stencil will not render 'false' in the DOM.\n * The need to explicitly render draggable=\"true\"\n * as only certain elements are draggable by default.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable.\n */\nconst isDraggable = (draggable) => {\n switch (draggable) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n return undefined;\n }\n};\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"ion-img\"];\n components.forEach(tagName => { switch (tagName) {\n case \"ion-img\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Img);\n }\n break;\n } });\n}\n\nconst IonImg = Img;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { IonImg, defineCustomElement };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,kBAAkB,EAAEC,WAAW,EAAEC,WAAW,EAAEC,CAAC,EAAEC,IAAI,QAAQ,+BAA+B;AAC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