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