lwc 2.23.5 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +216 -69
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +216 -69
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +194 -67
  5. package/dist/engine-dom/iife/es5/engine-dom.js +494 -313
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +463 -299
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +216 -69
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +194 -67
  11. package/dist/engine-dom/umd/es5/engine-dom.js +494 -313
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +463 -299
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +124 -16
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +124 -16
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +205 -168
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +205 -168
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +195 -158
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +25 -11
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +25 -11
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +205 -168
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +195 -158
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +25 -11
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +25 -11
  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
@@ -349,7 +349,7 @@
349
349
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
350
350
  return attributeName;
351
351
  }
352
- /** version: 2.23.5 */
352
+ /** version: 2.24.0 */
353
353
 
354
354
  /**
355
355
  * Copyright (C) 2018 salesforce.com, inc.
@@ -443,7 +443,7 @@
443
443
  patch$1(propName);
444
444
  }
445
445
  }
446
- /** version: 2.23.5 */
446
+ /** version: 2.24.0 */
447
447
 
448
448
  /**
449
449
  * Copyright (C) 2018 salesforce.com, inc.
@@ -618,6 +618,19 @@
618
618
 
619
619
  return result;
620
620
  }
621
+
622
+
623
+ function setRefVNode(vm, ref, vnode) {
624
+ // If not, then something went wrong and we threw an error above.
625
+
626
+
627
+ var refVNodes = vm.refVNodes; // In cases of conflict (two elements with the same ref), prefer, the last one,
628
+ // in depth-first traversal order.
629
+
630
+ if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
631
+ refVNodes[ref] = vnode;
632
+ }
633
+ }
621
634
  /*
622
635
  * Copyright (c) 2019, salesforce.com, inc.
623
636
  * All rights reserved.
@@ -1771,13 +1784,15 @@
1771
1784
  }
1772
1785
  };
1773
1786
  }
1787
+
1788
+ var EMPTY_REFS = freeze(create(null));
1789
+ var refsCache = new WeakMap();
1774
1790
  /**
1775
1791
  * This class is the base class for any LWC element.
1776
1792
  * Some elements directly extends this class, others implement it via inheritance.
1777
1793
  **/
1778
1794
  // @ts-ignore
1779
1795
 
1780
-
1781
1796
  var LightningElement = function LightningElement() {
1782
1797
  // This should be as performant as possible, while any initialization should be done lazily
1783
1798
  if (isNull(vmBeingConstructed)) {
@@ -1949,6 +1964,77 @@
1949
1964
  return vm.shadowRoot;
1950
1965
  },
1951
1966
 
1967
+ get refs() {
1968
+ var vm = getAssociatedVM(this);
1969
+
1970
+ if (isUpdatingTemplate) {
1971
+ // process of returning the refs and caching them, because the state of the refs is unstable.
1972
+ // This can happen if e.g. a template contains `<div class={foo}></div>` and `foo` is computed
1973
+ // based on `this.refs.bar`.
1974
+
1975
+
1976
+ return;
1977
+ }
1978
+
1979
+ var refVNodes = vm.refVNodes,
1980
+ hasRefVNodes = vm.hasRefVNodes;
1981
+ vm.cmpTemplate; // If the `cmpTemplate` is null, that means that the template has not been rendered yet. Most likely this occurs
1982
+ // were introduced, we return undefined if the template has no refs defined
1983
+ // anywhere. This fixes components that may want to add an expando called `refs`
1984
+ // and are checking if it exists with `if (this.refs)` before adding it.
1985
+ // Note it is not sufficient to just check if `refVNodes` is null or empty,
1986
+ // because a template may have `lwc:ref` defined within a falsy `if:true` block.
1987
+
1988
+
1989
+ if (!hasRefVNodes) {
1990
+ return;
1991
+ } // For templates that are using `lwc:ref`, if there are no refs currently available
1992
+ // (e.g. refs inside of a falsy `if:true` block), we return an empty object.
1993
+
1994
+
1995
+ if (isNull(refVNodes)) {
1996
+ return EMPTY_REFS;
1997
+ } // The refNodes can be cached based on the refVNodes, since the refVNodes
1998
+ // are recreated from scratch every time the template is rendered.
1999
+ // This happens with `vm.refVNodes = null` in `template.ts` in `@lwc/engine-core`.
2000
+
2001
+
2002
+ var refs = refsCache.get(refVNodes);
2003
+
2004
+ if (isUndefined$1(refs)) {
2005
+ refs = create(null);
2006
+
2007
+ var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
2008
+ _step3;
2009
+
2010
+ try {
2011
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2012
+ var key = _step3.value;
2013
+ refs[key] = refVNodes[key].elm;
2014
+ }
2015
+ } catch (err) {
2016
+ _iterator3.e(err);
2017
+ } finally {
2018
+ _iterator3.f();
2019
+ }
2020
+
2021
+ freeze(refs);
2022
+ refsCache.set(refVNodes, refs);
2023
+ }
2024
+
2025
+ return refs;
2026
+ },
2027
+
2028
+ // For backwards compat, we allow component authors to set `refs` as an expando
2029
+ set refs(value) {
2030
+ defineProperty(this, 'refs', {
2031
+ configurable: true,
2032
+ enumerable: true,
2033
+ writable: true,
2034
+ value: value
2035
+ });
2036
+ },
2037
+
1952
2038
  get shadowRoot() {
1953
2039
  // From within the component instance, the shadowRoot is always reported as "closed".
1954
2040
  // Authors should rely on this.template instead.
@@ -3326,15 +3412,33 @@
3326
3412
 
3327
3413
  function patchProps(oldVnode, vnode, renderer) {
3328
3414
  var props = vnode.data.props;
3415
+ var spread = vnode.data.spread;
3329
3416
 
3330
- if (isUndefined$1(props)) {
3417
+ if (isUndefined$1(props) && isUndefined$1(spread)) {
3331
3418
  return;
3332
3419
  }
3333
3420
 
3334
- var oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
3421
+ var oldProps;
3335
3422
 
3336
- if (oldProps === props) {
3337
- return;
3423
+ if (!isNull(oldVnode)) {
3424
+ oldProps = oldVnode.data.props;
3425
+ var oldSpread = oldVnode.data.spread;
3426
+
3427
+ if (oldProps === props && oldSpread === spread) {
3428
+ return;
3429
+ }
3430
+
3431
+ if (isUndefined$1(oldProps)) {
3432
+ oldProps = EmptyObject;
3433
+ }
3434
+
3435
+ if (!isUndefined$1(oldSpread)) {
3436
+ oldProps = assign({}, oldProps, oldSpread);
3437
+ }
3438
+ }
3439
+
3440
+ if (!isUndefined$1(spread)) {
3441
+ props = assign({}, props, spread);
3338
3442
  }
3339
3443
 
3340
3444
  var isFirstPatch = isNull(oldVnode);
@@ -3347,7 +3451,8 @@
3347
3451
  var cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
3348
3452
  // different than the one previously set.
3349
3453
 
3350
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
3454
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key]) || !(key in oldProps) // this is required because the above case will pass when `cur` is `undefined` and key is missing in `oldProps`
3455
+ ) {
3351
3456
 
3352
3457
  setProperty(elm, key, cur);
3353
3458
  }
@@ -4316,19 +4421,25 @@
4316
4421
  var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EmptyArray;
4317
4422
  var vmBeingRendered = getVMBeingRendered();
4318
4423
 
4319
- var elm;
4320
- var key = data.key;
4321
- return {
4424
+ var key = data.key,
4425
+ ref = data.ref;
4426
+ var vnode = {
4322
4427
  type: 2
4323
4428
  /* VNodeType.Element */
4324
4429
  ,
4325
4430
  sel: sel,
4326
4431
  data: data,
4327
4432
  children: children,
4328
- elm: elm,
4433
+ elm: undefined,
4329
4434
  key: key,
4330
4435
  owner: vmBeingRendered
4331
4436
  };
4437
+
4438
+ if (!isUndefined$1(ref)) {
4439
+ setRefVNode(vmBeingRendered, ref, vnode);
4440
+ }
4441
+
4442
+ return vnode;
4332
4443
  } // [t]ab[i]ndex function
4333
4444
 
4334
4445
 
@@ -4374,7 +4485,8 @@
4374
4485
  var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
4375
4486
  var vmBeingRendered = getVMBeingRendered();
4376
4487
 
4377
- var key = data.key;
4488
+ var key = data.key,
4489
+ ref = data.ref;
4378
4490
  var elm, aChildren, vm;
4379
4491
  var vnode = {
4380
4492
  type: 3
@@ -4392,6 +4504,11 @@
4392
4504
  vm: vm
4393
4505
  };
4394
4506
  addVNodeToChildLWC(vnode);
4507
+
4508
+ if (!isUndefined$1(ref)) {
4509
+ setRefVNode(vmBeingRendered, ref, vnode);
4510
+ }
4511
+
4395
4512
  return vnode;
4396
4513
  } // [i]terable node
4397
4514
 
@@ -4891,9 +5008,13 @@
4891
5008
  context.styleVNodes = stylesheetsContent.length === 0 ? null : createStylesheet(vm, stylesheetsContent);
4892
5009
  }
4893
5010
 
4894
- if ("production" !== 'production') ; // right before producing the vnodes, we clear up all internal references
4895
- // to custom elements from the template.
5011
+ if ("production" !== 'production') ; // reset the refs; they will be set during the tmpl() instantiation
5012
+
4896
5013
 
5014
+ var hasRefVNodes = Boolean(html.hasRefs);
5015
+ vm.hasRefVNodes = hasRefVNodes;
5016
+ vm.refVNodes = hasRefVNodes ? create(null) : null; // right before producing the vnodes, we clear up all internal references
5017
+ // to custom elements from the template.
4897
5018
 
4898
5019
  vm.velements = []; // Set the global flag that template is being updated
4899
5020
 
@@ -5256,6 +5377,8 @@
5256
5377
  tagName: tagName,
5257
5378
  mode: mode,
5258
5379
  owner: owner,
5380
+ refVNodes: null,
5381
+ hasRefVNodes: false,
5259
5382
  children: EmptyArray,
5260
5383
  aChildren: EmptyArray,
5261
5384
  velements: EmptyArray,
@@ -6560,7 +6683,7 @@
6560
6683
 
6561
6684
  return ctor;
6562
6685
  }
6563
- /* version: 2.23.5 */
6686
+ /* version: 2.24.0 */
6564
6687
 
6565
6688
  /*
6566
6689
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6731,356 +6854,397 @@
6731
6854
 
6732
6855
 
6733
6856
  function rendererFactory(baseRenderer) {
6734
- // Util functions
6735
- function assertInvariant(value, msg) {
6736
- if (!value) {
6737
- throw new Error("Invariant Violation: ".concat(msg));
6857
+ var renderer = function (exports) {
6858
+ /**
6859
+ * Copyright (C) 2018 salesforce.com, inc.
6860
+ */
6861
+
6862
+ /*
6863
+ * Copyright (c) 2018, salesforce.com, inc.
6864
+ * All rights reserved.
6865
+ * SPDX-License-Identifier: MIT
6866
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6867
+ */
6868
+ function invariant(value, msg) {
6869
+ if (!value) {
6870
+ throw new Error("Invariant Violation: ".concat(msg));
6871
+ }
6738
6872
  }
6739
- }
6740
6873
 
6741
- function isNull(obj) {
6742
- return obj === null;
6743
- }
6874
+ function isTrue$1(value, msg) {
6875
+ if (!value) {
6876
+ throw new Error("Assert Violation: ".concat(msg));
6877
+ }
6878
+ }
6744
6879
 
6745
- function isUndefined(obj) {
6746
- return obj === undefined;
6747
- }
6880
+ function isFalse$1(value, msg) {
6881
+ if (value) {
6882
+ throw new Error("Assert Violation: ".concat(msg));
6883
+ }
6884
+ }
6748
6885
 
6749
- var getCustomElement;
6750
- var defineCustomElement;
6751
- var HTMLElementConstructor;
6886
+ function fail(msg) {
6887
+ throw new Error(msg);
6888
+ }
6752
6889
 
6753
- function isCustomElementRegistryAvailable() {
6754
- if (typeof customElements === 'undefined') {
6755
- return false;
6890
+ var assert = /*#__PURE__*/Object.freeze({
6891
+ __proto__: null,
6892
+ invariant: invariant,
6893
+ isTrue: isTrue$1,
6894
+ isFalse: isFalse$1,
6895
+ fail: fail
6896
+ });
6897
+
6898
+ function isUndefined(obj) {
6899
+ return obj === undefined;
6756
6900
  }
6757
6901
 
6758
- try {
6759
- // dereference HTMLElement global because babel wraps globals in compat mode with a
6760
- // _wrapNativeSuper()
6761
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
6762
- // get wrapped by babel.
6763
- var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
6764
- // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
6765
- // which are not equipped to be initialized that way.
6902
+ function isNull(obj) {
6903
+ return obj === null;
6904
+ }
6905
+ /** version: 2.24.0 */
6766
6906
 
6767
- var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
6768
- _inherits(clazz, _HTMLElementAlias);
6907
+ /*
6908
+ * Copyright (c) 2018, salesforce.com, inc.
6909
+ * All rights reserved.
6910
+ * SPDX-License-Identifier: MIT
6911
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6912
+ */
6769
6913
 
6770
- var _super7 = _createSuper(clazz);
6771
6914
 
6772
- function clazz() {
6773
- _classCallCheck(this, clazz);
6915
+ exports.getCustomElement = void 0;
6916
+ exports.defineCustomElement = void 0;
6917
+ var HTMLElementConstructor;
6774
6918
 
6775
- return _super7.apply(this, arguments);
6776
- }
6919
+ function isCustomElementRegistryAvailable() {
6920
+ if (typeof customElements === 'undefined') {
6921
+ return false;
6922
+ }
6777
6923
 
6778
- return _createClass(clazz);
6779
- }(HTMLElementAlias);
6924
+ try {
6925
+ // dereference HTMLElement global because babel wraps globals in compat mode with a
6926
+ // _wrapNativeSuper()
6927
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
6928
+ // get wrapped by babel.
6929
+ var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
6930
+ // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
6931
+ // which are not equipped to be initialized that way.
6780
6932
 
6781
- customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
6782
- new clazz();
6783
- return true;
6784
- } catch (_a) {
6785
- return false;
6786
- }
6787
- }
6933
+ var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
6934
+ _inherits(clazz, _HTMLElementAlias);
6788
6935
 
6789
- if (isCustomElementRegistryAvailable()) {
6790
- getCustomElement = customElements.get.bind(customElements);
6791
- defineCustomElement = customElements.define.bind(customElements);
6792
- HTMLElementConstructor = HTMLElement;
6793
- } else {
6794
- var registry = Object.create(null);
6795
- var reverseRegistry = new WeakMap();
6936
+ var _super7 = _createSuper(clazz);
6796
6937
 
6797
- defineCustomElement = function define(name, ctor) {
6798
- if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
6799
- throw new TypeError("Invalid Registration");
6800
- }
6938
+ function clazz() {
6939
+ _classCallCheck(this, clazz);
6801
6940
 
6802
- registry[name] = ctor;
6803
- reverseRegistry.set(ctor, name);
6804
- };
6941
+ return _super7.apply(this, arguments);
6942
+ }
6805
6943
 
6806
- getCustomElement = function get(name) {
6807
- return registry[name];
6808
- };
6944
+ return _createClass(clazz);
6945
+ }(HTMLElementAlias);
6809
6946
 
6810
- HTMLElementConstructor = function HTMLElement() {
6811
- if (!(this instanceof HTMLElement)) {
6812
- throw new TypeError("Invalid Invocation");
6947
+ customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
6948
+ new clazz();
6949
+ return true;
6950
+ } catch (_a) {
6951
+ return false;
6813
6952
  }
6953
+ }
6814
6954
 
6815
- var constructor = this.constructor;
6816
- var name = reverseRegistry.get(constructor);
6955
+ if (isCustomElementRegistryAvailable()) {
6956
+ exports.getCustomElement = customElements.get.bind(customElements);
6957
+ exports.defineCustomElement = customElements.define.bind(customElements);
6958
+ HTMLElementConstructor = HTMLElement;
6959
+ } else {
6960
+ var registry = Object.create(null);
6961
+ var reverseRegistry = new WeakMap();
6817
6962
 
6818
- if (!name) {
6819
- throw new TypeError("Invalid Construction");
6820
- }
6963
+ exports.defineCustomElement = function define(name, ctor) {
6964
+ if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
6965
+ throw new TypeError("Invalid Registration");
6966
+ }
6821
6967
 
6822
- var elm = document.createElement(name);
6823
- Object.setPrototypeOf(elm, constructor.prototype);
6824
- return elm;
6825
- };
6968
+ registry[name] = ctor;
6969
+ reverseRegistry.set(ctor, name);
6970
+ };
6826
6971
 
6827
- HTMLElementConstructor.prototype = HTMLElement.prototype;
6828
- }
6972
+ exports.getCustomElement = function get(name) {
6973
+ return registry[name];
6974
+ };
6829
6975
 
6830
- function cloneNode(node, deep) {
6831
- return node.cloneNode(deep);
6832
- }
6976
+ HTMLElementConstructor = function HTMLElement() {
6977
+ if (!(this instanceof HTMLElement)) {
6978
+ throw new TypeError("Invalid Invocation");
6979
+ }
6833
6980
 
6834
- function createElement(tagName, namespace) {
6835
- return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6836
- }
6981
+ var constructor = this.constructor;
6982
+ var name = reverseRegistry.get(constructor);
6837
6983
 
6838
- function createText(content) {
6839
- return document.createTextNode(content);
6840
- }
6984
+ if (!name) {
6985
+ throw new TypeError("Invalid Construction");
6986
+ }
6841
6987
 
6842
- function createComment(content) {
6843
- return document.createComment(content);
6844
- }
6988
+ var elm = document.createElement(name);
6989
+ Object.setPrototypeOf(elm, constructor.prototype);
6990
+ return elm;
6991
+ };
6992
+
6993
+ HTMLElementConstructor.prototype = HTMLElement.prototype;
6994
+ }
6845
6995
 
6846
- var createFragment; // IE11 lacks support for this feature
6996
+ function cloneNode(node, deep) {
6997
+ return node.cloneNode(deep);
6998
+ }
6847
6999
 
6848
- var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
7000
+ function createElement(tagName, namespace) {
7001
+ return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7002
+ }
6849
7003
 
6850
- if (SUPPORTS_TEMPLATE) {
6851
- // Parse the fragment HTML string into DOM
6852
- createFragment = function createFragment(html) {
6853
- var template = document.createElement('template');
6854
- template.innerHTML = html;
6855
- return template.content.firstChild;
6856
- };
6857
- } else {
6858
- // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
6859
- // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
6860
- // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
6861
- // With other elements added from:
6862
- // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
6863
- // Using the test:
6864
- // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
6865
- // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
6866
- var topLevelWrappingMap = {
6867
- caption: ['table'],
6868
- col: ['colgroup', 'table'],
6869
- colgroup: ['table'],
6870
- option: ['select'],
6871
- tbody: ['table'],
6872
- td: ['tr', 'tbody', 'table'],
6873
- th: ['tr', 'tbody', 'table'],
6874
- thead: ['table'],
6875
- tfoot: ['table'],
6876
- tr: ['tbody', 'table']
6877
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
6878
-
6879
- var getTagName = function getTagName(text) {
6880
- return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
6881
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
6882
-
6883
-
6884
- createFragment = function createFragment(html) {
6885
- var wrapperTags = topLevelWrappingMap[getTagName(html)];
6886
-
6887
- if (!isUndefined(wrapperTags)) {
6888
- var _iterator5 = _createForOfIteratorHelper(wrapperTags),
6889
- _step5;
6890
-
6891
- try {
6892
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6893
- var wrapperTag = _step5.value;
6894
- html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
7004
+ function createText(content) {
7005
+ return document.createTextNode(content);
7006
+ }
7007
+
7008
+ function createComment(content) {
7009
+ return document.createComment(content);
7010
+ }
7011
+
7012
+ exports.createFragment = void 0; // IE11 lacks support for this feature
7013
+
7014
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
7015
+
7016
+ if (SUPPORTS_TEMPLATE) {
7017
+ // Parse the fragment HTML string into DOM
7018
+ exports.createFragment = function (html) {
7019
+ var template = document.createElement('template');
7020
+ template.innerHTML = html;
7021
+ return template.content.firstChild;
7022
+ };
7023
+ } else {
7024
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
7025
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
7026
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
7027
+ // With other elements added from:
7028
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
7029
+ // Using the test:
7030
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
7031
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
7032
+ var topLevelWrappingMap = {
7033
+ caption: ['table'],
7034
+ col: ['colgroup', 'table'],
7035
+ colgroup: ['table'],
7036
+ option: ['select'],
7037
+ tbody: ['table'],
7038
+ td: ['tr', 'tbody', 'table'],
7039
+ th: ['tr', 'tbody', 'table'],
7040
+ thead: ['table'],
7041
+ tfoot: ['table'],
7042
+ tr: ['tbody', 'table']
7043
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
7044
+
7045
+ var getTagName = function getTagName(text) {
7046
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
7047
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
7048
+
7049
+
7050
+ exports.createFragment = function (html) {
7051
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
7052
+
7053
+ if (!isUndefined(wrapperTags)) {
7054
+ var _iterator6 = _createForOfIteratorHelper(wrapperTags),
7055
+ _step6;
7056
+
7057
+ try {
7058
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7059
+ var wrapperTag = _step6.value;
7060
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
7061
+ }
7062
+ } catch (err) {
7063
+ _iterator6.e(err);
7064
+ } finally {
7065
+ _iterator6.f();
6895
7066
  }
6896
- } catch (err) {
6897
- _iterator5.e(err);
6898
- } finally {
6899
- _iterator5.f();
6900
- }
6901
- } // For IE11, the document title must not be undefined, but it can be an empty string
6902
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
7067
+ } // For IE11, the document title must not be undefined, but it can be an empty string
7068
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
6903
7069
 
6904
7070
 
6905
- var doc = document.implementation.createHTMLDocument('');
6906
- doc.body.innerHTML = html;
6907
- var content = doc.body;
7071
+ var doc = document.implementation.createHTMLDocument('');
7072
+ doc.body.innerHTML = html;
7073
+ var content = doc.body;
6908
7074
 
6909
- if (!isUndefined(wrapperTags)) {
6910
- for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
6911
- content = content.firstChild;
7075
+ if (!isUndefined(wrapperTags)) {
7076
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
7077
+ content = content.firstChild;
7078
+ }
6912
7079
  }
6913
- }
6914
7080
 
6915
- return content.firstChild;
6916
- };
6917
- }
7081
+ return content.firstChild;
7082
+ };
7083
+ }
6918
7084
 
6919
- function insert(node, parent, anchor) {
6920
- parent.insertBefore(node, anchor);
6921
- }
7085
+ function insert(node, parent, anchor) {
7086
+ parent.insertBefore(node, anchor);
7087
+ }
6922
7088
 
6923
- function remove(node, parent) {
6924
- parent.removeChild(node);
6925
- }
7089
+ function remove(node, parent) {
7090
+ parent.removeChild(node);
7091
+ }
6926
7092
 
6927
- function nextSibling(node) {
6928
- return node.nextSibling;
6929
- }
7093
+ function nextSibling(node) {
7094
+ return node.nextSibling;
7095
+ }
7096
+
7097
+ function attachShadow(element, options) {
7098
+ // `shadowRoot` will be non-null in two cases:
7099
+ // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
7100
+ // 2. when a webapp author places <c-app> in their static HTML and mounts their
7101
+ // root component with customElement.define('c-app', Ctor)
7102
+ if (!isNull(element.shadowRoot)) {
7103
+ return element.shadowRoot;
7104
+ }
6930
7105
 
6931
- function attachShadow(element, options) {
6932
- // `shadowRoot` will be non-null in two cases:
6933
- // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
6934
- // 2. when a webapp author places <c-app> in their static HTML and mounts their
6935
- // root component with customElement.define('c-app', Ctor)
6936
- if (!isNull(element.shadowRoot)) {
6937
- return element.shadowRoot;
7106
+ return element.attachShadow(options);
6938
7107
  }
6939
7108
 
6940
- return element.attachShadow(options);
6941
- }
7109
+ function setText(node, content) {
7110
+ node.nodeValue = content;
7111
+ }
6942
7112
 
6943
- function setText(node, content) {
6944
- node.nodeValue = content;
6945
- }
7113
+ function getProperty(node, key) {
7114
+ return node[key];
7115
+ }
6946
7116
 
6947
- function getProperty(node, key) {
6948
- return node[key];
6949
- }
7117
+ function setProperty(node, key, value) {
7118
+ node[key] = value;
7119
+ }
6950
7120
 
6951
- function setProperty(node, key, value) {
6952
- node[key] = value;
6953
- }
7121
+ function getAttribute(element, name, namespace) {
7122
+ return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
7123
+ }
6954
7124
 
6955
- function getAttribute(element, name, namespace) {
6956
- return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
6957
- }
7125
+ function setAttribute(element, name, value, namespace) {
7126
+ return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
7127
+ }
6958
7128
 
6959
- function setAttribute(element, name, value, namespace) {
6960
- return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
6961
- }
7129
+ function removeAttribute(element, name, namespace) {
7130
+ if (isUndefined(namespace)) {
7131
+ element.removeAttribute(name);
7132
+ } else {
7133
+ element.removeAttributeNS(namespace, name);
7134
+ }
7135
+ }
6962
7136
 
6963
- function removeAttribute(element, name, namespace) {
6964
- if (isUndefined(namespace)) {
6965
- element.removeAttribute(name);
6966
- } else {
6967
- element.removeAttributeNS(namespace, name);
7137
+ function addEventListener(target, type, callback, options) {
7138
+ target.addEventListener(type, callback, options);
6968
7139
  }
6969
- }
6970
7140
 
6971
- function addEventListener(target, type, callback, options) {
6972
- target.addEventListener(type, callback, options);
6973
- }
7141
+ function removeEventListener(target, type, callback, options) {
7142
+ target.removeEventListener(type, callback, options);
7143
+ }
6974
7144
 
6975
- function removeEventListener(target, type, callback, options) {
6976
- target.removeEventListener(type, callback, options);
6977
- }
7145
+ function dispatchEvent(target, event) {
7146
+ return target.dispatchEvent(event);
7147
+ }
6978
7148
 
6979
- function dispatchEvent(target, event) {
6980
- return target.dispatchEvent(event);
6981
- }
7149
+ function getClassList(element) {
7150
+ return element.classList;
7151
+ }
6982
7152
 
6983
- function getClassList(element) {
6984
- return element.classList;
6985
- }
7153
+ function setCSSStyleProperty(element, name, value, important) {
7154
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
7155
+ // represent elements in the engine?
7156
+ element.style.setProperty(name, value, important ? 'important' : '');
7157
+ }
6986
7158
 
6987
- function setCSSStyleProperty(element, name, value, important) {
6988
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
6989
- // represent elements in the engine?
6990
- element.style.setProperty(name, value, important ? 'important' : '');
6991
- }
7159
+ function getBoundingClientRect(element) {
7160
+ return element.getBoundingClientRect();
7161
+ }
6992
7162
 
6993
- function getBoundingClientRect(element) {
6994
- return element.getBoundingClientRect();
6995
- }
7163
+ function querySelector(element, selectors) {
7164
+ return element.querySelector(selectors);
7165
+ }
6996
7166
 
6997
- function querySelector(element, selectors) {
6998
- return element.querySelector(selectors);
6999
- }
7167
+ function querySelectorAll(element, selectors) {
7168
+ return element.querySelectorAll(selectors);
7169
+ }
7000
7170
 
7001
- function querySelectorAll(element, selectors) {
7002
- return element.querySelectorAll(selectors);
7003
- }
7171
+ function getElementsByTagName(element, tagNameOrWildCard) {
7172
+ return element.getElementsByTagName(tagNameOrWildCard);
7173
+ }
7004
7174
 
7005
- function getElementsByTagName(element, tagNameOrWildCard) {
7006
- return element.getElementsByTagName(tagNameOrWildCard);
7007
- }
7175
+ function getElementsByClassName(element, names) {
7176
+ return element.getElementsByClassName(names);
7177
+ }
7008
7178
 
7009
- function getElementsByClassName(element, names) {
7010
- return element.getElementsByClassName(names);
7011
- }
7179
+ function getChildren(element) {
7180
+ return element.children;
7181
+ }
7012
7182
 
7013
- function getChildren(element) {
7014
- return element.children;
7015
- }
7183
+ function getChildNodes(element) {
7184
+ return element.childNodes;
7185
+ }
7016
7186
 
7017
- function getChildNodes(element) {
7018
- return element.childNodes;
7019
- }
7187
+ function getFirstChild(element) {
7188
+ return element.firstChild;
7189
+ }
7020
7190
 
7021
- function getFirstChild(element) {
7022
- return element.firstChild;
7023
- }
7191
+ function getFirstElementChild(element) {
7192
+ return element.firstElementChild;
7193
+ }
7024
7194
 
7025
- function getFirstElementChild(element) {
7026
- return element.firstElementChild;
7027
- }
7195
+ function getLastChild(element) {
7196
+ return element.lastChild;
7197
+ }
7028
7198
 
7029
- function getLastChild(element) {
7030
- return element.lastChild;
7031
- }
7199
+ function getLastElementChild(element) {
7200
+ return element.lastElementChild;
7201
+ }
7032
7202
 
7033
- function getLastElementChild(element) {
7034
- return element.lastElementChild;
7035
- }
7203
+ function isConnected(node) {
7204
+ return node.isConnected;
7205
+ }
7036
7206
 
7037
- function isConnected(node) {
7038
- return node.isConnected;
7039
- }
7207
+ function assertInstanceOfHTMLElement(elm, msg) {
7208
+ assert.invariant(elm instanceof HTMLElement, msg);
7209
+ }
7040
7210
 
7041
- function assertInstanceOfHTMLElement(elm, msg) {
7042
- assertInvariant(elm instanceof HTMLElement, msg);
7043
- }
7211
+ var HTMLElementExported = HTMLElementConstructor;
7212
+ exports.HTMLElementExported = HTMLElementExported;
7213
+ exports.addEventListener = addEventListener;
7214
+ exports.assertInstanceOfHTMLElement = assertInstanceOfHTMLElement;
7215
+ exports.attachShadow = attachShadow;
7216
+ exports.cloneNode = cloneNode;
7217
+ exports.createComment = createComment;
7218
+ exports.createElement = createElement;
7219
+ exports.createText = createText;
7220
+ exports.dispatchEvent = dispatchEvent;
7221
+ exports.getAttribute = getAttribute;
7222
+ exports.getBoundingClientRect = getBoundingClientRect;
7223
+ exports.getChildNodes = getChildNodes;
7224
+ exports.getChildren = getChildren;
7225
+ exports.getClassList = getClassList;
7226
+ exports.getElementsByClassName = getElementsByClassName;
7227
+ exports.getElementsByTagName = getElementsByTagName;
7228
+ exports.getFirstChild = getFirstChild;
7229
+ exports.getFirstElementChild = getFirstElementChild;
7230
+ exports.getLastChild = getLastChild;
7231
+ exports.getLastElementChild = getLastElementChild;
7232
+ exports.getProperty = getProperty;
7233
+ exports.insert = insert;
7234
+ exports.isConnected = isConnected;
7235
+ exports.nextSibling = nextSibling;
7236
+ exports.querySelector = querySelector;
7237
+ exports.querySelectorAll = querySelectorAll;
7238
+ exports.remove = remove;
7239
+ exports.removeAttribute = removeAttribute;
7240
+ exports.removeEventListener = removeEventListener;
7241
+ exports.setAttribute = setAttribute;
7242
+ exports.setCSSStyleProperty = setCSSStyleProperty;
7243
+ exports.setProperty = setProperty;
7244
+ exports.setText = setText;
7245
+ return exports;
7246
+ }({}); // Meant to inherit any properties passed via the base renderer as the argument to the factory.
7044
7247
 
7045
- var HTMLElementExported = HTMLElementConstructor;
7046
- var renderer = {
7047
- HTMLElementExported: HTMLElementExported,
7048
- insert: insert,
7049
- remove: remove,
7050
- cloneNode: cloneNode,
7051
- createFragment: createFragment,
7052
- createElement: createElement,
7053
- createText: createText,
7054
- createComment: createComment,
7055
- nextSibling: nextSibling,
7056
- attachShadow: attachShadow,
7057
- getProperty: getProperty,
7058
- setProperty: setProperty,
7059
- setText: setText,
7060
- getAttribute: getAttribute,
7061
- setAttribute: setAttribute,
7062
- removeAttribute: removeAttribute,
7063
- addEventListener: addEventListener,
7064
- removeEventListener: removeEventListener,
7065
- dispatchEvent: dispatchEvent,
7066
- getClassList: getClassList,
7067
- setCSSStyleProperty: setCSSStyleProperty,
7068
- getBoundingClientRect: getBoundingClientRect,
7069
- querySelector: querySelector,
7070
- querySelectorAll: querySelectorAll,
7071
- getElementsByTagName: getElementsByTagName,
7072
- getElementsByClassName: getElementsByClassName,
7073
- getChildren: getChildren,
7074
- getChildNodes: getChildNodes,
7075
- getFirstChild: getFirstChild,
7076
- getFirstElementChild: getFirstElementChild,
7077
- getLastChild: getLastChild,
7078
- getLastElementChild: getLastElementChild,
7079
- isConnected: isConnected,
7080
- assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
7081
- defineCustomElement: defineCustomElement,
7082
- getCustomElement: getCustomElement
7083
- }; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
7084
7248
 
7085
7249
  Object.setPrototypeOf(renderer, baseRenderer);
7086
7250
  return renderer;
@@ -7461,7 +7625,7 @@
7461
7625
  });
7462
7626
  freeze(LightningElement);
7463
7627
  seal(LightningElement.prototype);
7464
- /* version: 2.23.5 */
7628
+ /* version: 2.24.0 */
7465
7629
 
7466
7630
  exports.LightningElement = LightningElement;
7467
7631
  exports.__unstable__ProfilerControl = profilerControl;