@stencil/core 4.42.0-dev.1770096324.69d331e → 4.42.0-dev.1770269227.50ad901
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +5 -5
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +181 -162
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +182 -163
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +56 -22
- package/internal/package.json +1 -1
- package/internal/testing/index.js +181 -162
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +56 -22
- package/mock-doc/index.d.ts +10 -2
- package/mock-doc/index.js +56 -22
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +23 -23
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
|
@@ -4068,7 +4068,7 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
|
|
|
4068
4068
|
});
|
|
4069
4069
|
}
|
|
4070
4070
|
scoped.slottedSelectors.forEach((slottedSelector) => {
|
|
4071
|
-
const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
|
|
4071
|
+
const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector) + "(?=\\s*[,{]|$)", "g");
|
|
4072
4072
|
cssText = cssText.replace(regex, slottedSelector.updatedSelector);
|
|
4073
4073
|
});
|
|
4074
4074
|
cssText = expandPartSelectors(cssText);
|
|
@@ -5049,7 +5049,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
5049
5049
|
if (childrenPromises.length === 0) {
|
|
5050
5050
|
postUpdate();
|
|
5051
5051
|
} else {
|
|
5052
|
-
Promise.all(childrenPromises).then(postUpdate);
|
|
5052
|
+
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
|
|
5053
5053
|
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
5054
5054
|
childrenPromises.length = 0;
|
|
5055
5055
|
}
|
|
@@ -5564,94 +5564,105 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
5564
5564
|
// src/runtime/initialize-component.ts
|
|
5565
5565
|
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
5566
5566
|
let Cstr;
|
|
5567
|
-
|
|
5568
|
-
hostRef.$flags$
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5567
|
+
try {
|
|
5568
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
5569
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
5570
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
5571
|
+
if (import_app_data17.BUILD.lazyLoad && bundleId) {
|
|
5572
|
+
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
5573
|
+
if (CstrImport && "then" in CstrImport) {
|
|
5574
|
+
const endLoad = uniqueTime(
|
|
5575
|
+
`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
|
|
5576
|
+
`[Stencil] Load module for <${cmpMeta.$tagName$}>`
|
|
5577
|
+
);
|
|
5578
|
+
Cstr = await CstrImport;
|
|
5579
|
+
endLoad();
|
|
5580
|
+
} else {
|
|
5581
|
+
Cstr = CstrImport;
|
|
5582
|
+
}
|
|
5583
|
+
if (!Cstr) {
|
|
5584
|
+
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
5585
|
+
}
|
|
5586
|
+
if (import_app_data17.BUILD.member && !Cstr.isProxied) {
|
|
5587
|
+
if (import_app_data17.BUILD.propChangeCallback) {
|
|
5588
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
5589
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
5590
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
5591
|
+
}
|
|
5592
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
5593
|
+
Cstr.isProxied = true;
|
|
5594
|
+
}
|
|
5595
|
+
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
5596
|
+
if (import_app_data17.BUILD.member) {
|
|
5597
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
5598
|
+
}
|
|
5599
|
+
try {
|
|
5600
|
+
new Cstr(hostRef);
|
|
5601
|
+
} catch (e) {
|
|
5602
|
+
consoleError(e, elm);
|
|
5603
|
+
}
|
|
5604
|
+
if (import_app_data17.BUILD.member) {
|
|
5605
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
5606
|
+
}
|
|
5586
5607
|
if (import_app_data17.BUILD.propChangeCallback) {
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5608
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
5609
|
+
}
|
|
5610
|
+
endNewInstance();
|
|
5611
|
+
const needsDeferredCallback = import_app_data17.BUILD.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
5612
|
+
if (!needsDeferredCallback) {
|
|
5613
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
5614
|
+
} else {
|
|
5615
|
+
hostRef.$deferredConnectedCallback$ = true;
|
|
5590
5616
|
}
|
|
5591
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
5592
|
-
Cstr.isProxied = true;
|
|
5593
|
-
}
|
|
5594
|
-
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
5595
|
-
if (import_app_data17.BUILD.member) {
|
|
5596
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
5597
|
-
}
|
|
5598
|
-
try {
|
|
5599
|
-
new Cstr(hostRef);
|
|
5600
|
-
} catch (e) {
|
|
5601
|
-
consoleError(e, elm);
|
|
5602
|
-
}
|
|
5603
|
-
if (import_app_data17.BUILD.member) {
|
|
5604
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
5605
|
-
}
|
|
5606
|
-
if (import_app_data17.BUILD.propChangeCallback) {
|
|
5607
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
5608
|
-
}
|
|
5609
|
-
endNewInstance();
|
|
5610
|
-
const needsDeferredCallback = import_app_data17.BUILD.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
5611
|
-
if (!needsDeferredCallback) {
|
|
5612
|
-
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
5613
5617
|
} else {
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
}
|
|
5630
|
-
if (import_app_data17.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
5631
|
-
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
5632
|
-
}
|
|
5633
|
-
}
|
|
5634
|
-
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
5635
|
-
if (!styles.has(scopeId2) || import_app_data17.BUILD.hotModuleReplacement && hmrVersionId) {
|
|
5636
|
-
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
5637
|
-
if (import_app_data17.BUILD.hydrateServerSide && import_app_data17.BUILD.shadowDom) {
|
|
5638
|
-
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
5639
|
-
style = scopeCss(style, scopeId2, true);
|
|
5640
|
-
} else if (needsScopedSSR()) {
|
|
5641
|
-
style = expandPartSelectors(style);
|
|
5618
|
+
Cstr = elm.constructor;
|
|
5619
|
+
const cmpTag = elm.localName;
|
|
5620
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
5621
|
+
}
|
|
5622
|
+
if (import_app_data17.BUILD.style && Cstr && Cstr.style) {
|
|
5623
|
+
let style;
|
|
5624
|
+
if (typeof Cstr.style === "string") {
|
|
5625
|
+
style = Cstr.style;
|
|
5626
|
+
} else if (import_app_data17.BUILD.mode && typeof Cstr.style !== "string") {
|
|
5627
|
+
hostRef.$modeName$ = computeMode(elm);
|
|
5628
|
+
if (hostRef.$modeName$) {
|
|
5629
|
+
style = Cstr.style[hostRef.$modeName$];
|
|
5630
|
+
}
|
|
5631
|
+
if (import_app_data17.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
5632
|
+
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
5642
5633
|
}
|
|
5643
5634
|
}
|
|
5644
|
-
|
|
5645
|
-
|
|
5635
|
+
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
5636
|
+
if (!styles.has(scopeId2) || import_app_data17.BUILD.hotModuleReplacement && hmrVersionId) {
|
|
5637
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
5638
|
+
if (import_app_data17.BUILD.hydrateServerSide && import_app_data17.BUILD.shadowDom) {
|
|
5639
|
+
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
5640
|
+
style = scopeCss(style, scopeId2, true);
|
|
5641
|
+
} else if (needsScopedSSR()) {
|
|
5642
|
+
style = expandPartSelectors(style);
|
|
5643
|
+
}
|
|
5644
|
+
}
|
|
5645
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
5646
|
+
endRegisterStyles();
|
|
5647
|
+
}
|
|
5646
5648
|
}
|
|
5647
5649
|
}
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5650
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
5651
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
5652
|
+
if (import_app_data17.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
5653
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
5654
|
+
} else {
|
|
5655
|
+
schedule();
|
|
5656
|
+
}
|
|
5657
|
+
} catch (e) {
|
|
5658
|
+
consoleError(e, elm);
|
|
5659
|
+
if (import_app_data17.BUILD.asyncLoading && hostRef.$onRenderResolve$) {
|
|
5660
|
+
hostRef.$onRenderResolve$();
|
|
5661
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
5662
|
+
}
|
|
5663
|
+
if (import_app_data17.BUILD.asyncLoading && hostRef.$onReadyResolve$) {
|
|
5664
|
+
hostRef.$onReadyResolve$(elm);
|
|
5665
|
+
}
|
|
5655
5666
|
}
|
|
5656
5667
|
};
|
|
5657
5668
|
var fireConnectedCallback = (instance, elm) => {
|
|
@@ -5783,91 +5794,99 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
5783
5794
|
$flags$: compactMeta[0],
|
|
5784
5795
|
$tagName$: compactMeta[1]
|
|
5785
5796
|
};
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
if (import_app_data20.BUILD.hostListener) {
|
|
5790
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
5791
|
-
}
|
|
5792
|
-
if (import_app_data20.BUILD.propChangeCallback) {
|
|
5793
|
-
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
5794
|
-
cmpMeta.$deserializers$ = Cstr.$deserializers$;
|
|
5795
|
-
cmpMeta.$serializers$ = Cstr.$serializers$;
|
|
5796
|
-
}
|
|
5797
|
-
if (import_app_data20.BUILD.reflect) {
|
|
5798
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
5799
|
-
}
|
|
5800
|
-
if (import_app_data20.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
5801
|
-
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
5802
|
-
}
|
|
5803
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
5804
|
-
if (import_app_data20.BUILD.experimentalSlotFixes) {
|
|
5805
|
-
patchPseudoShadowDom(Cstr.prototype);
|
|
5806
|
-
} else {
|
|
5807
|
-
if (import_app_data20.BUILD.slotChildNodesFix) {
|
|
5808
|
-
patchChildSlotNodes(Cstr.prototype);
|
|
5809
|
-
}
|
|
5810
|
-
if (import_app_data20.BUILD.cloneNodeFix) {
|
|
5811
|
-
patchCloneNode(Cstr.prototype);
|
|
5812
|
-
}
|
|
5813
|
-
if (import_app_data20.BUILD.appendChildSlotFix) {
|
|
5814
|
-
patchSlotAppendChild(Cstr.prototype);
|
|
5815
|
-
}
|
|
5816
|
-
if (import_app_data20.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
5817
|
-
patchTextContent(Cstr.prototype);
|
|
5818
|
-
}
|
|
5797
|
+
try {
|
|
5798
|
+
if (import_app_data20.BUILD.member) {
|
|
5799
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
5819
5800
|
}
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5801
|
+
if (import_app_data20.BUILD.hostListener) {
|
|
5802
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
5803
|
+
}
|
|
5804
|
+
if (import_app_data20.BUILD.propChangeCallback) {
|
|
5805
|
+
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
5806
|
+
cmpMeta.$deserializers$ = Cstr.$deserializers$;
|
|
5807
|
+
cmpMeta.$serializers$ = Cstr.$serializers$;
|
|
5808
|
+
}
|
|
5809
|
+
if (import_app_data20.BUILD.reflect) {
|
|
5810
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
5811
|
+
}
|
|
5812
|
+
if (import_app_data20.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
5813
|
+
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
5814
|
+
}
|
|
5815
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
5816
|
+
if (import_app_data20.BUILD.experimentalSlotFixes) {
|
|
5817
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
5818
|
+
} else {
|
|
5819
|
+
if (import_app_data20.BUILD.slotChildNodesFix) {
|
|
5820
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
5821
|
+
}
|
|
5822
|
+
if (import_app_data20.BUILD.cloneNodeFix) {
|
|
5823
|
+
patchCloneNode(Cstr.prototype);
|
|
5824
|
+
}
|
|
5825
|
+
if (import_app_data20.BUILD.appendChildSlotFix) {
|
|
5826
|
+
patchSlotAppendChild(Cstr.prototype);
|
|
5827
|
+
}
|
|
5828
|
+
if (import_app_data20.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
5829
|
+
patchTextContent(Cstr.prototype);
|
|
5838
5830
|
}
|
|
5839
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
5840
|
-
this.__hasHostListenerAttached = true;
|
|
5841
|
-
}
|
|
5842
|
-
connectedCallback(this);
|
|
5843
|
-
if (originalConnectedCallback) {
|
|
5844
|
-
originalConnectedCallback.call(this);
|
|
5845
|
-
}
|
|
5846
|
-
},
|
|
5847
|
-
disconnectedCallback() {
|
|
5848
|
-
disconnectedCallback(this);
|
|
5849
|
-
if (originalDisconnectedCallback) {
|
|
5850
|
-
originalDisconnectedCallback.call(this);
|
|
5851
5831
|
}
|
|
5852
|
-
}
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5832
|
+
} else if (import_app_data20.BUILD.cloneNodeFix) {
|
|
5833
|
+
patchCloneNode(Cstr.prototype);
|
|
5834
|
+
}
|
|
5835
|
+
if (import_app_data20.BUILD.hydrateClientSide && import_app_data20.BUILD.shadowDom) {
|
|
5836
|
+
hydrateScopedToShadow();
|
|
5837
|
+
}
|
|
5838
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
5839
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
5840
|
+
Object.assign(Cstr.prototype, {
|
|
5841
|
+
__hasHostListenerAttached: false,
|
|
5842
|
+
__registerHost() {
|
|
5843
|
+
registerHost(this, cmpMeta);
|
|
5844
|
+
},
|
|
5845
|
+
connectedCallback() {
|
|
5846
|
+
if (!this.__hasHostListenerAttached) {
|
|
5847
|
+
const hostRef = getHostRef(this);
|
|
5848
|
+
if (!hostRef) {
|
|
5849
|
+
return;
|
|
5862
5850
|
}
|
|
5851
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
5852
|
+
this.__hasHostListenerAttached = true;
|
|
5853
|
+
}
|
|
5854
|
+
connectedCallback(this);
|
|
5855
|
+
if (originalConnectedCallback) {
|
|
5856
|
+
originalConnectedCallback.call(this);
|
|
5857
|
+
}
|
|
5858
|
+
},
|
|
5859
|
+
disconnectedCallback() {
|
|
5860
|
+
disconnectedCallback(this);
|
|
5861
|
+
if (originalDisconnectedCallback) {
|
|
5862
|
+
originalDisconnectedCallback.call(this);
|
|
5863
|
+
}
|
|
5864
|
+
},
|
|
5865
|
+
__attachShadow() {
|
|
5866
|
+
if (supportsShadow) {
|
|
5867
|
+
if (!this.shadowRoot) {
|
|
5868
|
+
createShadowRoot.call(this, cmpMeta);
|
|
5869
|
+
} else {
|
|
5870
|
+
if (this.shadowRoot.mode !== "open") {
|
|
5871
|
+
throw new Error(
|
|
5872
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
5873
|
+
);
|
|
5874
|
+
}
|
|
5875
|
+
}
|
|
5876
|
+
} else {
|
|
5877
|
+
this.shadowRoot = this;
|
|
5863
5878
|
}
|
|
5864
|
-
} else {
|
|
5865
|
-
this.shadowRoot = this;
|
|
5866
5879
|
}
|
|
5867
|
-
}
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5880
|
+
});
|
|
5881
|
+
Object.defineProperty(Cstr, "is", {
|
|
5882
|
+
value: cmpMeta.$tagName$,
|
|
5883
|
+
configurable: true
|
|
5884
|
+
});
|
|
5885
|
+
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
5886
|
+
} catch (e) {
|
|
5887
|
+
consoleError(e);
|
|
5888
|
+
return Cstr;
|
|
5889
|
+
}
|
|
5871
5890
|
};
|
|
5872
5891
|
var forceModeUpdate = (elm) => {
|
|
5873
5892
|
if (import_app_data20.BUILD.style && import_app_data20.BUILD.mode && !import_app_data20.BUILD.lazyLoad) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.42.0-dev.
|
|
3
|
+
"version": "4.42.0-dev.1770269227.50ad901",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
package/mock-doc/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Mock Doc (CommonJS) v4.42.0-dev.
|
|
2
|
+
Stencil Mock Doc (CommonJS) v4.42.0-dev.1770269227.50ad901 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -7816,6 +7816,8 @@ function createElement(ownerDocument, tagName) {
|
|
|
7816
7816
|
return new MockImageElement(ownerDocument);
|
|
7817
7817
|
case "input":
|
|
7818
7818
|
return new MockInputElement(ownerDocument);
|
|
7819
|
+
case "label":
|
|
7820
|
+
return new MockLabelElement(ownerDocument);
|
|
7819
7821
|
case "link":
|
|
7820
7822
|
return new MockLinkElement(ownerDocument);
|
|
7821
7823
|
case "meta":
|
|
@@ -7894,6 +7896,9 @@ var MockButtonElement = class extends MockHTMLElement {
|
|
|
7894
7896
|
constructor(ownerDocument) {
|
|
7895
7897
|
super(ownerDocument, "button");
|
|
7896
7898
|
}
|
|
7899
|
+
get labels() {
|
|
7900
|
+
return getLabelsForElement(this);
|
|
7901
|
+
}
|
|
7897
7902
|
};
|
|
7898
7903
|
patchPropAttributes(
|
|
7899
7904
|
MockButtonElement.prototype,
|
|
@@ -7941,6 +7946,9 @@ var MockInputElement = class extends MockHTMLElement {
|
|
|
7941
7946
|
}
|
|
7942
7947
|
return null;
|
|
7943
7948
|
}
|
|
7949
|
+
get labels() {
|
|
7950
|
+
return getLabelsForElement(this);
|
|
7951
|
+
}
|
|
7944
7952
|
};
|
|
7945
7953
|
patchPropAttributes(
|
|
7946
7954
|
MockInputElement.prototype,
|
|
@@ -7989,6 +7997,26 @@ var MockFormElement = class extends MockHTMLElement {
|
|
|
7989
7997
|
patchPropAttributes(MockFormElement.prototype, {
|
|
7990
7998
|
name: String
|
|
7991
7999
|
});
|
|
8000
|
+
var MockLabelElement = class extends MockHTMLElement {
|
|
8001
|
+
constructor(ownerDocument) {
|
|
8002
|
+
super(ownerDocument, "label");
|
|
8003
|
+
}
|
|
8004
|
+
get htmlFor() {
|
|
8005
|
+
return this.getAttributeNS(null, "for") || "";
|
|
8006
|
+
}
|
|
8007
|
+
set htmlFor(value) {
|
|
8008
|
+
this.setAttributeNS(null, "for", value);
|
|
8009
|
+
}
|
|
8010
|
+
get control() {
|
|
8011
|
+
var _a, _b;
|
|
8012
|
+
const forAttr = this.htmlFor;
|
|
8013
|
+
if (forAttr) {
|
|
8014
|
+
return (_b = (_a = this.ownerDocument) == null ? void 0 : _a.getElementById(forAttr)) != null ? _b : null;
|
|
8015
|
+
}
|
|
8016
|
+
const labelableSelector = 'button, input:not([type="hidden"]), meter, output, progress, select, textarea';
|
|
8017
|
+
return this.querySelector(labelableSelector);
|
|
8018
|
+
}
|
|
8019
|
+
};
|
|
7992
8020
|
var MockLinkElement = class extends MockHTMLElement {
|
|
7993
8021
|
constructor(ownerDocument) {
|
|
7994
8022
|
super(ownerDocument, "link");
|
|
@@ -8399,6 +8427,30 @@ function fullUrl(elm, attrName) {
|
|
|
8399
8427
|
}
|
|
8400
8428
|
return val.replace(/\'|\"/g, "").trim();
|
|
8401
8429
|
}
|
|
8430
|
+
function getLabelsForElement(elm) {
|
|
8431
|
+
const labels = [];
|
|
8432
|
+
const id = elm.id;
|
|
8433
|
+
const doc = elm.ownerDocument;
|
|
8434
|
+
if (doc) {
|
|
8435
|
+
if (id) {
|
|
8436
|
+
const allLabels = doc.getElementsByTagName("label");
|
|
8437
|
+
for (let i = 0; i < allLabels.length; i++) {
|
|
8438
|
+
const label = allLabels[i];
|
|
8439
|
+
if (label.htmlFor === id) {
|
|
8440
|
+
labels.push(label);
|
|
8441
|
+
}
|
|
8442
|
+
}
|
|
8443
|
+
}
|
|
8444
|
+
let parent = elm.parentNode;
|
|
8445
|
+
while (parent) {
|
|
8446
|
+
if (parent.nodeName === "LABEL" && !labels.includes(parent)) {
|
|
8447
|
+
labels.push(parent);
|
|
8448
|
+
}
|
|
8449
|
+
parent = parent.parentNode;
|
|
8450
|
+
}
|
|
8451
|
+
}
|
|
8452
|
+
return labels;
|
|
8453
|
+
}
|
|
8402
8454
|
function patchPropAttributes(prototype, attrs, defaults = {}) {
|
|
8403
8455
|
Object.keys(attrs).forEach((propName) => {
|
|
8404
8456
|
const attr = attrs[propName];
|
|
@@ -9132,7 +9184,6 @@ var MockWindow = class {
|
|
|
9132
9184
|
__timeouts;
|
|
9133
9185
|
__history;
|
|
9134
9186
|
__elementCstr;
|
|
9135
|
-
__htmlElementCstr;
|
|
9136
9187
|
__charDataCstr;
|
|
9137
9188
|
__docTypeCstr;
|
|
9138
9189
|
__docCstr;
|
|
@@ -9339,27 +9390,10 @@ var MockWindow = class {
|
|
|
9339
9390
|
return JSON;
|
|
9340
9391
|
}
|
|
9341
9392
|
get HTMLElement() {
|
|
9342
|
-
|
|
9343
|
-
const ownerDocument = this.document;
|
|
9344
|
-
this.__htmlElementCstr = class extends MockHTMLElement {
|
|
9345
|
-
constructor() {
|
|
9346
|
-
super(ownerDocument, "");
|
|
9347
|
-
const observedAttributes = this.constructor.observedAttributes;
|
|
9348
|
-
if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === "function") {
|
|
9349
|
-
observedAttributes.forEach((attrName) => {
|
|
9350
|
-
const attrValue = this.getAttribute(attrName);
|
|
9351
|
-
if (attrValue != null) {
|
|
9352
|
-
this.attributeChangedCallback(attrName, null, attrValue);
|
|
9353
|
-
}
|
|
9354
|
-
});
|
|
9355
|
-
}
|
|
9356
|
-
}
|
|
9357
|
-
};
|
|
9358
|
-
}
|
|
9359
|
-
return this.__htmlElementCstr;
|
|
9393
|
+
return MockHTMLElement;
|
|
9360
9394
|
}
|
|
9361
|
-
|
|
9362
|
-
|
|
9395
|
+
get SVGElement() {
|
|
9396
|
+
return MockSVGElement;
|
|
9363
9397
|
}
|
|
9364
9398
|
get IntersectionObserver() {
|
|
9365
9399
|
return MockIntersectionObserver;
|
package/mock-doc/index.d.ts
CHANGED
|
@@ -165,6 +165,7 @@ declare class MockAnchorElement extends MockHTMLElement {
|
|
|
165
165
|
}
|
|
166
166
|
declare class MockButtonElement extends MockHTMLElement {
|
|
167
167
|
constructor(ownerDocument: any);
|
|
168
|
+
get labels(): MockHTMLElement[];
|
|
168
169
|
}
|
|
169
170
|
declare class MockImageElement extends MockHTMLElement {
|
|
170
171
|
constructor(ownerDocument: any);
|
|
@@ -176,10 +177,17 @@ declare class MockImageElement extends MockHTMLElement {
|
|
|
176
177
|
declare class MockInputElement extends MockHTMLElement {
|
|
177
178
|
constructor(ownerDocument: any);
|
|
178
179
|
get list(): HTMLElement;
|
|
180
|
+
get labels(): MockHTMLElement[];
|
|
179
181
|
}
|
|
180
182
|
declare class MockFormElement extends MockHTMLElement {
|
|
181
183
|
constructor(ownerDocument: any);
|
|
182
184
|
}
|
|
185
|
+
declare class MockLabelElement extends MockHTMLElement {
|
|
186
|
+
constructor(ownerDocument: any);
|
|
187
|
+
get htmlFor(): string;
|
|
188
|
+
set htmlFor(value: string);
|
|
189
|
+
get control(): MockHTMLElement | null;
|
|
190
|
+
}
|
|
183
191
|
declare class MockLinkElement extends MockHTMLElement {
|
|
184
192
|
constructor(ownerDocument: any);
|
|
185
193
|
get href(): string;
|
|
@@ -1018,8 +1026,8 @@ declare class MockWindow {
|
|
|
1018
1026
|
get history(): any;
|
|
1019
1027
|
set history(hsty: any);
|
|
1020
1028
|
get JSON(): JSON;
|
|
1021
|
-
get HTMLElement():
|
|
1022
|
-
|
|
1029
|
+
get HTMLElement(): typeof MockHTMLElement;
|
|
1030
|
+
get SVGElement(): typeof MockSVGElement;
|
|
1023
1031
|
get IntersectionObserver(): typeof MockIntersectionObserver;
|
|
1024
1032
|
get ResizeObserver(): typeof MockResizeObserver;
|
|
1025
1033
|
get localStorage(): MockStorage;
|