aiber-martin/www/42-es5.js.map
Martin Donnelly a4b8625d0f init
2020-12-17 16:23:12 +00:00

1 line
39 KiB
Plaintext

{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-virtual-scroll.entry.js"],"names":["CELL_TYPE_ITEM","CELL_TYPE_HEADER","CELL_TYPE_FOOTER","NODE_CHANGE_NONE","NODE_CHANGE_POSITION","NODE_CHANGE_CELL","MIN_READS","updateVDom","dom","heightIndex","cells","range","node","change","d","toMutate","end","offset","length","i","cell","find","n","top","push","pool","filter","type","index","visible","forEach","doRender","el","nodeRender","updateCellHeight","children","Array","from","tagName","childrenNu","child","newChild","createNode","classList","add","appendChild","style","transform","remove","reads","template","getTemplate","ownerDocument","importNode","content","querySelector","getViewport","scrollTop","vierportHeight","margin","Math","max","bottom","getRange","viewport","buffer","topPos","bottomPos","min","getShouldUpdate","dirtyIndex","currentRange","findCellIndex","findIndex","c","inplaceUpdate","dst","src","calcCells","items","itemHeight","headerHeight","footerHeight","headerFn","footerFn","approxHeaderHeight","approxFooterHeight","approxItemHeight","j","len","item","value","height","calcHeightIndex","buf","acum","resizeBuffer","Uint32Array","newBuf","set","subarray","positionForIndex","virtualScrollCss","VirtualScroll","hostRef","viewportHeight","virtualDom","isEnabled","viewportOffset","currentScrollTop","indexDirty","lastItemLen","totalHeight","onScroll","updateVirtualScroll","contentEl","closest","console","error","getScrollElement","scrollEl","updateState","undefined","Promise","resolve","getHeightIndex","cellIndex","scheduleUpdate","checkRange","timerUpdate","clearTimeout","readVS","bind","writeVS","topOffset","offsetTop","offsetParent","offsetHeight","shouldUpdate","domRender","renderItem","update","window","getComputedStyle","parseFloat","getPropertyValue","setCellHeight","componentOnReady","then","setTimeout","shouldEnable","enableScrollEvents","Infinity","shouldListen","rmEvent","addEventListener","removeEventListener","renderHeader","renderFooter","VirtualProxy","map","renderVirtualNode","utils","vattrs","classes","Object","assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA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AJkB,aAAP;AAKpB;AA5QW;;AAAA;AAAA,SAAnB;;AA8QA,UAAMmJ,YAAY,GAAG,SAAfA,YAAe,OAAU5H,QAAV,EAAoB+H,KAApB,EAA8B;AAAA,YAA3B1J,GAA2B,QAA3BA,GAA2B;AAC/C,eAAO0J,KAAK,CAACF,GAAN,CAAU7H,QAAV,EAAoB,UAACK,KAAD,EAAQrB,CAAR,EAAc;AACrC,cAAMP,IAAI,GAAGJ,GAAG,CAACW,CAAD,CAAhB;AACA,cAAMgJ,MAAM,GAAG3H,KAAK,CAAC2H,MAAN,IAAgB,EAA/B;AACA,cAAIC,OAAO,GAAGD,MAAM,SAAN,IAAgB,EAA9B;AACAC,iBAAO,IAAI,eAAX;;AACA,cAAI,CAACxJ,IAAI,CAACiB,OAAV,EAAmB;AACfuI,mBAAO,IAAI,iBAAX;AACH;;AACD,iBAAOC,MAAM,CAACC,MAAP,CAAcD,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB9H,KAAlB,CAAd,EAAwC;AAAE2H,kBAAM,EAAEE,MAAM,CAACC,MAAP,CAAcD,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBH,MAAlB,CAAd,EAAyC;AAAE,uBAAOC,OAAT;AAAkBtH,mBAAK,EAAEuH,MAAM,CAACC,MAAP,CAAcD,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBH,MAAM,CAACrH,KAAzB,CAAd,EAA+C;AAAEC,yBAAS,0BAAmBnC,IAAI,CAACW,GAAxB;AAAX,eAA/C;AAAzB,aAAzC;AAAV,WAAxC,CAAP;AACH,SATM,CAAP;AAUH,OAXD;;AAYAgF,mBAAa,CAACzD,KAAd,GAAsBwD,gBAAtB","file":"42-es5.js","sourcesContent":["import { r as registerInstance, f as readTask, c as writeTask, j as forceUpdate, h, H as Host, i as getElement } from './index-92848855.js';\n\nconst CELL_TYPE_ITEM = 'item';\nconst CELL_TYPE_HEADER = 'header';\nconst CELL_TYPE_FOOTER = 'footer';\nconst NODE_CHANGE_NONE = 0;\nconst NODE_CHANGE_POSITION = 1;\nconst NODE_CHANGE_CELL = 2;\n\nconst MIN_READS = 2;\nconst updateVDom = (dom, heightIndex, cells, range) => {\n // reset dom\n for (const node of dom) {\n node.change = NODE_CHANGE_NONE;\n node.d = true;\n }\n // try to match into exisiting dom\n const toMutate = [];\n const end = range.offset + range.length;\n for (let i = range.offset; i < end; i++) {\n const cell = cells[i];\n const node = dom.find(n => n.d && n.cell === cell);\n if (node) {\n const top = heightIndex[i];\n if (top !== node.top) {\n node.top = top;\n node.change = NODE_CHANGE_POSITION;\n }\n node.d = false;\n }\n else {\n toMutate.push(cell);\n }\n }\n // needs to append\n const pool = dom.filter(n => n.d);\n for (const cell of toMutate) {\n const node = pool.find(n => n.d && n.cell.type === cell.type);\n const index = cell.i;\n if (node) {\n node.d = false;\n node.change = NODE_CHANGE_CELL;\n node.cell = cell;\n node.top = heightIndex[index];\n }\n else {\n dom.push({\n d: false,\n cell,\n visible: true,\n change: NODE_CHANGE_CELL,\n top: heightIndex[index],\n });\n }\n }\n dom\n .filter(n => n.d && n.top !== -9999)\n .forEach(n => {\n n.change = NODE_CHANGE_POSITION;\n n.top = -9999;\n });\n};\nconst doRender = (el, nodeRender, dom, updateCellHeight) => {\n const children = Array.from(el.children).filter(n => n.tagName !== 'TEMPLATE');\n const childrenNu = children.length;\n let child;\n for (let i = 0; i < dom.length; i++) {\n const node = dom[i];\n const cell = node.cell;\n // the cell change, the content must be updated\n if (node.change === NODE_CHANGE_CELL) {\n if (i < childrenNu) {\n child = children[i];\n nodeRender(child, cell, i);\n }\n else {\n const newChild = createNode(el, cell.type);\n child = nodeRender(newChild, cell, i) || newChild;\n child.classList.add('virtual-item');\n el.appendChild(child);\n }\n child['$ionCell'] = cell;\n }\n else {\n child = children[i];\n }\n // only update position when it changes\n if (node.change !== NODE_CHANGE_NONE) {\n child.style.transform = `translate3d(0,${node.top}px,0)`;\n }\n // update visibility\n const visible = cell.visible;\n if (node.visible !== visible) {\n if (visible) {\n child.classList.remove('virtual-loading');\n }\n else {\n child.classList.add('virtual-loading');\n }\n node.visible = visible;\n }\n // dynamic height\n if (cell.reads > 0) {\n updateCellHeight(cell, child);\n cell.reads--;\n }\n }\n};\nconst createNode = (el, type) => {\n const template = getTemplate(el, type);\n if (template && el.ownerDocument) {\n return el.ownerDocument.importNode(template.content, true).children[0];\n }\n return null;\n};\nconst getTemplate = (el, type) => {\n switch (type) {\n case CELL_TYPE_ITEM: return el.querySelector('template:not([name])');\n case CELL_TYPE_HEADER: return el.querySelector('template[name=header]');\n case CELL_TYPE_FOOTER: return el.querySelector('template[name=footer]');\n }\n};\nconst getViewport = (scrollTop, vierportHeight, margin) => {\n return {\n top: Math.max(scrollTop - margin, 0),\n bottom: scrollTop + vierportHeight + margin\n };\n};\nconst getRange = (heightIndex, viewport, buffer) => {\n const topPos = viewport.top;\n const bottomPos = viewport.bottom;\n // find top index\n let i = 0;\n for (; i < heightIndex.length; i++) {\n if (heightIndex[i] > topPos) {\n break;\n }\n }\n const offset = Math.max(i - buffer - 1, 0);\n // find bottom index\n for (; i < heightIndex.length; i++) {\n if (heightIndex[i] >= bottomPos) {\n break;\n }\n }\n const end = Math.min(i + buffer, heightIndex.length);\n const length = end - offset;\n return { offset, length };\n};\nconst getShouldUpdate = (dirtyIndex, currentRange, range) => {\n const end = range.offset + range.length;\n return (dirtyIndex <= end ||\n currentRange.offset !== range.offset ||\n currentRange.length !== range.length);\n};\nconst findCellIndex = (cells, index) => {\n const max = cells.length > 0 ? cells[cells.length - 1].index : 0;\n if (index === 0) {\n return 0;\n }\n else if (index === max + 1) {\n return cells.length;\n }\n else {\n return cells.findIndex(c => c.index === index);\n }\n};\nconst inplaceUpdate = (dst, src, offset) => {\n if (offset === 0 && src.length >= dst.length) {\n return src;\n }\n for (let i = 0; i < src.length; i++) {\n dst[i + offset] = src[i];\n }\n return dst;\n};\nconst calcCells = (items, itemHeight, headerHeight, footerHeight, headerFn, footerFn, approxHeaderHeight, approxFooterHeight, approxItemHeight, j, offset, len) => {\n const cells = [];\n const end = len + offset;\n for (let i = offset; i < end; i++) {\n const item = items[i];\n if (headerFn) {\n const value = headerFn(item, i, items);\n if (value != null) {\n cells.push({\n i: j++,\n type: CELL_TYPE_HEADER,\n value,\n index: i,\n height: headerHeight ? headerHeight(value, i) : approxHeaderHeight,\n reads: headerHeight ? 0 : MIN_READS,\n visible: !!headerHeight,\n });\n }\n }\n cells.push({\n i: j++,\n type: CELL_TYPE_ITEM,\n value: item,\n index: i,\n height: itemHeight ? itemHeight(item, i) : approxItemHeight,\n reads: itemHeight ? 0 : MIN_READS,\n visible: !!itemHeight,\n });\n if (footerFn) {\n const value = footerFn(item, i, items);\n if (value != null) {\n cells.push({\n i: j++,\n type: CELL_TYPE_FOOTER,\n value,\n index: i,\n height: footerHeight ? footerHeight(value, i) : approxFooterHeight,\n reads: footerHeight ? 0 : MIN_READS,\n visible: !!footerHeight,\n });\n }\n }\n }\n return cells;\n};\nconst calcHeightIndex = (buf, cells, index) => {\n let acum = buf[index];\n for (let i = index; i < buf.length; i++) {\n buf[i] = acum;\n acum += cells[i].height;\n }\n return acum;\n};\nconst resizeBuffer = (buf, len) => {\n if (!buf) {\n return new Uint32Array(len);\n }\n if (buf.length === len) {\n return buf;\n }\n else if (len > buf.length) {\n const newBuf = new Uint32Array(len);\n newBuf.set(buf);\n return newBuf;\n }\n else {\n return buf.subarray(0, len);\n }\n};\nconst positionForIndex = (index, cells, heightIndex) => {\n const cell = cells.find(c => c.type === CELL_TYPE_ITEM && c.index === index);\n if (cell) {\n return heightIndex[cell.i];\n }\n return -1;\n};\n\nconst virtualScrollCss = \"ion-virtual-scroll{display:block;position:relative;width:100%;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-virtual-scroll>.virtual-loading{opacity:0}ion-virtual-scroll>.virtual-item{position:absolute !important;top:0 !important;right:0 !important;left:0 !important;-webkit-transition-duration:0ms;transition-duration:0ms;will-change:transform}\";\n\nconst VirtualScroll = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.range = { offset: 0, length: 0 };\n this.viewportHeight = 0;\n this.cells = [];\n this.virtualDom = [];\n this.isEnabled = false;\n this.viewportOffset = 0;\n this.currentScrollTop = 0;\n this.indexDirty = 0;\n this.lastItemLen = 0;\n this.totalHeight = 0;\n /**\n * It is important to provide this\n * if virtual item height will be significantly larger than the default\n * The approximate height of each virtual item template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxItemHeight = 45;\n /**\n * The approximate height of each header template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxHeaderHeight = 30;\n /**\n * The approximate width of each footer template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxFooterHeight = 30;\n this.onScroll = () => {\n this.updateVirtualScroll();\n };\n }\n itemsChanged() {\n this.calcCells();\n this.updateVirtualScroll();\n }\n async connectedCallback() {\n const contentEl = this.el.closest('ion-content');\n if (!contentEl) {\n console.error('<ion-virtual-scroll> must be used inside an <ion-content>');\n return;\n }\n this.scrollEl = await contentEl.getScrollElement();\n this.contentEl = contentEl;\n this.calcCells();\n this.updateState();\n }\n componentDidUpdate() {\n this.updateState();\n }\n disconnectedCallback() {\n this.scrollEl = undefined;\n }\n onResize() {\n this.calcCells();\n this.updateVirtualScroll();\n }\n /**\n * Returns the position of the virtual item at the given index.\n */\n positionForItem(index) {\n return Promise.resolve(positionForIndex(index, this.cells, this.getHeightIndex()));\n }\n /**\n * This method marks a subset of items as dirty, so they can be re-rendered. Items should be marked as\n * dirty any time the content or their style changes.\n *\n * The subset of items to be updated can are specifing by an offset and a length.\n */\n async checkRange(offset, len = -1) {\n // TODO: kind of hacky how we do in-place updated of the cells\n // array. this part needs a complete refactor\n if (!this.items) {\n return;\n }\n const length = (len === -1)\n ? this.items.length - offset\n : len;\n const cellIndex = findCellIndex(this.cells, offset);\n const cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, cellIndex, offset, length);\n this.cells = inplaceUpdate(this.cells, cells, cellIndex);\n this.lastItemLen = this.items.length;\n this.indexDirty = Math.max(offset - 1, 0);\n this.scheduleUpdate();\n }\n /**\n * This method marks the tail the items array as dirty, so they can be re-rendered.\n *\n * It's equivalent to calling:\n *\n * ```js\n * virtualScroll.checkRange(lastItemLen);\n * ```\n */\n async checkEnd() {\n if (this.items) {\n this.checkRange(this.lastItemLen);\n }\n }\n updateVirtualScroll() {\n // do nothing if virtual-scroll is disabled\n if (!this.isEnabled || !this.scrollEl) {\n return;\n }\n // unschedule future updates\n if (this.timerUpdate) {\n clearTimeout(this.timerUpdate);\n this.timerUpdate = undefined;\n }\n // schedule DOM operations into the stencil queue\n readTask(this.readVS.bind(this));\n writeTask(this.writeVS.bind(this));\n }\n readVS() {\n const { contentEl, scrollEl, el } = this;\n let topOffset = 0;\n let node = el;\n while (node && node !== contentEl) {\n topOffset += node.offsetTop;\n node = node.offsetParent;\n }\n this.viewportOffset = topOffset;\n if (scrollEl) {\n this.viewportHeight = scrollEl.offsetHeight;\n this.currentScrollTop = scrollEl.scrollTop;\n }\n }\n writeVS() {\n const dirtyIndex = this.indexDirty;\n // get visible viewport\n const scrollTop = this.currentScrollTop - this.viewportOffset;\n const viewport = getViewport(scrollTop, this.viewportHeight, 100);\n // compute lazily the height index\n const heightIndex = this.getHeightIndex();\n // get array bounds of visible cells base in the viewport\n const range = getRange(heightIndex, viewport, 2);\n // fast path, do nothing\n const shouldUpdate = getShouldUpdate(dirtyIndex, this.range, range);\n if (!shouldUpdate) {\n return;\n }\n this.range = range;\n // in place mutation of the virtual DOM\n updateVDom(this.virtualDom, heightIndex, this.cells, range);\n // Write DOM\n // Different code paths taken depending of the render API used\n if (this.nodeRender) {\n doRender(this.el, this.nodeRender, this.virtualDom, this.updateCellHeight.bind(this));\n }\n else if (this.domRender) {\n this.domRender(this.virtualDom);\n }\n else if (this.renderItem) {\n forceUpdate(this);\n }\n }\n updateCellHeight(cell, node) {\n const update = () => {\n if (node['$ionCell'] === cell) {\n const style = window.getComputedStyle(node);\n const height = node.offsetHeight + parseFloat(style.getPropertyValue('margin-bottom'));\n this.setCellHeight(cell, height);\n }\n };\n if (node && node.componentOnReady) {\n node.componentOnReady().then(update);\n }\n else {\n update();\n }\n }\n setCellHeight(cell, height) {\n const index = cell.i;\n // the cell might changed since the height update was scheduled\n if (cell !== this.cells[index]) {\n return;\n }\n if (cell.height !== height || cell.visible !== true) {\n cell.visible = true;\n cell.height = height;\n this.indexDirty = Math.min(this.indexDirty, index);\n this.scheduleUpdate();\n }\n }\n scheduleUpdate() {\n clearTimeout(this.timerUpdate);\n this.timerUpdate = setTimeout(() => this.updateVirtualScroll(), 100);\n }\n updateState() {\n const shouldEnable = !!(this.scrollEl &&\n this.cells);\n if (shouldEnable !== this.isEnabled) {\n this.enableScrollEvents(shouldEnable);\n if (shouldEnable) {\n this.updateVirtualScroll();\n }\n }\n }\n calcCells() {\n if (!this.items) {\n return;\n }\n this.lastItemLen = this.items.length;\n this.cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, 0, 0, this.lastItemLen);\n this.indexDirty = 0;\n }\n getHeightIndex() {\n if (this.indexDirty !== Infinity) {\n this.calcHeightIndex(this.indexDirty);\n }\n return this.heightIndex;\n }\n calcHeightIndex(index = 0) {\n // TODO: optimize, we don't need to calculate all the cells\n this.heightIndex = resizeBuffer(this.heightIndex, this.cells.length);\n this.totalHeight = calcHeightIndex(this.heightIndex, this.cells, index);\n this.indexDirty = Infinity;\n }\n enableScrollEvents(shouldListen) {\n if (this.rmEvent) {\n this.rmEvent();\n this.rmEvent = undefined;\n }\n const scrollEl = this.scrollEl;\n if (scrollEl) {\n this.isEnabled = shouldListen;\n scrollEl.addEventListener('scroll', this.onScroll);\n this.rmEvent = () => {\n scrollEl.removeEventListener('scroll', this.onScroll);\n };\n }\n }\n renderVirtualNode(node) {\n const { type, value, index } = node.cell;\n switch (type) {\n case CELL_TYPE_ITEM: return this.renderItem(value, index);\n case CELL_TYPE_HEADER: return this.renderHeader(value, index);\n case CELL_TYPE_FOOTER: return this.renderFooter(value, index);\n }\n }\n render() {\n return (h(Host, { style: {\n height: `${this.totalHeight}px`\n } }, this.renderItem && (h(VirtualProxy, { dom: this.virtualDom }, this.virtualDom.map(node => this.renderVirtualNode(node))))));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"itemHeight\": [\"itemsChanged\"],\n \"headerHeight\": [\"itemsChanged\"],\n \"footerHeight\": [\"itemsChanged\"],\n \"items\": [\"itemsChanged\"]\n }; }\n};\nconst VirtualProxy = ({ dom }, children, utils) => {\n return utils.map(children, (child, i) => {\n const node = dom[i];\n const vattrs = child.vattrs || {};\n let classes = vattrs.class || '';\n classes += 'virtual-item ';\n if (!node.visible) {\n classes += 'virtual-loading';\n }\n return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, vattrs), { class: classes, style: Object.assign(Object.assign({}, vattrs.style), { transform: `translate3d(0,${node.top}px,0)` }) }) });\n });\n};\nVirtualScroll.style = virtualScrollCss;\n\nexport { VirtualScroll as ion_virtual_scroll };\n"]}