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.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +207 -75
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +207 -75
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +204 -72
  5. package/dist/engine-dom/iife/es5/engine-dom.js +254 -118
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +251 -115
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +207 -75
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +204 -72
  11. package/dist/engine-dom/umd/es5/engine-dom.js +254 -118
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +251 -115
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +128 -48
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +128 -48
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +7 -4
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +7 -4
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +7 -4
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +7 -4
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +7 -4
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +7 -4
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +7 -4
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +7 -4
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +7 -4
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -240,32 +240,57 @@
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
- * Map composed of properties to attributes not following the HTML property to attribute mapping
245
- * convention.
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 NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
248
- ['accessKey', 'accesskey'],
249
- ['readOnly', 'readonly'],
250
- ['tabIndex', 'tabindex'],
251
- ['bgColor', 'bgcolor'],
252
- ['colSpan', 'colspan'],
253
- ['rowSpan', 'rowspan'],
254
- ['contentEditable', 'contenteditable'],
255
- ['crossOrigin', 'crossorigin'],
256
- ['dateTime', 'datetime'],
257
- ['formAction', 'formaction'],
258
- ['isMap', 'ismap'],
259
- ['maxLength', 'maxlength'],
260
- ['minLength', 'minlength'],
261
- ['noValidate', 'novalidate'],
262
- ['useMap', 'usemap'],
263
- ['htmlFor', 'for'],
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,7 +319,24 @@
294
319
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
295
320
  return attributeName;
296
321
  }
297
- /** version: 2.30.1 */
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
+ }
339
+ /** version: 2.30.3 */
298
340
 
299
341
  /**
300
342
  * Copyright (C) 2018 salesforce.com, inc.
@@ -376,7 +418,7 @@
376
418
  patch$1(propName);
377
419
  }
378
420
  }
379
- /** version: 2.30.1 */
421
+ /** version: 2.30.3 */
380
422
 
381
423
  /**
382
424
  * Copyright (C) 2018 salesforce.com, inc.
@@ -2576,7 +2618,7 @@
2576
2618
  * SPDX-License-Identifier: MIT
2577
2619
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2578
2620
  */
2579
- const ColonCharCode = 58;
2621
+ const ColonCharCode$1 = 58;
2580
2622
  function patchAttributes(oldVnode, vnode, renderer) {
2581
2623
  const { attrs } = vnode.data;
2582
2624
  if (isUndefined$1(attrs)) {
@@ -2593,11 +2635,11 @@
2593
2635
  const old = oldAttrs[key];
2594
2636
  if (old !== cur) {
2595
2637
  unlockAttribute(elm, key);
2596
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
2638
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
2597
2639
  // Assume xml namespace
2598
2640
  setAttribute(elm, key, cur, XML_NAMESPACE);
2599
2641
  }
2600
- else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
2642
+ else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
2601
2643
  // Assume xlink namespace
2602
2644
  setAttribute(elm, key, cur, XLINK_NAMESPACE);
2603
2645
  }
@@ -2612,6 +2654,46 @@
2612
2654
  }
2613
2655
  }
2614
2656
 
2657
+ /*
2658
+ * Copyright (c) 2018, salesforce.com, inc.
2659
+ * All rights reserved.
2660
+ * SPDX-License-Identifier: MIT
2661
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2662
+ */
2663
+ const ColonCharCode = 58;
2664
+ function patchAttrUnlessProp(oldVnode, vnode, renderer) {
2665
+ const { data: { attrs }, elm, } = vnode;
2666
+ if (isUndefined$1(attrs)) {
2667
+ return;
2668
+ }
2669
+ const { removeAttribute, setAttribute, setProperty } = renderer;
2670
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
2671
+ for (const name in attrs) {
2672
+ const cur = attrs[name];
2673
+ const old = oldAttrs[name];
2674
+ if (old !== cur) {
2675
+ const propName = htmlAttributeToProperty(name);
2676
+ if (propName in elm) {
2677
+ setProperty(elm, name, cur);
2678
+ }
2679
+ else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
2680
+ // Assume xml namespace
2681
+ setAttribute(elm, name, cur, XML_NAMESPACE);
2682
+ }
2683
+ else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
2684
+ // Assume xlink namespace
2685
+ setAttribute(elm, name, cur, XLINK_NAMESPACE);
2686
+ }
2687
+ else if (isNull(cur) || isUndefined$1(cur)) {
2688
+ removeAttribute(elm, name);
2689
+ }
2690
+ else {
2691
+ setAttribute(elm, name, cur);
2692
+ }
2693
+ }
2694
+ }
2695
+ }
2696
+
2615
2697
  /*
2616
2698
  * Copyright (c) 2018, salesforce.com, inc.
2617
2699
  * All rights reserved.
@@ -2996,16 +3078,16 @@
2996
3078
  // the custom element from the registry is expecting an upgrade callback
2997
3079
  vm = createViewModelHook(elm, vnode, renderer);
2998
3080
  };
2999
- const connectedCallback = elm => {
3000
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3081
+ let connectedCallback;
3082
+ let disconnectedCallback;
3083
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3084
+ connectedCallback = elm => {
3001
3085
  connectRootElement(elm);
3002
- }
3003
- };
3004
- const disconnectedCallback = elm => {
3005
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3086
+ };
3087
+ disconnectedCallback = elm => {
3006
3088
  disconnectRootElement(elm);
3007
- }
3008
- };
3089
+ };
3090
+ }
3009
3091
  // Should never get a tag with upper case letter at this point; the compiler
3010
3092
  // should produce only tags with lowercase letters. However, the Java
3011
3093
  // compiler may generate tagnames with uppercase letters so - for backwards
@@ -3160,7 +3242,11 @@
3160
3242
  // value is set before type=radio.
3161
3243
  patchClassAttribute(oldVnode, vnode, renderer);
3162
3244
  patchStyleAttribute(oldVnode, vnode, renderer);
3163
- patchAttributes(oldVnode, vnode, renderer);
3245
+ if (vnode.data.external) {
3246
+ patchAttrUnlessProp(oldVnode, vnode, renderer);
3247
+ } else {
3248
+ patchAttributes(oldVnode, vnode, renderer);
3249
+ }
3164
3250
  patchProps(oldVnode, vnode, renderer);
3165
3251
  }
3166
3252
  function applyStyleScoping(elm, owner, renderer) {
@@ -3540,40 +3626,41 @@
3540
3626
  !isUndefined$1(slotset.slotAssignments) &&
3541
3627
  !isUndefined$1(slotset.slotAssignments[slotName]) &&
3542
3628
  slotset.slotAssignments[slotName].length !== 0) {
3543
- children = slotset.slotAssignments[slotName].reduce((accumulator, vnode) => {
3544
- if (vnode) {
3629
+ const newChildren = [];
3630
+ const slotAssignments = slotset.slotAssignments[slotName];
3631
+ for (let i = 0; i < slotAssignments.length; i++) {
3632
+ const vnode = slotAssignments[i];
3633
+ if (!isNull(vnode)) {
3545
3634
  const assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
3546
3635
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
3547
3636
  const isScopedSlotElement = !isUndefined$1(data.slotData);
3548
3637
  // Check if slot types of parent and child are matching
3549
3638
  if (assignedNodeIsScopedSlot !== isScopedSlotElement) {
3550
3639
  // Ignore slot content from parent
3551
- return accumulator;
3640
+ continue;
3552
3641
  }
3553
3642
  // If the passed slot content is factory, evaluate it and add the produced vnodes
3554
3643
  if (assignedNodeIsScopedSlot) {
3555
3644
  const vmBeingRenderedInception = getVMBeingRendered();
3556
- let scopedSlotChildren = [];
3557
3645
  // Evaluate in the scope of the slot content's owner
3558
3646
  // if a slotset is provided, there will always be an owner. The only case where owner is
3559
3647
  // undefined is for root components, but root components cannot accept slotted content
3560
3648
  setVMBeingRendered(slotset.owner);
3561
3649
  try {
3562
- scopedSlotChildren = vnode.factory(data.slotData);
3650
+ ArrayPush$1.apply(newChildren, vnode.factory(data.slotData));
3563
3651
  }
3564
3652
  finally {
3565
3653
  setVMBeingRendered(vmBeingRenderedInception);
3566
3654
  }
3567
- return ArrayConcat$1.call(accumulator, scopedSlotChildren);
3568
3655
  }
3569
3656
  else {
3570
3657
  // If the slot content is standard type, the content is static, no additional
3571
3658
  // processing needed on the vnode
3572
- return ArrayConcat$1.call(accumulator, vnode);
3659
+ ArrayPush$1.call(newChildren, vnode);
3573
3660
  }
3574
3661
  }
3575
- return accumulator;
3576
- }, []);
3662
+ }
3663
+ children = newChildren;
3577
3664
  }
3578
3665
  const vmBeingRendered = getVMBeingRendered();
3579
3666
  const { renderMode, shadowMode } = vmBeingRendered;
@@ -5531,8 +5618,10 @@
5531
5618
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
5532
5619
  // This class should be created once per tag name.
5533
5620
  const createUpgradableConstructor = (connectedCallback, disconnectedCallback) => {
5621
+ const hasConnectedCallback = !isUndefined$1(connectedCallback);
5622
+ const hasDisconnectedCallback = !isUndefined$1(disconnectedCallback);
5534
5623
  // TODO [#2972]: this class should expose observedAttributes as necessary
5535
- return class UpgradableConstructor extends HTMLElement {
5624
+ class UpgradableConstructor extends HTMLElement {
5536
5625
  constructor(upgradeCallback) {
5537
5626
  super();
5538
5627
  // If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
@@ -5540,25 +5629,33 @@
5540
5629
  if (elementBeingUpgradedByLWC) {
5541
5630
  upgradeCallback(this);
5542
5631
  }
5543
- else {
5544
- // keep track of elements that were not created by lwc.createElement,
5545
- // so we can ignore their lifecycle hooks
5632
+ else if (hasConnectedCallback || hasDisconnectedCallback) {
5633
+ // If this element has connected or disconnected callbacks, then we need to keep track of
5634
+ // instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
5635
+ // If the element has no connected or disconnected callbacks, then we don't need to track this.
5546
5636
  elementsUpgradedOutsideLWC.add(this);
5547
5637
  // TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
5548
5638
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
5549
5639
  }
5550
5640
  }
5551
- connectedCallback() {
5641
+ }
5642
+ // Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
5643
+ // See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
5644
+ if (hasConnectedCallback) {
5645
+ UpgradableConstructor.prototype.connectedCallback = function () {
5552
5646
  if (!elementsUpgradedOutsideLWC.has(this)) {
5553
5647
  connectedCallback(this);
5554
5648
  }
5555
- }
5556
- disconnectedCallback() {
5649
+ };
5650
+ }
5651
+ if (hasDisconnectedCallback) {
5652
+ UpgradableConstructor.prototype.disconnectedCallback = function () {
5557
5653
  if (!elementsUpgradedOutsideLWC.has(this)) {
5558
5654
  disconnectedCallback(this);
5559
5655
  }
5560
- }
5561
- };
5656
+ };
5657
+ }
5658
+ return UpgradableConstructor;
5562
5659
  };
5563
5660
  const createCustomElementVanilla = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
5564
5661
  // use global custom elements registry
@@ -5611,16 +5708,22 @@
5611
5708
  const EMPTY_SET = new Set();
5612
5709
  function createDefinitionRecord(constructor) {
5613
5710
  var _a;
5614
- const { connectedCallback, disconnectedCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
5711
+ const { connectedCallback, disconnectedCallback, formAssociatedCallback, formDisabledCallback, formResetCallback, formStateRestoreCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
5712
+ const formAssociated = Boolean(constructor.formAssociated);
5615
5713
  const observedAttributes = new Set((_a = constructor.observedAttributes) !== null && _a !== void 0 ? _a : []);
5616
5714
  return {
5617
5715
  UserCtor: constructor,
5618
5716
  PivotCtor: undefined,
5619
5717
  connectedCallback,
5620
5718
  disconnectedCallback,
5719
+ formAssociatedCallback,
5720
+ formDisabledCallback,
5721
+ formResetCallback,
5722
+ formStateRestoreCallback,
5621
5723
  adoptedCallback,
5622
5724
  attributeChangedCallback,
5623
5725
  observedAttributes,
5726
+ formAssociated,
5624
5727
  };
5625
5728
  }
5626
5729
  // Helper to create stand-in element for each tagName registered that delegates out to the registry for the given
@@ -5695,6 +5798,26 @@
5695
5798
  }
5696
5799
  }
5697
5800
  }
5801
+ formAssociatedCallback(form) {
5802
+ var _a;
5803
+ const definition = definitionForElement.get(this);
5804
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formAssociatedCallback) === null || _a === void 0 ? void 0 : _a.call(this, form);
5805
+ }
5806
+ formDisabledCallback(disabled) {
5807
+ var _a;
5808
+ const definition = definitionForElement.get(this);
5809
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formDisabledCallback) === null || _a === void 0 ? void 0 : _a.call(this, disabled);
5810
+ }
5811
+ formResetCallback() {
5812
+ var _a;
5813
+ const definition = definitionForElement.get(this);
5814
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formResetCallback) === null || _a === void 0 ? void 0 : _a.call(this);
5815
+ }
5816
+ formStateRestoreCallback(state, mode) {
5817
+ var _a;
5818
+ const definition = definitionForElement.get(this);
5819
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formStateRestoreCallback) === null || _a === void 0 ? void 0 : _a.call(this, state, mode);
5820
+ }
5698
5821
  adoptedCallback() {
5699
5822
  var _a;
5700
5823
  const definition = definitionForElement.get(this);
@@ -5713,6 +5836,8 @@
5713
5836
  }
5714
5837
  }
5715
5838
  PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
5839
+ // TODO [#3000]: support case where registeredDefinition is not form-associated, but later definition is.
5840
+ PivotCtor.formAssociated = registeredDefinition.formAssociated;
5716
5841
  registeredPivotCtors.add(PivotCtor);
5717
5842
  return PivotCtor;
5718
5843
  }
@@ -6059,27 +6184,34 @@
6059
6184
  // Creates a constructor that is intended to be used as the UserConstructor in a scoped (pivots) registry.
6060
6185
  // In this case, the upgradeCallback only needs to be defined once because we create these on-demand,
6061
6186
  // multiple times per tag name.
6062
- const createUserConstructor = (upgradeCallback, connectedCallback, disconnectedCallback, HTMLElementToExtend) => {
6187
+ const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
6063
6188
  // TODO [#2972]: this class should expose observedAttributes as necessary
6064
- return class UserConstructor extends HTMLElementToExtend {
6189
+ class UserConstructor extends HTMLElementToExtend {
6065
6190
  constructor() {
6066
6191
  super();
6067
6192
  upgradeCallback(this);
6068
6193
  }
6069
- connectedCallback() {
6194
+ }
6195
+ // Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
6196
+ // See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
6197
+ if (!isUndefined$1(connectedCallback)) {
6198
+ UserConstructor.prototype.connectedCallback = function () {
6070
6199
  connectedCallback(this);
6071
- }
6072
- disconnectedCallback() {
6200
+ };
6201
+ }
6202
+ if (!isUndefined$1(disconnectedCallback)) {
6203
+ UserConstructor.prototype.disconnectedCallback = function () {
6073
6204
  disconnectedCallback(this);
6074
- }
6075
- };
6205
+ };
6206
+ }
6207
+ return UserConstructor;
6076
6208
  };
6077
6209
  function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
6078
6210
  if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
6079
6211
  // This error should be impossible to hit
6080
6212
  throw new Error('The flag ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY must be set to true to use this feature');
6081
6213
  }
6082
- const UserConstructor = createUserConstructor(upgradeCallback, connectedCallback, disconnectedCallback, CachedHTMLElement);
6214
+ const UserConstructor = createUserConstructor(CachedHTMLElement, upgradeCallback, connectedCallback, disconnectedCallback);
6083
6215
  const ScopedConstructor = createScopedConstructor(tagName, UserConstructor);
6084
6216
  return new ScopedConstructor(UserConstructor);
6085
6217
  }
@@ -6176,7 +6308,7 @@
6176
6308
  function isNull(obj) {
6177
6309
  return obj === null;
6178
6310
  }
6179
- /** version: 2.30.1 */
6311
+ /** version: 2.30.3 */
6180
6312
 
6181
6313
  /*
6182
6314
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6647,16 +6779,16 @@
6647
6779
  DisconnectingSlot.set(elm, disconnectRootElement);
6648
6780
  }
6649
6781
  };
6650
- const connectedCallback = elm => {
6651
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
6782
+ let connectedCallback;
6783
+ let disconnectedCallback;
6784
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
6785
+ connectedCallback = elm => {
6652
6786
  connectRootElement(elm);
6653
- }
6654
- };
6655
- const disconnectedCallback = elm => {
6656
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
6787
+ };
6788
+ disconnectedCallback = elm => {
6657
6789
  disconnectRootElement(elm);
6658
- }
6659
- };
6790
+ };
6791
+ }
6660
6792
  const element = createCustomElement(tagName, upgradeCallback, connectedCallback, disconnectedCallback);
6661
6793
  return element;
6662
6794
  }
@@ -6729,7 +6861,7 @@
6729
6861
  });
6730
6862
  freeze(LightningElement);
6731
6863
  seal(LightningElement.prototype);
6732
- /* version: 2.30.1 */
6864
+ /* version: 2.30.3 */
6733
6865
 
6734
6866
  exports.LightningElement = LightningElement;
6735
6867
  exports.__unstable__ProfilerControl = profilerControl;