lwc 2.30.1 → 2.30.3
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 +207 -75
- package/dist/engine-dom/iife/es2017/engine-dom.js +207 -75
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +204 -72
- package/dist/engine-dom/iife/es5/engine-dom.js +254 -118
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +251 -115
- package/dist/engine-dom/umd/es2017/engine-dom.js +207 -75
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +204 -72
- package/dist/engine-dom/umd/es5/engine-dom.js +254 -118
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +251 -115
- package/dist/engine-server/commonjs/es2017/engine-server.js +128 -48
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +128 -48
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +7 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +7 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +7 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +7 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +7 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +7 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +7 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +7 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +7 -4
- 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
|
@@ -240,32 +240,57 @@ var LWC = (function (exports) {
|
|
|
240
240
|
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
241
241
|
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
242
242
|
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
*
|
|
243
|
+
|
|
244
|
+
/*
|
|
245
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
246
|
+
* All rights reserved.
|
|
247
|
+
* SPDX-License-Identifier: MIT
|
|
248
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
246
249
|
*/
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
[
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
250
|
+
const CAMEL_REGEX = /-([a-z])/g;
|
|
251
|
+
// Convoluted map generation so that @lwc/shared remains fully tree-shakable (verify-treeshakable)
|
|
252
|
+
const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING } =
|
|
253
|
+
/*#__PURE__*/ (() => {
|
|
254
|
+
/**
|
|
255
|
+
* Map composed of properties to attributes not following the HTML property to attribute mapping
|
|
256
|
+
* convention.
|
|
257
|
+
*/
|
|
258
|
+
const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
|
|
259
|
+
['accessKey', 'accesskey'],
|
|
260
|
+
['readOnly', 'readonly'],
|
|
261
|
+
['tabIndex', 'tabindex'],
|
|
262
|
+
['bgColor', 'bgcolor'],
|
|
263
|
+
['colSpan', 'colspan'],
|
|
264
|
+
['rowSpan', 'rowspan'],
|
|
265
|
+
['contentEditable', 'contenteditable'],
|
|
266
|
+
['crossOrigin', 'crossorigin'],
|
|
267
|
+
['dateTime', 'datetime'],
|
|
268
|
+
['formAction', 'formaction'],
|
|
269
|
+
['isMap', 'ismap'],
|
|
270
|
+
['maxLength', 'maxlength'],
|
|
271
|
+
['minLength', 'minlength'],
|
|
272
|
+
['noValidate', 'novalidate'],
|
|
273
|
+
['useMap', 'usemap'],
|
|
274
|
+
['htmlFor', 'for'],
|
|
275
|
+
]);
|
|
276
|
+
/**
|
|
277
|
+
* Inverted map with attribute name key and property name value.
|
|
278
|
+
*/
|
|
279
|
+
const NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING = new Map();
|
|
280
|
+
NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.forEach((value, key) => NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.set(value, key));
|
|
281
|
+
return {
|
|
282
|
+
NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING,
|
|
283
|
+
NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING,
|
|
284
|
+
};
|
|
285
|
+
})();
|
|
265
286
|
/**
|
|
266
287
|
* Map associating previously transformed HTML property into HTML attribute.
|
|
267
288
|
*/
|
|
268
289
|
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
|
|
290
|
+
/**
|
|
291
|
+
* Map associating previously transformed HTML attribute into HTML property.
|
|
292
|
+
*/
|
|
293
|
+
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = new Map();
|
|
269
294
|
function htmlPropertyToAttribute(propName) {
|
|
270
295
|
const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
|
|
271
296
|
if (!isUndefined$1(ariaAttributeName)) {
|
|
@@ -294,6 +319,23 @@ var LWC = (function (exports) {
|
|
|
294
319
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
295
320
|
return attributeName;
|
|
296
321
|
}
|
|
322
|
+
function htmlAttributeToProperty(attrName) {
|
|
323
|
+
const ariaPropertyName = AriaAttrNameToPropNameMap[attrName];
|
|
324
|
+
if (!isUndefined$1(ariaPropertyName)) {
|
|
325
|
+
return ariaPropertyName;
|
|
326
|
+
}
|
|
327
|
+
const specialPropertyName = NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
|
|
328
|
+
if (!isUndefined$1(specialPropertyName)) {
|
|
329
|
+
return specialPropertyName;
|
|
330
|
+
}
|
|
331
|
+
const cachedPropertyName = CACHED_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
|
|
332
|
+
if (!isUndefined$1(cachedPropertyName)) {
|
|
333
|
+
return cachedPropertyName;
|
|
334
|
+
}
|
|
335
|
+
const propertyName = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
|
|
336
|
+
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
337
|
+
return propertyName;
|
|
338
|
+
}
|
|
297
339
|
|
|
298
340
|
/*
|
|
299
341
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -302,9 +344,9 @@ var LWC = (function (exports) {
|
|
|
302
344
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
303
345
|
*/
|
|
304
346
|
// Increment whenever the LWC template compiler changes
|
|
305
|
-
const LWC_VERSION = "2.30.
|
|
347
|
+
const LWC_VERSION = "2.30.3";
|
|
306
348
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
307
|
-
/** version: 2.30.
|
|
349
|
+
/** version: 2.30.3 */
|
|
308
350
|
|
|
309
351
|
/**
|
|
310
352
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -386,7 +428,7 @@ var LWC = (function (exports) {
|
|
|
386
428
|
patch$1(propName);
|
|
387
429
|
}
|
|
388
430
|
}
|
|
389
|
-
/** version: 2.30.
|
|
431
|
+
/** version: 2.30.3 */
|
|
390
432
|
|
|
391
433
|
/**
|
|
392
434
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -466,7 +508,7 @@ var LWC = (function (exports) {
|
|
|
466
508
|
setFeatureFlag(name, value);
|
|
467
509
|
}
|
|
468
510
|
}
|
|
469
|
-
/** version: 2.30.
|
|
511
|
+
/** version: 2.30.3 */
|
|
470
512
|
|
|
471
513
|
/*
|
|
472
514
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3618,7 +3660,7 @@ var LWC = (function (exports) {
|
|
|
3618
3660
|
* SPDX-License-Identifier: MIT
|
|
3619
3661
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3620
3662
|
*/
|
|
3621
|
-
const ColonCharCode = 58;
|
|
3663
|
+
const ColonCharCode$1 = 58;
|
|
3622
3664
|
function patchAttributes(oldVnode, vnode, renderer) {
|
|
3623
3665
|
const { attrs } = vnode.data;
|
|
3624
3666
|
if (isUndefined$1(attrs)) {
|
|
@@ -3635,11 +3677,11 @@ var LWC = (function (exports) {
|
|
|
3635
3677
|
const old = oldAttrs[key];
|
|
3636
3678
|
if (old !== cur) {
|
|
3637
3679
|
unlockAttribute(elm, key);
|
|
3638
|
-
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
3680
|
+
if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
|
|
3639
3681
|
// Assume xml namespace
|
|
3640
3682
|
setAttribute(elm, key, cur, XML_NAMESPACE);
|
|
3641
3683
|
}
|
|
3642
|
-
else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
3684
|
+
else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
|
|
3643
3685
|
// Assume xlink namespace
|
|
3644
3686
|
setAttribute(elm, key, cur, XLINK_NAMESPACE);
|
|
3645
3687
|
}
|
|
@@ -3654,6 +3696,46 @@ var LWC = (function (exports) {
|
|
|
3654
3696
|
}
|
|
3655
3697
|
}
|
|
3656
3698
|
|
|
3699
|
+
/*
|
|
3700
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3701
|
+
* All rights reserved.
|
|
3702
|
+
* SPDX-License-Identifier: MIT
|
|
3703
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3704
|
+
*/
|
|
3705
|
+
const ColonCharCode = 58;
|
|
3706
|
+
function patchAttrUnlessProp(oldVnode, vnode, renderer) {
|
|
3707
|
+
const { data: { attrs }, elm, } = vnode;
|
|
3708
|
+
if (isUndefined$1(attrs)) {
|
|
3709
|
+
return;
|
|
3710
|
+
}
|
|
3711
|
+
const { removeAttribute, setAttribute, setProperty } = renderer;
|
|
3712
|
+
const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
|
|
3713
|
+
for (const name in attrs) {
|
|
3714
|
+
const cur = attrs[name];
|
|
3715
|
+
const old = oldAttrs[name];
|
|
3716
|
+
if (old !== cur) {
|
|
3717
|
+
const propName = htmlAttributeToProperty(name);
|
|
3718
|
+
if (propName in elm) {
|
|
3719
|
+
setProperty(elm, name, cur);
|
|
3720
|
+
}
|
|
3721
|
+
else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
|
|
3722
|
+
// Assume xml namespace
|
|
3723
|
+
setAttribute(elm, name, cur, XML_NAMESPACE);
|
|
3724
|
+
}
|
|
3725
|
+
else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
|
|
3726
|
+
// Assume xlink namespace
|
|
3727
|
+
setAttribute(elm, name, cur, XLINK_NAMESPACE);
|
|
3728
|
+
}
|
|
3729
|
+
else if (isNull(cur) || isUndefined$1(cur)) {
|
|
3730
|
+
removeAttribute(elm, name);
|
|
3731
|
+
}
|
|
3732
|
+
else {
|
|
3733
|
+
setAttribute(elm, name, cur);
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3657
3739
|
/*
|
|
3658
3740
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3659
3741
|
* All rights reserved.
|
|
@@ -4063,16 +4145,16 @@ var LWC = (function (exports) {
|
|
|
4063
4145
|
// the custom element from the registry is expecting an upgrade callback
|
|
4064
4146
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
4065
4147
|
};
|
|
4066
|
-
|
|
4067
|
-
|
|
4148
|
+
let connectedCallback;
|
|
4149
|
+
let disconnectedCallback;
|
|
4150
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4151
|
+
connectedCallback = elm => {
|
|
4068
4152
|
connectRootElement(elm);
|
|
4069
|
-
}
|
|
4070
|
-
|
|
4071
|
-
const disconnectedCallback = elm => {
|
|
4072
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4153
|
+
};
|
|
4154
|
+
disconnectedCallback = elm => {
|
|
4073
4155
|
disconnectRootElement(elm);
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4156
|
+
};
|
|
4157
|
+
}
|
|
4076
4158
|
// Should never get a tag with upper case letter at this point; the compiler
|
|
4077
4159
|
// should produce only tags with lowercase letters. However, the Java
|
|
4078
4160
|
// compiler may generate tagnames with uppercase letters so - for backwards
|
|
@@ -4250,7 +4332,11 @@ var LWC = (function (exports) {
|
|
|
4250
4332
|
// value is set before type=radio.
|
|
4251
4333
|
patchClassAttribute(oldVnode, vnode, renderer);
|
|
4252
4334
|
patchStyleAttribute(oldVnode, vnode, renderer);
|
|
4253
|
-
|
|
4335
|
+
if (vnode.data.external) {
|
|
4336
|
+
patchAttrUnlessProp(oldVnode, vnode, renderer);
|
|
4337
|
+
} else {
|
|
4338
|
+
patchAttributes(oldVnode, vnode, renderer);
|
|
4339
|
+
}
|
|
4254
4340
|
patchProps(oldVnode, vnode, renderer);
|
|
4255
4341
|
}
|
|
4256
4342
|
function applyStyleScoping(elm, owner, renderer) {
|
|
@@ -4683,8 +4769,11 @@ var LWC = (function (exports) {
|
|
|
4683
4769
|
!isUndefined$1(slotset.slotAssignments) &&
|
|
4684
4770
|
!isUndefined$1(slotset.slotAssignments[slotName]) &&
|
|
4685
4771
|
slotset.slotAssignments[slotName].length !== 0) {
|
|
4686
|
-
|
|
4687
|
-
|
|
4772
|
+
const newChildren = [];
|
|
4773
|
+
const slotAssignments = slotset.slotAssignments[slotName];
|
|
4774
|
+
for (let i = 0; i < slotAssignments.length; i++) {
|
|
4775
|
+
const vnode = slotAssignments[i];
|
|
4776
|
+
if (!isNull(vnode)) {
|
|
4688
4777
|
const assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
|
|
4689
4778
|
// The only sniff test for a scoped <slot> element is the presence of `slotData`
|
|
4690
4779
|
const isScopedSlotElement = !isUndefined$1(data.slotData);
|
|
@@ -4694,32 +4783,30 @@ var LWC = (function (exports) {
|
|
|
4694
4783
|
logError(`Mismatched slot types for ${slotName === '' ? '(default)' : slotName} slot. Both parent and child component must use standard type or scoped type for a given slot.`, slotset.owner);
|
|
4695
4784
|
}
|
|
4696
4785
|
// Ignore slot content from parent
|
|
4697
|
-
|
|
4786
|
+
continue;
|
|
4698
4787
|
}
|
|
4699
4788
|
// If the passed slot content is factory, evaluate it and add the produced vnodes
|
|
4700
4789
|
if (assignedNodeIsScopedSlot) {
|
|
4701
4790
|
const vmBeingRenderedInception = getVMBeingRendered();
|
|
4702
|
-
let scopedSlotChildren = [];
|
|
4703
4791
|
// Evaluate in the scope of the slot content's owner
|
|
4704
4792
|
// if a slotset is provided, there will always be an owner. The only case where owner is
|
|
4705
4793
|
// undefined is for root components, but root components cannot accept slotted content
|
|
4706
4794
|
setVMBeingRendered(slotset.owner);
|
|
4707
4795
|
try {
|
|
4708
|
-
|
|
4796
|
+
ArrayPush$1.apply(newChildren, vnode.factory(data.slotData));
|
|
4709
4797
|
}
|
|
4710
4798
|
finally {
|
|
4711
4799
|
setVMBeingRendered(vmBeingRenderedInception);
|
|
4712
4800
|
}
|
|
4713
|
-
return ArrayConcat$1.call(accumulator, scopedSlotChildren);
|
|
4714
4801
|
}
|
|
4715
4802
|
else {
|
|
4716
4803
|
// If the slot content is standard type, the content is static, no additional
|
|
4717
4804
|
// processing needed on the vnode
|
|
4718
|
-
|
|
4805
|
+
ArrayPush$1.call(newChildren, vnode);
|
|
4719
4806
|
}
|
|
4720
4807
|
}
|
|
4721
|
-
|
|
4722
|
-
|
|
4808
|
+
}
|
|
4809
|
+
children = newChildren;
|
|
4723
4810
|
}
|
|
4724
4811
|
const vmBeingRendered = getVMBeingRendered();
|
|
4725
4812
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
@@ -6940,7 +7027,7 @@ var LWC = (function (exports) {
|
|
|
6940
7027
|
}
|
|
6941
7028
|
return ctor;
|
|
6942
7029
|
}
|
|
6943
|
-
/* version: 2.30.
|
|
7030
|
+
/* version: 2.30.3 */
|
|
6944
7031
|
|
|
6945
7032
|
/*
|
|
6946
7033
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7223,8 +7310,10 @@ var LWC = (function (exports) {
|
|
|
7223
7310
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
7224
7311
|
// This class should be created once per tag name.
|
|
7225
7312
|
const createUpgradableConstructor = (connectedCallback, disconnectedCallback) => {
|
|
7313
|
+
const hasConnectedCallback = !isUndefined$1(connectedCallback);
|
|
7314
|
+
const hasDisconnectedCallback = !isUndefined$1(disconnectedCallback);
|
|
7226
7315
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7227
|
-
|
|
7316
|
+
class UpgradableConstructor extends HTMLElement {
|
|
7228
7317
|
constructor(upgradeCallback) {
|
|
7229
7318
|
super();
|
|
7230
7319
|
// If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
|
|
@@ -7232,25 +7321,33 @@ var LWC = (function (exports) {
|
|
|
7232
7321
|
if (elementBeingUpgradedByLWC) {
|
|
7233
7322
|
upgradeCallback(this);
|
|
7234
7323
|
}
|
|
7235
|
-
else {
|
|
7236
|
-
//
|
|
7237
|
-
//
|
|
7324
|
+
else if (hasConnectedCallback || hasDisconnectedCallback) {
|
|
7325
|
+
// If this element has connected or disconnected callbacks, then we need to keep track of
|
|
7326
|
+
// instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
|
|
7327
|
+
// If the element has no connected or disconnected callbacks, then we don't need to track this.
|
|
7238
7328
|
elementsUpgradedOutsideLWC.add(this);
|
|
7239
7329
|
// TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
|
|
7240
7330
|
// Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
|
|
7241
7331
|
}
|
|
7242
7332
|
}
|
|
7243
|
-
|
|
7333
|
+
}
|
|
7334
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7335
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7336
|
+
if (hasConnectedCallback) {
|
|
7337
|
+
UpgradableConstructor.prototype.connectedCallback = function () {
|
|
7244
7338
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7245
7339
|
connectedCallback(this);
|
|
7246
7340
|
}
|
|
7247
|
-
}
|
|
7248
|
-
|
|
7341
|
+
};
|
|
7342
|
+
}
|
|
7343
|
+
if (hasDisconnectedCallback) {
|
|
7344
|
+
UpgradableConstructor.prototype.disconnectedCallback = function () {
|
|
7249
7345
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7250
7346
|
disconnectedCallback(this);
|
|
7251
7347
|
}
|
|
7252
|
-
}
|
|
7253
|
-
}
|
|
7348
|
+
};
|
|
7349
|
+
}
|
|
7350
|
+
return UpgradableConstructor;
|
|
7254
7351
|
};
|
|
7255
7352
|
const createCustomElementVanilla = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7256
7353
|
// use global custom elements registry
|
|
@@ -7303,16 +7400,22 @@ var LWC = (function (exports) {
|
|
|
7303
7400
|
const EMPTY_SET = new Set();
|
|
7304
7401
|
function createDefinitionRecord(constructor) {
|
|
7305
7402
|
var _a;
|
|
7306
|
-
const { connectedCallback, disconnectedCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7403
|
+
const { connectedCallback, disconnectedCallback, formAssociatedCallback, formDisabledCallback, formResetCallback, formStateRestoreCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7404
|
+
const formAssociated = Boolean(constructor.formAssociated);
|
|
7307
7405
|
const observedAttributes = new Set((_a = constructor.observedAttributes) !== null && _a !== void 0 ? _a : []);
|
|
7308
7406
|
return {
|
|
7309
7407
|
UserCtor: constructor,
|
|
7310
7408
|
PivotCtor: undefined,
|
|
7311
7409
|
connectedCallback,
|
|
7312
7410
|
disconnectedCallback,
|
|
7411
|
+
formAssociatedCallback,
|
|
7412
|
+
formDisabledCallback,
|
|
7413
|
+
formResetCallback,
|
|
7414
|
+
formStateRestoreCallback,
|
|
7313
7415
|
adoptedCallback,
|
|
7314
7416
|
attributeChangedCallback,
|
|
7315
7417
|
observedAttributes,
|
|
7418
|
+
formAssociated,
|
|
7316
7419
|
};
|
|
7317
7420
|
}
|
|
7318
7421
|
// Helper to create stand-in element for each tagName registered that delegates out to the registry for the given
|
|
@@ -7387,6 +7490,26 @@ var LWC = (function (exports) {
|
|
|
7387
7490
|
}
|
|
7388
7491
|
}
|
|
7389
7492
|
}
|
|
7493
|
+
formAssociatedCallback(form) {
|
|
7494
|
+
var _a;
|
|
7495
|
+
const definition = definitionForElement.get(this);
|
|
7496
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formAssociatedCallback) === null || _a === void 0 ? void 0 : _a.call(this, form);
|
|
7497
|
+
}
|
|
7498
|
+
formDisabledCallback(disabled) {
|
|
7499
|
+
var _a;
|
|
7500
|
+
const definition = definitionForElement.get(this);
|
|
7501
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formDisabledCallback) === null || _a === void 0 ? void 0 : _a.call(this, disabled);
|
|
7502
|
+
}
|
|
7503
|
+
formResetCallback() {
|
|
7504
|
+
var _a;
|
|
7505
|
+
const definition = definitionForElement.get(this);
|
|
7506
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formResetCallback) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
7507
|
+
}
|
|
7508
|
+
formStateRestoreCallback(state, mode) {
|
|
7509
|
+
var _a;
|
|
7510
|
+
const definition = definitionForElement.get(this);
|
|
7511
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formStateRestoreCallback) === null || _a === void 0 ? void 0 : _a.call(this, state, mode);
|
|
7512
|
+
}
|
|
7390
7513
|
adoptedCallback() {
|
|
7391
7514
|
var _a;
|
|
7392
7515
|
const definition = definitionForElement.get(this);
|
|
@@ -7405,6 +7528,8 @@ var LWC = (function (exports) {
|
|
|
7405
7528
|
}
|
|
7406
7529
|
}
|
|
7407
7530
|
PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
|
|
7531
|
+
// TODO [#3000]: support case where registeredDefinition is not form-associated, but later definition is.
|
|
7532
|
+
PivotCtor.formAssociated = registeredDefinition.formAssociated;
|
|
7408
7533
|
registeredPivotCtors.add(PivotCtor);
|
|
7409
7534
|
return PivotCtor;
|
|
7410
7535
|
}
|
|
@@ -7751,27 +7876,34 @@ var LWC = (function (exports) {
|
|
|
7751
7876
|
// Creates a constructor that is intended to be used as the UserConstructor in a scoped (pivots) registry.
|
|
7752
7877
|
// In this case, the upgradeCallback only needs to be defined once because we create these on-demand,
|
|
7753
7878
|
// multiple times per tag name.
|
|
7754
|
-
const createUserConstructor = (upgradeCallback, connectedCallback, disconnectedCallback
|
|
7879
|
+
const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7755
7880
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7756
|
-
|
|
7881
|
+
class UserConstructor extends HTMLElementToExtend {
|
|
7757
7882
|
constructor() {
|
|
7758
7883
|
super();
|
|
7759
7884
|
upgradeCallback(this);
|
|
7760
7885
|
}
|
|
7761
|
-
|
|
7886
|
+
}
|
|
7887
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7888
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7889
|
+
if (!isUndefined$1(connectedCallback)) {
|
|
7890
|
+
UserConstructor.prototype.connectedCallback = function () {
|
|
7762
7891
|
connectedCallback(this);
|
|
7763
|
-
}
|
|
7764
|
-
|
|
7892
|
+
};
|
|
7893
|
+
}
|
|
7894
|
+
if (!isUndefined$1(disconnectedCallback)) {
|
|
7895
|
+
UserConstructor.prototype.disconnectedCallback = function () {
|
|
7765
7896
|
disconnectedCallback(this);
|
|
7766
|
-
}
|
|
7767
|
-
}
|
|
7897
|
+
};
|
|
7898
|
+
}
|
|
7899
|
+
return UserConstructor;
|
|
7768
7900
|
};
|
|
7769
7901
|
function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
7770
7902
|
if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
|
|
7771
7903
|
// This error should be impossible to hit
|
|
7772
7904
|
throw new Error('The flag ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY must be set to true to use this feature');
|
|
7773
7905
|
}
|
|
7774
|
-
const UserConstructor = createUserConstructor(upgradeCallback, connectedCallback, disconnectedCallback
|
|
7906
|
+
const UserConstructor = createUserConstructor(CachedHTMLElement, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
7775
7907
|
const ScopedConstructor = createScopedConstructor(tagName, UserConstructor);
|
|
7776
7908
|
return new ScopedConstructor(UserConstructor);
|
|
7777
7909
|
}
|
|
@@ -7868,7 +8000,7 @@ var LWC = (function (exports) {
|
|
|
7868
8000
|
function isNull(obj) {
|
|
7869
8001
|
return obj === null;
|
|
7870
8002
|
}
|
|
7871
|
-
/** version: 2.30.
|
|
8003
|
+
/** version: 2.30.3 */
|
|
7872
8004
|
|
|
7873
8005
|
/*
|
|
7874
8006
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8347,16 +8479,16 @@ var LWC = (function (exports) {
|
|
|
8347
8479
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
8348
8480
|
}
|
|
8349
8481
|
};
|
|
8350
|
-
|
|
8351
|
-
|
|
8482
|
+
let connectedCallback;
|
|
8483
|
+
let disconnectedCallback;
|
|
8484
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8485
|
+
connectedCallback = elm => {
|
|
8352
8486
|
connectRootElement(elm);
|
|
8353
|
-
}
|
|
8354
|
-
|
|
8355
|
-
const disconnectedCallback = elm => {
|
|
8356
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8487
|
+
};
|
|
8488
|
+
disconnectedCallback = elm => {
|
|
8357
8489
|
disconnectRootElement(elm);
|
|
8358
|
-
}
|
|
8359
|
-
}
|
|
8490
|
+
};
|
|
8491
|
+
}
|
|
8360
8492
|
const element = createCustomElement(tagName, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
8361
8493
|
return element;
|
|
8362
8494
|
}
|
|
@@ -8429,7 +8561,7 @@ var LWC = (function (exports) {
|
|
|
8429
8561
|
});
|
|
8430
8562
|
freeze(LightningElement);
|
|
8431
8563
|
seal(LightningElement.prototype);
|
|
8432
|
-
/* version: 2.30.
|
|
8564
|
+
/* version: 2.30.3 */
|
|
8433
8565
|
|
|
8434
8566
|
exports.LightningElement = LightningElement;
|
|
8435
8567
|
exports.__unstable__ProfilerControl = profilerControl;
|