lwc 2.23.6 → 2.24.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/engine-dom/esm/es2017/engine-dom.js +126 -18
- package/dist/engine-dom/iife/es2017/engine-dom.js +126 -18
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +104 -16
- package/dist/engine-dom/iife/es5/engine-dom.js +178 -38
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +147 -24
- package/dist/engine-dom/umd/es2017/engine-dom.js +126 -18
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +104 -16
- package/dist/engine-dom/umd/es5/engine-dom.js +178 -38
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +147 -24
- package/dist/engine-server/commonjs/es2017/engine-server.js +124 -16
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +124 -16
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +205 -168
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +205 -168
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +195 -158
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +25 -11
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +25 -11
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +205 -168
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +195 -158
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +25 -11
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +25 -11
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
295
295
|
return attributeName;
|
|
296
296
|
}
|
|
297
|
-
/** version: 2.
|
|
297
|
+
/** version: 2.24.0 */
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
patch$1(propName);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
/** version: 2.
|
|
379
|
+
/** version: 2.24.0 */
|
|
380
380
|
|
|
381
381
|
/**
|
|
382
382
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -504,6 +504,17 @@
|
|
|
504
504
|
}
|
|
505
505
|
return result;
|
|
506
506
|
}
|
|
507
|
+
// Set a ref (lwc:ref) on a VM, from a template API
|
|
508
|
+
function setRefVNode(vm, ref, vnode) {
|
|
509
|
+
// If this method is called, then vm.refVNodes is set as the template has refs.
|
|
510
|
+
// If not, then something went wrong and we threw an error above.
|
|
511
|
+
const refVNodes = vm.refVNodes;
|
|
512
|
+
// In cases of conflict (two elements with the same ref), prefer, the last one,
|
|
513
|
+
// in depth-first traversal order.
|
|
514
|
+
if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
|
|
515
|
+
refVNodes[ref] = vnode;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
507
518
|
|
|
508
519
|
/*
|
|
509
520
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -1365,6 +1376,8 @@
|
|
|
1365
1376
|
},
|
|
1366
1377
|
};
|
|
1367
1378
|
}
|
|
1379
|
+
const EMPTY_REFS = freeze(create(null));
|
|
1380
|
+
const refsCache = new WeakMap();
|
|
1368
1381
|
/**
|
|
1369
1382
|
* This class is the base class for any LWC element.
|
|
1370
1383
|
* Some elements directly extends this class, others implement it via inheritance.
|
|
@@ -1502,6 +1515,53 @@
|
|
|
1502
1515
|
const vm = getAssociatedVM(this);
|
|
1503
1516
|
return vm.shadowRoot;
|
|
1504
1517
|
},
|
|
1518
|
+
get refs() {
|
|
1519
|
+
const vm = getAssociatedVM(this);
|
|
1520
|
+
if (isUpdatingTemplate) {
|
|
1521
|
+
// If the template is in the process of being updated, then we don't want to go through the normal
|
|
1522
|
+
// process of returning the refs and caching them, because the state of the refs is unstable.
|
|
1523
|
+
// This can happen if e.g. a template contains `<div class={foo}></div>` and `foo` is computed
|
|
1524
|
+
// based on `this.refs.bar`.
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
const { refVNodes, hasRefVNodes, cmpTemplate } = vm;
|
|
1528
|
+
// For backwards compatibility with component written before template refs
|
|
1529
|
+
// were introduced, we return undefined if the template has no refs defined
|
|
1530
|
+
// anywhere. This fixes components that may want to add an expando called `refs`
|
|
1531
|
+
// and are checking if it exists with `if (this.refs)` before adding it.
|
|
1532
|
+
// Note it is not sufficient to just check if `refVNodes` is null or empty,
|
|
1533
|
+
// because a template may have `lwc:ref` defined within a falsy `if:true` block.
|
|
1534
|
+
if (!hasRefVNodes) {
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
// For templates that are using `lwc:ref`, if there are no refs currently available
|
|
1538
|
+
// (e.g. refs inside of a falsy `if:true` block), we return an empty object.
|
|
1539
|
+
if (isNull(refVNodes)) {
|
|
1540
|
+
return EMPTY_REFS;
|
|
1541
|
+
}
|
|
1542
|
+
// The refNodes can be cached based on the refVNodes, since the refVNodes
|
|
1543
|
+
// are recreated from scratch every time the template is rendered.
|
|
1544
|
+
// This happens with `vm.refVNodes = null` in `template.ts` in `@lwc/engine-core`.
|
|
1545
|
+
let refs = refsCache.get(refVNodes);
|
|
1546
|
+
if (isUndefined$1(refs)) {
|
|
1547
|
+
refs = create(null);
|
|
1548
|
+
for (const key of keys(refVNodes)) {
|
|
1549
|
+
refs[key] = refVNodes[key].elm;
|
|
1550
|
+
}
|
|
1551
|
+
freeze(refs);
|
|
1552
|
+
refsCache.set(refVNodes, refs);
|
|
1553
|
+
}
|
|
1554
|
+
return refs;
|
|
1555
|
+
},
|
|
1556
|
+
// For backwards compat, we allow component authors to set `refs` as an expando
|
|
1557
|
+
set refs(value) {
|
|
1558
|
+
defineProperty(this, 'refs', {
|
|
1559
|
+
configurable: true,
|
|
1560
|
+
enumerable: true,
|
|
1561
|
+
writable: true,
|
|
1562
|
+
value,
|
|
1563
|
+
});
|
|
1564
|
+
},
|
|
1505
1565
|
get shadowRoot() {
|
|
1506
1566
|
// From within the component instance, the shadowRoot is always reported as "closed".
|
|
1507
1567
|
// Authors should rely on this.template instead.
|
|
@@ -2602,13 +2662,27 @@
|
|
|
2602
2662
|
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
2603
2663
|
}
|
|
2604
2664
|
function patchProps(oldVnode, vnode, renderer) {
|
|
2605
|
-
|
|
2606
|
-
|
|
2665
|
+
let { props } = vnode.data;
|
|
2666
|
+
const { spread } = vnode.data;
|
|
2667
|
+
if (isUndefined$1(props) && isUndefined$1(spread)) {
|
|
2607
2668
|
return;
|
|
2608
2669
|
}
|
|
2609
|
-
|
|
2610
|
-
if (
|
|
2611
|
-
|
|
2670
|
+
let oldProps;
|
|
2671
|
+
if (!isNull(oldVnode)) {
|
|
2672
|
+
oldProps = oldVnode.data.props;
|
|
2673
|
+
const oldSpread = oldVnode.data.spread;
|
|
2674
|
+
if (oldProps === props && oldSpread === spread) {
|
|
2675
|
+
return;
|
|
2676
|
+
}
|
|
2677
|
+
if (isUndefined$1(oldProps)) {
|
|
2678
|
+
oldProps = EmptyObject;
|
|
2679
|
+
}
|
|
2680
|
+
if (!isUndefined$1(oldSpread)) {
|
|
2681
|
+
oldProps = assign({}, oldProps, oldSpread);
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
if (!isUndefined$1(spread)) {
|
|
2685
|
+
props = assign({}, props, spread);
|
|
2612
2686
|
}
|
|
2613
2687
|
const isFirstPatch = isNull(oldVnode);
|
|
2614
2688
|
const { elm, sel } = vnode;
|
|
@@ -2618,7 +2692,9 @@
|
|
|
2618
2692
|
// Set the property if it's the first time is is patched or if the previous property is
|
|
2619
2693
|
// different than the one previously set.
|
|
2620
2694
|
if (isFirstPatch ||
|
|
2621
|
-
cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])
|
|
2695
|
+
cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key]) ||
|
|
2696
|
+
!(key in oldProps) // this is required because the above case will pass when `cur` is `undefined` and key is missing in `oldProps`
|
|
2697
|
+
) {
|
|
2622
2698
|
setProperty(elm, key, cur);
|
|
2623
2699
|
}
|
|
2624
2700
|
}
|
|
@@ -3580,17 +3656,20 @@
|
|
|
3580
3656
|
// [h]tml node
|
|
3581
3657
|
function h(sel, data, children = EmptyArray) {
|
|
3582
3658
|
const vmBeingRendered = getVMBeingRendered();
|
|
3583
|
-
|
|
3584
|
-
const
|
|
3585
|
-
return {
|
|
3659
|
+
const { key, ref } = data;
|
|
3660
|
+
const vnode = {
|
|
3586
3661
|
type: 2 /* VNodeType.Element */,
|
|
3587
3662
|
sel,
|
|
3588
3663
|
data,
|
|
3589
3664
|
children,
|
|
3590
|
-
elm,
|
|
3665
|
+
elm: undefined,
|
|
3591
3666
|
key,
|
|
3592
3667
|
owner: vmBeingRendered,
|
|
3593
3668
|
};
|
|
3669
|
+
if (!isUndefined$1(ref)) {
|
|
3670
|
+
setRefVNode(vmBeingRendered, ref, vnode);
|
|
3671
|
+
}
|
|
3672
|
+
return vnode;
|
|
3594
3673
|
}
|
|
3595
3674
|
// [t]ab[i]ndex function
|
|
3596
3675
|
function ti(value) {
|
|
@@ -3622,7 +3701,7 @@
|
|
|
3622
3701
|
// [c]ustom element node
|
|
3623
3702
|
function c(sel, Ctor, data, children = EmptyArray) {
|
|
3624
3703
|
const vmBeingRendered = getVMBeingRendered();
|
|
3625
|
-
const { key } = data;
|
|
3704
|
+
const { key, ref } = data;
|
|
3626
3705
|
let elm, aChildren, vm;
|
|
3627
3706
|
const vnode = {
|
|
3628
3707
|
type: 3 /* VNodeType.CustomElement */,
|
|
@@ -3638,6 +3717,9 @@
|
|
|
3638
3717
|
vm,
|
|
3639
3718
|
};
|
|
3640
3719
|
addVNodeToChildLWC(vnode);
|
|
3720
|
+
if (!isUndefined$1(ref)) {
|
|
3721
|
+
setRefVNode(vmBeingRendered, ref, vnode);
|
|
3722
|
+
}
|
|
3641
3723
|
return vnode;
|
|
3642
3724
|
}
|
|
3643
3725
|
// [i]terable node
|
|
@@ -4010,6 +4092,10 @@
|
|
|
4010
4092
|
: createStylesheet(vm, stylesheetsContent);
|
|
4011
4093
|
}
|
|
4012
4094
|
if ("production" !== 'production') ;
|
|
4095
|
+
// reset the refs; they will be set during the tmpl() instantiation
|
|
4096
|
+
const hasRefVNodes = Boolean(html.hasRefs);
|
|
4097
|
+
vm.hasRefVNodes = hasRefVNodes;
|
|
4098
|
+
vm.refVNodes = hasRefVNodes ? create(null) : null;
|
|
4013
4099
|
// right before producing the vnodes, we clear up all internal references
|
|
4014
4100
|
// to custom elements from the template.
|
|
4015
4101
|
vm.velements = [];
|
|
@@ -4321,6 +4407,8 @@
|
|
|
4321
4407
|
tagName,
|
|
4322
4408
|
mode,
|
|
4323
4409
|
owner,
|
|
4410
|
+
refVNodes: null,
|
|
4411
|
+
hasRefVNodes: false,
|
|
4324
4412
|
children: EmptyArray,
|
|
4325
4413
|
aChildren: EmptyArray,
|
|
4326
4414
|
velements: EmptyArray,
|
|
@@ -5500,7 +5588,7 @@
|
|
|
5500
5588
|
}
|
|
5501
5589
|
return ctor;
|
|
5502
5590
|
}
|
|
5503
|
-
/* version: 2.
|
|
5591
|
+
/* version: 2.24.0 */
|
|
5504
5592
|
|
|
5505
5593
|
/*
|
|
5506
5594
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5695,7 +5783,7 @@
|
|
|
5695
5783
|
function isNull(obj) {
|
|
5696
5784
|
return obj === null;
|
|
5697
5785
|
}
|
|
5698
|
-
/** version: 2.
|
|
5786
|
+
/** version: 2.24.0 */
|
|
5699
5787
|
|
|
5700
5788
|
/*
|
|
5701
5789
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6306,7 +6394,7 @@
|
|
|
6306
6394
|
});
|
|
6307
6395
|
freeze(LightningElement);
|
|
6308
6396
|
seal(LightningElement.prototype);
|
|
6309
|
-
/* version: 2.
|
|
6397
|
+
/* version: 2.24.0 */
|
|
6310
6398
|
|
|
6311
6399
|
exports.LightningElement = LightningElement;
|
|
6312
6400
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -368,9 +368,9 @@
|
|
|
368
368
|
// Increment whenever the LWC template compiler changes
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
var LWC_VERSION = "2.
|
|
371
|
+
var LWC_VERSION = "2.24.0";
|
|
372
372
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
373
|
-
/** version: 2.
|
|
373
|
+
/** version: 2.24.0 */
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
patch$1(propName);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
/** version: 2.
|
|
467
|
+
/** version: 2.24.0 */
|
|
468
468
|
|
|
469
469
|
/**
|
|
470
470
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -557,7 +557,7 @@
|
|
|
557
557
|
setFeatureFlag(name, value);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
/** version: 2.
|
|
560
|
+
/** version: 2.24.0 */
|
|
561
561
|
|
|
562
562
|
/*
|
|
563
563
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -735,6 +735,22 @@
|
|
|
735
735
|
}
|
|
736
736
|
|
|
737
737
|
return list;
|
|
738
|
+
} // Set a ref (lwc:ref) on a VM, from a template API
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
function setRefVNode(vm, ref, vnode) {
|
|
742
|
+
if (process.env.NODE_ENV !== 'production' && isUndefined$1(vm.refVNodes)) {
|
|
743
|
+
throw new Error('refVNodes must be defined when setting a ref');
|
|
744
|
+
} // If this method is called, then vm.refVNodes is set as the template has refs.
|
|
745
|
+
// If not, then something went wrong and we threw an error above.
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
var refVNodes = vm.refVNodes; // In cases of conflict (two elements with the same ref), prefer, the last one,
|
|
749
|
+
// in depth-first traversal order.
|
|
750
|
+
|
|
751
|
+
if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
|
|
752
|
+
refVNodes[ref] = vnode;
|
|
753
|
+
}
|
|
738
754
|
}
|
|
739
755
|
/*
|
|
740
756
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -2397,13 +2413,15 @@
|
|
|
2397
2413
|
}
|
|
2398
2414
|
};
|
|
2399
2415
|
}
|
|
2416
|
+
|
|
2417
|
+
var EMPTY_REFS = freeze(create(null));
|
|
2418
|
+
var refsCache = new WeakMap();
|
|
2400
2419
|
/**
|
|
2401
2420
|
* This class is the base class for any LWC element.
|
|
2402
2421
|
* Some elements directly extends this class, others implement it via inheritance.
|
|
2403
2422
|
**/
|
|
2404
2423
|
// @ts-ignore
|
|
2405
2424
|
|
|
2406
|
-
|
|
2407
2425
|
var LightningElement = function LightningElement() {
|
|
2408
2426
|
// This should be as performant as possible, while any initialization should be done lazily
|
|
2409
2427
|
if (isNull(vmBeingConstructed)) {
|
|
@@ -2630,6 +2648,91 @@
|
|
|
2630
2648
|
return vm.shadowRoot;
|
|
2631
2649
|
},
|
|
2632
2650
|
|
|
2651
|
+
get refs() {
|
|
2652
|
+
var vm = getAssociatedVM(this);
|
|
2653
|
+
|
|
2654
|
+
if (isUpdatingTemplate) {
|
|
2655
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2656
|
+
logError("this.refs should not be called while ".concat(getComponentTag(vm), " is rendering. Use this.refs only when the DOM is stable, e.g. in renderedCallback()."));
|
|
2657
|
+
} // If the template is in the process of being updated, then we don't want to go through the normal
|
|
2658
|
+
// process of returning the refs and caching them, because the state of the refs is unstable.
|
|
2659
|
+
// This can happen if e.g. a template contains `<div class={foo}></div>` and `foo` is computed
|
|
2660
|
+
// based on `this.refs.bar`.
|
|
2661
|
+
|
|
2662
|
+
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2667
|
+
warnIfInvokedDuringConstruction(vm, 'refs');
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
var refVNodes = vm.refVNodes,
|
|
2671
|
+
hasRefVNodes = vm.hasRefVNodes,
|
|
2672
|
+
cmpTemplate = vm.cmpTemplate; // If the `cmpTemplate` is null, that means that the template has not been rendered yet. Most likely this occurs
|
|
2673
|
+
// if `this.refs` is called during the `connectedCallback` phase. The DOM elements have not been rendered yet,
|
|
2674
|
+
// so log a warning. Note we also check `isBeingConstructed()` to avoid a double warning (due to
|
|
2675
|
+
// `warnIfInvokedDuringConstruction` above).
|
|
2676
|
+
|
|
2677
|
+
if (process.env.NODE_ENV !== 'production' && isNull(cmpTemplate) && !isBeingConstructed(vm)) {
|
|
2678
|
+
logError("this.refs is undefined for ".concat(getComponentTag(vm), ". This is either because the attached template has no \"lwc:ref\" directive, or this.refs was ") + "invoked before renderedCallback(). Use this.refs only when the referenced HTML elements have " + "been rendered to the DOM, such as within renderedCallback() or disconnectedCallback().");
|
|
2679
|
+
} // For backwards compatibility with component written before template refs
|
|
2680
|
+
// were introduced, we return undefined if the template has no refs defined
|
|
2681
|
+
// anywhere. This fixes components that may want to add an expando called `refs`
|
|
2682
|
+
// and are checking if it exists with `if (this.refs)` before adding it.
|
|
2683
|
+
// Note it is not sufficient to just check if `refVNodes` is null or empty,
|
|
2684
|
+
// because a template may have `lwc:ref` defined within a falsy `if:true` block.
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
if (!hasRefVNodes) {
|
|
2688
|
+
return;
|
|
2689
|
+
} // For templates that are using `lwc:ref`, if there are no refs currently available
|
|
2690
|
+
// (e.g. refs inside of a falsy `if:true` block), we return an empty object.
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
if (isNull(refVNodes)) {
|
|
2694
|
+
return EMPTY_REFS;
|
|
2695
|
+
} // The refNodes can be cached based on the refVNodes, since the refVNodes
|
|
2696
|
+
// are recreated from scratch every time the template is rendered.
|
|
2697
|
+
// This happens with `vm.refVNodes = null` in `template.ts` in `@lwc/engine-core`.
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
var refs = refsCache.get(refVNodes);
|
|
2701
|
+
|
|
2702
|
+
if (isUndefined$1(refs)) {
|
|
2703
|
+
refs = create(null);
|
|
2704
|
+
|
|
2705
|
+
var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
|
|
2706
|
+
_step3;
|
|
2707
|
+
|
|
2708
|
+
try {
|
|
2709
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
2710
|
+
var key = _step3.value;
|
|
2711
|
+
refs[key] = refVNodes[key].elm;
|
|
2712
|
+
}
|
|
2713
|
+
} catch (err) {
|
|
2714
|
+
_iterator3.e(err);
|
|
2715
|
+
} finally {
|
|
2716
|
+
_iterator3.f();
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
freeze(refs);
|
|
2720
|
+
refsCache.set(refVNodes, refs);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
return refs;
|
|
2724
|
+
},
|
|
2725
|
+
|
|
2726
|
+
// For backwards compat, we allow component authors to set `refs` as an expando
|
|
2727
|
+
set refs(value) {
|
|
2728
|
+
defineProperty(this, 'refs', {
|
|
2729
|
+
configurable: true,
|
|
2730
|
+
enumerable: true,
|
|
2731
|
+
writable: true,
|
|
2732
|
+
value: value
|
|
2733
|
+
});
|
|
2734
|
+
},
|
|
2735
|
+
|
|
2633
2736
|
get shadowRoot() {
|
|
2634
2737
|
// From within the component instance, the shadowRoot is always reported as "closed".
|
|
2635
2738
|
// Authors should rely on this.template instead.
|
|
@@ -4545,15 +4648,33 @@
|
|
|
4545
4648
|
|
|
4546
4649
|
function patchProps(oldVnode, vnode, renderer) {
|
|
4547
4650
|
var props = vnode.data.props;
|
|
4651
|
+
var spread = vnode.data.spread;
|
|
4548
4652
|
|
|
4549
|
-
if (isUndefined$1(props)) {
|
|
4653
|
+
if (isUndefined$1(props) && isUndefined$1(spread)) {
|
|
4550
4654
|
return;
|
|
4551
4655
|
}
|
|
4552
4656
|
|
|
4553
|
-
var oldProps
|
|
4657
|
+
var oldProps;
|
|
4554
4658
|
|
|
4555
|
-
if (
|
|
4556
|
-
|
|
4659
|
+
if (!isNull(oldVnode)) {
|
|
4660
|
+
oldProps = oldVnode.data.props;
|
|
4661
|
+
var oldSpread = oldVnode.data.spread;
|
|
4662
|
+
|
|
4663
|
+
if (oldProps === props && oldSpread === spread) {
|
|
4664
|
+
return;
|
|
4665
|
+
}
|
|
4666
|
+
|
|
4667
|
+
if (isUndefined$1(oldProps)) {
|
|
4668
|
+
oldProps = EmptyObject;
|
|
4669
|
+
}
|
|
4670
|
+
|
|
4671
|
+
if (!isUndefined$1(oldSpread)) {
|
|
4672
|
+
oldProps = assign({}, oldProps, oldSpread);
|
|
4673
|
+
}
|
|
4674
|
+
}
|
|
4675
|
+
|
|
4676
|
+
if (!isUndefined$1(spread)) {
|
|
4677
|
+
props = assign({}, props, spread);
|
|
4557
4678
|
}
|
|
4558
4679
|
|
|
4559
4680
|
var isFirstPatch = isNull(oldVnode);
|
|
@@ -4566,7 +4687,8 @@
|
|
|
4566
4687
|
var cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
|
|
4567
4688
|
// different than the one previously set.
|
|
4568
4689
|
|
|
4569
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key]))
|
|
4690
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key]) || !(key in oldProps) // this is required because the above case will pass when `cur` is `undefined` and key is missing in `oldProps`
|
|
4691
|
+
) {
|
|
4570
4692
|
// Additional verification if properties are supported by the element
|
|
4571
4693
|
// Validation relies on html properties and public properties being defined on the element,
|
|
4572
4694
|
// SSR has its own custom validation.
|
|
@@ -5634,19 +5756,25 @@
|
|
|
5634
5756
|
});
|
|
5635
5757
|
}
|
|
5636
5758
|
|
|
5637
|
-
var
|
|
5638
|
-
|
|
5639
|
-
|
|
5759
|
+
var key = data.key,
|
|
5760
|
+
ref = data.ref;
|
|
5761
|
+
var vnode = {
|
|
5640
5762
|
type: 2
|
|
5641
5763
|
/* VNodeType.Element */
|
|
5642
5764
|
,
|
|
5643
5765
|
sel: sel,
|
|
5644
5766
|
data: data,
|
|
5645
5767
|
children: children,
|
|
5646
|
-
elm:
|
|
5768
|
+
elm: undefined,
|
|
5647
5769
|
key: key,
|
|
5648
5770
|
owner: vmBeingRendered
|
|
5649
5771
|
};
|
|
5772
|
+
|
|
5773
|
+
if (!isUndefined$1(ref)) {
|
|
5774
|
+
setRefVNode(vmBeingRendered, ref, vnode);
|
|
5775
|
+
}
|
|
5776
|
+
|
|
5777
|
+
return vnode;
|
|
5650
5778
|
} // [t]ab[i]ndex function
|
|
5651
5779
|
|
|
5652
5780
|
|
|
@@ -5727,7 +5855,8 @@
|
|
|
5727
5855
|
}
|
|
5728
5856
|
}
|
|
5729
5857
|
|
|
5730
|
-
var key = data.key
|
|
5858
|
+
var key = data.key,
|
|
5859
|
+
ref = data.ref;
|
|
5731
5860
|
var elm, aChildren, vm;
|
|
5732
5861
|
var vnode = {
|
|
5733
5862
|
type: 3
|
|
@@ -5745,6 +5874,11 @@
|
|
|
5745
5874
|
vm: vm
|
|
5746
5875
|
};
|
|
5747
5876
|
addVNodeToChildLWC(vnode);
|
|
5877
|
+
|
|
5878
|
+
if (!isUndefined$1(ref)) {
|
|
5879
|
+
setRefVNode(vmBeingRendered, ref, vnode);
|
|
5880
|
+
}
|
|
5881
|
+
|
|
5748
5882
|
return vnode;
|
|
5749
5883
|
} // [i]terable node
|
|
5750
5884
|
|
|
@@ -6399,10 +6533,14 @@
|
|
|
6399
6533
|
validateSlots(vm, html); // add the VM to the list of host VMs that can be re-rendered if html is swapped
|
|
6400
6534
|
|
|
6401
6535
|
setActiveVM(vm);
|
|
6402
|
-
} //
|
|
6403
|
-
// to custom elements from the template.
|
|
6536
|
+
} // reset the refs; they will be set during the tmpl() instantiation
|
|
6404
6537
|
|
|
6405
6538
|
|
|
6539
|
+
var hasRefVNodes = Boolean(html.hasRefs);
|
|
6540
|
+
vm.hasRefVNodes = hasRefVNodes;
|
|
6541
|
+
vm.refVNodes = hasRefVNodes ? create(null) : null; // right before producing the vnodes, we clear up all internal references
|
|
6542
|
+
// to custom elements from the template.
|
|
6543
|
+
|
|
6406
6544
|
vm.velements = []; // Set the global flag that template is being updated
|
|
6407
6545
|
|
|
6408
6546
|
isUpdatingTemplate = true;
|
|
@@ -6814,6 +6952,8 @@
|
|
|
6814
6952
|
tagName: tagName,
|
|
6815
6953
|
mode: mode,
|
|
6816
6954
|
owner: owner,
|
|
6955
|
+
refVNodes: null,
|
|
6956
|
+
hasRefVNodes: false,
|
|
6817
6957
|
children: EmptyArray,
|
|
6818
6958
|
aChildren: EmptyArray,
|
|
6819
6959
|
velements: EmptyArray,
|
|
@@ -8275,12 +8415,12 @@
|
|
|
8275
8415
|
function warnOnArrayMutation(stylesheets) {
|
|
8276
8416
|
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
8277
8417
|
// we can at least warn when they use the most common mutation methods.
|
|
8278
|
-
var
|
|
8279
|
-
|
|
8418
|
+
var _iterator4 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
8419
|
+
_step4;
|
|
8280
8420
|
|
|
8281
8421
|
try {
|
|
8282
8422
|
var _loop2 = function _loop2() {
|
|
8283
|
-
var prop =
|
|
8423
|
+
var prop = _step4.value;
|
|
8284
8424
|
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
8285
8425
|
|
|
8286
8426
|
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
@@ -8290,13 +8430,13 @@
|
|
|
8290
8430
|
};
|
|
8291
8431
|
};
|
|
8292
8432
|
|
|
8293
|
-
for (
|
|
8433
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
8294
8434
|
_loop2();
|
|
8295
8435
|
}
|
|
8296
8436
|
} catch (err) {
|
|
8297
|
-
|
|
8437
|
+
_iterator4.e(err);
|
|
8298
8438
|
} finally {
|
|
8299
|
-
|
|
8439
|
+
_iterator4.f();
|
|
8300
8440
|
}
|
|
8301
8441
|
} // TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
|
|
8302
8442
|
// just warns on mutation.
|
|
@@ -8308,12 +8448,12 @@
|
|
|
8308
8448
|
warnOnArrayMutation(tmpl.stylesheets);
|
|
8309
8449
|
}
|
|
8310
8450
|
|
|
8311
|
-
var
|
|
8312
|
-
|
|
8451
|
+
var _iterator5 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
8452
|
+
_step5;
|
|
8313
8453
|
|
|
8314
8454
|
try {
|
|
8315
8455
|
var _loop3 = function _loop3() {
|
|
8316
|
-
var prop =
|
|
8456
|
+
var prop = _step5.value;
|
|
8317
8457
|
var value = tmpl[prop];
|
|
8318
8458
|
defineProperty(tmpl, prop, {
|
|
8319
8459
|
enumerable: true,
|
|
@@ -8331,13 +8471,13 @@
|
|
|
8331
8471
|
});
|
|
8332
8472
|
};
|
|
8333
8473
|
|
|
8334
|
-
for (
|
|
8474
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
8335
8475
|
_loop3();
|
|
8336
8476
|
}
|
|
8337
8477
|
} catch (err) {
|
|
8338
|
-
|
|
8478
|
+
_iterator5.e(err);
|
|
8339
8479
|
} finally {
|
|
8340
|
-
|
|
8480
|
+
_iterator5.f();
|
|
8341
8481
|
}
|
|
8342
8482
|
|
|
8343
8483
|
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
@@ -8382,7 +8522,7 @@
|
|
|
8382
8522
|
|
|
8383
8523
|
return ctor;
|
|
8384
8524
|
}
|
|
8385
|
-
/* version: 2.
|
|
8525
|
+
/* version: 2.24.0 */
|
|
8386
8526
|
|
|
8387
8527
|
/*
|
|
8388
8528
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8610,7 +8750,7 @@
|
|
|
8610
8750
|
function isNull(obj) {
|
|
8611
8751
|
return obj === null;
|
|
8612
8752
|
}
|
|
8613
|
-
/** version: 2.
|
|
8753
|
+
/** version: 2.24.0 */
|
|
8614
8754
|
|
|
8615
8755
|
/*
|
|
8616
8756
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8759,18 +8899,18 @@
|
|
|
8759
8899
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8760
8900
|
|
|
8761
8901
|
if (!isUndefined(wrapperTags)) {
|
|
8762
|
-
var
|
|
8763
|
-
|
|
8902
|
+
var _iterator6 = _createForOfIteratorHelper(wrapperTags),
|
|
8903
|
+
_step6;
|
|
8764
8904
|
|
|
8765
8905
|
try {
|
|
8766
|
-
for (
|
|
8767
|
-
var wrapperTag =
|
|
8906
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
8907
|
+
var wrapperTag = _step6.value;
|
|
8768
8908
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8769
8909
|
}
|
|
8770
8910
|
} catch (err) {
|
|
8771
|
-
|
|
8911
|
+
_iterator6.e(err);
|
|
8772
8912
|
} finally {
|
|
8773
|
-
|
|
8913
|
+
_iterator6.f();
|
|
8774
8914
|
}
|
|
8775
8915
|
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
8776
8916
|
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
@@ -9340,7 +9480,7 @@
|
|
|
9340
9480
|
});
|
|
9341
9481
|
freeze(LightningElement);
|
|
9342
9482
|
seal(LightningElement.prototype);
|
|
9343
|
-
/* version: 2.
|
|
9483
|
+
/* version: 2.24.0 */
|
|
9344
9484
|
|
|
9345
9485
|
exports.LightningElement = LightningElement;
|
|
9346
9486
|
exports.__unstable__ProfilerControl = profilerControl;
|