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
|
@@ -87,8 +87,10 @@ var LWC = (function (exports) {
|
|
|
87
87
|
var isArray$1 = Array.isArray;
|
|
88
88
|
var _Array$prototype = Array.prototype,
|
|
89
89
|
ArrayCopyWithin = _Array$prototype.copyWithin,
|
|
90
|
+
ArrayEvery = _Array$prototype.every,
|
|
90
91
|
ArrayFill = _Array$prototype.fill,
|
|
91
92
|
ArrayFilter = _Array$prototype.filter,
|
|
93
|
+
ArrayIncludes = _Array$prototype.includes,
|
|
92
94
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
93
95
|
ArrayJoin = _Array$prototype.join,
|
|
94
96
|
ArrayMap = _Array$prototype.map,
|
|
@@ -102,6 +104,15 @@ var LWC = (function (exports) {
|
|
|
102
104
|
ArraySplice = _Array$prototype.splice,
|
|
103
105
|
ArrayUnshift = _Array$prototype.unshift,
|
|
104
106
|
forEach = _Array$prototype.forEach;
|
|
107
|
+
// The type of the return value of Array.prototype.every is `this is T[]`. However, once this
|
|
108
|
+
// Array method is pulled out of the prototype, the function is now referencing `this` where
|
|
109
|
+
// `this` is meaningless, resulting in a TypeScript compilation error.
|
|
110
|
+
//
|
|
111
|
+
// Exposing this helper function is the closest we can get to preserving the usage patterns
|
|
112
|
+
// of Array.prototype methods used elsewhere in the codebase.
|
|
113
|
+
function arrayEvery(arr, predicate) {
|
|
114
|
+
return ArrayEvery.call(arr, predicate);
|
|
115
|
+
}
|
|
105
116
|
var StringFromCharCode = String.fromCharCode;
|
|
106
117
|
var _String$prototype = String.prototype,
|
|
107
118
|
StringCharCodeAt = _String$prototype.charCodeAt,
|
|
@@ -327,9 +338,9 @@ var LWC = (function (exports) {
|
|
|
327
338
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
328
339
|
*/
|
|
329
340
|
// Increment whenever the LWC template compiler changes
|
|
330
|
-
var LWC_VERSION = "2.45.
|
|
341
|
+
var LWC_VERSION = "2.45.2";
|
|
331
342
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
332
|
-
/** version: 2.45.
|
|
343
|
+
/** version: 2.45.2 */
|
|
333
344
|
|
|
334
345
|
/**
|
|
335
346
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -409,7 +420,7 @@ var LWC = (function (exports) {
|
|
|
409
420
|
setFeatureFlag(name, value);
|
|
410
421
|
}
|
|
411
422
|
}
|
|
412
|
-
/** version: 2.45.
|
|
423
|
+
/** version: 2.45.2 */
|
|
413
424
|
|
|
414
425
|
/**
|
|
415
426
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -473,7 +484,7 @@ var LWC = (function (exports) {
|
|
|
473
484
|
}
|
|
474
485
|
}
|
|
475
486
|
}
|
|
476
|
-
/** version: 2.45.
|
|
487
|
+
/** version: 2.45.2 */
|
|
477
488
|
|
|
478
489
|
/*
|
|
479
490
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1024,8 +1035,9 @@ var LWC = (function (exports) {
|
|
|
1024
1035
|
get: function get() {
|
|
1025
1036
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
1026
1037
|
},
|
|
1027
|
-
set: function set(
|
|
1028
|
-
|
|
1038
|
+
set: function set(value) {
|
|
1039
|
+
logError("Invalid attempt to set outerHTML on Element.");
|
|
1040
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
1029
1041
|
}
|
|
1030
1042
|
})
|
|
1031
1043
|
};
|
|
@@ -1113,16 +1125,18 @@ var LWC = (function (exports) {
|
|
|
1113
1125
|
get: function get() {
|
|
1114
1126
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1115
1127
|
},
|
|
1116
|
-
set: function set(
|
|
1117
|
-
|
|
1128
|
+
set: function set(value) {
|
|
1129
|
+
logError("Invalid attempt to set innerHTML on ShadowRoot.");
|
|
1130
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1118
1131
|
}
|
|
1119
1132
|
}),
|
|
1120
1133
|
textContent: generateAccessorDescriptor({
|
|
1121
1134
|
get: function get() {
|
|
1122
1135
|
return originalTextContentDescriptor.get.call(this);
|
|
1123
1136
|
},
|
|
1124
|
-
set: function set(
|
|
1125
|
-
|
|
1137
|
+
set: function set(value) {
|
|
1138
|
+
logError("Invalid attempt to set textContent on ShadowRoot.");
|
|
1139
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1126
1140
|
}
|
|
1127
1141
|
}),
|
|
1128
1142
|
addEventListener: generateDataDescriptor({
|
|
@@ -1151,24 +1165,27 @@ var LWC = (function (exports) {
|
|
|
1151
1165
|
get: function get() {
|
|
1152
1166
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1153
1167
|
},
|
|
1154
|
-
set: function set(
|
|
1155
|
-
|
|
1168
|
+
set: function set(value) {
|
|
1169
|
+
logError("Invalid attempt to set innerHTML on HTMLElement.");
|
|
1170
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1156
1171
|
}
|
|
1157
1172
|
}),
|
|
1158
1173
|
outerHTML: generateAccessorDescriptor({
|
|
1159
1174
|
get: function get() {
|
|
1160
1175
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
1161
1176
|
},
|
|
1162
|
-
set: function set(
|
|
1163
|
-
|
|
1177
|
+
set: function set(value) {
|
|
1178
|
+
logError("Invalid attempt to set outerHTML on HTMLElement.");
|
|
1179
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
1164
1180
|
}
|
|
1165
1181
|
}),
|
|
1166
1182
|
textContent: generateAccessorDescriptor({
|
|
1167
1183
|
get: function get() {
|
|
1168
1184
|
return originalTextContentDescriptor.get.call(this);
|
|
1169
1185
|
},
|
|
1170
|
-
set: function set(
|
|
1171
|
-
|
|
1186
|
+
set: function set(value) {
|
|
1187
|
+
logError("Invalid attempt to set textContent on HTMLElement.");
|
|
1188
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1172
1189
|
}
|
|
1173
1190
|
}),
|
|
1174
1191
|
addEventListener: generateDataDescriptor({
|
|
@@ -1184,19 +1201,6 @@ var LWC = (function (exports) {
|
|
|
1184
1201
|
})
|
|
1185
1202
|
};
|
|
1186
1203
|
}
|
|
1187
|
-
function getComponentRestrictionsDescriptors() {
|
|
1188
|
-
assertNotProd(); // this method should never leak to prod
|
|
1189
|
-
return {
|
|
1190
|
-
tagName: generateAccessorDescriptor({
|
|
1191
|
-
get: function get() {
|
|
1192
|
-
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.");
|
|
1193
|
-
},
|
|
1194
|
-
configurable: true,
|
|
1195
|
-
enumerable: false // no enumerable properties on component
|
|
1196
|
-
})
|
|
1197
|
-
};
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
1204
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1201
1205
|
assertNotProd(); // this method should never leak to prod
|
|
1202
1206
|
var originalDispatchEvent = proto.dispatchEvent;
|
|
@@ -1227,9 +1231,6 @@ var LWC = (function (exports) {
|
|
|
1227
1231
|
var elmProto = getPrototypeOf$1(elm);
|
|
1228
1232
|
setPrototypeOf(elm, create(elmProto, restrictionsDescriptors));
|
|
1229
1233
|
}
|
|
1230
|
-
function patchComponentWithRestrictions(cmp) {
|
|
1231
|
-
defineProperties(cmp, getComponentRestrictionsDescriptors());
|
|
1232
|
-
}
|
|
1233
1234
|
function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
1234
1235
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1235
1236
|
}
|
|
@@ -1958,16 +1959,10 @@ var LWC = (function (exports) {
|
|
|
1958
1959
|
enumerable = descriptor.enumerable,
|
|
1959
1960
|
configurable = descriptor.configurable;
|
|
1960
1961
|
if (!isFunction$1(_get)) {
|
|
1961
|
-
|
|
1962
|
-
assert.fail("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard getter."));
|
|
1963
|
-
}
|
|
1964
|
-
throw new TypeError();
|
|
1962
|
+
throw new TypeError("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard getter."));
|
|
1965
1963
|
}
|
|
1966
1964
|
if (!isFunction$1(_set)) {
|
|
1967
|
-
|
|
1968
|
-
assert.fail("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard setter."));
|
|
1969
|
-
}
|
|
1970
|
-
throw new TypeError();
|
|
1965
|
+
throw new TypeError("Detected invalid public property descriptor for HTMLElement.prototype.".concat(propName, " definition. Missing the standard setter."));
|
|
1971
1966
|
}
|
|
1972
1967
|
return {
|
|
1973
1968
|
enumerable: enumerable,
|
|
@@ -1987,10 +1982,18 @@ var LWC = (function (exports) {
|
|
|
1987
1982
|
var vm = getAssociatedVM(this);
|
|
1988
1983
|
if (process.env.NODE_ENV !== 'production') {
|
|
1989
1984
|
var _vmBeingRendered = getVMBeingRendered();
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1985
|
+
if (isInvokingRender) {
|
|
1986
|
+
logError("".concat(_vmBeingRendered, ".render() method has side effects on the state of ").concat(vm, ".").concat(propName));
|
|
1987
|
+
}
|
|
1988
|
+
if (isUpdatingTemplate) {
|
|
1989
|
+
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));
|
|
1990
|
+
}
|
|
1991
|
+
if (isBeingConstructed(vm)) {
|
|
1992
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
1993
|
+
}
|
|
1994
|
+
if (isObject(newValue) && !isNull(newValue)) {
|
|
1995
|
+
logError("Invalid value \"".concat(newValue, "\" for \"").concat(propName, "\" of ").concat(vm, ". Value cannot be an object, must be a primitive value."));
|
|
1996
|
+
}
|
|
1994
1997
|
}
|
|
1995
1998
|
updateComponentValue(vm, propName, newValue);
|
|
1996
1999
|
return _set.call(vm.elm, newValue);
|
|
@@ -2046,7 +2049,6 @@ var LWC = (function (exports) {
|
|
|
2046
2049
|
// Adding extra guard rails in DEV mode.
|
|
2047
2050
|
if (process.env.NODE_ENV !== 'production') {
|
|
2048
2051
|
patchCustomElementWithRestrictions(elm);
|
|
2049
|
-
patchComponentWithRestrictions(component);
|
|
2050
2052
|
}
|
|
2051
2053
|
return this;
|
|
2052
2054
|
};
|
|
@@ -2085,9 +2087,15 @@ var LWC = (function (exports) {
|
|
|
2085
2087
|
addEventListener = vm.renderer.addEventListener;
|
|
2086
2088
|
if (process.env.NODE_ENV !== 'production') {
|
|
2087
2089
|
var _vmBeingRendered2 = getVMBeingRendered();
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2090
|
+
if (isInvokingRender) {
|
|
2091
|
+
logError("".concat(_vmBeingRendered2, ".render() method has side effects on the state of ").concat(vm, " by adding an event listener for \"").concat(type, "\"."));
|
|
2092
|
+
}
|
|
2093
|
+
if (isUpdatingTemplate) {
|
|
2094
|
+
logError("Updating the template of ".concat(_vmBeingRendered2, " has side effects on the state of ").concat(vm, " by adding an event listener for \"").concat(type, "\"."));
|
|
2095
|
+
}
|
|
2096
|
+
if (!isFunction$1(listener)) {
|
|
2097
|
+
logError("Invalid second argument for this.addEventListener() in ".concat(vm, " for event \"").concat(type, "\". Expected an EventListener but received ").concat(listener, "."));
|
|
2098
|
+
}
|
|
2091
2099
|
}
|
|
2092
2100
|
var wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2093
2101
|
addEventListener(elm, type, wrappedListener, options);
|
|
@@ -2144,7 +2152,9 @@ var LWC = (function (exports) {
|
|
|
2144
2152
|
var elm = vm.elm,
|
|
2145
2153
|
setAttribute = vm.renderer.setAttribute;
|
|
2146
2154
|
if (process.env.NODE_ENV !== 'production') {
|
|
2147
|
-
|
|
2155
|
+
if (isBeingConstructed(vm)) {
|
|
2156
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
2157
|
+
}
|
|
2148
2158
|
}
|
|
2149
2159
|
unlockAttribute(elm, name);
|
|
2150
2160
|
setAttribute(elm, name, value);
|
|
@@ -2155,7 +2165,9 @@ var LWC = (function (exports) {
|
|
|
2155
2165
|
var elm = vm.elm,
|
|
2156
2166
|
setAttribute = vm.renderer.setAttribute;
|
|
2157
2167
|
if (process.env.NODE_ENV !== 'production') {
|
|
2158
|
-
|
|
2168
|
+
if (isBeingConstructed(vm)) {
|
|
2169
|
+
logError("Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
|
|
2170
|
+
}
|
|
2159
2171
|
}
|
|
2160
2172
|
unlockAttribute(elm, name);
|
|
2161
2173
|
setAttribute(elm, name, value, namespace);
|
|
@@ -2181,9 +2193,9 @@ var LWC = (function (exports) {
|
|
|
2181
2193
|
var elm = vm.elm,
|
|
2182
2194
|
getClassList = vm.renderer.getClassList;
|
|
2183
2195
|
if (process.env.NODE_ENV !== 'production') {
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2196
|
+
if (isBeingConstructed(vm)) {
|
|
2197
|
+
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."));
|
|
2198
|
+
}
|
|
2187
2199
|
}
|
|
2188
2200
|
return getClassList(elm);
|
|
2189
2201
|
},
|
|
@@ -2715,8 +2727,12 @@ var LWC = (function (exports) {
|
|
|
2715
2727
|
var vm = getAssociatedVM(this);
|
|
2716
2728
|
if (process.env.NODE_ENV !== 'production') {
|
|
2717
2729
|
var _vmBeingRendered3 = getVMBeingRendered();
|
|
2718
|
-
|
|
2719
|
-
|
|
2730
|
+
if (isInvokingRender) {
|
|
2731
|
+
logError("render() method has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered3) ? vm : _vmBeingRendered3);
|
|
2732
|
+
}
|
|
2733
|
+
if (isUpdatingTemplate) {
|
|
2734
|
+
logError("Updating the template has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered3) ? vm : _vmBeingRendered3);
|
|
2735
|
+
}
|
|
2720
2736
|
}
|
|
2721
2737
|
vm.cmpProps[key] = newValue;
|
|
2722
2738
|
componentValueMutated(vm, key);
|
|
@@ -2743,13 +2759,17 @@ var LWC = (function (exports) {
|
|
|
2743
2759
|
var vm = getAssociatedVM(this);
|
|
2744
2760
|
if (process.env.NODE_ENV !== 'production') {
|
|
2745
2761
|
var _vmBeingRendered4 = getVMBeingRendered();
|
|
2746
|
-
|
|
2747
|
-
|
|
2762
|
+
if (isInvokingRender) {
|
|
2763
|
+
logError("render() method has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered4) ? vm : _vmBeingRendered4);
|
|
2764
|
+
}
|
|
2765
|
+
if (isUpdatingTemplate) {
|
|
2766
|
+
logError("Updating the template has side effects on the state of property \"".concat(toString$1(key), "\""), isNull(_vmBeingRendered4) ? vm : _vmBeingRendered4);
|
|
2767
|
+
}
|
|
2748
2768
|
}
|
|
2749
2769
|
if (_set2) {
|
|
2750
2770
|
_set2.call(this, newValue);
|
|
2751
2771
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
2752
|
-
|
|
2772
|
+
logError("Invalid attempt to set a new value for property \"".concat(toString$1(key), "\" that does not has a setter decorated with @api."), vm);
|
|
2753
2773
|
}
|
|
2754
2774
|
},
|
|
2755
2775
|
enumerable: enumerable,
|
|
@@ -2783,8 +2803,12 @@ var LWC = (function (exports) {
|
|
|
2783
2803
|
var vm = getAssociatedVM(this);
|
|
2784
2804
|
if (process.env.NODE_ENV !== 'production') {
|
|
2785
2805
|
var _vmBeingRendered5 = getVMBeingRendered();
|
|
2786
|
-
|
|
2787
|
-
|
|
2806
|
+
if (isInvokingRender) {
|
|
2807
|
+
logError("".concat(_vmBeingRendered5, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
|
|
2808
|
+
}
|
|
2809
|
+
if (isUpdatingTemplate) {
|
|
2810
|
+
logError("Updating the template of ".concat(_vmBeingRendered5, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
|
|
2811
|
+
}
|
|
2788
2812
|
}
|
|
2789
2813
|
var reactiveOrAnyValue = getReactiveProxy(newValue);
|
|
2790
2814
|
updateComponentValue(vm, key, reactiveOrAnyValue);
|
|
@@ -3642,12 +3666,16 @@ var LWC = (function (exports) {
|
|
|
3642
3666
|
var ctorName = Ctor.name;
|
|
3643
3667
|
// Removing the following assert until https://bugs.webkit.org/show_bug.cgi?id=190140 is fixed.
|
|
3644
3668
|
// assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3669
|
+
if (!Ctor.constructor) {
|
|
3670
|
+
// This error seems impossible to hit, due to an earlier check in `isComponentConstructor()`.
|
|
3671
|
+
// But we keep it here just in case.
|
|
3672
|
+
logError("Missing ".concat(ctorName, ".constructor, ").concat(ctorName, " should have a \"constructor\" property."));
|
|
3673
|
+
}
|
|
3674
|
+
if (!isUndefined$1(ctorShadowSupportMode) && ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ && ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */) {
|
|
3675
|
+
logError("Invalid value for static property shadowSupportMode: '".concat(ctorShadowSupportMode, "'"));
|
|
3648
3676
|
}
|
|
3649
|
-
if (!isUndefined$1(ctorRenderMode)) {
|
|
3650
|
-
|
|
3677
|
+
if (!isUndefined$1(ctorRenderMode) && ctorRenderMode !== 'light' && ctorRenderMode !== 'shadow') {
|
|
3678
|
+
logError("Invalid value for static property renderMode: '".concat(ctorRenderMode, "'. renderMode must be either 'light' or 'shadow'."));
|
|
3651
3679
|
}
|
|
3652
3680
|
}
|
|
3653
3681
|
var decoratorsMeta = getDecoratorsMeta(Ctor);
|
|
@@ -5447,7 +5475,7 @@ var LWC = (function (exports) {
|
|
|
5447
5475
|
return compilerKey + ':' + obj;
|
|
5448
5476
|
case 'object':
|
|
5449
5477
|
if (process.env.NODE_ENV !== 'production') {
|
|
5450
|
-
|
|
5478
|
+
logError("Invalid key value \"".concat(obj, "\" in ").concat(getVMBeingRendered(), ". Key must be a string or number."));
|
|
5451
5479
|
}
|
|
5452
5480
|
}
|
|
5453
5481
|
}
|
|
@@ -5725,11 +5753,18 @@ var LWC = (function (exports) {
|
|
|
5725
5753
|
}
|
|
5726
5754
|
}
|
|
5727
5755
|
function validateLightDomTemplate(template, vm) {
|
|
5728
|
-
|
|
5756
|
+
assertNotProd(); // should never leak to prod mode
|
|
5757
|
+
if (template === defaultEmptyTemplate) {
|
|
5758
|
+
return;
|
|
5759
|
+
}
|
|
5729
5760
|
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
5730
|
-
|
|
5761
|
+
if (template.renderMode !== 'light') {
|
|
5762
|
+
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), "."));
|
|
5763
|
+
}
|
|
5731
5764
|
} else {
|
|
5732
|
-
|
|
5765
|
+
if (!isUndefined$1(template.renderMode)) {
|
|
5766
|
+
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\""));
|
|
5767
|
+
}
|
|
5733
5768
|
}
|
|
5734
5769
|
}
|
|
5735
5770
|
function buildParseFragmentFn(createFragmentFn) {
|
|
@@ -5878,7 +5913,9 @@ var LWC = (function (exports) {
|
|
|
5878
5913
|
logOperationEnd(1 /* OperationId.Render */, vm);
|
|
5879
5914
|
});
|
|
5880
5915
|
if (process.env.NODE_ENV !== 'production') {
|
|
5881
|
-
|
|
5916
|
+
if (!isArray$1(vnodes)) {
|
|
5917
|
+
logError("Compiler should produce html functions that always return an array.");
|
|
5918
|
+
}
|
|
5882
5919
|
}
|
|
5883
5920
|
return vnodes;
|
|
5884
5921
|
}
|
|
@@ -6997,6 +7034,35 @@ var LWC = (function (exports) {
|
|
|
6997
7034
|
}
|
|
6998
7035
|
return false;
|
|
6999
7036
|
}
|
|
7037
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
7038
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
7039
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
7040
|
+
function getValidationPredicate(optOutStaticProp) {
|
|
7041
|
+
if (isUndefined$1(optOutStaticProp)) {
|
|
7042
|
+
return function (_attrName) {
|
|
7043
|
+
return true;
|
|
7044
|
+
};
|
|
7045
|
+
}
|
|
7046
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
7047
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
7048
|
+
if (isTrue(optOutStaticProp)) {
|
|
7049
|
+
return function (_attrName) {
|
|
7050
|
+
return false;
|
|
7051
|
+
};
|
|
7052
|
+
}
|
|
7053
|
+
// If validationOptOut is an array of strings, attributes specified in the
|
|
7054
|
+
// array will be "opted out". Attributes not specified in the array will still
|
|
7055
|
+
// be validated.
|
|
7056
|
+
if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
|
|
7057
|
+
return function (attrName) {
|
|
7058
|
+
return !ArrayIncludes.call(optOutStaticProp, attrName);
|
|
7059
|
+
};
|
|
7060
|
+
}
|
|
7061
|
+
logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
|
|
7062
|
+
return function (_attrName) {
|
|
7063
|
+
return true;
|
|
7064
|
+
};
|
|
7065
|
+
}
|
|
7000
7066
|
function hydrateText(node, vnode, renderer) {
|
|
7001
7067
|
var _a;
|
|
7002
7068
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -7076,7 +7142,18 @@ var LWC = (function (exports) {
|
|
|
7076
7142
|
return elm;
|
|
7077
7143
|
}
|
|
7078
7144
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
7079
|
-
|
|
7145
|
+
var validationOptOut = vnode.ctor.validationOptOut;
|
|
7146
|
+
var shouldValidateAttr = getValidationPredicate(validationOptOut);
|
|
7147
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
7148
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
7149
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
7150
|
+
//
|
|
7151
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
7152
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
7153
|
+
//
|
|
7154
|
+
// Therefore, if validationOptOut is falsey or an array of strings, we need to
|
|
7155
|
+
// examine some or all of the custom element's attributes.
|
|
7156
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) || !isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
|
|
7080
7157
|
return handleMismatch(elm, vnode, renderer);
|
|
7081
7158
|
}
|
|
7082
7159
|
var sel = vnode.sel,
|
|
@@ -7173,6 +7250,9 @@ var LWC = (function (exports) {
|
|
|
7173
7250
|
return true;
|
|
7174
7251
|
}
|
|
7175
7252
|
function isMatchingElement(vnode, elm, renderer) {
|
|
7253
|
+
var shouldValidateAttr = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
|
7254
|
+
return true;
|
|
7255
|
+
};
|
|
7176
7256
|
var getProperty = renderer.getProperty;
|
|
7177
7257
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
7178
7258
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -7180,10 +7260,10 @@ var LWC = (function (exports) {
|
|
|
7180
7260
|
}
|
|
7181
7261
|
return false;
|
|
7182
7262
|
}
|
|
7183
|
-
var
|
|
7184
|
-
var
|
|
7185
|
-
var
|
|
7186
|
-
return
|
|
7263
|
+
var hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
|
|
7264
|
+
var hasCompatibleClass = shouldValidateAttr('class') ? validateClassAttr(vnode, elm, renderer) : true;
|
|
7265
|
+
var hasCompatibleStyle = shouldValidateAttr('style') ? validateStyleAttr(vnode, elm, renderer) : true;
|
|
7266
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
7187
7267
|
}
|
|
7188
7268
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
7189
7269
|
var vnodeValueAsString = String(vnodeValue);
|
|
@@ -7198,7 +7278,7 @@ var LWC = (function (exports) {
|
|
|
7198
7278
|
// In all other cases, the two values are not considered equal
|
|
7199
7279
|
return false;
|
|
7200
7280
|
}
|
|
7201
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
7281
|
+
function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
|
|
7202
7282
|
var _vnode$data$attrs = vnode.data.attrs,
|
|
7203
7283
|
attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
|
|
7204
7284
|
var nodesAreCompatible = true;
|
|
@@ -7208,6 +7288,9 @@ var LWC = (function (exports) {
|
|
|
7208
7288
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i37], 2),
|
|
7209
7289
|
attrName = _Object$entries$_i[0],
|
|
7210
7290
|
attrValue = _Object$entries$_i[1];
|
|
7291
|
+
if (!shouldValidateAttr(attrName)) {
|
|
7292
|
+
continue;
|
|
7293
|
+
}
|
|
7211
7294
|
var owner = vnode.owner;
|
|
7212
7295
|
var getAttribute = renderer.getAttribute;
|
|
7213
7296
|
var elmAttrValue = getAttribute(elm, attrName);
|
|
@@ -7659,7 +7742,7 @@ var LWC = (function (exports) {
|
|
|
7659
7742
|
}
|
|
7660
7743
|
return getReadOnlyProxy(obj);
|
|
7661
7744
|
}
|
|
7662
|
-
/* version: 2.45.
|
|
7745
|
+
/* version: 2.45.2 */
|
|
7663
7746
|
|
|
7664
7747
|
/*
|
|
7665
7748
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8085,7 +8168,7 @@ var LWC = (function (exports) {
|
|
|
8085
8168
|
function isNull(obj) {
|
|
8086
8169
|
return obj === null;
|
|
8087
8170
|
}
|
|
8088
|
-
/** version: 2.45.
|
|
8171
|
+
/** version: 2.45.2 */
|
|
8089
8172
|
|
|
8090
8173
|
/*
|
|
8091
8174
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8727,7 +8810,7 @@ var LWC = (function (exports) {
|
|
|
8727
8810
|
});
|
|
8728
8811
|
});
|
|
8729
8812
|
}
|
|
8730
|
-
/* version: 2.45.
|
|
8813
|
+
/* version: 2.45.2 */
|
|
8731
8814
|
|
|
8732
8815
|
exports.LightningElement = LightningElement;
|
|
8733
8816
|
exports.__unstable__ProfilerControl = profilerControl;
|