smoothly 0.1.77 → 0.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{App-eff713bd.js → App-ffc56e72.js} +1 -1
- package/dist/cjs/{Notice-e43922ea.js → Notice-9120d311.js} +1 -1
- package/dist/cjs/{css-shim-e3f30f9a.js → css-shim-88cc6900.js} +1 -1
- package/dist/cjs/{dom-c8b6d1a7.js → dom-95afd968.js} +1 -1
- package/dist/cjs/{generate-7f7f7d99.js → generate-14aca5d2.js} +1 -1
- package/dist/cjs/{index-b7e6a72c.js → index-138c41c2.js} +342 -147
- package/dist/cjs/{index-5537d93a.js → index-41a36ce2.js} +154 -88
- package/dist/cjs/{index-7c9d0102.js → index-42db74b3.js} +2 -2
- package/dist/cjs/{index-c973259c.js → index-de5d1ee1.js} +10 -7
- package/dist/cjs/{index-e37f73fe.js → index-fc82954f.js} +311 -12
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{shadow-css-6cbb23a9.js → shadow-css-71d0f821.js} +12 -6
- package/dist/cjs/smoothly-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-accordion.cjs.entry.js +2 -2
- package/dist/cjs/{smoothly-accordion_46.cjs.entry.js → smoothly-accordion_47.cjs.entry.js} +7965 -2493
- package/dist/cjs/smoothly-app-demo.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-app.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-calendar.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-checkbox.cjs.entry.js +5707 -504
- package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-dialog.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-display-amount.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-display-date-time.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-display-demo.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-display.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-frame.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-icon-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-icon.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-input-date.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-input-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-input-month.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-input.cjs.entry.js +19 -12
- package/dist/cjs/smoothly-item.cjs.entry.js +6 -2
- package/dist/cjs/smoothly-menu-options.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-notification.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-notifier.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-option.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-picker.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-popup.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-quiet.cjs.entry.js +19 -0
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-radio.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-room.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-select-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-select.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-selector.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-spinner.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-submit.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-tab-switch.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-tab.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-header.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table-row.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-table.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +3 -3
- package/dist/cjs/smoothly-trigger.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-tuple.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-urlencoded.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +10 -7
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/display-demo/index.js +4 -1
- package/dist/collection/components/input/index.js +16 -9
- package/dist/collection/components/item/index.js +4 -0
- package/dist/collection/components/quiet/index.js +34 -0
- package/dist/collection/components/quiet/style.css +3 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +8186 -2655
- package/dist/{smoothly/App-bf78807d.js → esm/App-c5f6000f.js} +1 -1
- package/dist/esm/{Notice-966edc54.js → Notice-d87d90f7.js} +1 -1
- package/dist/esm/{css-shim-003e9264.js → css-shim-c64026cd.js} +1 -1
- package/dist/esm/{dom-1b195079.js → dom-a712b575.js} +1 -1
- package/dist/esm/{generate-7090dc14.js → generate-be25a8d1.js} +1 -1
- package/dist/esm/{index-0dd5f791.js → index-02a70ac1.js} +342 -147
- package/dist/{smoothly/index-01fedb5b.js → esm/index-36a04e8c.js} +2 -2
- package/dist/esm/{index-531e2f06.js → index-68492ed9.js} +10 -7
- package/dist/{smoothly/index-13251390.js → esm/index-a28d88cf.js} +311 -12
- package/dist/esm/{index-9d550804.js → index-dcb2b612.js} +154 -88
- package/dist/esm/index.js +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{shadow-css-c1ad5fdc.js → shadow-css-1e16431b.js} +12 -6
- package/dist/esm/smoothly-accordion-item.entry.js +2 -2
- package/dist/esm/smoothly-accordion.entry.js +2 -2
- package/dist/esm/{smoothly-accordion_46.entry.js → smoothly-accordion_47.entry.js} +7965 -2494
- package/dist/esm/smoothly-app-demo.entry.js +3 -3
- package/dist/esm/smoothly-app.entry.js +2 -2
- package/dist/esm/smoothly-calendar.entry.js +4 -4
- package/dist/esm/smoothly-checkbox.entry.js +5703 -500
- package/dist/esm/smoothly-dialog-demo.entry.js +2 -2
- package/dist/esm/smoothly-dialog.entry.js +3 -3
- package/dist/esm/smoothly-display-amount.entry.js +3 -3
- package/dist/esm/smoothly-display-date-time.entry.js +2 -2
- package/dist/esm/smoothly-display-demo.entry.js +4 -4
- package/dist/esm/smoothly-display.entry.js +3 -3
- package/dist/esm/smoothly-frame.entry.js +3 -3
- package/dist/esm/smoothly-icon-demo.entry.js +2 -2
- package/dist/esm/smoothly-icon.entry.js +2 -2
- package/dist/esm/smoothly-input-date-range.entry.js +3 -3
- package/dist/esm/smoothly-input-date.entry.js +3 -3
- package/dist/esm/smoothly-input-demo.entry.js +2 -2
- package/dist/esm/smoothly-input-month.entry.js +4 -4
- package/dist/esm/smoothly-input.entry.js +19 -12
- package/dist/esm/smoothly-item.entry.js +6 -2
- package/dist/esm/smoothly-menu-options.entry.js +2 -2
- package/dist/esm/smoothly-notification.entry.js +2 -2
- package/dist/esm/smoothly-notifier.entry.js +2 -2
- package/dist/esm/smoothly-option.entry.js +2 -2
- package/dist/esm/smoothly-picker.entry.js +2 -2
- package/dist/esm/smoothly-popup.entry.js +2 -2
- package/dist/esm/smoothly-quiet.entry.js +15 -0
- package/dist/esm/smoothly-radio-group.entry.js +2 -2
- package/dist/esm/smoothly-radio.entry.js +2 -2
- package/dist/esm/smoothly-reorder.entry.js +2 -2
- package/dist/esm/smoothly-room.entry.js +2 -2
- package/dist/esm/smoothly-select-demo.entry.js +2 -2
- package/dist/esm/smoothly-select.entry.js +2 -2
- package/dist/esm/smoothly-selector.entry.js +2 -2
- package/dist/esm/smoothly-spinner.entry.js +2 -2
- package/dist/esm/smoothly-submit.entry.js +2 -2
- package/dist/esm/smoothly-tab-switch.entry.js +2 -2
- package/dist/esm/smoothly-tab.entry.js +2 -2
- package/dist/esm/smoothly-table-cell.entry.js +2 -2
- package/dist/esm/smoothly-table-demo.entry.js +2 -2
- package/dist/esm/smoothly-table-expandable-cell.entry.js +2 -2
- package/dist/esm/smoothly-table-expandable-row.entry.js +2 -2
- package/dist/esm/smoothly-table-header.entry.js +2 -2
- package/dist/esm/smoothly-table-row.entry.js +2 -2
- package/dist/esm/smoothly-table.entry.js +2 -2
- package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
- package/dist/esm/smoothly-trigger-source.entry.js +3 -3
- package/dist/esm/smoothly-trigger.entry.js +2 -2
- package/dist/esm/smoothly-tuple.entry.js +2 -2
- package/dist/esm/smoothly-urlencoded.entry.js +2 -2
- package/dist/esm/smoothly.js +10 -7
- package/dist/{esm/App-bf78807d.js → smoothly/App-c5f6000f.js} +1 -1
- package/dist/smoothly/{css-shim-003e9264.js → css-shim-c64026cd.js} +1 -1
- package/dist/smoothly/{dom-1b195079.js → dom-a712b575.js} +1 -1
- package/dist/smoothly/{generate-7090dc14.js → generate-be25a8d1.js} +1 -1
- package/dist/smoothly/{index-0dd5f791.js → index-02a70ac1.js} +342 -147
- package/dist/{esm/index-01fedb5b.js → smoothly/index-36a04e8c.js} +2 -2
- package/dist/smoothly/{index-531e2f06.js → index-68492ed9.js} +10 -7
- package/dist/{esm/index-13251390.js → smoothly/index-a28d88cf.js} +311 -12
- package/dist/smoothly/index.esm.js +3 -3
- package/dist/smoothly/{p-0906d4b2.js → p-074a0448.js} +1 -1
- package/dist/smoothly/p-09d633f8.entry.js +1 -0
- package/dist/smoothly/p-0c1e9588.entry.js +1 -0
- package/dist/smoothly/p-1a81597b.entry.js +1 -0
- package/dist/smoothly/{p-7f5dd95f.js → p-1e768876.js} +1 -1
- package/dist/smoothly/p-9fa3ab06.entry.js +1 -0
- package/dist/smoothly/p-c9d01e9b.entry.js +1 -0
- package/dist/smoothly/{shadow-css-c1ad5fdc.js → shadow-css-1e16431b.js} +12 -6
- package/dist/smoothly/smoothly-accordion-item.entry.js +2 -2
- package/dist/smoothly/smoothly-accordion.entry.js +2 -2
- package/dist/smoothly/smoothly-app-demo.entry.js +3 -3
- package/dist/smoothly/smoothly-app.entry.js +2 -2
- package/dist/smoothly/smoothly-calendar.entry.js +4 -4
- package/dist/smoothly/smoothly-checkbox.entry.js +5703 -500
- package/dist/smoothly/smoothly-dialog-demo.entry.js +2 -2
- package/dist/smoothly/smoothly-dialog.entry.js +3 -3
- package/dist/smoothly/smoothly-display-amount.entry.js +3 -3
- package/dist/smoothly/smoothly-display-date-time.entry.js +2 -2
- package/dist/smoothly/smoothly-display-demo.entry.js +4 -4
- package/dist/smoothly/smoothly-display.entry.js +3 -3
- package/dist/smoothly/smoothly-frame.entry.js +3 -3
- package/dist/smoothly/smoothly-icon-demo.entry.js +2 -2
- package/dist/smoothly/smoothly-icon.entry.js +2 -2
- package/dist/smoothly/smoothly-input-date-range.entry.js +3 -3
- package/dist/smoothly/smoothly-input-date.entry.js +3 -3
- package/dist/smoothly/smoothly-input-demo.entry.js +2 -2
- package/dist/smoothly/smoothly-input-month.entry.js +4 -4
- package/dist/smoothly/smoothly-input.entry.js +19 -12
- package/dist/smoothly/smoothly-item.entry.js +6 -2
- package/dist/smoothly/smoothly-menu-options.entry.js +2 -2
- package/dist/smoothly/smoothly-notification.entry.js +2 -2
- package/dist/smoothly/smoothly-notifier.entry.js +2 -2
- package/dist/smoothly/smoothly-option.entry.js +2 -2
- package/dist/smoothly/smoothly-picker.entry.js +2 -2
- package/dist/smoothly/smoothly-popup.entry.js +2 -2
- package/dist/smoothly/smoothly-quiet.entry.js +15 -0
- package/dist/smoothly/smoothly-radio-group.entry.js +2 -2
- package/dist/smoothly/smoothly-radio.entry.js +2 -2
- package/dist/smoothly/smoothly-reorder.entry.js +2 -2
- package/dist/smoothly/smoothly-room.entry.js +2 -2
- package/dist/smoothly/smoothly-select-demo.entry.js +2 -2
- package/dist/smoothly/smoothly-select.entry.js +2 -2
- package/dist/smoothly/smoothly-selector.entry.js +2 -2
- package/dist/smoothly/smoothly-spinner.entry.js +2 -2
- package/dist/smoothly/smoothly-submit.entry.js +2 -2
- package/dist/smoothly/smoothly-tab-switch.entry.js +2 -2
- package/dist/smoothly/smoothly-tab.entry.js +2 -2
- package/dist/smoothly/smoothly-table-cell.entry.js +2 -2
- package/dist/smoothly/smoothly-table-demo.entry.js +2 -2
- package/dist/smoothly/smoothly-table-expandable-cell.entry.js +2 -2
- package/dist/smoothly/smoothly-table-expandable-row.entry.js +2 -2
- package/dist/smoothly/smoothly-table-header.entry.js +2 -2
- package/dist/smoothly/smoothly-table-row.entry.js +2 -2
- package/dist/smoothly/smoothly-table.entry.js +2 -2
- package/dist/smoothly/smoothly-trigger-sink.entry.js +3 -3
- package/dist/smoothly/smoothly-trigger-source.entry.js +3 -3
- package/dist/smoothly/smoothly-trigger.entry.js +2 -2
- package/dist/smoothly/smoothly-tuple.entry.js +2 -2
- package/dist/smoothly/smoothly-urlencoded.entry.js +2 -2
- package/dist/smoothly/smoothly.esm.js +10 -7
- package/dist/types/components/item/index.d.ts +1 -0
- package/dist/types/components/quiet/index.d.ts +4 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/stencil-public-runtime.d.ts +183 -182
- package/loader/index.d.ts +0 -1
- package/package.json +89 -90
- package/dist/smoothly/p-22bce579.entry.js +0 -1
- package/dist/smoothly/p-41528fcb.entry.js +0 -1
- package/dist/smoothly/p-89fe12b0.entry.js +0 -1
- package/dist/smoothly/p-e3d91e7a.entry.js +0 -1
- package/dist/smoothly/p-e79800d9.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'smoothly';
|
|
2
|
-
const BUILD = /* smoothly */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, cssVarShim: false, devTools: false, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, isDebug: false, isDev: true, isTesting: true, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
2
|
+
const BUILD = /* smoothly */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, cssVarShim: false, devTools: false, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: true, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
3
|
const Env = /* smoothly */ {};
|
|
4
4
|
|
|
5
5
|
let scopeId;
|
|
@@ -22,8 +22,8 @@ const H = (win.HTMLElement || class {
|
|
|
22
22
|
const plt = {
|
|
23
23
|
$flags$: 0,
|
|
24
24
|
$resourcesUrl$: '',
|
|
25
|
-
jmp: h => h(),
|
|
26
|
-
raf: h => requestAnimationFrame(h),
|
|
25
|
+
jmp: (h) => h(),
|
|
26
|
+
raf: (h) => requestAnimationFrame(h),
|
|
27
27
|
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
28
28
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
29
29
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
@@ -31,7 +31,9 @@ const plt = {
|
|
|
31
31
|
const setPlatformHelpers = (helpers) => {
|
|
32
32
|
Object.assign(plt, helpers);
|
|
33
33
|
};
|
|
34
|
-
const supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom
|
|
34
|
+
const supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom
|
|
35
|
+
? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
36
|
+
: true;
|
|
35
37
|
const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
36
38
|
let supportsListenerOptions = false;
|
|
37
39
|
try {
|
|
@@ -49,7 +51,7 @@ const supportsConstructibleStylesheets = BUILD.constructableCSS
|
|
|
49
51
|
? /*@__PURE__*/ (() => {
|
|
50
52
|
try {
|
|
51
53
|
new CSSStyleSheet();
|
|
52
|
-
return typeof
|
|
54
|
+
return typeof new CSSStyleSheet().replace === 'function';
|
|
53
55
|
}
|
|
54
56
|
catch (e) { }
|
|
55
57
|
return false;
|
|
@@ -248,7 +250,9 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
248
250
|
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
249
251
|
}
|
|
250
252
|
if (!appliedStyles.has(scopeId)) {
|
|
251
|
-
if (BUILD.hydrateClientSide &&
|
|
253
|
+
if (BUILD.hydrateClientSide &&
|
|
254
|
+
styleContainerNode.host &&
|
|
255
|
+
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
252
256
|
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
253
257
|
styleElm.innerHTML = style;
|
|
254
258
|
}
|
|
@@ -309,7 +313,7 @@ const attachStyles = (hostRef) => {
|
|
|
309
313
|
const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
|
|
310
314
|
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
311
315
|
// Private
|
|
312
|
-
const computeMode = (elm) => modeResolutionChain.map(h => h(elm)).find(m => !!m);
|
|
316
|
+
const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
|
|
313
317
|
// Public
|
|
314
318
|
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
315
319
|
const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
@@ -396,7 +400,7 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
396
400
|
typeof classData !== 'object'
|
|
397
401
|
? classData
|
|
398
402
|
: Object.keys(classData)
|
|
399
|
-
.filter(k => classData[k])
|
|
403
|
+
.filter((k) => classData[k])
|
|
400
404
|
.join(' ');
|
|
401
405
|
}
|
|
402
406
|
}
|
|
@@ -504,8 +508,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
504
508
|
const classList = elm.classList;
|
|
505
509
|
const oldClasses = parseClassList(oldValue);
|
|
506
510
|
const newClasses = parseClassList(newValue);
|
|
507
|
-
classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c)));
|
|
508
|
-
classList.add(...newClasses.filter(c => c && !oldClasses.includes(c)));
|
|
511
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
512
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
509
513
|
}
|
|
510
514
|
else if (BUILD.vdomStyle && memberName === 'style') {
|
|
511
515
|
// update style attribute, css properties and values
|
|
@@ -540,7 +544,10 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
540
544
|
newValue(elm);
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
|
-
else if (BUILD.vdomListener &&
|
|
547
|
+
else if (BUILD.vdomListener &&
|
|
548
|
+
(BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
|
|
549
|
+
memberName[0] === 'o' &&
|
|
550
|
+
memberName[1] === 'n') {
|
|
544
551
|
// Event Handlers
|
|
545
552
|
// so if the member name starts with "on" and the 3rd characters is
|
|
546
553
|
// a capital letter, and it's not already a member on the element,
|
|
@@ -587,7 +594,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
587
594
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
588
595
|
if (memberName === 'list') {
|
|
589
596
|
isProp = false;
|
|
590
|
-
// tslint:disable-next-line: triple-equals
|
|
591
597
|
}
|
|
592
598
|
else if (oldValue == null || elm[memberName] != n) {
|
|
593
599
|
elm[memberName] = n;
|
|
@@ -641,7 +647,9 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
641
647
|
// if the element passed in is a shadow root, which is a document fragment
|
|
642
648
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
643
649
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
644
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
650
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
651
|
+
? newVnode.$elm$.host
|
|
652
|
+
: newVnode.$elm$;
|
|
645
653
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
646
654
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
647
655
|
if (BUILD.updatable) {
|
|
@@ -688,7 +696,8 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
688
696
|
}
|
|
689
697
|
else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
690
698
|
// create a slot reference node
|
|
691
|
-
elm = newVNode.$elm$ =
|
|
699
|
+
elm = newVNode.$elm$ =
|
|
700
|
+
BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
|
|
692
701
|
}
|
|
693
702
|
else {
|
|
694
703
|
if (BUILD.svg && !isSvgMode) {
|
|
@@ -696,8 +705,12 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
696
705
|
}
|
|
697
706
|
// create element
|
|
698
707
|
elm = newVNode.$elm$ = (BUILD.svg
|
|
699
|
-
? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* isSlotFallback */
|
|
700
|
-
|
|
708
|
+
? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* isSlotFallback */
|
|
709
|
+
? 'slot-fb'
|
|
710
|
+
: newVNode.$tag$)
|
|
711
|
+
: doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* isSlotFallback */
|
|
712
|
+
? 'slot-fb'
|
|
713
|
+
: newVNode.$tag$));
|
|
701
714
|
if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
702
715
|
isSvgMode = false;
|
|
703
716
|
}
|
|
@@ -1067,7 +1080,7 @@ const relocateSlotContent = (elm) => {
|
|
|
1067
1080
|
// that is suppose to always represent the original content location
|
|
1068
1081
|
if (isNodeLocatedInSlot(node, slotNameAttr)) {
|
|
1069
1082
|
// it's possible we've already decided to relocate this node
|
|
1070
|
-
relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
|
|
1083
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1071
1084
|
// made some changes to slots
|
|
1072
1085
|
// let's make sure we also double check
|
|
1073
1086
|
// fallbacks are correctly hidden or shown
|
|
@@ -1086,9 +1099,9 @@ const relocateSlotContent = (elm) => {
|
|
|
1086
1099
|
});
|
|
1087
1100
|
}
|
|
1088
1101
|
if (node['s-sr']) {
|
|
1089
|
-
relocateNodes.map(relocateNode => {
|
|
1102
|
+
relocateNodes.map((relocateNode) => {
|
|
1090
1103
|
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
|
1091
|
-
relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
|
|
1104
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1092
1105
|
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1093
1106
|
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1094
1107
|
}
|
|
@@ -1096,7 +1109,7 @@ const relocateSlotContent = (elm) => {
|
|
|
1096
1109
|
});
|
|
1097
1110
|
}
|
|
1098
1111
|
}
|
|
1099
|
-
else if (!relocateNodes.some(r => r.$nodeToRelocate$ === node)) {
|
|
1112
|
+
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1100
1113
|
// so far this element does not have a slot home, not setting slotRefNode on purpose
|
|
1101
1114
|
// if we never find a home for this element then we'll need to hide it
|
|
1102
1115
|
relocateNodes.push({
|
|
@@ -1191,7 +1204,10 @@ render() {
|
|
|
1191
1204
|
if (!nodeToRelocate['s-ol']) {
|
|
1192
1205
|
// add a reference node marking this node's original location
|
|
1193
1206
|
// keep a reference to this node for later lookups
|
|
1194
|
-
orgLocationNode =
|
|
1207
|
+
orgLocationNode =
|
|
1208
|
+
BUILD.isDebug || BUILD.hydrateServerSide
|
|
1209
|
+
? originalLocationDebugNode(nodeToRelocate)
|
|
1210
|
+
: doc.createTextNode('');
|
|
1195
1211
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1196
1212
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1197
1213
|
}
|
|
@@ -1215,7 +1231,8 @@ render() {
|
|
|
1215
1231
|
}
|
|
1216
1232
|
}
|
|
1217
1233
|
}
|
|
1218
|
-
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
1234
|
+
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
1235
|
+
nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1219
1236
|
// we've checked that it's worth while to relocate
|
|
1220
1237
|
// since that the node to relocate
|
|
1221
1238
|
// has a different next sibling or parent relocated
|
|
@@ -1250,7 +1267,10 @@ render() {
|
|
|
1250
1267
|
// slot comment debug nodes only created with the `--debug` flag
|
|
1251
1268
|
// otherwise these nodes are text nodes w/out content
|
|
1252
1269
|
const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
|
|
1253
|
-
const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
|
|
1270
|
+
const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
|
|
1271
|
+
(nodeToRelocate.localName
|
|
1272
|
+
? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
|
|
1273
|
+
: `[${nodeToRelocate.textContent}]`));
|
|
1254
1274
|
const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
|
|
1255
1275
|
const createEvent = (ref, name, flags) => {
|
|
1256
1276
|
const elm = getElement(ref);
|
|
@@ -1268,6 +1288,13 @@ const createEvent = (ref, name, flags) => {
|
|
|
1268
1288
|
},
|
|
1269
1289
|
};
|
|
1270
1290
|
};
|
|
1291
|
+
/**
|
|
1292
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
1293
|
+
* @param elm the target of the Event
|
|
1294
|
+
* @param name the name to give the custom Event
|
|
1295
|
+
* @param opts options for configuring a custom Event
|
|
1296
|
+
* @returns the custom Event
|
|
1297
|
+
*/
|
|
1271
1298
|
const emitEvent = (elm, name, opts) => {
|
|
1272
1299
|
const ev = plt.ce(name, opts);
|
|
1273
1300
|
elm.dispatchEvent(ev);
|
|
@@ -1275,7 +1302,7 @@ const emitEvent = (elm, name, opts) => {
|
|
|
1275
1302
|
};
|
|
1276
1303
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1277
1304
|
if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1278
|
-
ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r)));
|
|
1305
|
+
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
1279
1306
|
}
|
|
1280
1307
|
};
|
|
1281
1308
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1372,7 +1399,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1372
1399
|
// ok, so turns out there are some child host elements
|
|
1373
1400
|
// waiting on this parent element to load
|
|
1374
1401
|
// let's fire off all update callbacks waiting
|
|
1375
|
-
rc.map(cb => cb());
|
|
1402
|
+
rc.map((cb) => cb());
|
|
1376
1403
|
elm['s-rc'] = undefined;
|
|
1377
1404
|
}
|
|
1378
1405
|
endRender();
|
|
@@ -1416,7 +1443,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1416
1443
|
// or we need to update the css class/attrs on the host element
|
|
1417
1444
|
// DOM WRITE!
|
|
1418
1445
|
if (BUILD.hydrateServerSide) {
|
|
1419
|
-
return Promise.resolve(instance).then(value => renderVdom(hostRef, value));
|
|
1446
|
+
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
|
|
1420
1447
|
}
|
|
1421
1448
|
else {
|
|
1422
1449
|
renderVdom(hostRef, instance);
|
|
@@ -1517,7 +1544,8 @@ const forceUpdate = (ref) => {
|
|
|
1517
1544
|
if (BUILD.updatable) {
|
|
1518
1545
|
const hostRef = getHostRef(ref);
|
|
1519
1546
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1520
|
-
if (isConnected &&
|
|
1547
|
+
if (isConnected &&
|
|
1548
|
+
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1521
1549
|
scheduleUpdate(hostRef, false);
|
|
1522
1550
|
}
|
|
1523
1551
|
// Returns "true" when the forced update was successfully scheduled
|
|
@@ -1564,7 +1592,11 @@ const emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
1564
1592
|
});
|
|
1565
1593
|
}
|
|
1566
1594
|
};
|
|
1567
|
-
const addHydratedFlag = (elm) =>
|
|
1595
|
+
const addHydratedFlag = (elm) => BUILD.hydratedClass
|
|
1596
|
+
? elm.classList.add('hydrated')
|
|
1597
|
+
: BUILD.hydratedAttribute
|
|
1598
|
+
? elm.setAttribute('hydrated', '')
|
|
1599
|
+
: undefined;
|
|
1568
1600
|
const serverSideConnected = (elm) => {
|
|
1569
1601
|
const children = elm.children;
|
|
1570
1602
|
if (children != null) {
|
|
@@ -1590,7 +1622,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1590
1622
|
hostElm[HYDRATE_ID] = hostId;
|
|
1591
1623
|
hostElm.removeAttribute(HYDRATE_ID);
|
|
1592
1624
|
clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
|
|
1593
|
-
childRenderNodes.map(c => {
|
|
1625
|
+
childRenderNodes.map((c) => {
|
|
1594
1626
|
const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
|
1595
1627
|
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1596
1628
|
const node = c.$elm$;
|
|
@@ -1607,7 +1639,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1607
1639
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1608
1640
|
});
|
|
1609
1641
|
if (BUILD.shadowDom && shadowRoot) {
|
|
1610
|
-
shadowRootNodes.map(shadowRootNode => {
|
|
1642
|
+
shadowRootNodes.map((shadowRootNode) => {
|
|
1611
1643
|
if (shadowRootNode) {
|
|
1612
1644
|
shadowRoot.appendChild(shadowRootNode);
|
|
1613
1645
|
}
|
|
@@ -1833,7 +1865,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1833
1865
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1834
1866
|
if (watchMethods) {
|
|
1835
1867
|
// this instance is watching for when this property changed
|
|
1836
|
-
watchMethods.map(watchMethodName => {
|
|
1868
|
+
watchMethods.map((watchMethodName) => {
|
|
1837
1869
|
try {
|
|
1838
1870
|
// fire off each of the watch methods that are watching this property
|
|
1839
1871
|
instance[watchMethodName](newVal, oldVal, propName);
|
|
@@ -1844,7 +1876,8 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1844
1876
|
});
|
|
1845
1877
|
}
|
|
1846
1878
|
}
|
|
1847
|
-
if (BUILD.updatable &&
|
|
1879
|
+
if (BUILD.updatable &&
|
|
1880
|
+
(flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1848
1881
|
if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
1849
1882
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1850
1883
|
return;
|
|
@@ -1868,7 +1901,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1868
1901
|
const members = Object.entries(cmpMeta.$members$);
|
|
1869
1902
|
const prototype = Cstr.prototype;
|
|
1870
1903
|
members.map(([memberName, [memberFlags]]) => {
|
|
1871
|
-
if ((BUILD.prop || BUILD.state) &&
|
|
1904
|
+
if ((BUILD.prop || BUILD.state) &&
|
|
1905
|
+
(memberFlags & 31 /* Prop */ ||
|
|
1906
|
+
((!BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1872
1907
|
// proxyComponent - prop
|
|
1873
1908
|
Object.defineProperty(prototype, memberName, {
|
|
1874
1909
|
get() {
|
|
@@ -1898,7 +1933,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1898
1933
|
enumerable: true,
|
|
1899
1934
|
});
|
|
1900
1935
|
}
|
|
1901
|
-
else if (BUILD.lazyLoad &&
|
|
1936
|
+
else if (BUILD.lazyLoad &&
|
|
1937
|
+
BUILD.method &&
|
|
1938
|
+
flags & 1 /* isElementConstructor */ &&
|
|
1939
|
+
memberFlags & 64 /* Method */) {
|
|
1902
1940
|
// proxyComponent - method
|
|
1903
1941
|
Object.defineProperty(prototype, memberName, {
|
|
1904
1942
|
value(...args) {
|
|
@@ -1913,6 +1951,51 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1913
1951
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1914
1952
|
plt.jmp(() => {
|
|
1915
1953
|
const propName = attrNameToPropName.get(attrName);
|
|
1954
|
+
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1955
|
+
// in the case where an attribute was set inline.
|
|
1956
|
+
// ```html
|
|
1957
|
+
// <my-component some-attribute="some-value"></my-component>
|
|
1958
|
+
// ```
|
|
1959
|
+
//
|
|
1960
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1961
|
+
// programmatically changes it before it has been upgraded as shown below:
|
|
1962
|
+
//
|
|
1963
|
+
// ```html
|
|
1964
|
+
// <!-- this component has _not_ been upgraded yet -->
|
|
1965
|
+
// <my-component id="test" some-attribute="some-value"></my-component>
|
|
1966
|
+
// <script>
|
|
1967
|
+
// // grab non-upgraded component
|
|
1968
|
+
// el = document.querySelector("#test");
|
|
1969
|
+
// el.someAttribute = "another-value";
|
|
1970
|
+
// // upgrade component
|
|
1971
|
+
// customElements.define('my-component', MyComponent);
|
|
1972
|
+
// </script>
|
|
1973
|
+
// ```
|
|
1974
|
+
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1975
|
+
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1976
|
+
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1977
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
|
|
1978
|
+
//
|
|
1979
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1980
|
+
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1981
|
+
//
|
|
1982
|
+
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1983
|
+
//
|
|
1984
|
+
// TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
|
|
1985
|
+
// properties here given that this goes against best practices outlined here
|
|
1986
|
+
// https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
|
|
1987
|
+
if (this.hasOwnProperty(propName)) {
|
|
1988
|
+
newValue = this[propName];
|
|
1989
|
+
delete this[propName];
|
|
1990
|
+
}
|
|
1991
|
+
else if (prototype.hasOwnProperty(propName) &&
|
|
1992
|
+
typeof this[propName] === 'number' &&
|
|
1993
|
+
this[propName] == newValue) {
|
|
1994
|
+
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1995
|
+
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1996
|
+
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1916
1999
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1917
2000
|
});
|
|
1918
2001
|
};
|
|
@@ -1934,7 +2017,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1934
2017
|
};
|
|
1935
2018
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1936
2019
|
// initializeComponent
|
|
1937
|
-
if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&
|
|
2020
|
+
if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&
|
|
2021
|
+
(hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1938
2022
|
if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
1939
2023
|
// we haven't initialized this element yet
|
|
1940
2024
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
@@ -1952,7 +2036,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1952
2036
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1953
2037
|
}
|
|
1954
2038
|
if (BUILD.member && !Cstr.isProxied) {
|
|
1955
|
-
// we'
|
|
2039
|
+
// we've never proxied this Constructor before
|
|
1956
2040
|
// let's add the getters/setters to its prototype before
|
|
1957
2041
|
// the first time we create an instance of the implementation
|
|
1958
2042
|
if (BUILD.watchCallback) {
|
|
@@ -1990,7 +2074,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1990
2074
|
else {
|
|
1991
2075
|
// sync constructor component
|
|
1992
2076
|
Cstr = elm.constructor;
|
|
1993
|
-
hostRef.$flags$ |=
|
|
2077
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2078
|
+
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
2079
|
+
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
|
2080
|
+
// Stencil has completed instantiating the component.
|
|
2081
|
+
customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* isWatchReady */));
|
|
1994
2082
|
}
|
|
1995
2083
|
if (BUILD.style && Cstr.style) {
|
|
1996
2084
|
// this component has styles but we haven't registered them yet
|
|
@@ -2004,8 +2092,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2004
2092
|
const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2005
2093
|
if (!styles.has(scopeId)) {
|
|
2006
2094
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
2007
|
-
if (!BUILD.hydrateServerSide &&
|
|
2008
|
-
|
|
2095
|
+
if (!BUILD.hydrateServerSide &&
|
|
2096
|
+
BUILD.shadowDom &&
|
|
2097
|
+
BUILD.shadowDomShim &&
|
|
2098
|
+
cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2099
|
+
style = await import('./shadow-css-1e16431b.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
2009
2100
|
}
|
|
2010
2101
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
2011
2102
|
endRegisterStyles();
|
|
@@ -2016,7 +2107,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
2016
2107
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2017
2108
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2018
2109
|
if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
|
|
2019
|
-
// this is the
|
|
2110
|
+
// this is the initial load and this component it has an ancestor component
|
|
2020
2111
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
2021
2112
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
2022
2113
|
// this will get fired off when the ancestor component
|
|
@@ -2050,7 +2141,9 @@ const connectedCallback = (elm) => {
|
|
|
2050
2141
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2051
2142
|
if (hostId) {
|
|
2052
2143
|
if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2053
|
-
const scopeId = BUILD.mode
|
|
2144
|
+
const scopeId = BUILD.mode
|
|
2145
|
+
? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
|
|
2146
|
+
: addStyle(elm.shadowRoot, cmpMeta);
|
|
2054
2147
|
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
|
2055
2148
|
}
|
|
2056
2149
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
@@ -2061,7 +2154,9 @@ const connectedCallback = (elm) => {
|
|
|
2061
2154
|
// if the slot polyfill is required we'll need to put some nodes
|
|
2062
2155
|
// in here to act as original content anchors as we move nodes around
|
|
2063
2156
|
// host element has been connected to the DOM
|
|
2064
|
-
if (BUILD.hydrateServerSide ||
|
|
2157
|
+
if (BUILD.hydrateServerSide ||
|
|
2158
|
+
((BUILD.slot || BUILD.shadowDom) &&
|
|
2159
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
2065
2160
|
setContentReference(elm);
|
|
2066
2161
|
}
|
|
2067
2162
|
}
|
|
@@ -2072,7 +2167,10 @@ const connectedCallback = (elm) => {
|
|
|
2072
2167
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
2073
2168
|
// climb up the ancestors looking for the first
|
|
2074
2169
|
// component that hasn't finished its lifecycle update yet
|
|
2075
|
-
if ((BUILD.hydrateClientSide &&
|
|
2170
|
+
if ((BUILD.hydrateClientSide &&
|
|
2171
|
+
ancestorComponent.nodeType === 1 /* ElementNode */ &&
|
|
2172
|
+
ancestorComponent.hasAttribute('s-id') &&
|
|
2173
|
+
ancestorComponent['s-p']) ||
|
|
2076
2174
|
ancestorComponent['s-p']) {
|
|
2077
2175
|
// we found this components first ancestor component
|
|
2078
2176
|
// keep a reference to this component's ancestor component
|
|
@@ -2083,7 +2181,7 @@ const connectedCallback = (elm) => {
|
|
|
2083
2181
|
}
|
|
2084
2182
|
// Lazy properties
|
|
2085
2183
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
2086
|
-
if (BUILD.prop &&
|
|
2184
|
+
if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
2087
2185
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2088
2186
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2089
2187
|
const value = elm[memberName];
|
|
@@ -2131,7 +2229,7 @@ const disconnectedCallback = (elm) => {
|
|
|
2131
2229
|
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2132
2230
|
if (BUILD.hostListener) {
|
|
2133
2231
|
if (hostRef.$rmListeners$) {
|
|
2134
|
-
hostRef.$rmListeners$.map(rmListener => rmListener());
|
|
2232
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2135
2233
|
hostRef.$rmListeners$ = undefined;
|
|
2136
2234
|
}
|
|
2137
2235
|
}
|
|
@@ -2188,6 +2286,22 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2188
2286
|
originalDisconnectedCallback.call(this);
|
|
2189
2287
|
}
|
|
2190
2288
|
},
|
|
2289
|
+
__attachShadow() {
|
|
2290
|
+
if (supportsShadow) {
|
|
2291
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2292
|
+
this.attachShadow({
|
|
2293
|
+
mode: 'open',
|
|
2294
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
else {
|
|
2298
|
+
this.attachShadow({ mode: 'open' });
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
else {
|
|
2302
|
+
this.shadowRoot = this;
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2191
2305
|
});
|
|
2192
2306
|
Cstr.is = cmpMeta.$tagName$;
|
|
2193
2307
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
@@ -2214,14 +2328,6 @@ const forceModeUpdate = (elm) => {
|
|
|
2214
2328
|
}
|
|
2215
2329
|
}
|
|
2216
2330
|
};
|
|
2217
|
-
const attachShadow = (el) => {
|
|
2218
|
-
if (supportsShadow) {
|
|
2219
|
-
el.attachShadow({ mode: 'open' });
|
|
2220
|
-
}
|
|
2221
|
-
else {
|
|
2222
|
-
el.shadowRoot = el;
|
|
2223
|
-
}
|
|
2224
|
-
};
|
|
2225
2331
|
const hmrStart = (elm, cmpMeta, hmrVersionId) => {
|
|
2226
2332
|
// ¯\_(ツ)_/¯
|
|
2227
2333
|
const hostRef = getHostRef(elm);
|
|
@@ -2248,7 +2354,21 @@ const patchCloneNode = (HostElementPrototype) => {
|
|
|
2248
2354
|
if (BUILD.slot && !isShadowDom && deep) {
|
|
2249
2355
|
let i = 0;
|
|
2250
2356
|
let slotted, nonStencilNode;
|
|
2251
|
-
let stencilPrivates = [
|
|
2357
|
+
let stencilPrivates = [
|
|
2358
|
+
's-id',
|
|
2359
|
+
's-cr',
|
|
2360
|
+
's-lr',
|
|
2361
|
+
's-rc',
|
|
2362
|
+
's-sc',
|
|
2363
|
+
's-p',
|
|
2364
|
+
's-cn',
|
|
2365
|
+
's-sr',
|
|
2366
|
+
's-sn',
|
|
2367
|
+
's-hn',
|
|
2368
|
+
's-ol',
|
|
2369
|
+
's-nr',
|
|
2370
|
+
's-si',
|
|
2371
|
+
];
|
|
2252
2372
|
for (; i < srcNode.childNodes.length; i++) {
|
|
2253
2373
|
slotted = srcNode.childNodes[i]['s-nr'];
|
|
2254
2374
|
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
|
|
@@ -2281,6 +2401,62 @@ const patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
2281
2401
|
return this.__appendChild(newChild);
|
|
2282
2402
|
};
|
|
2283
2403
|
};
|
|
2404
|
+
/**
|
|
2405
|
+
* Patches the text content of an unnamed slotted node inside a scoped component
|
|
2406
|
+
* @param hostElementPrototype the `Element` to be patched
|
|
2407
|
+
* @param cmpMeta component runtime metadata used to determine if the component should be patched or not
|
|
2408
|
+
*/
|
|
2409
|
+
const patchTextContent = (hostElementPrototype, cmpMeta) => {
|
|
2410
|
+
if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2411
|
+
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
|
|
2412
|
+
Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
|
|
2413
|
+
Object.defineProperty(hostElementPrototype, 'textContent', {
|
|
2414
|
+
get() {
|
|
2415
|
+
var _a;
|
|
2416
|
+
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2417
|
+
// the empty string
|
|
2418
|
+
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2419
|
+
// when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
|
|
2420
|
+
// nodes were reordered during the vdom render. first try to get the text content from the sibling.
|
|
2421
|
+
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2422
|
+
return slotNode.nextSibling.textContent;
|
|
2423
|
+
}
|
|
2424
|
+
else if (slotNode) {
|
|
2425
|
+
return slotNode.textContent;
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2428
|
+
// fallback to the original implementation
|
|
2429
|
+
return this.__textContent;
|
|
2430
|
+
}
|
|
2431
|
+
},
|
|
2432
|
+
set(value) {
|
|
2433
|
+
var _a;
|
|
2434
|
+
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2435
|
+
// the empty string
|
|
2436
|
+
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2437
|
+
// when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
|
|
2438
|
+
// depending on how nodes were reordered during the vdom render. first try to set the text content on the
|
|
2439
|
+
// sibling.
|
|
2440
|
+
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2441
|
+
slotNode.nextSibling.textContent = value;
|
|
2442
|
+
}
|
|
2443
|
+
else if (slotNode) {
|
|
2444
|
+
slotNode.textContent = value;
|
|
2445
|
+
}
|
|
2446
|
+
else {
|
|
2447
|
+
// we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
|
|
2448
|
+
// loaded, we could have missed it. check for a content reference element on the scoped component and insert
|
|
2449
|
+
// it there
|
|
2450
|
+
this.__textContent = value;
|
|
2451
|
+
const contentRefElm = this['s-cr'];
|
|
2452
|
+
if (contentRefElm) {
|
|
2453
|
+
this.insertBefore(contentRefElm, this.firstChild);
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
};
|
|
2284
2460
|
const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2285
2461
|
class FakeNodeList extends Array {
|
|
2286
2462
|
item(n) {
|
|
@@ -2302,7 +2478,8 @@ const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
|
2302
2478
|
Object.defineProperty(elm, 'childNodes', {
|
|
2303
2479
|
get() {
|
|
2304
2480
|
const childNodes = childNodesFn.call(this);
|
|
2305
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 &&
|
|
2481
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 &&
|
|
2482
|
+
getHostRef(this).$flags$ & 2 /* hasRendered */) {
|
|
2306
2483
|
const result = new FakeNodeList();
|
|
2307
2484
|
for (let i = 0; i < childNodes.length; i++) {
|
|
2308
2485
|
const slot = childNodes[i]['s-nr'];
|
|
@@ -2318,6 +2495,12 @@ const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
|
2318
2495
|
}
|
|
2319
2496
|
};
|
|
2320
2497
|
const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
|
|
2498
|
+
/**
|
|
2499
|
+
* Recursively searches a series of child nodes for a slot with the provided name.
|
|
2500
|
+
* @param childNodes the nodes to search for a slot with a specific name.
|
|
2501
|
+
* @param slotName the name of the slot to match on.
|
|
2502
|
+
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
|
2503
|
+
*/
|
|
2321
2504
|
const getHostSlotNode = (childNodes, slotName) => {
|
|
2322
2505
|
let i = 0;
|
|
2323
2506
|
let childNode;
|
|
@@ -2374,98 +2557,105 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2374
2557
|
registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
|
|
2375
2558
|
}
|
|
2376
2559
|
}
|
|
2377
|
-
lazyBundles.map(lazyBundle =>
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
cmpMeta.$flags$
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
self
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2560
|
+
lazyBundles.map((lazyBundle) => {
|
|
2561
|
+
lazyBundle[1].map((compactMeta) => {
|
|
2562
|
+
const cmpMeta = {
|
|
2563
|
+
$flags$: compactMeta[0],
|
|
2564
|
+
$tagName$: compactMeta[1],
|
|
2565
|
+
$members$: compactMeta[2],
|
|
2566
|
+
$listeners$: compactMeta[3],
|
|
2567
|
+
};
|
|
2568
|
+
if (BUILD.member) {
|
|
2569
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
2570
|
+
}
|
|
2571
|
+
if (BUILD.hostListener) {
|
|
2572
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
2573
|
+
}
|
|
2574
|
+
if (BUILD.reflect) {
|
|
2575
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
2576
|
+
}
|
|
2577
|
+
if (BUILD.watchCallback) {
|
|
2578
|
+
cmpMeta.$watchers$ = {};
|
|
2579
|
+
}
|
|
2580
|
+
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2581
|
+
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2582
|
+
}
|
|
2583
|
+
const tagName = BUILD.transformTagName && options.transformTagName
|
|
2584
|
+
? options.transformTagName(cmpMeta.$tagName$)
|
|
2585
|
+
: cmpMeta.$tagName$;
|
|
2586
|
+
const HostElement = class extends HTMLElement {
|
|
2587
|
+
// StencilLazyHost
|
|
2588
|
+
constructor(self) {
|
|
2589
|
+
// @ts-ignore
|
|
2590
|
+
super(self);
|
|
2591
|
+
self = this;
|
|
2592
|
+
registerHost(self, cmpMeta);
|
|
2593
|
+
if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2594
|
+
// this component is using shadow dom
|
|
2595
|
+
// and this browser supports shadow dom
|
|
2596
|
+
// add the read-only property "shadowRoot" to the host element
|
|
2597
|
+
// adding the shadow root build conditionals to minimize runtime
|
|
2598
|
+
if (supportsShadow) {
|
|
2599
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2600
|
+
self.attachShadow({
|
|
2601
|
+
mode: 'open',
|
|
2602
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
else {
|
|
2606
|
+
self.attachShadow({ mode: 'open' });
|
|
2607
|
+
}
|
|
2418
2608
|
}
|
|
2419
|
-
else {
|
|
2420
|
-
self.
|
|
2609
|
+
else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
|
|
2610
|
+
self.shadowRoot = self;
|
|
2421
2611
|
}
|
|
2422
2612
|
}
|
|
2423
|
-
|
|
2424
|
-
self
|
|
2613
|
+
if (BUILD.slotChildNodesFix) {
|
|
2614
|
+
patchChildSlotNodes(self, cmpMeta);
|
|
2425
2615
|
}
|
|
2426
2616
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2617
|
+
connectedCallback() {
|
|
2618
|
+
if (appLoadFallback) {
|
|
2619
|
+
clearTimeout(appLoadFallback);
|
|
2620
|
+
appLoadFallback = null;
|
|
2621
|
+
}
|
|
2622
|
+
if (isBootstrapping) {
|
|
2623
|
+
// connectedCallback will be processed once all components have been registered
|
|
2624
|
+
deferredConnectedCallbacks.push(this);
|
|
2625
|
+
}
|
|
2626
|
+
else {
|
|
2627
|
+
plt.jmp(() => connectedCallback(this));
|
|
2628
|
+
}
|
|
2435
2629
|
}
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
deferredConnectedCallbacks.push(this);
|
|
2630
|
+
disconnectedCallback() {
|
|
2631
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
2439
2632
|
}
|
|
2440
|
-
|
|
2441
|
-
|
|
2633
|
+
componentOnReady() {
|
|
2634
|
+
return getHostRef(this).$onReadyPromise$;
|
|
2442
2635
|
}
|
|
2636
|
+
};
|
|
2637
|
+
if (BUILD.cloneNodeFix) {
|
|
2638
|
+
patchCloneNode(HostElement.prototype);
|
|
2443
2639
|
}
|
|
2444
|
-
|
|
2445
|
-
|
|
2640
|
+
if (BUILD.appendChildSlotFix) {
|
|
2641
|
+
patchSlotAppendChild(HostElement.prototype);
|
|
2446
2642
|
}
|
|
2447
|
-
|
|
2448
|
-
|
|
2643
|
+
if (BUILD.hotModuleReplacement) {
|
|
2644
|
+
HostElement.prototype['s-hmr'] = function (hmrVersionId) {
|
|
2645
|
+
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2646
|
+
};
|
|
2449
2647
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
}
|
|
2462
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
2463
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
2464
|
-
cmpTags.push(tagName);
|
|
2465
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
2466
|
-
}
|
|
2467
|
-
}));
|
|
2468
|
-
if (BUILD.hydratedClass || BUILD.hydratedAttribute) {
|
|
2648
|
+
if (BUILD.scopedSlotTextContentFix) {
|
|
2649
|
+
patchTextContent(HostElement.prototype, cmpMeta);
|
|
2650
|
+
}
|
|
2651
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
2652
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
2653
|
+
cmpTags.push(tagName);
|
|
2654
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2657
|
+
});
|
|
2658
|
+
if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
|
|
2469
2659
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
2470
2660
|
visibilityStyle.setAttribute('data-styles', '');
|
|
2471
2661
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
@@ -2473,7 +2663,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2473
2663
|
// Process deferred connectedCallbacks now all components have been registered
|
|
2474
2664
|
isBootstrapping = false;
|
|
2475
2665
|
if (deferredConnectedCallbacks.length) {
|
|
2476
|
-
deferredConnectedCallbacks.map(host => host.connectedCallback());
|
|
2666
|
+
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
2477
2667
|
}
|
|
2478
2668
|
else {
|
|
2479
2669
|
if (BUILD.profile) {
|
|
@@ -2501,7 +2691,7 @@ const getConnect = (_ref, tagName) => {
|
|
|
2501
2691
|
return typeof elm.componentOnReady === 'function' ? elm.componentOnReady() : Promise.resolve(elm);
|
|
2502
2692
|
};
|
|
2503
2693
|
const create = (...args) => {
|
|
2504
|
-
return componentOnReady().then(el => el.create(...args));
|
|
2694
|
+
return componentOnReady().then((el) => el.create(...args));
|
|
2505
2695
|
};
|
|
2506
2696
|
return {
|
|
2507
2697
|
create,
|
|
@@ -2549,7 +2739,7 @@ const insertVdomAnnotations = (doc, staticComponents) => {
|
|
|
2549
2739
|
};
|
|
2550
2740
|
const orgLocationNodes = [];
|
|
2551
2741
|
parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
|
|
2552
|
-
orgLocationNodes.forEach(orgLocationNode => {
|
|
2742
|
+
orgLocationNodes.forEach((orgLocationNode) => {
|
|
2553
2743
|
if (orgLocationNode != null) {
|
|
2554
2744
|
const nodeRef = orgLocationNode['s-nr'];
|
|
2555
2745
|
let hostId = nodeRef['s-host-id'];
|
|
@@ -2606,7 +2796,7 @@ const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
|
|
|
2606
2796
|
orgLocationNodes.push(node);
|
|
2607
2797
|
}
|
|
2608
2798
|
if (node.nodeType === 1 /* ElementNode */) {
|
|
2609
|
-
node.childNodes.forEach(childNode => {
|
|
2799
|
+
node.childNodes.forEach((childNode) => {
|
|
2610
2800
|
const hostRef = getHostRef(childNode);
|
|
2611
2801
|
if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
|
|
2612
2802
|
const cmpData = {
|
|
@@ -2635,7 +2825,7 @@ const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
|
2635
2825
|
const parent = hostElm.parentElement;
|
|
2636
2826
|
if (parent && parent.childNodes) {
|
|
2637
2827
|
const parentChildNodes = Array.from(parent.childNodes);
|
|
2638
|
-
const comment = parentChildNodes.find(node => node.nodeType === 8 /* CommentNode */ && node['s-sr']);
|
|
2828
|
+
const comment = parentChildNodes.find((node) => node.nodeType === 8 /* CommentNode */ && node['s-sr']);
|
|
2639
2829
|
if (comment) {
|
|
2640
2830
|
const index = parentChildNodes.indexOf(hostElm) - 1;
|
|
2641
2831
|
vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
|
|
@@ -2695,10 +2885,10 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
2695
2885
|
hostRef.$renderCount$ = 0;
|
|
2696
2886
|
}
|
|
2697
2887
|
if (BUILD.method && BUILD.lazyLoad) {
|
|
2698
|
-
hostRef.$onInstancePromise$ = new Promise(r => (hostRef.$onInstanceResolve$ = r));
|
|
2888
|
+
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
2699
2889
|
}
|
|
2700
2890
|
if (BUILD.asyncLoading) {
|
|
2701
|
-
hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r));
|
|
2891
|
+
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
2702
2892
|
elm['s-p'] = [];
|
|
2703
2893
|
elm['s-rc'] = [];
|
|
2704
2894
|
}
|
|
@@ -2709,11 +2899,14 @@ const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
|
2709
2899
|
const consoleError = (e, el) => (customError || console.error)(e, el);
|
|
2710
2900
|
const STENCIL_DEV_MODE = BUILD.isTesting
|
|
2711
2901
|
? ['STENCIL:'] // E2E testing
|
|
2712
|
-
: [
|
|
2902
|
+
: [
|
|
2903
|
+
'%cstencil',
|
|
2904
|
+
'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
|
|
2905
|
+
];
|
|
2713
2906
|
const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
2714
2907
|
const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
2715
2908
|
const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
2716
|
-
const setErrorHandler = (handler) => customError = handler;
|
|
2909
|
+
const setErrorHandler = (handler) => (customError = handler);
|
|
2717
2910
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
2718
2911
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
2719
2912
|
// loadModuleImport
|
|
@@ -2731,7 +2924,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2731
2924
|
/* webpackInclude: /\.entry\.js$/ */
|
|
2732
2925
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2733
2926
|
/* webpackMode: "lazy" */
|
|
2734
|
-
`./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then(importedModule => {
|
|
2927
|
+
`./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
|
|
2735
2928
|
if (!BUILD.hotModuleReplacement) {
|
|
2736
2929
|
cmpModules.set(bundleId, importedModule);
|
|
2737
2930
|
}
|
|
@@ -2794,7 +2987,9 @@ const flush = () => {
|
|
|
2794
2987
|
consume(queueDomReads);
|
|
2795
2988
|
// DOM WRITES!!!
|
|
2796
2989
|
if (BUILD.asyncQueue) {
|
|
2797
|
-
const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */
|
|
2990
|
+
const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */
|
|
2991
|
+
? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
|
|
2992
|
+
: Infinity;
|
|
2798
2993
|
consumeTimeout(queueDomWrites, timeout);
|
|
2799
2994
|
consumeTimeout(queueDomWritesLow, timeout);
|
|
2800
2995
|
if (queueDomWrites.length > 0) {
|