feat(custom-elements): add experimental custom elements build (#22863)

Co-authored-by: Liam DeBeasi <liamdebeasi@icloud.com>
This commit is contained in:
Adam Bradley
2021-02-11 11:08:00 -06:00
committed by GitHub
parent 19d63f6243
commit 0de75afbef
61 changed files with 5430 additions and 7613 deletions

View File

@ -4,7 +4,7 @@ test('virtual-scroll: basic', async () => {
const page = await newE2EPage({
url: '/src/components/virtual-scroll/test/basic?ionic:_testing=true'
});
await page.waitFor(300);
await page.waitForTimeout(300);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();

View File

@ -4,7 +4,7 @@ test('virtual-scroll: cards', async () => {
const page = await newE2EPage({
url: '/src/components/virtual-scroll/test/cards?ionic:_testing=true'
});
await page.waitFor(300);
await page.waitForTimeout(300);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();

View File

@ -1,6 +1,7 @@
import { Component, ComponentInterface, Element, FunctionalComponent, Host, Listen, Method, Prop, State, Watch, forceUpdate, h, readTask, writeTask } from '@stencil/core';
import { Cell, DomRenderFn, FooterHeightFn, HeaderFn, HeaderHeightFn, ItemHeightFn, ItemRenderFn, VirtualNode } from '../../interface';
import { componentOnReady } from '../../utils/helpers';
import { CELL_TYPE_FOOTER, CELL_TYPE_HEADER, CELL_TYPE_ITEM } from './constants';
import { Range, calcCells, calcHeightIndex, doRender, findCellIndex, getRange, getShouldUpdate, getViewport, inplaceUpdate, positionForIndex, resizeBuffer, updateVDom } from './virtual-scroll-utils';
@ -322,8 +323,8 @@ export class VirtualScroll implements ComponentInterface {
this.setCellHeight(cell, height);
}
};
if (node && node.componentOnReady) {
node.componentOnReady().then(update);
if (node) {
componentOnReady(node, update);
} else {
update();
}