lwc 2.13.2 → 2.14.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 +339 -113
- package/dist/engine-dom/iife/es2017/engine-dom.js +339 -112
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +185 -107
- package/dist/engine-dom/iife/es5/engine-dom.js +7560 -5747
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +5942 -4572
- package/dist/engine-dom/umd/es2017/engine-dom.js +339 -112
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +185 -107
- package/dist/engine-dom/umd/es5/engine-dom.js +7560 -5747
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +5942 -4572
- package/dist/engine-server/commonjs/es2017/engine-server.js +176 -36
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +176 -37
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4424 -3481
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +4424 -3481
- 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.min.js +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +243 -258
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +243 -258
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +243 -258
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +243 -258
- package/package.json +7 -7
|
@@ -46,7 +46,7 @@ var LWC = (function (exports) {
|
|
|
46
46
|
*/
|
|
47
47
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
48
48
|
const { isArray: isArray$1 } = Array;
|
|
49
|
-
const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
49
|
+
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
50
50
|
const { fromCharCode: StringFromCharCode } = String;
|
|
51
51
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
52
52
|
function isUndefined$1(obj) {
|
|
@@ -290,7 +290,7 @@ var LWC = (function (exports) {
|
|
|
290
290
|
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
291
291
|
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
292
292
|
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
293
|
-
/** version: 2.
|
|
293
|
+
/** version: 2.14.0 */
|
|
294
294
|
|
|
295
295
|
/*
|
|
296
296
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -380,6 +380,7 @@ var LWC = (function (exports) {
|
|
|
380
380
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
381
381
|
*/
|
|
382
382
|
const features = {
|
|
383
|
+
DUMMY_TEST_FLAG: null,
|
|
383
384
|
ENABLE_ELEMENT_PATCH: null,
|
|
384
385
|
ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
|
|
385
386
|
ENABLE_HMR: null,
|
|
@@ -433,9 +434,6 @@ var LWC = (function (exports) {
|
|
|
433
434
|
*/
|
|
434
435
|
function setFeatureFlagForTest(name, value) {
|
|
435
436
|
}
|
|
436
|
-
/** version: 2.13.2 */
|
|
437
|
-
|
|
438
|
-
/* proxy-compat-disable */
|
|
439
437
|
|
|
440
438
|
/*
|
|
441
439
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -515,10 +513,6 @@ var LWC = (function (exports) {
|
|
|
515
513
|
function setHTMLElement(HTMLElementImpl) {
|
|
516
514
|
HTMLElementExported$1 = HTMLElementImpl;
|
|
517
515
|
}
|
|
518
|
-
let isHydrating$1;
|
|
519
|
-
function setIsHydrating$1(isHydratingImpl) {
|
|
520
|
-
isHydrating$1 = isHydratingImpl;
|
|
521
|
-
}
|
|
522
516
|
let insert$1;
|
|
523
517
|
function setInsert(insertImpl) {
|
|
524
518
|
insert$1 = insertImpl;
|
|
@@ -639,10 +633,6 @@ var LWC = (function (exports) {
|
|
|
639
633
|
function setIsConnected(isConnectedImpl) {
|
|
640
634
|
isConnected$1 = isConnectedImpl;
|
|
641
635
|
}
|
|
642
|
-
let insertGlobalStylesheet$1;
|
|
643
|
-
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
644
|
-
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
645
|
-
}
|
|
646
636
|
let insertStylesheet$1;
|
|
647
637
|
function setInsertStylesheet(insertStylesheetImpl) {
|
|
648
638
|
insertStylesheet$1 = insertStylesheetImpl;
|
|
@@ -2051,6 +2041,12 @@ var LWC = (function (exports) {
|
|
|
2051
2041
|
return isUndefined$1(meta) ? defaultMeta : meta;
|
|
2052
2042
|
}
|
|
2053
2043
|
|
|
2044
|
+
/*
|
|
2045
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2046
|
+
* All rights reserved.
|
|
2047
|
+
* SPDX-License-Identifier: MIT
|
|
2048
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2049
|
+
*/
|
|
2054
2050
|
const signedTemplateSet = new Set();
|
|
2055
2051
|
function defaultEmptyTemplate() {
|
|
2056
2052
|
return [];
|
|
@@ -2065,6 +2061,32 @@ var LWC = (function (exports) {
|
|
|
2065
2061
|
*/
|
|
2066
2062
|
function registerTemplate(tpl) {
|
|
2067
2063
|
signedTemplateSet.add(tpl);
|
|
2064
|
+
// FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
|
|
2065
|
+
// the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
|
|
2066
|
+
// on top of stylesheetToken for anyone who is accessing the old internal API.
|
|
2067
|
+
// Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
2068
|
+
defineProperty(tpl, 'stylesheetTokens', {
|
|
2069
|
+
enumerable: true,
|
|
2070
|
+
configurable: true,
|
|
2071
|
+
get() {
|
|
2072
|
+
const { stylesheetToken } = this;
|
|
2073
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
2074
|
+
return stylesheetToken;
|
|
2075
|
+
}
|
|
2076
|
+
// Shim for the old `stylesheetTokens` property
|
|
2077
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
2078
|
+
return {
|
|
2079
|
+
hostAttribute: `${stylesheetToken}-host`,
|
|
2080
|
+
shadowAttribute: stylesheetToken,
|
|
2081
|
+
};
|
|
2082
|
+
},
|
|
2083
|
+
set(value) {
|
|
2084
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
2085
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
2086
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
2087
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
2088
|
+
},
|
|
2089
|
+
});
|
|
2068
2090
|
// chaining this method as a way to wrap existing
|
|
2069
2091
|
// assignment of templates easily, without too much transformation
|
|
2070
2092
|
return tpl;
|
|
@@ -2838,15 +2860,16 @@ var LWC = (function (exports) {
|
|
|
2838
2860
|
}
|
|
2839
2861
|
}
|
|
2840
2862
|
function unmount(vnode, parent, doRemove = false) {
|
|
2841
|
-
const { type, elm } = vnode;
|
|
2863
|
+
const { type, elm, sel } = vnode;
|
|
2842
2864
|
// When unmounting a VNode subtree not all the elements have to removed from the DOM. The
|
|
2843
2865
|
// subtree root, is the only element worth unmounting from the subtree.
|
|
2844
2866
|
if (doRemove) {
|
|
2845
2867
|
removeNode(elm, parent);
|
|
2846
2868
|
}
|
|
2869
|
+
const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
|
|
2847
2870
|
switch (type) {
|
|
2848
2871
|
case 2 /* Element */:
|
|
2849
|
-
unmountVNodes(vnode.children, elm);
|
|
2872
|
+
unmountVNodes(vnode.children, elm, removeChildren);
|
|
2850
2873
|
break;
|
|
2851
2874
|
case 3 /* CustomElement */: {
|
|
2852
2875
|
const { vm } = vnode;
|
|
@@ -3614,10 +3637,10 @@ var LWC = (function (exports) {
|
|
|
3614
3637
|
const { renderMode, shadowMode } = vm;
|
|
3615
3638
|
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
3616
3639
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3617
|
-
|
|
3640
|
+
insertStylesheet$1(stylesheets[i]);
|
|
3618
3641
|
}
|
|
3619
3642
|
}
|
|
3620
|
-
else if (ssr$1 ||
|
|
3643
|
+
else if (ssr$1 || vm.hydrated) {
|
|
3621
3644
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3622
3645
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3623
3646
|
// the first time the VM renders.
|
|
@@ -3628,15 +3651,10 @@ var LWC = (function (exports) {
|
|
|
3628
3651
|
else {
|
|
3629
3652
|
// native shadow or light DOM, DOM renderer
|
|
3630
3653
|
const root = getNearestNativeShadowComponent(vm);
|
|
3631
|
-
|
|
3654
|
+
// null root means a global style
|
|
3655
|
+
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
3632
3656
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3633
|
-
|
|
3634
|
-
insertGlobalStylesheet$1(stylesheets[i]);
|
|
3635
|
-
}
|
|
3636
|
-
else {
|
|
3637
|
-
// local level
|
|
3638
|
-
insertStylesheet$1(stylesheets[i], root.shadowRoot);
|
|
3639
|
-
}
|
|
3657
|
+
insertStylesheet$1(stylesheets[i], target);
|
|
3640
3658
|
}
|
|
3641
3659
|
}
|
|
3642
3660
|
return null;
|
|
@@ -4041,7 +4059,8 @@ var LWC = (function (exports) {
|
|
|
4041
4059
|
const {
|
|
4042
4060
|
mode,
|
|
4043
4061
|
owner,
|
|
4044
|
-
tagName
|
|
4062
|
+
tagName,
|
|
4063
|
+
hydrated
|
|
4045
4064
|
} = options;
|
|
4046
4065
|
const def = getComponentInternalDef(ctor);
|
|
4047
4066
|
const vm = {
|
|
@@ -4064,6 +4083,7 @@ var LWC = (function (exports) {
|
|
|
4064
4083
|
cmpSlots: create(null),
|
|
4065
4084
|
oar: create(null),
|
|
4066
4085
|
cmpTemplate: null,
|
|
4086
|
+
hydrated: Boolean(hydrated),
|
|
4067
4087
|
renderMode: def.renderMode,
|
|
4068
4088
|
shadowMode: computeShadowMode(def, owner),
|
|
4069
4089
|
nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
|
|
@@ -4957,6 +4977,7 @@ var LWC = (function (exports) {
|
|
|
4957
4977
|
mode,
|
|
4958
4978
|
owner,
|
|
4959
4979
|
tagName: sel,
|
|
4980
|
+
hydrated: true,
|
|
4960
4981
|
});
|
|
4961
4982
|
vnode.elm = elm;
|
|
4962
4983
|
vnode.vm = vm;
|
|
@@ -5106,6 +5127,10 @@ var LWC = (function (exports) {
|
|
|
5106
5127
|
hooksAreSet = true;
|
|
5107
5128
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5108
5129
|
}
|
|
5130
|
+
// TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
|
|
5131
|
+
// just warns on mutation.
|
|
5132
|
+
function freezeTemplate(tmpl) {
|
|
5133
|
+
}
|
|
5109
5134
|
|
|
5110
5135
|
/*
|
|
5111
5136
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5129,7 +5154,7 @@ var LWC = (function (exports) {
|
|
|
5129
5154
|
}
|
|
5130
5155
|
return ctor;
|
|
5131
5156
|
}
|
|
5132
|
-
/* version: 2.
|
|
5157
|
+
/* version: 2.14.0 */
|
|
5133
5158
|
|
|
5134
5159
|
/*
|
|
5135
5160
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5137,17 +5162,138 @@ var LWC = (function (exports) {
|
|
|
5137
5162
|
* SPDX-License-Identifier: MIT
|
|
5138
5163
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5139
5164
|
*/
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
//
|
|
5165
|
+
//
|
|
5166
|
+
// Feature detection
|
|
5167
|
+
//
|
|
5168
|
+
// This check for constructable style sheets is similar to Fast's:
|
|
5143
5169
|
// https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
|
|
5144
5170
|
// See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
|
|
5145
|
-
const
|
|
5146
|
-
|
|
5171
|
+
const supportsConstructableStylesheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
|
|
5172
|
+
// The original adoptedStylesheet proposal used a frozen array. A follow-up proposal made the array mutable.
|
|
5173
|
+
// Chromium 99+ and Firefox 101+ support mutable arrays. We check if the array is mutable, to ensure backward compat.
|
|
5174
|
+
// (If the length is writable, then the array is mutable.) See: https://chromestatus.com/feature/5638996492288000
|
|
5175
|
+
// TODO [#2828]: Re-evaluate this in the future once we drop support for older browser versions.
|
|
5176
|
+
const supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets &&
|
|
5147
5177
|
getOwnPropertyDescriptor$1(document.adoptedStyleSheets, 'length').writable;
|
|
5148
|
-
|
|
5149
|
-
const
|
|
5150
|
-
const
|
|
5178
|
+
// Detect IE, via https://stackoverflow.com/a/9851769
|
|
5179
|
+
const isIE11 = !isUndefined$1(document.documentMode);
|
|
5180
|
+
const stylesheetCache = new Map();
|
|
5181
|
+
function isDocument(target) {
|
|
5182
|
+
return !isUndefined$1(target.head);
|
|
5183
|
+
}
|
|
5184
|
+
function createFreshStyleElement(content) {
|
|
5185
|
+
const elm = document.createElement('style');
|
|
5186
|
+
elm.type = 'text/css';
|
|
5187
|
+
elm.textContent = content;
|
|
5188
|
+
return elm;
|
|
5189
|
+
}
|
|
5190
|
+
function createStyleElement(content, cacheData) {
|
|
5191
|
+
const { stylesheet, used } = cacheData;
|
|
5192
|
+
// If the <style> was already used, then we should clone it. We cannot insert
|
|
5193
|
+
// the same <style> in two places in the DOM.
|
|
5194
|
+
if (used) {
|
|
5195
|
+
// For a mysterious reason, IE11 doesn't like the way we clone <style> nodes
|
|
5196
|
+
// and will render the incorrect styles if we do things that way. It's just
|
|
5197
|
+
// a perf optimization, so we can skip it for IE11.
|
|
5198
|
+
if (isIE11) {
|
|
5199
|
+
return createFreshStyleElement(content);
|
|
5200
|
+
}
|
|
5201
|
+
// This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
|
|
5202
|
+
// faster to call `cloneNode()` on an existing node than to recreate it every time.
|
|
5203
|
+
return stylesheet.cloneNode(true);
|
|
5204
|
+
}
|
|
5205
|
+
// We don't clone every time, because that would be a perf tax on the first time
|
|
5206
|
+
cacheData.used = true;
|
|
5207
|
+
return stylesheet;
|
|
5208
|
+
}
|
|
5209
|
+
function createConstructableStylesheet(content) {
|
|
5210
|
+
const stylesheet = new CSSStyleSheet();
|
|
5211
|
+
stylesheet.replaceSync(content);
|
|
5212
|
+
return stylesheet;
|
|
5213
|
+
}
|
|
5214
|
+
function insertConstructableStylesheet(content, target, cacheData) {
|
|
5215
|
+
const { adoptedStyleSheets } = target;
|
|
5216
|
+
const { stylesheet } = cacheData;
|
|
5217
|
+
// Mutable adopted stylesheets are only supported in certain browsers.
|
|
5218
|
+
// The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2683
|
|
5219
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
5220
|
+
adoptedStyleSheets.push(stylesheet);
|
|
5221
|
+
}
|
|
5222
|
+
else {
|
|
5223
|
+
target.adoptedStyleSheets = [...adoptedStyleSheets, stylesheet];
|
|
5224
|
+
}
|
|
5225
|
+
}
|
|
5226
|
+
function insertStyleElement(content, target, cacheData) {
|
|
5227
|
+
const elm = createStyleElement(content, cacheData);
|
|
5228
|
+
const targetAnchorPoint = isDocument(target) ? target.head : target;
|
|
5229
|
+
targetAnchorPoint.appendChild(elm);
|
|
5230
|
+
}
|
|
5231
|
+
function doInsertStylesheet(content, target, cacheData) {
|
|
5232
|
+
// Constructable stylesheets are only supported in certain browsers:
|
|
5233
|
+
// https://caniuse.com/mdn-api_document_adoptedstylesheets
|
|
5234
|
+
// The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2460
|
|
5235
|
+
if (supportsConstructableStylesheets) {
|
|
5236
|
+
insertConstructableStylesheet(content, target, cacheData);
|
|
5237
|
+
}
|
|
5238
|
+
else {
|
|
5239
|
+
// Fall back to <style> element
|
|
5240
|
+
insertStyleElement(content, target, cacheData);
|
|
5241
|
+
}
|
|
5242
|
+
}
|
|
5243
|
+
function getCacheData(content) {
|
|
5244
|
+
let cacheData = stylesheetCache.get(content);
|
|
5245
|
+
if (isUndefined$1(cacheData)) {
|
|
5246
|
+
cacheData = {
|
|
5247
|
+
stylesheet: supportsConstructableStylesheets
|
|
5248
|
+
? createConstructableStylesheet(content)
|
|
5249
|
+
: createFreshStyleElement(content),
|
|
5250
|
+
roots: undefined,
|
|
5251
|
+
global: false,
|
|
5252
|
+
used: false,
|
|
5253
|
+
};
|
|
5254
|
+
stylesheetCache.set(content, cacheData);
|
|
5255
|
+
}
|
|
5256
|
+
return cacheData;
|
|
5257
|
+
}
|
|
5258
|
+
function insertGlobalStylesheet(content) {
|
|
5259
|
+
const cacheData = getCacheData(content);
|
|
5260
|
+
if (cacheData.global) {
|
|
5261
|
+
// already inserted
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
cacheData.global = true; // mark inserted
|
|
5265
|
+
doInsertStylesheet(content, document, cacheData);
|
|
5266
|
+
}
|
|
5267
|
+
function insertLocalStylesheet(content, target) {
|
|
5268
|
+
const cacheData = getCacheData(content);
|
|
5269
|
+
let { roots } = cacheData;
|
|
5270
|
+
if (isUndefined$1(roots)) {
|
|
5271
|
+
roots = cacheData.roots = new WeakSet(); // lazily initialize (not needed for global styles)
|
|
5272
|
+
}
|
|
5273
|
+
else if (roots.has(target)) {
|
|
5274
|
+
// already inserted
|
|
5275
|
+
return;
|
|
5276
|
+
}
|
|
5277
|
+
roots.add(target); // mark inserted
|
|
5278
|
+
doInsertStylesheet(content, target, cacheData);
|
|
5279
|
+
}
|
|
5280
|
+
function insertStylesheet(content, target) {
|
|
5281
|
+
if (isUndefined$1(target)) {
|
|
5282
|
+
// global
|
|
5283
|
+
insertGlobalStylesheet(content);
|
|
5284
|
+
}
|
|
5285
|
+
else {
|
|
5286
|
+
// local
|
|
5287
|
+
insertLocalStylesheet(content, target);
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
5290
|
+
|
|
5291
|
+
/*
|
|
5292
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5293
|
+
* All rights reserved.
|
|
5294
|
+
* SPDX-License-Identifier: MIT
|
|
5295
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5296
|
+
*/
|
|
5151
5297
|
let getCustomElement;
|
|
5152
5298
|
let defineCustomElement;
|
|
5153
5299
|
let HTMLElementConstructor;
|
|
@@ -5174,52 +5320,6 @@ var LWC = (function (exports) {
|
|
|
5174
5320
|
return false;
|
|
5175
5321
|
}
|
|
5176
5322
|
}
|
|
5177
|
-
function insertConstructableStyleSheet(content, target) {
|
|
5178
|
-
// It's important for CSSStyleSheets to be unique based on their content, so that
|
|
5179
|
-
// `shadowRoot.adoptedStyleSheets.includes(sheet)` works.
|
|
5180
|
-
let styleSheet = styleSheets[content];
|
|
5181
|
-
if (isUndefined$1(styleSheet)) {
|
|
5182
|
-
styleSheet = new CSSStyleSheet();
|
|
5183
|
-
styleSheet.replaceSync(content);
|
|
5184
|
-
styleSheets[content] = styleSheet;
|
|
5185
|
-
}
|
|
5186
|
-
const { adoptedStyleSheets } = target;
|
|
5187
|
-
if (!adoptedStyleSheets.includes(styleSheet)) {
|
|
5188
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
5189
|
-
// This is only supported in later versions of Chromium:
|
|
5190
|
-
// https://chromestatus.com/feature/5638996492288000
|
|
5191
|
-
adoptedStyleSheets.push(styleSheet);
|
|
5192
|
-
}
|
|
5193
|
-
else {
|
|
5194
|
-
target.adoptedStyleSheets = [...adoptedStyleSheets, styleSheet];
|
|
5195
|
-
}
|
|
5196
|
-
}
|
|
5197
|
-
}
|
|
5198
|
-
function insertStyleElement(content, target) {
|
|
5199
|
-
// Avoid inserting duplicate `<style>`s
|
|
5200
|
-
let sheets = shadowRootsToStyleSheets.get(target);
|
|
5201
|
-
if (isUndefined$1(sheets)) {
|
|
5202
|
-
sheets = create(null);
|
|
5203
|
-
shadowRootsToStyleSheets.set(target, sheets);
|
|
5204
|
-
}
|
|
5205
|
-
if (sheets[content]) {
|
|
5206
|
-
return;
|
|
5207
|
-
}
|
|
5208
|
-
sheets[content] = true;
|
|
5209
|
-
// This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
|
|
5210
|
-
// faster to call `cloneNode()` on an existing node than to recreate it every time.
|
|
5211
|
-
let elm = styleElements[content];
|
|
5212
|
-
if (isUndefined$1(elm)) {
|
|
5213
|
-
elm = document.createElement('style');
|
|
5214
|
-
elm.type = 'text/css';
|
|
5215
|
-
elm.textContent = content;
|
|
5216
|
-
styleElements[content] = elm;
|
|
5217
|
-
}
|
|
5218
|
-
else {
|
|
5219
|
-
elm = elm.cloneNode(true);
|
|
5220
|
-
}
|
|
5221
|
-
target.appendChild(elm);
|
|
5222
|
-
}
|
|
5223
5323
|
if (isCustomElementRegistryAvailable()) {
|
|
5224
5324
|
getCustomElement = customElements.get.bind(customElements);
|
|
5225
5325
|
defineCustomElement = customElements.define.bind(customElements);
|
|
@@ -5258,9 +5358,6 @@ var LWC = (function (exports) {
|
|
|
5258
5358
|
hydrating = value;
|
|
5259
5359
|
}
|
|
5260
5360
|
const ssr = false;
|
|
5261
|
-
function isHydrating() {
|
|
5262
|
-
return hydrating;
|
|
5263
|
-
}
|
|
5264
5361
|
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
5265
5362
|
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
5266
5363
|
function createElement$1(tagName, namespace) {
|
|
@@ -5369,25 +5466,6 @@ var LWC = (function (exports) {
|
|
|
5369
5466
|
function isConnected(node) {
|
|
5370
5467
|
return node.isConnected;
|
|
5371
5468
|
}
|
|
5372
|
-
function insertGlobalStylesheet(content) {
|
|
5373
|
-
if (!isUndefined$1(globalStylesheets[content])) {
|
|
5374
|
-
return;
|
|
5375
|
-
}
|
|
5376
|
-
globalStylesheets[content] = true;
|
|
5377
|
-
const elm = document.createElement('style');
|
|
5378
|
-
elm.type = 'text/css';
|
|
5379
|
-
elm.textContent = content;
|
|
5380
|
-
globalStylesheetsParentElement.appendChild(elm);
|
|
5381
|
-
}
|
|
5382
|
-
function insertStylesheet(content, target) {
|
|
5383
|
-
if (supportsConstructableStyleSheets) {
|
|
5384
|
-
insertConstructableStyleSheet(content, target);
|
|
5385
|
-
}
|
|
5386
|
-
else {
|
|
5387
|
-
// Fall back to <style> element
|
|
5388
|
-
insertStyleElement(content, target);
|
|
5389
|
-
}
|
|
5390
|
-
}
|
|
5391
5469
|
const HTMLElementExported = HTMLElementConstructor;
|
|
5392
5470
|
setAttachShadow(attachShadow);
|
|
5393
5471
|
setCreateComment(createComment);
|
|
@@ -5410,10 +5488,7 @@ var LWC = (function (exports) {
|
|
|
5410
5488
|
setGetProperty(getProperty);
|
|
5411
5489
|
setHTMLElement(HTMLElementExported);
|
|
5412
5490
|
setInsert(insert);
|
|
5413
|
-
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
5414
|
-
setInsertStylesheet(insertStylesheet);
|
|
5415
5491
|
setIsConnected(isConnected);
|
|
5416
|
-
setIsHydrating$1(isHydrating);
|
|
5417
5492
|
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
5418
5493
|
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
5419
5494
|
setNextSibling(nextSibling);
|
|
@@ -5428,6 +5503,7 @@ var LWC = (function (exports) {
|
|
|
5428
5503
|
setSetText(setText);
|
|
5429
5504
|
setSsr(ssr);
|
|
5430
5505
|
setAddEventListener(addEventListener);
|
|
5506
|
+
setInsertStylesheet(insertStylesheet);
|
|
5431
5507
|
|
|
5432
5508
|
/*
|
|
5433
5509
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5453,6 +5529,7 @@ var LWC = (function (exports) {
|
|
|
5453
5529
|
mode: 'open',
|
|
5454
5530
|
owner: null,
|
|
5455
5531
|
tagName: element.tagName.toLowerCase(),
|
|
5532
|
+
hydrated: true,
|
|
5456
5533
|
});
|
|
5457
5534
|
for (const [key, value] of Object.entries(props)) {
|
|
5458
5535
|
element[key] = value;
|
|
@@ -5715,7 +5792,7 @@ var LWC = (function (exports) {
|
|
|
5715
5792
|
});
|
|
5716
5793
|
freeze(LightningElement);
|
|
5717
5794
|
seal(LightningElement.prototype);
|
|
5718
|
-
/* version: 2.
|
|
5795
|
+
/* version: 2.14.0 */
|
|
5719
5796
|
|
|
5720
5797
|
exports.LightningElement = LightningElement;
|
|
5721
5798
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -5723,6 +5800,7 @@ var LWC = (function (exports) {
|
|
|
5723
5800
|
exports.buildCustomElementConstructor = deprecatedBuildCustomElementConstructor;
|
|
5724
5801
|
exports.createContextProvider = createContextProvider;
|
|
5725
5802
|
exports.createElement = createElement;
|
|
5803
|
+
exports.freezeTemplate = freezeTemplate;
|
|
5726
5804
|
exports.getComponentConstructor = getComponentConstructor;
|
|
5727
5805
|
exports.getComponentDef = getComponentDef;
|
|
5728
5806
|
exports.hydrateComponent = hydrateComponent;
|