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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
var LWC = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
/* proxy-compat-disable */
|
|
5
4
|
/**
|
|
6
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
7
9
|
*/
|
|
8
10
|
/*
|
|
9
11
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -46,7 +48,16 @@ var LWC = (function (exports) {
|
|
|
46
48
|
*/
|
|
47
49
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
48
50
|
const { isArray: isArray$1 } = Array;
|
|
49
|
-
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;
|
|
51
|
+
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;
|
|
52
|
+
// The type of the return value of Array.prototype.every is `this is T[]`. However, once this
|
|
53
|
+
// Array method is pulled out of the prototype, the function is now referencing `this` where
|
|
54
|
+
// `this` is meaningless, resulting in a TypeScript compilation error.
|
|
55
|
+
//
|
|
56
|
+
// Exposing this helper function is the closest we can get to preserving the usage patterns
|
|
57
|
+
// of Array.prototype methods used elsewhere in the codebase.
|
|
58
|
+
function arrayEvery(arr, predicate) {
|
|
59
|
+
return ArrayEvery.call(arr, predicate);
|
|
60
|
+
}
|
|
50
61
|
const { fromCharCode: StringFromCharCode } = String;
|
|
51
62
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
52
63
|
function isUndefined$1(obj) {
|
|
@@ -184,7 +195,7 @@ var LWC = (function (exports) {
|
|
|
184
195
|
})();
|
|
185
196
|
// These attributes take either an ID or a list of IDs as values.
|
|
186
197
|
// This includes aria-* attributes as well as the special non-ARIA "for" attribute
|
|
187
|
-
const ID_REFERENCING_ATTRIBUTES_SET = new Set([
|
|
198
|
+
const ID_REFERENCING_ATTRIBUTES_SET = /*@__PURE__*/ new Set([
|
|
188
199
|
'aria-activedescendant',
|
|
189
200
|
'aria-controls',
|
|
190
201
|
'aria-describedby',
|
|
@@ -271,11 +282,11 @@ var LWC = (function (exports) {
|
|
|
271
282
|
/**
|
|
272
283
|
* Map associating previously transformed HTML property into HTML attribute.
|
|
273
284
|
*/
|
|
274
|
-
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
|
|
285
|
+
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
|
|
275
286
|
/**
|
|
276
287
|
* Map associating previously transformed HTML attribute into HTML property.
|
|
277
288
|
*/
|
|
278
|
-
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = new Map();
|
|
289
|
+
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
|
|
279
290
|
function htmlPropertyToAttribute(propName) {
|
|
280
291
|
const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
|
|
281
292
|
if (!isUndefined$1(ariaAttributeName)) {
|
|
@@ -321,10 +332,10 @@ var LWC = (function (exports) {
|
|
|
321
332
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
322
333
|
return propertyName;
|
|
323
334
|
}
|
|
324
|
-
/** version: 2.45.
|
|
335
|
+
/** version: 2.45.3 */
|
|
325
336
|
|
|
326
337
|
/**
|
|
327
|
-
* Copyright (C)
|
|
338
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
328
339
|
*/
|
|
329
340
|
|
|
330
341
|
/*
|
|
@@ -388,10 +399,10 @@ var LWC = (function (exports) {
|
|
|
388
399
|
*/
|
|
389
400
|
function setFeatureFlagForTest(name, value) {
|
|
390
401
|
}
|
|
391
|
-
/** version: 2.45.
|
|
402
|
+
/** version: 2.45.3 */
|
|
392
403
|
|
|
393
404
|
/**
|
|
394
|
-
* Copyright (C)
|
|
405
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
395
406
|
*/
|
|
396
407
|
|
|
397
408
|
/*
|
|
@@ -452,7 +463,7 @@ var LWC = (function (exports) {
|
|
|
452
463
|
}
|
|
453
464
|
}
|
|
454
465
|
}
|
|
455
|
-
/** version: 2.45.
|
|
466
|
+
/** version: 2.45.3 */
|
|
456
467
|
|
|
457
468
|
/*
|
|
458
469
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -466,7 +477,9 @@ var LWC = (function (exports) {
|
|
|
466
477
|
applyAriaReflection();
|
|
467
478
|
}
|
|
468
479
|
|
|
469
|
-
|
|
480
|
+
/**
|
|
481
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
482
|
+
*/
|
|
470
483
|
|
|
471
484
|
/*
|
|
472
485
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -615,6 +628,9 @@ var LWC = (function (exports) {
|
|
|
615
628
|
function logError(message, vm) {
|
|
616
629
|
log('error', message, vm, false);
|
|
617
630
|
}
|
|
631
|
+
function logWarn(message, vm) {
|
|
632
|
+
log('warn', message, vm, false);
|
|
633
|
+
}
|
|
618
634
|
|
|
619
635
|
/*
|
|
620
636
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -863,19 +879,6 @@ var LWC = (function (exports) {
|
|
|
863
879
|
'tabIndex',
|
|
864
880
|
'title',
|
|
865
881
|
];
|
|
866
|
-
let controlledElement = null;
|
|
867
|
-
let controlledAttributeName;
|
|
868
|
-
function isAttributeLocked(elm, attrName) {
|
|
869
|
-
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
870
|
-
}
|
|
871
|
-
function lockAttribute(_elm, _key) {
|
|
872
|
-
controlledElement = null;
|
|
873
|
-
controlledAttributeName = undefined;
|
|
874
|
-
}
|
|
875
|
-
function unlockAttribute(elm, key) {
|
|
876
|
-
controlledElement = elm;
|
|
877
|
-
controlledAttributeName = key;
|
|
878
|
-
}
|
|
879
882
|
|
|
880
883
|
/*
|
|
881
884
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1372,6 +1375,14 @@ var LWC = (function (exports) {
|
|
|
1372
1375
|
* SPDX-License-Identifier: MIT
|
|
1373
1376
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1374
1377
|
*/
|
|
1378
|
+
/**
|
|
1379
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
1380
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
1381
|
+
* instance of a component class, and shared across all instances.
|
|
1382
|
+
*
|
|
1383
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
1384
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
1385
|
+
*/
|
|
1375
1386
|
/**
|
|
1376
1387
|
* This operation is called with a descriptor of an standard html property
|
|
1377
1388
|
* that a Custom Element can support (including AOM properties), which
|
|
@@ -1489,15 +1500,11 @@ var LWC = (function (exports) {
|
|
|
1489
1500
|
removeAttribute(name) {
|
|
1490
1501
|
const vm = getAssociatedVM(this);
|
|
1491
1502
|
const { elm, renderer: { removeAttribute }, } = vm;
|
|
1492
|
-
unlockAttribute(elm, name);
|
|
1493
1503
|
removeAttribute(elm, name);
|
|
1494
|
-
lockAttribute();
|
|
1495
1504
|
},
|
|
1496
1505
|
removeAttributeNS(namespace, name) {
|
|
1497
1506
|
const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
|
|
1498
|
-
unlockAttribute(elm, name);
|
|
1499
1507
|
removeAttribute(elm, name, namespace);
|
|
1500
|
-
lockAttribute();
|
|
1501
1508
|
},
|
|
1502
1509
|
getAttribute(name) {
|
|
1503
1510
|
const vm = getAssociatedVM(this);
|
|
@@ -1514,16 +1521,12 @@ var LWC = (function (exports) {
|
|
|
1514
1521
|
setAttribute(name, value) {
|
|
1515
1522
|
const vm = getAssociatedVM(this);
|
|
1516
1523
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1517
|
-
unlockAttribute(elm, name);
|
|
1518
1524
|
setAttribute(elm, name, value);
|
|
1519
|
-
lockAttribute();
|
|
1520
1525
|
},
|
|
1521
1526
|
setAttributeNS(namespace, name, value) {
|
|
1522
1527
|
const vm = getAssociatedVM(this);
|
|
1523
1528
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1524
|
-
unlockAttribute(elm, name);
|
|
1525
1529
|
setAttribute(elm, name, value, namespace);
|
|
1526
|
-
lockAttribute();
|
|
1527
1530
|
},
|
|
1528
1531
|
getBoundingClientRect() {
|
|
1529
1532
|
const vm = getAssociatedVM(this);
|
|
@@ -1834,7 +1837,7 @@ var LWC = (function (exports) {
|
|
|
1834
1837
|
});
|
|
1835
1838
|
runWithBoundaryProtection(vm, vm, noop, () => {
|
|
1836
1839
|
// job
|
|
1837
|
-
connector = new adapter(dataCallback);
|
|
1840
|
+
connector = new adapter(dataCallback, { tagName: vm.tagName });
|
|
1838
1841
|
}, noop);
|
|
1839
1842
|
const updateConnectorConfig = (config) => {
|
|
1840
1843
|
// every time the config is recomputed due to tracking,
|
|
@@ -2200,6 +2203,10 @@ var LWC = (function (exports) {
|
|
|
2200
2203
|
* SPDX-License-Identifier: MIT
|
|
2201
2204
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2202
2205
|
*/
|
|
2206
|
+
/**
|
|
2207
|
+
* This module is responsible for creating the base bridge class BaseBridgeElement
|
|
2208
|
+
* that represents the HTMLElement extension used for any LWC inserted in the DOM.
|
|
2209
|
+
*/
|
|
2203
2210
|
// A bridge descriptor is a descriptor whose job is just to get the component instance
|
|
2204
2211
|
// from the element instance, and get the value or set a new value on the component.
|
|
2205
2212
|
// This means that across different elements, similar names can get the exact same
|
|
@@ -2253,14 +2260,6 @@ var LWC = (function (exports) {
|
|
|
2253
2260
|
}
|
|
2254
2261
|
return;
|
|
2255
2262
|
}
|
|
2256
|
-
if (!isAttributeLocked(this, attrName)) {
|
|
2257
|
-
// Ignore changes triggered by the engine itself during:
|
|
2258
|
-
// * diffing when public props are attempting to reflect to the DOM
|
|
2259
|
-
// * component via `this.setAttribute()`, should never update the prop
|
|
2260
|
-
// Both cases, the setAttribute call is always wrapped by the unlocking of the
|
|
2261
|
-
// attribute to be changed
|
|
2262
|
-
return;
|
|
2263
|
-
}
|
|
2264
2263
|
// Reflect attribute change to the corresponding property when changed from outside.
|
|
2265
2264
|
this[propName] = newValue;
|
|
2266
2265
|
};
|
|
@@ -2442,6 +2441,15 @@ var LWC = (function (exports) {
|
|
|
2442
2441
|
}
|
|
2443
2442
|
}
|
|
2444
2443
|
const WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
|
|
2444
|
+
|
|
2445
|
+
/*
|
|
2446
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
2447
|
+
* All rights reserved.
|
|
2448
|
+
* SPDX-License-Identifier: MIT
|
|
2449
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2450
|
+
*/
|
|
2451
|
+
new WeakMap();
|
|
2452
|
+
new WeakMap();
|
|
2445
2453
|
const swappedStyleMap = new WeakMap();
|
|
2446
2454
|
// The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
|
|
2447
2455
|
// so we don't want to create strong references to them.
|
|
@@ -2503,6 +2511,14 @@ var LWC = (function (exports) {
|
|
|
2503
2511
|
* SPDX-License-Identifier: MIT
|
|
2504
2512
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2505
2513
|
*/
|
|
2514
|
+
/**
|
|
2515
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
2516
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
2517
|
+
* instance of a component class, and shared across all instances.
|
|
2518
|
+
*
|
|
2519
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
2520
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
2521
|
+
*/
|
|
2506
2522
|
const CtorToDefMap = new WeakMap();
|
|
2507
2523
|
function getCtorProto(Ctor) {
|
|
2508
2524
|
let proto = getPrototypeOf$1(Ctor);
|
|
@@ -2905,7 +2921,6 @@ var LWC = (function (exports) {
|
|
|
2905
2921
|
const cur = attrs[key];
|
|
2906
2922
|
const old = oldAttrs[key];
|
|
2907
2923
|
if (old !== cur) {
|
|
2908
|
-
unlockAttribute(elm, key);
|
|
2909
2924
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
|
|
2910
2925
|
// Assume xml namespace
|
|
2911
2926
|
setAttribute(elm, key, cur, XML_NAMESPACE);
|
|
@@ -2920,7 +2935,6 @@ var LWC = (function (exports) {
|
|
|
2920
2935
|
else {
|
|
2921
2936
|
setAttribute(elm, key, cur);
|
|
2922
2937
|
}
|
|
2923
|
-
lockAttribute();
|
|
2924
2938
|
}
|
|
2925
2939
|
}
|
|
2926
2940
|
}
|
|
@@ -5370,6 +5384,27 @@ var LWC = (function (exports) {
|
|
|
5370
5384
|
return renderer.nextSibling(hydratedNode);
|
|
5371
5385
|
}
|
|
5372
5386
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
5387
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
5388
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
5389
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
5390
|
+
function getValidationPredicate(optOutStaticProp) {
|
|
5391
|
+
if (isUndefined$1(optOutStaticProp)) {
|
|
5392
|
+
return (_attrName) => true;
|
|
5393
|
+
}
|
|
5394
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
5395
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
5396
|
+
if (isTrue(optOutStaticProp)) {
|
|
5397
|
+
return (_attrName) => false;
|
|
5398
|
+
}
|
|
5399
|
+
// If validationOptOut is an array of strings, attributes specified in the
|
|
5400
|
+
// array will be "opted out". Attributes not specified in the array will still
|
|
5401
|
+
// be validated.
|
|
5402
|
+
if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
|
|
5403
|
+
return (attrName) => !ArrayIncludes.call(optOutStaticProp, attrName);
|
|
5404
|
+
}
|
|
5405
|
+
logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
|
|
5406
|
+
return (_attrName) => true;
|
|
5407
|
+
}
|
|
5373
5408
|
function hydrateText(node, vnode, renderer) {
|
|
5374
5409
|
var _a;
|
|
5375
5410
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -5431,8 +5466,19 @@ var LWC = (function (exports) {
|
|
|
5431
5466
|
return elm;
|
|
5432
5467
|
}
|
|
5433
5468
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
5469
|
+
const { validationOptOut } = vnode.ctor;
|
|
5470
|
+
const shouldValidateAttr = getValidationPredicate(validationOptOut);
|
|
5471
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
5472
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
5473
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
5474
|
+
//
|
|
5475
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
5476
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
5477
|
+
//
|
|
5478
|
+
// Therefore, if validationOptOut is falsey or an array of strings, we need to
|
|
5479
|
+
// examine some or all of the custom element's attributes.
|
|
5434
5480
|
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
5435
|
-
!isMatchingElement(vnode, elm, renderer)) {
|
|
5481
|
+
!isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
|
|
5436
5482
|
return handleMismatch(elm, vnode, renderer);
|
|
5437
5483
|
}
|
|
5438
5484
|
const { sel, mode, ctor, owner } = vnode;
|
|
@@ -5458,19 +5504,17 @@ var LWC = (function (exports) {
|
|
|
5458
5504
|
}
|
|
5459
5505
|
function hydrateChildren(node, children, parentNode, owner) {
|
|
5460
5506
|
let nextNode = node;
|
|
5461
|
-
let anchor = null;
|
|
5462
5507
|
const { renderer } = owner;
|
|
5463
5508
|
for (let i = 0; i < children.length; i++) {
|
|
5464
5509
|
const childVnode = children[i];
|
|
5465
5510
|
if (!isNull(childVnode)) {
|
|
5466
5511
|
if (nextNode) {
|
|
5467
5512
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
5468
|
-
anchor = childVnode.elm;
|
|
5469
5513
|
}
|
|
5470
5514
|
else {
|
|
5471
5515
|
hasMismatch = true;
|
|
5472
|
-
mount(childVnode, parentNode, renderer,
|
|
5473
|
-
|
|
5516
|
+
mount(childVnode, parentNode, renderer, nextNode);
|
|
5517
|
+
nextNode = renderer.nextSibling(childVnode.elm);
|
|
5474
5518
|
}
|
|
5475
5519
|
}
|
|
5476
5520
|
}
|
|
@@ -5507,15 +5551,19 @@ var LWC = (function (exports) {
|
|
|
5507
5551
|
}
|
|
5508
5552
|
return true;
|
|
5509
5553
|
}
|
|
5510
|
-
function isMatchingElement(vnode, elm, renderer) {
|
|
5554
|
+
function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true) {
|
|
5511
5555
|
const { getProperty } = renderer;
|
|
5512
5556
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
5513
5557
|
return false;
|
|
5514
5558
|
}
|
|
5515
|
-
const
|
|
5516
|
-
const
|
|
5517
|
-
|
|
5518
|
-
|
|
5559
|
+
const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
|
|
5560
|
+
const hasCompatibleClass = shouldValidateAttr('class')
|
|
5561
|
+
? validateClassAttr(vnode, elm, renderer)
|
|
5562
|
+
: true;
|
|
5563
|
+
const hasCompatibleStyle = shouldValidateAttr('style')
|
|
5564
|
+
? validateStyleAttr(vnode, elm, renderer)
|
|
5565
|
+
: true;
|
|
5566
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
5519
5567
|
}
|
|
5520
5568
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
5521
5569
|
const vnodeValueAsString = String(vnodeValue);
|
|
@@ -5530,12 +5578,15 @@ var LWC = (function (exports) {
|
|
|
5530
5578
|
// In all other cases, the two values are not considered equal
|
|
5531
5579
|
return false;
|
|
5532
5580
|
}
|
|
5533
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
5581
|
+
function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
|
|
5534
5582
|
const { data: { attrs = {} }, } = vnode;
|
|
5535
5583
|
let nodesAreCompatible = true;
|
|
5536
5584
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5537
5585
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5538
5586
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
5587
|
+
if (!shouldValidateAttr(attrName)) {
|
|
5588
|
+
continue;
|
|
5589
|
+
}
|
|
5539
5590
|
const { getAttribute } = renderer;
|
|
5540
5591
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
5541
5592
|
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
@@ -6093,6 +6144,7 @@ var LWC = (function (exports) {
|
|
|
6093
6144
|
* SPDX-License-Identifier: MIT
|
|
6094
6145
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6095
6146
|
*/
|
|
6147
|
+
new WeakMap();
|
|
6096
6148
|
// Creates a custom element for compat (legacy) browser environments
|
|
6097
6149
|
const createCustomElementCompat = (tagName, upgradeCallback) => {
|
|
6098
6150
|
const elm = document.createElement(tagName);
|
|
@@ -6219,7 +6271,7 @@ var LWC = (function (exports) {
|
|
|
6219
6271
|
const renderer = (function (exports) {
|
|
6220
6272
|
|
|
6221
6273
|
/**
|
|
6222
|
-
* Copyright (C)
|
|
6274
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
6223
6275
|
*/
|
|
6224
6276
|
/*
|
|
6225
6277
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6259,7 +6311,7 @@ var LWC = (function (exports) {
|
|
|
6259
6311
|
function isNull(obj) {
|
|
6260
6312
|
return obj === null;
|
|
6261
6313
|
}
|
|
6262
|
-
/** version: 2.45.
|
|
6314
|
+
/** version: 2.45.3 */
|
|
6263
6315
|
|
|
6264
6316
|
/*
|
|
6265
6317
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -6870,7 +6922,7 @@ var LWC = (function (exports) {
|
|
|
6870
6922
|
});
|
|
6871
6923
|
}));
|
|
6872
6924
|
}
|
|
6873
|
-
|
|
6925
|
+
/** version: 2.45.3 */
|
|
6874
6926
|
|
|
6875
6927
|
exports.LightningElement = LightningElement;
|
|
6876
6928
|
exports.__unstable__ProfilerControl = profilerControl;
|