lwc 2.43.0 → 2.45.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 +53 -231
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +52 -231
- 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 +8 -28
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +51 -232
- 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 +7 -27
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +52 -231
- 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 +8 -28
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +51 -232
- 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 +7 -27
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +121 -203
- 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 +103 -203
- 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
|
@@ -43,7 +43,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
43
43
|
*/
|
|
44
44
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
45
45
|
const { isArray: isArray$1 } = Array;
|
|
46
|
-
const { concat: ArrayConcat$1, 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, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
46
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
47
47
|
const { fromCharCode: StringFromCharCode } = String;
|
|
48
48
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
49
49
|
function isUndefined$1(obj) {
|
|
@@ -322,24 +322,6 @@ function htmlAttributeToProperty(attrName) {
|
|
|
322
322
|
return propertyName;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
/*
|
|
326
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
327
|
-
* All rights reserved.
|
|
328
|
-
* SPDX-License-Identifier: MIT
|
|
329
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
|
-
*/
|
|
331
|
-
const ESCAPED_CHARS = {
|
|
332
|
-
'"': '"',
|
|
333
|
-
"'": ''',
|
|
334
|
-
'<': '<',
|
|
335
|
-
'>': '>',
|
|
336
|
-
'&': '&',
|
|
337
|
-
};
|
|
338
|
-
function htmlEscape(str, attrMode = false) {
|
|
339
|
-
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
340
|
-
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
325
|
/*
|
|
344
326
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
345
327
|
* All rights reserved.
|
|
@@ -347,9 +329,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
347
329
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
348
330
|
*/
|
|
349
331
|
// Increment whenever the LWC template compiler changes
|
|
350
|
-
const LWC_VERSION = "2.
|
|
332
|
+
const LWC_VERSION = "2.45.0";
|
|
351
333
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
352
|
-
/** version: 2.
|
|
334
|
+
/** version: 2.45.0 */
|
|
353
335
|
|
|
354
336
|
/**
|
|
355
337
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -427,7 +409,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
427
409
|
setFeatureFlag(name, value);
|
|
428
410
|
}
|
|
429
411
|
}
|
|
430
|
-
/** version: 2.
|
|
412
|
+
/** version: 2.45.0 */
|
|
431
413
|
|
|
432
414
|
/**
|
|
433
415
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -491,7 +473,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
491
473
|
}
|
|
492
474
|
}
|
|
493
475
|
}
|
|
494
|
-
/** version: 2.
|
|
476
|
+
/** version: 2.45.0 */
|
|
495
477
|
|
|
496
478
|
/*
|
|
497
479
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -934,101 +916,6 @@ const defaultDefHTMLPropertyNames = [
|
|
|
934
916
|
'tabIndex',
|
|
935
917
|
'title',
|
|
936
918
|
];
|
|
937
|
-
function offsetPropertyErrorMessage(name) {
|
|
938
|
-
return `Using the \`${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.`;
|
|
939
|
-
}
|
|
940
|
-
// Global HTML Attributes & Properties
|
|
941
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
942
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
943
|
-
//
|
|
944
|
-
// If you update this list, check for test files that recapitulate the same list. Searching the codebase
|
|
945
|
-
// for e.g. "dropzone" should suffice.
|
|
946
|
-
const globalHTMLProperties = {
|
|
947
|
-
accessKey: {
|
|
948
|
-
attribute: 'accesskey',
|
|
949
|
-
},
|
|
950
|
-
accessKeyLabel: {
|
|
951
|
-
readOnly: true,
|
|
952
|
-
},
|
|
953
|
-
className: {
|
|
954
|
-
attribute: 'class',
|
|
955
|
-
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.',
|
|
956
|
-
},
|
|
957
|
-
contentEditable: {
|
|
958
|
-
attribute: 'contenteditable',
|
|
959
|
-
},
|
|
960
|
-
dataset: {
|
|
961
|
-
readOnly: true,
|
|
962
|
-
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.",
|
|
963
|
-
},
|
|
964
|
-
dir: {
|
|
965
|
-
attribute: 'dir',
|
|
966
|
-
},
|
|
967
|
-
draggable: {
|
|
968
|
-
attribute: 'draggable',
|
|
969
|
-
},
|
|
970
|
-
dropzone: {
|
|
971
|
-
attribute: 'dropzone',
|
|
972
|
-
readOnly: true,
|
|
973
|
-
},
|
|
974
|
-
hidden: {
|
|
975
|
-
attribute: 'hidden',
|
|
976
|
-
},
|
|
977
|
-
id: {
|
|
978
|
-
attribute: 'id',
|
|
979
|
-
},
|
|
980
|
-
inputMode: {
|
|
981
|
-
attribute: 'inputmode',
|
|
982
|
-
},
|
|
983
|
-
lang: {
|
|
984
|
-
attribute: 'lang',
|
|
985
|
-
},
|
|
986
|
-
slot: {
|
|
987
|
-
attribute: 'slot',
|
|
988
|
-
error: 'Using the `slot` property is an anti-pattern.',
|
|
989
|
-
},
|
|
990
|
-
spellcheck: {
|
|
991
|
-
attribute: 'spellcheck',
|
|
992
|
-
},
|
|
993
|
-
style: {
|
|
994
|
-
attribute: 'style',
|
|
995
|
-
},
|
|
996
|
-
tabIndex: {
|
|
997
|
-
attribute: 'tabindex',
|
|
998
|
-
},
|
|
999
|
-
title: {
|
|
1000
|
-
attribute: 'title',
|
|
1001
|
-
},
|
|
1002
|
-
translate: {
|
|
1003
|
-
attribute: 'translate',
|
|
1004
|
-
},
|
|
1005
|
-
// additional "global attributes" that are not present in the link above.
|
|
1006
|
-
isContentEditable: {
|
|
1007
|
-
readOnly: true,
|
|
1008
|
-
},
|
|
1009
|
-
offsetHeight: {
|
|
1010
|
-
readOnly: true,
|
|
1011
|
-
error: offsetPropertyErrorMessage('offsetHeight'),
|
|
1012
|
-
},
|
|
1013
|
-
offsetLeft: {
|
|
1014
|
-
readOnly: true,
|
|
1015
|
-
error: offsetPropertyErrorMessage('offsetLeft'),
|
|
1016
|
-
},
|
|
1017
|
-
offsetParent: {
|
|
1018
|
-
readOnly: true,
|
|
1019
|
-
},
|
|
1020
|
-
offsetTop: {
|
|
1021
|
-
readOnly: true,
|
|
1022
|
-
error: offsetPropertyErrorMessage('offsetTop'),
|
|
1023
|
-
},
|
|
1024
|
-
offsetWidth: {
|
|
1025
|
-
readOnly: true,
|
|
1026
|
-
error: offsetPropertyErrorMessage('offsetWidth'),
|
|
1027
|
-
},
|
|
1028
|
-
role: {
|
|
1029
|
-
attribute: 'role',
|
|
1030
|
-
},
|
|
1031
|
-
};
|
|
1032
919
|
let controlledElement = null;
|
|
1033
920
|
let controlledAttributeName;
|
|
1034
921
|
function isAttributeLocked(elm, attrName) {
|
|
@@ -1213,8 +1100,7 @@ function getShadowRootRestrictionsDescriptors(sr) {
|
|
|
1213
1100
|
}),
|
|
1214
1101
|
addEventListener: generateDataDescriptor({
|
|
1215
1102
|
value(type, listener, options) {
|
|
1216
|
-
// TODO [#
|
|
1217
|
-
// programmatically into its Component's shadow root
|
|
1103
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1218
1104
|
if (!isUndefined$1(options)) {
|
|
1219
1105
|
logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
|
|
1220
1106
|
}
|
|
@@ -1260,8 +1146,7 @@ function getCustomElementRestrictionsDescriptors(elm) {
|
|
|
1260
1146
|
}),
|
|
1261
1147
|
addEventListener: generateDataDescriptor({
|
|
1262
1148
|
value(type, listener, options) {
|
|
1263
|
-
// TODO [#
|
|
1264
|
-
// programmatically into a lighting element node
|
|
1149
|
+
// TODO [#1824]: Potentially relax this restriction
|
|
1265
1150
|
if (!isUndefined$1(options)) {
|
|
1266
1151
|
logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
|
|
1267
1152
|
}
|
|
@@ -1289,7 +1174,7 @@ function getComponentRestrictionsDescriptors() {
|
|
|
1289
1174
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1290
1175
|
assertNotProd(); // this method should never leak to prod
|
|
1291
1176
|
const originalDispatchEvent = proto.dispatchEvent;
|
|
1292
|
-
|
|
1177
|
+
return {
|
|
1293
1178
|
dispatchEvent: generateDataDescriptor({
|
|
1294
1179
|
value(event) {
|
|
1295
1180
|
const vm = getAssociatedVM(this);
|
|
@@ -1307,32 +1192,6 @@ function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
|
1307
1192
|
},
|
|
1308
1193
|
}),
|
|
1309
1194
|
};
|
|
1310
|
-
forEach.call(getOwnPropertyNames$1(globalHTMLProperties), (propName) => {
|
|
1311
|
-
if (propName in proto) {
|
|
1312
|
-
return; // no need to redefine something that we are already exposing
|
|
1313
|
-
}
|
|
1314
|
-
descriptors[propName] = generateAccessorDescriptor({
|
|
1315
|
-
get() {
|
|
1316
|
-
const { error, attribute } = globalHTMLProperties[propName];
|
|
1317
|
-
const msg = [];
|
|
1318
|
-
msg.push(`Accessing the global HTML property "${propName}" is disabled.`);
|
|
1319
|
-
if (error) {
|
|
1320
|
-
msg.push(error);
|
|
1321
|
-
}
|
|
1322
|
-
else if (attribute) {
|
|
1323
|
-
msg.push(`Instead access it via \`this.getAttribute("${attribute}")\`.`);
|
|
1324
|
-
}
|
|
1325
|
-
logError(msg.join('\n'), getAssociatedVM(this));
|
|
1326
|
-
},
|
|
1327
|
-
set() {
|
|
1328
|
-
const { readOnly } = globalHTMLProperties[propName];
|
|
1329
|
-
if (readOnly) {
|
|
1330
|
-
logError(`The global HTML property \`${propName}\` is read-only.`, getAssociatedVM(this));
|
|
1331
|
-
}
|
|
1332
|
-
},
|
|
1333
|
-
});
|
|
1334
|
-
});
|
|
1335
|
-
return descriptors;
|
|
1336
1195
|
}
|
|
1337
1196
|
// This routine will prevent access to certain properties on a shadow root instance to guarantee
|
|
1338
1197
|
// that all components will work fine in IE11 and other browsers without shadow dom support.
|
|
@@ -2683,12 +2542,7 @@ function createPublicPropertyDescriptor(key) {
|
|
|
2683
2542
|
}
|
|
2684
2543
|
function createPublicAccessorDescriptor(key, descriptor) {
|
|
2685
2544
|
const { get, set, enumerable, configurable } = descriptor;
|
|
2686
|
-
|
|
2687
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2688
|
-
assert.invariant(isFunction$1(get), `Invalid compiler output for public accessor ${toString$1(key)} decorated with @api`);
|
|
2689
|
-
}
|
|
2690
|
-
throw new Error();
|
|
2691
|
-
}
|
|
2545
|
+
assert.invariant(isFunction$1(get), `Invalid public accessor ${toString$1(key)} decorated with @api. The property is missing a getter.`);
|
|
2692
2546
|
return {
|
|
2693
2547
|
get() {
|
|
2694
2548
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2810,64 +2664,64 @@ function getClassDescriptorType(descriptor) {
|
|
|
2810
2664
|
}
|
|
2811
2665
|
}
|
|
2812
2666
|
function validateObservedField(Ctor, fieldName, descriptor) {
|
|
2667
|
+
assertNotProd(); // this method should never leak to prod
|
|
2813
2668
|
if (!isUndefined$1(descriptor)) {
|
|
2814
2669
|
const type = getClassDescriptorType(descriptor);
|
|
2815
2670
|
const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2816
|
-
// [
|
|
2817
|
-
|
|
2818
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2819
|
-
logError(message);
|
|
2820
|
-
}
|
|
2821
|
-
else {
|
|
2822
|
-
assert.fail(message);
|
|
2823
|
-
}
|
|
2671
|
+
// TODO [#3408]: this should throw, not log
|
|
2672
|
+
logError(message);
|
|
2824
2673
|
}
|
|
2825
2674
|
}
|
|
2826
2675
|
function validateFieldDecoratedWithTrack(Ctor, fieldName, descriptor) {
|
|
2676
|
+
assertNotProd(); // this method should never leak to prod
|
|
2827
2677
|
if (!isUndefined$1(descriptor)) {
|
|
2828
2678
|
const type = getClassDescriptorType(descriptor);
|
|
2829
|
-
|
|
2679
|
+
// TODO [#3408]: this should throw, not log
|
|
2680
|
+
logError(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
|
|
2830
2681
|
}
|
|
2831
2682
|
}
|
|
2832
2683
|
function validateFieldDecoratedWithWire(Ctor, fieldName, descriptor) {
|
|
2684
|
+
assertNotProd(); // this method should never leak to prod
|
|
2833
2685
|
if (!isUndefined$1(descriptor)) {
|
|
2834
2686
|
const type = getClassDescriptorType(descriptor);
|
|
2835
|
-
|
|
2687
|
+
// TODO [#3408]: this should throw, not log
|
|
2688
|
+
logError(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
|
|
2836
2689
|
}
|
|
2837
2690
|
}
|
|
2838
2691
|
function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
|
|
2692
|
+
assertNotProd(); // this method should never leak to prod
|
|
2839
2693
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
2840
|
-
|
|
2694
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2695
|
+
logError(`Invalid @wire ${methodName} field. The field should have a valid writable descriptor.`);
|
|
2841
2696
|
}
|
|
2842
2697
|
}
|
|
2843
2698
|
function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
2699
|
+
assertNotProd(); // this method should never leak to prod
|
|
2844
2700
|
if (!isUndefined$1(descriptor)) {
|
|
2845
2701
|
const type = getClassDescriptorType(descriptor);
|
|
2846
2702
|
const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2847
|
-
// [
|
|
2848
|
-
|
|
2849
|
-
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2850
|
-
logError(message);
|
|
2851
|
-
}
|
|
2852
|
-
else {
|
|
2853
|
-
assert.fail(message);
|
|
2854
|
-
}
|
|
2703
|
+
// TODO [#3408]: this should throw, not log
|
|
2704
|
+
logError(message);
|
|
2855
2705
|
}
|
|
2856
2706
|
}
|
|
2857
2707
|
function validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2708
|
+
assertNotProd(); // this method should never leak to prod
|
|
2709
|
+
if (isFunction$1(descriptor.set)) {
|
|
2710
|
+
if (!isFunction$1(descriptor.get)) {
|
|
2711
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2712
|
+
logError(`Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
|
|
2713
|
+
}
|
|
2863
2714
|
}
|
|
2864
2715
|
else if (!isFunction$1(descriptor.get)) {
|
|
2865
|
-
|
|
2716
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2717
|
+
logError(`Missing @api get ${fieldName} accessor.`);
|
|
2866
2718
|
}
|
|
2867
2719
|
}
|
|
2868
2720
|
function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
|
|
2721
|
+
assertNotProd(); // this method should never leak to prod
|
|
2869
2722
|
if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
|
|
2870
|
-
|
|
2723
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2724
|
+
logError(`Invalid @api ${methodName} method.`);
|
|
2871
2725
|
}
|
|
2872
2726
|
}
|
|
2873
2727
|
/**
|
|
@@ -2890,13 +2744,14 @@ function registerDecorators(Ctor, meta) {
|
|
|
2890
2744
|
apiFieldsConfig[fieldName] = propConfig.config;
|
|
2891
2745
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldName);
|
|
2892
2746
|
if (propConfig.config > 0) {
|
|
2747
|
+
if (isUndefined$1(descriptor)) {
|
|
2748
|
+
// TODO [#3441]: This line of code does not seem possible to reach.
|
|
2749
|
+
throw new Error();
|
|
2750
|
+
}
|
|
2893
2751
|
// accessor declaration
|
|
2894
2752
|
if (process.env.NODE_ENV !== 'production') {
|
|
2895
2753
|
validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor);
|
|
2896
2754
|
}
|
|
2897
|
-
if (isUndefined$1(descriptor)) {
|
|
2898
|
-
throw new Error();
|
|
2899
|
-
}
|
|
2900
2755
|
descriptor = createPublicAccessorDescriptor(fieldName, descriptor);
|
|
2901
2756
|
}
|
|
2902
2757
|
else {
|
|
@@ -2936,7 +2791,10 @@ function registerDecorators(Ctor, meta) {
|
|
|
2936
2791
|
descriptor = getOwnPropertyDescriptor$1(proto, fieldOrMethodName);
|
|
2937
2792
|
if (method === 1) {
|
|
2938
2793
|
if (process.env.NODE_ENV !== 'production') {
|
|
2939
|
-
|
|
2794
|
+
if (!adapter) {
|
|
2795
|
+
// TODO [#3408]: this should throw, not log
|
|
2796
|
+
logError(`@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
|
|
2797
|
+
}
|
|
2940
2798
|
validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
2941
2799
|
}
|
|
2942
2800
|
if (isUndefined$1(descriptor)) {
|
|
@@ -2947,7 +2805,10 @@ function registerDecorators(Ctor, meta) {
|
|
|
2947
2805
|
}
|
|
2948
2806
|
else {
|
|
2949
2807
|
if (process.env.NODE_ENV !== 'production') {
|
|
2950
|
-
|
|
2808
|
+
if (!adapter) {
|
|
2809
|
+
// TODO [#3408]: this should throw, not log
|
|
2810
|
+
logError(`@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
|
|
2811
|
+
}
|
|
2951
2812
|
validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
|
|
2952
2813
|
}
|
|
2953
2814
|
descriptor = internalWireFieldDecorator(fieldOrMethodName);
|
|
@@ -3753,15 +3614,6 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
3753
3614
|
// the stylesheet, while internally, we have a replacement for it.
|
|
3754
3615
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
3755
3616
|
}
|
|
3756
|
-
// Check that this stylesheet was generated by our compiler
|
|
3757
|
-
if (!isStylesheetRegistered(stylesheet)) {
|
|
3758
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3759
|
-
logWarnOnce(`TypeError: Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
|
|
3760
|
-
}
|
|
3761
|
-
report("UnexpectedStylesheetContent" /* ReportingEventId.UnexpectedStylesheetContent */, {
|
|
3762
|
-
tagName: vm.tagName.toLowerCase(),
|
|
3763
|
-
});
|
|
3764
|
-
}
|
|
3765
3617
|
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
3766
3618
|
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS &&
|
|
3767
3619
|
!isScopedCss &&
|
|
@@ -3882,18 +3734,6 @@ function createStylesheet(vm, stylesheets) {
|
|
|
3882
3734
|
}
|
|
3883
3735
|
return null;
|
|
3884
3736
|
}
|
|
3885
|
-
const signedStylesheetSet = new Set();
|
|
3886
|
-
/**
|
|
3887
|
-
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
3888
|
-
* will prevent this function from being imported by userland code.
|
|
3889
|
-
*/
|
|
3890
|
-
function registerStylesheet(stylesheet) {
|
|
3891
|
-
signedStylesheetSet.add(stylesheet);
|
|
3892
|
-
return stylesheet;
|
|
3893
|
-
}
|
|
3894
|
-
function isStylesheetRegistered(stylesheet) {
|
|
3895
|
-
return signedStylesheetSet.has(stylesheet);
|
|
3896
|
-
}
|
|
3897
3737
|
|
|
3898
3738
|
/*
|
|
3899
3739
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6705,7 +6545,7 @@ function checkAndReportViolation(elm, prop, isSetter, setValue) {
|
|
|
6705
6545
|
const vm = findVM(elm);
|
|
6706
6546
|
if (process.env.NODE_ENV !== 'production') {
|
|
6707
6547
|
logWarnOnce(`Element <${elm.tagName.toLowerCase()}> ` +
|
|
6708
|
-
(isUndefined$1(vm) ? '' : `owned by <${vm.tagName.toLowerCase()}> `) +
|
|
6548
|
+
(isUndefined$1(vm) ? '' : `owned by <${vm.elm.tagName.toLowerCase()}> `) +
|
|
6709
6549
|
`uses non-standard property "${prop}". This will be removed in a future version of LWC. ` +
|
|
6710
6550
|
`See https://sfdc.co/deprecated-aria`);
|
|
6711
6551
|
}
|
|
@@ -6822,8 +6662,6 @@ function hydrateNode(node, vnode, renderer) {
|
|
|
6822
6662
|
return renderer.nextSibling(hydratedNode);
|
|
6823
6663
|
}
|
|
6824
6664
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
6825
|
-
const PARENT_NODE_PROP = 'parentNode';
|
|
6826
|
-
const TAG_NAME_PROP = 'tagName';
|
|
6827
6665
|
function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
6828
6666
|
const { getProperty } = renderer;
|
|
6829
6667
|
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
@@ -6835,22 +6673,6 @@ function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
|
6835
6673
|
if (nodeValue === '\u200D' && vnode.text === '') {
|
|
6836
6674
|
return true;
|
|
6837
6675
|
}
|
|
6838
|
-
// Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
|
|
6839
|
-
// but not when generated by the engine client-side.
|
|
6840
|
-
const parentNode = getProperty(node, PARENT_NODE_PROP);
|
|
6841
|
-
// Should never be null, but just to be safe, we check.
|
|
6842
|
-
/* istanbul ignore else */
|
|
6843
|
-
if (!isNull(parentNode)) {
|
|
6844
|
-
const tagName = getProperty(parentNode, TAG_NAME_PROP);
|
|
6845
|
-
// If the tagName is STYLE, then the following condition should always be true.
|
|
6846
|
-
// The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
|
|
6847
|
-
// for component authors to render different `<style>` text content on the client and server.
|
|
6848
|
-
// But just to be safe, we check.
|
|
6849
|
-
/* istanbul ignore next */
|
|
6850
|
-
if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
|
|
6851
|
-
return true;
|
|
6852
|
-
}
|
|
6853
|
-
}
|
|
6854
6676
|
return false;
|
|
6855
6677
|
}
|
|
6856
6678
|
function hydrateText(node, vnode, renderer) {
|
|
@@ -7476,12 +7298,12 @@ function readonly(obj) {
|
|
|
7476
7298
|
if (process.env.NODE_ENV !== 'production') {
|
|
7477
7299
|
// TODO [#1292]: Remove the readonly decorator
|
|
7478
7300
|
if (arguments.length !== 1) {
|
|
7479
|
-
|
|
7301
|
+
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.');
|
|
7480
7302
|
}
|
|
7481
7303
|
}
|
|
7482
7304
|
return getReadOnlyProxy(obj);
|
|
7483
7305
|
}
|
|
7484
|
-
/* version: 2.
|
|
7306
|
+
/* version: 2.45.0 */
|
|
7485
7307
|
|
|
7486
7308
|
/*
|
|
7487
7309
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7909,7 +7731,7 @@ function rendererFactory(baseRenderer) {
|
|
|
7909
7731
|
function isNull(obj) {
|
|
7910
7732
|
return obj === null;
|
|
7911
7733
|
}
|
|
7912
|
-
/** version: 2.
|
|
7734
|
+
/** version: 2.45.0 */
|
|
7913
7735
|
|
|
7914
7736
|
/*
|
|
7915
7737
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8528,7 +8350,7 @@ function registerContextProvider(elm, adapterContextToken, onContextSubscription
|
|
|
8528
8350
|
});
|
|
8529
8351
|
}));
|
|
8530
8352
|
}
|
|
8531
|
-
/* version: 2.
|
|
8353
|
+
/* version: 2.45.0 */
|
|
8532
8354
|
|
|
8533
|
-
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators,
|
|
8355
|
+
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
8534
8356
|
//# sourceMappingURL=engine-dom.js.map
|