lwc 2.6.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 +590 -394
- package/dist/engine-dom/iife/es2017/engine-dom.js +590 -394
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +564 -370
- package/dist/engine-dom/iife/es5/engine-dom.js +648 -351
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +616 -327
- package/dist/engine-dom/umd/es2017/engine-dom.js +590 -394
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +564 -370
- package/dist/engine-dom/umd/es5/engine-dom.js +648 -351
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +616 -327
- package/dist/engine-server/commonjs/es2017/engine-server.js +670 -472
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +670 -472
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +74 -9
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +74 -9
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +74 -9
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +85 -12
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +85 -12
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +74 -9
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +74 -9
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +85 -12
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +85 -12
- 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
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
306
306
|
return attributeName;
|
|
307
307
|
}
|
|
308
|
-
/** version: 2.
|
|
308
|
+
/** version: 2.7.2 */
|
|
309
309
|
|
|
310
310
|
/*
|
|
311
311
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -419,7 +419,6 @@
|
|
|
419
419
|
ENABLE_NODE_LIST_PATCH: null,
|
|
420
420
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
421
421
|
ENABLE_NODE_PATCH: null,
|
|
422
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
423
422
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
424
423
|
};
|
|
425
424
|
|
|
@@ -484,7 +483,7 @@
|
|
|
484
483
|
setFeatureFlag(name, value);
|
|
485
484
|
}
|
|
486
485
|
}
|
|
487
|
-
/** version: 2.
|
|
486
|
+
/** version: 2.7.2 */
|
|
488
487
|
|
|
489
488
|
/* proxy-compat-disable */
|
|
490
489
|
|
|
@@ -558,6 +557,249 @@
|
|
|
558
557
|
}
|
|
559
558
|
|
|
560
559
|
return styleMap;
|
|
560
|
+
} //
|
|
561
|
+
// Primitives
|
|
562
|
+
//
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
let ssr$1;
|
|
566
|
+
|
|
567
|
+
function setSsr(ssrImpl) {
|
|
568
|
+
ssr$1 = ssrImpl;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
let isNativeShadowDefined$1;
|
|
572
|
+
|
|
573
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
574
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
let isSyntheticShadowDefined$1;
|
|
578
|
+
|
|
579
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
580
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
let HTMLElementExported$1;
|
|
584
|
+
|
|
585
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
586
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
let isHydrating$1;
|
|
590
|
+
|
|
591
|
+
function setIsHydrating$1(isHydratingImpl) {
|
|
592
|
+
isHydrating$1 = isHydratingImpl;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
let insert$1;
|
|
596
|
+
|
|
597
|
+
function setInsert(insertImpl) {
|
|
598
|
+
insert$1 = insertImpl;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
let remove$1;
|
|
602
|
+
|
|
603
|
+
function setRemove(removeImpl) {
|
|
604
|
+
remove$1 = removeImpl;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
let createElement$2;
|
|
608
|
+
|
|
609
|
+
function setCreateElement(createElementImpl) {
|
|
610
|
+
createElement$2 = createElementImpl;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
let createText$1;
|
|
614
|
+
|
|
615
|
+
function setCreateText(createTextImpl) {
|
|
616
|
+
createText$1 = createTextImpl;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
let createComment$1;
|
|
620
|
+
|
|
621
|
+
function setCreateComment(createCommentImpl) {
|
|
622
|
+
createComment$1 = createCommentImpl;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
let nextSibling$1;
|
|
626
|
+
|
|
627
|
+
function setNextSibling(nextSiblingImpl) {
|
|
628
|
+
nextSibling$1 = nextSiblingImpl;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
let attachShadow$1;
|
|
632
|
+
|
|
633
|
+
function setAttachShadow(attachShadowImpl) {
|
|
634
|
+
attachShadow$1 = attachShadowImpl;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
let getProperty$1;
|
|
638
|
+
|
|
639
|
+
function setGetProperty(getPropertyImpl) {
|
|
640
|
+
getProperty$1 = getPropertyImpl;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
let setProperty$1;
|
|
644
|
+
|
|
645
|
+
function setSetProperty(setPropertyImpl) {
|
|
646
|
+
setProperty$1 = setPropertyImpl;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
let setText$1;
|
|
650
|
+
|
|
651
|
+
function setSetText(setTextImpl) {
|
|
652
|
+
setText$1 = setTextImpl;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
let getAttribute$1;
|
|
656
|
+
|
|
657
|
+
function setGetAttribute(getAttributeImpl) {
|
|
658
|
+
getAttribute$1 = getAttributeImpl;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
let setAttribute$1;
|
|
662
|
+
|
|
663
|
+
function setSetAttribute(setAttributeImpl) {
|
|
664
|
+
setAttribute$1 = setAttributeImpl;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
let removeAttribute$1;
|
|
668
|
+
|
|
669
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
670
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
let addEventListener$1;
|
|
674
|
+
|
|
675
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
676
|
+
addEventListener$1 = addEventListenerImpl;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
let removeEventListener$1;
|
|
680
|
+
|
|
681
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
682
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
let dispatchEvent$1;
|
|
686
|
+
|
|
687
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
688
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
let getClassList$1;
|
|
692
|
+
|
|
693
|
+
function setGetClassList(getClassListImpl) {
|
|
694
|
+
getClassList$1 = getClassListImpl;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
let setCSSStyleProperty$1;
|
|
698
|
+
|
|
699
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
700
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
let getBoundingClientRect$1;
|
|
704
|
+
|
|
705
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
706
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
let querySelector$1;
|
|
710
|
+
|
|
711
|
+
function setQuerySelector(querySelectorImpl) {
|
|
712
|
+
querySelector$1 = querySelectorImpl;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
let querySelectorAll$1;
|
|
716
|
+
|
|
717
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
718
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
let getElementsByTagName$1;
|
|
722
|
+
|
|
723
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
724
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
let getElementsByClassName$1;
|
|
728
|
+
|
|
729
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
730
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
let getChildren$1;
|
|
734
|
+
|
|
735
|
+
function setGetChildren(getChildrenImpl) {
|
|
736
|
+
getChildren$1 = getChildrenImpl;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
let getChildNodes$1;
|
|
740
|
+
|
|
741
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
742
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
let getFirstChild$1;
|
|
746
|
+
|
|
747
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
748
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
let getFirstElementChild$1;
|
|
752
|
+
|
|
753
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
754
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
let getLastChild$1;
|
|
758
|
+
|
|
759
|
+
function setGetLastChild(getLastChildImpl) {
|
|
760
|
+
getLastChild$1 = getLastChildImpl;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
let getLastElementChild$1;
|
|
764
|
+
|
|
765
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
766
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
let isConnected$1;
|
|
770
|
+
|
|
771
|
+
function setIsConnected(isConnectedImpl) {
|
|
772
|
+
isConnected$1 = isConnectedImpl;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
let insertGlobalStylesheet$1;
|
|
776
|
+
|
|
777
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
778
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
let insertStylesheet$1;
|
|
782
|
+
|
|
783
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
784
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
let assertInstanceOfHTMLElement$1;
|
|
788
|
+
|
|
789
|
+
function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
|
|
790
|
+
assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
let defineCustomElement$1;
|
|
794
|
+
|
|
795
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
796
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
let getCustomElement$1;
|
|
800
|
+
|
|
801
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
802
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
561
803
|
}
|
|
562
804
|
/*
|
|
563
805
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -811,9 +1053,6 @@
|
|
|
811
1053
|
elm,
|
|
812
1054
|
data: {
|
|
813
1055
|
on
|
|
814
|
-
},
|
|
815
|
-
owner: {
|
|
816
|
-
renderer
|
|
817
1056
|
}
|
|
818
1057
|
} = vnode;
|
|
819
1058
|
|
|
@@ -826,7 +1065,7 @@
|
|
|
826
1065
|
let name;
|
|
827
1066
|
|
|
828
1067
|
for (name in on) {
|
|
829
|
-
|
|
1068
|
+
addEventListener$1(elm, name, listener);
|
|
830
1069
|
}
|
|
831
1070
|
}
|
|
832
1071
|
|
|
@@ -968,9 +1207,6 @@
|
|
|
968
1207
|
const {
|
|
969
1208
|
data: {
|
|
970
1209
|
attrs
|
|
971
|
-
},
|
|
972
|
-
owner: {
|
|
973
|
-
renderer
|
|
974
1210
|
}
|
|
975
1211
|
} = vnode;
|
|
976
1212
|
|
|
@@ -993,10 +1229,6 @@
|
|
|
993
1229
|
}
|
|
994
1230
|
|
|
995
1231
|
const elm = vnode.elm;
|
|
996
|
-
const {
|
|
997
|
-
setAttribute,
|
|
998
|
-
removeAttribute
|
|
999
|
-
} = renderer;
|
|
1000
1232
|
let key;
|
|
1001
1233
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
1002
1234
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -1011,14 +1243,14 @@
|
|
|
1011
1243
|
|
|
1012
1244
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
1013
1245
|
// Assume xml namespace
|
|
1014
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
1246
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
1015
1247
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
1016
1248
|
// Assume xlink namespace
|
|
1017
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
1018
|
-
} else if (isNull(cur)) {
|
|
1019
|
-
removeAttribute(elm, key);
|
|
1249
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
1250
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
1251
|
+
removeAttribute$1(elm, key);
|
|
1020
1252
|
} else {
|
|
1021
|
-
setAttribute(elm, key, cur);
|
|
1253
|
+
setAttribute$1(elm, key, cur);
|
|
1022
1254
|
}
|
|
1023
1255
|
|
|
1024
1256
|
lockAttribute();
|
|
@@ -1066,17 +1298,14 @@
|
|
|
1066
1298
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
1067
1299
|
const {
|
|
1068
1300
|
elm,
|
|
1069
|
-
sel
|
|
1070
|
-
owner: {
|
|
1071
|
-
renderer
|
|
1072
|
-
}
|
|
1301
|
+
sel
|
|
1073
1302
|
} = vnode;
|
|
1074
1303
|
|
|
1075
1304
|
for (const key in props) {
|
|
1076
1305
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1077
1306
|
|
|
1078
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
1079
|
-
|
|
1307
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
1308
|
+
setProperty$1(elm, key, cur);
|
|
1080
1309
|
}
|
|
1081
1310
|
}
|
|
1082
1311
|
}
|
|
@@ -1145,9 +1374,6 @@
|
|
|
1145
1374
|
elm,
|
|
1146
1375
|
data: {
|
|
1147
1376
|
className: newClass
|
|
1148
|
-
},
|
|
1149
|
-
owner: {
|
|
1150
|
-
renderer
|
|
1151
1377
|
}
|
|
1152
1378
|
} = vnode;
|
|
1153
1379
|
const {
|
|
@@ -1160,7 +1386,7 @@
|
|
|
1160
1386
|
return;
|
|
1161
1387
|
}
|
|
1162
1388
|
|
|
1163
|
-
const classList =
|
|
1389
|
+
const classList = getClassList$1(elm);
|
|
1164
1390
|
const newClassMap = getMapFromClassName(newClass);
|
|
1165
1391
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
1166
1392
|
let name;
|
|
@@ -1198,24 +1424,17 @@
|
|
|
1198
1424
|
elm,
|
|
1199
1425
|
data: {
|
|
1200
1426
|
style: newStyle
|
|
1201
|
-
},
|
|
1202
|
-
owner: {
|
|
1203
|
-
renderer
|
|
1204
1427
|
}
|
|
1205
1428
|
} = vnode;
|
|
1206
|
-
const {
|
|
1207
|
-
setAttribute,
|
|
1208
|
-
removeAttribute
|
|
1209
|
-
} = renderer;
|
|
1210
1429
|
|
|
1211
1430
|
if (oldVnode.data.style === newStyle) {
|
|
1212
1431
|
return;
|
|
1213
1432
|
}
|
|
1214
1433
|
|
|
1215
1434
|
if (!isString(newStyle) || newStyle === '') {
|
|
1216
|
-
removeAttribute(elm, 'style');
|
|
1435
|
+
removeAttribute$1(elm, 'style');
|
|
1217
1436
|
} else {
|
|
1218
|
-
setAttribute(elm, 'style', newStyle);
|
|
1437
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
1219
1438
|
}
|
|
1220
1439
|
}
|
|
1221
1440
|
|
|
@@ -1240,9 +1459,6 @@
|
|
|
1240
1459
|
elm,
|
|
1241
1460
|
data: {
|
|
1242
1461
|
classMap
|
|
1243
|
-
},
|
|
1244
|
-
owner: {
|
|
1245
|
-
renderer
|
|
1246
1462
|
}
|
|
1247
1463
|
} = vnode;
|
|
1248
1464
|
|
|
@@ -1250,7 +1466,7 @@
|
|
|
1250
1466
|
return;
|
|
1251
1467
|
}
|
|
1252
1468
|
|
|
1253
|
-
const classList =
|
|
1469
|
+
const classList = getClassList$1(elm);
|
|
1254
1470
|
|
|
1255
1471
|
for (const name in classMap) {
|
|
1256
1472
|
classList.add(name);
|
|
@@ -1274,9 +1490,6 @@
|
|
|
1274
1490
|
elm,
|
|
1275
1491
|
data: {
|
|
1276
1492
|
styleDecls
|
|
1277
|
-
},
|
|
1278
|
-
owner: {
|
|
1279
|
-
renderer
|
|
1280
1493
|
}
|
|
1281
1494
|
} = vnode;
|
|
1282
1495
|
|
|
@@ -1286,7 +1499,7 @@
|
|
|
1286
1499
|
|
|
1287
1500
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
1288
1501
|
const [prop, value, important] = styleDecls[i];
|
|
1289
|
-
|
|
1502
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
1290
1503
|
}
|
|
1291
1504
|
}
|
|
1292
1505
|
|
|
@@ -1300,15 +1513,6 @@
|
|
|
1300
1513
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1301
1514
|
*/
|
|
1302
1515
|
|
|
1303
|
-
/**
|
|
1304
|
-
@license
|
|
1305
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1306
|
-
This code may only be used under the MIT License found at
|
|
1307
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1308
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1309
|
-
https://github.com/snabbdom/snabbdom/
|
|
1310
|
-
*/
|
|
1311
|
-
|
|
1312
1516
|
function isUndef(s) {
|
|
1313
1517
|
return s === undefined;
|
|
1314
1518
|
}
|
|
@@ -1396,7 +1600,7 @@
|
|
|
1396
1600
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1397
1601
|
// Vnode moved right
|
|
1398
1602
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1399
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1603
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1400
1604
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1401
1605
|
newEndVnode = newCh[--newEndIdx];
|
|
1402
1606
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1878,7 +2082,7 @@
|
|
|
1878
2082
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1879
2083
|
}
|
|
1880
2084
|
/*
|
|
1881
|
-
* Copyright (c)
|
|
2085
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1882
2086
|
* All rights reserved.
|
|
1883
2087
|
* SPDX-License-Identifier: MIT
|
|
1884
2088
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2798,9 +3002,7 @@
|
|
|
2798
3002
|
|
|
2799
3003
|
|
|
2800
3004
|
const LightningElement = function () {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
3005
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2804
3006
|
if (isNull(vmBeingConstructed)) {
|
|
2805
3007
|
throw new ReferenceError('Illegal constructor');
|
|
2806
3008
|
}
|
|
@@ -2808,15 +3010,14 @@
|
|
|
2808
3010
|
const vm = vmBeingConstructed;
|
|
2809
3011
|
const {
|
|
2810
3012
|
def,
|
|
2811
|
-
elm
|
|
2812
|
-
renderer
|
|
3013
|
+
elm
|
|
2813
3014
|
} = vm;
|
|
2814
3015
|
const {
|
|
2815
3016
|
bridge
|
|
2816
3017
|
} = def;
|
|
2817
3018
|
|
|
2818
3019
|
if (process.env.NODE_ENV !== 'production') {
|
|
2819
|
-
|
|
3020
|
+
assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
|
|
2820
3021
|
}
|
|
2821
3022
|
|
|
2822
3023
|
const component = this;
|
|
@@ -2846,7 +3047,7 @@
|
|
|
2846
3047
|
if (vm.renderMode === 1
|
|
2847
3048
|
/* Shadow */
|
|
2848
3049
|
) {
|
|
2849
|
-
|
|
3050
|
+
doAttachShadow(vm);
|
|
2850
3051
|
} // Adding extra guard rails in DEV mode.
|
|
2851
3052
|
|
|
2852
3053
|
|
|
@@ -2858,17 +3059,16 @@
|
|
|
2858
3059
|
return this;
|
|
2859
3060
|
};
|
|
2860
3061
|
|
|
2861
|
-
function
|
|
3062
|
+
function doAttachShadow(vm) {
|
|
2862
3063
|
const {
|
|
2863
3064
|
elm,
|
|
2864
3065
|
mode,
|
|
2865
|
-
renderer,
|
|
2866
3066
|
shadowMode,
|
|
2867
3067
|
def: {
|
|
2868
3068
|
ctor
|
|
2869
3069
|
}
|
|
2870
3070
|
} = vm;
|
|
2871
|
-
const cmpRoot =
|
|
3071
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2872
3072
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2873
3073
|
/* Synthetic */
|
|
2874
3074
|
,
|
|
@@ -2895,21 +3095,15 @@
|
|
|
2895
3095
|
|
|
2896
3096
|
dispatchEvent(event) {
|
|
2897
3097
|
const {
|
|
2898
|
-
elm
|
|
2899
|
-
renderer: {
|
|
2900
|
-
dispatchEvent
|
|
2901
|
-
}
|
|
3098
|
+
elm
|
|
2902
3099
|
} = getAssociatedVM(this);
|
|
2903
|
-
return dispatchEvent(elm, event);
|
|
3100
|
+
return dispatchEvent$1(elm, event);
|
|
2904
3101
|
},
|
|
2905
3102
|
|
|
2906
3103
|
addEventListener(type, listener, options) {
|
|
2907
3104
|
const vm = getAssociatedVM(this);
|
|
2908
3105
|
const {
|
|
2909
|
-
elm
|
|
2910
|
-
renderer: {
|
|
2911
|
-
addEventListener
|
|
2912
|
-
}
|
|
3106
|
+
elm
|
|
2913
3107
|
} = vm;
|
|
2914
3108
|
|
|
2915
3109
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2920,92 +3114,68 @@
|
|
|
2920
3114
|
}
|
|
2921
3115
|
|
|
2922
3116
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2923
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
3117
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2924
3118
|
},
|
|
2925
3119
|
|
|
2926
3120
|
removeEventListener(type, listener, options) {
|
|
2927
3121
|
const vm = getAssociatedVM(this);
|
|
2928
3122
|
const {
|
|
2929
|
-
elm
|
|
2930
|
-
renderer: {
|
|
2931
|
-
removeEventListener
|
|
2932
|
-
}
|
|
3123
|
+
elm
|
|
2933
3124
|
} = vm;
|
|
2934
3125
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2935
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
3126
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2936
3127
|
},
|
|
2937
3128
|
|
|
2938
3129
|
hasAttribute(name) {
|
|
2939
3130
|
const {
|
|
2940
|
-
elm
|
|
2941
|
-
renderer: {
|
|
2942
|
-
getAttribute
|
|
2943
|
-
}
|
|
3131
|
+
elm
|
|
2944
3132
|
} = getAssociatedVM(this);
|
|
2945
|
-
return !isNull(getAttribute(elm, name));
|
|
3133
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2946
3134
|
},
|
|
2947
3135
|
|
|
2948
3136
|
hasAttributeNS(namespace, name) {
|
|
2949
3137
|
const {
|
|
2950
|
-
elm
|
|
2951
|
-
renderer: {
|
|
2952
|
-
getAttribute
|
|
2953
|
-
}
|
|
3138
|
+
elm
|
|
2954
3139
|
} = getAssociatedVM(this);
|
|
2955
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
3140
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2956
3141
|
},
|
|
2957
3142
|
|
|
2958
3143
|
removeAttribute(name) {
|
|
2959
3144
|
const {
|
|
2960
|
-
elm
|
|
2961
|
-
renderer: {
|
|
2962
|
-
removeAttribute
|
|
2963
|
-
}
|
|
3145
|
+
elm
|
|
2964
3146
|
} = getAssociatedVM(this);
|
|
2965
3147
|
unlockAttribute(elm, name);
|
|
2966
|
-
removeAttribute(elm, name);
|
|
3148
|
+
removeAttribute$1(elm, name);
|
|
2967
3149
|
lockAttribute();
|
|
2968
3150
|
},
|
|
2969
3151
|
|
|
2970
3152
|
removeAttributeNS(namespace, name) {
|
|
2971
3153
|
const {
|
|
2972
|
-
elm
|
|
2973
|
-
renderer: {
|
|
2974
|
-
removeAttribute
|
|
2975
|
-
}
|
|
3154
|
+
elm
|
|
2976
3155
|
} = getAssociatedVM(this);
|
|
2977
3156
|
unlockAttribute(elm, name);
|
|
2978
|
-
removeAttribute(elm, name, namespace);
|
|
3157
|
+
removeAttribute$1(elm, name, namespace);
|
|
2979
3158
|
lockAttribute();
|
|
2980
3159
|
},
|
|
2981
3160
|
|
|
2982
3161
|
getAttribute(name) {
|
|
2983
3162
|
const {
|
|
2984
|
-
elm
|
|
2985
|
-
renderer: {
|
|
2986
|
-
getAttribute
|
|
2987
|
-
}
|
|
3163
|
+
elm
|
|
2988
3164
|
} = getAssociatedVM(this);
|
|
2989
|
-
return getAttribute(elm, name);
|
|
3165
|
+
return getAttribute$1(elm, name);
|
|
2990
3166
|
},
|
|
2991
3167
|
|
|
2992
3168
|
getAttributeNS(namespace, name) {
|
|
2993
3169
|
const {
|
|
2994
|
-
elm
|
|
2995
|
-
renderer: {
|
|
2996
|
-
getAttribute
|
|
2997
|
-
}
|
|
3170
|
+
elm
|
|
2998
3171
|
} = getAssociatedVM(this);
|
|
2999
|
-
return getAttribute(elm, name, namespace);
|
|
3172
|
+
return getAttribute$1(elm, name, namespace);
|
|
3000
3173
|
},
|
|
3001
3174
|
|
|
3002
3175
|
setAttribute(name, value) {
|
|
3003
3176
|
const vm = getAssociatedVM(this);
|
|
3004
3177
|
const {
|
|
3005
|
-
elm
|
|
3006
|
-
renderer: {
|
|
3007
|
-
setAttribute
|
|
3008
|
-
}
|
|
3178
|
+
elm
|
|
3009
3179
|
} = vm;
|
|
3010
3180
|
|
|
3011
3181
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3013,17 +3183,14 @@
|
|
|
3013
3183
|
}
|
|
3014
3184
|
|
|
3015
3185
|
unlockAttribute(elm, name);
|
|
3016
|
-
setAttribute(elm, name, value);
|
|
3186
|
+
setAttribute$1(elm, name, value);
|
|
3017
3187
|
lockAttribute();
|
|
3018
3188
|
},
|
|
3019
3189
|
|
|
3020
3190
|
setAttributeNS(namespace, name, value) {
|
|
3021
3191
|
const vm = getAssociatedVM(this);
|
|
3022
3192
|
const {
|
|
3023
|
-
elm
|
|
3024
|
-
renderer: {
|
|
3025
|
-
setAttribute
|
|
3026
|
-
}
|
|
3193
|
+
elm
|
|
3027
3194
|
} = vm;
|
|
3028
3195
|
|
|
3029
3196
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3031,43 +3198,34 @@
|
|
|
3031
3198
|
}
|
|
3032
3199
|
|
|
3033
3200
|
unlockAttribute(elm, name);
|
|
3034
|
-
setAttribute(elm, name, value, namespace);
|
|
3201
|
+
setAttribute$1(elm, name, value, namespace);
|
|
3035
3202
|
lockAttribute();
|
|
3036
3203
|
},
|
|
3037
3204
|
|
|
3038
3205
|
getBoundingClientRect() {
|
|
3039
3206
|
const vm = getAssociatedVM(this);
|
|
3040
3207
|
const {
|
|
3041
|
-
elm
|
|
3042
|
-
renderer: {
|
|
3043
|
-
getBoundingClientRect
|
|
3044
|
-
}
|
|
3208
|
+
elm
|
|
3045
3209
|
} = vm;
|
|
3046
3210
|
|
|
3047
3211
|
if (process.env.NODE_ENV !== 'production') {
|
|
3048
3212
|
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
|
|
3049
3213
|
}
|
|
3050
3214
|
|
|
3051
|
-
return getBoundingClientRect(elm);
|
|
3215
|
+
return getBoundingClientRect$1(elm);
|
|
3052
3216
|
},
|
|
3053
3217
|
|
|
3054
3218
|
get isConnected() {
|
|
3055
3219
|
const {
|
|
3056
|
-
elm
|
|
3057
|
-
renderer: {
|
|
3058
|
-
isConnected
|
|
3059
|
-
}
|
|
3220
|
+
elm
|
|
3060
3221
|
} = getAssociatedVM(this);
|
|
3061
|
-
return isConnected(elm);
|
|
3222
|
+
return isConnected$1(elm);
|
|
3062
3223
|
},
|
|
3063
3224
|
|
|
3064
3225
|
get classList() {
|
|
3065
3226
|
const vm = getAssociatedVM(this);
|
|
3066
3227
|
const {
|
|
3067
|
-
elm
|
|
3068
|
-
renderer: {
|
|
3069
|
-
getClassList
|
|
3070
|
-
}
|
|
3228
|
+
elm
|
|
3071
3229
|
} = vm;
|
|
3072
3230
|
|
|
3073
3231
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3076,7 +3234,7 @@
|
|
|
3076
3234
|
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.`);
|
|
3077
3235
|
}
|
|
3078
3236
|
|
|
3079
|
-
return getClassList(elm);
|
|
3237
|
+
return getClassList$1(elm);
|
|
3080
3238
|
},
|
|
3081
3239
|
|
|
3082
3240
|
get template() {
|
|
@@ -3110,23 +3268,48 @@
|
|
|
3110
3268
|
}
|
|
3111
3269
|
|
|
3112
3270
|
};
|
|
3113
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
3114
|
-
|
|
3271
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
3272
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
3273
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
3274
|
+
|
|
3275
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
3276
|
+
|
|
3277
|
+
function getChildGetter(methodName) {
|
|
3278
|
+
switch (methodName) {
|
|
3279
|
+
case 'children':
|
|
3280
|
+
return getChildren$1;
|
|
3281
|
+
|
|
3282
|
+
case 'childNodes':
|
|
3283
|
+
return getChildNodes$1;
|
|
3284
|
+
|
|
3285
|
+
case 'firstChild':
|
|
3286
|
+
return getFirstChild$1;
|
|
3287
|
+
|
|
3288
|
+
case 'firstElementChild':
|
|
3289
|
+
return getFirstElementChild$1;
|
|
3290
|
+
|
|
3291
|
+
case 'lastChild':
|
|
3292
|
+
return getLastChild$1;
|
|
3293
|
+
|
|
3294
|
+
case 'lastElementChild':
|
|
3295
|
+
return getLastElementChild$1;
|
|
3296
|
+
}
|
|
3297
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
3298
|
+
|
|
3115
3299
|
|
|
3116
|
-
for (const
|
|
3117
|
-
queryAndChildGetterDescriptors[
|
|
3300
|
+
for (const childGetter of childGetters) {
|
|
3301
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
3118
3302
|
get() {
|
|
3119
3303
|
const vm = getAssociatedVM(this);
|
|
3120
3304
|
const {
|
|
3121
|
-
elm
|
|
3122
|
-
renderer
|
|
3305
|
+
elm
|
|
3123
3306
|
} = vm;
|
|
3124
3307
|
|
|
3125
3308
|
if (process.env.NODE_ENV !== 'production') {
|
|
3126
|
-
warnIfInvokedDuringConstruction(vm,
|
|
3309
|
+
warnIfInvokedDuringConstruction(vm, childGetter);
|
|
3127
3310
|
}
|
|
3128
3311
|
|
|
3129
|
-
return
|
|
3312
|
+
return getChildGetter(childGetter)(elm);
|
|
3130
3313
|
},
|
|
3131
3314
|
|
|
3132
3315
|
configurable: true,
|
|
@@ -3134,22 +3317,38 @@
|
|
|
3134
3317
|
};
|
|
3135
3318
|
}
|
|
3136
3319
|
|
|
3137
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3320
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3321
|
+
|
|
3322
|
+
function getQueryMethod(methodName) {
|
|
3323
|
+
switch (methodName) {
|
|
3324
|
+
case 'getElementsByClassName':
|
|
3325
|
+
return getElementsByClassName$1;
|
|
3326
|
+
|
|
3327
|
+
case 'getElementsByTagName':
|
|
3328
|
+
return getElementsByTagName$1;
|
|
3329
|
+
|
|
3330
|
+
case 'querySelector':
|
|
3331
|
+
return querySelector$1;
|
|
3332
|
+
|
|
3333
|
+
case 'querySelectorAll':
|
|
3334
|
+
return querySelectorAll$1;
|
|
3335
|
+
}
|
|
3336
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
3337
|
+
|
|
3138
3338
|
|
|
3139
3339
|
for (const queryMethod of queryMethods) {
|
|
3140
3340
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
3141
3341
|
value(arg) {
|
|
3142
3342
|
const vm = getAssociatedVM(this);
|
|
3143
3343
|
const {
|
|
3144
|
-
elm
|
|
3145
|
-
renderer
|
|
3344
|
+
elm
|
|
3146
3345
|
} = vm;
|
|
3147
3346
|
|
|
3148
3347
|
if (process.env.NODE_ENV !== 'production') {
|
|
3149
3348
|
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
3150
3349
|
}
|
|
3151
3350
|
|
|
3152
|
-
return
|
|
3351
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
3153
3352
|
},
|
|
3154
3353
|
|
|
3155
3354
|
configurable: true,
|
|
@@ -4305,10 +4504,6 @@
|
|
|
4305
4504
|
|
|
4306
4505
|
assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
4307
4506
|
|
|
4308
|
-
if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
4309
|
-
assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
|
|
4310
|
-
}
|
|
4311
|
-
|
|
4312
4507
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
4313
4508
|
assert.invariant(ctorShadowSupportMode === "any"
|
|
4314
4509
|
/* Any */
|
|
@@ -4552,17 +4747,14 @@
|
|
|
4552
4747
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
4553
4748
|
|
|
4554
4749
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
4555
|
-
|
|
4750
|
+
getClassList$1(elm).add(token);
|
|
4556
4751
|
}
|
|
4557
4752
|
}
|
|
4558
4753
|
|
|
4559
4754
|
function updateNodeHook(oldVnode, vnode) {
|
|
4560
4755
|
const {
|
|
4561
4756
|
elm,
|
|
4562
|
-
text
|
|
4563
|
-
owner: {
|
|
4564
|
-
renderer
|
|
4565
|
-
}
|
|
4757
|
+
text
|
|
4566
4758
|
} = vnode;
|
|
4567
4759
|
|
|
4568
4760
|
if (oldVnode.text !== text) {
|
|
@@ -4570,7 +4762,7 @@
|
|
|
4570
4762
|
unlockDomMutation();
|
|
4571
4763
|
}
|
|
4572
4764
|
|
|
4573
|
-
|
|
4765
|
+
setText$1(elm, text);
|
|
4574
4766
|
|
|
4575
4767
|
if (process.env.NODE_ENV !== 'production') {
|
|
4576
4768
|
lockDomMutation();
|
|
@@ -4579,15 +4771,11 @@
|
|
|
4579
4771
|
}
|
|
4580
4772
|
|
|
4581
4773
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
4582
|
-
const {
|
|
4583
|
-
renderer
|
|
4584
|
-
} = vnode.owner;
|
|
4585
|
-
|
|
4586
4774
|
if (process.env.NODE_ENV !== 'production') {
|
|
4587
4775
|
unlockDomMutation();
|
|
4588
4776
|
}
|
|
4589
4777
|
|
|
4590
|
-
|
|
4778
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
4591
4779
|
|
|
4592
4780
|
if (process.env.NODE_ENV !== 'production') {
|
|
4593
4781
|
lockDomMutation();
|
|
@@ -4595,15 +4783,11 @@
|
|
|
4595
4783
|
}
|
|
4596
4784
|
|
|
4597
4785
|
function removeNodeHook(vnode, parentNode) {
|
|
4598
|
-
const {
|
|
4599
|
-
renderer
|
|
4600
|
-
} = vnode.owner;
|
|
4601
|
-
|
|
4602
4786
|
if (process.env.NODE_ENV !== 'production') {
|
|
4603
4787
|
unlockDomMutation();
|
|
4604
4788
|
}
|
|
4605
4789
|
|
|
4606
|
-
|
|
4790
|
+
remove$1(vnode.elm, parentNode);
|
|
4607
4791
|
|
|
4608
4792
|
if (process.env.NODE_ENV !== 'production') {
|
|
4609
4793
|
lockDomMutation();
|
|
@@ -4695,13 +4879,15 @@
|
|
|
4695
4879
|
|
|
4696
4880
|
function updateChildrenHook(oldVnode, vnode) {
|
|
4697
4881
|
const {
|
|
4698
|
-
|
|
4699
|
-
|
|
4882
|
+
elm,
|
|
4883
|
+
children
|
|
4700
4884
|
} = vnode;
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
}
|
|
4885
|
+
|
|
4886
|
+
if (hasDynamicChildren(children)) {
|
|
4887
|
+
updateDynamicChildren(elm, oldVnode.children, children);
|
|
4888
|
+
} else {
|
|
4889
|
+
updateStaticChildren(elm, oldVnode.children, children);
|
|
4890
|
+
}
|
|
4705
4891
|
}
|
|
4706
4892
|
|
|
4707
4893
|
function allocateChildrenHook(vnode, vm) {
|
|
@@ -4767,8 +4953,7 @@
|
|
|
4767
4953
|
createVM(elm, def, {
|
|
4768
4954
|
mode,
|
|
4769
4955
|
owner,
|
|
4770
|
-
tagName: sel
|
|
4771
|
-
renderer: owner.renderer
|
|
4956
|
+
tagName: sel
|
|
4772
4957
|
});
|
|
4773
4958
|
|
|
4774
4959
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4814,16 +4999,13 @@
|
|
|
4814
4999
|
const {
|
|
4815
5000
|
data: {
|
|
4816
5001
|
attrs = {}
|
|
4817
|
-
},
|
|
4818
|
-
owner: {
|
|
4819
|
-
renderer
|
|
4820
5002
|
}
|
|
4821
5003
|
} = vnode;
|
|
4822
5004
|
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4823
5005
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4824
5006
|
|
|
4825
5007
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4826
|
-
const elmAttrValue =
|
|
5008
|
+
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
4827
5009
|
|
|
4828
5010
|
if (String(attrValue) !== elmAttrValue) {
|
|
4829
5011
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
@@ -4839,9 +5021,6 @@
|
|
|
4839
5021
|
data: {
|
|
4840
5022
|
className,
|
|
4841
5023
|
classMap
|
|
4842
|
-
},
|
|
4843
|
-
owner: {
|
|
4844
|
-
renderer
|
|
4845
5024
|
}
|
|
4846
5025
|
} = vnode;
|
|
4847
5026
|
let nodesAreCompatible = true;
|
|
@@ -4853,7 +5032,7 @@
|
|
|
4853
5032
|
vnodeClassName = className;
|
|
4854
5033
|
} else if (!isUndefined$1(classMap)) {
|
|
4855
5034
|
// classMap is used when class is set to static value.
|
|
4856
|
-
const classList =
|
|
5035
|
+
const classList = getClassList$1(elm);
|
|
4857
5036
|
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4858
5037
|
|
|
4859
5038
|
for (const name in classMap) {
|
|
@@ -4883,12 +5062,9 @@
|
|
|
4883
5062
|
data: {
|
|
4884
5063
|
style,
|
|
4885
5064
|
styleDecls
|
|
4886
|
-
},
|
|
4887
|
-
owner: {
|
|
4888
|
-
renderer
|
|
4889
5065
|
}
|
|
4890
5066
|
} = vnode;
|
|
4891
|
-
const elmStyle =
|
|
5067
|
+
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
4892
5068
|
let vnodeStyle;
|
|
4893
5069
|
let nodesAreCompatible = true;
|
|
4894
5070
|
|
|
@@ -5025,12 +5201,12 @@
|
|
|
5025
5201
|
*/
|
|
5026
5202
|
|
|
5027
5203
|
|
|
5028
|
-
function getUpgradableConstructor(tagName
|
|
5204
|
+
function getUpgradableConstructor(tagName) {
|
|
5029
5205
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
5030
5206
|
// produce only tags with lowercase letters
|
|
5031
5207
|
// But, for backwards compatibility, we will lower case the tagName
|
|
5032
5208
|
tagName = tagName.toLowerCase();
|
|
5033
|
-
let CE =
|
|
5209
|
+
let CE = getCustomElement$1(tagName);
|
|
5034
5210
|
|
|
5035
5211
|
if (!isUndefined$1(CE)) {
|
|
5036
5212
|
return CE;
|
|
@@ -5041,7 +5217,7 @@
|
|
|
5041
5217
|
*/
|
|
5042
5218
|
|
|
5043
5219
|
|
|
5044
|
-
CE = class LWCUpgradableElement extends
|
|
5220
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
5045
5221
|
constructor(upgradeCallback) {
|
|
5046
5222
|
super();
|
|
5047
5223
|
|
|
@@ -5051,7 +5227,7 @@
|
|
|
5051
5227
|
}
|
|
5052
5228
|
|
|
5053
5229
|
};
|
|
5054
|
-
|
|
5230
|
+
defineCustomElement$1(tagName, CE);
|
|
5055
5231
|
return CE;
|
|
5056
5232
|
}
|
|
5057
5233
|
/*
|
|
@@ -5069,10 +5245,7 @@
|
|
|
5069
5245
|
const {
|
|
5070
5246
|
owner
|
|
5071
5247
|
} = vnode;
|
|
5072
|
-
const
|
|
5073
|
-
renderer
|
|
5074
|
-
} = owner;
|
|
5075
|
-
const elm = renderer.createText(vnode.text);
|
|
5248
|
+
const elm = createText$1(vnode.text);
|
|
5076
5249
|
linkNodeToShadow(elm, owner);
|
|
5077
5250
|
vnode.elm = elm;
|
|
5078
5251
|
},
|
|
@@ -5106,10 +5279,7 @@
|
|
|
5106
5279
|
owner,
|
|
5107
5280
|
text
|
|
5108
5281
|
} = vnode;
|
|
5109
|
-
const
|
|
5110
|
-
renderer
|
|
5111
|
-
} = owner;
|
|
5112
|
-
const elm = renderer.createComment(text);
|
|
5282
|
+
const elm = createComment$1(text);
|
|
5113
5283
|
linkNodeToShadow(elm, owner);
|
|
5114
5284
|
vnode.elm = elm;
|
|
5115
5285
|
},
|
|
@@ -5151,11 +5321,8 @@
|
|
|
5151
5321
|
svg
|
|
5152
5322
|
}
|
|
5153
5323
|
} = vnode;
|
|
5154
|
-
const {
|
|
5155
|
-
renderer
|
|
5156
|
-
} = owner;
|
|
5157
5324
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
5158
|
-
const elm =
|
|
5325
|
+
const elm = createElement$2(sel, namespace);
|
|
5159
5326
|
linkNodeToShadow(elm, owner);
|
|
5160
5327
|
fallbackElmHook(elm, vnode);
|
|
5161
5328
|
vnode.elm = elm;
|
|
@@ -5215,10 +5382,7 @@
|
|
|
5215
5382
|
sel,
|
|
5216
5383
|
owner
|
|
5217
5384
|
} = vnode;
|
|
5218
|
-
const
|
|
5219
|
-
renderer
|
|
5220
|
-
} = owner;
|
|
5221
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5385
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5222
5386
|
/**
|
|
5223
5387
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
5224
5388
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -5311,8 +5475,7 @@
|
|
|
5311
5475
|
createVM(elm, def, {
|
|
5312
5476
|
mode,
|
|
5313
5477
|
owner,
|
|
5314
|
-
tagName: sel
|
|
5315
|
-
renderer: owner.renderer
|
|
5478
|
+
tagName: sel
|
|
5316
5479
|
});
|
|
5317
5480
|
vnode.elm = elm;
|
|
5318
5481
|
const vm = getAssociatedVM(elm);
|
|
@@ -5341,12 +5504,11 @@
|
|
|
5341
5504
|
|
|
5342
5505
|
function linkNodeToShadow(elm, owner) {
|
|
5343
5506
|
const {
|
|
5344
|
-
renderer,
|
|
5345
5507
|
renderMode,
|
|
5346
5508
|
shadowMode
|
|
5347
5509
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
5348
5510
|
|
|
5349
|
-
if (
|
|
5511
|
+
if (isSyntheticShadowDefined$1) {
|
|
5350
5512
|
if (shadowMode === 1
|
|
5351
5513
|
/* Synthetic */
|
|
5352
5514
|
|| renderMode === 0
|
|
@@ -5878,7 +6040,6 @@
|
|
|
5878
6040
|
const {
|
|
5879
6041
|
elm,
|
|
5880
6042
|
context,
|
|
5881
|
-
renderer,
|
|
5882
6043
|
renderMode,
|
|
5883
6044
|
shadowMode
|
|
5884
6045
|
} = vm;
|
|
@@ -5905,11 +6066,11 @@
|
|
|
5905
6066
|
} = context;
|
|
5906
6067
|
|
|
5907
6068
|
if (oldHasTokenInClass) {
|
|
5908
|
-
|
|
6069
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
5909
6070
|
}
|
|
5910
6071
|
|
|
5911
6072
|
if (oldHasTokenInAttribute) {
|
|
5912
|
-
|
|
6073
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
5913
6074
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5914
6075
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5915
6076
|
|
|
@@ -5921,12 +6082,12 @@
|
|
|
5921
6082
|
|
|
5922
6083
|
if (!isUndefined$1(newToken)) {
|
|
5923
6084
|
if (hasScopedStyles) {
|
|
5924
|
-
|
|
6085
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
5925
6086
|
newHasTokenInClass = true;
|
|
5926
6087
|
}
|
|
5927
6088
|
|
|
5928
6089
|
if (isSyntheticShadow) {
|
|
5929
|
-
|
|
6090
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
5930
6091
|
newHasTokenInAttribute = true;
|
|
5931
6092
|
}
|
|
5932
6093
|
} // Update the styling tokens present on the context object.
|
|
@@ -6047,7 +6208,6 @@
|
|
|
6047
6208
|
|
|
6048
6209
|
function createStylesheet(vm, stylesheets) {
|
|
6049
6210
|
const {
|
|
6050
|
-
renderer,
|
|
6051
6211
|
renderMode,
|
|
6052
6212
|
shadowMode
|
|
6053
6213
|
} = vm;
|
|
@@ -6058,9 +6218,9 @@
|
|
|
6058
6218
|
/* Synthetic */
|
|
6059
6219
|
) {
|
|
6060
6220
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
6061
|
-
|
|
6221
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
6062
6222
|
}
|
|
6063
|
-
} else if (
|
|
6223
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
6064
6224
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
6065
6225
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
6066
6226
|
// the first time the VM renders.
|
|
@@ -6074,10 +6234,10 @@
|
|
|
6074
6234
|
|
|
6075
6235
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
6076
6236
|
if (isGlobal) {
|
|
6077
|
-
|
|
6237
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
6078
6238
|
} else {
|
|
6079
6239
|
// local level
|
|
6080
|
-
|
|
6240
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
6081
6241
|
}
|
|
6082
6242
|
}
|
|
6083
6243
|
}
|
|
@@ -6162,7 +6322,7 @@
|
|
|
6162
6322
|
if (isProfilerEnabled) {
|
|
6163
6323
|
currentDispatcher(opId, 0
|
|
6164
6324
|
/* Start */
|
|
6165
|
-
, vm.tagName, vm.idx);
|
|
6325
|
+
, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
6166
6326
|
}
|
|
6167
6327
|
}
|
|
6168
6328
|
|
|
@@ -6176,7 +6336,7 @@
|
|
|
6176
6336
|
if (isProfilerEnabled) {
|
|
6177
6337
|
currentDispatcher(opId, 1
|
|
6178
6338
|
/* Stop */
|
|
6179
|
-
, vm.tagName, vm.idx);
|
|
6339
|
+
, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
6180
6340
|
}
|
|
6181
6341
|
}
|
|
6182
6342
|
|
|
@@ -6190,7 +6350,7 @@
|
|
|
6190
6350
|
if (isProfilerEnabled) {
|
|
6191
6351
|
currentDispatcher(opId, 0
|
|
6192
6352
|
/* Start */
|
|
6193
|
-
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
|
|
6353
|
+
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
6194
6354
|
}
|
|
6195
6355
|
}
|
|
6196
6356
|
|
|
@@ -6204,7 +6364,7 @@
|
|
|
6204
6364
|
if (isProfilerEnabled) {
|
|
6205
6365
|
currentDispatcher(opId, 1
|
|
6206
6366
|
/* Stop */
|
|
6207
|
-
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
|
|
6367
|
+
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
6208
6368
|
}
|
|
6209
6369
|
}
|
|
6210
6370
|
/*
|
|
@@ -6769,7 +6929,6 @@
|
|
|
6769
6929
|
const {
|
|
6770
6930
|
mode,
|
|
6771
6931
|
owner,
|
|
6772
|
-
renderer,
|
|
6773
6932
|
tagName
|
|
6774
6933
|
} = options;
|
|
6775
6934
|
const vm = {
|
|
@@ -6784,7 +6943,6 @@
|
|
|
6784
6943
|
tagName,
|
|
6785
6944
|
mode,
|
|
6786
6945
|
owner,
|
|
6787
|
-
renderer,
|
|
6788
6946
|
children: EmptyArray,
|
|
6789
6947
|
aChildren: EmptyArray,
|
|
6790
6948
|
velements: EmptyArray,
|
|
@@ -6839,16 +6997,11 @@
|
|
|
6839
6997
|
|
|
6840
6998
|
function computeShadowMode(vm) {
|
|
6841
6999
|
const {
|
|
6842
|
-
def
|
|
6843
|
-
renderer
|
|
7000
|
+
def
|
|
6844
7001
|
} = vm;
|
|
6845
|
-
const {
|
|
6846
|
-
isNativeShadowDefined,
|
|
6847
|
-
isSyntheticShadowDefined
|
|
6848
|
-
} = renderer;
|
|
6849
7002
|
let shadowMode;
|
|
6850
7003
|
|
|
6851
|
-
if (isSyntheticShadowDefined) {
|
|
7004
|
+
if (isSyntheticShadowDefined$1) {
|
|
6852
7005
|
if (def.renderMode === 0
|
|
6853
7006
|
/* Light */
|
|
6854
7007
|
) {
|
|
@@ -6857,7 +7010,7 @@
|
|
|
6857
7010
|
shadowMode = 0
|
|
6858
7011
|
/* Native */
|
|
6859
7012
|
;
|
|
6860
|
-
} else if (isNativeShadowDefined) {
|
|
7013
|
+
} else if (isNativeShadowDefined$1) {
|
|
6861
7014
|
if (def.shadowSupportMode === "any"
|
|
6862
7015
|
/* Any */
|
|
6863
7016
|
) {
|
|
@@ -6997,13 +7150,12 @@
|
|
|
6997
7150
|
|
|
6998
7151
|
function runRenderedCallback(vm) {
|
|
6999
7152
|
const {
|
|
7000
|
-
renderer,
|
|
7001
7153
|
def: {
|
|
7002
7154
|
renderedCallback
|
|
7003
7155
|
}
|
|
7004
7156
|
} = vm;
|
|
7005
7157
|
|
|
7006
|
-
if (isTrue(
|
|
7158
|
+
if (isTrue(ssr$1)) {
|
|
7007
7159
|
return;
|
|
7008
7160
|
}
|
|
7009
7161
|
|
|
@@ -7229,8 +7381,7 @@
|
|
|
7229
7381
|
|
|
7230
7382
|
function resetComponentRoot(vm) {
|
|
7231
7383
|
const {
|
|
7232
|
-
children
|
|
7233
|
-
renderer
|
|
7384
|
+
children
|
|
7234
7385
|
} = vm;
|
|
7235
7386
|
const rootNode = getRenderRoot(vm);
|
|
7236
7387
|
|
|
@@ -7238,7 +7389,7 @@
|
|
|
7238
7389
|
const child = children[i];
|
|
7239
7390
|
|
|
7240
7391
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
7241
|
-
|
|
7392
|
+
remove$1(child.elm, rootNode);
|
|
7242
7393
|
}
|
|
7243
7394
|
}
|
|
7244
7395
|
|
|
@@ -7248,7 +7399,7 @@
|
|
|
7248
7399
|
}
|
|
7249
7400
|
|
|
7250
7401
|
function scheduleRehydration(vm) {
|
|
7251
|
-
if (isTrue(
|
|
7402
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
7252
7403
|
return;
|
|
7253
7404
|
}
|
|
7254
7405
|
|
|
@@ -7493,7 +7644,6 @@
|
|
|
7493
7644
|
|
|
7494
7645
|
const {
|
|
7495
7646
|
elm,
|
|
7496
|
-
renderer,
|
|
7497
7647
|
context: {
|
|
7498
7648
|
wiredConnecting,
|
|
7499
7649
|
wiredDisconnecting
|
|
@@ -7520,7 +7670,7 @@
|
|
|
7520
7670
|
}
|
|
7521
7671
|
|
|
7522
7672
|
});
|
|
7523
|
-
|
|
7673
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
7524
7674
|
});
|
|
7525
7675
|
}
|
|
7526
7676
|
|
|
@@ -7785,7 +7935,7 @@
|
|
|
7785
7935
|
hooksAreSet = true;
|
|
7786
7936
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7787
7937
|
}
|
|
7788
|
-
/* version: 2.
|
|
7938
|
+
/* version: 2.7.2 */
|
|
7789
7939
|
|
|
7790
7940
|
/*
|
|
7791
7941
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7814,7 +7964,9 @@
|
|
|
7814
7964
|
const styleElements = create(null);
|
|
7815
7965
|
const styleSheets = create(null);
|
|
7816
7966
|
const nodesToStyleSheets = new WeakMap();
|
|
7817
|
-
let getCustomElement
|
|
7967
|
+
let getCustomElement;
|
|
7968
|
+
let defineCustomElement;
|
|
7969
|
+
let HTMLElementConstructor;
|
|
7818
7970
|
|
|
7819
7971
|
function isCustomElementRegistryAvailable() {
|
|
7820
7972
|
if (typeof customElements === 'undefined') {
|
|
@@ -7929,188 +8081,231 @@
|
|
|
7929
8081
|
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
7930
8082
|
}
|
|
7931
8083
|
|
|
7932
|
-
let
|
|
8084
|
+
let hydrating = false;
|
|
7933
8085
|
|
|
7934
|
-
function setIsHydrating(
|
|
7935
|
-
|
|
8086
|
+
function setIsHydrating(value) {
|
|
8087
|
+
hydrating = value;
|
|
7936
8088
|
}
|
|
7937
8089
|
|
|
7938
|
-
const
|
|
7939
|
-
ssr: false,
|
|
8090
|
+
const ssr = false;
|
|
7940
8091
|
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
8092
|
+
function isHydrating() {
|
|
8093
|
+
return hydrating;
|
|
8094
|
+
}
|
|
7944
8095
|
|
|
7945
|
-
|
|
7946
|
-
|
|
8096
|
+
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
8097
|
+
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
7947
8098
|
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
8099
|
+
function createElement$1(tagName, namespace) {
|
|
8100
|
+
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
8101
|
+
}
|
|
7951
8102
|
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
8103
|
+
function createText(content) {
|
|
8104
|
+
return document.createTextNode(content);
|
|
8105
|
+
}
|
|
7955
8106
|
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
8107
|
+
function createComment(content) {
|
|
8108
|
+
return document.createComment(content);
|
|
8109
|
+
}
|
|
7959
8110
|
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
8111
|
+
function insert(node, parent, anchor) {
|
|
8112
|
+
parent.insertBefore(node, anchor);
|
|
8113
|
+
}
|
|
7963
8114
|
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
8115
|
+
function remove(node, parent) {
|
|
8116
|
+
parent.removeChild(node);
|
|
8117
|
+
}
|
|
7967
8118
|
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
8119
|
+
function nextSibling(node) {
|
|
8120
|
+
return node.nextSibling;
|
|
8121
|
+
}
|
|
7971
8122
|
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
8123
|
+
function attachShadow(element, options) {
|
|
8124
|
+
if (hydrating) {
|
|
8125
|
+
return element.shadowRoot;
|
|
8126
|
+
}
|
|
7976
8127
|
|
|
7977
|
-
|
|
7978
|
-
|
|
8128
|
+
return element.attachShadow(options);
|
|
8129
|
+
}
|
|
7979
8130
|
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
8131
|
+
function setText(node, content) {
|
|
8132
|
+
node.nodeValue = content;
|
|
8133
|
+
}
|
|
7983
8134
|
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
8135
|
+
function getProperty(node, key) {
|
|
8136
|
+
return node[key];
|
|
8137
|
+
}
|
|
7987
8138
|
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
}
|
|
8139
|
+
function setProperty(node, key, value) {
|
|
8140
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8141
|
+
if (node instanceof Element && !(key in node)) {
|
|
8142
|
+
// TODO [#1297]: Move this validation to the compiler
|
|
8143
|
+
assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
|
|
7994
8144
|
}
|
|
8145
|
+
}
|
|
7995
8146
|
|
|
7996
|
-
|
|
7997
|
-
|
|
8147
|
+
node[key] = value;
|
|
8148
|
+
}
|
|
7998
8149
|
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8150
|
+
function getAttribute(element, name, namespace) {
|
|
8151
|
+
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
8152
|
+
}
|
|
8002
8153
|
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8154
|
+
function setAttribute(element, name, value, namespace) {
|
|
8155
|
+
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
8156
|
+
}
|
|
8006
8157
|
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8158
|
+
function removeAttribute(element, name, namespace) {
|
|
8159
|
+
if (isUndefined$1(namespace)) {
|
|
8160
|
+
element.removeAttribute(name);
|
|
8161
|
+
} else {
|
|
8162
|
+
element.removeAttributeNS(namespace, name);
|
|
8163
|
+
}
|
|
8164
|
+
}
|
|
8014
8165
|
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8166
|
+
function addEventListener(target, type, callback, options) {
|
|
8167
|
+
target.addEventListener(type, callback, options);
|
|
8168
|
+
}
|
|
8018
8169
|
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8170
|
+
function removeEventListener(target, type, callback, options) {
|
|
8171
|
+
target.removeEventListener(type, callback, options);
|
|
8172
|
+
}
|
|
8022
8173
|
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8174
|
+
function dispatchEvent(target, event) {
|
|
8175
|
+
return target.dispatchEvent(event);
|
|
8176
|
+
}
|
|
8026
8177
|
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8178
|
+
function getClassList(element) {
|
|
8179
|
+
return element.classList;
|
|
8180
|
+
}
|
|
8030
8181
|
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8182
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
8183
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
8184
|
+
// represent elements in the engine?
|
|
8185
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
8186
|
+
}
|
|
8036
8187
|
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8188
|
+
function getBoundingClientRect(element) {
|
|
8189
|
+
return element.getBoundingClientRect();
|
|
8190
|
+
}
|
|
8040
8191
|
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8192
|
+
function querySelector(element, selectors) {
|
|
8193
|
+
return element.querySelector(selectors);
|
|
8194
|
+
}
|
|
8044
8195
|
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8196
|
+
function querySelectorAll(element, selectors) {
|
|
8197
|
+
return element.querySelectorAll(selectors);
|
|
8198
|
+
}
|
|
8048
8199
|
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8200
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
8201
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
8202
|
+
}
|
|
8052
8203
|
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8204
|
+
function getElementsByClassName(element, names) {
|
|
8205
|
+
return element.getElementsByClassName(names);
|
|
8206
|
+
}
|
|
8056
8207
|
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8208
|
+
function getChildren(element) {
|
|
8209
|
+
return element.children;
|
|
8210
|
+
}
|
|
8060
8211
|
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8212
|
+
function getChildNodes(element) {
|
|
8213
|
+
return element.childNodes;
|
|
8214
|
+
}
|
|
8064
8215
|
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8216
|
+
function getFirstChild(element) {
|
|
8217
|
+
return element.firstChild;
|
|
8218
|
+
}
|
|
8068
8219
|
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8220
|
+
function getFirstElementChild(element) {
|
|
8221
|
+
return element.firstElementChild;
|
|
8222
|
+
}
|
|
8072
8223
|
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8224
|
+
function getLastChild(element) {
|
|
8225
|
+
return element.lastChild;
|
|
8226
|
+
}
|
|
8076
8227
|
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8228
|
+
function getLastElementChild(element) {
|
|
8229
|
+
return element.lastElementChild;
|
|
8230
|
+
}
|
|
8080
8231
|
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8232
|
+
function isConnected(node) {
|
|
8233
|
+
return node.isConnected;
|
|
8234
|
+
}
|
|
8084
8235
|
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8236
|
+
function insertGlobalStylesheet(content) {
|
|
8237
|
+
if (!isUndefined$1(globalStylesheets[content])) {
|
|
8238
|
+
return;
|
|
8239
|
+
}
|
|
8089
8240
|
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8241
|
+
globalStylesheets[content] = true;
|
|
8242
|
+
const elm = document.createElement('style');
|
|
8243
|
+
elm.type = 'text/css';
|
|
8244
|
+
elm.textContent = content;
|
|
8245
|
+
globalStylesheetsParentElement.appendChild(elm);
|
|
8246
|
+
}
|
|
8096
8247
|
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8248
|
+
function insertStylesheet(content, target) {
|
|
8249
|
+
if (supportsConstructableStyleSheets) {
|
|
8250
|
+
insertConstructableStyleSheet(content, target);
|
|
8251
|
+
} else {
|
|
8252
|
+
// Fall back to <style> element
|
|
8253
|
+
insertStyleElement(content, target);
|
|
8254
|
+
}
|
|
8255
|
+
}
|
|
8105
8256
|
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8257
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
8258
|
+
assert.invariant(elm instanceof HTMLElement, msg);
|
|
8259
|
+
}
|
|
8109
8260
|
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8261
|
+
const HTMLElementExported = HTMLElementConstructor;
|
|
8262
|
+
/*
|
|
8263
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
8264
|
+
* All rights reserved.
|
|
8265
|
+
* SPDX-License-Identifier: MIT
|
|
8266
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8267
|
+
*/
|
|
8268
|
+
|
|
8269
|
+
setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
|
|
8270
|
+
setAttachShadow(attachShadow);
|
|
8271
|
+
setCreateComment(createComment);
|
|
8272
|
+
setCreateElement(createElement$1);
|
|
8273
|
+
setCreateText(createText);
|
|
8274
|
+
setDefineCustomElement(defineCustomElement);
|
|
8275
|
+
setDispatchEvent(dispatchEvent);
|
|
8276
|
+
setGetAttribute(getAttribute);
|
|
8277
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
8278
|
+
setGetChildNodes(getChildNodes);
|
|
8279
|
+
setGetChildren(getChildren);
|
|
8280
|
+
setGetClassList(getClassList);
|
|
8281
|
+
setGetCustomElement(getCustomElement);
|
|
8282
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
8283
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
8284
|
+
setGetFirstChild(getFirstChild);
|
|
8285
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
8286
|
+
setGetLastChild(getLastChild);
|
|
8287
|
+
setGetLastElementChild(getLastElementChild);
|
|
8288
|
+
setGetProperty(getProperty);
|
|
8289
|
+
setHTMLElement(HTMLElementExported);
|
|
8290
|
+
setInsert(insert);
|
|
8291
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
8292
|
+
setInsertStylesheet(insertStylesheet);
|
|
8293
|
+
setIsConnected(isConnected);
|
|
8294
|
+
setIsHydrating$1(isHydrating);
|
|
8295
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
8296
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
8297
|
+
setNextSibling(nextSibling);
|
|
8298
|
+
setQuerySelector(querySelector);
|
|
8299
|
+
setQuerySelectorAll(querySelectorAll);
|
|
8300
|
+
setRemove(remove);
|
|
8301
|
+
setRemoveAttribute(removeAttribute);
|
|
8302
|
+
setRemoveEventListener(removeEventListener);
|
|
8303
|
+
setSetAttribute(setAttribute);
|
|
8304
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
8305
|
+
setSetProperty(setProperty);
|
|
8306
|
+
setSetText(setText);
|
|
8307
|
+
setSsr(ssr);
|
|
8308
|
+
setAddEventListener(addEventListener);
|
|
8114
8309
|
/*
|
|
8115
8310
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
8116
8311
|
* All rights reserved.
|
|
@@ -8193,7 +8388,7 @@
|
|
|
8193
8388
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
8194
8389
|
}
|
|
8195
8390
|
|
|
8196
|
-
const UpgradableConstructor = getUpgradableConstructor(sel
|
|
8391
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
8197
8392
|
let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
8198
8393
|
|
|
8199
8394
|
/**
|
|
@@ -8208,8 +8403,7 @@
|
|
|
8208
8403
|
createVM(elm, def, {
|
|
8209
8404
|
tagName: sel,
|
|
8210
8405
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
8211
|
-
owner: null
|
|
8212
|
-
renderer
|
|
8406
|
+
owner: null
|
|
8213
8407
|
});
|
|
8214
8408
|
ConnectingSlot.set(elm, connectRootElement);
|
|
8215
8409
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
@@ -8232,6 +8426,10 @@
|
|
|
8232
8426
|
|
|
8233
8427
|
|
|
8234
8428
|
function hydrateComponent(element, Ctor, props = {}) {
|
|
8429
|
+
if (!(element instanceof Element)) {
|
|
8430
|
+
throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
|
|
8431
|
+
}
|
|
8432
|
+
|
|
8235
8433
|
if (!isFunction$1(Ctor)) {
|
|
8236
8434
|
throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
|
|
8237
8435
|
}
|
|
@@ -8249,7 +8447,6 @@
|
|
|
8249
8447
|
createVM(element, def, {
|
|
8250
8448
|
mode: 'open',
|
|
8251
8449
|
owner: null,
|
|
8252
|
-
renderer,
|
|
8253
8450
|
tagName: element.tagName.toLowerCase()
|
|
8254
8451
|
});
|
|
8255
8452
|
|
|
@@ -8320,8 +8517,7 @@
|
|
|
8320
8517
|
createVM(this, def, {
|
|
8321
8518
|
mode: 'open',
|
|
8322
8519
|
owner: null,
|
|
8323
|
-
tagName: this.tagName
|
|
8324
|
-
renderer
|
|
8520
|
+
tagName: this.tagName
|
|
8325
8521
|
});
|
|
8326
8522
|
}
|
|
8327
8523
|
|
|
@@ -8388,7 +8584,7 @@
|
|
|
8388
8584
|
return false;
|
|
8389
8585
|
}
|
|
8390
8586
|
|
|
8391
|
-
if (
|
|
8587
|
+
if (isSyntheticShadowDefined) {
|
|
8392
8588
|
// TODO [#1252]: old behavior that is still used by some pieces of the platform,
|
|
8393
8589
|
// specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
|
|
8394
8590
|
// used, will be considered global elements.
|
|
@@ -8441,7 +8637,7 @@
|
|
|
8441
8637
|
});
|
|
8442
8638
|
freeze(LightningElement);
|
|
8443
8639
|
seal(LightningElement.prototype);
|
|
8444
|
-
/* version: 2.
|
|
8640
|
+
/* version: 2.7.2 */
|
|
8445
8641
|
|
|
8446
8642
|
exports.LightningElement = LightningElement;
|
|
8447
8643
|
exports.__unstable__ProfilerControl = profilerControl;
|