lwc 2.30.1 → 2.30.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 +86 -41
- package/dist/engine-dom/iife/es2017/engine-dom.js +86 -41
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +83 -38
- package/dist/engine-dom/iife/es5/engine-dom.js +105 -60
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +102 -57
- package/dist/engine-dom/umd/es2017/engine-dom.js +86 -41
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +83 -38
- package/dist/engine-dom/umd/es5/engine-dom.js +105 -60
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +102 -57
- package/dist/engine-server/commonjs/es2017/engine-server.js +13 -13
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +13 -13
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- 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
|
@@ -299,9 +299,9 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
300
300
|
*/
|
|
301
301
|
// Increment whenever the LWC template compiler changes
|
|
302
|
-
const LWC_VERSION = "2.30.
|
|
302
|
+
const LWC_VERSION = "2.30.2";
|
|
303
303
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
304
|
-
/** version: 2.30.
|
|
304
|
+
/** version: 2.30.2 */
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -383,7 +383,7 @@ for (let i = 0, len = ElementPrototypeAriaPropertyNames.length; i < len; i += 1)
|
|
|
383
383
|
patch$1(propName);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
/** version: 2.30.
|
|
386
|
+
/** version: 2.30.2 */
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -463,7 +463,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
463
463
|
setFeatureFlag(name, value);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
/** version: 2.30.
|
|
466
|
+
/** version: 2.30.2 */
|
|
467
467
|
|
|
468
468
|
/*
|
|
469
469
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4060,16 +4060,16 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4060
4060
|
// the custom element from the registry is expecting an upgrade callback
|
|
4061
4061
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
4062
4062
|
};
|
|
4063
|
-
|
|
4064
|
-
|
|
4063
|
+
let connectedCallback;
|
|
4064
|
+
let disconnectedCallback;
|
|
4065
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4066
|
+
connectedCallback = elm => {
|
|
4065
4067
|
connectRootElement(elm);
|
|
4066
|
-
}
|
|
4067
|
-
|
|
4068
|
-
const disconnectedCallback = elm => {
|
|
4069
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4068
|
+
};
|
|
4069
|
+
disconnectedCallback = elm => {
|
|
4070
4070
|
disconnectRootElement(elm);
|
|
4071
|
-
}
|
|
4072
|
-
}
|
|
4071
|
+
};
|
|
4072
|
+
}
|
|
4073
4073
|
// Should never get a tag with upper case letter at this point; the compiler
|
|
4074
4074
|
// should produce only tags with lowercase letters. However, the Java
|
|
4075
4075
|
// compiler may generate tagnames with uppercase letters so - for backwards
|
|
@@ -6937,7 +6937,7 @@ function getComponentConstructor(elm) {
|
|
|
6937
6937
|
}
|
|
6938
6938
|
return ctor;
|
|
6939
6939
|
}
|
|
6940
|
-
/* version: 2.30.
|
|
6940
|
+
/* version: 2.30.2 */
|
|
6941
6941
|
|
|
6942
6942
|
/*
|
|
6943
6943
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7220,8 +7220,10 @@ let elementBeingUpgradedByLWC = false;
|
|
|
7220
7220
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
7221
7221
|
// This class should be created once per tag name.
|
|
7222
7222
|
const createUpgradableConstructor = (connectedCallback, disconnectedCallback) => {
|
|
7223
|
+
const hasConnectedCallback = !isUndefined$1(connectedCallback);
|
|
7224
|
+
const hasDisconnectedCallback = !isUndefined$1(disconnectedCallback);
|
|
7223
7225
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7224
|
-
|
|
7226
|
+
class UpgradableConstructor extends HTMLElement {
|
|
7225
7227
|
constructor(upgradeCallback) {
|
|
7226
7228
|
super();
|
|
7227
7229
|
// If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
|
|
@@ -7229,25 +7231,33 @@ const createUpgradableConstructor = (connectedCallback, disconnectedCallback) =>
|
|
|
7229
7231
|
if (elementBeingUpgradedByLWC) {
|
|
7230
7232
|
upgradeCallback(this);
|
|
7231
7233
|
}
|
|
7232
|
-
else {
|
|
7233
|
-
//
|
|
7234
|
-
//
|
|
7234
|
+
else if (hasConnectedCallback || hasDisconnectedCallback) {
|
|
7235
|
+
// If this element has connected or disconnected callbacks, then we need to keep track of
|
|
7236
|
+
// instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
|
|
7237
|
+
// If the element has no connected or disconnected callbacks, then we don't need to track this.
|
|
7235
7238
|
elementsUpgradedOutsideLWC.add(this);
|
|
7236
7239
|
// TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
|
|
7237
7240
|
// Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
|
|
7238
7241
|
}
|
|
7239
7242
|
}
|
|
7240
|
-
|
|
7243
|
+
}
|
|
7244
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7245
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7246
|
+
if (hasConnectedCallback) {
|
|
7247
|
+
UpgradableConstructor.prototype.connectedCallback = function () {
|
|
7241
7248
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7242
7249
|
connectedCallback(this);
|
|
7243
7250
|
}
|
|
7244
|
-
}
|
|
7245
|
-
|
|
7251
|
+
};
|
|
7252
|
+
}
|
|
7253
|
+
if (hasDisconnectedCallback) {
|
|
7254
|
+
UpgradableConstructor.prototype.disconnectedCallback = function () {
|
|
7246
7255
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7247
7256
|
disconnectedCallback(this);
|
|
7248
7257
|
}
|
|
7249
|
-
}
|
|
7250
|
-
}
|
|
7258
|
+
};
|
|
7259
|
+
}
|
|
7260
|
+
return UpgradableConstructor;
|
|
7251
7261
|
};
|
|
7252
7262
|
const createCustomElementVanilla = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7253
7263
|
// use global custom elements registry
|
|
@@ -7300,16 +7310,22 @@ function createScopedRegistry() {
|
|
|
7300
7310
|
const EMPTY_SET = new Set();
|
|
7301
7311
|
function createDefinitionRecord(constructor) {
|
|
7302
7312
|
var _a;
|
|
7303
|
-
const { connectedCallback, disconnectedCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7313
|
+
const { connectedCallback, disconnectedCallback, formAssociatedCallback, formDisabledCallback, formResetCallback, formStateRestoreCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7314
|
+
const formAssociated = Boolean(constructor.formAssociated);
|
|
7304
7315
|
const observedAttributes = new Set((_a = constructor.observedAttributes) !== null && _a !== void 0 ? _a : []);
|
|
7305
7316
|
return {
|
|
7306
7317
|
UserCtor: constructor,
|
|
7307
7318
|
PivotCtor: undefined,
|
|
7308
7319
|
connectedCallback,
|
|
7309
7320
|
disconnectedCallback,
|
|
7321
|
+
formAssociatedCallback,
|
|
7322
|
+
formDisabledCallback,
|
|
7323
|
+
formResetCallback,
|
|
7324
|
+
formStateRestoreCallback,
|
|
7310
7325
|
adoptedCallback,
|
|
7311
7326
|
attributeChangedCallback,
|
|
7312
7327
|
observedAttributes,
|
|
7328
|
+
formAssociated,
|
|
7313
7329
|
};
|
|
7314
7330
|
}
|
|
7315
7331
|
// Helper to create stand-in element for each tagName registered that delegates out to the registry for the given
|
|
@@ -7384,6 +7400,26 @@ function createScopedRegistry() {
|
|
|
7384
7400
|
}
|
|
7385
7401
|
}
|
|
7386
7402
|
}
|
|
7403
|
+
formAssociatedCallback(form) {
|
|
7404
|
+
var _a;
|
|
7405
|
+
const definition = definitionForElement.get(this);
|
|
7406
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formAssociatedCallback) === null || _a === void 0 ? void 0 : _a.call(this, form);
|
|
7407
|
+
}
|
|
7408
|
+
formDisabledCallback(disabled) {
|
|
7409
|
+
var _a;
|
|
7410
|
+
const definition = definitionForElement.get(this);
|
|
7411
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formDisabledCallback) === null || _a === void 0 ? void 0 : _a.call(this, disabled);
|
|
7412
|
+
}
|
|
7413
|
+
formResetCallback() {
|
|
7414
|
+
var _a;
|
|
7415
|
+
const definition = definitionForElement.get(this);
|
|
7416
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formResetCallback) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
7417
|
+
}
|
|
7418
|
+
formStateRestoreCallback(state, mode) {
|
|
7419
|
+
var _a;
|
|
7420
|
+
const definition = definitionForElement.get(this);
|
|
7421
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formStateRestoreCallback) === null || _a === void 0 ? void 0 : _a.call(this, state, mode);
|
|
7422
|
+
}
|
|
7387
7423
|
adoptedCallback() {
|
|
7388
7424
|
var _a;
|
|
7389
7425
|
const definition = definitionForElement.get(this);
|
|
@@ -7402,6 +7438,8 @@ function createScopedRegistry() {
|
|
|
7402
7438
|
}
|
|
7403
7439
|
}
|
|
7404
7440
|
PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
|
|
7441
|
+
// TODO [#3000]: support case where registeredDefinition is not form-associated, but later definition is.
|
|
7442
|
+
PivotCtor.formAssociated = registeredDefinition.formAssociated;
|
|
7405
7443
|
registeredPivotCtors.add(PivotCtor);
|
|
7406
7444
|
return PivotCtor;
|
|
7407
7445
|
}
|
|
@@ -7748,27 +7786,34 @@ if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
|
|
|
7748
7786
|
// Creates a constructor that is intended to be used as the UserConstructor in a scoped (pivots) registry.
|
|
7749
7787
|
// In this case, the upgradeCallback only needs to be defined once because we create these on-demand,
|
|
7750
7788
|
// multiple times per tag name.
|
|
7751
|
-
const createUserConstructor = (upgradeCallback, connectedCallback, disconnectedCallback
|
|
7789
|
+
const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7752
7790
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7753
|
-
|
|
7791
|
+
class UserConstructor extends HTMLElementToExtend {
|
|
7754
7792
|
constructor() {
|
|
7755
7793
|
super();
|
|
7756
7794
|
upgradeCallback(this);
|
|
7757
7795
|
}
|
|
7758
|
-
|
|
7796
|
+
}
|
|
7797
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7798
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7799
|
+
if (!isUndefined$1(connectedCallback)) {
|
|
7800
|
+
UserConstructor.prototype.connectedCallback = function () {
|
|
7759
7801
|
connectedCallback(this);
|
|
7760
|
-
}
|
|
7761
|
-
|
|
7802
|
+
};
|
|
7803
|
+
}
|
|
7804
|
+
if (!isUndefined$1(disconnectedCallback)) {
|
|
7805
|
+
UserConstructor.prototype.disconnectedCallback = function () {
|
|
7762
7806
|
disconnectedCallback(this);
|
|
7763
|
-
}
|
|
7764
|
-
}
|
|
7807
|
+
};
|
|
7808
|
+
}
|
|
7809
|
+
return UserConstructor;
|
|
7765
7810
|
};
|
|
7766
7811
|
function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
7767
7812
|
if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
|
|
7768
7813
|
// This error should be impossible to hit
|
|
7769
7814
|
throw new Error('The flag ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY must be set to true to use this feature');
|
|
7770
7815
|
}
|
|
7771
|
-
const UserConstructor = createUserConstructor(upgradeCallback, connectedCallback, disconnectedCallback
|
|
7816
|
+
const UserConstructor = createUserConstructor(CachedHTMLElement, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
7772
7817
|
const ScopedConstructor = createScopedConstructor(tagName, UserConstructor);
|
|
7773
7818
|
return new ScopedConstructor(UserConstructor);
|
|
7774
7819
|
}
|
|
@@ -7865,7 +7910,7 @@ function rendererFactory(baseRenderer) {
|
|
|
7865
7910
|
function isNull(obj) {
|
|
7866
7911
|
return obj === null;
|
|
7867
7912
|
}
|
|
7868
|
-
/** version: 2.30.
|
|
7913
|
+
/** version: 2.30.2 */
|
|
7869
7914
|
|
|
7870
7915
|
/*
|
|
7871
7916
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8344,16 +8389,16 @@ function createElement(sel, options) {
|
|
|
8344
8389
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
8345
8390
|
}
|
|
8346
8391
|
};
|
|
8347
|
-
|
|
8348
|
-
|
|
8392
|
+
let connectedCallback;
|
|
8393
|
+
let disconnectedCallback;
|
|
8394
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8395
|
+
connectedCallback = elm => {
|
|
8349
8396
|
connectRootElement(elm);
|
|
8350
|
-
}
|
|
8351
|
-
|
|
8352
|
-
const disconnectedCallback = elm => {
|
|
8353
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8397
|
+
};
|
|
8398
|
+
disconnectedCallback = elm => {
|
|
8354
8399
|
disconnectRootElement(elm);
|
|
8355
|
-
}
|
|
8356
|
-
}
|
|
8400
|
+
};
|
|
8401
|
+
}
|
|
8357
8402
|
const element = createCustomElement(tagName, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
8358
8403
|
return element;
|
|
8359
8404
|
}
|
|
@@ -8426,6 +8471,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8426
8471
|
});
|
|
8427
8472
|
freeze(LightningElement);
|
|
8428
8473
|
seal(LightningElement.prototype);
|
|
8429
|
-
/* version: 2.30.
|
|
8474
|
+
/* version: 2.30.2 */
|
|
8430
8475
|
|
|
8431
8476
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
@@ -302,9 +302,9 @@ var LWC = (function (exports) {
|
|
|
302
302
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
303
303
|
*/
|
|
304
304
|
// Increment whenever the LWC template compiler changes
|
|
305
|
-
const LWC_VERSION = "2.30.
|
|
305
|
+
const LWC_VERSION = "2.30.2";
|
|
306
306
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
307
|
-
/** version: 2.30.
|
|
307
|
+
/** version: 2.30.2 */
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
310
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -386,7 +386,7 @@ var LWC = (function (exports) {
|
|
|
386
386
|
patch$1(propName);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
/** version: 2.30.
|
|
389
|
+
/** version: 2.30.2 */
|
|
390
390
|
|
|
391
391
|
/**
|
|
392
392
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -466,7 +466,7 @@ var LWC = (function (exports) {
|
|
|
466
466
|
setFeatureFlag(name, value);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
/** version: 2.30.
|
|
469
|
+
/** version: 2.30.2 */
|
|
470
470
|
|
|
471
471
|
/*
|
|
472
472
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4063,16 +4063,16 @@ var LWC = (function (exports) {
|
|
|
4063
4063
|
// the custom element from the registry is expecting an upgrade callback
|
|
4064
4064
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
4065
4065
|
};
|
|
4066
|
-
|
|
4067
|
-
|
|
4066
|
+
let connectedCallback;
|
|
4067
|
+
let disconnectedCallback;
|
|
4068
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4069
|
+
connectedCallback = elm => {
|
|
4068
4070
|
connectRootElement(elm);
|
|
4069
|
-
}
|
|
4070
|
-
|
|
4071
|
-
const disconnectedCallback = elm => {
|
|
4072
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4071
|
+
};
|
|
4072
|
+
disconnectedCallback = elm => {
|
|
4073
4073
|
disconnectRootElement(elm);
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4074
|
+
};
|
|
4075
|
+
}
|
|
4076
4076
|
// Should never get a tag with upper case letter at this point; the compiler
|
|
4077
4077
|
// should produce only tags with lowercase letters. However, the Java
|
|
4078
4078
|
// compiler may generate tagnames with uppercase letters so - for backwards
|
|
@@ -6940,7 +6940,7 @@ var LWC = (function (exports) {
|
|
|
6940
6940
|
}
|
|
6941
6941
|
return ctor;
|
|
6942
6942
|
}
|
|
6943
|
-
/* version: 2.30.
|
|
6943
|
+
/* version: 2.30.2 */
|
|
6944
6944
|
|
|
6945
6945
|
/*
|
|
6946
6946
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7223,8 +7223,10 @@ var LWC = (function (exports) {
|
|
|
7223
7223
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
7224
7224
|
// This class should be created once per tag name.
|
|
7225
7225
|
const createUpgradableConstructor = (connectedCallback, disconnectedCallback) => {
|
|
7226
|
+
const hasConnectedCallback = !isUndefined$1(connectedCallback);
|
|
7227
|
+
const hasDisconnectedCallback = !isUndefined$1(disconnectedCallback);
|
|
7226
7228
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7227
|
-
|
|
7229
|
+
class UpgradableConstructor extends HTMLElement {
|
|
7228
7230
|
constructor(upgradeCallback) {
|
|
7229
7231
|
super();
|
|
7230
7232
|
// If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
|
|
@@ -7232,25 +7234,33 @@ var LWC = (function (exports) {
|
|
|
7232
7234
|
if (elementBeingUpgradedByLWC) {
|
|
7233
7235
|
upgradeCallback(this);
|
|
7234
7236
|
}
|
|
7235
|
-
else {
|
|
7236
|
-
//
|
|
7237
|
-
//
|
|
7237
|
+
else if (hasConnectedCallback || hasDisconnectedCallback) {
|
|
7238
|
+
// If this element has connected or disconnected callbacks, then we need to keep track of
|
|
7239
|
+
// instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
|
|
7240
|
+
// If the element has no connected or disconnected callbacks, then we don't need to track this.
|
|
7238
7241
|
elementsUpgradedOutsideLWC.add(this);
|
|
7239
7242
|
// TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
|
|
7240
7243
|
// Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
|
|
7241
7244
|
}
|
|
7242
7245
|
}
|
|
7243
|
-
|
|
7246
|
+
}
|
|
7247
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7248
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7249
|
+
if (hasConnectedCallback) {
|
|
7250
|
+
UpgradableConstructor.prototype.connectedCallback = function () {
|
|
7244
7251
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7245
7252
|
connectedCallback(this);
|
|
7246
7253
|
}
|
|
7247
|
-
}
|
|
7248
|
-
|
|
7254
|
+
};
|
|
7255
|
+
}
|
|
7256
|
+
if (hasDisconnectedCallback) {
|
|
7257
|
+
UpgradableConstructor.prototype.disconnectedCallback = function () {
|
|
7249
7258
|
if (!elementsUpgradedOutsideLWC.has(this)) {
|
|
7250
7259
|
disconnectedCallback(this);
|
|
7251
7260
|
}
|
|
7252
|
-
}
|
|
7253
|
-
}
|
|
7261
|
+
};
|
|
7262
|
+
}
|
|
7263
|
+
return UpgradableConstructor;
|
|
7254
7264
|
};
|
|
7255
7265
|
const createCustomElementVanilla = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7256
7266
|
// use global custom elements registry
|
|
@@ -7303,16 +7313,22 @@ var LWC = (function (exports) {
|
|
|
7303
7313
|
const EMPTY_SET = new Set();
|
|
7304
7314
|
function createDefinitionRecord(constructor) {
|
|
7305
7315
|
var _a;
|
|
7306
|
-
const { connectedCallback, disconnectedCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7316
|
+
const { connectedCallback, disconnectedCallback, formAssociatedCallback, formDisabledCallback, formResetCallback, formStateRestoreCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
|
|
7317
|
+
const formAssociated = Boolean(constructor.formAssociated);
|
|
7307
7318
|
const observedAttributes = new Set((_a = constructor.observedAttributes) !== null && _a !== void 0 ? _a : []);
|
|
7308
7319
|
return {
|
|
7309
7320
|
UserCtor: constructor,
|
|
7310
7321
|
PivotCtor: undefined,
|
|
7311
7322
|
connectedCallback,
|
|
7312
7323
|
disconnectedCallback,
|
|
7324
|
+
formAssociatedCallback,
|
|
7325
|
+
formDisabledCallback,
|
|
7326
|
+
formResetCallback,
|
|
7327
|
+
formStateRestoreCallback,
|
|
7313
7328
|
adoptedCallback,
|
|
7314
7329
|
attributeChangedCallback,
|
|
7315
7330
|
observedAttributes,
|
|
7331
|
+
formAssociated,
|
|
7316
7332
|
};
|
|
7317
7333
|
}
|
|
7318
7334
|
// Helper to create stand-in element for each tagName registered that delegates out to the registry for the given
|
|
@@ -7387,6 +7403,26 @@ var LWC = (function (exports) {
|
|
|
7387
7403
|
}
|
|
7388
7404
|
}
|
|
7389
7405
|
}
|
|
7406
|
+
formAssociatedCallback(form) {
|
|
7407
|
+
var _a;
|
|
7408
|
+
const definition = definitionForElement.get(this);
|
|
7409
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formAssociatedCallback) === null || _a === void 0 ? void 0 : _a.call(this, form);
|
|
7410
|
+
}
|
|
7411
|
+
formDisabledCallback(disabled) {
|
|
7412
|
+
var _a;
|
|
7413
|
+
const definition = definitionForElement.get(this);
|
|
7414
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formDisabledCallback) === null || _a === void 0 ? void 0 : _a.call(this, disabled);
|
|
7415
|
+
}
|
|
7416
|
+
formResetCallback() {
|
|
7417
|
+
var _a;
|
|
7418
|
+
const definition = definitionForElement.get(this);
|
|
7419
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formResetCallback) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
7420
|
+
}
|
|
7421
|
+
formStateRestoreCallback(state, mode) {
|
|
7422
|
+
var _a;
|
|
7423
|
+
const definition = definitionForElement.get(this);
|
|
7424
|
+
(_a = definition === null || definition === void 0 ? void 0 : definition.formStateRestoreCallback) === null || _a === void 0 ? void 0 : _a.call(this, state, mode);
|
|
7425
|
+
}
|
|
7390
7426
|
adoptedCallback() {
|
|
7391
7427
|
var _a;
|
|
7392
7428
|
const definition = definitionForElement.get(this);
|
|
@@ -7405,6 +7441,8 @@ var LWC = (function (exports) {
|
|
|
7405
7441
|
}
|
|
7406
7442
|
}
|
|
7407
7443
|
PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
|
|
7444
|
+
// TODO [#3000]: support case where registeredDefinition is not form-associated, but later definition is.
|
|
7445
|
+
PivotCtor.formAssociated = registeredDefinition.formAssociated;
|
|
7408
7446
|
registeredPivotCtors.add(PivotCtor);
|
|
7409
7447
|
return PivotCtor;
|
|
7410
7448
|
}
|
|
@@ -7751,27 +7789,34 @@ var LWC = (function (exports) {
|
|
|
7751
7789
|
// Creates a constructor that is intended to be used as the UserConstructor in a scoped (pivots) registry.
|
|
7752
7790
|
// In this case, the upgradeCallback only needs to be defined once because we create these on-demand,
|
|
7753
7791
|
// multiple times per tag name.
|
|
7754
|
-
const createUserConstructor = (upgradeCallback, connectedCallback, disconnectedCallback
|
|
7792
|
+
const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
7755
7793
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
7756
|
-
|
|
7794
|
+
class UserConstructor extends HTMLElementToExtend {
|
|
7757
7795
|
constructor() {
|
|
7758
7796
|
super();
|
|
7759
7797
|
upgradeCallback(this);
|
|
7760
7798
|
}
|
|
7761
|
-
|
|
7799
|
+
}
|
|
7800
|
+
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
7801
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
7802
|
+
if (!isUndefined$1(connectedCallback)) {
|
|
7803
|
+
UserConstructor.prototype.connectedCallback = function () {
|
|
7762
7804
|
connectedCallback(this);
|
|
7763
|
-
}
|
|
7764
|
-
|
|
7805
|
+
};
|
|
7806
|
+
}
|
|
7807
|
+
if (!isUndefined$1(disconnectedCallback)) {
|
|
7808
|
+
UserConstructor.prototype.disconnectedCallback = function () {
|
|
7765
7809
|
disconnectedCallback(this);
|
|
7766
|
-
}
|
|
7767
|
-
}
|
|
7810
|
+
};
|
|
7811
|
+
}
|
|
7812
|
+
return UserConstructor;
|
|
7768
7813
|
};
|
|
7769
7814
|
function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
7770
7815
|
if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
|
|
7771
7816
|
// This error should be impossible to hit
|
|
7772
7817
|
throw new Error('The flag ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY must be set to true to use this feature');
|
|
7773
7818
|
}
|
|
7774
|
-
const UserConstructor = createUserConstructor(upgradeCallback, connectedCallback, disconnectedCallback
|
|
7819
|
+
const UserConstructor = createUserConstructor(CachedHTMLElement, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
7775
7820
|
const ScopedConstructor = createScopedConstructor(tagName, UserConstructor);
|
|
7776
7821
|
return new ScopedConstructor(UserConstructor);
|
|
7777
7822
|
}
|
|
@@ -7868,7 +7913,7 @@ var LWC = (function (exports) {
|
|
|
7868
7913
|
function isNull(obj) {
|
|
7869
7914
|
return obj === null;
|
|
7870
7915
|
}
|
|
7871
|
-
/** version: 2.30.
|
|
7916
|
+
/** version: 2.30.2 */
|
|
7872
7917
|
|
|
7873
7918
|
/*
|
|
7874
7919
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8347,16 +8392,16 @@ var LWC = (function (exports) {
|
|
|
8347
8392
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
8348
8393
|
}
|
|
8349
8394
|
};
|
|
8350
|
-
|
|
8351
|
-
|
|
8395
|
+
let connectedCallback;
|
|
8396
|
+
let disconnectedCallback;
|
|
8397
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8398
|
+
connectedCallback = elm => {
|
|
8352
8399
|
connectRootElement(elm);
|
|
8353
|
-
}
|
|
8354
|
-
|
|
8355
|
-
const disconnectedCallback = elm => {
|
|
8356
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
8400
|
+
};
|
|
8401
|
+
disconnectedCallback = elm => {
|
|
8357
8402
|
disconnectRootElement(elm);
|
|
8358
|
-
}
|
|
8359
|
-
}
|
|
8403
|
+
};
|
|
8404
|
+
}
|
|
8360
8405
|
const element = createCustomElement(tagName, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
8361
8406
|
return element;
|
|
8362
8407
|
}
|
|
@@ -8429,7 +8474,7 @@ var LWC = (function (exports) {
|
|
|
8429
8474
|
});
|
|
8430
8475
|
freeze(LightningElement);
|
|
8431
8476
|
seal(LightningElement.prototype);
|
|
8432
|
-
/* version: 2.30.
|
|
8477
|
+
/* version: 2.30.2 */
|
|
8433
8478
|
|
|
8434
8479
|
exports.LightningElement = LightningElement;
|
|
8435
8480
|
exports.__unstable__ProfilerControl = profilerControl;
|