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.
- package/dist/engine-dom/esm/es2017/engine-dom.js +181 -127
- package/dist/engine-dom/iife/es2017/engine-dom.js +181 -127
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +168 -115
- package/dist/engine-dom/iife/es5/engine-dom.js +226 -147
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +201 -119
- package/dist/engine-dom/umd/es2017/engine-dom.js +181 -127
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +168 -115
- package/dist/engine-dom/umd/es5/engine-dom.js +226 -147
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +201 -119
- package/dist/engine-server/commonjs/es2017/engine-server.js +89 -318
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +89 -318
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -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.
|
|
349
|
+
/** version: 2.22.0 */
|
|
350
350
|
|
|
351
351
|
/*
|
|
352
352
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -734,20 +734,24 @@ var LWC = (function (exports) {
|
|
|
734
734
|
|
|
735
735
|
return ReactiveObserver;
|
|
736
736
|
}();
|
|
737
|
-
/*
|
|
738
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
739
|
-
* All rights reserved.
|
|
740
|
-
* SPDX-License-Identifier: MIT
|
|
741
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
742
|
-
*/
|
|
743
|
-
|
|
744
737
|
|
|
745
738
|
function componentValueMutated(vm, key) {
|
|
746
|
-
|
|
739
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
740
|
+
{
|
|
741
|
+
valueMutated(vm.component, key);
|
|
742
|
+
}
|
|
747
743
|
}
|
|
748
744
|
|
|
749
745
|
function componentValueObserved(vm, key) {
|
|
750
|
-
|
|
746
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
747
|
+
{
|
|
748
|
+
valueObserved(vm.component, key);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
function createReactiveObserver(callback) {
|
|
753
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
754
|
+
return new ReactiveObserver(callback);
|
|
751
755
|
}
|
|
752
756
|
/*
|
|
753
757
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1672,8 +1676,28 @@ var LWC = (function (exports) {
|
|
|
1672
1676
|
*/
|
|
1673
1677
|
|
|
1674
1678
|
function unwrap(value) {
|
|
1679
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1675
1680
|
return reactiveMembrane.unwrapProxy(value);
|
|
1676
1681
|
}
|
|
1682
|
+
|
|
1683
|
+
function getReadOnlyProxy(value) {
|
|
1684
|
+
// We must return a frozen wrapper around the value, so that child components cannot mutate properties passed to
|
|
1685
|
+
// them from their parents. This applies to both the client and server.
|
|
1686
|
+
return reactiveMembrane.getReadOnlyProxy(value);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
function getReactiveProxy(value) {
|
|
1690
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1691
|
+
return reactiveMembrane.getProxy(value);
|
|
1692
|
+
} // Making the component instance a live value when using Locker to support expandos.
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
function markLockerLiveObject(obj) {
|
|
1696
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1697
|
+
{
|
|
1698
|
+
obj[lockerLivePropertyKey] = undefined;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1677
1701
|
/*
|
|
1678
1702
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1679
1703
|
* All rights reserved.
|
|
@@ -1764,10 +1788,9 @@ var LWC = (function (exports) {
|
|
|
1764
1788
|
vm.callHook = _callHook;
|
|
1765
1789
|
vm.setHook = _setHook;
|
|
1766
1790
|
vm.getHook = _getHook;
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1791
|
+
}
|
|
1769
1792
|
|
|
1770
|
-
this
|
|
1793
|
+
markLockerLiveObject(this); // Linking elm, shadow root and component with the VM.
|
|
1771
1794
|
|
|
1772
1795
|
associateVM(component, vm);
|
|
1773
1796
|
associateVM(elm, vm);
|
|
@@ -2025,42 +2048,6 @@ var LWC = (function (exports) {
|
|
|
2025
2048
|
configurable: true
|
|
2026
2049
|
};
|
|
2027
2050
|
}
|
|
2028
|
-
/*
|
|
2029
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
2030
|
-
* All rights reserved.
|
|
2031
|
-
* SPDX-License-Identifier: MIT
|
|
2032
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2033
|
-
*/
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
function api$1() {
|
|
2037
|
-
|
|
2038
|
-
throw new Error();
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
function createPublicPropertyDescriptor(key) {
|
|
2042
|
-
return {
|
|
2043
|
-
get: function get() {
|
|
2044
|
-
var vm = getAssociatedVM(this);
|
|
2045
|
-
|
|
2046
|
-
if (isBeingConstructed(vm)) {
|
|
2047
|
-
|
|
2048
|
-
return;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
componentValueObserved(vm, key);
|
|
2052
|
-
return vm.cmpProps[key];
|
|
2053
|
-
},
|
|
2054
|
-
set: function set(newValue) {
|
|
2055
|
-
var vm = getAssociatedVM(this);
|
|
2056
|
-
|
|
2057
|
-
vm.cmpProps[key] = newValue;
|
|
2058
|
-
componentValueMutated(vm, key);
|
|
2059
|
-
},
|
|
2060
|
-
enumerable: true,
|
|
2061
|
-
configurable: true
|
|
2062
|
-
};
|
|
2063
|
-
}
|
|
2064
2051
|
|
|
2065
2052
|
var AccessorReactiveObserver = /*#__PURE__*/function (_ReactiveObserver) {
|
|
2066
2053
|
_inherits(AccessorReactiveObserver, _ReactiveObserver);
|
|
@@ -2119,6 +2106,47 @@ var LWC = (function (exports) {
|
|
|
2119
2106
|
return AccessorReactiveObserver;
|
|
2120
2107
|
}(ReactiveObserver);
|
|
2121
2108
|
|
|
2109
|
+
function createAccessorReactiveObserver(vm, set) {
|
|
2110
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
2111
|
+
return new AccessorReactiveObserver(vm, set);
|
|
2112
|
+
}
|
|
2113
|
+
/*
|
|
2114
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2115
|
+
* All rights reserved.
|
|
2116
|
+
* SPDX-License-Identifier: MIT
|
|
2117
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2118
|
+
*/
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
function api$1() {
|
|
2122
|
+
|
|
2123
|
+
throw new Error();
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
function createPublicPropertyDescriptor(key) {
|
|
2127
|
+
return {
|
|
2128
|
+
get: function get() {
|
|
2129
|
+
var vm = getAssociatedVM(this);
|
|
2130
|
+
|
|
2131
|
+
if (isBeingConstructed(vm)) {
|
|
2132
|
+
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
componentValueObserved(vm, key);
|
|
2137
|
+
return vm.cmpProps[key];
|
|
2138
|
+
},
|
|
2139
|
+
set: function set(newValue) {
|
|
2140
|
+
var vm = getAssociatedVM(this);
|
|
2141
|
+
|
|
2142
|
+
vm.cmpProps[key] = newValue;
|
|
2143
|
+
componentValueMutated(vm, key);
|
|
2144
|
+
},
|
|
2145
|
+
enumerable: true,
|
|
2146
|
+
configurable: true
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2122
2150
|
function createPublicAccessorDescriptor(key, descriptor) {
|
|
2123
2151
|
var _get3 = descriptor.get,
|
|
2124
2152
|
_set2 = descriptor.set,
|
|
@@ -2145,7 +2173,7 @@ var LWC = (function (exports) {
|
|
|
2145
2173
|
var ro = vm.oar[key];
|
|
2146
2174
|
|
|
2147
2175
|
if (isUndefined$1(ro)) {
|
|
2148
|
-
ro = vm.oar[key] =
|
|
2176
|
+
ro = vm.oar[key] = createAccessorReactiveObserver(vm, _set2);
|
|
2149
2177
|
} // every time we invoke this setter from outside (through this wrapper setter)
|
|
2150
2178
|
// we should reset the value and then debounce just in case there is a pending
|
|
2151
2179
|
// invocation the next tick that is not longer relevant since the value is changing
|
|
@@ -2175,7 +2203,7 @@ var LWC = (function (exports) {
|
|
|
2175
2203
|
|
|
2176
2204
|
function track(target) {
|
|
2177
2205
|
if (arguments.length === 1) {
|
|
2178
|
-
return
|
|
2206
|
+
return getReactiveProxy(target);
|
|
2179
2207
|
}
|
|
2180
2208
|
|
|
2181
2209
|
throw new Error();
|
|
@@ -2191,7 +2219,7 @@ var LWC = (function (exports) {
|
|
|
2191
2219
|
set: function set(newValue) {
|
|
2192
2220
|
var vm = getAssociatedVM(this);
|
|
2193
2221
|
|
|
2194
|
-
var reactiveOrAnyValue =
|
|
2222
|
+
var reactiveOrAnyValue = getReactiveProxy(newValue);
|
|
2195
2223
|
|
|
2196
2224
|
if (reactiveOrAnyValue !== vm.cmpFields[key]) {
|
|
2197
2225
|
vm.cmpFields[key] = reactiveOrAnyValue;
|
|
@@ -2499,7 +2527,7 @@ var LWC = (function (exports) {
|
|
|
2499
2527
|
fn = cachedSetterByKey[key] = function (newValue) {
|
|
2500
2528
|
var vm = getAssociatedVM(this);
|
|
2501
2529
|
var setHook = vm.setHook;
|
|
2502
|
-
newValue =
|
|
2530
|
+
newValue = getReadOnlyProxy(newValue);
|
|
2503
2531
|
setHook(vm.component, key, newValue);
|
|
2504
2532
|
};
|
|
2505
2533
|
}
|
|
@@ -3621,10 +3649,10 @@ var LWC = (function (exports) {
|
|
|
3621
3649
|
svg = vnode.data.svg;
|
|
3622
3650
|
var createElement = renderer.createElement;
|
|
3623
3651
|
var namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3624
|
-
var elm = createElement(sel, namespace);
|
|
3652
|
+
var elm = vnode.elm = createElement(sel, namespace);
|
|
3625
3653
|
linkNodeToShadow(elm, owner, renderer);
|
|
3626
|
-
|
|
3627
|
-
|
|
3654
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3655
|
+
applyDomManual(elm, vnode);
|
|
3628
3656
|
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
3629
3657
|
insertNode(elm, parent, anchor, renderer);
|
|
3630
3658
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3641,7 +3669,7 @@ var LWC = (function (exports) {
|
|
|
3641
3669
|
var cloneNode = renderer.cloneNode,
|
|
3642
3670
|
isSyntheticShadowDefined = renderer.isSyntheticShadowDefined;
|
|
3643
3671
|
var elm = vnode.elm = cloneNode(vnode.fragment, true);
|
|
3644
|
-
linkNodeToShadow(elm, owner, renderer);
|
|
3672
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
3645
3673
|
|
|
3646
3674
|
var renderMode = owner.renderMode,
|
|
3647
3675
|
shadowMode = owner.shadowMode;
|
|
@@ -3675,9 +3703,10 @@ var LWC = (function (exports) {
|
|
|
3675
3703
|
// the custom element from the registry is expecting an upgrade callback
|
|
3676
3704
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
3677
3705
|
});
|
|
3678
|
-
linkNodeToShadow(elm, owner, renderer);
|
|
3679
3706
|
vnode.elm = elm;
|
|
3680
3707
|
vnode.vm = vm;
|
|
3708
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
3709
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3681
3710
|
|
|
3682
3711
|
if (vm) {
|
|
3683
3712
|
allocateChildren(vnode, vm);
|
|
@@ -3794,26 +3823,6 @@ var LWC = (function (exports) {
|
|
|
3794
3823
|
return vnode != null;
|
|
3795
3824
|
}
|
|
3796
3825
|
|
|
3797
|
-
function observeElementChildNodes(elm) {
|
|
3798
|
-
elm.$domManual$ = true;
|
|
3799
|
-
}
|
|
3800
|
-
|
|
3801
|
-
function setElementShadowToken(elm, token) {
|
|
3802
|
-
elm.$shadowToken$ = token;
|
|
3803
|
-
} // Set the scope token class for *.scoped.css styles
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
3807
|
-
var token = getScopeTokenClass(owner);
|
|
3808
|
-
|
|
3809
|
-
if (!isNull(token)) {
|
|
3810
|
-
var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
3811
|
-
// probably we should have a renderer api for just the add operation
|
|
3812
|
-
|
|
3813
|
-
_getClassList(elm).add(token);
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
|
|
3817
3826
|
function linkNodeToShadow(elm, owner, renderer) {
|
|
3818
3827
|
var renderRoot = owner.renderRoot,
|
|
3819
3828
|
renderMode = owner.renderMode,
|
|
@@ -3864,28 +3873,39 @@ var LWC = (function (exports) {
|
|
|
3864
3873
|
patchProps(oldVnode, vnode, renderer);
|
|
3865
3874
|
}
|
|
3866
3875
|
|
|
3867
|
-
function
|
|
3868
|
-
|
|
3869
|
-
|
|
3876
|
+
function applyStyleScoping(elm, owner, renderer) {
|
|
3877
|
+
// Set the class name for `*.scoped.css` style scoping.
|
|
3878
|
+
var scopeToken = getScopeTokenClass(owner);
|
|
3879
|
+
|
|
3880
|
+
if (!isNull(scopeToken)) {
|
|
3881
|
+
var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
3882
|
+
// probably we should have a renderer api for just the add operation
|
|
3883
|
+
|
|
3884
|
+
_getClassList(elm).add(scopeToken);
|
|
3885
|
+
} // Set property element for synthetic shadow DOM style scoping.
|
|
3886
|
+
|
|
3887
|
+
|
|
3888
|
+
var syntheticToken = owner.context.stylesheetToken;
|
|
3870
3889
|
|
|
3871
3890
|
if (owner.shadowMode === 1
|
|
3872
3891
|
/* ShadowMode.Synthetic */
|
|
3873
|
-
) {
|
|
3874
|
-
|
|
3875
|
-
|
|
3892
|
+
&& !isUndefined$1(syntheticToken)) {
|
|
3893
|
+
elm.$shadowToken$ = syntheticToken;
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3876
3896
|
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
) {
|
|
3880
|
-
// this element will now accept any manual content inserted into it
|
|
3881
|
-
observeElementChildNodes(elm);
|
|
3882
|
-
}
|
|
3897
|
+
function applyDomManual(elm, vnode) {
|
|
3898
|
+
var _a;
|
|
3883
3899
|
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3900
|
+
var owner = vnode.owner,
|
|
3901
|
+
context = vnode.data.context;
|
|
3902
|
+
|
|
3903
|
+
if (owner.shadowMode === 1
|
|
3904
|
+
/* ShadowMode.Synthetic */
|
|
3905
|
+
&& ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual"
|
|
3906
|
+
/* LwcDomMode.Manual */
|
|
3907
|
+
) {
|
|
3908
|
+
elm.$domManual$ = true;
|
|
3889
3909
|
}
|
|
3890
3910
|
}
|
|
3891
3911
|
|
|
@@ -3932,19 +3952,6 @@ var LWC = (function (exports) {
|
|
|
3932
3952
|
mode = vnode.mode,
|
|
3933
3953
|
ctor = vnode.ctor,
|
|
3934
3954
|
owner = vnode.owner;
|
|
3935
|
-
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3936
|
-
|
|
3937
|
-
if (owner.shadowMode === 1
|
|
3938
|
-
/* ShadowMode.Synthetic */
|
|
3939
|
-
) {
|
|
3940
|
-
var stylesheetToken = owner.context.stylesheetToken; // when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3941
|
-
// into each element from the template, so they can be styled accordingly.
|
|
3942
|
-
|
|
3943
|
-
if (!isUndefined$1(stylesheetToken)) {
|
|
3944
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
|
|
3948
3955
|
vm = createVM(elm, ctor, renderer, {
|
|
3949
3956
|
mode: mode,
|
|
3950
3957
|
owner: owner,
|
|
@@ -4974,7 +4981,7 @@ var LWC = (function (exports) {
|
|
|
4974
4981
|
}
|
|
4975
4982
|
|
|
4976
4983
|
function getTemplateReactiveObserver(vm) {
|
|
4977
|
-
return
|
|
4984
|
+
return createReactiveObserver(function () {
|
|
4978
4985
|
var isDirty = vm.isDirty;
|
|
4979
4986
|
|
|
4980
4987
|
if (isFalse(isDirty)) {
|
|
@@ -5709,7 +5716,7 @@ var LWC = (function (exports) {
|
|
|
5709
5716
|
function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
|
|
5710
5717
|
var hasPendingConfig = false; // creating the reactive observer for reactive params when needed
|
|
5711
5718
|
|
|
5712
|
-
var ro =
|
|
5719
|
+
var ro = createReactiveObserver(function () {
|
|
5713
5720
|
if (hasPendingConfig === false) {
|
|
5714
5721
|
hasPendingConfig = true; // collect new config in the micro-task
|
|
5715
5722
|
|
|
@@ -6000,7 +6007,7 @@ var LWC = (function (exports) {
|
|
|
6000
6007
|
|
|
6001
6008
|
function readonly(obj) {
|
|
6002
6009
|
|
|
6003
|
-
return
|
|
6010
|
+
return getReadOnlyProxy(obj);
|
|
6004
6011
|
}
|
|
6005
6012
|
/*
|
|
6006
6013
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
@@ -6482,7 +6489,7 @@ var LWC = (function (exports) {
|
|
|
6482
6489
|
|
|
6483
6490
|
return ctor;
|
|
6484
6491
|
}
|
|
6485
|
-
/* version: 2.
|
|
6492
|
+
/* version: 2.22.0 */
|
|
6486
6493
|
|
|
6487
6494
|
/*
|
|
6488
6495
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6641,6 +6648,85 @@ var LWC = (function (exports) {
|
|
|
6641
6648
|
*/
|
|
6642
6649
|
|
|
6643
6650
|
|
|
6651
|
+
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6652
|
+
var createFragment;
|
|
6653
|
+
|
|
6654
|
+
if (SUPPORTS_TEMPLATE) {
|
|
6655
|
+
// Parse the fragment HTML string into DOM
|
|
6656
|
+
createFragment = function createFragment(html) {
|
|
6657
|
+
var template = document.createElement('template');
|
|
6658
|
+
template.innerHTML = html;
|
|
6659
|
+
return template.content.firstChild;
|
|
6660
|
+
};
|
|
6661
|
+
} else {
|
|
6662
|
+
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6663
|
+
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6664
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6665
|
+
// With other elements added from:
|
|
6666
|
+
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6667
|
+
// Using the test:
|
|
6668
|
+
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6669
|
+
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6670
|
+
var topLevelWrappingMap = {
|
|
6671
|
+
caption: ['table'],
|
|
6672
|
+
col: ['colgroup', 'table'],
|
|
6673
|
+
colgroup: ['table'],
|
|
6674
|
+
option: ['select'],
|
|
6675
|
+
tbody: ['table'],
|
|
6676
|
+
td: ['tr', 'tbody', 'table'],
|
|
6677
|
+
th: ['tr', 'tbody', 'table'],
|
|
6678
|
+
thead: ['table'],
|
|
6679
|
+
tfoot: ['table'],
|
|
6680
|
+
tr: ['tbody', 'table']
|
|
6681
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6682
|
+
|
|
6683
|
+
var getTagName = function getTagName(text) {
|
|
6684
|
+
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6685
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6686
|
+
|
|
6687
|
+
|
|
6688
|
+
createFragment = function createFragment(html) {
|
|
6689
|
+
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6690
|
+
|
|
6691
|
+
if (!isUndefined$1(wrapperTags)) {
|
|
6692
|
+
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6693
|
+
_step5;
|
|
6694
|
+
|
|
6695
|
+
try {
|
|
6696
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
6697
|
+
var wrapperTag = _step5.value;
|
|
6698
|
+
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6699
|
+
}
|
|
6700
|
+
} catch (err) {
|
|
6701
|
+
_iterator5.e(err);
|
|
6702
|
+
} finally {
|
|
6703
|
+
_iterator5.f();
|
|
6704
|
+
}
|
|
6705
|
+
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6706
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6707
|
+
|
|
6708
|
+
|
|
6709
|
+
var doc = document.implementation.createHTMLDocument('');
|
|
6710
|
+
doc.body.innerHTML = html;
|
|
6711
|
+
var content = doc.body;
|
|
6712
|
+
|
|
6713
|
+
if (!isUndefined$1(wrapperTags)) {
|
|
6714
|
+
for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
|
|
6715
|
+
content = content.firstChild;
|
|
6716
|
+
}
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6719
|
+
return content.firstChild;
|
|
6720
|
+
};
|
|
6721
|
+
}
|
|
6722
|
+
/*
|
|
6723
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
6724
|
+
* All rights reserved.
|
|
6725
|
+
* SPDX-License-Identifier: MIT
|
|
6726
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6727
|
+
*/
|
|
6728
|
+
|
|
6729
|
+
|
|
6644
6730
|
var getCustomElement;
|
|
6645
6731
|
var defineCustomElement;
|
|
6646
6732
|
var HTMLElementConstructor;
|
|
@@ -6741,10 +6827,6 @@ var LWC = (function (exports) {
|
|
|
6741
6827
|
return node.cloneNode(deep);
|
|
6742
6828
|
}
|
|
6743
6829
|
|
|
6744
|
-
function createFragment(html) {
|
|
6745
|
-
return document.createRange().createContextualFragment(html).firstChild;
|
|
6746
|
-
}
|
|
6747
|
-
|
|
6748
6830
|
function createElement$1(tagName, namespace) {
|
|
6749
6831
|
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6750
6832
|
}
|
|
@@ -6963,8 +7045,8 @@ var LWC = (function (exports) {
|
|
|
6963
7045
|
hydrated: true
|
|
6964
7046
|
});
|
|
6965
7047
|
|
|
6966
|
-
for (var
|
|
6967
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
7048
|
+
for (var _i33 = 0, _Object$entries2 = Object.entries(props); _i33 < _Object$entries2.length; _i33++) {
|
|
7049
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i33], 2),
|
|
6968
7050
|
key = _Object$entries2$_i[0],
|
|
6969
7051
|
value = _Object$entries2$_i[1];
|
|
6970
7052
|
|
|
@@ -7289,7 +7371,7 @@ var LWC = (function (exports) {
|
|
|
7289
7371
|
});
|
|
7290
7372
|
freeze(LightningElement);
|
|
7291
7373
|
seal(LightningElement.prototype);
|
|
7292
|
-
/* version: 2.
|
|
7374
|
+
/* version: 2.22.0 */
|
|
7293
7375
|
|
|
7294
7376
|
exports.LightningElement = LightningElement;
|
|
7295
7377
|
exports.__unstable__ProfilerControl = profilerControl;
|