lwc 2.45.0 → 2.45.2
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 +158 -83
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +158 -83
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +75 -18
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +162 -79
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +83 -16
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +158 -83
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +75 -18
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +162 -79
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +83 -16
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +102 -75
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +102 -75
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -90,8 +90,10 @@
|
|
|
90
90
|
var isArray$1 = Array.isArray;
|
|
91
91
|
var _Array$prototype = Array.prototype,
|
|
92
92
|
ArrayCopyWithin = _Array$prototype.copyWithin,
|
|
93
|
+
ArrayEvery = _Array$prototype.every,
|
|
93
94
|
ArrayFill = _Array$prototype.fill,
|
|
94
95
|
ArrayFilter = _Array$prototype.filter,
|
|
96
|
+
ArrayIncludes = _Array$prototype.includes,
|
|
95
97
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
96
98
|
ArrayJoin = _Array$prototype.join,
|
|
97
99
|
ArrayMap = _Array$prototype.map,
|
|
@@ -105,6 +107,15 @@
|
|
|
105
107
|
ArraySplice = _Array$prototype.splice,
|
|
106
108
|
ArrayUnshift = _Array$prototype.unshift,
|
|
107
109
|
forEach = _Array$prototype.forEach;
|
|
110
|
+
// The type of the return value of Array.prototype.every is `this is T[]`. However, once this
|
|
111
|
+
// Array method is pulled out of the prototype, the function is now referencing `this` where
|
|
112
|
+
// `this` is meaningless, resulting in a TypeScript compilation error.
|
|
113
|
+
//
|
|
114
|
+
// Exposing this helper function is the closest we can get to preserving the usage patterns
|
|
115
|
+
// of Array.prototype methods used elsewhere in the codebase.
|
|
116
|
+
function arrayEvery(arr, predicate) {
|
|
117
|
+
return ArrayEvery.call(arr, predicate);
|
|
118
|
+
}
|
|
108
119
|
var StringFromCharCode = String.fromCharCode;
|
|
109
120
|
var _String$prototype = String.prototype,
|
|
110
121
|
StringCharCodeAt = _String$prototype.charCodeAt,
|
|
@@ -330,9 +341,9 @@
|
|
|
330
341
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
331
342
|
*/
|
|
332
343
|
// Increment whenever the LWC template compiler changes
|
|
333
|
-
var LWC_VERSION = "2.45.
|
|
344
|
+
var LWC_VERSION = "2.45.2";
|
|
334
345
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
335
|
-
/** version: 2.45.
|
|
346
|
+
/** version: 2.45.2 */
|
|
336
347
|
|
|
337
348
|
/**
|
|
338
349
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -412,7 +423,7 @@
|
|
|
412
423
|
setFeatureFlag(name, value);
|
|
413
424
|
}
|
|
414
425
|
}
|
|
415
|
-
/** version: 2.45.
|
|
426
|
+
/** version: 2.45.2 */
|
|
416
427
|
|
|
417
428
|
/**
|
|
418
429
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -476,7 +487,7 @@
|
|
|
476
487
|
}
|
|
477
488
|
}
|
|
478
489
|
}
|
|
479
|
-
/** version: 2.45.
|
|
490
|
+
/** version: 2.45.2 */
|
|
480
491
|
|
|
481
492
|
/*
|
|
482
493
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1027,8 +1038,9 @@
|
|
|
1027
1038
|
get: function get() {
|
|
1028
1039
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
1029
1040
|
},
|
|
1030
|
-
set: function set(
|
|
1031
|
-
|
|
1041
|
+
set: function set(value) {
|
|
1042
|
+
logError("Invalid attempt to set outerHTML on Element.");
|
|
1043
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
1032
1044
|
}
|
|
1033
1045
|
})
|
|
1034
1046
|
};
|
|
@@ -1116,16 +1128,18 @@
|
|
|
1116
1128
|
get: function get() {
|
|
1117
1129
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1118
1130
|
},
|
|
1119
|
-
set: function set(
|
|
1120
|
-
|
|
1131
|
+
set: function set(value) {
|
|
1132
|
+
logError("Invalid attempt to set innerHTML on ShadowRoot.");
|
|
1133
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1121
1134
|
}
|
|
1122
1135
|
}),
|
|
1123
1136
|
textContent: generateAccessorDescriptor({
|
|
1124
1137
|
get: function get() {
|
|
1125
1138
|
return originalTextContentDescriptor.get.call(this);
|
|
1126
1139
|
},
|
|
1127
|
-
set: function set(
|
|
1128
|
-
|
|
1140
|
+
set: function set(value) {
|
|
1141
|
+
logError("Invalid attempt to set textContent on ShadowRoot.");
|
|
1142
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1129
1143
|
}
|
|
1130
1144
|
}),
|
|
1131
1145
|
addEventListener: generateDataDescriptor({
|
|
@@ -1154,24 +1168,27 @@
|
|
|
1154
1168
|
get: function get() {
|
|
1155
1169
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1156
1170
|
},
|
|
1157
|
-
set: function set(
|
|
1158
|
-
|
|
1171
|
+
set: function set(value) {
|
|
1172
|
+
logError("Invalid attempt to set innerHTML on HTMLElement.");
|
|
1173
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1159
1174
|
}
|
|
1160
1175
|
}),
|
|
1161
1176
|
outerHTML: generateAccessorDescriptor({
|
|
1162
1177
|
get: function get() {
|
|
1163
1178
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
1164
1179
|
},
|
|
1165
|
-
set: function set(
|
|
1166
|
-
|
|
1180
|
+
set: function set(value) {
|
|
1181
|
+
logError("Invalid attempt to set outerHTML on HTMLElement.");
|
|
1182
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
1167
1183
|
}
|
|
1168
1184
|
}),
|
|
1169
1185
|
textContent: generateAccessorDescriptor({
|
|
1170
1186
|
get: function get() {
|
|
1171
1187
|
return originalTextContentDescriptor.get.call(this);
|
|
1172
1188
|
},
|
|
1173
|
-
set: function set(
|
|
1174
|
-
|
|
1189
|
+
set: function set(value) {
|
|
1190
|
+
logError("Invalid attempt to set textContent on HTMLElement.");
|
|
1191
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1175
1192
|
}
|
|
1176
1193
|
}),
|
|
1177
1194
|
addEventListener: generateDataDescriptor({
|
|
@@ -1187,19 +1204,6 @@
|
|
|
1187
1204
|
})
|
|
1188
1205
|
};
|
|
1189
1206
|
}
|
|
1190
|
-
function getComponentRestrictionsDescriptors() {
|
|
1191
|
-
assertNotProd(); // this method should never leak to prod
|
|
1192
|
-
return {
|
|
1193
|
-
tagName: generateAccessorDescriptor({
|
|
1194
|
-
get: function get() {
|
|
1195
|
-
throw new Error("Usage of property `tagName` is disallowed because the component itself does" + " not know which tagName will be used to create the element, therefore writing" + " code that check for that value is error prone.");
|
|
1196
|
-
},
|
|
1197
|
-
configurable: true,
|
|
1198
|
-
enumerable: false // no enumerable properties on component
|
|
1199
|
-
})
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
1207
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1204
1208
|
assertNotProd(); // this method should never leak to prod
|
|
1205
1209
|
var originalDispatchEvent = proto.dispatchEvent;
|
|
@@ -1230,9 +1234,6 @@
|
|
|
1230
1234
|
var elmProto = getPrototypeOf$1(elm);
|
|
1231
1235
|
setPrototypeOf(elm, create(elmProto, restrictionsDescriptors));
|
|
1232
1236
|
}
|
|
1233
|
-
function patchComponentWithRestrictions(cmp) {
|
|
1234
|
-
defineProperties(cmp, getComponentRestrictionsDescriptors());
|
|
1235
|
-
}
|
|
1236
1237
|
function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
1237
1238
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1238
1239
|
}
|
|
@@ -1961,16 +1962,10 @@
|
|
|
1961
1962
|
enumerable = descriptor.enumerable,
|
|
1962
1963
|
configurable = descriptor.configurable;
|
|
1963
1964
|
if (!isFunction$1(_get)) {
|
|
1964
|
-
|
|
1965
|
-
assert.fail("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard getter."));
|
|
1966
|
-
}
|
|
1967
|
-
throw new TypeError();
|
|
1965
|
+
throw new TypeError("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard getter."));
|
|
1968
1966
|
}
|
|
1969
1967
|
if (!isFunction$1(_set)) {
|
|
1970
|
-
|
|
1971
|
-
assert.fail("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard setter."));
|
|
1972
|
-
}
|
|
1973
|
-
throw new TypeError();
|
|
1968
|
+
throw new TypeError("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard setter."));
|
|
1974
1969
|
}
|
|
1975
1970
|
return {
|
|
1976
1971
|
enumerable: enumerable,
|
|
@@ -1990,10 +1985,18 @@
|
|
|
1990
1985
|
var vm = getAssociatedVM(this);
|
|
1991
1986
|
if (process.env.NODE_ENV !== 'production') {
|
|
1992
1987
|
var _vmBeingRendered = getVMBeingRendered();
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1988
|
+
if (isInvokingRender) {
|
|
1989
|
+
logError("".concat(_vmBeingRendered, ".render() method has side effects on the state of ").concat(vm, ".").concat(propName));
|
|
1990
|
+
}
|
|
1991
|
+
if (isUpdatingTemplate) {
|
|
1992
|
+
logError("When updating the template of ".concat(_vmBeingRendered, ", one of the accessors used by the template has side effects on the state of ").concat(vm, ".").concat(propName));
|
|
1993
|
+
}
|
|
1994
|
+
if (isBeingConstructed(vm)) {
|
|
1995
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
1996
|
+
}
|
|
1997
|
+
if (isObject(newValue) && !isNull(newValue)) {
|
|
1998
|
+
logError("Invalid value \"".concat(newValue, "\" for \"").concat(propName, "\" of ").concat(vm, ". Value cannot be an object, must be a primitive value."));
|
|
1999
|
+
}
|
|
1997
2000
|
}
|
|
1998
2001
|
updateComponentValue(vm, propName, newValue);
|
|
1999
2002
|
return _set.call(vm.elm, newValue);
|
|
@@ -2049,7 +2052,6 @@
|
|
|
2049
2052
|
// Adding extra guard rails in DEV mode.
|
|
2050
2053
|
if (process.env.NODE_ENV !== 'production') {
|
|
2051
2054
|
patchCustomElementWithRestrictions(elm);
|
|
2052
|
-
patchComponentWithRestrictions(component);
|
|
2053
2055
|
}
|
|
2054
2056
|
return this;
|
|
2055
2057
|
};
|
|
@@ -2088,9 +2090,15 @@
|
|
|
2088
2090
|
addEventListener = vm.renderer.addEventListener;
|
|
2089
2091
|
if (process.env.NODE_ENV !== 'production') {
|
|
2090
2092
|
var _vmBeingRendered2 = getVMBeingRendered();
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2093
|
+
if (isInvokingRender) {
|
|
2094
|
+
logError("".concat(_vmBeingRendered2, ".render() method has side effects on the state of ").concat(vm, " by adding an event listener for \"").concat(type, "\"."));
|
|
2095
|
+
}
|
|
2096
|
+
if (isUpdatingTemplate) {
|
|
2097
|
+
logError("Updating the template of ".concat(_vmBeingRendered2, " has side effects on the state of ").concat(vm, " by adding an event listener for \"").concat(type, "\"."));
|
|
2098
|
+
}
|
|
2099
|
+
if (!isFunction$1(listener)) {
|
|
2100
|
+
logError("Invalid second argument for this.addEventListener() in ".concat(vm, " for event \"").concat(type, "\". Expected an EventListener but received ").concat(listener, "."));
|
|
2101
|
+
}
|
|
2094
2102
|
}
|
|
2095
2103
|
var wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2096
2104
|
addEventListener(elm, type, wrappedListener, options);
|
|
@@ -2147,7 +2155,9 @@
|
|
|
2147
2155
|
var elm = vm.elm,
|
|
2148
2156
|
setAttribute = vm.renderer.setAttribute;
|
|
2149
2157
|
if (process.env.NODE_ENV !== 'production') {
|
|
2150
|
-
|
|
2158
|
+
if (isBeingConstructed(vm)) {
|
|
2159
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
2160
|
+
}
|
|
2151
2161
|
}
|
|
2152
2162
|
unlockAttribute(elm, name);
|
|
2153
2163
|
setAttribute(elm, name, value);
|
|
@@ -2158,7 +2168,9 @@
|
|
|
2158
2168
|
var elm = vm.elm,
|
|
2159
2169
|
setAttribute = vm.renderer.setAttribute;
|
|
2160
2170
|
if (process.env.NODE_ENV !== 'production') {
|
|
2161
|
-
|
|
2171
|
+
if (isBeingConstructed(vm)) {
|
|
2172
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
2173
|
+
}
|
|
2162
2174
|
}
|
|
2163
2175
|
unlockAttribute(elm, name);
|
|
2164
2176
|
setAttribute(elm, name, value, namespace);
|
|
@@ -2184,9 +2196,9 @@
|
|
|
2184
2196
|
var elm = vm.elm,
|
|
2185
2197
|
getClassList = vm.renderer.getClassList;
|
|
2186
2198
|
if (process.env.NODE_ENV !== 'production') {
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2199
|
+
if (isBeingConstructed(vm)) {
|
|
2200
|
+
logError("Failed to construct ".concat(vm, ": The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead."));
|
|
2201
|
+
}
|
|
2190
2202
|
}
|
|
2191
2203
|
return getClassList(elm);
|
|
2192
2204
|
},
|
|
@@ -2718,8 +2730,12 @@
|
|
|
2718
2730
|
var vm = getAssociatedVM(this);
|
|
2719
2731
|
if (process.env.NODE_ENV !== 'production') {
|
|
2720
2732
|
var _vmBeingRendered3 = getVMBeingRendered();
|
|
2721
|
-
|
|
2722
|
-
|
|
2733
|
+
if (isInvokingRender) {
|
|
2734
|
+
logError("render() method has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered3) ? vm : _vmBeingRendered3);
|
|
2735
|
+
}
|
|
2736
|
+
if (isUpdatingTemplate) {
|
|
2737
|
+
logError("Updating the template has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered3) ? vm : _vmBeingRendered3);
|
|
2738
|
+
}
|
|
2723
2739
|
}
|
|
2724
2740
|
vm.cmpProps[key] = newValue;
|
|
2725
2741
|
componentValueMutated(vm, key);
|
|
@@ -2746,13 +2762,17 @@
|
|
|
2746
2762
|
var vm = getAssociatedVM(this);
|
|
2747
2763
|
if (process.env.NODE_ENV !== 'production') {
|
|
2748
2764
|
var _vmBeingRendered4 = getVMBeingRendered();
|
|
2749
|
-
|
|
2750
|
-
|
|
2765
|
+
if (isInvokingRender) {
|
|
2766
|
+
logError("render() method has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered4) ? vm : _vmBeingRendered4);
|
|
2767
|
+
}
|
|
2768
|
+
if (isUpdatingTemplate) {
|
|
2769
|
+
logError("Updating the template has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered4) ? vm : _vmBeingRendered4);
|
|
2770
|
+
}
|
|
2751
2771
|
}
|
|
2752
2772
|
if (_set2) {
|
|
2753
2773
|
_set2.call(this, newValue);
|
|
2754
2774
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
2755
|
-
|
|
2775
|
+
logError("Invalid attempt to set a new value for property \"".concat(toString$1(key), "\" that does not has a setter decorated with @api."), vm);
|
|
2756
2776
|
}
|
|
2757
2777
|
},
|
|
2758
2778
|
enumerable: enumerable,
|
|
@@ -2786,8 +2806,12 @@
|
|
|
2786
2806
|
var vm = getAssociatedVM(this);
|
|
2787
2807
|
if (process.env.NODE_ENV !== 'production') {
|
|
2788
2808
|
var _vmBeingRendered5 = getVMBeingRendered();
|
|
2789
|
-
|
|
2790
|
-
|
|
2809
|
+
if (isInvokingRender) {
|
|
2810
|
+
logError("".concat(_vmBeingRendered5, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
|
|
2811
|
+
}
|
|
2812
|
+
if (isUpdatingTemplate) {
|
|
2813
|
+
logError("Updating the template of ".concat(_vmBeingRendered5, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
|
|
2814
|
+
}
|
|
2791
2815
|
}
|
|
2792
2816
|
var reactiveOrAnyValue = getReactiveProxy(newValue);
|
|
2793
2817
|
updateComponentValue(vm, key, reactiveOrAnyValue);
|
|
@@ -3645,12 +3669,16 @@
|
|
|
3645
3669
|
var ctorName = Ctor.name;
|
|
3646
3670
|
// Removing the following assert until https://bugs.webkit.org/show_bug.cgi?id=190140 is fixed.
|
|
3647
3671
|
// assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3672
|
+
if (!Ctor.constructor) {
|
|
3673
|
+
// This error seems impossible to hit, due to an earlier check in `isComponentConstructor()`.
|
|
3674
|
+
// But we keep it here just in case.
|
|
3675
|
+
logError("Missing ".concat(ctorName, ".constructor, ").concat(ctorName, " should have a \"constructor\" property."));
|
|
3676
|
+
}
|
|
3677
|
+
if (!isUndefined$1(ctorShadowSupportMode) && ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ && ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */) {
|
|
3678
|
+
logError("Invalid value for static property shadowSupportMode: '".concat(ctorShadowSupportMode, "'"));
|
|
3651
3679
|
}
|
|
3652
|
-
if (!isUndefined$1(ctorRenderMode)) {
|
|
3653
|
-
|
|
3680
|
+
if (!isUndefined$1(ctorRenderMode) && ctorRenderMode !== 'light' && ctorRenderMode !== 'shadow') {
|
|
3681
|
+
logError("Invalid value for static property renderMode: '".concat(ctorRenderMode, "'. renderMode must be either 'light' or 'shadow'."));
|
|
3654
3682
|
}
|
|
3655
3683
|
}
|
|
3656
3684
|
var decoratorsMeta = getDecoratorsMeta(Ctor);
|
|
@@ -5450,7 +5478,7 @@
|
|
|
5450
5478
|
return compilerKey + ':' + obj;
|
|
5451
5479
|
case 'object':
|
|
5452
5480
|
if (process.env.NODE_ENV !== 'production') {
|
|
5453
|
-
|
|
5481
|
+
logError("Invalid key value \"".concat(obj, "\" in ").concat(getVMBeingRendered(), ". Key must be a string or number."));
|
|
5454
5482
|
}
|
|
5455
5483
|
}
|
|
5456
5484
|
}
|
|
@@ -5728,11 +5756,18 @@
|
|
|
5728
5756
|
}
|
|
5729
5757
|
}
|
|
5730
5758
|
function validateLightDomTemplate(template, vm) {
|
|
5731
|
-
|
|
5759
|
+
assertNotProd(); // should never leak to prod mode
|
|
5760
|
+
if (template === defaultEmptyTemplate) {
|
|
5761
|
+
return;
|
|
5762
|
+
}
|
|
5732
5763
|
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
5733
|
-
|
|
5764
|
+
if (template.renderMode !== 'light') {
|
|
5765
|
+
logError("Light DOM components can't render shadow DOM templates. Add an 'lwc:render-mode=\"light\"' directive to the root template tag of ".concat(getComponentTag(vm), "."));
|
|
5766
|
+
}
|
|
5734
5767
|
} else {
|
|
5735
|
-
|
|
5768
|
+
if (!isUndefined$1(template.renderMode)) {
|
|
5769
|
+
logError("Shadow DOM components template can't render light DOM templates. Either remove the 'lwc:render-mode' directive from ".concat(getComponentTag(vm), " or set it to 'lwc:render-mode=\"shadow\""));
|
|
5770
|
+
}
|
|
5736
5771
|
}
|
|
5737
5772
|
}
|
|
5738
5773
|
function buildParseFragmentFn(createFragmentFn) {
|
|
@@ -5881,7 +5916,9 @@
|
|
|
5881
5916
|
logOperationEnd(1 /* OperationId.Render */, vm);
|
|
5882
5917
|
});
|
|
5883
5918
|
if (process.env.NODE_ENV !== 'production') {
|
|
5884
|
-
|
|
5919
|
+
if (!isArray$1(vnodes)) {
|
|
5920
|
+
logError("Compiler should produce html functions that always return an array.");
|
|
5921
|
+
}
|
|
5885
5922
|
}
|
|
5886
5923
|
return vnodes;
|
|
5887
5924
|
}
|
|
@@ -7000,6 +7037,35 @@
|
|
|
7000
7037
|
}
|
|
7001
7038
|
return false;
|
|
7002
7039
|
}
|
|
7040
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
7041
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
7042
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
7043
|
+
function getValidationPredicate(optOutStaticProp) {
|
|
7044
|
+
if (isUndefined$1(optOutStaticProp)) {
|
|
7045
|
+
return function (_attrName) {
|
|
7046
|
+
return true;
|
|
7047
|
+
};
|
|
7048
|
+
}
|
|
7049
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
7050
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
7051
|
+
if (isTrue(optOutStaticProp)) {
|
|
7052
|
+
return function (_attrName) {
|
|
7053
|
+
return false;
|
|
7054
|
+
};
|
|
7055
|
+
}
|
|
7056
|
+
// If validationOptOut is an array of strings, attributes specified in the
|
|
7057
|
+
// array will be "opted out". Attributes not specified in the array will still
|
|
7058
|
+
// be validated.
|
|
7059
|
+
if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
|
|
7060
|
+
return function (attrName) {
|
|
7061
|
+
return !ArrayIncludes.call(optOutStaticProp, attrName);
|
|
7062
|
+
};
|
|
7063
|
+
}
|
|
7064
|
+
logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
|
|
7065
|
+
return function (_attrName) {
|
|
7066
|
+
return true;
|
|
7067
|
+
};
|
|
7068
|
+
}
|
|
7003
7069
|
function hydrateText(node, vnode, renderer) {
|
|
7004
7070
|
var _a;
|
|
7005
7071
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -7079,7 +7145,18 @@
|
|
|
7079
7145
|
return elm;
|
|
7080
7146
|
}
|
|
7081
7147
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
7082
|
-
|
|
7148
|
+
var validationOptOut = vnode.ctor.validationOptOut;
|
|
7149
|
+
var shouldValidateAttr = getValidationPredicate(validationOptOut);
|
|
7150
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
7151
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
7152
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
7153
|
+
//
|
|
7154
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
7155
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
7156
|
+
//
|
|
7157
|
+
// Therefore, if validationOptOut is falsey or an array of strings, we need to
|
|
7158
|
+
// examine some or all of the custom element's attributes.
|
|
7159
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) || !isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
|
|
7083
7160
|
return handleMismatch(elm, vnode, renderer);
|
|
7084
7161
|
}
|
|
7085
7162
|
var sel = vnode.sel,
|
|
@@ -7176,6 +7253,9 @@
|
|
|
7176
7253
|
return true;
|
|
7177
7254
|
}
|
|
7178
7255
|
function isMatchingElement(vnode, elm, renderer) {
|
|
7256
|
+
var shouldValidateAttr = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
|
7257
|
+
return true;
|
|
7258
|
+
};
|
|
7179
7259
|
var getProperty = renderer.getProperty;
|
|
7180
7260
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
7181
7261
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -7183,10 +7263,10 @@
|
|
|
7183
7263
|
}
|
|
7184
7264
|
return false;
|
|
7185
7265
|
}
|
|
7186
|
-
var
|
|
7187
|
-
var
|
|
7188
|
-
var
|
|
7189
|
-
return
|
|
7266
|
+
var hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
|
|
7267
|
+
var hasCompatibleClass = shouldValidateAttr('class') ? validateClassAttr(vnode, elm, renderer) : true;
|
|
7268
|
+
var hasCompatibleStyle = shouldValidateAttr('style') ? validateStyleAttr(vnode, elm, renderer) : true;
|
|
7269
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
7190
7270
|
}
|
|
7191
7271
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
7192
7272
|
var vnodeValueAsString = String(vnodeValue);
|
|
@@ -7201,7 +7281,7 @@
|
|
|
7201
7281
|
// In all other cases, the two values are not considered equal
|
|
7202
7282
|
return false;
|
|
7203
7283
|
}
|
|
7204
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
7284
|
+
function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
|
|
7205
7285
|
var _vnode$data$attrs = vnode.data.attrs,
|
|
7206
7286
|
attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
|
|
7207
7287
|
var nodesAreCompatible = true;
|
|
@@ -7211,6 +7291,9 @@
|
|
|
7211
7291
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i37], 2),
|
|
7212
7292
|
attrName = _Object$entries$_i[0],
|
|
7213
7293
|
attrValue = _Object$entries$_i[1];
|
|
7294
|
+
if (!shouldValidateAttr(attrName)) {
|
|
7295
|
+
continue;
|
|
7296
|
+
}
|
|
7214
7297
|
var owner = vnode.owner;
|
|
7215
7298
|
var getAttribute = renderer.getAttribute;
|
|
7216
7299
|
var elmAttrValue = getAttribute(elm, attrName);
|
|
@@ -7662,7 +7745,7 @@
|
|
|
7662
7745
|
}
|
|
7663
7746
|
return getReadOnlyProxy(obj);
|
|
7664
7747
|
}
|
|
7665
|
-
/* version: 2.45.
|
|
7748
|
+
/* version: 2.45.2 */
|
|
7666
7749
|
|
|
7667
7750
|
/*
|
|
7668
7751
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8088,7 +8171,7 @@
|
|
|
8088
8171
|
function isNull(obj) {
|
|
8089
8172
|
return obj === null;
|
|
8090
8173
|
}
|
|
8091
|
-
/** version: 2.45.
|
|
8174
|
+
/** version: 2.45.2 */
|
|
8092
8175
|
|
|
8093
8176
|
/*
|
|
8094
8177
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8730,7 +8813,7 @@
|
|
|
8730
8813
|
});
|
|
8731
8814
|
});
|
|
8732
8815
|
}
|
|
8733
|
-
/* version: 2.45.
|
|
8816
|
+
/* version: 2.45.2 */
|
|
8734
8817
|
|
|
8735
8818
|
exports.LightningElement = LightningElement;
|
|
8736
8819
|
exports.__unstable__ProfilerControl = profilerControl;
|