@lwc/engine-core 3.5.0 → 3.7.0
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/framework/api.d.ts +4 -2
- package/dist/framework/base-bridge-element.d.ts +1 -1
- package/dist/framework/modules/events.d.ts +2 -2
- package/dist/framework/modules/refs.d.ts +3 -0
- package/dist/framework/modules/static-parts.d.ts +10 -0
- package/dist/framework/renderer.d.ts +1 -0
- package/dist/framework/utils.d.ts +0 -3
- package/dist/framework/vm.d.ts +4 -3
- package/dist/framework/vnodes.d.ts +7 -2
- package/dist/index.cjs.js +141 -48
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +142 -49
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (C) 2023 salesforce.com, inc.
|
|
3
3
|
*/
|
|
4
|
-
import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, ArrayIndexOf, ArraySplice, create, seal, isArray as isArray$1, isFunction as isFunction$1, keys, hasOwnProperty as hasOwnProperty$1, globalThis as globalThis$1, forEach, AriaPropNameToAttrNameMap, getPropertyDescriptor, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, isObject, freeze, KEY__SYNTHETIC_MODE, assert, toString as toString$1, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, isFalse, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyNames as getOwnPropertyNames$1, getOwnPropertyDescriptors, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, isString, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, ArrayPop, isNumber, StringReplace,
|
|
4
|
+
import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, ArrayIndexOf, ArraySplice, create, seal, isArray as isArray$1, isFunction as isFunction$1, keys, hasOwnProperty as hasOwnProperty$1, globalThis as globalThis$1, forEach, AriaPropNameToAttrNameMap, getPropertyDescriptor, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, isObject, freeze, KEY__SYNTHETIC_MODE, assert, toString as toString$1, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, isFalse, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyNames as getOwnPropertyNames$1, getOwnPropertyDescriptors, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, isString, StringSlice, ArrayShift, ArrayUnshift, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, ArrayPop, isNumber, StringReplace, LOWEST_API_VERSION, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, ID_REFERENCING_ATTRIBUTES_SET, KEY__SHADOW_TOKEN, ArrayFilter, StringSplit, arrayEvery, ArrayIncludes, ArrayCopyWithin, ArrayFill, ArraySort, ArrayReverse } from '@lwc/shared';
|
|
5
5
|
import { applyAriaReflection } from '@lwc/aria-reflection';
|
|
6
6
|
export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
|
|
7
7
|
|
|
@@ -388,20 +388,6 @@ function flattenStylesheets(stylesheets) {
|
|
|
388
388
|
}
|
|
389
389
|
return list;
|
|
390
390
|
}
|
|
391
|
-
// Set a ref (lwc:ref) on a VM, from a template API
|
|
392
|
-
function setRefVNode(vm, ref, vnode) {
|
|
393
|
-
if (process.env.NODE_ENV !== 'production' && isUndefined$1(vm.refVNodes)) {
|
|
394
|
-
throw new Error('refVNodes must be defined when setting a ref');
|
|
395
|
-
}
|
|
396
|
-
// If this method is called, then vm.refVNodes is set as the template has refs.
|
|
397
|
-
// If not, then something went wrong and we threw an error above.
|
|
398
|
-
const refVNodes = vm.refVNodes;
|
|
399
|
-
// In cases of conflict (two elements with the same ref), prefer, the last one,
|
|
400
|
-
// in depth-first traversal order.
|
|
401
|
-
if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
|
|
402
|
-
refVNodes[ref] = vnode;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
391
|
// Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
|
|
406
392
|
function assertNotProd() {
|
|
407
393
|
/* istanbul ignore if */
|
|
@@ -2620,7 +2606,7 @@ function createAccessorThatWarns(propName) {
|
|
|
2620
2606
|
configurable: true,
|
|
2621
2607
|
};
|
|
2622
2608
|
}
|
|
2623
|
-
function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto) {
|
|
2609
|
+
function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
|
|
2624
2610
|
const HTMLBridgeElement = class extends SuperClass {
|
|
2625
2611
|
};
|
|
2626
2612
|
// generating the hash table for attributes to avoid duplicate fields and facilitate validation
|
|
@@ -2631,7 +2617,8 @@ function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observe
|
|
|
2631
2617
|
const descriptors = create(null);
|
|
2632
2618
|
// present a hint message so that developers are aware that they have not decorated property with @api
|
|
2633
2619
|
if (process.env.NODE_ENV !== 'production') {
|
|
2634
|
-
|
|
2620
|
+
// TODO [#3761]: enable for components that don't extend from LightningElement
|
|
2621
|
+
if (!isUndefined$1(proto) && !isNull(proto) && !hasCustomSuperClass) {
|
|
2635
2622
|
const nonPublicPropertiesToWarnOn = new Set([
|
|
2636
2623
|
// getters, setters, and methods
|
|
2637
2624
|
...keys(getOwnPropertyDescriptors(proto)),
|
|
@@ -2712,7 +2699,7 @@ function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observe
|
|
|
2712
2699
|
defineProperties(HTMLBridgeElement.prototype, descriptors);
|
|
2713
2700
|
return HTMLBridgeElement;
|
|
2714
2701
|
}
|
|
2715
|
-
const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), [], [], null);
|
|
2702
|
+
const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), [], [], null, false);
|
|
2716
2703
|
if (process.env.IS_BROWSER) {
|
|
2717
2704
|
// This ARIA reflection only really makes sense in the browser. On the server, there is no `renderedCallback()`,
|
|
2718
2705
|
// so you cannot do e.g. `this.template.querySelector('x-child').ariaBusy = 'true'`. So we don't need to expose
|
|
@@ -3022,7 +3009,8 @@ function createComponentDef(Ctor) {
|
|
|
3022
3009
|
}
|
|
3023
3010
|
if (!isUndefined$1(ctorShadowSupportMode) &&
|
|
3024
3011
|
ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ &&
|
|
3025
|
-
ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */
|
|
3012
|
+
ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */ &&
|
|
3013
|
+
ctorShadowSupportMode !== "native" /* ShadowSupportMode.Native */) {
|
|
3026
3014
|
logError(`Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3027
3015
|
}
|
|
3028
3016
|
if (!isUndefined$1(ctorRenderMode) &&
|
|
@@ -3036,8 +3024,9 @@ function createComponentDef(Ctor) {
|
|
|
3036
3024
|
const proto = Ctor.prototype;
|
|
3037
3025
|
let { connectedCallback, disconnectedCallback, renderedCallback, errorCallback, formAssociatedCallback, formResetCallback, formDisabledCallback, formStateRestoreCallback, render, } = proto;
|
|
3038
3026
|
const superProto = getCtorProto(Ctor);
|
|
3039
|
-
const
|
|
3040
|
-
const
|
|
3027
|
+
const hasCustomSuperClass = superProto !== LightningElement;
|
|
3028
|
+
const superDef = hasCustomSuperClass ? getComponentInternalDef(superProto) : lightingElementDef;
|
|
3029
|
+
const bridge = HTMLBridgeElementFactory(superDef.bridge, keys(apiFields), keys(apiMethods), keys(observedFields), proto, hasCustomSuperClass);
|
|
3041
3030
|
const props = assign(create(null), superDef.props, apiFields);
|
|
3042
3031
|
const propsConfig = assign(create(null), superDef.propsConfig, apiFieldsConfig);
|
|
3043
3032
|
const methods = assign(create(null), superDef.methods, apiMethods);
|
|
@@ -3695,6 +3684,106 @@ function applyStaticStyleAttribute(vnode, renderer) {
|
|
|
3695
3684
|
}
|
|
3696
3685
|
}
|
|
3697
3686
|
|
|
3687
|
+
/*
|
|
3688
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3689
|
+
* All rights reserved.
|
|
3690
|
+
* SPDX-License-Identifier: MIT
|
|
3691
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3692
|
+
*/
|
|
3693
|
+
// Set a ref (lwc:ref) on a VM, from a template API
|
|
3694
|
+
function applyRefs(vnode, owner) {
|
|
3695
|
+
const { data } = vnode;
|
|
3696
|
+
const { ref } = data;
|
|
3697
|
+
if (isUndefined$1(ref)) {
|
|
3698
|
+
return;
|
|
3699
|
+
}
|
|
3700
|
+
if (process.env.NODE_ENV !== 'production' && isUndefined$1(owner.refVNodes)) {
|
|
3701
|
+
throw new Error('refVNodes must be defined when setting a ref');
|
|
3702
|
+
}
|
|
3703
|
+
// If this method is called, then vm.refVNodes is set as the template has refs.
|
|
3704
|
+
// If not, then something went wrong and we threw an error above.
|
|
3705
|
+
const refVNodes = owner.refVNodes;
|
|
3706
|
+
// In cases of conflict (two elements with the same ref), prefer the last one,
|
|
3707
|
+
// in depth-first traversal order. This happens automatically due to how we render
|
|
3708
|
+
refVNodes[ref] = vnode;
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3711
|
+
/*
|
|
3712
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3713
|
+
* All rights reserved.
|
|
3714
|
+
* SPDX-License-Identifier: MIT
|
|
3715
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3716
|
+
*/
|
|
3717
|
+
function traverseAndSetElements(root, parts, renderer) {
|
|
3718
|
+
const numParts = parts.length;
|
|
3719
|
+
// Optimization given that, in most cases, there will be one part, and it's just the root
|
|
3720
|
+
if (numParts === 1) {
|
|
3721
|
+
const firstPart = parts[0];
|
|
3722
|
+
if (firstPart.partId === 0) {
|
|
3723
|
+
// 0 means the root node
|
|
3724
|
+
firstPart.elm = root;
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3727
|
+
}
|
|
3728
|
+
const partIdsToParts = new Map();
|
|
3729
|
+
for (const staticPart of parts) {
|
|
3730
|
+
partIdsToParts.set(staticPart.partId, staticPart);
|
|
3731
|
+
}
|
|
3732
|
+
let numFoundParts = 0;
|
|
3733
|
+
const { previousSibling, getLastChild } = renderer;
|
|
3734
|
+
const stack = [root];
|
|
3735
|
+
let partId = -1;
|
|
3736
|
+
// Depth-first traversal. We assign a partId to each element, which is an integer based on traversal order.
|
|
3737
|
+
while (stack.length > 0) {
|
|
3738
|
+
const elm = ArrayShift.call(stack);
|
|
3739
|
+
partId++;
|
|
3740
|
+
const part = partIdsToParts.get(partId);
|
|
3741
|
+
if (!isUndefined$1(part)) {
|
|
3742
|
+
part.elm = elm;
|
|
3743
|
+
if (++numFoundParts === numParts) {
|
|
3744
|
+
return; // perf optimization - stop traversing once we've found everything we need
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
// For depth-first traversal, prepend to the stack in reverse order
|
|
3748
|
+
// Note that we traverse using `*Child`/`*Sibling` rather than `children` because the browser uses a linked
|
|
3749
|
+
// list under the hood to represent the DOM tree, so it's faster to do this than to create an underlying array
|
|
3750
|
+
// by calling `children`.
|
|
3751
|
+
let child = getLastChild(elm);
|
|
3752
|
+
while (!isNull(child)) {
|
|
3753
|
+
ArrayUnshift.call(stack, child);
|
|
3754
|
+
child = previousSibling(child);
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3758
|
+
assert.isTrue(numFoundParts === numParts, `Should have found all parts by now. Found ${numFoundParts}, needed ${numParts}.`);
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Given an array of static parts, do all the mounting required for these parts.
|
|
3763
|
+
*
|
|
3764
|
+
* @param root - the root element
|
|
3765
|
+
* @param vnode - the parent VStatic
|
|
3766
|
+
* @param renderer - the renderer to use
|
|
3767
|
+
*/
|
|
3768
|
+
function applyStaticParts(root, vnode, renderer) {
|
|
3769
|
+
// On the server, we don't support ref (because it relies on renderedCallback), nor do we
|
|
3770
|
+
// support event listeners (no interactivity), so traversing parts makes no sense
|
|
3771
|
+
if (!process.env.IS_BROWSER) {
|
|
3772
|
+
return;
|
|
3773
|
+
}
|
|
3774
|
+
const { parts, owner } = vnode;
|
|
3775
|
+
if (isUndefined$1(parts)) {
|
|
3776
|
+
return;
|
|
3777
|
+
}
|
|
3778
|
+
traverseAndSetElements(root, parts, renderer); // this adds `part.elm` to each `part`
|
|
3779
|
+
for (const part of parts) {
|
|
3780
|
+
// Event listeners are only applied once when mounting, so they are allowed for static vnodes
|
|
3781
|
+
applyEventListeners(part, renderer);
|
|
3782
|
+
// Refs are allowed as well
|
|
3783
|
+
applyRefs(part, owner);
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3698
3787
|
/*
|
|
3699
3788
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3700
3789
|
* All rights reserved.
|
|
@@ -3831,13 +3920,13 @@ function mountElement(vnode, parent, anchor, renderer) {
|
|
|
3831
3920
|
applyStyleScoping(elm, owner, renderer);
|
|
3832
3921
|
applyDomManual(elm, vnode);
|
|
3833
3922
|
applyElementRestrictions(elm, vnode);
|
|
3834
|
-
|
|
3923
|
+
patchElementPropsAndAttrsAndRefs$1(null, vnode, renderer);
|
|
3835
3924
|
insertNode(elm, parent, anchor, renderer);
|
|
3836
3925
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
3837
3926
|
}
|
|
3838
3927
|
function patchElement(n1, n2, renderer) {
|
|
3839
3928
|
const elm = (n2.elm = n1.elm);
|
|
3840
|
-
|
|
3929
|
+
patchElementPropsAndAttrsAndRefs$1(n1, n2, renderer);
|
|
3841
3930
|
patchChildren(n1.children, n2.children, elm, renderer);
|
|
3842
3931
|
}
|
|
3843
3932
|
function mountStatic(vnode, parent, anchor, renderer) {
|
|
@@ -3854,8 +3943,7 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3854
3943
|
}
|
|
3855
3944
|
}
|
|
3856
3945
|
insertNode(elm, parent, anchor, renderer);
|
|
3857
|
-
|
|
3858
|
-
applyEventListeners(vnode, renderer);
|
|
3946
|
+
applyStaticParts(elm, vnode, renderer);
|
|
3859
3947
|
}
|
|
3860
3948
|
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
3861
3949
|
const { sel, owner } = vnode;
|
|
@@ -3910,7 +3998,7 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3910
3998
|
if (vm) {
|
|
3911
3999
|
allocateChildren(vnode, vm);
|
|
3912
4000
|
}
|
|
3913
|
-
|
|
4001
|
+
patchElementPropsAndAttrsAndRefs$1(null, vnode, renderer);
|
|
3914
4002
|
insertNode(elm, parent, anchor, renderer);
|
|
3915
4003
|
if (vm) {
|
|
3916
4004
|
if (process.env.IS_BROWSER) {
|
|
@@ -3947,7 +4035,7 @@ function patchCustomElement(n1, n2, parent, renderer) {
|
|
|
3947
4035
|
// Otherwise patch the existing component with new props/attrs/etc.
|
|
3948
4036
|
const elm = (n2.elm = n1.elm);
|
|
3949
4037
|
const vm = (n2.vm = n1.vm);
|
|
3950
|
-
|
|
4038
|
+
patchElementPropsAndAttrsAndRefs$1(n1, n2, renderer);
|
|
3951
4039
|
if (!isUndefined$1(vm)) {
|
|
3952
4040
|
// in fallback mode, the allocation will always set children to
|
|
3953
4041
|
// empty and delegate the real allocation to the slot elements
|
|
@@ -4094,7 +4182,7 @@ function removeNode(node, parent, renderer) {
|
|
|
4094
4182
|
lockDomMutation();
|
|
4095
4183
|
}
|
|
4096
4184
|
}
|
|
4097
|
-
function
|
|
4185
|
+
function patchElementPropsAndAttrsAndRefs$1(oldVnode, vnode, renderer) {
|
|
4098
4186
|
if (isNull(oldVnode)) {
|
|
4099
4187
|
applyEventListeners(vnode, renderer);
|
|
4100
4188
|
applyStaticClassAttribute(vnode, renderer);
|
|
@@ -4106,6 +4194,8 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
|
4106
4194
|
patchStyleAttribute(oldVnode, vnode, renderer);
|
|
4107
4195
|
patchAttributes(oldVnode, vnode, renderer);
|
|
4108
4196
|
patchProps(oldVnode, vnode, renderer);
|
|
4197
|
+
// The `refs` object is blown away in every re-render, so we always need to re-apply them
|
|
4198
|
+
applyRefs(vnode, vnode.owner);
|
|
4109
4199
|
}
|
|
4110
4200
|
function applyStyleScoping(elm, owner, renderer) {
|
|
4111
4201
|
const { getClassList } = renderer;
|
|
@@ -4507,6 +4597,14 @@ const SymbolIterator = Symbol.iterator;
|
|
|
4507
4597
|
function addVNodeToChildLWC(vnode) {
|
|
4508
4598
|
ArrayPush$1.call(getVMBeingRendered().velements, vnode);
|
|
4509
4599
|
}
|
|
4600
|
+
// [s]tatic [p]art
|
|
4601
|
+
function sp(partId, data) {
|
|
4602
|
+
return {
|
|
4603
|
+
partId,
|
|
4604
|
+
data,
|
|
4605
|
+
elm: undefined, // elm is defined later
|
|
4606
|
+
};
|
|
4607
|
+
}
|
|
4510
4608
|
// [s]coped [s]lot [f]actory
|
|
4511
4609
|
function ssf(slotName, factory) {
|
|
4512
4610
|
return {
|
|
@@ -4520,7 +4618,7 @@ function ssf(slotName, factory) {
|
|
|
4520
4618
|
};
|
|
4521
4619
|
}
|
|
4522
4620
|
// [st]atic node
|
|
4523
|
-
function st(fragment, key,
|
|
4621
|
+
function st(fragment, key, parts) {
|
|
4524
4622
|
const owner = getVMBeingRendered();
|
|
4525
4623
|
const vnode = {
|
|
4526
4624
|
type: 4 /* VNodeType.Static */,
|
|
@@ -4529,12 +4627,8 @@ function st(fragment, key, data) {
|
|
|
4529
4627
|
elm: undefined,
|
|
4530
4628
|
fragment,
|
|
4531
4629
|
owner,
|
|
4532
|
-
|
|
4630
|
+
parts,
|
|
4533
4631
|
};
|
|
4534
|
-
const ref = data === null || data === void 0 ? void 0 : data.ref;
|
|
4535
|
-
if (!isUndefined$1(ref)) {
|
|
4536
|
-
setRefVNode(owner, ref, vnode);
|
|
4537
|
-
}
|
|
4538
4632
|
return vnode;
|
|
4539
4633
|
}
|
|
4540
4634
|
// [fr]agment node
|
|
@@ -4576,7 +4670,7 @@ function h(sel, data, children = EmptyArray) {
|
|
|
4576
4670
|
}
|
|
4577
4671
|
});
|
|
4578
4672
|
}
|
|
4579
|
-
const { key
|
|
4673
|
+
const { key } = data;
|
|
4580
4674
|
const vnode = {
|
|
4581
4675
|
type: 2 /* VNodeType.Element */,
|
|
4582
4676
|
sel,
|
|
@@ -4586,9 +4680,6 @@ function h(sel, data, children = EmptyArray) {
|
|
|
4586
4680
|
key,
|
|
4587
4681
|
owner: vmBeingRendered,
|
|
4588
4682
|
};
|
|
4589
|
-
if (!isUndefined$1(ref)) {
|
|
4590
|
-
setRefVNode(vmBeingRendered, ref, vnode);
|
|
4591
|
-
}
|
|
4592
4683
|
return vnode;
|
|
4593
4684
|
}
|
|
4594
4685
|
// [t]ab[i]ndex function
|
|
@@ -4697,7 +4788,7 @@ function c(sel, Ctor, data, children = EmptyArray) {
|
|
|
4697
4788
|
});
|
|
4698
4789
|
}
|
|
4699
4790
|
}
|
|
4700
|
-
const { key
|
|
4791
|
+
const { key } = data;
|
|
4701
4792
|
let elm, aChildren, vm;
|
|
4702
4793
|
const vnode = {
|
|
4703
4794
|
type: 3 /* VNodeType.CustomElement */,
|
|
@@ -4713,9 +4804,6 @@ function c(sel, Ctor, data, children = EmptyArray) {
|
|
|
4713
4804
|
vm,
|
|
4714
4805
|
};
|
|
4715
4806
|
addVNodeToChildLWC(vnode);
|
|
4716
|
-
if (!isUndefined$1(ref)) {
|
|
4717
|
-
setRefVNode(vmBeingRendered, ref, vnode);
|
|
4718
|
-
}
|
|
4719
4807
|
return vnode;
|
|
4720
4808
|
}
|
|
4721
4809
|
// [i]terable node
|
|
@@ -5006,6 +5094,7 @@ const api = freeze({
|
|
|
5006
5094
|
shc,
|
|
5007
5095
|
ssf,
|
|
5008
5096
|
ddc,
|
|
5097
|
+
sp,
|
|
5009
5098
|
});
|
|
5010
5099
|
|
|
5011
5100
|
/*
|
|
@@ -5720,8 +5809,10 @@ function computeShadowMode(def, owner, renderer) {
|
|
|
5720
5809
|
// everything defaults to native when the synthetic shadow polyfill is unavailable.
|
|
5721
5810
|
shadowMode = 0 /* ShadowMode.Native */;
|
|
5722
5811
|
}
|
|
5723
|
-
else if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE
|
|
5724
|
-
|
|
5812
|
+
else if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE ||
|
|
5813
|
+
def.shadowSupportMode === "native" /* ShadowSupportMode.Native */) {
|
|
5814
|
+
if (def.shadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
|
|
5815
|
+
def.shadowSupportMode === "native" /* ShadowSupportMode.Native */) {
|
|
5725
5816
|
shadowMode = 0 /* ShadowMode.Native */;
|
|
5726
5817
|
}
|
|
5727
5818
|
else {
|
|
@@ -6466,7 +6557,7 @@ function hydrateStaticElement(elm, vnode, renderer) {
|
|
|
6466
6557
|
return handleMismatch(elm, vnode, renderer);
|
|
6467
6558
|
}
|
|
6468
6559
|
vnode.elm = elm;
|
|
6469
|
-
|
|
6560
|
+
applyStaticParts(elm, vnode, renderer);
|
|
6470
6561
|
return elm;
|
|
6471
6562
|
}
|
|
6472
6563
|
function hydrateFragment(elm, vnode, renderer) {
|
|
@@ -6500,7 +6591,7 @@ function hydrateElement(elm, vnode, renderer) {
|
|
|
6500
6591
|
}
|
|
6501
6592
|
}
|
|
6502
6593
|
}
|
|
6503
|
-
|
|
6594
|
+
patchElementPropsAndAttrsAndRefs(vnode, renderer);
|
|
6504
6595
|
if (!isDomManual) {
|
|
6505
6596
|
const { getFirstChild } = renderer;
|
|
6506
6597
|
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
@@ -6533,7 +6624,7 @@ function hydrateCustomElement(elm, vnode, renderer) {
|
|
|
6533
6624
|
vnode.elm = elm;
|
|
6534
6625
|
vnode.vm = vm;
|
|
6535
6626
|
allocateChildren(vnode, vm);
|
|
6536
|
-
|
|
6627
|
+
patchElementPropsAndAttrsAndRefs(vnode, renderer);
|
|
6537
6628
|
// Insert hook section:
|
|
6538
6629
|
if (process.env.NODE_ENV !== 'production') {
|
|
6539
6630
|
assert.isTrue(vm.state === 0 /* VMState.created */, `${vm} cannot be recycled.`);
|
|
@@ -6598,9 +6689,11 @@ function handleMismatch(node, vnode, renderer) {
|
|
|
6598
6689
|
removeNode(node, parentNode, renderer);
|
|
6599
6690
|
return vnode.elm;
|
|
6600
6691
|
}
|
|
6601
|
-
function
|
|
6692
|
+
function patchElementPropsAndAttrsAndRefs(vnode, renderer) {
|
|
6602
6693
|
applyEventListeners(vnode, renderer);
|
|
6603
6694
|
patchProps(null, vnode, renderer);
|
|
6695
|
+
// The `refs` object is blown away in every re-render, so we always need to re-apply them
|
|
6696
|
+
applyRefs(vnode, vnode.owner);
|
|
6604
6697
|
}
|
|
6605
6698
|
function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
6606
6699
|
const { getProperty } = renderer;
|
|
@@ -7079,5 +7172,5 @@ function readonly(obj) {
|
|
|
7079
7172
|
}
|
|
7080
7173
|
|
|
7081
7174
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
7082
|
-
/** version: 3.
|
|
7175
|
+
/** version: 3.7.0 */
|
|
7083
7176
|
//# sourceMappingURL=index.js.map
|