lwc 2.45.1 → 2.45.3
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 +101 -60
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +101 -60
- 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 +110 -58
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +114 -62
- 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 +123 -60
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +101 -60
- 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 +110 -58
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +114 -62
- 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 +123 -60
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +7796 -92
- 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 +7795 -72
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +40 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +56 -6
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +71 -12
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +39 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +43 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +40 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +56 -6
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +71 -12
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +39 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +43 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +10 -4
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +10 -4
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +10 -4
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +10 -4
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +10 -4
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +10 -4
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +10 -4
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +10 -4
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +10 -4
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LWC = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/* proxy-compat-disable */
|
|
8
7
|
/**
|
|
9
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
10
12
|
*/
|
|
11
13
|
/*
|
|
12
14
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -49,7 +51,16 @@
|
|
|
49
51
|
*/
|
|
50
52
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
51
53
|
const { isArray: isArray$1 } = Array;
|
|
52
|
-
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;
|
|
54
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, 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;
|
|
55
|
+
// The type of the return value of Array.prototype.every is `this is T[]`. However, once this
|
|
56
|
+
// Array method is pulled out of the prototype, the function is now referencing `this` where
|
|
57
|
+
// `this` is meaningless, resulting in a TypeScript compilation error.
|
|
58
|
+
//
|
|
59
|
+
// Exposing this helper function is the closest we can get to preserving the usage patterns
|
|
60
|
+
// of Array.prototype methods used elsewhere in the codebase.
|
|
61
|
+
function arrayEvery(arr, predicate) {
|
|
62
|
+
return ArrayEvery.call(arr, predicate);
|
|
63
|
+
}
|
|
53
64
|
const { fromCharCode: StringFromCharCode } = String;
|
|
54
65
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
55
66
|
function isUndefined$1(obj) {
|
|
@@ -187,7 +198,7 @@
|
|
|
187
198
|
})();
|
|
188
199
|
// These attributes take either an ID or a list of IDs as values.
|
|
189
200
|
// This includes aria-* attributes as well as the special non-ARIA "for" attribute
|
|
190
|
-
const ID_REFERENCING_ATTRIBUTES_SET = new Set([
|
|
201
|
+
const ID_REFERENCING_ATTRIBUTES_SET = /*@__PURE__*/ new Set([
|
|
191
202
|
'aria-activedescendant',
|
|
192
203
|
'aria-controls',
|
|
193
204
|
'aria-describedby',
|
|
@@ -274,11 +285,11 @@
|
|
|
274
285
|
/**
|
|
275
286
|
* Map associating previously transformed HTML property into HTML attribute.
|
|
276
287
|
*/
|
|
277
|
-
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
|
|
288
|
+
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
|
|
278
289
|
/**
|
|
279
290
|
* Map associating previously transformed HTML attribute into HTML property.
|
|
280
291
|
*/
|
|
281
|
-
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = new Map();
|
|
292
|
+
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
|
|
282
293
|
function htmlPropertyToAttribute(propName) {
|
|
283
294
|
const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
|
|
284
295
|
if (!isUndefined$1(ariaAttributeName)) {
|
|
@@ -324,10 +335,10 @@
|
|
|
324
335
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
325
336
|
return propertyName;
|
|
326
337
|
}
|
|
327
|
-
/** version: 2.45.
|
|
338
|
+
/** version: 2.45.3 */
|
|
328
339
|
|
|
329
340
|
/**
|
|
330
|
-
* Copyright (C)
|
|
341
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
331
342
|
*/
|
|
332
343
|
|
|
333
344
|
/*
|
|
@@ -391,10 +402,10 @@
|
|
|
391
402
|
*/
|
|
392
403
|
function setFeatureFlagForTest(name, value) {
|
|
393
404
|
}
|
|
394
|
-
/** version: 2.45.
|
|
405
|
+
/** version: 2.45.3 */
|
|
395
406
|
|
|
396
407
|
/**
|
|
397
|
-
* Copyright (C)
|
|
408
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
398
409
|
*/
|
|
399
410
|
|
|
400
411
|
/*
|
|
@@ -455,7 +466,7 @@
|
|
|
455
466
|
}
|
|
456
467
|
}
|
|
457
468
|
}
|
|
458
|
-
/** version: 2.45.
|
|
469
|
+
/** version: 2.45.3 */
|
|
459
470
|
|
|
460
471
|
/*
|
|
461
472
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -469,7 +480,9 @@
|
|
|
469
480
|
applyAriaReflection();
|
|
470
481
|
}
|
|
471
482
|
|
|
472
|
-
|
|
483
|
+
/**
|
|
484
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
485
|
+
*/
|
|
473
486
|
|
|
474
487
|
/*
|
|
475
488
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -618,6 +631,9 @@
|
|
|
618
631
|
function logError(message, vm) {
|
|
619
632
|
log('error', message, vm, false);
|
|
620
633
|
}
|
|
634
|
+
function logWarn(message, vm) {
|
|
635
|
+
log('warn', message, vm, false);
|
|
636
|
+
}
|
|
621
637
|
|
|
622
638
|
/*
|
|
623
639
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -866,19 +882,6 @@
|
|
|
866
882
|
'tabIndex',
|
|
867
883
|
'title',
|
|
868
884
|
];
|
|
869
|
-
let controlledElement = null;
|
|
870
|
-
let controlledAttributeName;
|
|
871
|
-
function isAttributeLocked(elm, attrName) {
|
|
872
|
-
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
873
|
-
}
|
|
874
|
-
function lockAttribute(_elm, _key) {
|
|
875
|
-
controlledElement = null;
|
|
876
|
-
controlledAttributeName = undefined;
|
|
877
|
-
}
|
|
878
|
-
function unlockAttribute(elm, key) {
|
|
879
|
-
controlledElement = elm;
|
|
880
|
-
controlledAttributeName = key;
|
|
881
|
-
}
|
|
882
885
|
|
|
883
886
|
/*
|
|
884
887
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1375,6 +1378,14 @@
|
|
|
1375
1378
|
* SPDX-License-Identifier: MIT
|
|
1376
1379
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1377
1380
|
*/
|
|
1381
|
+
/**
|
|
1382
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
1383
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
1384
|
+
* instance of a component class, and shared across all instances.
|
|
1385
|
+
*
|
|
1386
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
1387
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
1388
|
+
*/
|
|
1378
1389
|
/**
|
|
1379
1390
|
* This operation is called with a descriptor of an standard html property
|
|
1380
1391
|
* that a Custom Element can support (including AOM properties), which
|
|
@@ -1492,15 +1503,11 @@
|
|
|
1492
1503
|
removeAttribute(name) {
|
|
1493
1504
|
const vm = getAssociatedVM(this);
|
|
1494
1505
|
const { elm, renderer: { removeAttribute }, } = vm;
|
|
1495
|
-
unlockAttribute(elm, name);
|
|
1496
1506
|
removeAttribute(elm, name);
|
|
1497
|
-
lockAttribute();
|
|
1498
1507
|
},
|
|
1499
1508
|
removeAttributeNS(namespace, name) {
|
|
1500
1509
|
const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
|
|
1501
|
-
unlockAttribute(elm, name);
|
|
1502
1510
|
removeAttribute(elm, name, namespace);
|
|
1503
|
-
lockAttribute();
|
|
1504
1511
|
},
|
|
1505
1512
|
getAttribute(name) {
|
|
1506
1513
|
const vm = getAssociatedVM(this);
|
|
@@ -1517,16 +1524,12 @@
|
|
|
1517
1524
|
setAttribute(name, value) {
|
|
1518
1525
|
const vm = getAssociatedVM(this);
|
|
1519
1526
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1520
|
-
unlockAttribute(elm, name);
|
|
1521
1527
|
setAttribute(elm, name, value);
|
|
1522
|
-
lockAttribute();
|
|
1523
1528
|
},
|
|
1524
1529
|
setAttributeNS(namespace, name, value) {
|
|
1525
1530
|
const vm = getAssociatedVM(this);
|
|
1526
1531
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1527
|
-
unlockAttribute(elm, name);
|
|
1528
1532
|
setAttribute(elm, name, value, namespace);
|
|
1529
|
-
lockAttribute();
|
|
1530
1533
|
},
|
|
1531
1534
|
getBoundingClientRect() {
|
|
1532
1535
|
const vm = getAssociatedVM(this);
|
|
@@ -1837,7 +1840,7 @@
|
|
|
1837
1840
|
});
|
|
1838
1841
|
runWithBoundaryProtection(vm, vm, noop, () => {
|
|
1839
1842
|
// job
|
|
1840
|
-
connector = new adapter(dataCallback);
|
|
1843
|
+
connector = new adapter(dataCallback, { tagName: vm.tagName });
|
|
1841
1844
|
}, noop);
|
|
1842
1845
|
const updateConnectorConfig = (config) => {
|
|
1843
1846
|
// every time the config is recomputed due to tracking,
|
|
@@ -2203,6 +2206,10 @@
|
|
|
2203
2206
|
* SPDX-License-Identifier: MIT
|
|
2204
2207
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2205
2208
|
*/
|
|
2209
|
+
/**
|
|
2210
|
+
* This module is responsible for creating the base bridge class BaseBridgeElement
|
|
2211
|
+
* that represents the HTMLElement extension used for any LWC inserted in the DOM.
|
|
2212
|
+
*/
|
|
2206
2213
|
// A bridge descriptor is a descriptor whose job is just to get the component instance
|
|
2207
2214
|
// from the element instance, and get the value or set a new value on the component.
|
|
2208
2215
|
// This means that across different elements, similar names can get the exact same
|
|
@@ -2256,14 +2263,6 @@
|
|
|
2256
2263
|
}
|
|
2257
2264
|
return;
|
|
2258
2265
|
}
|
|
2259
|
-
if (!isAttributeLocked(this, attrName)) {
|
|
2260
|
-
// Ignore changes triggered by the engine itself during:
|
|
2261
|
-
// * diffing when public props are attempting to reflect to the DOM
|
|
2262
|
-
// * component via `this.setAttribute()`, should never update the prop
|
|
2263
|
-
// Both cases, the setAttribute call is always wrapped by the unlocking of the
|
|
2264
|
-
// attribute to be changed
|
|
2265
|
-
return;
|
|
2266
|
-
}
|
|
2267
2266
|
// Reflect attribute change to the corresponding property when changed from outside.
|
|
2268
2267
|
this[propName] = newValue;
|
|
2269
2268
|
};
|
|
@@ -2445,6 +2444,15 @@
|
|
|
2445
2444
|
}
|
|
2446
2445
|
}
|
|
2447
2446
|
const WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
|
|
2447
|
+
|
|
2448
|
+
/*
|
|
2449
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
2450
|
+
* All rights reserved.
|
|
2451
|
+
* SPDX-License-Identifier: MIT
|
|
2452
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2453
|
+
*/
|
|
2454
|
+
new WeakMap();
|
|
2455
|
+
new WeakMap();
|
|
2448
2456
|
const swappedStyleMap = new WeakMap();
|
|
2449
2457
|
// The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
|
|
2450
2458
|
// so we don't want to create strong references to them.
|
|
@@ -2506,6 +2514,14 @@
|
|
|
2506
2514
|
* SPDX-License-Identifier: MIT
|
|
2507
2515
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2508
2516
|
*/
|
|
2517
|
+
/**
|
|
2518
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
2519
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
2520
|
+
* instance of a component class, and shared across all instances.
|
|
2521
|
+
*
|
|
2522
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
2523
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
2524
|
+
*/
|
|
2509
2525
|
const CtorToDefMap = new WeakMap();
|
|
2510
2526
|
function getCtorProto(Ctor) {
|
|
2511
2527
|
let proto = getPrototypeOf$1(Ctor);
|
|
@@ -2908,7 +2924,6 @@
|
|
|
2908
2924
|
const cur = attrs[key];
|
|
2909
2925
|
const old = oldAttrs[key];
|
|
2910
2926
|
if (old !== cur) {
|
|
2911
|
-
unlockAttribute(elm, key);
|
|
2912
2927
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
|
|
2913
2928
|
// Assume xml namespace
|
|
2914
2929
|
setAttribute(elm, key, cur, XML_NAMESPACE);
|
|
@@ -2923,7 +2938,6 @@
|
|
|
2923
2938
|
else {
|
|
2924
2939
|
setAttribute(elm, key, cur);
|
|
2925
2940
|
}
|
|
2926
|
-
lockAttribute();
|
|
2927
2941
|
}
|
|
2928
2942
|
}
|
|
2929
2943
|
}
|
|
@@ -5373,6 +5387,27 @@
|
|
|
5373
5387
|
return renderer.nextSibling(hydratedNode);
|
|
5374
5388
|
}
|
|
5375
5389
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
5390
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
5391
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
5392
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
5393
|
+
function getValidationPredicate(optOutStaticProp) {
|
|
5394
|
+
if (isUndefined$1(optOutStaticProp)) {
|
|
5395
|
+
return (_attrName) => true;
|
|
5396
|
+
}
|
|
5397
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
5398
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
5399
|
+
if (isTrue(optOutStaticProp)) {
|
|
5400
|
+
return (_attrName) => false;
|
|
5401
|
+
}
|
|
5402
|
+
// If validationOptOut is an array of strings, attributes specified in the
|
|
5403
|
+
// array will be "opted out". Attributes not specified in the array will still
|
|
5404
|
+
// be validated.
|
|
5405
|
+
if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
|
|
5406
|
+
return (attrName) => !ArrayIncludes.call(optOutStaticProp, attrName);
|
|
5407
|
+
}
|
|
5408
|
+
logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
|
|
5409
|
+
return (_attrName) => true;
|
|
5410
|
+
}
|
|
5376
5411
|
function hydrateText(node, vnode, renderer) {
|
|
5377
5412
|
var _a;
|
|
5378
5413
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -5434,8 +5469,19 @@
|
|
|
5434
5469
|
return elm;
|
|
5435
5470
|
}
|
|
5436
5471
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
5472
|
+
const { validationOptOut } = vnode.ctor;
|
|
5473
|
+
const shouldValidateAttr = getValidationPredicate(validationOptOut);
|
|
5474
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
5475
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
5476
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
5477
|
+
//
|
|
5478
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
5479
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
5480
|
+
//
|
|
5481
|
+
// Therefore, if validationOptOut is falsey or an array of strings, we need to
|
|
5482
|
+
// examine some or all of the custom element's attributes.
|
|
5437
5483
|
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
5438
|
-
!isMatchingElement(vnode, elm, renderer)) {
|
|
5484
|
+
!isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
|
|
5439
5485
|
return handleMismatch(elm, vnode, renderer);
|
|
5440
5486
|
}
|
|
5441
5487
|
const { sel, mode, ctor, owner } = vnode;
|
|
@@ -5461,19 +5507,17 @@
|
|
|
5461
5507
|
}
|
|
5462
5508
|
function hydrateChildren(node, children, parentNode, owner) {
|
|
5463
5509
|
let nextNode = node;
|
|
5464
|
-
let anchor = null;
|
|
5465
5510
|
const { renderer } = owner;
|
|
5466
5511
|
for (let i = 0; i < children.length; i++) {
|
|
5467
5512
|
const childVnode = children[i];
|
|
5468
5513
|
if (!isNull(childVnode)) {
|
|
5469
5514
|
if (nextNode) {
|
|
5470
5515
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
5471
|
-
anchor = childVnode.elm;
|
|
5472
5516
|
}
|
|
5473
5517
|
else {
|
|
5474
5518
|
hasMismatch = true;
|
|
5475
|
-
mount(childVnode, parentNode, renderer,
|
|
5476
|
-
|
|
5519
|
+
mount(childVnode, parentNode, renderer, nextNode);
|
|
5520
|
+
nextNode = renderer.nextSibling(childVnode.elm);
|
|
5477
5521
|
}
|
|
5478
5522
|
}
|
|
5479
5523
|
}
|
|
@@ -5510,15 +5554,19 @@
|
|
|
5510
5554
|
}
|
|
5511
5555
|
return true;
|
|
5512
5556
|
}
|
|
5513
|
-
function isMatchingElement(vnode, elm, renderer) {
|
|
5557
|
+
function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true) {
|
|
5514
5558
|
const { getProperty } = renderer;
|
|
5515
5559
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
5516
5560
|
return false;
|
|
5517
5561
|
}
|
|
5518
|
-
const
|
|
5519
|
-
const
|
|
5520
|
-
|
|
5521
|
-
|
|
5562
|
+
const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
|
|
5563
|
+
const hasCompatibleClass = shouldValidateAttr('class')
|
|
5564
|
+
? validateClassAttr(vnode, elm, renderer)
|
|
5565
|
+
: true;
|
|
5566
|
+
const hasCompatibleStyle = shouldValidateAttr('style')
|
|
5567
|
+
? validateStyleAttr(vnode, elm, renderer)
|
|
5568
|
+
: true;
|
|
5569
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
5522
5570
|
}
|
|
5523
5571
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
5524
5572
|
const vnodeValueAsString = String(vnodeValue);
|
|
@@ -5533,12 +5581,15 @@
|
|
|
5533
5581
|
// In all other cases, the two values are not considered equal
|
|
5534
5582
|
return false;
|
|
5535
5583
|
}
|
|
5536
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
5584
|
+
function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
|
|
5537
5585
|
const { data: { attrs = {} }, } = vnode;
|
|
5538
5586
|
let nodesAreCompatible = true;
|
|
5539
5587
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5540
5588
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5541
5589
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
5590
|
+
if (!shouldValidateAttr(attrName)) {
|
|
5591
|
+
continue;
|
|
5592
|
+
}
|
|
5542
5593
|
const { getAttribute } = renderer;
|
|
5543
5594
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
5544
5595
|
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
@@ -6096,6 +6147,7 @@
|
|
|
6096
6147
|
* SPDX-License-Identifier: MIT
|
|
6097
6148
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6098
6149
|
*/
|
|
6150
|
+
new WeakMap();
|
|
6099
6151
|
// Creates a custom element for compat (legacy) browser environments
|
|
6100
6152
|
const createCustomElementCompat = (tagName, upgradeCallback) => {
|
|
6101
6153
|
const elm = document.createElement(tagName);
|
|
@@ -6222,7 +6274,7 @@
|
|
|
6222
6274
|
const renderer = (function (exports) {
|
|
6223
6275
|
|
|
6224
6276
|
/**
|
|
6225
|
-
* Copyright (C)
|
|
6277
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
6226
6278
|
*/
|
|
6227
6279
|
/*
|
|
6228
6280
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6262,7 +6314,7 @@
|
|
|
6262
6314
|
function isNull(obj) {
|
|
6263
6315
|
return obj === null;
|
|
6264
6316
|
}
|
|
6265
|
-
/** version: 2.45.
|
|
6317
|
+
/** version: 2.45.3 */
|
|
6266
6318
|
|
|
6267
6319
|
/*
|
|
6268
6320
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -6873,7 +6925,7 @@
|
|
|
6873
6925
|
});
|
|
6874
6926
|
}));
|
|
6875
6927
|
}
|
|
6876
|
-
|
|
6928
|
+
/** version: 2.45.3 */
|
|
6877
6929
|
|
|
6878
6930
|
exports.LightningElement = LightningElement;
|
|
6879
6931
|
exports.__unstable__ProfilerControl = profilerControl;
|