lwc 2.5.10 → 2.7.1
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 +100 -96
- package/dist/engine-dom/iife/es2017/engine-dom.js +100 -96
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +99 -91
- package/dist/engine-dom/iife/es5/engine-dom.js +112 -108
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +111 -103
- package/dist/engine-dom/umd/es2017/engine-dom.js +100 -96
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +99 -91
- package/dist/engine-dom/umd/es5/engine-dom.js +112 -108
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +111 -103
- package/dist/engine-server/commonjs/es2017/engine-server.js +111 -104
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +111 -104
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +56 -133
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +56 -133
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +56 -133
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +67 -130
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +67 -130
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +56 -133
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +56 -133
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +67 -130
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +67 -130
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +11 -11
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +11 -11
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
- package/package.json +8 -8
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
7
|
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
9
|
+
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
|
|
8
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
13
|
|
|
10
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
11
15
|
/*
|
|
12
16
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
13
17
|
* All rights reserved.
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
var KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
118
122
|
var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
119
123
|
var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
120
|
-
/** version: 2.
|
|
124
|
+
/** version: 2.7.1 */
|
|
121
125
|
|
|
122
126
|
/*
|
|
123
127
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -216,6 +220,9 @@
|
|
|
216
220
|
var shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : function () {
|
|
217
221
|
return null;
|
|
218
222
|
};
|
|
223
|
+
var assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : function () {
|
|
224
|
+
return null;
|
|
225
|
+
};
|
|
219
226
|
/*
|
|
220
227
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
221
228
|
* All rights reserved.
|
|
@@ -348,9 +355,9 @@
|
|
|
348
355
|
function apply$4() {
|
|
349
356
|
// IE11 does not have this element definition
|
|
350
357
|
// we don't care much about the construction phase, just the prototype
|
|
351
|
-
var HTMLSlotElement = function HTMLSlotElement() {
|
|
358
|
+
var HTMLSlotElement = /*#__PURE__*/_createClass(function HTMLSlotElement() {
|
|
352
359
|
_classCallCheck(this, HTMLSlotElement);
|
|
353
|
-
}; // prototype inheritance dance
|
|
360
|
+
}); // prototype inheritance dance
|
|
354
361
|
|
|
355
362
|
|
|
356
363
|
setPrototypeOf(HTMLSlotElement, HTMLElement.constructor);
|
|
@@ -436,20 +443,6 @@
|
|
|
436
443
|
|
|
437
444
|
return cloned;
|
|
438
445
|
}
|
|
439
|
-
/**
|
|
440
|
-
* Copyright (C) 2018 salesforce.com, inc.
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (!_globalThis.lwcRuntimeFlags) {
|
|
445
|
-
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
446
|
-
value: create(null)
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
451
|
-
/** version: 2.5.10 */
|
|
452
|
-
|
|
453
446
|
/*
|
|
454
447
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
455
448
|
* All rights reserved.
|
|
@@ -457,6 +450,7 @@
|
|
|
457
450
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
458
451
|
*/
|
|
459
452
|
|
|
453
|
+
|
|
460
454
|
var eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
|
|
461
455
|
var addEventListener = eventTargetPrototype.addEventListener,
|
|
462
456
|
dispatchEvent = eventTargetPrototype.dispatchEvent,
|
|
@@ -505,17 +499,9 @@
|
|
|
505
499
|
// This function is invoked from an event listener and currentTarget is always defined.
|
|
506
500
|
var currentTarget = eventCurrentTargetGetter.call(event);
|
|
507
501
|
|
|
508
|
-
var
|
|
509
|
-
var shouldInvoke;
|
|
502
|
+
var actualTarget = getActualTarget(event);
|
|
510
503
|
|
|
511
|
-
if (
|
|
512
|
-
shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
|
|
513
|
-
} else {
|
|
514
|
-
var actualTarget = getActualTarget(event);
|
|
515
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
if (!shouldInvoke) {
|
|
504
|
+
if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
519
505
|
return;
|
|
520
506
|
}
|
|
521
507
|
|
|
@@ -536,25 +522,6 @@
|
|
|
536
522
|
|
|
537
523
|
|
|
538
524
|
var eventToContextMap = new WeakMap();
|
|
539
|
-
|
|
540
|
-
function isChildNode(root, node) {
|
|
541
|
-
return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
var GET_ROOT_NODE_CONFIG_FALSE = {
|
|
545
|
-
composed: false
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
function getRootNodeHost(node, options) {
|
|
549
|
-
var rootNode = node.getRootNode(options);
|
|
550
|
-
|
|
551
|
-
if (isSyntheticShadowRoot(rootNode)) {
|
|
552
|
-
rootNode = getHost(rootNode);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
return rootNode;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
525
|
var customElementToWrappedListeners = new WeakMap();
|
|
559
526
|
|
|
560
527
|
function getEventMap(elm) {
|
|
@@ -599,16 +566,9 @@
|
|
|
599
566
|
currentTarget = getShadowRoot(currentTarget);
|
|
600
567
|
}
|
|
601
568
|
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
605
|
-
shouldInvoke = shouldInvokeShadowRootListener(event);
|
|
606
|
-
} else {
|
|
607
|
-
var actualTarget = getActualTarget(event);
|
|
608
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
609
|
-
}
|
|
569
|
+
var actualTarget = getActualTarget(event);
|
|
610
570
|
|
|
611
|
-
if (
|
|
571
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
612
572
|
listener.call(currentTarget, event);
|
|
613
573
|
}
|
|
614
574
|
};
|
|
@@ -635,16 +595,9 @@
|
|
|
635
595
|
customElementWrappedListener = function customElementWrappedListener(event) {
|
|
636
596
|
// currentTarget is always defined inside an event listener
|
|
637
597
|
var currentTarget = eventCurrentTargetGetter.call(event);
|
|
638
|
-
var
|
|
639
|
-
|
|
640
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
641
|
-
shouldInvoke = shouldInvokeCustomElementListener(event);
|
|
642
|
-
} else {
|
|
643
|
-
var actualTarget = getActualTarget(event);
|
|
644
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
645
|
-
}
|
|
598
|
+
var actualTarget = getActualTarget(event);
|
|
646
599
|
|
|
647
|
-
if (
|
|
600
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
648
601
|
listener.call(currentTarget, event);
|
|
649
602
|
}
|
|
650
603
|
};
|
|
@@ -761,66 +714,6 @@
|
|
|
761
714
|
}
|
|
762
715
|
}
|
|
763
716
|
|
|
764
|
-
function shouldInvokeCustomElementListener(event) {
|
|
765
|
-
var composed = event.composed;
|
|
766
|
-
|
|
767
|
-
if (isTrue(composed)) {
|
|
768
|
-
// Listeners on host elements should always be invoked for {composed: true} events.
|
|
769
|
-
return true;
|
|
770
|
-
} // If this {composed: false} event was dispatched on any root.
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if (eventToShadowRootMap.has(event)) {
|
|
774
|
-
return false;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
var target = eventTargetGetter.call(event);
|
|
778
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
|
|
779
|
-
|
|
780
|
-
if (target === currentTarget) {
|
|
781
|
-
return true;
|
|
782
|
-
} // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
783
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
784
|
-
// host was assigned to a slot in the composed subtree of the current target host.
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
788
|
-
var currentTargetHost = currentTarget;
|
|
789
|
-
return isChildNode(targetHost, currentTargetHost);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
function shouldInvokeShadowRootListener(event) {
|
|
793
|
-
var composed = event.composed;
|
|
794
|
-
var target = eventTargetGetter.call(event);
|
|
795
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
|
|
796
|
-
|
|
797
|
-
if (target === currentTarget) {
|
|
798
|
-
// Invoke the listener if the event was dispatched directly on the root.
|
|
799
|
-
return eventToShadowRootMap.get(event) === getShadowRoot(target);
|
|
800
|
-
} // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
if (isTrue(composed)) {
|
|
804
|
-
// Invoke the listener if the event is {composed: true}.
|
|
805
|
-
return true;
|
|
806
|
-
} // At this point the event must be {bubbles: true, composed: false}.
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (isTrue(eventToShadowRootMap.has(event))) {
|
|
810
|
-
// Don't invoke the listener because the event was dispatched on a descendant root.
|
|
811
|
-
return false;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
815
|
-
var currentTargetHost = currentTarget;
|
|
816
|
-
var isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
817
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
818
|
-
// host was assigned to a slot in the composed subtree of the current target host, or the
|
|
819
|
-
// descendant node is in the shadow tree of the current root.
|
|
820
|
-
|
|
821
|
-
return isCurrentTargetSlotted || targetHost === currentTargetHost;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
717
|
function addCustomElementEventListener(type, listener, _options) {
|
|
825
718
|
|
|
826
719
|
|
|
@@ -1513,6 +1406,20 @@
|
|
|
1513
1406
|
}
|
|
1514
1407
|
}
|
|
1515
1408
|
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
1411
|
+
*/
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
if (!_globalThis.lwcRuntimeFlags) {
|
|
1415
|
+
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
1416
|
+
value: create(null)
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1421
|
+
/** version: 2.7.1 */
|
|
1422
|
+
|
|
1516
1423
|
/*
|
|
1517
1424
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1518
1425
|
* All rights reserved.
|
|
@@ -1527,7 +1434,6 @@
|
|
|
1527
1434
|
* because we don't want to patch the children getters for those elements.
|
|
1528
1435
|
*/
|
|
1529
1436
|
|
|
1530
|
-
|
|
1531
1437
|
function hasMountedChildren(node) {
|
|
1532
1438
|
return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
|
|
1533
1439
|
}
|
|
@@ -1606,7 +1512,9 @@
|
|
|
1606
1512
|
}
|
|
1607
1513
|
|
|
1608
1514
|
function compareDocumentPositionPatched(otherNode) {
|
|
1609
|
-
if (this
|
|
1515
|
+
if (this === otherNode) {
|
|
1516
|
+
return 0;
|
|
1517
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1610
1518
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1611
1519
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1612
1520
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -2090,6 +1998,12 @@
|
|
|
2090
1998
|
value: function value() {
|
|
2091
1999
|
return "[object ShadowRoot]";
|
|
2092
2000
|
}
|
|
2001
|
+
},
|
|
2002
|
+
synthetic: {
|
|
2003
|
+
writable: false,
|
|
2004
|
+
enumerable: false,
|
|
2005
|
+
configurable: false,
|
|
2006
|
+
value: true
|
|
2093
2007
|
}
|
|
2094
2008
|
};
|
|
2095
2009
|
var ShadowRootDescriptors = {
|
|
@@ -3782,6 +3696,16 @@
|
|
|
3782
3696
|
*/
|
|
3783
3697
|
|
|
3784
3698
|
retargetRelatedTarget(MouseEvent);
|
|
3699
|
+
/*
|
|
3700
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
3701
|
+
* All rights reserved.
|
|
3702
|
+
* SPDX-License-Identifier: MIT
|
|
3703
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3704
|
+
*/
|
|
3705
|
+
|
|
3706
|
+
var assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get : function () {
|
|
3707
|
+
return null;
|
|
3708
|
+
};
|
|
3785
3709
|
/*
|
|
3786
3710
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3787
3711
|
* All rights reserved.
|
|
@@ -3830,10 +3754,22 @@
|
|
|
3830
3754
|
}
|
|
3831
3755
|
|
|
3832
3756
|
function assignedSlotGetterPatched() {
|
|
3833
|
-
var parentNode = parentNodeGetter.call(this);
|
|
3757
|
+
var parentNode = parentNodeGetter.call(this); // use original assignedSlot if parent has a native shdow root
|
|
3758
|
+
|
|
3759
|
+
if (parentNode instanceof Element) {
|
|
3760
|
+
var sr = shadowRootGetter.call(parentNode);
|
|
3761
|
+
|
|
3762
|
+
if (isInstanceOfNativeShadowRoot(sr)) {
|
|
3763
|
+
if (this instanceof Text) {
|
|
3764
|
+
return assignedSlotGetter.call(this);
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
return assignedSlotGetter$1.call(this);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3834
3770
|
/**
|
|
3835
3771
|
* The node is assigned to a slot if:
|
|
3836
|
-
* - it has a parent and
|
|
3772
|
+
* - it has a parent and its parent is a slot element
|
|
3837
3773
|
* - and if the slot owner key is different than the node owner key.
|
|
3838
3774
|
*
|
|
3839
3775
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -3842,6 +3778,7 @@
|
|
|
3842
3778
|
* different than the node owner key (always `undefined`).
|
|
3843
3779
|
*/
|
|
3844
3780
|
|
|
3781
|
+
|
|
3845
3782
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
3846
3783
|
return parentNode;
|
|
3847
3784
|
}
|
|
@@ -5435,6 +5372,6 @@
|
|
|
5435
5372
|
},
|
|
5436
5373
|
configurable: true
|
|
5437
5374
|
});
|
|
5438
|
-
/** version: 2.
|
|
5375
|
+
/** version: 2.7.1 */
|
|
5439
5376
|
|
|
5440
5377
|
})();
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
// we can't use typeof since it will fail when transpiling.
|
|
200
200
|
|
|
201
201
|
const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
|
|
202
|
-
/** version: 2.
|
|
202
|
+
/** version: 2.7.1 */
|
|
203
203
|
|
|
204
204
|
/*
|
|
205
205
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -307,6 +307,7 @@
|
|
|
307
307
|
getElementsByClassName: getElementsByClassName$1
|
|
308
308
|
} = HTMLElement.prototype;
|
|
309
309
|
const shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : () => null;
|
|
310
|
+
const assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : () => null;
|
|
310
311
|
/*
|
|
311
312
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
312
313
|
* All rights reserved.
|
|
@@ -526,20 +527,6 @@
|
|
|
526
527
|
|
|
527
528
|
return cloned;
|
|
528
529
|
}
|
|
529
|
-
/**
|
|
530
|
-
* Copyright (C) 2018 salesforce.com, inc.
|
|
531
|
-
*/
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
if (!_globalThis.lwcRuntimeFlags) {
|
|
535
|
-
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
536
|
-
value: create(null)
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
541
|
-
/** version: 2.5.10 */
|
|
542
|
-
|
|
543
530
|
/*
|
|
544
531
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
545
532
|
* All rights reserved.
|
|
@@ -547,6 +534,7 @@
|
|
|
547
534
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
548
535
|
*/
|
|
549
536
|
|
|
537
|
+
|
|
550
538
|
const eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
|
|
551
539
|
const {
|
|
552
540
|
addEventListener,
|
|
@@ -601,19 +589,9 @@
|
|
|
601
589
|
assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');
|
|
602
590
|
}
|
|
603
591
|
|
|
604
|
-
const
|
|
605
|
-
composed
|
|
606
|
-
} = event;
|
|
607
|
-
let shouldInvoke;
|
|
608
|
-
|
|
609
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
610
|
-
shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
|
|
611
|
-
} else {
|
|
612
|
-
const actualTarget = getActualTarget(event);
|
|
613
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
614
|
-
}
|
|
592
|
+
const actualTarget = getActualTarget(event);
|
|
615
593
|
|
|
616
|
-
if (!
|
|
594
|
+
if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
617
595
|
return;
|
|
618
596
|
}
|
|
619
597
|
|
|
@@ -634,25 +612,6 @@
|
|
|
634
612
|
|
|
635
613
|
|
|
636
614
|
const eventToContextMap = new WeakMap();
|
|
637
|
-
|
|
638
|
-
function isChildNode(root, node) {
|
|
639
|
-
return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
const GET_ROOT_NODE_CONFIG_FALSE = {
|
|
643
|
-
composed: false
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
function getRootNodeHost(node, options) {
|
|
647
|
-
let rootNode = node.getRootNode(options);
|
|
648
|
-
|
|
649
|
-
if (isSyntheticShadowRoot(rootNode)) {
|
|
650
|
-
rootNode = getHost(rootNode);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
return rootNode;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
615
|
const customElementToWrappedListeners = new WeakMap();
|
|
657
616
|
|
|
658
617
|
function getEventMap(elm) {
|
|
@@ -697,16 +656,9 @@
|
|
|
697
656
|
currentTarget = getShadowRoot(currentTarget);
|
|
698
657
|
}
|
|
699
658
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
703
|
-
shouldInvoke = shouldInvokeShadowRootListener(event);
|
|
704
|
-
} else {
|
|
705
|
-
const actualTarget = getActualTarget(event);
|
|
706
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
707
|
-
}
|
|
659
|
+
const actualTarget = getActualTarget(event);
|
|
708
660
|
|
|
709
|
-
if (
|
|
661
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
710
662
|
listener.call(currentTarget, event);
|
|
711
663
|
}
|
|
712
664
|
};
|
|
@@ -733,16 +685,9 @@
|
|
|
733
685
|
customElementWrappedListener = function (event) {
|
|
734
686
|
// currentTarget is always defined inside an event listener
|
|
735
687
|
const currentTarget = eventCurrentTargetGetter.call(event);
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
739
|
-
shouldInvoke = shouldInvokeCustomElementListener(event);
|
|
740
|
-
} else {
|
|
741
|
-
const actualTarget = getActualTarget(event);
|
|
742
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
743
|
-
}
|
|
688
|
+
const actualTarget = getActualTarget(event);
|
|
744
689
|
|
|
745
|
-
if (
|
|
690
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
746
691
|
listener.call(currentTarget, event);
|
|
747
692
|
}
|
|
748
693
|
};
|
|
@@ -863,70 +808,6 @@
|
|
|
863
808
|
}
|
|
864
809
|
}
|
|
865
810
|
|
|
866
|
-
function shouldInvokeCustomElementListener(event) {
|
|
867
|
-
const {
|
|
868
|
-
composed
|
|
869
|
-
} = event;
|
|
870
|
-
|
|
871
|
-
if (isTrue(composed)) {
|
|
872
|
-
// Listeners on host elements should always be invoked for {composed: true} events.
|
|
873
|
-
return true;
|
|
874
|
-
} // If this {composed: false} event was dispatched on any root.
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
if (eventToShadowRootMap.has(event)) {
|
|
878
|
-
return false;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
const target = eventTargetGetter.call(event);
|
|
882
|
-
const currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
|
|
883
|
-
|
|
884
|
-
if (target === currentTarget) {
|
|
885
|
-
return true;
|
|
886
|
-
} // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
887
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
888
|
-
// host was assigned to a slot in the composed subtree of the current target host.
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
892
|
-
const currentTargetHost = currentTarget;
|
|
893
|
-
return isChildNode(targetHost, currentTargetHost);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
function shouldInvokeShadowRootListener(event) {
|
|
897
|
-
const {
|
|
898
|
-
composed
|
|
899
|
-
} = event;
|
|
900
|
-
const target = eventTargetGetter.call(event);
|
|
901
|
-
const currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
|
|
902
|
-
|
|
903
|
-
if (target === currentTarget) {
|
|
904
|
-
// Invoke the listener if the event was dispatched directly on the root.
|
|
905
|
-
return eventToShadowRootMap.get(event) === getShadowRoot(target);
|
|
906
|
-
} // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
if (isTrue(composed)) {
|
|
910
|
-
// Invoke the listener if the event is {composed: true}.
|
|
911
|
-
return true;
|
|
912
|
-
} // At this point the event must be {bubbles: true, composed: false}.
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if (isTrue(eventToShadowRootMap.has(event))) {
|
|
916
|
-
// Don't invoke the listener because the event was dispatched on a descendant root.
|
|
917
|
-
return false;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
921
|
-
const currentTargetHost = currentTarget;
|
|
922
|
-
const isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
923
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
924
|
-
// host was assigned to a slot in the composed subtree of the current target host, or the
|
|
925
|
-
// descendant node is in the shadow tree of the current root.
|
|
926
|
-
|
|
927
|
-
return isCurrentTargetSlotted || targetHost === currentTargetHost;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
811
|
function addCustomElementEventListener(type, listener, _options) {
|
|
931
812
|
if (process.env.NODE_ENV !== 'production') {
|
|
932
813
|
if (!isFunction(listener)) {
|
|
@@ -1674,6 +1555,20 @@
|
|
|
1674
1555
|
}
|
|
1675
1556
|
}
|
|
1676
1557
|
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
1560
|
+
*/
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
if (!_globalThis.lwcRuntimeFlags) {
|
|
1564
|
+
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
1565
|
+
value: create(null)
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1570
|
+
/** version: 2.7.1 */
|
|
1571
|
+
|
|
1677
1572
|
/*
|
|
1678
1573
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1679
1574
|
* All rights reserved.
|
|
@@ -1688,7 +1583,6 @@
|
|
|
1688
1583
|
* because we don't want to patch the children getters for those elements.
|
|
1689
1584
|
*/
|
|
1690
1585
|
|
|
1691
|
-
|
|
1692
1586
|
function hasMountedChildren(node) {
|
|
1693
1587
|
return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
|
|
1694
1588
|
}
|
|
@@ -1767,7 +1661,9 @@
|
|
|
1767
1661
|
}
|
|
1768
1662
|
|
|
1769
1663
|
function compareDocumentPositionPatched(otherNode) {
|
|
1770
|
-
if (this
|
|
1664
|
+
if (this === otherNode) {
|
|
1665
|
+
return 0;
|
|
1666
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1771
1667
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1772
1668
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1773
1669
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -2307,6 +2203,12 @@
|
|
|
2307
2203
|
return `[object ShadowRoot]`;
|
|
2308
2204
|
}
|
|
2309
2205
|
|
|
2206
|
+
},
|
|
2207
|
+
synthetic: {
|
|
2208
|
+
writable: false,
|
|
2209
|
+
enumerable: false,
|
|
2210
|
+
configurable: false,
|
|
2211
|
+
value: true
|
|
2310
2212
|
}
|
|
2311
2213
|
};
|
|
2312
2214
|
const ShadowRootDescriptors = {
|
|
@@ -4145,6 +4047,14 @@
|
|
|
4145
4047
|
*/
|
|
4146
4048
|
|
|
4147
4049
|
retargetRelatedTarget(MouseEvent);
|
|
4050
|
+
/*
|
|
4051
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
4052
|
+
* All rights reserved.
|
|
4053
|
+
* SPDX-License-Identifier: MIT
|
|
4054
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
4055
|
+
*/
|
|
4056
|
+
|
|
4057
|
+
const assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get : () => null;
|
|
4148
4058
|
/*
|
|
4149
4059
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4150
4060
|
* All rights reserved.
|
|
@@ -4198,10 +4108,22 @@
|
|
|
4198
4108
|
}
|
|
4199
4109
|
|
|
4200
4110
|
function assignedSlotGetterPatched() {
|
|
4201
|
-
const parentNode = parentNodeGetter.call(this);
|
|
4111
|
+
const parentNode = parentNodeGetter.call(this); // use original assignedSlot if parent has a native shdow root
|
|
4112
|
+
|
|
4113
|
+
if (parentNode instanceof Element) {
|
|
4114
|
+
const sr = shadowRootGetter.call(parentNode);
|
|
4115
|
+
|
|
4116
|
+
if (isInstanceOfNativeShadowRoot(sr)) {
|
|
4117
|
+
if (this instanceof Text) {
|
|
4118
|
+
return assignedSlotGetter.call(this);
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
return assignedSlotGetter$1.call(this);
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4202
4124
|
/**
|
|
4203
4125
|
* The node is assigned to a slot if:
|
|
4204
|
-
* - it has a parent and
|
|
4126
|
+
* - it has a parent and its parent is a slot element
|
|
4205
4127
|
* - and if the slot owner key is different than the node owner key.
|
|
4206
4128
|
*
|
|
4207
4129
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -4210,6 +4132,7 @@
|
|
|
4210
4132
|
* different than the node owner key (always `undefined`).
|
|
4211
4133
|
*/
|
|
4212
4134
|
|
|
4135
|
+
|
|
4213
4136
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
4214
4137
|
return parentNode;
|
|
4215
4138
|
}
|
|
@@ -5834,6 +5757,6 @@
|
|
|
5834
5757
|
|
|
5835
5758
|
configurable: true
|
|
5836
5759
|
});
|
|
5837
|
-
/** version: 2.
|
|
5760
|
+
/** version: 2.7.1 */
|
|
5838
5761
|
|
|
5839
5762
|
}));
|