lwc 2.20.4 → 2.22.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 (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +181 -127
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +181 -127
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +168 -115
  5. package/dist/engine-dom/iife/es5/engine-dom.js +226 -147
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +201 -119
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +181 -127
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +168 -115
  11. package/dist/engine-dom/umd/es5/engine-dom.js +226 -147
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +201 -119
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +89 -318
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +89 -318
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +7 -7
@@ -365,9 +365,9 @@ var LWC = (function (exports) {
365
365
  // Increment whenever the LWC template compiler changes
366
366
 
367
367
 
368
- var LWC_VERSION = "2.20.4";
368
+ var LWC_VERSION = "2.22.0";
369
369
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
370
- /** version: 2.20.4 */
370
+ /** version: 2.22.0 */
371
371
 
372
372
  /*
373
373
  * Copyright (c) 2018, salesforce.com, inc.
@@ -546,7 +546,7 @@ var LWC = (function (exports) {
546
546
  setFeatureFlag(name, value);
547
547
  }
548
548
  }
549
- /** version: 2.20.4 */
549
+ /** version: 2.22.0 */
550
550
 
551
551
  /*
552
552
  * Copyright (c) 2018, salesforce.com, inc.
@@ -852,20 +852,24 @@ var LWC = (function (exports) {
852
852
 
853
853
  return ReactiveObserver;
854
854
  }();
855
- /*
856
- * Copyright (c) 2018, salesforce.com, inc.
857
- * All rights reserved.
858
- * SPDX-License-Identifier: MIT
859
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
860
- */
861
-
862
855
 
863
856
  function componentValueMutated(vm, key) {
864
- valueMutated(vm.component, key);
857
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
858
+ {
859
+ valueMutated(vm.component, key);
860
+ }
865
861
  }
866
862
 
867
863
  function componentValueObserved(vm, key) {
868
- valueObserved(vm.component, key);
864
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
865
+ {
866
+ valueObserved(vm.component, key);
867
+ }
868
+ }
869
+
870
+ function createReactiveObserver(callback) {
871
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
872
+ return new ReactiveObserver(callback);
869
873
  }
870
874
  /*
871
875
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2280,8 +2284,28 @@ var LWC = (function (exports) {
2280
2284
  */
2281
2285
 
2282
2286
  function unwrap(value) {
2287
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2283
2288
  return reactiveMembrane.unwrapProxy(value);
2284
2289
  }
2290
+
2291
+ function getReadOnlyProxy(value) {
2292
+ // We must return a frozen wrapper around the value, so that child components cannot mutate properties passed to
2293
+ // them from their parents. This applies to both the client and server.
2294
+ return reactiveMembrane.getReadOnlyProxy(value);
2295
+ }
2296
+
2297
+ function getReactiveProxy(value) {
2298
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2299
+ return reactiveMembrane.getProxy(value);
2300
+ } // Making the component instance a live value when using Locker to support expandos.
2301
+
2302
+
2303
+ function markLockerLiveObject(obj) {
2304
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2305
+ {
2306
+ obj[lockerLivePropertyKey] = undefined;
2307
+ }
2308
+ }
2285
2309
  /*
2286
2310
  * Copyright (c) 2018, salesforce.com, inc.
2287
2311
  * All rights reserved.
@@ -2396,10 +2420,9 @@ var LWC = (function (exports) {
2396
2420
  vm.callHook = _callHook;
2397
2421
  vm.setHook = _setHook;
2398
2422
  vm.getHook = _getHook;
2399
- } // Making the component instance a live value when using Locker to support expandos.
2400
-
2423
+ }
2401
2424
 
2402
- this[lockerLivePropertyKey] = undefined; // Linking elm, shadow root and component with the VM.
2425
+ markLockerLiveObject(this); // Linking elm, shadow root and component with the VM.
2403
2426
 
2404
2427
  associateVM(component, vm);
2405
2428
  associateVM(elm, vm);
@@ -2739,55 +2762,6 @@ var LWC = (function (exports) {
2739
2762
  configurable: true
2740
2763
  };
2741
2764
  }
2742
- /*
2743
- * Copyright (c) 2018, salesforce.com, inc.
2744
- * All rights reserved.
2745
- * SPDX-License-Identifier: MIT
2746
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2747
- */
2748
-
2749
-
2750
- function api$1() {
2751
- if (process.env.NODE_ENV !== 'production') {
2752
- assert.fail("@api decorator can only be used as a decorator function.");
2753
- }
2754
-
2755
- throw new Error();
2756
- }
2757
-
2758
- function createPublicPropertyDescriptor(key) {
2759
- return {
2760
- get: function get() {
2761
- var vm = getAssociatedVM(this);
2762
-
2763
- if (isBeingConstructed(vm)) {
2764
- if (process.env.NODE_ENV !== 'production') {
2765
- logError("Can\u2019t read the value of property `".concat(toString$1(key), "` from the constructor because the owner component hasn\u2019t set the value yet. Instead, use the constructor to set a default value for the property."), vm);
2766
- }
2767
-
2768
- return;
2769
- }
2770
-
2771
- componentValueObserved(vm, key);
2772
- return vm.cmpProps[key];
2773
- },
2774
- set: function set(newValue) {
2775
- var vm = getAssociatedVM(this);
2776
-
2777
- if (process.env.NODE_ENV !== 'production') {
2778
- var _vmBeingRendered3 = getVMBeingRendered();
2779
-
2780
- assert.invariant(!isInvokingRender, "".concat(_vmBeingRendered3, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2781
- assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(_vmBeingRendered3, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2782
- }
2783
-
2784
- vm.cmpProps[key] = newValue;
2785
- componentValueMutated(vm, key);
2786
- },
2787
- enumerable: true,
2788
- configurable: true
2789
- };
2790
- }
2791
2765
 
2792
2766
  var AccessorReactiveObserver = /*#__PURE__*/function (_ReactiveObserver) {
2793
2767
  _inherits(AccessorReactiveObserver, _ReactiveObserver);
@@ -2846,6 +2820,60 @@ var LWC = (function (exports) {
2846
2820
  return AccessorReactiveObserver;
2847
2821
  }(ReactiveObserver);
2848
2822
 
2823
+ function createAccessorReactiveObserver(vm, set) {
2824
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2825
+ return new AccessorReactiveObserver(vm, set);
2826
+ }
2827
+ /*
2828
+ * Copyright (c) 2018, salesforce.com, inc.
2829
+ * All rights reserved.
2830
+ * SPDX-License-Identifier: MIT
2831
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2832
+ */
2833
+
2834
+
2835
+ function api$1() {
2836
+ if (process.env.NODE_ENV !== 'production') {
2837
+ assert.fail("@api decorator can only be used as a decorator function.");
2838
+ }
2839
+
2840
+ throw new Error();
2841
+ }
2842
+
2843
+ function createPublicPropertyDescriptor(key) {
2844
+ return {
2845
+ get: function get() {
2846
+ var vm = getAssociatedVM(this);
2847
+
2848
+ if (isBeingConstructed(vm)) {
2849
+ if (process.env.NODE_ENV !== 'production') {
2850
+ logError("Can\u2019t read the value of property `".concat(toString$1(key), "` from the constructor because the owner component hasn\u2019t set the value yet. Instead, use the constructor to set a default value for the property."), vm);
2851
+ }
2852
+
2853
+ return;
2854
+ }
2855
+
2856
+ componentValueObserved(vm, key);
2857
+ return vm.cmpProps[key];
2858
+ },
2859
+ set: function set(newValue) {
2860
+ var vm = getAssociatedVM(this);
2861
+
2862
+ if (process.env.NODE_ENV !== 'production') {
2863
+ var _vmBeingRendered3 = getVMBeingRendered();
2864
+
2865
+ assert.invariant(!isInvokingRender, "".concat(_vmBeingRendered3, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2866
+ assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(_vmBeingRendered3, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2867
+ }
2868
+
2869
+ vm.cmpProps[key] = newValue;
2870
+ componentValueMutated(vm, key);
2871
+ },
2872
+ enumerable: true,
2873
+ configurable: true
2874
+ };
2875
+ }
2876
+
2849
2877
  function createPublicAccessorDescriptor(key, descriptor) {
2850
2878
  var _get3 = descriptor.get,
2851
2879
  _set2 = descriptor.set,
@@ -2886,7 +2914,7 @@ var LWC = (function (exports) {
2886
2914
  var ro = vm.oar[key];
2887
2915
 
2888
2916
  if (isUndefined$1(ro)) {
2889
- ro = vm.oar[key] = new AccessorReactiveObserver(vm, _set2);
2917
+ ro = vm.oar[key] = createAccessorReactiveObserver(vm, _set2);
2890
2918
  } // every time we invoke this setter from outside (through this wrapper setter)
2891
2919
  // we should reset the value and then debounce just in case there is a pending
2892
2920
  // invocation the next tick that is not longer relevant since the value is changing
@@ -2918,7 +2946,7 @@ var LWC = (function (exports) {
2918
2946
 
2919
2947
  function track(target) {
2920
2948
  if (arguments.length === 1) {
2921
- return reactiveMembrane.getProxy(target);
2949
+ return getReactiveProxy(target);
2922
2950
  }
2923
2951
 
2924
2952
  if (process.env.NODE_ENV !== 'production') {
@@ -2945,7 +2973,7 @@ var LWC = (function (exports) {
2945
2973
  assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(_vmBeingRendered5, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2946
2974
  }
2947
2975
 
2948
- var reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2976
+ var reactiveOrAnyValue = getReactiveProxy(newValue);
2949
2977
 
2950
2978
  if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2951
2979
  vm.cmpFields[key] = reactiveOrAnyValue;
@@ -3420,7 +3448,7 @@ var LWC = (function (exports) {
3420
3448
  fn = cachedSetterByKey[key] = function (newValue) {
3421
3449
  var vm = getAssociatedVM(this);
3422
3450
  var setHook = vm.setHook;
3423
- newValue = reactiveMembrane.getReadOnlyProxy(newValue);
3451
+ newValue = getReadOnlyProxy(newValue);
3424
3452
  setHook(vm.component, key, newValue);
3425
3453
  };
3426
3454
  }
@@ -4852,10 +4880,11 @@ var LWC = (function (exports) {
4852
4880
  svg = vnode.data.svg;
4853
4881
  var createElement = renderer.createElement;
4854
4882
  var namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
4855
- var elm = createElement(sel, namespace);
4883
+ var elm = vnode.elm = createElement(sel, namespace);
4856
4884
  linkNodeToShadow(elm, owner, renderer);
4857
- fallbackElmHook(elm, vnode, renderer);
4858
- vnode.elm = elm;
4885
+ applyStyleScoping(elm, owner, renderer);
4886
+ applyDomManual(elm, vnode);
4887
+ applyElementRestrictions(elm, vnode);
4859
4888
  patchElementPropsAndAttrs$1(null, vnode, renderer);
4860
4889
  insertNode(elm, parent, anchor, renderer);
4861
4890
  mountVNodes(vnode.children, elm, renderer, null);
@@ -4872,7 +4901,8 @@ var LWC = (function (exports) {
4872
4901
  var cloneNode = renderer.cloneNode,
4873
4902
  isSyntheticShadowDefined = renderer.isSyntheticShadowDefined;
4874
4903
  var elm = vnode.elm = cloneNode(vnode.fragment, true);
4875
- linkNodeToShadow(elm, owner, renderer); // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
4904
+ linkNodeToShadow(elm, owner, renderer);
4905
+ applyElementRestrictions(elm, vnode); // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
4876
4906
 
4877
4907
  var renderMode = owner.renderMode,
4878
4908
  shadowMode = owner.shadowMode;
@@ -4887,16 +4917,6 @@ var LWC = (function (exports) {
4887
4917
  }
4888
4918
  }
4889
4919
 
4890
- if (process.env.NODE_ENV !== 'production') {
4891
- var isLight = renderMode === 0
4892
- /* RenderMode.Light */
4893
- ;
4894
- patchElementWithRestrictions(elm, {
4895
- isPortal: false,
4896
- isLight: isLight
4897
- });
4898
- }
4899
-
4900
4920
  insertNode(elm, parent, anchor, renderer);
4901
4921
  }
4902
4922
 
@@ -4916,9 +4936,10 @@ var LWC = (function (exports) {
4916
4936
  // the custom element from the registry is expecting an upgrade callback
4917
4937
  vm = createViewModelHook(elm, vnode, renderer);
4918
4938
  });
4919
- linkNodeToShadow(elm, owner, renderer);
4920
4939
  vnode.elm = elm;
4921
4940
  vnode.vm = vm;
4941
+ linkNodeToShadow(elm, owner, renderer);
4942
+ applyStyleScoping(elm, owner, renderer);
4922
4943
 
4923
4944
  if (vm) {
4924
4945
  allocateChildren(vnode, vm);
@@ -5040,26 +5061,6 @@ var LWC = (function (exports) {
5040
5061
  return vnode != null;
5041
5062
  }
5042
5063
 
5043
- function observeElementChildNodes(elm) {
5044
- elm.$domManual$ = true;
5045
- }
5046
-
5047
- function setElementShadowToken(elm, token) {
5048
- elm.$shadowToken$ = token;
5049
- } // Set the scope token class for *.scoped.css styles
5050
-
5051
-
5052
- function setScopeTokenClassIfNecessary(elm, owner, renderer) {
5053
- var token = getScopeTokenClass(owner);
5054
-
5055
- if (!isNull(token)) {
5056
- var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5057
- // probably we should have a renderer api for just the add operation
5058
-
5059
- _getClassList(elm).add(token);
5060
- }
5061
- }
5062
-
5063
5064
  function linkNodeToShadow(elm, owner, renderer) {
5064
5065
  var renderRoot = owner.renderRoot,
5065
5066
  renderMode = owner.renderMode,
@@ -5132,36 +5133,52 @@ var LWC = (function (exports) {
5132
5133
  patchProps(oldVnode, vnode, renderer);
5133
5134
  }
5134
5135
 
5135
- function fallbackElmHook(elm, vnode, renderer) {
5136
- var owner = vnode.owner;
5137
- setScopeTokenClassIfNecessary(elm, owner, renderer);
5136
+ function applyStyleScoping(elm, owner, renderer) {
5137
+ // Set the class name for `*.scoped.css` style scoping.
5138
+ var scopeToken = getScopeTokenClass(owner);
5139
+
5140
+ if (!isNull(scopeToken)) {
5141
+ var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5142
+ // probably we should have a renderer api for just the add operation
5143
+
5144
+ _getClassList(elm).add(scopeToken);
5145
+ } // Set property element for synthetic shadow DOM style scoping.
5146
+
5147
+
5148
+ var syntheticToken = owner.context.stylesheetToken;
5138
5149
 
5139
5150
  if (owner.shadowMode === 1
5140
5151
  /* ShadowMode.Synthetic */
5141
- ) {
5142
- var context = vnode.data.context;
5143
- var stylesheetToken = owner.context.stylesheetToken;
5152
+ && !isUndefined$1(syntheticToken)) {
5153
+ elm.$shadowToken$ = syntheticToken;
5154
+ }
5155
+ }
5144
5156
 
5145
- if (!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
5146
- /* LwcDomMode.Manual */
5147
- ) {
5148
- // this element will now accept any manual content inserted into it
5149
- observeElementChildNodes(elm);
5150
- }
5157
+ function applyDomManual(elm, vnode) {
5158
+ var _a;
5151
5159
 
5152
- if (!isUndefined$1(stylesheetToken)) {
5153
- // when running in synthetic shadow mode, we need to set the shadowToken value
5154
- // into each element from the template, so they can be styled accordingly.
5155
- setElementShadowToken(elm, stylesheetToken);
5156
- }
5160
+ var owner = vnode.owner,
5161
+ context = vnode.data.context;
5162
+
5163
+ if (owner.shadowMode === 1
5164
+ /* ShadowMode.Synthetic */
5165
+ && ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual"
5166
+ /* LwcDomMode.Manual */
5167
+ ) {
5168
+ elm.$domManual$ = true;
5157
5169
  }
5170
+ }
5171
+
5172
+ function applyElementRestrictions(elm, vnode) {
5173
+ var _a, _b;
5158
5174
 
5159
5175
  if (process.env.NODE_ENV !== 'production') {
5160
- var _context = vnode.data.context;
5161
- var isPortal = !isUndefined$1(_context) && !isUndefined$1(_context.lwc) && _context.lwc.dom === "manual"
5176
+ var isPortal = vnode.type === 2
5177
+ /* VNodeType.Element */
5178
+ && ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual"
5162
5179
  /* LwcDomMode.Manual */
5163
5180
  ;
5164
- var isLight = owner.renderMode === 0
5181
+ var isLight = vnode.owner.renderMode === 0
5165
5182
  /* RenderMode.Light */
5166
5183
  ;
5167
5184
  patchElementWithRestrictions(elm, {
@@ -5214,19 +5231,6 @@ var LWC = (function (exports) {
5214
5231
  mode = vnode.mode,
5215
5232
  ctor = vnode.ctor,
5216
5233
  owner = vnode.owner;
5217
- setScopeTokenClassIfNecessary(elm, owner, renderer);
5218
-
5219
- if (owner.shadowMode === 1
5220
- /* ShadowMode.Synthetic */
5221
- ) {
5222
- var stylesheetToken = owner.context.stylesheetToken; // when running in synthetic shadow mode, we need to set the shadowToken value
5223
- // into each element from the template, so they can be styled accordingly.
5224
-
5225
- if (!isUndefined$1(stylesheetToken)) {
5226
- setElementShadowToken(elm, stylesheetToken);
5227
- }
5228
- }
5229
-
5230
5234
  vm = createVM(elm, ctor, renderer, {
5231
5235
  mode: mode,
5232
5236
  owner: owner,
@@ -6493,7 +6497,7 @@ var LWC = (function (exports) {
6493
6497
  }
6494
6498
 
6495
6499
  function getTemplateReactiveObserver(vm) {
6496
- return new ReactiveObserver(function () {
6500
+ return createReactiveObserver(function () {
6497
6501
  var isDirty = vm.isDirty;
6498
6502
 
6499
6503
  if (isFalse(isDirty)) {
@@ -7312,7 +7316,7 @@ var LWC = (function (exports) {
7312
7316
  function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
7313
7317
  var hasPendingConfig = false; // creating the reactive observer for reactive params when needed
7314
7318
 
7315
- var ro = new ReactiveObserver(function () {
7319
+ var ro = createReactiveObserver(function () {
7316
7320
  if (hasPendingConfig === false) {
7317
7321
  hasPendingConfig = true; // collect new config in the micro-task
7318
7322
 
@@ -7613,7 +7617,7 @@ var LWC = (function (exports) {
7613
7617
  }
7614
7618
  }
7615
7619
 
7616
- return reactiveMembrane.getReadOnlyProxy(obj);
7620
+ return getReadOnlyProxy(obj);
7617
7621
  }
7618
7622
  /*
7619
7623
  * Copyright (c) 2022, salesforce.com, inc.
@@ -8294,7 +8298,7 @@ var LWC = (function (exports) {
8294
8298
 
8295
8299
  return ctor;
8296
8300
  }
8297
- /* version: 2.20.4 */
8301
+ /* version: 2.22.0 */
8298
8302
 
8299
8303
  /*
8300
8304
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8462,6 +8466,85 @@ var LWC = (function (exports) {
8462
8466
  */
8463
8467
 
8464
8468
 
8469
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8470
+ var createFragment;
8471
+
8472
+ if (SUPPORTS_TEMPLATE) {
8473
+ // Parse the fragment HTML string into DOM
8474
+ createFragment = function createFragment(html) {
8475
+ var template = document.createElement('template');
8476
+ template.innerHTML = html;
8477
+ return template.content.firstChild;
8478
+ };
8479
+ } else {
8480
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8481
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8482
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8483
+ // With other elements added from:
8484
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8485
+ // Using the test:
8486
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8487
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8488
+ var topLevelWrappingMap = {
8489
+ caption: ['table'],
8490
+ col: ['colgroup', 'table'],
8491
+ colgroup: ['table'],
8492
+ option: ['select'],
8493
+ tbody: ['table'],
8494
+ td: ['tr', 'tbody', 'table'],
8495
+ th: ['tr', 'tbody', 'table'],
8496
+ thead: ['table'],
8497
+ tfoot: ['table'],
8498
+ tr: ['tbody', 'table']
8499
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8500
+
8501
+ var getTagName = function getTagName(text) {
8502
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8503
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8504
+
8505
+
8506
+ createFragment = function createFragment(html) {
8507
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
8508
+
8509
+ if (!isUndefined$1(wrapperTags)) {
8510
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8511
+ _step5;
8512
+
8513
+ try {
8514
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8515
+ var wrapperTag = _step5.value;
8516
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8517
+ }
8518
+ } catch (err) {
8519
+ _iterator5.e(err);
8520
+ } finally {
8521
+ _iterator5.f();
8522
+ }
8523
+ } // For IE11, the document title must not be undefined, but it can be an empty string
8524
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8525
+
8526
+
8527
+ var doc = document.implementation.createHTMLDocument('');
8528
+ doc.body.innerHTML = html;
8529
+ var content = doc.body;
8530
+
8531
+ if (!isUndefined$1(wrapperTags)) {
8532
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8533
+ content = content.firstChild;
8534
+ }
8535
+ }
8536
+
8537
+ return content.firstChild;
8538
+ };
8539
+ }
8540
+ /*
8541
+ * Copyright (c) 2018, salesforce.com, inc.
8542
+ * All rights reserved.
8543
+ * SPDX-License-Identifier: MIT
8544
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8545
+ */
8546
+
8547
+
8465
8548
  var getCustomElement;
8466
8549
  var defineCustomElement;
8467
8550
  var HTMLElementConstructor;
@@ -8562,10 +8645,6 @@ var LWC = (function (exports) {
8562
8645
  return node.cloneNode(deep);
8563
8646
  }
8564
8647
 
8565
- function createFragment(html) {
8566
- return document.createRange().createContextualFragment(html).firstChild;
8567
- }
8568
-
8569
8648
  function createElement$1(tagName, namespace) {
8570
8649
  return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8571
8650
  }
@@ -8790,8 +8869,8 @@ var LWC = (function (exports) {
8790
8869
  hydrated: true
8791
8870
  });
8792
8871
 
8793
- for (var _i32 = 0, _Object$entries2 = Object.entries(props); _i32 < _Object$entries2.length; _i32++) {
8794
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i32], 2),
8872
+ for (var _i33 = 0, _Object$entries2 = Object.entries(props); _i33 < _Object$entries2.length; _i33++) {
8873
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i33], 2),
8795
8874
  key = _Object$entries2$_i[0],
8796
8875
  value = _Object$entries2$_i[1];
8797
8876
 
@@ -9123,7 +9202,7 @@ var LWC = (function (exports) {
9123
9202
  });
9124
9203
  freeze(LightningElement);
9125
9204
  seal(LightningElement.prototype);
9126
- /* version: 2.20.4 */
9205
+ /* version: 2.22.0 */
9127
9206
 
9128
9207
  exports.LightningElement = LightningElement;
9129
9208
  exports.__unstable__ProfilerControl = profilerControl;