lwc 2.7.1 → 2.7.2
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 +578 -379
- package/dist/engine-dom/iife/es2017/engine-dom.js +578 -379
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +552 -359
- package/dist/engine-dom/iife/es5/engine-dom.js +630 -330
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +598 -310
- package/dist/engine-dom/umd/es2017/engine-dom.js +578 -379
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +552 -359
- package/dist/engine-dom/umd/es5/engine-dom.js +630 -330
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +598 -310
- package/dist/engine-server/commonjs/es2017/engine-server.js +647 -449
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +647 -449
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +41 -6
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +41 -6
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +41 -6
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +41 -6
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +41 -6
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +41 -6
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +41 -6
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +41 -6
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +41 -6
- 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 +3 -3
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
- 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 +3 -3
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +3 -3
- package/package.json +8 -8
|
@@ -299,7 +299,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
300
300
|
return attributeName;
|
|
301
301
|
}
|
|
302
|
-
/** version: 2.7.
|
|
302
|
+
/** version: 2.7.2 */
|
|
303
303
|
|
|
304
304
|
/*
|
|
305
305
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -477,7 +477,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
477
477
|
setFeatureFlag(name, value);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
/** version: 2.7.
|
|
480
|
+
/** version: 2.7.2 */
|
|
481
481
|
|
|
482
482
|
/* proxy-compat-disable */
|
|
483
483
|
|
|
@@ -551,6 +551,249 @@ function parseStyleText(cssText) {
|
|
|
551
551
|
}
|
|
552
552
|
|
|
553
553
|
return styleMap;
|
|
554
|
+
} //
|
|
555
|
+
// Primitives
|
|
556
|
+
//
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
let ssr$1;
|
|
560
|
+
|
|
561
|
+
function setSsr(ssrImpl) {
|
|
562
|
+
ssr$1 = ssrImpl;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
let isNativeShadowDefined$1;
|
|
566
|
+
|
|
567
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
568
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
let isSyntheticShadowDefined$1;
|
|
572
|
+
|
|
573
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
574
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
let HTMLElementExported$1;
|
|
578
|
+
|
|
579
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
580
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
let isHydrating$1;
|
|
584
|
+
|
|
585
|
+
function setIsHydrating$1(isHydratingImpl) {
|
|
586
|
+
isHydrating$1 = isHydratingImpl;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
let insert$1;
|
|
590
|
+
|
|
591
|
+
function setInsert(insertImpl) {
|
|
592
|
+
insert$1 = insertImpl;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
let remove$1;
|
|
596
|
+
|
|
597
|
+
function setRemove(removeImpl) {
|
|
598
|
+
remove$1 = removeImpl;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
let createElement$2;
|
|
602
|
+
|
|
603
|
+
function setCreateElement(createElementImpl) {
|
|
604
|
+
createElement$2 = createElementImpl;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
let createText$1;
|
|
608
|
+
|
|
609
|
+
function setCreateText(createTextImpl) {
|
|
610
|
+
createText$1 = createTextImpl;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
let createComment$1;
|
|
614
|
+
|
|
615
|
+
function setCreateComment(createCommentImpl) {
|
|
616
|
+
createComment$1 = createCommentImpl;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
let nextSibling$1;
|
|
620
|
+
|
|
621
|
+
function setNextSibling(nextSiblingImpl) {
|
|
622
|
+
nextSibling$1 = nextSiblingImpl;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
let attachShadow$1;
|
|
626
|
+
|
|
627
|
+
function setAttachShadow(attachShadowImpl) {
|
|
628
|
+
attachShadow$1 = attachShadowImpl;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
let getProperty$1;
|
|
632
|
+
|
|
633
|
+
function setGetProperty(getPropertyImpl) {
|
|
634
|
+
getProperty$1 = getPropertyImpl;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
let setProperty$1;
|
|
638
|
+
|
|
639
|
+
function setSetProperty(setPropertyImpl) {
|
|
640
|
+
setProperty$1 = setPropertyImpl;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
let setText$1;
|
|
644
|
+
|
|
645
|
+
function setSetText(setTextImpl) {
|
|
646
|
+
setText$1 = setTextImpl;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
let getAttribute$1;
|
|
650
|
+
|
|
651
|
+
function setGetAttribute(getAttributeImpl) {
|
|
652
|
+
getAttribute$1 = getAttributeImpl;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
let setAttribute$1;
|
|
656
|
+
|
|
657
|
+
function setSetAttribute(setAttributeImpl) {
|
|
658
|
+
setAttribute$1 = setAttributeImpl;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
let removeAttribute$1;
|
|
662
|
+
|
|
663
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
664
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
let addEventListener$1;
|
|
668
|
+
|
|
669
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
670
|
+
addEventListener$1 = addEventListenerImpl;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
let removeEventListener$1;
|
|
674
|
+
|
|
675
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
676
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
let dispatchEvent$1;
|
|
680
|
+
|
|
681
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
682
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
let getClassList$1;
|
|
686
|
+
|
|
687
|
+
function setGetClassList(getClassListImpl) {
|
|
688
|
+
getClassList$1 = getClassListImpl;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
let setCSSStyleProperty$1;
|
|
692
|
+
|
|
693
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
694
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
let getBoundingClientRect$1;
|
|
698
|
+
|
|
699
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
700
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
let querySelector$1;
|
|
704
|
+
|
|
705
|
+
function setQuerySelector(querySelectorImpl) {
|
|
706
|
+
querySelector$1 = querySelectorImpl;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
let querySelectorAll$1;
|
|
710
|
+
|
|
711
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
712
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
let getElementsByTagName$1;
|
|
716
|
+
|
|
717
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
718
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
let getElementsByClassName$1;
|
|
722
|
+
|
|
723
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
724
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
let getChildren$1;
|
|
728
|
+
|
|
729
|
+
function setGetChildren(getChildrenImpl) {
|
|
730
|
+
getChildren$1 = getChildrenImpl;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
let getChildNodes$1;
|
|
734
|
+
|
|
735
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
736
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
let getFirstChild$1;
|
|
740
|
+
|
|
741
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
742
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
let getFirstElementChild$1;
|
|
746
|
+
|
|
747
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
748
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
let getLastChild$1;
|
|
752
|
+
|
|
753
|
+
function setGetLastChild(getLastChildImpl) {
|
|
754
|
+
getLastChild$1 = getLastChildImpl;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
let getLastElementChild$1;
|
|
758
|
+
|
|
759
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
760
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
let isConnected$1;
|
|
764
|
+
|
|
765
|
+
function setIsConnected(isConnectedImpl) {
|
|
766
|
+
isConnected$1 = isConnectedImpl;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
let insertGlobalStylesheet$1;
|
|
770
|
+
|
|
771
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
772
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
let insertStylesheet$1;
|
|
776
|
+
|
|
777
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
778
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
let assertInstanceOfHTMLElement$1;
|
|
782
|
+
|
|
783
|
+
function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
|
|
784
|
+
assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
let defineCustomElement$1;
|
|
788
|
+
|
|
789
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
790
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
let getCustomElement$1;
|
|
794
|
+
|
|
795
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
796
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
554
797
|
}
|
|
555
798
|
/*
|
|
556
799
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -804,9 +1047,6 @@ function createAllEventListeners(vnode) {
|
|
|
804
1047
|
elm,
|
|
805
1048
|
data: {
|
|
806
1049
|
on
|
|
807
|
-
},
|
|
808
|
-
owner: {
|
|
809
|
-
renderer
|
|
810
1050
|
}
|
|
811
1051
|
} = vnode;
|
|
812
1052
|
|
|
@@ -819,7 +1059,7 @@ function createAllEventListeners(vnode) {
|
|
|
819
1059
|
let name;
|
|
820
1060
|
|
|
821
1061
|
for (name in on) {
|
|
822
|
-
|
|
1062
|
+
addEventListener$1(elm, name, listener);
|
|
823
1063
|
}
|
|
824
1064
|
}
|
|
825
1065
|
|
|
@@ -961,9 +1201,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
961
1201
|
const {
|
|
962
1202
|
data: {
|
|
963
1203
|
attrs
|
|
964
|
-
},
|
|
965
|
-
owner: {
|
|
966
|
-
renderer
|
|
967
1204
|
}
|
|
968
1205
|
} = vnode;
|
|
969
1206
|
|
|
@@ -986,10 +1223,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
986
1223
|
}
|
|
987
1224
|
|
|
988
1225
|
const elm = vnode.elm;
|
|
989
|
-
const {
|
|
990
|
-
setAttribute,
|
|
991
|
-
removeAttribute
|
|
992
|
-
} = renderer;
|
|
993
1226
|
let key;
|
|
994
1227
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
995
1228
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -1004,14 +1237,14 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
1004
1237
|
|
|
1005
1238
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
1006
1239
|
// Assume xml namespace
|
|
1007
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
1240
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
1008
1241
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
1009
1242
|
// Assume xlink namespace
|
|
1010
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
1011
|
-
} else if (isNull(cur)) {
|
|
1012
|
-
removeAttribute(elm, key);
|
|
1243
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
1244
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
1245
|
+
removeAttribute$1(elm, key);
|
|
1013
1246
|
} else {
|
|
1014
|
-
setAttribute(elm, key, cur);
|
|
1247
|
+
setAttribute$1(elm, key, cur);
|
|
1015
1248
|
}
|
|
1016
1249
|
|
|
1017
1250
|
lockAttribute();
|
|
@@ -1059,17 +1292,14 @@ function update(oldVnode, vnode) {
|
|
|
1059
1292
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
1060
1293
|
const {
|
|
1061
1294
|
elm,
|
|
1062
|
-
sel
|
|
1063
|
-
owner: {
|
|
1064
|
-
renderer
|
|
1065
|
-
}
|
|
1295
|
+
sel
|
|
1066
1296
|
} = vnode;
|
|
1067
1297
|
|
|
1068
1298
|
for (const key in props) {
|
|
1069
1299
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1070
1300
|
|
|
1071
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
1072
|
-
|
|
1301
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
1302
|
+
setProperty$1(elm, key, cur);
|
|
1073
1303
|
}
|
|
1074
1304
|
}
|
|
1075
1305
|
}
|
|
@@ -1138,9 +1368,6 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1138
1368
|
elm,
|
|
1139
1369
|
data: {
|
|
1140
1370
|
className: newClass
|
|
1141
|
-
},
|
|
1142
|
-
owner: {
|
|
1143
|
-
renderer
|
|
1144
1371
|
}
|
|
1145
1372
|
} = vnode;
|
|
1146
1373
|
const {
|
|
@@ -1153,7 +1380,7 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1153
1380
|
return;
|
|
1154
1381
|
}
|
|
1155
1382
|
|
|
1156
|
-
const classList =
|
|
1383
|
+
const classList = getClassList$1(elm);
|
|
1157
1384
|
const newClassMap = getMapFromClassName(newClass);
|
|
1158
1385
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
1159
1386
|
let name;
|
|
@@ -1191,24 +1418,17 @@ function updateStyleAttribute(oldVnode, vnode) {
|
|
|
1191
1418
|
elm,
|
|
1192
1419
|
data: {
|
|
1193
1420
|
style: newStyle
|
|
1194
|
-
},
|
|
1195
|
-
owner: {
|
|
1196
|
-
renderer
|
|
1197
1421
|
}
|
|
1198
1422
|
} = vnode;
|
|
1199
|
-
const {
|
|
1200
|
-
setAttribute,
|
|
1201
|
-
removeAttribute
|
|
1202
|
-
} = renderer;
|
|
1203
1423
|
|
|
1204
1424
|
if (oldVnode.data.style === newStyle) {
|
|
1205
1425
|
return;
|
|
1206
1426
|
}
|
|
1207
1427
|
|
|
1208
1428
|
if (!isString(newStyle) || newStyle === '') {
|
|
1209
|
-
removeAttribute(elm, 'style');
|
|
1429
|
+
removeAttribute$1(elm, 'style');
|
|
1210
1430
|
} else {
|
|
1211
|
-
setAttribute(elm, 'style', newStyle);
|
|
1431
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
1212
1432
|
}
|
|
1213
1433
|
}
|
|
1214
1434
|
|
|
@@ -1233,9 +1453,6 @@ function createClassAttribute(vnode) {
|
|
|
1233
1453
|
elm,
|
|
1234
1454
|
data: {
|
|
1235
1455
|
classMap
|
|
1236
|
-
},
|
|
1237
|
-
owner: {
|
|
1238
|
-
renderer
|
|
1239
1456
|
}
|
|
1240
1457
|
} = vnode;
|
|
1241
1458
|
|
|
@@ -1243,7 +1460,7 @@ function createClassAttribute(vnode) {
|
|
|
1243
1460
|
return;
|
|
1244
1461
|
}
|
|
1245
1462
|
|
|
1246
|
-
const classList =
|
|
1463
|
+
const classList = getClassList$1(elm);
|
|
1247
1464
|
|
|
1248
1465
|
for (const name in classMap) {
|
|
1249
1466
|
classList.add(name);
|
|
@@ -1267,9 +1484,6 @@ function createStyleAttribute(vnode) {
|
|
|
1267
1484
|
elm,
|
|
1268
1485
|
data: {
|
|
1269
1486
|
styleDecls
|
|
1270
|
-
},
|
|
1271
|
-
owner: {
|
|
1272
|
-
renderer
|
|
1273
1487
|
}
|
|
1274
1488
|
} = vnode;
|
|
1275
1489
|
|
|
@@ -1279,7 +1493,7 @@ function createStyleAttribute(vnode) {
|
|
|
1279
1493
|
|
|
1280
1494
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
1281
1495
|
const [prop, value, important] = styleDecls[i];
|
|
1282
|
-
|
|
1496
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
1283
1497
|
}
|
|
1284
1498
|
}
|
|
1285
1499
|
|
|
@@ -1293,15 +1507,6 @@ var modStaticStyle = {
|
|
|
1293
1507
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1294
1508
|
*/
|
|
1295
1509
|
|
|
1296
|
-
/**
|
|
1297
|
-
@license
|
|
1298
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1299
|
-
This code may only be used under the MIT License found at
|
|
1300
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1301
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1302
|
-
https://github.com/snabbdom/snabbdom/
|
|
1303
|
-
*/
|
|
1304
|
-
|
|
1305
1510
|
function isUndef(s) {
|
|
1306
1511
|
return s === undefined;
|
|
1307
1512
|
}
|
|
@@ -1389,7 +1594,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
|
1389
1594
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1390
1595
|
// Vnode moved right
|
|
1391
1596
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1392
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1597
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1393
1598
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1394
1599
|
newEndVnode = newCh[--newEndIdx];
|
|
1395
1600
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1871,7 +2076,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
|
1871
2076
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1872
2077
|
}
|
|
1873
2078
|
/*
|
|
1874
|
-
* Copyright (c)
|
|
2079
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1875
2080
|
* All rights reserved.
|
|
1876
2081
|
* SPDX-License-Identifier: MIT
|
|
1877
2082
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2791,9 +2996,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
2791
2996
|
|
|
2792
2997
|
|
|
2793
2998
|
const LightningElement = function () {
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2999
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2797
3000
|
if (isNull(vmBeingConstructed)) {
|
|
2798
3001
|
throw new ReferenceError('Illegal constructor');
|
|
2799
3002
|
}
|
|
@@ -2801,15 +3004,14 @@ const LightningElement = function () {
|
|
|
2801
3004
|
const vm = vmBeingConstructed;
|
|
2802
3005
|
const {
|
|
2803
3006
|
def,
|
|
2804
|
-
elm
|
|
2805
|
-
renderer
|
|
3007
|
+
elm
|
|
2806
3008
|
} = vm;
|
|
2807
3009
|
const {
|
|
2808
3010
|
bridge
|
|
2809
3011
|
} = def;
|
|
2810
3012
|
|
|
2811
3013
|
if (process.env.NODE_ENV !== 'production') {
|
|
2812
|
-
|
|
3014
|
+
assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
|
|
2813
3015
|
}
|
|
2814
3016
|
|
|
2815
3017
|
const component = this;
|
|
@@ -2839,7 +3041,7 @@ const LightningElement = function () {
|
|
|
2839
3041
|
if (vm.renderMode === 1
|
|
2840
3042
|
/* Shadow */
|
|
2841
3043
|
) {
|
|
2842
|
-
|
|
3044
|
+
doAttachShadow(vm);
|
|
2843
3045
|
} // Adding extra guard rails in DEV mode.
|
|
2844
3046
|
|
|
2845
3047
|
|
|
@@ -2851,17 +3053,16 @@ const LightningElement = function () {
|
|
|
2851
3053
|
return this;
|
|
2852
3054
|
};
|
|
2853
3055
|
|
|
2854
|
-
function
|
|
3056
|
+
function doAttachShadow(vm) {
|
|
2855
3057
|
const {
|
|
2856
3058
|
elm,
|
|
2857
3059
|
mode,
|
|
2858
|
-
renderer,
|
|
2859
3060
|
shadowMode,
|
|
2860
3061
|
def: {
|
|
2861
3062
|
ctor
|
|
2862
3063
|
}
|
|
2863
3064
|
} = vm;
|
|
2864
|
-
const cmpRoot =
|
|
3065
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2865
3066
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2866
3067
|
/* Synthetic */
|
|
2867
3068
|
,
|
|
@@ -2888,21 +3089,15 @@ LightningElement.prototype = {
|
|
|
2888
3089
|
|
|
2889
3090
|
dispatchEvent(event) {
|
|
2890
3091
|
const {
|
|
2891
|
-
elm
|
|
2892
|
-
renderer: {
|
|
2893
|
-
dispatchEvent
|
|
2894
|
-
}
|
|
3092
|
+
elm
|
|
2895
3093
|
} = getAssociatedVM(this);
|
|
2896
|
-
return dispatchEvent(elm, event);
|
|
3094
|
+
return dispatchEvent$1(elm, event);
|
|
2897
3095
|
},
|
|
2898
3096
|
|
|
2899
3097
|
addEventListener(type, listener, options) {
|
|
2900
3098
|
const vm = getAssociatedVM(this);
|
|
2901
3099
|
const {
|
|
2902
|
-
elm
|
|
2903
|
-
renderer: {
|
|
2904
|
-
addEventListener
|
|
2905
|
-
}
|
|
3100
|
+
elm
|
|
2906
3101
|
} = vm;
|
|
2907
3102
|
|
|
2908
3103
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2913,92 +3108,68 @@ LightningElement.prototype = {
|
|
|
2913
3108
|
}
|
|
2914
3109
|
|
|
2915
3110
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2916
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
3111
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2917
3112
|
},
|
|
2918
3113
|
|
|
2919
3114
|
removeEventListener(type, listener, options) {
|
|
2920
3115
|
const vm = getAssociatedVM(this);
|
|
2921
3116
|
const {
|
|
2922
|
-
elm
|
|
2923
|
-
renderer: {
|
|
2924
|
-
removeEventListener
|
|
2925
|
-
}
|
|
3117
|
+
elm
|
|
2926
3118
|
} = vm;
|
|
2927
3119
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2928
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
3120
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2929
3121
|
},
|
|
2930
3122
|
|
|
2931
3123
|
hasAttribute(name) {
|
|
2932
3124
|
const {
|
|
2933
|
-
elm
|
|
2934
|
-
renderer: {
|
|
2935
|
-
getAttribute
|
|
2936
|
-
}
|
|
3125
|
+
elm
|
|
2937
3126
|
} = getAssociatedVM(this);
|
|
2938
|
-
return !isNull(getAttribute(elm, name));
|
|
3127
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2939
3128
|
},
|
|
2940
3129
|
|
|
2941
3130
|
hasAttributeNS(namespace, name) {
|
|
2942
3131
|
const {
|
|
2943
|
-
elm
|
|
2944
|
-
renderer: {
|
|
2945
|
-
getAttribute
|
|
2946
|
-
}
|
|
3132
|
+
elm
|
|
2947
3133
|
} = getAssociatedVM(this);
|
|
2948
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
3134
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2949
3135
|
},
|
|
2950
3136
|
|
|
2951
3137
|
removeAttribute(name) {
|
|
2952
3138
|
const {
|
|
2953
|
-
elm
|
|
2954
|
-
renderer: {
|
|
2955
|
-
removeAttribute
|
|
2956
|
-
}
|
|
3139
|
+
elm
|
|
2957
3140
|
} = getAssociatedVM(this);
|
|
2958
3141
|
unlockAttribute(elm, name);
|
|
2959
|
-
removeAttribute(elm, name);
|
|
3142
|
+
removeAttribute$1(elm, name);
|
|
2960
3143
|
lockAttribute();
|
|
2961
3144
|
},
|
|
2962
3145
|
|
|
2963
3146
|
removeAttributeNS(namespace, name) {
|
|
2964
3147
|
const {
|
|
2965
|
-
elm
|
|
2966
|
-
renderer: {
|
|
2967
|
-
removeAttribute
|
|
2968
|
-
}
|
|
3148
|
+
elm
|
|
2969
3149
|
} = getAssociatedVM(this);
|
|
2970
3150
|
unlockAttribute(elm, name);
|
|
2971
|
-
removeAttribute(elm, name, namespace);
|
|
3151
|
+
removeAttribute$1(elm, name, namespace);
|
|
2972
3152
|
lockAttribute();
|
|
2973
3153
|
},
|
|
2974
3154
|
|
|
2975
3155
|
getAttribute(name) {
|
|
2976
3156
|
const {
|
|
2977
|
-
elm
|
|
2978
|
-
renderer: {
|
|
2979
|
-
getAttribute
|
|
2980
|
-
}
|
|
3157
|
+
elm
|
|
2981
3158
|
} = getAssociatedVM(this);
|
|
2982
|
-
return getAttribute(elm, name);
|
|
3159
|
+
return getAttribute$1(elm, name);
|
|
2983
3160
|
},
|
|
2984
3161
|
|
|
2985
3162
|
getAttributeNS(namespace, name) {
|
|
2986
3163
|
const {
|
|
2987
|
-
elm
|
|
2988
|
-
renderer: {
|
|
2989
|
-
getAttribute
|
|
2990
|
-
}
|
|
3164
|
+
elm
|
|
2991
3165
|
} = getAssociatedVM(this);
|
|
2992
|
-
return getAttribute(elm, name, namespace);
|
|
3166
|
+
return getAttribute$1(elm, name, namespace);
|
|
2993
3167
|
},
|
|
2994
3168
|
|
|
2995
3169
|
setAttribute(name, value) {
|
|
2996
3170
|
const vm = getAssociatedVM(this);
|
|
2997
3171
|
const {
|
|
2998
|
-
elm
|
|
2999
|
-
renderer: {
|
|
3000
|
-
setAttribute
|
|
3001
|
-
}
|
|
3172
|
+
elm
|
|
3002
3173
|
} = vm;
|
|
3003
3174
|
|
|
3004
3175
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3006,17 +3177,14 @@ LightningElement.prototype = {
|
|
|
3006
3177
|
}
|
|
3007
3178
|
|
|
3008
3179
|
unlockAttribute(elm, name);
|
|
3009
|
-
setAttribute(elm, name, value);
|
|
3180
|
+
setAttribute$1(elm, name, value);
|
|
3010
3181
|
lockAttribute();
|
|
3011
3182
|
},
|
|
3012
3183
|
|
|
3013
3184
|
setAttributeNS(namespace, name, value) {
|
|
3014
3185
|
const vm = getAssociatedVM(this);
|
|
3015
3186
|
const {
|
|
3016
|
-
elm
|
|
3017
|
-
renderer: {
|
|
3018
|
-
setAttribute
|
|
3019
|
-
}
|
|
3187
|
+
elm
|
|
3020
3188
|
} = vm;
|
|
3021
3189
|
|
|
3022
3190
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3024,43 +3192,34 @@ LightningElement.prototype = {
|
|
|
3024
3192
|
}
|
|
3025
3193
|
|
|
3026
3194
|
unlockAttribute(elm, name);
|
|
3027
|
-
setAttribute(elm, name, value, namespace);
|
|
3195
|
+
setAttribute$1(elm, name, value, namespace);
|
|
3028
3196
|
lockAttribute();
|
|
3029
3197
|
},
|
|
3030
3198
|
|
|
3031
3199
|
getBoundingClientRect() {
|
|
3032
3200
|
const vm = getAssociatedVM(this);
|
|
3033
3201
|
const {
|
|
3034
|
-
elm
|
|
3035
|
-
renderer: {
|
|
3036
|
-
getBoundingClientRect
|
|
3037
|
-
}
|
|
3202
|
+
elm
|
|
3038
3203
|
} = vm;
|
|
3039
3204
|
|
|
3040
3205
|
if (process.env.NODE_ENV !== 'production') {
|
|
3041
3206
|
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
|
|
3042
3207
|
}
|
|
3043
3208
|
|
|
3044
|
-
return getBoundingClientRect(elm);
|
|
3209
|
+
return getBoundingClientRect$1(elm);
|
|
3045
3210
|
},
|
|
3046
3211
|
|
|
3047
3212
|
get isConnected() {
|
|
3048
3213
|
const {
|
|
3049
|
-
elm
|
|
3050
|
-
renderer: {
|
|
3051
|
-
isConnected
|
|
3052
|
-
}
|
|
3214
|
+
elm
|
|
3053
3215
|
} = getAssociatedVM(this);
|
|
3054
|
-
return isConnected(elm);
|
|
3216
|
+
return isConnected$1(elm);
|
|
3055
3217
|
},
|
|
3056
3218
|
|
|
3057
3219
|
get classList() {
|
|
3058
3220
|
const vm = getAssociatedVM(this);
|
|
3059
3221
|
const {
|
|
3060
|
-
elm
|
|
3061
|
-
renderer: {
|
|
3062
|
-
getClassList
|
|
3063
|
-
}
|
|
3222
|
+
elm
|
|
3064
3223
|
} = vm;
|
|
3065
3224
|
|
|
3066
3225
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3069,7 +3228,7 @@ LightningElement.prototype = {
|
|
|
3069
3228
|
assert.isFalse(isBeingConstructed(vm), `Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
|
|
3070
3229
|
}
|
|
3071
3230
|
|
|
3072
|
-
return getClassList(elm);
|
|
3231
|
+
return getClassList$1(elm);
|
|
3073
3232
|
},
|
|
3074
3233
|
|
|
3075
3234
|
get template() {
|
|
@@ -3103,23 +3262,48 @@ LightningElement.prototype = {
|
|
|
3103
3262
|
}
|
|
3104
3263
|
|
|
3105
3264
|
};
|
|
3106
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
3107
|
-
|
|
3265
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
3266
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
3267
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
3268
|
+
|
|
3269
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
3270
|
+
|
|
3271
|
+
function getChildGetter(methodName) {
|
|
3272
|
+
switch (methodName) {
|
|
3273
|
+
case 'children':
|
|
3274
|
+
return getChildren$1;
|
|
3275
|
+
|
|
3276
|
+
case 'childNodes':
|
|
3277
|
+
return getChildNodes$1;
|
|
3108
3278
|
|
|
3109
|
-
|
|
3110
|
-
|
|
3279
|
+
case 'firstChild':
|
|
3280
|
+
return getFirstChild$1;
|
|
3281
|
+
|
|
3282
|
+
case 'firstElementChild':
|
|
3283
|
+
return getFirstElementChild$1;
|
|
3284
|
+
|
|
3285
|
+
case 'lastChild':
|
|
3286
|
+
return getLastChild$1;
|
|
3287
|
+
|
|
3288
|
+
case 'lastElementChild':
|
|
3289
|
+
return getLastElementChild$1;
|
|
3290
|
+
}
|
|
3291
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
3292
|
+
|
|
3293
|
+
|
|
3294
|
+
for (const childGetter of childGetters) {
|
|
3295
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
3111
3296
|
get() {
|
|
3112
3297
|
const vm = getAssociatedVM(this);
|
|
3113
3298
|
const {
|
|
3114
|
-
elm
|
|
3115
|
-
renderer
|
|
3299
|
+
elm
|
|
3116
3300
|
} = vm;
|
|
3117
3301
|
|
|
3118
3302
|
if (process.env.NODE_ENV !== 'production') {
|
|
3119
|
-
warnIfInvokedDuringConstruction(vm,
|
|
3303
|
+
warnIfInvokedDuringConstruction(vm, childGetter);
|
|
3120
3304
|
}
|
|
3121
3305
|
|
|
3122
|
-
return
|
|
3306
|
+
return getChildGetter(childGetter)(elm);
|
|
3123
3307
|
},
|
|
3124
3308
|
|
|
3125
3309
|
configurable: true,
|
|
@@ -3127,22 +3311,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
|
|
|
3127
3311
|
};
|
|
3128
3312
|
}
|
|
3129
3313
|
|
|
3130
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3314
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3315
|
+
|
|
3316
|
+
function getQueryMethod(methodName) {
|
|
3317
|
+
switch (methodName) {
|
|
3318
|
+
case 'getElementsByClassName':
|
|
3319
|
+
return getElementsByClassName$1;
|
|
3320
|
+
|
|
3321
|
+
case 'getElementsByTagName':
|
|
3322
|
+
return getElementsByTagName$1;
|
|
3323
|
+
|
|
3324
|
+
case 'querySelector':
|
|
3325
|
+
return querySelector$1;
|
|
3326
|
+
|
|
3327
|
+
case 'querySelectorAll':
|
|
3328
|
+
return querySelectorAll$1;
|
|
3329
|
+
}
|
|
3330
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
3331
|
+
|
|
3131
3332
|
|
|
3132
3333
|
for (const queryMethod of queryMethods) {
|
|
3133
3334
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
3134
3335
|
value(arg) {
|
|
3135
3336
|
const vm = getAssociatedVM(this);
|
|
3136
3337
|
const {
|
|
3137
|
-
elm
|
|
3138
|
-
renderer
|
|
3338
|
+
elm
|
|
3139
3339
|
} = vm;
|
|
3140
3340
|
|
|
3141
3341
|
if (process.env.NODE_ENV !== 'production') {
|
|
3142
3342
|
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
3143
3343
|
}
|
|
3144
3344
|
|
|
3145
|
-
return
|
|
3345
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
3146
3346
|
},
|
|
3147
3347
|
|
|
3148
3348
|
configurable: true,
|
|
@@ -4541,17 +4741,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
|
|
|
4541
4741
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
4542
4742
|
|
|
4543
4743
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
4544
|
-
|
|
4744
|
+
getClassList$1(elm).add(token);
|
|
4545
4745
|
}
|
|
4546
4746
|
}
|
|
4547
4747
|
|
|
4548
4748
|
function updateNodeHook(oldVnode, vnode) {
|
|
4549
4749
|
const {
|
|
4550
4750
|
elm,
|
|
4551
|
-
text
|
|
4552
|
-
owner: {
|
|
4553
|
-
renderer
|
|
4554
|
-
}
|
|
4751
|
+
text
|
|
4555
4752
|
} = vnode;
|
|
4556
4753
|
|
|
4557
4754
|
if (oldVnode.text !== text) {
|
|
@@ -4559,7 +4756,7 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4559
4756
|
unlockDomMutation();
|
|
4560
4757
|
}
|
|
4561
4758
|
|
|
4562
|
-
|
|
4759
|
+
setText$1(elm, text);
|
|
4563
4760
|
|
|
4564
4761
|
if (process.env.NODE_ENV !== 'production') {
|
|
4565
4762
|
lockDomMutation();
|
|
@@ -4568,15 +4765,11 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4568
4765
|
}
|
|
4569
4766
|
|
|
4570
4767
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
4571
|
-
const {
|
|
4572
|
-
renderer
|
|
4573
|
-
} = vnode.owner;
|
|
4574
|
-
|
|
4575
4768
|
if (process.env.NODE_ENV !== 'production') {
|
|
4576
4769
|
unlockDomMutation();
|
|
4577
4770
|
}
|
|
4578
4771
|
|
|
4579
|
-
|
|
4772
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
4580
4773
|
|
|
4581
4774
|
if (process.env.NODE_ENV !== 'production') {
|
|
4582
4775
|
lockDomMutation();
|
|
@@ -4584,15 +4777,11 @@ function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
|
4584
4777
|
}
|
|
4585
4778
|
|
|
4586
4779
|
function removeNodeHook(vnode, parentNode) {
|
|
4587
|
-
const {
|
|
4588
|
-
renderer
|
|
4589
|
-
} = vnode.owner;
|
|
4590
|
-
|
|
4591
4780
|
if (process.env.NODE_ENV !== 'production') {
|
|
4592
4781
|
unlockDomMutation();
|
|
4593
4782
|
}
|
|
4594
4783
|
|
|
4595
|
-
|
|
4784
|
+
remove$1(vnode.elm, parentNode);
|
|
4596
4785
|
|
|
4597
4786
|
if (process.env.NODE_ENV !== 'production') {
|
|
4598
4787
|
lockDomMutation();
|
|
@@ -4758,8 +4947,7 @@ function createViewModelHook(elm, vnode) {
|
|
|
4758
4947
|
createVM(elm, def, {
|
|
4759
4948
|
mode,
|
|
4760
4949
|
owner,
|
|
4761
|
-
tagName: sel
|
|
4762
|
-
renderer: owner.renderer
|
|
4950
|
+
tagName: sel
|
|
4763
4951
|
});
|
|
4764
4952
|
|
|
4765
4953
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4805,16 +4993,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
|
|
|
4805
4993
|
const {
|
|
4806
4994
|
data: {
|
|
4807
4995
|
attrs = {}
|
|
4808
|
-
},
|
|
4809
|
-
owner: {
|
|
4810
|
-
renderer
|
|
4811
4996
|
}
|
|
4812
4997
|
} = vnode;
|
|
4813
4998
|
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4814
4999
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4815
5000
|
|
|
4816
5001
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4817
|
-
const elmAttrValue =
|
|
5002
|
+
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
4818
5003
|
|
|
4819
5004
|
if (String(attrValue) !== elmAttrValue) {
|
|
4820
5005
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
@@ -4830,9 +5015,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4830
5015
|
data: {
|
|
4831
5016
|
className,
|
|
4832
5017
|
classMap
|
|
4833
|
-
},
|
|
4834
|
-
owner: {
|
|
4835
|
-
renderer
|
|
4836
5018
|
}
|
|
4837
5019
|
} = vnode;
|
|
4838
5020
|
let nodesAreCompatible = true;
|
|
@@ -4844,7 +5026,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4844
5026
|
vnodeClassName = className;
|
|
4845
5027
|
} else if (!isUndefined$1(classMap)) {
|
|
4846
5028
|
// classMap is used when class is set to static value.
|
|
4847
|
-
const classList =
|
|
5029
|
+
const classList = getClassList$1(elm);
|
|
4848
5030
|
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4849
5031
|
|
|
4850
5032
|
for (const name in classMap) {
|
|
@@ -4874,12 +5056,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
|
|
|
4874
5056
|
data: {
|
|
4875
5057
|
style,
|
|
4876
5058
|
styleDecls
|
|
4877
|
-
},
|
|
4878
|
-
owner: {
|
|
4879
|
-
renderer
|
|
4880
5059
|
}
|
|
4881
5060
|
} = vnode;
|
|
4882
|
-
const elmStyle =
|
|
5061
|
+
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
4883
5062
|
let vnodeStyle;
|
|
4884
5063
|
let nodesAreCompatible = true;
|
|
4885
5064
|
|
|
@@ -5016,12 +5195,12 @@ function hasDynamicChildren(children) {
|
|
|
5016
5195
|
*/
|
|
5017
5196
|
|
|
5018
5197
|
|
|
5019
|
-
function getUpgradableConstructor(tagName
|
|
5198
|
+
function getUpgradableConstructor(tagName) {
|
|
5020
5199
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
5021
5200
|
// produce only tags with lowercase letters
|
|
5022
5201
|
// But, for backwards compatibility, we will lower case the tagName
|
|
5023
5202
|
tagName = tagName.toLowerCase();
|
|
5024
|
-
let CE =
|
|
5203
|
+
let CE = getCustomElement$1(tagName);
|
|
5025
5204
|
|
|
5026
5205
|
if (!isUndefined$1(CE)) {
|
|
5027
5206
|
return CE;
|
|
@@ -5032,7 +5211,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
5032
5211
|
*/
|
|
5033
5212
|
|
|
5034
5213
|
|
|
5035
|
-
CE = class LWCUpgradableElement extends
|
|
5214
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
5036
5215
|
constructor(upgradeCallback) {
|
|
5037
5216
|
super();
|
|
5038
5217
|
|
|
@@ -5042,7 +5221,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
5042
5221
|
}
|
|
5043
5222
|
|
|
5044
5223
|
};
|
|
5045
|
-
|
|
5224
|
+
defineCustomElement$1(tagName, CE);
|
|
5046
5225
|
return CE;
|
|
5047
5226
|
}
|
|
5048
5227
|
/*
|
|
@@ -5060,10 +5239,7 @@ const TextHook = {
|
|
|
5060
5239
|
const {
|
|
5061
5240
|
owner
|
|
5062
5241
|
} = vnode;
|
|
5063
|
-
const
|
|
5064
|
-
renderer
|
|
5065
|
-
} = owner;
|
|
5066
|
-
const elm = renderer.createText(vnode.text);
|
|
5242
|
+
const elm = createText$1(vnode.text);
|
|
5067
5243
|
linkNodeToShadow(elm, owner);
|
|
5068
5244
|
vnode.elm = elm;
|
|
5069
5245
|
},
|
|
@@ -5097,10 +5273,7 @@ const CommentHook = {
|
|
|
5097
5273
|
owner,
|
|
5098
5274
|
text
|
|
5099
5275
|
} = vnode;
|
|
5100
|
-
const
|
|
5101
|
-
renderer
|
|
5102
|
-
} = owner;
|
|
5103
|
-
const elm = renderer.createComment(text);
|
|
5276
|
+
const elm = createComment$1(text);
|
|
5104
5277
|
linkNodeToShadow(elm, owner);
|
|
5105
5278
|
vnode.elm = elm;
|
|
5106
5279
|
},
|
|
@@ -5142,11 +5315,8 @@ const ElementHook = {
|
|
|
5142
5315
|
svg
|
|
5143
5316
|
}
|
|
5144
5317
|
} = vnode;
|
|
5145
|
-
const {
|
|
5146
|
-
renderer
|
|
5147
|
-
} = owner;
|
|
5148
5318
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
5149
|
-
const elm =
|
|
5319
|
+
const elm = createElement$2(sel, namespace);
|
|
5150
5320
|
linkNodeToShadow(elm, owner);
|
|
5151
5321
|
fallbackElmHook(elm, vnode);
|
|
5152
5322
|
vnode.elm = elm;
|
|
@@ -5206,10 +5376,7 @@ const CustomElementHook = {
|
|
|
5206
5376
|
sel,
|
|
5207
5377
|
owner
|
|
5208
5378
|
} = vnode;
|
|
5209
|
-
const
|
|
5210
|
-
renderer
|
|
5211
|
-
} = owner;
|
|
5212
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5379
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5213
5380
|
/**
|
|
5214
5381
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
5215
5382
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -5302,8 +5469,7 @@ const CustomElementHook = {
|
|
|
5302
5469
|
createVM(elm, def, {
|
|
5303
5470
|
mode,
|
|
5304
5471
|
owner,
|
|
5305
|
-
tagName: sel
|
|
5306
|
-
renderer: owner.renderer
|
|
5472
|
+
tagName: sel
|
|
5307
5473
|
});
|
|
5308
5474
|
vnode.elm = elm;
|
|
5309
5475
|
const vm = getAssociatedVM(elm);
|
|
@@ -5332,12 +5498,11 @@ const CustomElementHook = {
|
|
|
5332
5498
|
|
|
5333
5499
|
function linkNodeToShadow(elm, owner) {
|
|
5334
5500
|
const {
|
|
5335
|
-
renderer,
|
|
5336
5501
|
renderMode,
|
|
5337
5502
|
shadowMode
|
|
5338
5503
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
5339
5504
|
|
|
5340
|
-
if (
|
|
5505
|
+
if (isSyntheticShadowDefined$1) {
|
|
5341
5506
|
if (shadowMode === 1
|
|
5342
5507
|
/* Synthetic */
|
|
5343
5508
|
|| renderMode === 0
|
|
@@ -5869,7 +6034,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5869
6034
|
const {
|
|
5870
6035
|
elm,
|
|
5871
6036
|
context,
|
|
5872
|
-
renderer,
|
|
5873
6037
|
renderMode,
|
|
5874
6038
|
shadowMode
|
|
5875
6039
|
} = vm;
|
|
@@ -5896,11 +6060,11 @@ function updateStylesheetToken(vm, template) {
|
|
|
5896
6060
|
} = context;
|
|
5897
6061
|
|
|
5898
6062
|
if (oldHasTokenInClass) {
|
|
5899
|
-
|
|
6063
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
5900
6064
|
}
|
|
5901
6065
|
|
|
5902
6066
|
if (oldHasTokenInAttribute) {
|
|
5903
|
-
|
|
6067
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
5904
6068
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5905
6069
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5906
6070
|
|
|
@@ -5912,12 +6076,12 @@ function updateStylesheetToken(vm, template) {
|
|
|
5912
6076
|
|
|
5913
6077
|
if (!isUndefined$1(newToken)) {
|
|
5914
6078
|
if (hasScopedStyles) {
|
|
5915
|
-
|
|
6079
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
5916
6080
|
newHasTokenInClass = true;
|
|
5917
6081
|
}
|
|
5918
6082
|
|
|
5919
6083
|
if (isSyntheticShadow) {
|
|
5920
|
-
|
|
6084
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
5921
6085
|
newHasTokenInAttribute = true;
|
|
5922
6086
|
}
|
|
5923
6087
|
} // Update the styling tokens present on the context object.
|
|
@@ -6038,7 +6202,6 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
6038
6202
|
|
|
6039
6203
|
function createStylesheet(vm, stylesheets) {
|
|
6040
6204
|
const {
|
|
6041
|
-
renderer,
|
|
6042
6205
|
renderMode,
|
|
6043
6206
|
shadowMode
|
|
6044
6207
|
} = vm;
|
|
@@ -6049,9 +6212,9 @@ function createStylesheet(vm, stylesheets) {
|
|
|
6049
6212
|
/* Synthetic */
|
|
6050
6213
|
) {
|
|
6051
6214
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
6052
|
-
|
|
6215
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
6053
6216
|
}
|
|
6054
|
-
} else if (
|
|
6217
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
6055
6218
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
6056
6219
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
6057
6220
|
// the first time the VM renders.
|
|
@@ -6065,10 +6228,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
6065
6228
|
|
|
6066
6229
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
6067
6230
|
if (isGlobal) {
|
|
6068
|
-
|
|
6231
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
6069
6232
|
} else {
|
|
6070
6233
|
// local level
|
|
6071
|
-
|
|
6234
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
6072
6235
|
}
|
|
6073
6236
|
}
|
|
6074
6237
|
}
|
|
@@ -6760,7 +6923,6 @@ function createVM(elm, def, options) {
|
|
|
6760
6923
|
const {
|
|
6761
6924
|
mode,
|
|
6762
6925
|
owner,
|
|
6763
|
-
renderer,
|
|
6764
6926
|
tagName
|
|
6765
6927
|
} = options;
|
|
6766
6928
|
const vm = {
|
|
@@ -6775,7 +6937,6 @@ function createVM(elm, def, options) {
|
|
|
6775
6937
|
tagName,
|
|
6776
6938
|
mode,
|
|
6777
6939
|
owner,
|
|
6778
|
-
renderer,
|
|
6779
6940
|
children: EmptyArray,
|
|
6780
6941
|
aChildren: EmptyArray,
|
|
6781
6942
|
velements: EmptyArray,
|
|
@@ -6830,16 +6991,11 @@ function createVM(elm, def, options) {
|
|
|
6830
6991
|
|
|
6831
6992
|
function computeShadowMode(vm) {
|
|
6832
6993
|
const {
|
|
6833
|
-
def
|
|
6834
|
-
renderer
|
|
6994
|
+
def
|
|
6835
6995
|
} = vm;
|
|
6836
|
-
const {
|
|
6837
|
-
isNativeShadowDefined,
|
|
6838
|
-
isSyntheticShadowDefined
|
|
6839
|
-
} = renderer;
|
|
6840
6996
|
let shadowMode;
|
|
6841
6997
|
|
|
6842
|
-
if (isSyntheticShadowDefined) {
|
|
6998
|
+
if (isSyntheticShadowDefined$1) {
|
|
6843
6999
|
if (def.renderMode === 0
|
|
6844
7000
|
/* Light */
|
|
6845
7001
|
) {
|
|
@@ -6848,7 +7004,7 @@ function computeShadowMode(vm) {
|
|
|
6848
7004
|
shadowMode = 0
|
|
6849
7005
|
/* Native */
|
|
6850
7006
|
;
|
|
6851
|
-
} else if (isNativeShadowDefined) {
|
|
7007
|
+
} else if (isNativeShadowDefined$1) {
|
|
6852
7008
|
if (def.shadowSupportMode === "any"
|
|
6853
7009
|
/* Any */
|
|
6854
7010
|
) {
|
|
@@ -6988,13 +7144,12 @@ function patchShadowRoot(vm, newCh) {
|
|
|
6988
7144
|
|
|
6989
7145
|
function runRenderedCallback(vm) {
|
|
6990
7146
|
const {
|
|
6991
|
-
renderer,
|
|
6992
7147
|
def: {
|
|
6993
7148
|
renderedCallback
|
|
6994
7149
|
}
|
|
6995
7150
|
} = vm;
|
|
6996
7151
|
|
|
6997
|
-
if (isTrue(
|
|
7152
|
+
if (isTrue(ssr$1)) {
|
|
6998
7153
|
return;
|
|
6999
7154
|
}
|
|
7000
7155
|
|
|
@@ -7220,8 +7375,7 @@ function recursivelyDisconnectChildren(vnodes) {
|
|
|
7220
7375
|
|
|
7221
7376
|
function resetComponentRoot(vm) {
|
|
7222
7377
|
const {
|
|
7223
|
-
children
|
|
7224
|
-
renderer
|
|
7378
|
+
children
|
|
7225
7379
|
} = vm;
|
|
7226
7380
|
const rootNode = getRenderRoot(vm);
|
|
7227
7381
|
|
|
@@ -7229,7 +7383,7 @@ function resetComponentRoot(vm) {
|
|
|
7229
7383
|
const child = children[i];
|
|
7230
7384
|
|
|
7231
7385
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
7232
|
-
|
|
7386
|
+
remove$1(child.elm, rootNode);
|
|
7233
7387
|
}
|
|
7234
7388
|
}
|
|
7235
7389
|
|
|
@@ -7239,7 +7393,7 @@ function resetComponentRoot(vm) {
|
|
|
7239
7393
|
}
|
|
7240
7394
|
|
|
7241
7395
|
function scheduleRehydration(vm) {
|
|
7242
|
-
if (isTrue(
|
|
7396
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
7243
7397
|
return;
|
|
7244
7398
|
}
|
|
7245
7399
|
|
|
@@ -7484,7 +7638,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7484
7638
|
|
|
7485
7639
|
const {
|
|
7486
7640
|
elm,
|
|
7487
|
-
renderer,
|
|
7488
7641
|
context: {
|
|
7489
7642
|
wiredConnecting,
|
|
7490
7643
|
wiredDisconnecting
|
|
@@ -7511,7 +7664,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7511
7664
|
}
|
|
7512
7665
|
|
|
7513
7666
|
});
|
|
7514
|
-
|
|
7667
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
7515
7668
|
});
|
|
7516
7669
|
}
|
|
7517
7670
|
|
|
@@ -7776,7 +7929,7 @@ function setHooks(hooks) {
|
|
|
7776
7929
|
hooksAreSet = true;
|
|
7777
7930
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7778
7931
|
}
|
|
7779
|
-
/* version: 2.7.
|
|
7932
|
+
/* version: 2.7.2 */
|
|
7780
7933
|
|
|
7781
7934
|
/*
|
|
7782
7935
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7805,7 +7958,9 @@ const supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.re
|
|
|
7805
7958
|
const styleElements = create(null);
|
|
7806
7959
|
const styleSheets = create(null);
|
|
7807
7960
|
const nodesToStyleSheets = new WeakMap();
|
|
7808
|
-
let getCustomElement
|
|
7961
|
+
let getCustomElement;
|
|
7962
|
+
let defineCustomElement;
|
|
7963
|
+
let HTMLElementConstructor;
|
|
7809
7964
|
|
|
7810
7965
|
function isCustomElementRegistryAvailable() {
|
|
7811
7966
|
if (typeof customElements === 'undefined') {
|
|
@@ -7920,188 +8075,231 @@ if (isCustomElementRegistryAvailable()) {
|
|
|
7920
8075
|
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
7921
8076
|
}
|
|
7922
8077
|
|
|
7923
|
-
let
|
|
8078
|
+
let hydrating = false;
|
|
7924
8079
|
|
|
7925
|
-
function setIsHydrating(
|
|
7926
|
-
|
|
8080
|
+
function setIsHydrating(value) {
|
|
8081
|
+
hydrating = value;
|
|
7927
8082
|
}
|
|
7928
8083
|
|
|
7929
|
-
const
|
|
7930
|
-
ssr: false,
|
|
8084
|
+
const ssr = false;
|
|
7931
8085
|
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
8086
|
+
function isHydrating() {
|
|
8087
|
+
return hydrating;
|
|
8088
|
+
}
|
|
7935
8089
|
|
|
7936
|
-
|
|
7937
|
-
|
|
8090
|
+
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
8091
|
+
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
7938
8092
|
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
8093
|
+
function createElement$1(tagName, namespace) {
|
|
8094
|
+
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
8095
|
+
}
|
|
7942
8096
|
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
8097
|
+
function createText(content) {
|
|
8098
|
+
return document.createTextNode(content);
|
|
8099
|
+
}
|
|
7946
8100
|
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
8101
|
+
function createComment(content) {
|
|
8102
|
+
return document.createComment(content);
|
|
8103
|
+
}
|
|
7950
8104
|
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
8105
|
+
function insert(node, parent, anchor) {
|
|
8106
|
+
parent.insertBefore(node, anchor);
|
|
8107
|
+
}
|
|
7954
8108
|
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
8109
|
+
function remove(node, parent) {
|
|
8110
|
+
parent.removeChild(node);
|
|
8111
|
+
}
|
|
7958
8112
|
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
8113
|
+
function nextSibling(node) {
|
|
8114
|
+
return node.nextSibling;
|
|
8115
|
+
}
|
|
7962
8116
|
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
8117
|
+
function attachShadow(element, options) {
|
|
8118
|
+
if (hydrating) {
|
|
8119
|
+
return element.shadowRoot;
|
|
8120
|
+
}
|
|
7967
8121
|
|
|
7968
|
-
|
|
7969
|
-
|
|
8122
|
+
return element.attachShadow(options);
|
|
8123
|
+
}
|
|
7970
8124
|
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
8125
|
+
function setText(node, content) {
|
|
8126
|
+
node.nodeValue = content;
|
|
8127
|
+
}
|
|
7974
8128
|
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
8129
|
+
function getProperty(node, key) {
|
|
8130
|
+
return node[key];
|
|
8131
|
+
}
|
|
7978
8132
|
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
}
|
|
8133
|
+
function setProperty(node, key, value) {
|
|
8134
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8135
|
+
if (node instanceof Element && !(key in node)) {
|
|
8136
|
+
// TODO [#1297]: Move this validation to the compiler
|
|
8137
|
+
assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
|
|
7985
8138
|
}
|
|
8139
|
+
}
|
|
7986
8140
|
|
|
7987
|
-
|
|
7988
|
-
|
|
8141
|
+
node[key] = value;
|
|
8142
|
+
}
|
|
7989
8143
|
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
8144
|
+
function getAttribute(element, name, namespace) {
|
|
8145
|
+
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
8146
|
+
}
|
|
7993
8147
|
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
8148
|
+
function setAttribute(element, name, value, namespace) {
|
|
8149
|
+
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
8150
|
+
}
|
|
7997
8151
|
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8152
|
+
function removeAttribute(element, name, namespace) {
|
|
8153
|
+
if (isUndefined$1(namespace)) {
|
|
8154
|
+
element.removeAttribute(name);
|
|
8155
|
+
} else {
|
|
8156
|
+
element.removeAttributeNS(namespace, name);
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8005
8159
|
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8160
|
+
function addEventListener(target, type, callback, options) {
|
|
8161
|
+
target.addEventListener(type, callback, options);
|
|
8162
|
+
}
|
|
8009
8163
|
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8164
|
+
function removeEventListener(target, type, callback, options) {
|
|
8165
|
+
target.removeEventListener(type, callback, options);
|
|
8166
|
+
}
|
|
8013
8167
|
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8168
|
+
function dispatchEvent(target, event) {
|
|
8169
|
+
return target.dispatchEvent(event);
|
|
8170
|
+
}
|
|
8017
8171
|
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8172
|
+
function getClassList(element) {
|
|
8173
|
+
return element.classList;
|
|
8174
|
+
}
|
|
8021
8175
|
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8176
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
8177
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
8178
|
+
// represent elements in the engine?
|
|
8179
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
8180
|
+
}
|
|
8027
8181
|
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8182
|
+
function getBoundingClientRect(element) {
|
|
8183
|
+
return element.getBoundingClientRect();
|
|
8184
|
+
}
|
|
8031
8185
|
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8186
|
+
function querySelector(element, selectors) {
|
|
8187
|
+
return element.querySelector(selectors);
|
|
8188
|
+
}
|
|
8035
8189
|
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8190
|
+
function querySelectorAll(element, selectors) {
|
|
8191
|
+
return element.querySelectorAll(selectors);
|
|
8192
|
+
}
|
|
8039
8193
|
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8194
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
8195
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
8196
|
+
}
|
|
8043
8197
|
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8198
|
+
function getElementsByClassName(element, names) {
|
|
8199
|
+
return element.getElementsByClassName(names);
|
|
8200
|
+
}
|
|
8047
8201
|
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8202
|
+
function getChildren(element) {
|
|
8203
|
+
return element.children;
|
|
8204
|
+
}
|
|
8051
8205
|
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8206
|
+
function getChildNodes(element) {
|
|
8207
|
+
return element.childNodes;
|
|
8208
|
+
}
|
|
8055
8209
|
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8210
|
+
function getFirstChild(element) {
|
|
8211
|
+
return element.firstChild;
|
|
8212
|
+
}
|
|
8059
8213
|
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8214
|
+
function getFirstElementChild(element) {
|
|
8215
|
+
return element.firstElementChild;
|
|
8216
|
+
}
|
|
8063
8217
|
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8218
|
+
function getLastChild(element) {
|
|
8219
|
+
return element.lastChild;
|
|
8220
|
+
}
|
|
8067
8221
|
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8222
|
+
function getLastElementChild(element) {
|
|
8223
|
+
return element.lastElementChild;
|
|
8224
|
+
}
|
|
8071
8225
|
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8226
|
+
function isConnected(node) {
|
|
8227
|
+
return node.isConnected;
|
|
8228
|
+
}
|
|
8075
8229
|
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8230
|
+
function insertGlobalStylesheet(content) {
|
|
8231
|
+
if (!isUndefined$1(globalStylesheets[content])) {
|
|
8232
|
+
return;
|
|
8233
|
+
}
|
|
8080
8234
|
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8235
|
+
globalStylesheets[content] = true;
|
|
8236
|
+
const elm = document.createElement('style');
|
|
8237
|
+
elm.type = 'text/css';
|
|
8238
|
+
elm.textContent = content;
|
|
8239
|
+
globalStylesheetsParentElement.appendChild(elm);
|
|
8240
|
+
}
|
|
8087
8241
|
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8242
|
+
function insertStylesheet(content, target) {
|
|
8243
|
+
if (supportsConstructableStyleSheets) {
|
|
8244
|
+
insertConstructableStyleSheet(content, target);
|
|
8245
|
+
} else {
|
|
8246
|
+
// Fall back to <style> element
|
|
8247
|
+
insertStyleElement(content, target);
|
|
8248
|
+
}
|
|
8249
|
+
}
|
|
8096
8250
|
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8251
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
8252
|
+
assert.invariant(elm instanceof HTMLElement, msg);
|
|
8253
|
+
}
|
|
8100
8254
|
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8255
|
+
const HTMLElementExported = HTMLElementConstructor;
|
|
8256
|
+
/*
|
|
8257
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
8258
|
+
* All rights reserved.
|
|
8259
|
+
* SPDX-License-Identifier: MIT
|
|
8260
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8261
|
+
*/
|
|
8262
|
+
|
|
8263
|
+
setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
|
|
8264
|
+
setAttachShadow(attachShadow);
|
|
8265
|
+
setCreateComment(createComment);
|
|
8266
|
+
setCreateElement(createElement$1);
|
|
8267
|
+
setCreateText(createText);
|
|
8268
|
+
setDefineCustomElement(defineCustomElement);
|
|
8269
|
+
setDispatchEvent(dispatchEvent);
|
|
8270
|
+
setGetAttribute(getAttribute);
|
|
8271
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
8272
|
+
setGetChildNodes(getChildNodes);
|
|
8273
|
+
setGetChildren(getChildren);
|
|
8274
|
+
setGetClassList(getClassList);
|
|
8275
|
+
setGetCustomElement(getCustomElement);
|
|
8276
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
8277
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
8278
|
+
setGetFirstChild(getFirstChild);
|
|
8279
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
8280
|
+
setGetLastChild(getLastChild);
|
|
8281
|
+
setGetLastElementChild(getLastElementChild);
|
|
8282
|
+
setGetProperty(getProperty);
|
|
8283
|
+
setHTMLElement(HTMLElementExported);
|
|
8284
|
+
setInsert(insert);
|
|
8285
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
8286
|
+
setInsertStylesheet(insertStylesheet);
|
|
8287
|
+
setIsConnected(isConnected);
|
|
8288
|
+
setIsHydrating$1(isHydrating);
|
|
8289
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
8290
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
8291
|
+
setNextSibling(nextSibling);
|
|
8292
|
+
setQuerySelector(querySelector);
|
|
8293
|
+
setQuerySelectorAll(querySelectorAll);
|
|
8294
|
+
setRemove(remove);
|
|
8295
|
+
setRemoveAttribute(removeAttribute);
|
|
8296
|
+
setRemoveEventListener(removeEventListener);
|
|
8297
|
+
setSetAttribute(setAttribute);
|
|
8298
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
8299
|
+
setSetProperty(setProperty);
|
|
8300
|
+
setSetText(setText);
|
|
8301
|
+
setSsr(ssr);
|
|
8302
|
+
setAddEventListener(addEventListener);
|
|
8105
8303
|
/*
|
|
8106
8304
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
8107
8305
|
* All rights reserved.
|
|
@@ -8184,7 +8382,7 @@ function createElement(sel, options) {
|
|
|
8184
8382
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
8185
8383
|
}
|
|
8186
8384
|
|
|
8187
|
-
const UpgradableConstructor = getUpgradableConstructor(sel
|
|
8385
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
8188
8386
|
let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
8189
8387
|
|
|
8190
8388
|
/**
|
|
@@ -8199,8 +8397,7 @@ function createElement(sel, options) {
|
|
|
8199
8397
|
createVM(elm, def, {
|
|
8200
8398
|
tagName: sel,
|
|
8201
8399
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
8202
|
-
owner: null
|
|
8203
|
-
renderer
|
|
8400
|
+
owner: null
|
|
8204
8401
|
});
|
|
8205
8402
|
ConnectingSlot.set(elm, connectRootElement);
|
|
8206
8403
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
@@ -8223,6 +8420,10 @@ function createElement(sel, options) {
|
|
|
8223
8420
|
|
|
8224
8421
|
|
|
8225
8422
|
function hydrateComponent(element, Ctor, props = {}) {
|
|
8423
|
+
if (!(element instanceof Element)) {
|
|
8424
|
+
throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
|
|
8425
|
+
}
|
|
8426
|
+
|
|
8226
8427
|
if (!isFunction$1(Ctor)) {
|
|
8227
8428
|
throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
|
|
8228
8429
|
}
|
|
@@ -8240,7 +8441,6 @@ function hydrateComponent(element, Ctor, props = {}) {
|
|
|
8240
8441
|
createVM(element, def, {
|
|
8241
8442
|
mode: 'open',
|
|
8242
8443
|
owner: null,
|
|
8243
|
-
renderer,
|
|
8244
8444
|
tagName: element.tagName.toLowerCase()
|
|
8245
8445
|
});
|
|
8246
8446
|
|
|
@@ -8311,8 +8511,7 @@ function buildCustomElementConstructor(Ctor) {
|
|
|
8311
8511
|
createVM(this, def, {
|
|
8312
8512
|
mode: 'open',
|
|
8313
8513
|
owner: null,
|
|
8314
|
-
tagName: this.tagName
|
|
8315
|
-
renderer
|
|
8514
|
+
tagName: this.tagName
|
|
8316
8515
|
});
|
|
8317
8516
|
}
|
|
8318
8517
|
|
|
@@ -8379,7 +8578,7 @@ function isNodeFromTemplate(node) {
|
|
|
8379
8578
|
return false;
|
|
8380
8579
|
}
|
|
8381
8580
|
|
|
8382
|
-
if (
|
|
8581
|
+
if (isSyntheticShadowDefined) {
|
|
8383
8582
|
// TODO [#1252]: old behavior that is still used by some pieces of the platform,
|
|
8384
8583
|
// specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
|
|
8385
8584
|
// used, will be considered global elements.
|
|
@@ -8432,6 +8631,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8432
8631
|
});
|
|
8433
8632
|
freeze(LightningElement);
|
|
8434
8633
|
seal(LightningElement.prototype);
|
|
8435
|
-
/* version: 2.7.
|
|
8634
|
+
/* version: 2.7.2 */
|
|
8436
8635
|
|
|
8437
8636
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|