lwc 2.42.0 → 2.44.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 +85 -225
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +85 -224
- 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 +35 -20
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +85 -226
- 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 +36 -21
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +85 -224
- 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 +35 -20
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +85 -226
- 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 +36 -21
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +152 -182
- 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 +133 -183
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +89 -74
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +89 -74
- 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 +85 -70
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +88 -71
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +84 -67
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +89 -74
- 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 +85 -70
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +88 -71
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +84 -67
- 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
|
@@ -320,27 +320,6 @@ var LWC = (function (exports) {
|
|
|
320
320
|
return propertyName;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
/*
|
|
324
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
325
|
-
* All rights reserved.
|
|
326
|
-
* SPDX-License-Identifier: MIT
|
|
327
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
328
|
-
*/
|
|
329
|
-
var ESCAPED_CHARS = {
|
|
330
|
-
'"': '"',
|
|
331
|
-
"'": ''',
|
|
332
|
-
'<': '<',
|
|
333
|
-
'>': '>',
|
|
334
|
-
'&': '&'
|
|
335
|
-
};
|
|
336
|
-
function htmlEscape(str) {
|
|
337
|
-
var attrMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
338
|
-
var searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
339
|
-
return str.replace(searchValue, function (char) {
|
|
340
|
-
return ESCAPED_CHARS[char];
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
323
|
/*
|
|
345
324
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
346
325
|
* All rights reserved.
|
|
@@ -348,9 +327,9 @@ var LWC = (function (exports) {
|
|
|
348
327
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
349
328
|
*/
|
|
350
329
|
// Increment whenever the LWC template compiler changes
|
|
351
|
-
var LWC_VERSION = "2.
|
|
330
|
+
var LWC_VERSION = "2.44.0";
|
|
352
331
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
353
|
-
/** version: 2.
|
|
332
|
+
/** version: 2.44.0 */
|
|
354
333
|
|
|
355
334
|
/**
|
|
356
335
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -430,7 +409,7 @@ var LWC = (function (exports) {
|
|
|
430
409
|
setFeatureFlag(name, value);
|
|
431
410
|
}
|
|
432
411
|
}
|
|
433
|
-
/** version: 2.
|
|
412
|
+
/** version: 2.44.0 */
|
|
434
413
|
|
|
435
414
|
/**
|
|
436
415
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -494,7 +473,7 @@ var LWC = (function (exports) {
|
|
|
494
473
|
}
|
|
495
474
|
}
|
|
496
475
|
}
|
|
497
|
-
/** version: 2.
|
|
476
|
+
/** version: 2.44.0 */
|
|
498
477
|
|
|
499
478
|
/*
|
|
500
479
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -961,101 +940,6 @@ var LWC = (function (exports) {
|
|
|
961
940
|
*/
|
|
962
941
|
// These properties get added to LWCElement.prototype publicProps automatically
|
|
963
942
|
var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
|
|
964
|
-
function offsetPropertyErrorMessage(name) {
|
|
965
|
-
return "Using the `".concat(name, "` property is an anti-pattern because it rounds the value to an integer. Instead, use the `getBoundingClientRect` method to obtain fractional values for the size of an element and its position relative to the viewport.");
|
|
966
|
-
}
|
|
967
|
-
// Global HTML Attributes & Properties
|
|
968
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
969
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
970
|
-
//
|
|
971
|
-
// If you update this list, check for test files that recapitulate the same list. Searching the codebase
|
|
972
|
-
// for e.g. "dropzone" should suffice.
|
|
973
|
-
var globalHTMLProperties = {
|
|
974
|
-
accessKey: {
|
|
975
|
-
attribute: 'accesskey'
|
|
976
|
-
},
|
|
977
|
-
accessKeyLabel: {
|
|
978
|
-
readOnly: true
|
|
979
|
-
},
|
|
980
|
-
className: {
|
|
981
|
-
attribute: 'class',
|
|
982
|
-
error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
|
|
983
|
-
},
|
|
984
|
-
contentEditable: {
|
|
985
|
-
attribute: 'contenteditable'
|
|
986
|
-
},
|
|
987
|
-
dataset: {
|
|
988
|
-
readOnly: true,
|
|
989
|
-
error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
|
|
990
|
-
},
|
|
991
|
-
dir: {
|
|
992
|
-
attribute: 'dir'
|
|
993
|
-
},
|
|
994
|
-
draggable: {
|
|
995
|
-
attribute: 'draggable'
|
|
996
|
-
},
|
|
997
|
-
dropzone: {
|
|
998
|
-
attribute: 'dropzone',
|
|
999
|
-
readOnly: true
|
|
1000
|
-
},
|
|
1001
|
-
hidden: {
|
|
1002
|
-
attribute: 'hidden'
|
|
1003
|
-
},
|
|
1004
|
-
id: {
|
|
1005
|
-
attribute: 'id'
|
|
1006
|
-
},
|
|
1007
|
-
inputMode: {
|
|
1008
|
-
attribute: 'inputmode'
|
|
1009
|
-
},
|
|
1010
|
-
lang: {
|
|
1011
|
-
attribute: 'lang'
|
|
1012
|
-
},
|
|
1013
|
-
slot: {
|
|
1014
|
-
attribute: 'slot',
|
|
1015
|
-
error: 'Using the `slot` property is an anti-pattern.'
|
|
1016
|
-
},
|
|
1017
|
-
spellcheck: {
|
|
1018
|
-
attribute: 'spellcheck'
|
|
1019
|
-
},
|
|
1020
|
-
style: {
|
|
1021
|
-
attribute: 'style'
|
|
1022
|
-
},
|
|
1023
|
-
tabIndex: {
|
|
1024
|
-
attribute: 'tabindex'
|
|
1025
|
-
},
|
|
1026
|
-
title: {
|
|
1027
|
-
attribute: 'title'
|
|
1028
|
-
},
|
|
1029
|
-
translate: {
|
|
1030
|
-
attribute: 'translate'
|
|
1031
|
-
},
|
|
1032
|
-
// additional "global attributes" that are not present in the link above.
|
|
1033
|
-
isContentEditable: {
|
|
1034
|
-
readOnly: true
|
|
1035
|
-
},
|
|
1036
|
-
offsetHeight: {
|
|
1037
|
-
readOnly: true,
|
|
1038
|
-
error: offsetPropertyErrorMessage('offsetHeight')
|
|
1039
|
-
},
|
|
1040
|
-
offsetLeft: {
|
|
1041
|
-
readOnly: true,
|
|
1042
|
-
error: offsetPropertyErrorMessage('offsetLeft')
|
|
1043
|
-
},
|
|
1044
|
-
offsetParent: {
|
|
1045
|
-
readOnly: true
|
|
1046
|
-
},
|
|
1047
|
-
offsetTop: {
|
|
1048
|
-
readOnly: true,
|
|
1049
|
-
error: offsetPropertyErrorMessage('offsetTop')
|
|
1050
|
-
},
|
|
1051
|
-
offsetWidth: {
|
|
1052
|
-
readOnly: true,
|
|
1053
|
-
error: offsetPropertyErrorMessage('offsetWidth')
|
|
1054
|
-
},
|
|
1055
|
-
role: {
|
|
1056
|
-
attribute: 'role'
|
|
1057
|
-
}
|
|
1058
|
-
};
|
|
1059
943
|
var controlledElement = null;
|
|
1060
944
|
var controlledAttributeName;
|
|
1061
945
|
function isAttributeLocked(elm, attrName) {
|
|
@@ -1243,8 +1127,7 @@ var LWC = (function (exports) {
|
|
|
1243
1127
|
}),
|
|
1244
1128
|
addEventListener: generateDataDescriptor({
|
|
1245
1129
|
value: function value(type, listener, options) {
|
|
1246
|
-
// TODO [#
|
|
1247
|
-
// programmatically into its Component's shadow root
|
|
1130
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1248
1131
|
if (!isUndefined$1(options)) {
|
|
1249
1132
|
logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
|
|
1250
1133
|
}
|
|
@@ -1290,8 +1173,7 @@ var LWC = (function (exports) {
|
|
|
1290
1173
|
}),
|
|
1291
1174
|
addEventListener: generateDataDescriptor({
|
|
1292
1175
|
value: function value(type, listener, options) {
|
|
1293
|
-
// TODO [#
|
|
1294
|
-
// programmatically into a lighting element node
|
|
1176
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1295
1177
|
if (!isUndefined$1(options)) {
|
|
1296
1178
|
logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
|
|
1297
1179
|
}
|
|
@@ -1318,7 +1200,7 @@ var LWC = (function (exports) {
|
|
|
1318
1200
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1319
1201
|
assertNotProd(); // this method should never leak to prod
|
|
1320
1202
|
var originalDispatchEvent = proto.dispatchEvent;
|
|
1321
|
-
|
|
1203
|
+
return {
|
|
1322
1204
|
dispatchEvent: generateDataDescriptor({
|
|
1323
1205
|
value: function value(event) {
|
|
1324
1206
|
var vm = getAssociatedVM(this);
|
|
@@ -1334,34 +1216,6 @@ var LWC = (function (exports) {
|
|
|
1334
1216
|
}
|
|
1335
1217
|
})
|
|
1336
1218
|
};
|
|
1337
|
-
forEach.call(getOwnPropertyNames$1(globalHTMLProperties), function (propName) {
|
|
1338
|
-
if (propName in proto) {
|
|
1339
|
-
return; // no need to redefine something that we are already exposing
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
descriptors[propName] = generateAccessorDescriptor({
|
|
1343
|
-
get: function get() {
|
|
1344
|
-
var _globalHTMLProperties = globalHTMLProperties[propName],
|
|
1345
|
-
error = _globalHTMLProperties.error,
|
|
1346
|
-
attribute = _globalHTMLProperties.attribute;
|
|
1347
|
-
var msg = [];
|
|
1348
|
-
msg.push("Accessing the global HTML property \"".concat(propName, "\" is disabled."));
|
|
1349
|
-
if (error) {
|
|
1350
|
-
msg.push(error);
|
|
1351
|
-
} else if (attribute) {
|
|
1352
|
-
msg.push("Instead access it via `this.getAttribute(\"".concat(attribute, "\")`."));
|
|
1353
|
-
}
|
|
1354
|
-
logError(msg.join('\n'), getAssociatedVM(this));
|
|
1355
|
-
},
|
|
1356
|
-
set: function set() {
|
|
1357
|
-
var readOnly = globalHTMLProperties[propName].readOnly;
|
|
1358
|
-
if (readOnly) {
|
|
1359
|
-
logError("The global HTML property `".concat(propName, "` is read-only."), getAssociatedVM(this));
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
});
|
|
1364
|
-
return descriptors;
|
|
1365
1219
|
}
|
|
1366
1220
|
// This routine will prevent access to certain properties on a shadow root instance to guarantee
|
|
1367
1221
|
// that all components will work fine in IE11 and other browsers without shadow dom support.
|
|
@@ -2876,12 +2730,7 @@ var LWC = (function (exports) {
|
|
|
2876
2730
|
_set2 = descriptor.set,
|
|
2877
2731
|
enumerable = descriptor.enumerable,
|
|
2878
2732
|
configurable = descriptor.configurable;
|
|
2879
|
-
|
|
2880
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2881
|
-
assert.invariant(isFunction$1(_get2), "Invalid compiler output for public accessor ".concat(toString$1(key), " decorated with @api"));
|
|
2882
|
-
}
|
|
2883
|
-
throw new Error();
|
|
2884
|
-
}
|
|
2733
|
+
assert.invariant(isFunction$1(_get2), "Invalid public accessor ".concat(toString$1(key), " decorated with @api. The property is missing a getter."));
|
|
2885
2734
|
return {
|
|
2886
2735
|
get: function get() {
|
|
2887
2736
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3001,60 +2850,63 @@ var LWC = (function (exports) {
|
|
|
3001
2850
|
}
|
|
3002
2851
|
|
|
3003
2852
|
function validateObservedField(Ctor, fieldName, descriptor) {
|
|
2853
|
+
assertNotProd(); // this method should never leak to prod
|
|
3004
2854
|
if (!isUndefined$1(descriptor)) {
|
|
3005
2855
|
var type = getClassDescriptorType(descriptor);
|
|
3006
2856
|
var message = "Invalid observed ".concat(fieldName, " field. Found a duplicate ").concat(type, " with the same name.");
|
|
3007
|
-
// [
|
|
3008
|
-
|
|
3009
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
3010
|
-
logError(message);
|
|
3011
|
-
} else {
|
|
3012
|
-
assert.fail(message);
|
|
3013
|
-
}
|
|
2857
|
+
// TODO [#3408]: this should throw, not log
|
|
2858
|
+
logError(message);
|
|
3014
2859
|
}
|
|
3015
2860
|
}
|
|
3016
2861
|
function validateFieldDecoratedWithTrack(Ctor, fieldName, descriptor) {
|
|
2862
|
+
assertNotProd(); // this method should never leak to prod
|
|
3017
2863
|
if (!isUndefined$1(descriptor)) {
|
|
3018
2864
|
var type = getClassDescriptorType(descriptor);
|
|
3019
|
-
|
|
2865
|
+
// TODO [#3408]: this should throw, not log
|
|
2866
|
+
logError("Invalid @track ".concat(fieldName, " field. Found a duplicate ").concat(type, " with the same name."));
|
|
3020
2867
|
}
|
|
3021
2868
|
}
|
|
3022
2869
|
function validateFieldDecoratedWithWire(Ctor, fieldName, descriptor) {
|
|
2870
|
+
assertNotProd(); // this method should never leak to prod
|
|
3023
2871
|
if (!isUndefined$1(descriptor)) {
|
|
3024
2872
|
var type = getClassDescriptorType(descriptor);
|
|
3025
|
-
|
|
2873
|
+
// TODO [#3408]: this should throw, not log
|
|
2874
|
+
logError("Invalid @wire ".concat(fieldName, " field. Found a duplicate ").concat(type, " with the same name."));
|
|
3026
2875
|
}
|
|
3027
2876
|
}
|
|
3028
2877
|
function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
|
|
2878
|
+
assertNotProd(); // this method should never leak to prod
|
|
3029
2879
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
3030
|
-
|
|
2880
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2881
|
+
logError("Invalid @wire ".concat(methodName, " field. The field should have a valid writable descriptor."));
|
|
3031
2882
|
}
|
|
3032
2883
|
}
|
|
3033
2884
|
function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
2885
|
+
assertNotProd(); // this method should never leak to prod
|
|
3034
2886
|
if (!isUndefined$1(descriptor)) {
|
|
3035
2887
|
var type = getClassDescriptorType(descriptor);
|
|
3036
2888
|
var message = "Invalid @api ".concat(fieldName, " field. Found a duplicate ").concat(type, " with the same name.");
|
|
3037
|
-
// [
|
|
3038
|
-
|
|
3039
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
3040
|
-
logError(message);
|
|
3041
|
-
} else {
|
|
3042
|
-
assert.fail(message);
|
|
3043
|
-
}
|
|
2889
|
+
// TODO [#3408]: this should throw, not log
|
|
2890
|
+
logError(message);
|
|
3044
2891
|
}
|
|
3045
2892
|
}
|
|
3046
2893
|
function validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
2894
|
+
assertNotProd(); // this method should never leak to prod
|
|
2895
|
+
if (isFunction$1(descriptor.set)) {
|
|
2896
|
+
if (!isFunction$1(descriptor.get)) {
|
|
2897
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2898
|
+
logError("Missing getter for property ".concat(fieldName, " decorated with @api in ").concat(Ctor, ". You cannot have a setter without the corresponding getter."));
|
|
2899
|
+
}
|
|
3051
2900
|
} else if (!isFunction$1(descriptor.get)) {
|
|
3052
|
-
|
|
2901
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2902
|
+
logError("Missing @api get ".concat(fieldName, " accessor."));
|
|
3053
2903
|
}
|
|
3054
2904
|
}
|
|
3055
2905
|
function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
|
|
2906
|
+
assertNotProd(); // this method should never leak to prod
|
|
3056
2907
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
3057
|
-
|
|
2908
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2909
|
+
logError("Invalid @api ".concat(methodName, " method."));
|
|
3058
2910
|
}
|
|
3059
2911
|
}
|
|
3060
2912
|
/**
|
|
@@ -3081,13 +2933,14 @@ var LWC = (function (exports) {
|
|
|
3081
2933
|
apiFieldsConfig[fieldName] = propConfig.config;
|
|
3082
2934
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldName);
|
|
3083
2935
|
if (propConfig.config > 0) {
|
|
2936
|
+
if (isUndefined$1(descriptor)) {
|
|
2937
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2938
|
+
throw new Error();
|
|
2939
|
+
}
|
|
3084
2940
|
// accessor declaration
|
|
3085
2941
|
if (process.env.NODE_ENV !== 'production') {
|
|
3086
2942
|
validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor);
|
|
3087
2943
|
}
|
|
3088
|
-
if (isUndefined$1(descriptor)) {
|
|
3089
|
-
throw new Error();
|
|
3090
|
-
}
|
|
3091
2944
|
descriptor = createPublicAccessorDescriptor(fieldName, descriptor);
|
|
3092
2945
|
} else {
|
|
3093
2946
|
// field declaration
|
|
@@ -3130,7 +2983,10 @@ var LWC = (function (exports) {
|
|
|
3130
2983
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldOrMethodName);
|
|
3131
2984
|
if (method === 1) {
|
|
3132
2985
|
if (process.env.NODE_ENV !== 'production') {
|
|
3133
|
-
|
|
2986
|
+
if (!adapter) {
|
|
2987
|
+
// TODO [#3408]: this should throw, not log
|
|
2988
|
+
logError("@wire on method \"".concat(fieldOrMethodName, "\": adapter id must be truthy."));
|
|
2989
|
+
}
|
|
3134
2990
|
validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
3135
2991
|
}
|
|
3136
2992
|
if (isUndefined$1(descriptor)) {
|
|
@@ -3140,7 +2996,10 @@ var LWC = (function (exports) {
|
|
|
3140
2996
|
storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic);
|
|
3141
2997
|
} else {
|
|
3142
2998
|
if (process.env.NODE_ENV !== 'production') {
|
|
3143
|
-
|
|
2999
|
+
if (!adapter) {
|
|
3000
|
+
// TODO [#3408]: this should throw, not log
|
|
3001
|
+
logError("@wire on field \"".concat(fieldOrMethodName, "\": adapter id must be truthy."));
|
|
3002
|
+
}
|
|
3144
3003
|
validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
3145
3004
|
}
|
|
3146
3005
|
descriptor = internalWireFieldDecorator(fieldOrMethodName);
|
|
@@ -4045,6 +3904,15 @@ var LWC = (function (exports) {
|
|
|
4045
3904
|
// the stylesheet, while internally, we have a replacement for it.
|
|
4046
3905
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
4047
3906
|
}
|
|
3907
|
+
// Check that this stylesheet was generated by our compiler
|
|
3908
|
+
if (!isStylesheetRegistered(stylesheet)) {
|
|
3909
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3910
|
+
logWarnOnce("TypeError: Unexpected LWC stylesheet content found for component <".concat(vm.tagName.toLowerCase(), ">."));
|
|
3911
|
+
}
|
|
3912
|
+
report("UnexpectedStylesheetContent" /* ReportingEventId.UnexpectedStylesheetContent */, {
|
|
3913
|
+
tagName: vm.tagName.toLowerCase()
|
|
3914
|
+
});
|
|
3915
|
+
}
|
|
4048
3916
|
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4049
3917
|
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS && !isScopedCss && vm.renderMode === 0 /* RenderMode.Light */) {
|
|
4050
3918
|
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
@@ -4159,6 +4027,18 @@ var LWC = (function (exports) {
|
|
|
4159
4027
|
}
|
|
4160
4028
|
return null;
|
|
4161
4029
|
}
|
|
4030
|
+
var signedStylesheetSet = new Set();
|
|
4031
|
+
/**
|
|
4032
|
+
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
4033
|
+
* will prevent this function from being imported by userland code.
|
|
4034
|
+
*/
|
|
4035
|
+
function registerStylesheet(stylesheet) {
|
|
4036
|
+
signedStylesheetSet.add(stylesheet);
|
|
4037
|
+
return stylesheet;
|
|
4038
|
+
}
|
|
4039
|
+
function isStylesheetRegistered(stylesheet) {
|
|
4040
|
+
return signedStylesheetSet.has(stylesheet);
|
|
4041
|
+
}
|
|
4162
4042
|
|
|
4163
4043
|
/*
|
|
4164
4044
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5857,19 +5737,12 @@ var LWC = (function (exports) {
|
|
|
5857
5737
|
function setVMBeingRendered(vm) {
|
|
5858
5738
|
vmBeingRendered = vm;
|
|
5859
5739
|
}
|
|
5860
|
-
function validateSlots(vm
|
|
5740
|
+
function validateSlots(vm) {
|
|
5861
5741
|
assertNotProd(); // this method should never leak to prod
|
|
5862
5742
|
var cmpSlots = vm.cmpSlots;
|
|
5863
|
-
var _html$slots = html.slots,
|
|
5864
|
-
slots = _html$slots === void 0 ? EmptyArray : _html$slots;
|
|
5865
5743
|
for (var slotName in cmpSlots.slotAssignments) {
|
|
5866
5744
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
5867
5745
|
assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), "Slots can only be set to an array, instead received ".concat(toString$1(cmpSlots.slotAssignments[slotName]), " for slot \"").concat(slotName, "\" in ").concat(vm, "."));
|
|
5868
|
-
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
5869
|
-
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
5870
|
-
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
5871
|
-
logError("Ignoring unknown provided slot name \"".concat(slotName, "\" in ").concat(vm, ". Check for a typo on the slot attribute."), vm);
|
|
5872
|
-
}
|
|
5873
5746
|
}
|
|
5874
5747
|
}
|
|
5875
5748
|
function validateLightDomTemplate(template, vm) {
|
|
@@ -6002,7 +5875,7 @@ var LWC = (function (exports) {
|
|
|
6002
5875
|
}
|
|
6003
5876
|
if (process.env.NODE_ENV !== 'production') {
|
|
6004
5877
|
// validating slots in every rendering since the allocated content might change over time
|
|
6005
|
-
validateSlots(vm
|
|
5878
|
+
validateSlots(vm);
|
|
6006
5879
|
// add the VM to the list of host VMs that can be re-rendered if html is swapped
|
|
6007
5880
|
setActiveVM(vm);
|
|
6008
5881
|
}
|
|
@@ -7005,7 +6878,7 @@ var LWC = (function (exports) {
|
|
|
7005
6878
|
if (!isLightningElement(elm)) {
|
|
7006
6879
|
var vm = findVM(elm);
|
|
7007
6880
|
if (process.env.NODE_ENV !== 'production') {
|
|
7008
|
-
logWarnOnce("Element <".concat(elm.tagName.toLowerCase(), "> ") + (isUndefined$1(vm) ? '' : "owned by <".concat(vm.
|
|
6881
|
+
logWarnOnce("Element <".concat(elm.tagName.toLowerCase(), "> ") + (isUndefined$1(vm) ? '' : "owned by <".concat(vm.tagName.toLowerCase(), "> ")) + "uses non-standard property \"".concat(prop, "\". This will be removed in a future version of LWC. ") + "See https://sfdc.co/deprecated-aria");
|
|
7009
6882
|
}
|
|
7010
6883
|
var setValueType;
|
|
7011
6884
|
if (isSetter) {
|
|
@@ -7132,8 +7005,6 @@ var LWC = (function (exports) {
|
|
|
7132
7005
|
return renderer.nextSibling(hydratedNode);
|
|
7133
7006
|
}
|
|
7134
7007
|
var NODE_VALUE_PROP = 'nodeValue';
|
|
7135
|
-
var PARENT_NODE_PROP = 'parentNode';
|
|
7136
|
-
var TAG_NAME_PROP = 'tagName';
|
|
7137
7008
|
function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
7138
7009
|
var getProperty = renderer.getProperty;
|
|
7139
7010
|
var nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
@@ -7145,22 +7016,6 @@ var LWC = (function (exports) {
|
|
|
7145
7016
|
if (nodeValue === "\u200D" && vnode.text === '') {
|
|
7146
7017
|
return true;
|
|
7147
7018
|
}
|
|
7148
|
-
// Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
|
|
7149
|
-
// but not when generated by the engine client-side.
|
|
7150
|
-
var parentNode = getProperty(node, PARENT_NODE_PROP);
|
|
7151
|
-
// Should never be null, but just to be safe, we check.
|
|
7152
|
-
/* istanbul ignore else */
|
|
7153
|
-
if (!isNull(parentNode)) {
|
|
7154
|
-
var tagName = getProperty(parentNode, TAG_NAME_PROP);
|
|
7155
|
-
// If the tagName is STYLE, then the following condition should always be true.
|
|
7156
|
-
// The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
|
|
7157
|
-
// for component authors to render different `<style>` text content on the client and server.
|
|
7158
|
-
// But just to be safe, we check.
|
|
7159
|
-
/* istanbul ignore next */
|
|
7160
|
-
if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
|
|
7161
|
-
return true;
|
|
7162
|
-
}
|
|
7163
|
-
}
|
|
7164
7019
|
return false;
|
|
7165
7020
|
}
|
|
7166
7021
|
function hydrateText(node, vnode, renderer) {
|
|
@@ -7393,7 +7248,8 @@ var LWC = (function (exports) {
|
|
|
7393
7248
|
var className = data.className,
|
|
7394
7249
|
classMap = data.classMap;
|
|
7395
7250
|
var getProperty = renderer.getProperty,
|
|
7396
|
-
getClassList = renderer.getClassList
|
|
7251
|
+
getClassList = renderer.getClassList,
|
|
7252
|
+
getAttribute = renderer.getAttribute;
|
|
7397
7253
|
var scopedToken = getScopeTokenClass(owner);
|
|
7398
7254
|
var stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
|
|
7399
7255
|
// Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
@@ -7425,11 +7281,12 @@ var LWC = (function (exports) {
|
|
|
7425
7281
|
}
|
|
7426
7282
|
var nodesAreCompatible = true;
|
|
7427
7283
|
var readableVnodeClassname;
|
|
7428
|
-
var elmClassName =
|
|
7284
|
+
var elmClassName = getAttribute(elm, 'class');
|
|
7429
7285
|
if (!isUndefined$1(className) && String(className) !== elmClassName) {
|
|
7430
7286
|
// className is used when class is bound to an expr.
|
|
7431
7287
|
nodesAreCompatible = false;
|
|
7432
|
-
|
|
7288
|
+
// stringify for pretty-printing
|
|
7289
|
+
readableVnodeClassname = JSON.stringify(className);
|
|
7433
7290
|
} else if (!isUndefined$1(classMap)) {
|
|
7434
7291
|
// classMap is used when class is set to static value.
|
|
7435
7292
|
var classList = getClassList(elm);
|
|
@@ -7441,18 +7298,19 @@ var LWC = (function (exports) {
|
|
|
7441
7298
|
nodesAreCompatible = false;
|
|
7442
7299
|
}
|
|
7443
7300
|
}
|
|
7444
|
-
|
|
7301
|
+
// stringify for pretty-printing
|
|
7302
|
+
readableVnodeClassname = JSON.stringify(computedClassName.trim());
|
|
7445
7303
|
if (classList.length > keys(classMap).length) {
|
|
7446
7304
|
nodesAreCompatible = false;
|
|
7447
7305
|
}
|
|
7448
|
-
} else if (isUndefined$1(className) && elmClassName
|
|
7306
|
+
} else if (isUndefined$1(className) && !isNull(elmClassName)) {
|
|
7449
7307
|
// SSR contains a className but client-side VDOM does not
|
|
7450
7308
|
nodesAreCompatible = false;
|
|
7451
|
-
readableVnodeClassname = '';
|
|
7309
|
+
readableVnodeClassname = '""';
|
|
7452
7310
|
}
|
|
7453
7311
|
if (!nodesAreCompatible) {
|
|
7454
7312
|
if (process.env.NODE_ENV !== 'production') {
|
|
7455
|
-
logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"class\" has different values, expected
|
|
7313
|
+
logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"class\" has different values, expected ").concat(readableVnodeClassname, " but found ").concat(JSON.stringify(elmClassName)), vnode.owner);
|
|
7456
7314
|
}
|
|
7457
7315
|
}
|
|
7458
7316
|
return nodesAreCompatible;
|
|
@@ -7817,12 +7675,12 @@ var LWC = (function (exports) {
|
|
|
7817
7675
|
if (process.env.NODE_ENV !== 'production') {
|
|
7818
7676
|
// TODO [#1292]: Remove the readonly decorator
|
|
7819
7677
|
if (arguments.length !== 1) {
|
|
7820
|
-
|
|
7678
|
+
logError('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
|
|
7821
7679
|
}
|
|
7822
7680
|
}
|
|
7823
7681
|
return getReadOnlyProxy(obj);
|
|
7824
7682
|
}
|
|
7825
|
-
/* version: 2.
|
|
7683
|
+
/* version: 2.44.0 */
|
|
7826
7684
|
|
|
7827
7685
|
/*
|
|
7828
7686
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8248,7 +8106,7 @@ var LWC = (function (exports) {
|
|
|
8248
8106
|
function isNull(obj) {
|
|
8249
8107
|
return obj === null;
|
|
8250
8108
|
}
|
|
8251
|
-
/** version: 2.
|
|
8109
|
+
/** version: 2.44.0 */
|
|
8252
8110
|
|
|
8253
8111
|
/*
|
|
8254
8112
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8890,7 +8748,7 @@ var LWC = (function (exports) {
|
|
|
8890
8748
|
});
|
|
8891
8749
|
});
|
|
8892
8750
|
}
|
|
8893
|
-
/* version: 2.
|
|
8751
|
+
/* version: 2.44.0 */
|
|
8894
8752
|
|
|
8895
8753
|
exports.LightningElement = LightningElement;
|
|
8896
8754
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -8911,6 +8769,7 @@ var LWC = (function (exports) {
|
|
|
8911
8769
|
exports.register = register;
|
|
8912
8770
|
exports.registerComponent = registerComponent;
|
|
8913
8771
|
exports.registerDecorators = registerDecorators;
|
|
8772
|
+
exports.registerStylesheet = registerStylesheet;
|
|
8914
8773
|
exports.registerTemplate = registerTemplate;
|
|
8915
8774
|
exports.renderer = renderer;
|
|
8916
8775
|
exports.rendererFactory = rendererFactory;
|