lwc 2.35.0 → 2.35.2
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 +61 -134
- package/dist/engine-dom/iife/es2017/engine-dom.js +61 -134
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +100 -74
- package/dist/engine-dom/iife/es5/engine-dom.js +249 -327
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +266 -244
- package/dist/engine-dom/umd/es2017/engine-dom.js +61 -134
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +100 -74
- package/dist/engine-dom/umd/es5/engine-dom.js +249 -327
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +266 -244
- package/dist/engine-server/commonjs/es2017/engine-server.js +47 -136
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +47 -136
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +11 -42
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +11 -42
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +8 -38
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +15 -44
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +12 -40
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +11 -42
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +8 -38
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +15 -44
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +12 -40
- 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
|
@@ -32,10 +32,10 @@ var LWC = (function (exports) {
|
|
|
32
32
|
|
|
33
33
|
var assert = /*#__PURE__*/Object.freeze({
|
|
34
34
|
__proto__: null,
|
|
35
|
+
fail: fail,
|
|
35
36
|
invariant: invariant,
|
|
36
|
-
isTrue: isTrue$1,
|
|
37
37
|
isFalse: isFalse$1,
|
|
38
|
-
|
|
38
|
+
isTrue: isTrue$1
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
/*
|
|
@@ -202,41 +202,11 @@ var LWC = (function (exports) {
|
|
|
202
202
|
* SPDX-License-Identifier: MIT
|
|
203
203
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
204
204
|
*/
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
let _globalThis;
|
|
212
|
-
try {
|
|
213
|
-
// eslint-disable-next-line no-extend-native
|
|
214
|
-
Object.defineProperty(Object.prototype, '__magic__', {
|
|
215
|
-
get: function () {
|
|
216
|
-
return this;
|
|
217
|
-
},
|
|
218
|
-
configurable: true,
|
|
219
|
-
});
|
|
220
|
-
// __magic__ is undefined in Safari 10 and IE10 and older.
|
|
221
|
-
// @ts-ignore
|
|
222
|
-
// eslint-disable-next-line no-undef
|
|
223
|
-
_globalThis = __magic__;
|
|
224
|
-
// @ts-ignore
|
|
225
|
-
delete Object.prototype.__magic__;
|
|
226
|
-
}
|
|
227
|
-
catch (ex) {
|
|
228
|
-
// In IE8, Object.defineProperty only works on DOM objects.
|
|
229
|
-
}
|
|
230
|
-
finally {
|
|
231
|
-
// If the magic above fails for some reason we assume that we are in a legacy browser.
|
|
232
|
-
// Assume `window` exists in this case.
|
|
233
|
-
if (typeof _globalThis === 'undefined') {
|
|
234
|
-
// @ts-ignore
|
|
235
|
-
_globalThis = window;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return _globalThis;
|
|
239
|
-
})();
|
|
205
|
+
// See browser support for globalThis:
|
|
206
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
|
|
207
|
+
/* istanbul ignore next */
|
|
208
|
+
// @ts-ignore
|
|
209
|
+
const _globalThis = typeof globalThis === 'object' ? globalThis : window;
|
|
240
210
|
|
|
241
211
|
/*
|
|
242
212
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -351,7 +321,7 @@ var LWC = (function (exports) {
|
|
|
351
321
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
352
322
|
return propertyName;
|
|
353
323
|
}
|
|
354
|
-
/** version: 2.35.
|
|
324
|
+
/** version: 2.35.2 */
|
|
355
325
|
|
|
356
326
|
/**
|
|
357
327
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -401,6 +371,7 @@ var LWC = (function (exports) {
|
|
|
401
371
|
console.warn(`Failed to set the value "${value}" for the runtime feature flag "${name}" because it is undefined. Available flags: ${availableFlags}.`);
|
|
402
372
|
return;
|
|
403
373
|
}
|
|
374
|
+
// This may seem redundant, but `"production" === 'test-karma-lwc'` is replaced by Karma tests
|
|
404
375
|
{
|
|
405
376
|
// Disallow the same flag to be set more than once in production
|
|
406
377
|
const runtimeValue = lwcRuntimeFlags[name];
|
|
@@ -418,7 +389,7 @@ var LWC = (function (exports) {
|
|
|
418
389
|
*/
|
|
419
390
|
function setFeatureFlagForTest(name, value) {
|
|
420
391
|
}
|
|
421
|
-
/** version: 2.35.
|
|
392
|
+
/** version: 2.35.2 */
|
|
422
393
|
|
|
423
394
|
/**
|
|
424
395
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -482,7 +453,7 @@ var LWC = (function (exports) {
|
|
|
482
453
|
}
|
|
483
454
|
}
|
|
484
455
|
}
|
|
485
|
-
/** version: 2.35.
|
|
456
|
+
/** version: 2.35.2 */
|
|
486
457
|
|
|
487
458
|
/*
|
|
488
459
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -840,6 +811,14 @@ var LWC = (function (exports) {
|
|
|
840
811
|
refVNodes[ref] = vnode;
|
|
841
812
|
}
|
|
842
813
|
}
|
|
814
|
+
// Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
|
|
815
|
+
function assertNotProd() {
|
|
816
|
+
/* istanbul ignore if */
|
|
817
|
+
{
|
|
818
|
+
// this method should never leak to prod
|
|
819
|
+
throw new ReferenceError();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
843
822
|
|
|
844
823
|
/*
|
|
845
824
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -1430,7 +1409,6 @@ var LWC = (function (exports) {
|
|
|
1430
1409
|
}
|
|
1431
1410
|
};
|
|
1432
1411
|
}
|
|
1433
|
-
const EMPTY_REFS = freeze(create(null));
|
|
1434
1412
|
const refsCache = new WeakMap();
|
|
1435
1413
|
/**
|
|
1436
1414
|
* This class is the base class for any LWC element.
|
|
@@ -1668,22 +1646,15 @@ var LWC = (function (exports) {
|
|
|
1668
1646
|
}
|
|
1669
1647
|
const {
|
|
1670
1648
|
refVNodes,
|
|
1671
|
-
hasRefVNodes,
|
|
1672
1649
|
cmpTemplate
|
|
1673
1650
|
} = vm;
|
|
1674
1651
|
// For backwards compatibility with component written before template refs
|
|
1675
1652
|
// were introduced, we return undefined if the template has no refs defined
|
|
1676
1653
|
// anywhere. This fixes components that may want to add an expando called `refs`
|
|
1677
1654
|
// and are checking if it exists with `if (this.refs)` before adding it.
|
|
1678
|
-
// Note
|
|
1679
|
-
// because a template may have `lwc:ref` defined within a falsy `if:true` block.
|
|
1680
|
-
if (!hasRefVNodes) {
|
|
1681
|
-
return;
|
|
1682
|
-
}
|
|
1683
|
-
// For templates that are using `lwc:ref`, if there are no refs currently available
|
|
1684
|
-
// (e.g. refs inside of a falsy `if:true` block), we return an empty object.
|
|
1655
|
+
// Note we use a null refVNodes to indicate that the template has no refs defined.
|
|
1685
1656
|
if (isNull(refVNodes)) {
|
|
1686
|
-
return
|
|
1657
|
+
return;
|
|
1687
1658
|
}
|
|
1688
1659
|
// The refNodes can be cached based on the refVNodes, since the refVNodes
|
|
1689
1660
|
// are recreated from scratch every time the template is rendered.
|
|
@@ -2500,10 +2471,60 @@ var LWC = (function (exports) {
|
|
|
2500
2471
|
}
|
|
2501
2472
|
freeze(BaseBridgeElement);
|
|
2502
2473
|
seal(BaseBridgeElement.prototype);
|
|
2474
|
+
const swappedStyleMap = new WeakMap();
|
|
2475
|
+
const activeTemplates = new WeakMap();
|
|
2476
|
+
const activeComponents = new WeakMap();
|
|
2477
|
+
const activeStyles = new WeakMap();
|
|
2478
|
+
function getStyleOrSwappedStyle(style) {
|
|
2479
|
+
assertNotProd(); // this method should never leak to prod
|
|
2480
|
+
const visited = new Set();
|
|
2481
|
+
while (swappedStyleMap.has(style) && !visited.has(style)) {
|
|
2482
|
+
visited.add(style);
|
|
2483
|
+
style = swappedStyleMap.get(style);
|
|
2484
|
+
}
|
|
2485
|
+
return style;
|
|
2486
|
+
}
|
|
2503
2487
|
function setActiveVM(vm) {
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2488
|
+
assertNotProd(); // this method should never leak to prod
|
|
2489
|
+
// tracking active component
|
|
2490
|
+
const Ctor = vm.def.ctor;
|
|
2491
|
+
let componentVMs = activeComponents.get(Ctor);
|
|
2492
|
+
if (isUndefined$1(componentVMs)) {
|
|
2493
|
+
componentVMs = new Set();
|
|
2494
|
+
activeComponents.set(Ctor, componentVMs);
|
|
2495
|
+
}
|
|
2496
|
+
// this will allow us to keep track of the hot components
|
|
2497
|
+
componentVMs.add(vm);
|
|
2498
|
+
// tracking active template
|
|
2499
|
+
const tpl = vm.cmpTemplate;
|
|
2500
|
+
if (tpl) {
|
|
2501
|
+
let templateVMs = activeTemplates.get(tpl);
|
|
2502
|
+
if (isUndefined$1(templateVMs)) {
|
|
2503
|
+
templateVMs = new Set();
|
|
2504
|
+
activeTemplates.set(tpl, templateVMs);
|
|
2505
|
+
}
|
|
2506
|
+
// this will allow us to keep track of the templates that are
|
|
2507
|
+
// being used by a hot component
|
|
2508
|
+
templateVMs.add(vm);
|
|
2509
|
+
// tracking active styles associated to template
|
|
2510
|
+
const stylesheets = tpl.stylesheets;
|
|
2511
|
+
if (!isUndefined$1(stylesheets)) {
|
|
2512
|
+
flattenStylesheets(stylesheets).forEach((stylesheet) => {
|
|
2513
|
+
// this is necessary because we don't hold the list of styles
|
|
2514
|
+
// in the vm, we only hold the selected (already swapped template)
|
|
2515
|
+
// but the styles attached to the template might not be the actual
|
|
2516
|
+
// active ones, but the swapped versions of those.
|
|
2517
|
+
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
2518
|
+
let stylesheetVMs = activeStyles.get(stylesheet);
|
|
2519
|
+
if (isUndefined$1(stylesheetVMs)) {
|
|
2520
|
+
stylesheetVMs = new Set();
|
|
2521
|
+
activeStyles.set(stylesheet, stylesheetVMs);
|
|
2522
|
+
}
|
|
2523
|
+
// this will allow us to keep track of the stylesheet that are
|
|
2524
|
+
// being used by a hot component
|
|
2525
|
+
stylesheetVMs.add(vm);
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2507
2528
|
}
|
|
2508
2529
|
}
|
|
2509
2530
|
function swapTemplate(oldTpl, newTpl) {
|
|
@@ -4335,9 +4356,17 @@ var LWC = (function (exports) {
|
|
|
4335
4356
|
vmBeingRendered = vm;
|
|
4336
4357
|
}
|
|
4337
4358
|
function validateSlots(vm, html) {
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4359
|
+
assertNotProd(); // this method should never leak to prod
|
|
4360
|
+
const { cmpSlots } = vm;
|
|
4361
|
+
const { slots = EmptyArray } = html;
|
|
4362
|
+
for (const slotName in cmpSlots.slotAssignments) {
|
|
4363
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4364
|
+
assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots.slotAssignments[slotName])} for slot "${slotName}" in ${vm}.`);
|
|
4365
|
+
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
4366
|
+
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
4367
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4368
|
+
logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
|
|
4369
|
+
}
|
|
4341
4370
|
}
|
|
4342
4371
|
}
|
|
4343
4372
|
function validateLightDomTemplate(template, vm) {
|
|
@@ -4447,9 +4476,7 @@ var LWC = (function (exports) {
|
|
|
4447
4476
|
}
|
|
4448
4477
|
if ("production" !== 'production') ;
|
|
4449
4478
|
// reset the refs; they will be set during the tmpl() instantiation
|
|
4450
|
-
|
|
4451
|
-
vm.hasRefVNodes = hasRefVNodes;
|
|
4452
|
-
vm.refVNodes = hasRefVNodes ? create(null) : null;
|
|
4479
|
+
vm.refVNodes = html.hasRefs ? create(null) : null;
|
|
4453
4480
|
// right before producing the vnodes, we clear up all internal references
|
|
4454
4481
|
// to custom elements from the template.
|
|
4455
4482
|
vm.velements = [];
|
|
@@ -4606,7 +4633,7 @@ var LWC = (function (exports) {
|
|
|
4606
4633
|
const cmpEventListenerMap = new WeakMap();
|
|
4607
4634
|
function getWrappedComponentsListener(vm, listener) {
|
|
4608
4635
|
if (!isFunction$1(listener)) {
|
|
4609
|
-
throw new TypeError(); // avoiding problems with non-valid listeners
|
|
4636
|
+
throw new TypeError('Expected an EventListener but received ' + typeof listener); // avoiding problems with non-valid listeners
|
|
4610
4637
|
}
|
|
4611
4638
|
let wrappedListener = cmpEventListenerMap.get(listener);
|
|
4612
4639
|
if (isUndefined$1(wrappedListener)) {
|
|
@@ -4739,7 +4766,6 @@ var LWC = (function (exports) {
|
|
|
4739
4766
|
mode,
|
|
4740
4767
|
owner,
|
|
4741
4768
|
refVNodes: null,
|
|
4742
|
-
hasRefVNodes: false,
|
|
4743
4769
|
children: EmptyArray,
|
|
4744
4770
|
aChildren: EmptyArray,
|
|
4745
4771
|
velements: EmptyArray,
|
|
@@ -5950,7 +5976,7 @@ var LWC = (function (exports) {
|
|
|
5950
5976
|
const cachedConstructors = new Map();
|
|
5951
5977
|
const elementsUpgradedOutsideLWC = new WeakSet();
|
|
5952
5978
|
let elementBeingUpgradedByLWC = false;
|
|
5953
|
-
// Creates a constructor that is intended to be used as a
|
|
5979
|
+
// Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
|
|
5954
5980
|
// passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
|
|
5955
5981
|
// Another benefit is that only LWC can create components that actually do anything – if you do
|
|
5956
5982
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
@@ -5995,7 +6021,7 @@ var LWC = (function (exports) {
|
|
|
5995
6021
|
}
|
|
5996
6022
|
return UpgradableConstructor;
|
|
5997
6023
|
};
|
|
5998
|
-
const
|
|
6024
|
+
const createCustomElementUsingUpgradableConstructor = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
5999
6025
|
// use global custom elements registry
|
|
6000
6026
|
let UpgradableConstructor = cachedConstructors.get(tagName);
|
|
6001
6027
|
if (isUndefined$1(UpgradableConstructor)) {
|
|
@@ -6023,7 +6049,7 @@ var LWC = (function (exports) {
|
|
|
6023
6049
|
*/
|
|
6024
6050
|
/**
|
|
6025
6051
|
* Create a scoped registry, i.e. a function that can create custom elements whose tag names
|
|
6026
|
-
* do not conflict with
|
|
6052
|
+
* do not conflict with third-party custom elements having the same tag name.
|
|
6027
6053
|
*/
|
|
6028
6054
|
function createScopedRegistry() {
|
|
6029
6055
|
if (!hasCustomElements) {
|
|
@@ -6564,10 +6590,10 @@ var LWC = (function (exports) {
|
|
|
6564
6590
|
* We have three modes for creating custom elements:
|
|
6565
6591
|
*
|
|
6566
6592
|
* 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
|
|
6567
|
-
* 2. "
|
|
6568
|
-
*
|
|
6569
|
-
*
|
|
6570
|
-
* constructor, which allows us to have completely customized functionality for different components.
|
|
6593
|
+
* 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
|
|
6594
|
+
* via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
|
|
6595
|
+
* a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
|
|
6596
|
+
* constructor"), which allows us to have completely customized functionality for different components.
|
|
6571
6597
|
* 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
|
|
6572
6598
|
* elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
|
|
6573
6599
|
* between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
|
|
@@ -6578,8 +6604,8 @@ var LWC = (function (exports) {
|
|
|
6578
6604
|
if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
|
|
6579
6605
|
createCustomElement = createCustomElementScoped;
|
|
6580
6606
|
} else {
|
|
6581
|
-
// use global
|
|
6582
|
-
createCustomElement =
|
|
6607
|
+
// use the global registry, with an upgradable constructor for the defined custom element
|
|
6608
|
+
createCustomElement = createCustomElementUsingUpgradableConstructor;
|
|
6583
6609
|
}
|
|
6584
6610
|
} else {
|
|
6585
6611
|
// no registry available here
|
|
@@ -6635,10 +6661,10 @@ var LWC = (function (exports) {
|
|
|
6635
6661
|
|
|
6636
6662
|
var assert = /*#__PURE__*/Object.freeze({
|
|
6637
6663
|
__proto__: null,
|
|
6664
|
+
fail: fail,
|
|
6638
6665
|
invariant: invariant,
|
|
6639
|
-
isTrue: isTrue$1,
|
|
6640
6666
|
isFalse: isFalse$1,
|
|
6641
|
-
|
|
6667
|
+
isTrue: isTrue$1
|
|
6642
6668
|
});
|
|
6643
6669
|
function isUndefined(obj) {
|
|
6644
6670
|
return obj === undefined;
|
|
@@ -6646,7 +6672,7 @@ var LWC = (function (exports) {
|
|
|
6646
6672
|
function isNull(obj) {
|
|
6647
6673
|
return obj === null;
|
|
6648
6674
|
}
|
|
6649
|
-
/** version: 2.35.
|
|
6675
|
+
/** version: 2.35.2 */
|
|
6650
6676
|
|
|
6651
6677
|
/*
|
|
6652
6678
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7199,7 +7225,7 @@ var LWC = (function (exports) {
|
|
|
7199
7225
|
});
|
|
7200
7226
|
freeze(LightningElement);
|
|
7201
7227
|
seal(LightningElement.prototype);
|
|
7202
|
-
/* version: 2.35.
|
|
7228
|
+
/* version: 2.35.2 */
|
|
7203
7229
|
|
|
7204
7230
|
exports.LightningElement = LightningElement;
|
|
7205
7231
|
exports.__unstable__ProfilerControl = profilerControl;
|