lwc 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +578 -384
- package/dist/engine-dom/iife/es2017/engine-dom.js +578 -384
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +552 -360
- package/dist/engine-dom/iife/es5/engine-dom.js +630 -335
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +598 -311
- package/dist/engine-dom/umd/es2017/engine-dom.js +578 -384
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +552 -360
- package/dist/engine-dom/umd/es5/engine-dom.js +630 -335
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +598 -311
- package/dist/engine-server/commonjs/es2017/engine-server.js +647 -454
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +647 -454
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +115 -13
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +119 -13
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +119 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +115 -13
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +119 -13
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +119 -13
- 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
|
@@ -339,7 +339,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
339
339
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
340
340
|
return attributeName;
|
|
341
341
|
}
|
|
342
|
-
/** version: 2.6.
|
|
342
|
+
/** version: 2.6.3 */
|
|
343
343
|
|
|
344
344
|
/*
|
|
345
345
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -397,7 +397,6 @@ const features = {
|
|
|
397
397
|
ENABLE_NODE_LIST_PATCH: null,
|
|
398
398
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
399
399
|
ENABLE_NODE_PATCH: null,
|
|
400
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
401
400
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
402
401
|
};
|
|
403
402
|
|
|
@@ -462,7 +461,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
462
461
|
setFeatureFlag(name, value);
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
|
-
/** version: 2.6.
|
|
464
|
+
/** version: 2.6.3 */
|
|
466
465
|
|
|
467
466
|
/* proxy-compat-disable */
|
|
468
467
|
|
|
@@ -536,6 +535,249 @@ function parseStyleText(cssText) {
|
|
|
536
535
|
}
|
|
537
536
|
|
|
538
537
|
return styleMap;
|
|
538
|
+
} //
|
|
539
|
+
// Primitives
|
|
540
|
+
//
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
let ssr$1;
|
|
544
|
+
|
|
545
|
+
function setSsr(ssrImpl) {
|
|
546
|
+
ssr$1 = ssrImpl;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
let isNativeShadowDefined$1;
|
|
550
|
+
|
|
551
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
552
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
let isSyntheticShadowDefined$1;
|
|
556
|
+
|
|
557
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
558
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
let HTMLElementExported$1;
|
|
562
|
+
|
|
563
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
564
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
let isHydrating$1;
|
|
568
|
+
|
|
569
|
+
function setIsHydrating(isHydratingImpl) {
|
|
570
|
+
isHydrating$1 = isHydratingImpl;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
let insert$1;
|
|
574
|
+
|
|
575
|
+
function setInsert(insertImpl) {
|
|
576
|
+
insert$1 = insertImpl;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
let remove$1;
|
|
580
|
+
|
|
581
|
+
function setRemove(removeImpl) {
|
|
582
|
+
remove$1 = removeImpl;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
let createElement$1;
|
|
586
|
+
|
|
587
|
+
function setCreateElement(createElementImpl) {
|
|
588
|
+
createElement$1 = createElementImpl;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
let createText$1;
|
|
592
|
+
|
|
593
|
+
function setCreateText(createTextImpl) {
|
|
594
|
+
createText$1 = createTextImpl;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
let createComment$1;
|
|
598
|
+
|
|
599
|
+
function setCreateComment(createCommentImpl) {
|
|
600
|
+
createComment$1 = createCommentImpl;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
let nextSibling$1;
|
|
604
|
+
|
|
605
|
+
function setNextSibling(nextSiblingImpl) {
|
|
606
|
+
nextSibling$1 = nextSiblingImpl;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
let attachShadow$1;
|
|
610
|
+
|
|
611
|
+
function setAttachShadow(attachShadowImpl) {
|
|
612
|
+
attachShadow$1 = attachShadowImpl;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
let getProperty$1;
|
|
616
|
+
|
|
617
|
+
function setGetProperty(getPropertyImpl) {
|
|
618
|
+
getProperty$1 = getPropertyImpl;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
let setProperty$1;
|
|
622
|
+
|
|
623
|
+
function setSetProperty(setPropertyImpl) {
|
|
624
|
+
setProperty$1 = setPropertyImpl;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
let setText$1;
|
|
628
|
+
|
|
629
|
+
function setSetText(setTextImpl) {
|
|
630
|
+
setText$1 = setTextImpl;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
let getAttribute$1;
|
|
634
|
+
|
|
635
|
+
function setGetAttribute(getAttributeImpl) {
|
|
636
|
+
getAttribute$1 = getAttributeImpl;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
let setAttribute$1;
|
|
640
|
+
|
|
641
|
+
function setSetAttribute(setAttributeImpl) {
|
|
642
|
+
setAttribute$1 = setAttributeImpl;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
let removeAttribute$1;
|
|
646
|
+
|
|
647
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
648
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
let addEventListener$1;
|
|
652
|
+
|
|
653
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
654
|
+
addEventListener$1 = addEventListenerImpl;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
let removeEventListener$1;
|
|
658
|
+
|
|
659
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
660
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
let dispatchEvent$1;
|
|
664
|
+
|
|
665
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
666
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
let getClassList$1;
|
|
670
|
+
|
|
671
|
+
function setGetClassList(getClassListImpl) {
|
|
672
|
+
getClassList$1 = getClassListImpl;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
let setCSSStyleProperty$1;
|
|
676
|
+
|
|
677
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
678
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
let getBoundingClientRect$1;
|
|
682
|
+
|
|
683
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
684
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
let querySelector$1;
|
|
688
|
+
|
|
689
|
+
function setQuerySelector(querySelectorImpl) {
|
|
690
|
+
querySelector$1 = querySelectorImpl;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
let querySelectorAll$1;
|
|
694
|
+
|
|
695
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
696
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
let getElementsByTagName$1;
|
|
700
|
+
|
|
701
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
702
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
let getElementsByClassName$1;
|
|
706
|
+
|
|
707
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
708
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
let getChildren$1;
|
|
712
|
+
|
|
713
|
+
function setGetChildren(getChildrenImpl) {
|
|
714
|
+
getChildren$1 = getChildrenImpl;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
let getChildNodes$1;
|
|
718
|
+
|
|
719
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
720
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
let getFirstChild$1;
|
|
724
|
+
|
|
725
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
726
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
let getFirstElementChild$1;
|
|
730
|
+
|
|
731
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
732
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
let getLastChild$1;
|
|
736
|
+
|
|
737
|
+
function setGetLastChild(getLastChildImpl) {
|
|
738
|
+
getLastChild$1 = getLastChildImpl;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
let getLastElementChild$1;
|
|
742
|
+
|
|
743
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
744
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
let isConnected$1;
|
|
748
|
+
|
|
749
|
+
function setIsConnected(isConnectedImpl) {
|
|
750
|
+
isConnected$1 = isConnectedImpl;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
let insertGlobalStylesheet$1;
|
|
754
|
+
|
|
755
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
756
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
let insertStylesheet$1;
|
|
760
|
+
|
|
761
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
762
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
let assertInstanceOfHTMLElement$1;
|
|
766
|
+
|
|
767
|
+
function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
|
|
768
|
+
assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
let defineCustomElement$1;
|
|
772
|
+
|
|
773
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
774
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
let getCustomElement$1;
|
|
778
|
+
|
|
779
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
780
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
539
781
|
}
|
|
540
782
|
/*
|
|
541
783
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -789,9 +1031,6 @@ function createAllEventListeners(vnode) {
|
|
|
789
1031
|
elm,
|
|
790
1032
|
data: {
|
|
791
1033
|
on
|
|
792
|
-
},
|
|
793
|
-
owner: {
|
|
794
|
-
renderer
|
|
795
1034
|
}
|
|
796
1035
|
} = vnode;
|
|
797
1036
|
|
|
@@ -804,7 +1043,7 @@ function createAllEventListeners(vnode) {
|
|
|
804
1043
|
let name;
|
|
805
1044
|
|
|
806
1045
|
for (name in on) {
|
|
807
|
-
|
|
1046
|
+
addEventListener$1(elm, name, listener);
|
|
808
1047
|
}
|
|
809
1048
|
}
|
|
810
1049
|
|
|
@@ -946,9 +1185,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
946
1185
|
const {
|
|
947
1186
|
data: {
|
|
948
1187
|
attrs
|
|
949
|
-
},
|
|
950
|
-
owner: {
|
|
951
|
-
renderer
|
|
952
1188
|
}
|
|
953
1189
|
} = vnode;
|
|
954
1190
|
|
|
@@ -971,10 +1207,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
971
1207
|
}
|
|
972
1208
|
|
|
973
1209
|
const elm = vnode.elm;
|
|
974
|
-
const {
|
|
975
|
-
setAttribute,
|
|
976
|
-
removeAttribute
|
|
977
|
-
} = renderer;
|
|
978
1210
|
let key;
|
|
979
1211
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
980
1212
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -989,14 +1221,14 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
989
1221
|
|
|
990
1222
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
991
1223
|
// Assume xml namespace
|
|
992
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
1224
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
993
1225
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
994
1226
|
// Assume xlink namespace
|
|
995
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
996
|
-
} else if (isNull(cur)) {
|
|
997
|
-
removeAttribute(elm, key);
|
|
1227
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
1228
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
1229
|
+
removeAttribute$1(elm, key);
|
|
998
1230
|
} else {
|
|
999
|
-
setAttribute(elm, key, cur);
|
|
1231
|
+
setAttribute$1(elm, key, cur);
|
|
1000
1232
|
}
|
|
1001
1233
|
|
|
1002
1234
|
lockAttribute();
|
|
@@ -1044,17 +1276,14 @@ function update(oldVnode, vnode) {
|
|
|
1044
1276
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
1045
1277
|
const {
|
|
1046
1278
|
elm,
|
|
1047
|
-
sel
|
|
1048
|
-
owner: {
|
|
1049
|
-
renderer
|
|
1050
|
-
}
|
|
1279
|
+
sel
|
|
1051
1280
|
} = vnode;
|
|
1052
1281
|
|
|
1053
1282
|
for (const key in props) {
|
|
1054
1283
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1055
1284
|
|
|
1056
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
1057
|
-
|
|
1285
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
1286
|
+
setProperty$1(elm, key, cur);
|
|
1058
1287
|
}
|
|
1059
1288
|
}
|
|
1060
1289
|
}
|
|
@@ -1123,9 +1352,6 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1123
1352
|
elm,
|
|
1124
1353
|
data: {
|
|
1125
1354
|
className: newClass
|
|
1126
|
-
},
|
|
1127
|
-
owner: {
|
|
1128
|
-
renderer
|
|
1129
1355
|
}
|
|
1130
1356
|
} = vnode;
|
|
1131
1357
|
const {
|
|
@@ -1138,7 +1364,7 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1138
1364
|
return;
|
|
1139
1365
|
}
|
|
1140
1366
|
|
|
1141
|
-
const classList =
|
|
1367
|
+
const classList = getClassList$1(elm);
|
|
1142
1368
|
const newClassMap = getMapFromClassName(newClass);
|
|
1143
1369
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
1144
1370
|
let name;
|
|
@@ -1176,24 +1402,17 @@ function updateStyleAttribute(oldVnode, vnode) {
|
|
|
1176
1402
|
elm,
|
|
1177
1403
|
data: {
|
|
1178
1404
|
style: newStyle
|
|
1179
|
-
},
|
|
1180
|
-
owner: {
|
|
1181
|
-
renderer
|
|
1182
1405
|
}
|
|
1183
1406
|
} = vnode;
|
|
1184
|
-
const {
|
|
1185
|
-
setAttribute,
|
|
1186
|
-
removeAttribute
|
|
1187
|
-
} = renderer;
|
|
1188
1407
|
|
|
1189
1408
|
if (oldVnode.data.style === newStyle) {
|
|
1190
1409
|
return;
|
|
1191
1410
|
}
|
|
1192
1411
|
|
|
1193
1412
|
if (!isString(newStyle) || newStyle === '') {
|
|
1194
|
-
removeAttribute(elm, 'style');
|
|
1413
|
+
removeAttribute$1(elm, 'style');
|
|
1195
1414
|
} else {
|
|
1196
|
-
setAttribute(elm, 'style', newStyle);
|
|
1415
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
1197
1416
|
}
|
|
1198
1417
|
}
|
|
1199
1418
|
|
|
@@ -1218,9 +1437,6 @@ function createClassAttribute(vnode) {
|
|
|
1218
1437
|
elm,
|
|
1219
1438
|
data: {
|
|
1220
1439
|
classMap
|
|
1221
|
-
},
|
|
1222
|
-
owner: {
|
|
1223
|
-
renderer
|
|
1224
1440
|
}
|
|
1225
1441
|
} = vnode;
|
|
1226
1442
|
|
|
@@ -1228,7 +1444,7 @@ function createClassAttribute(vnode) {
|
|
|
1228
1444
|
return;
|
|
1229
1445
|
}
|
|
1230
1446
|
|
|
1231
|
-
const classList =
|
|
1447
|
+
const classList = getClassList$1(elm);
|
|
1232
1448
|
|
|
1233
1449
|
for (const name in classMap) {
|
|
1234
1450
|
classList.add(name);
|
|
@@ -1252,9 +1468,6 @@ function createStyleAttribute(vnode) {
|
|
|
1252
1468
|
elm,
|
|
1253
1469
|
data: {
|
|
1254
1470
|
styleDecls
|
|
1255
|
-
},
|
|
1256
|
-
owner: {
|
|
1257
|
-
renderer
|
|
1258
1471
|
}
|
|
1259
1472
|
} = vnode;
|
|
1260
1473
|
|
|
@@ -1264,7 +1477,7 @@ function createStyleAttribute(vnode) {
|
|
|
1264
1477
|
|
|
1265
1478
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
1266
1479
|
const [prop, value, important] = styleDecls[i];
|
|
1267
|
-
|
|
1480
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
1268
1481
|
}
|
|
1269
1482
|
}
|
|
1270
1483
|
|
|
@@ -1278,15 +1491,6 @@ var modStaticStyle = {
|
|
|
1278
1491
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1279
1492
|
*/
|
|
1280
1493
|
|
|
1281
|
-
/**
|
|
1282
|
-
@license
|
|
1283
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1284
|
-
This code may only be used under the MIT License found at
|
|
1285
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1286
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1287
|
-
https://github.com/snabbdom/snabbdom/
|
|
1288
|
-
*/
|
|
1289
|
-
|
|
1290
1494
|
function isUndef(s) {
|
|
1291
1495
|
return s === undefined;
|
|
1292
1496
|
}
|
|
@@ -1374,7 +1578,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
|
1374
1578
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1375
1579
|
// Vnode moved right
|
|
1376
1580
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1377
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1581
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1378
1582
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1379
1583
|
newEndVnode = newCh[--newEndIdx];
|
|
1380
1584
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1856,7 +2060,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
|
1856
2060
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1857
2061
|
}
|
|
1858
2062
|
/*
|
|
1859
|
-
* Copyright (c)
|
|
2063
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1860
2064
|
* All rights reserved.
|
|
1861
2065
|
* SPDX-License-Identifier: MIT
|
|
1862
2066
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2776,9 +2980,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
2776
2980
|
|
|
2777
2981
|
|
|
2778
2982
|
const LightningElement = function () {
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2983
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2782
2984
|
if (isNull(vmBeingConstructed)) {
|
|
2783
2985
|
throw new ReferenceError('Illegal constructor');
|
|
2784
2986
|
}
|
|
@@ -2786,15 +2988,14 @@ const LightningElement = function () {
|
|
|
2786
2988
|
const vm = vmBeingConstructed;
|
|
2787
2989
|
const {
|
|
2788
2990
|
def,
|
|
2789
|
-
elm
|
|
2790
|
-
renderer
|
|
2991
|
+
elm
|
|
2791
2992
|
} = vm;
|
|
2792
2993
|
const {
|
|
2793
2994
|
bridge
|
|
2794
2995
|
} = def;
|
|
2795
2996
|
|
|
2796
2997
|
if (process.env.NODE_ENV !== 'production') {
|
|
2797
|
-
|
|
2998
|
+
assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
|
|
2798
2999
|
}
|
|
2799
3000
|
|
|
2800
3001
|
const component = this;
|
|
@@ -2824,7 +3025,7 @@ const LightningElement = function () {
|
|
|
2824
3025
|
if (vm.renderMode === 1
|
|
2825
3026
|
/* Shadow */
|
|
2826
3027
|
) {
|
|
2827
|
-
|
|
3028
|
+
doAttachShadow(vm);
|
|
2828
3029
|
} // Adding extra guard rails in DEV mode.
|
|
2829
3030
|
|
|
2830
3031
|
|
|
@@ -2836,17 +3037,16 @@ const LightningElement = function () {
|
|
|
2836
3037
|
return this;
|
|
2837
3038
|
};
|
|
2838
3039
|
|
|
2839
|
-
function
|
|
3040
|
+
function doAttachShadow(vm) {
|
|
2840
3041
|
const {
|
|
2841
3042
|
elm,
|
|
2842
3043
|
mode,
|
|
2843
|
-
renderer,
|
|
2844
3044
|
shadowMode,
|
|
2845
3045
|
def: {
|
|
2846
3046
|
ctor
|
|
2847
3047
|
}
|
|
2848
3048
|
} = vm;
|
|
2849
|
-
const cmpRoot =
|
|
3049
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2850
3050
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2851
3051
|
/* Synthetic */
|
|
2852
3052
|
,
|
|
@@ -2873,21 +3073,15 @@ LightningElement.prototype = {
|
|
|
2873
3073
|
|
|
2874
3074
|
dispatchEvent(event) {
|
|
2875
3075
|
const {
|
|
2876
|
-
elm
|
|
2877
|
-
renderer: {
|
|
2878
|
-
dispatchEvent
|
|
2879
|
-
}
|
|
3076
|
+
elm
|
|
2880
3077
|
} = getAssociatedVM(this);
|
|
2881
|
-
return dispatchEvent(elm, event);
|
|
3078
|
+
return dispatchEvent$1(elm, event);
|
|
2882
3079
|
},
|
|
2883
3080
|
|
|
2884
3081
|
addEventListener(type, listener, options) {
|
|
2885
3082
|
const vm = getAssociatedVM(this);
|
|
2886
3083
|
const {
|
|
2887
|
-
elm
|
|
2888
|
-
renderer: {
|
|
2889
|
-
addEventListener
|
|
2890
|
-
}
|
|
3084
|
+
elm
|
|
2891
3085
|
} = vm;
|
|
2892
3086
|
|
|
2893
3087
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2898,92 +3092,68 @@ LightningElement.prototype = {
|
|
|
2898
3092
|
}
|
|
2899
3093
|
|
|
2900
3094
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2901
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
3095
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2902
3096
|
},
|
|
2903
3097
|
|
|
2904
3098
|
removeEventListener(type, listener, options) {
|
|
2905
3099
|
const vm = getAssociatedVM(this);
|
|
2906
3100
|
const {
|
|
2907
|
-
elm
|
|
2908
|
-
renderer: {
|
|
2909
|
-
removeEventListener
|
|
2910
|
-
}
|
|
3101
|
+
elm
|
|
2911
3102
|
} = vm;
|
|
2912
3103
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2913
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
3104
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2914
3105
|
},
|
|
2915
3106
|
|
|
2916
3107
|
hasAttribute(name) {
|
|
2917
3108
|
const {
|
|
2918
|
-
elm
|
|
2919
|
-
renderer: {
|
|
2920
|
-
getAttribute
|
|
2921
|
-
}
|
|
3109
|
+
elm
|
|
2922
3110
|
} = getAssociatedVM(this);
|
|
2923
|
-
return !isNull(getAttribute(elm, name));
|
|
3111
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2924
3112
|
},
|
|
2925
3113
|
|
|
2926
3114
|
hasAttributeNS(namespace, name) {
|
|
2927
3115
|
const {
|
|
2928
|
-
elm
|
|
2929
|
-
renderer: {
|
|
2930
|
-
getAttribute
|
|
2931
|
-
}
|
|
3116
|
+
elm
|
|
2932
3117
|
} = getAssociatedVM(this);
|
|
2933
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
3118
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2934
3119
|
},
|
|
2935
3120
|
|
|
2936
3121
|
removeAttribute(name) {
|
|
2937
3122
|
const {
|
|
2938
|
-
elm
|
|
2939
|
-
renderer: {
|
|
2940
|
-
removeAttribute
|
|
2941
|
-
}
|
|
3123
|
+
elm
|
|
2942
3124
|
} = getAssociatedVM(this);
|
|
2943
3125
|
unlockAttribute(elm, name);
|
|
2944
|
-
removeAttribute(elm, name);
|
|
3126
|
+
removeAttribute$1(elm, name);
|
|
2945
3127
|
lockAttribute();
|
|
2946
3128
|
},
|
|
2947
3129
|
|
|
2948
3130
|
removeAttributeNS(namespace, name) {
|
|
2949
3131
|
const {
|
|
2950
|
-
elm
|
|
2951
|
-
renderer: {
|
|
2952
|
-
removeAttribute
|
|
2953
|
-
}
|
|
3132
|
+
elm
|
|
2954
3133
|
} = getAssociatedVM(this);
|
|
2955
3134
|
unlockAttribute(elm, name);
|
|
2956
|
-
removeAttribute(elm, name, namespace);
|
|
3135
|
+
removeAttribute$1(elm, name, namespace);
|
|
2957
3136
|
lockAttribute();
|
|
2958
3137
|
},
|
|
2959
3138
|
|
|
2960
3139
|
getAttribute(name) {
|
|
2961
3140
|
const {
|
|
2962
|
-
elm
|
|
2963
|
-
renderer: {
|
|
2964
|
-
getAttribute
|
|
2965
|
-
}
|
|
3141
|
+
elm
|
|
2966
3142
|
} = getAssociatedVM(this);
|
|
2967
|
-
return getAttribute(elm, name);
|
|
3143
|
+
return getAttribute$1(elm, name);
|
|
2968
3144
|
},
|
|
2969
3145
|
|
|
2970
3146
|
getAttributeNS(namespace, name) {
|
|
2971
3147
|
const {
|
|
2972
|
-
elm
|
|
2973
|
-
renderer: {
|
|
2974
|
-
getAttribute
|
|
2975
|
-
}
|
|
3148
|
+
elm
|
|
2976
3149
|
} = getAssociatedVM(this);
|
|
2977
|
-
return getAttribute(elm, name, namespace);
|
|
3150
|
+
return getAttribute$1(elm, name, namespace);
|
|
2978
3151
|
},
|
|
2979
3152
|
|
|
2980
3153
|
setAttribute(name, value) {
|
|
2981
3154
|
const vm = getAssociatedVM(this);
|
|
2982
3155
|
const {
|
|
2983
|
-
elm
|
|
2984
|
-
renderer: {
|
|
2985
|
-
setAttribute
|
|
2986
|
-
}
|
|
3156
|
+
elm
|
|
2987
3157
|
} = vm;
|
|
2988
3158
|
|
|
2989
3159
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2991,17 +3161,14 @@ LightningElement.prototype = {
|
|
|
2991
3161
|
}
|
|
2992
3162
|
|
|
2993
3163
|
unlockAttribute(elm, name);
|
|
2994
|
-
setAttribute(elm, name, value);
|
|
3164
|
+
setAttribute$1(elm, name, value);
|
|
2995
3165
|
lockAttribute();
|
|
2996
3166
|
},
|
|
2997
3167
|
|
|
2998
3168
|
setAttributeNS(namespace, name, value) {
|
|
2999
3169
|
const vm = getAssociatedVM(this);
|
|
3000
3170
|
const {
|
|
3001
|
-
elm
|
|
3002
|
-
renderer: {
|
|
3003
|
-
setAttribute
|
|
3004
|
-
}
|
|
3171
|
+
elm
|
|
3005
3172
|
} = vm;
|
|
3006
3173
|
|
|
3007
3174
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3009,43 +3176,34 @@ LightningElement.prototype = {
|
|
|
3009
3176
|
}
|
|
3010
3177
|
|
|
3011
3178
|
unlockAttribute(elm, name);
|
|
3012
|
-
setAttribute(elm, name, value, namespace);
|
|
3179
|
+
setAttribute$1(elm, name, value, namespace);
|
|
3013
3180
|
lockAttribute();
|
|
3014
3181
|
},
|
|
3015
3182
|
|
|
3016
3183
|
getBoundingClientRect() {
|
|
3017
3184
|
const vm = getAssociatedVM(this);
|
|
3018
3185
|
const {
|
|
3019
|
-
elm
|
|
3020
|
-
renderer: {
|
|
3021
|
-
getBoundingClientRect
|
|
3022
|
-
}
|
|
3186
|
+
elm
|
|
3023
3187
|
} = vm;
|
|
3024
3188
|
|
|
3025
3189
|
if (process.env.NODE_ENV !== 'production') {
|
|
3026
3190
|
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
|
|
3027
3191
|
}
|
|
3028
3192
|
|
|
3029
|
-
return getBoundingClientRect(elm);
|
|
3193
|
+
return getBoundingClientRect$1(elm);
|
|
3030
3194
|
},
|
|
3031
3195
|
|
|
3032
3196
|
get isConnected() {
|
|
3033
3197
|
const {
|
|
3034
|
-
elm
|
|
3035
|
-
renderer: {
|
|
3036
|
-
isConnected
|
|
3037
|
-
}
|
|
3198
|
+
elm
|
|
3038
3199
|
} = getAssociatedVM(this);
|
|
3039
|
-
return isConnected(elm);
|
|
3200
|
+
return isConnected$1(elm);
|
|
3040
3201
|
},
|
|
3041
3202
|
|
|
3042
3203
|
get classList() {
|
|
3043
3204
|
const vm = getAssociatedVM(this);
|
|
3044
3205
|
const {
|
|
3045
|
-
elm
|
|
3046
|
-
renderer: {
|
|
3047
|
-
getClassList
|
|
3048
|
-
}
|
|
3206
|
+
elm
|
|
3049
3207
|
} = vm;
|
|
3050
3208
|
|
|
3051
3209
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3054,7 +3212,7 @@ LightningElement.prototype = {
|
|
|
3054
3212
|
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.`);
|
|
3055
3213
|
}
|
|
3056
3214
|
|
|
3057
|
-
return getClassList(elm);
|
|
3215
|
+
return getClassList$1(elm);
|
|
3058
3216
|
},
|
|
3059
3217
|
|
|
3060
3218
|
get template() {
|
|
@@ -3088,23 +3246,48 @@ LightningElement.prototype = {
|
|
|
3088
3246
|
}
|
|
3089
3247
|
|
|
3090
3248
|
};
|
|
3091
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
3092
|
-
|
|
3249
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
3250
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
3251
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
3252
|
+
|
|
3253
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
3254
|
+
|
|
3255
|
+
function getChildGetter(methodName) {
|
|
3256
|
+
switch (methodName) {
|
|
3257
|
+
case 'children':
|
|
3258
|
+
return getChildren$1;
|
|
3259
|
+
|
|
3260
|
+
case 'childNodes':
|
|
3261
|
+
return getChildNodes$1;
|
|
3262
|
+
|
|
3263
|
+
case 'firstChild':
|
|
3264
|
+
return getFirstChild$1;
|
|
3265
|
+
|
|
3266
|
+
case 'firstElementChild':
|
|
3267
|
+
return getFirstElementChild$1;
|
|
3093
3268
|
|
|
3094
|
-
|
|
3095
|
-
|
|
3269
|
+
case 'lastChild':
|
|
3270
|
+
return getLastChild$1;
|
|
3271
|
+
|
|
3272
|
+
case 'lastElementChild':
|
|
3273
|
+
return getLastElementChild$1;
|
|
3274
|
+
}
|
|
3275
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
3276
|
+
|
|
3277
|
+
|
|
3278
|
+
for (const childGetter of childGetters) {
|
|
3279
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
3096
3280
|
get() {
|
|
3097
3281
|
const vm = getAssociatedVM(this);
|
|
3098
3282
|
const {
|
|
3099
|
-
elm
|
|
3100
|
-
renderer
|
|
3283
|
+
elm
|
|
3101
3284
|
} = vm;
|
|
3102
3285
|
|
|
3103
3286
|
if (process.env.NODE_ENV !== 'production') {
|
|
3104
|
-
warnIfInvokedDuringConstruction(vm,
|
|
3287
|
+
warnIfInvokedDuringConstruction(vm, childGetter);
|
|
3105
3288
|
}
|
|
3106
3289
|
|
|
3107
|
-
return
|
|
3290
|
+
return getChildGetter(childGetter)(elm);
|
|
3108
3291
|
},
|
|
3109
3292
|
|
|
3110
3293
|
configurable: true,
|
|
@@ -3112,22 +3295,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
|
|
|
3112
3295
|
};
|
|
3113
3296
|
}
|
|
3114
3297
|
|
|
3115
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3298
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3299
|
+
|
|
3300
|
+
function getQueryMethod(methodName) {
|
|
3301
|
+
switch (methodName) {
|
|
3302
|
+
case 'getElementsByClassName':
|
|
3303
|
+
return getElementsByClassName$1;
|
|
3304
|
+
|
|
3305
|
+
case 'getElementsByTagName':
|
|
3306
|
+
return getElementsByTagName$1;
|
|
3307
|
+
|
|
3308
|
+
case 'querySelector':
|
|
3309
|
+
return querySelector$1;
|
|
3310
|
+
|
|
3311
|
+
case 'querySelectorAll':
|
|
3312
|
+
return querySelectorAll$1;
|
|
3313
|
+
}
|
|
3314
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
3315
|
+
|
|
3116
3316
|
|
|
3117
3317
|
for (const queryMethod of queryMethods) {
|
|
3118
3318
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
3119
3319
|
value(arg) {
|
|
3120
3320
|
const vm = getAssociatedVM(this);
|
|
3121
3321
|
const {
|
|
3122
|
-
elm
|
|
3123
|
-
renderer
|
|
3322
|
+
elm
|
|
3124
3323
|
} = vm;
|
|
3125
3324
|
|
|
3126
3325
|
if (process.env.NODE_ENV !== 'production') {
|
|
3127
3326
|
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
3128
3327
|
}
|
|
3129
3328
|
|
|
3130
|
-
return
|
|
3329
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
3131
3330
|
},
|
|
3132
3331
|
|
|
3133
3332
|
configurable: true,
|
|
@@ -4163,10 +4362,6 @@ function createComponentDef(Ctor) {
|
|
|
4163
4362
|
|
|
4164
4363
|
assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
4165
4364
|
|
|
4166
|
-
if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
4167
|
-
assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
|
|
4168
|
-
}
|
|
4169
|
-
|
|
4170
4365
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
4171
4366
|
assert.invariant(ctorShadowSupportMode === "any"
|
|
4172
4367
|
/* Any */
|
|
@@ -4410,17 +4605,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
|
|
|
4410
4605
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
4411
4606
|
|
|
4412
4607
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
4413
|
-
|
|
4608
|
+
getClassList$1(elm).add(token);
|
|
4414
4609
|
}
|
|
4415
4610
|
}
|
|
4416
4611
|
|
|
4417
4612
|
function updateNodeHook(oldVnode, vnode) {
|
|
4418
4613
|
const {
|
|
4419
4614
|
elm,
|
|
4420
|
-
text
|
|
4421
|
-
owner: {
|
|
4422
|
-
renderer
|
|
4423
|
-
}
|
|
4615
|
+
text
|
|
4424
4616
|
} = vnode;
|
|
4425
4617
|
|
|
4426
4618
|
if (oldVnode.text !== text) {
|
|
@@ -4428,7 +4620,7 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4428
4620
|
unlockDomMutation();
|
|
4429
4621
|
}
|
|
4430
4622
|
|
|
4431
|
-
|
|
4623
|
+
setText$1(elm, text);
|
|
4432
4624
|
|
|
4433
4625
|
if (process.env.NODE_ENV !== 'production') {
|
|
4434
4626
|
lockDomMutation();
|
|
@@ -4437,15 +4629,11 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4437
4629
|
}
|
|
4438
4630
|
|
|
4439
4631
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
4440
|
-
const {
|
|
4441
|
-
renderer
|
|
4442
|
-
} = vnode.owner;
|
|
4443
|
-
|
|
4444
4632
|
if (process.env.NODE_ENV !== 'production') {
|
|
4445
4633
|
unlockDomMutation();
|
|
4446
4634
|
}
|
|
4447
4635
|
|
|
4448
|
-
|
|
4636
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
4449
4637
|
|
|
4450
4638
|
if (process.env.NODE_ENV !== 'production') {
|
|
4451
4639
|
lockDomMutation();
|
|
@@ -4453,15 +4641,11 @@ function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
|
4453
4641
|
}
|
|
4454
4642
|
|
|
4455
4643
|
function removeNodeHook(vnode, parentNode) {
|
|
4456
|
-
const {
|
|
4457
|
-
renderer
|
|
4458
|
-
} = vnode.owner;
|
|
4459
|
-
|
|
4460
4644
|
if (process.env.NODE_ENV !== 'production') {
|
|
4461
4645
|
unlockDomMutation();
|
|
4462
4646
|
}
|
|
4463
4647
|
|
|
4464
|
-
|
|
4648
|
+
remove$1(vnode.elm, parentNode);
|
|
4465
4649
|
|
|
4466
4650
|
if (process.env.NODE_ENV !== 'production') {
|
|
4467
4651
|
lockDomMutation();
|
|
@@ -4627,8 +4811,7 @@ function createViewModelHook(elm, vnode) {
|
|
|
4627
4811
|
createVM(elm, def, {
|
|
4628
4812
|
mode,
|
|
4629
4813
|
owner,
|
|
4630
|
-
tagName: sel
|
|
4631
|
-
renderer: owner.renderer
|
|
4814
|
+
tagName: sel
|
|
4632
4815
|
});
|
|
4633
4816
|
|
|
4634
4817
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4674,16 +4857,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
|
|
|
4674
4857
|
const {
|
|
4675
4858
|
data: {
|
|
4676
4859
|
attrs = {}
|
|
4677
|
-
},
|
|
4678
|
-
owner: {
|
|
4679
|
-
renderer
|
|
4680
4860
|
}
|
|
4681
4861
|
} = vnode;
|
|
4682
4862
|
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4683
4863
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4684
4864
|
|
|
4685
4865
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4686
|
-
const elmAttrValue =
|
|
4866
|
+
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
4687
4867
|
|
|
4688
4868
|
if (String(attrValue) !== elmAttrValue) {
|
|
4689
4869
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
@@ -4699,9 +4879,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4699
4879
|
data: {
|
|
4700
4880
|
className,
|
|
4701
4881
|
classMap
|
|
4702
|
-
},
|
|
4703
|
-
owner: {
|
|
4704
|
-
renderer
|
|
4705
4882
|
}
|
|
4706
4883
|
} = vnode;
|
|
4707
4884
|
let nodesAreCompatible = true;
|
|
@@ -4713,7 +4890,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4713
4890
|
vnodeClassName = className;
|
|
4714
4891
|
} else if (!isUndefined$1(classMap)) {
|
|
4715
4892
|
// classMap is used when class is set to static value.
|
|
4716
|
-
const classList =
|
|
4893
|
+
const classList = getClassList$1(elm);
|
|
4717
4894
|
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4718
4895
|
|
|
4719
4896
|
for (const name in classMap) {
|
|
@@ -4743,12 +4920,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
|
|
|
4743
4920
|
data: {
|
|
4744
4921
|
style,
|
|
4745
4922
|
styleDecls
|
|
4746
|
-
},
|
|
4747
|
-
owner: {
|
|
4748
|
-
renderer
|
|
4749
4923
|
}
|
|
4750
4924
|
} = vnode;
|
|
4751
|
-
const elmStyle =
|
|
4925
|
+
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
4752
4926
|
let vnodeStyle;
|
|
4753
4927
|
let nodesAreCompatible = true;
|
|
4754
4928
|
|
|
@@ -4885,12 +5059,12 @@ function hasDynamicChildren(children) {
|
|
|
4885
5059
|
*/
|
|
4886
5060
|
|
|
4887
5061
|
|
|
4888
|
-
function getUpgradableConstructor(tagName
|
|
5062
|
+
function getUpgradableConstructor(tagName) {
|
|
4889
5063
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
4890
5064
|
// produce only tags with lowercase letters
|
|
4891
5065
|
// But, for backwards compatibility, we will lower case the tagName
|
|
4892
5066
|
tagName = tagName.toLowerCase();
|
|
4893
|
-
let CE =
|
|
5067
|
+
let CE = getCustomElement$1(tagName);
|
|
4894
5068
|
|
|
4895
5069
|
if (!isUndefined$1(CE)) {
|
|
4896
5070
|
return CE;
|
|
@@ -4901,7 +5075,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4901
5075
|
*/
|
|
4902
5076
|
|
|
4903
5077
|
|
|
4904
|
-
CE = class LWCUpgradableElement extends
|
|
5078
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
4905
5079
|
constructor(upgradeCallback) {
|
|
4906
5080
|
super();
|
|
4907
5081
|
|
|
@@ -4911,7 +5085,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4911
5085
|
}
|
|
4912
5086
|
|
|
4913
5087
|
};
|
|
4914
|
-
|
|
5088
|
+
defineCustomElement$1(tagName, CE);
|
|
4915
5089
|
return CE;
|
|
4916
5090
|
}
|
|
4917
5091
|
/*
|
|
@@ -4929,10 +5103,7 @@ const TextHook = {
|
|
|
4929
5103
|
const {
|
|
4930
5104
|
owner
|
|
4931
5105
|
} = vnode;
|
|
4932
|
-
const
|
|
4933
|
-
renderer
|
|
4934
|
-
} = owner;
|
|
4935
|
-
const elm = renderer.createText(vnode.text);
|
|
5106
|
+
const elm = createText$1(vnode.text);
|
|
4936
5107
|
linkNodeToShadow(elm, owner);
|
|
4937
5108
|
vnode.elm = elm;
|
|
4938
5109
|
},
|
|
@@ -4966,10 +5137,7 @@ const CommentHook = {
|
|
|
4966
5137
|
owner,
|
|
4967
5138
|
text
|
|
4968
5139
|
} = vnode;
|
|
4969
|
-
const
|
|
4970
|
-
renderer
|
|
4971
|
-
} = owner;
|
|
4972
|
-
const elm = renderer.createComment(text);
|
|
5140
|
+
const elm = createComment$1(text);
|
|
4973
5141
|
linkNodeToShadow(elm, owner);
|
|
4974
5142
|
vnode.elm = elm;
|
|
4975
5143
|
},
|
|
@@ -5011,11 +5179,8 @@ const ElementHook = {
|
|
|
5011
5179
|
svg
|
|
5012
5180
|
}
|
|
5013
5181
|
} = vnode;
|
|
5014
|
-
const {
|
|
5015
|
-
renderer
|
|
5016
|
-
} = owner;
|
|
5017
5182
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
5018
|
-
const elm =
|
|
5183
|
+
const elm = createElement$1(sel, namespace);
|
|
5019
5184
|
linkNodeToShadow(elm, owner);
|
|
5020
5185
|
fallbackElmHook(elm, vnode);
|
|
5021
5186
|
vnode.elm = elm;
|
|
@@ -5075,10 +5240,7 @@ const CustomElementHook = {
|
|
|
5075
5240
|
sel,
|
|
5076
5241
|
owner
|
|
5077
5242
|
} = vnode;
|
|
5078
|
-
const
|
|
5079
|
-
renderer
|
|
5080
|
-
} = owner;
|
|
5081
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5243
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5082
5244
|
/**
|
|
5083
5245
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
5084
5246
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -5171,8 +5333,7 @@ const CustomElementHook = {
|
|
|
5171
5333
|
createVM(elm, def, {
|
|
5172
5334
|
mode,
|
|
5173
5335
|
owner,
|
|
5174
|
-
tagName: sel
|
|
5175
|
-
renderer: owner.renderer
|
|
5336
|
+
tagName: sel
|
|
5176
5337
|
});
|
|
5177
5338
|
vnode.elm = elm;
|
|
5178
5339
|
const vm = getAssociatedVM(elm);
|
|
@@ -5201,12 +5362,11 @@ const CustomElementHook = {
|
|
|
5201
5362
|
|
|
5202
5363
|
function linkNodeToShadow(elm, owner) {
|
|
5203
5364
|
const {
|
|
5204
|
-
renderer,
|
|
5205
5365
|
renderMode,
|
|
5206
5366
|
shadowMode
|
|
5207
5367
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
5208
5368
|
|
|
5209
|
-
if (
|
|
5369
|
+
if (isSyntheticShadowDefined$1) {
|
|
5210
5370
|
if (shadowMode === 1
|
|
5211
5371
|
/* Synthetic */
|
|
5212
5372
|
|| renderMode === 0
|
|
@@ -5738,7 +5898,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5738
5898
|
const {
|
|
5739
5899
|
elm,
|
|
5740
5900
|
context,
|
|
5741
|
-
renderer,
|
|
5742
5901
|
renderMode,
|
|
5743
5902
|
shadowMode
|
|
5744
5903
|
} = vm;
|
|
@@ -5765,11 +5924,11 @@ function updateStylesheetToken(vm, template) {
|
|
|
5765
5924
|
} = context;
|
|
5766
5925
|
|
|
5767
5926
|
if (oldHasTokenInClass) {
|
|
5768
|
-
|
|
5927
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
5769
5928
|
}
|
|
5770
5929
|
|
|
5771
5930
|
if (oldHasTokenInAttribute) {
|
|
5772
|
-
|
|
5931
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
5773
5932
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5774
5933
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5775
5934
|
|
|
@@ -5781,12 +5940,12 @@ function updateStylesheetToken(vm, template) {
|
|
|
5781
5940
|
|
|
5782
5941
|
if (!isUndefined$1(newToken)) {
|
|
5783
5942
|
if (hasScopedStyles) {
|
|
5784
|
-
|
|
5943
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
5785
5944
|
newHasTokenInClass = true;
|
|
5786
5945
|
}
|
|
5787
5946
|
|
|
5788
5947
|
if (isSyntheticShadow) {
|
|
5789
|
-
|
|
5948
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
5790
5949
|
newHasTokenInAttribute = true;
|
|
5791
5950
|
}
|
|
5792
5951
|
} // Update the styling tokens present on the context object.
|
|
@@ -5907,7 +6066,6 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
5907
6066
|
|
|
5908
6067
|
function createStylesheet(vm, stylesheets) {
|
|
5909
6068
|
const {
|
|
5910
|
-
renderer,
|
|
5911
6069
|
renderMode,
|
|
5912
6070
|
shadowMode
|
|
5913
6071
|
} = vm;
|
|
@@ -5918,9 +6076,9 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5918
6076
|
/* Synthetic */
|
|
5919
6077
|
) {
|
|
5920
6078
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5921
|
-
|
|
6079
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
5922
6080
|
}
|
|
5923
|
-
} else if (
|
|
6081
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
5924
6082
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
5925
6083
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
5926
6084
|
// the first time the VM renders.
|
|
@@ -5934,10 +6092,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5934
6092
|
|
|
5935
6093
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5936
6094
|
if (isGlobal) {
|
|
5937
|
-
|
|
6095
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
5938
6096
|
} else {
|
|
5939
6097
|
// local level
|
|
5940
|
-
|
|
6098
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
5941
6099
|
}
|
|
5942
6100
|
}
|
|
5943
6101
|
}
|
|
@@ -6571,7 +6729,6 @@ function createVM(elm, def, options) {
|
|
|
6571
6729
|
const {
|
|
6572
6730
|
mode,
|
|
6573
6731
|
owner,
|
|
6574
|
-
renderer,
|
|
6575
6732
|
tagName
|
|
6576
6733
|
} = options;
|
|
6577
6734
|
const vm = {
|
|
@@ -6586,7 +6743,6 @@ function createVM(elm, def, options) {
|
|
|
6586
6743
|
tagName,
|
|
6587
6744
|
mode,
|
|
6588
6745
|
owner,
|
|
6589
|
-
renderer,
|
|
6590
6746
|
children: EmptyArray,
|
|
6591
6747
|
aChildren: EmptyArray,
|
|
6592
6748
|
velements: EmptyArray,
|
|
@@ -6641,16 +6797,11 @@ function createVM(elm, def, options) {
|
|
|
6641
6797
|
|
|
6642
6798
|
function computeShadowMode(vm) {
|
|
6643
6799
|
const {
|
|
6644
|
-
def
|
|
6645
|
-
renderer
|
|
6800
|
+
def
|
|
6646
6801
|
} = vm;
|
|
6647
|
-
const {
|
|
6648
|
-
isNativeShadowDefined,
|
|
6649
|
-
isSyntheticShadowDefined
|
|
6650
|
-
} = renderer;
|
|
6651
6802
|
let shadowMode;
|
|
6652
6803
|
|
|
6653
|
-
if (isSyntheticShadowDefined) {
|
|
6804
|
+
if (isSyntheticShadowDefined$1) {
|
|
6654
6805
|
if (def.renderMode === 0
|
|
6655
6806
|
/* Light */
|
|
6656
6807
|
) {
|
|
@@ -6659,7 +6810,7 @@ function computeShadowMode(vm) {
|
|
|
6659
6810
|
shadowMode = 0
|
|
6660
6811
|
/* Native */
|
|
6661
6812
|
;
|
|
6662
|
-
} else if (isNativeShadowDefined) {
|
|
6813
|
+
} else if (isNativeShadowDefined$1) {
|
|
6663
6814
|
if (def.shadowSupportMode === "any"
|
|
6664
6815
|
/* Any */
|
|
6665
6816
|
) {
|
|
@@ -6799,13 +6950,12 @@ function patchShadowRoot(vm, newCh) {
|
|
|
6799
6950
|
|
|
6800
6951
|
function runRenderedCallback(vm) {
|
|
6801
6952
|
const {
|
|
6802
|
-
renderer,
|
|
6803
6953
|
def: {
|
|
6804
6954
|
renderedCallback
|
|
6805
6955
|
}
|
|
6806
6956
|
} = vm;
|
|
6807
6957
|
|
|
6808
|
-
if (isTrue(
|
|
6958
|
+
if (isTrue(ssr$1)) {
|
|
6809
6959
|
return;
|
|
6810
6960
|
}
|
|
6811
6961
|
|
|
@@ -7031,8 +7181,7 @@ function recursivelyDisconnectChildren(vnodes) {
|
|
|
7031
7181
|
|
|
7032
7182
|
function resetComponentRoot(vm) {
|
|
7033
7183
|
const {
|
|
7034
|
-
children
|
|
7035
|
-
renderer
|
|
7184
|
+
children
|
|
7036
7185
|
} = vm;
|
|
7037
7186
|
const rootNode = getRenderRoot(vm);
|
|
7038
7187
|
|
|
@@ -7040,7 +7189,7 @@ function resetComponentRoot(vm) {
|
|
|
7040
7189
|
const child = children[i];
|
|
7041
7190
|
|
|
7042
7191
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
7043
|
-
|
|
7192
|
+
remove$1(child.elm, rootNode);
|
|
7044
7193
|
}
|
|
7045
7194
|
}
|
|
7046
7195
|
|
|
@@ -7050,7 +7199,7 @@ function resetComponentRoot(vm) {
|
|
|
7050
7199
|
}
|
|
7051
7200
|
|
|
7052
7201
|
function scheduleRehydration(vm) {
|
|
7053
|
-
if (isTrue(
|
|
7202
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
7054
7203
|
return;
|
|
7055
7204
|
}
|
|
7056
7205
|
|
|
@@ -7277,7 +7426,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7277
7426
|
|
|
7278
7427
|
const {
|
|
7279
7428
|
elm,
|
|
7280
|
-
renderer,
|
|
7281
7429
|
context: {
|
|
7282
7430
|
wiredConnecting,
|
|
7283
7431
|
wiredDisconnecting
|
|
@@ -7304,7 +7452,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7304
7452
|
}
|
|
7305
7453
|
|
|
7306
7454
|
});
|
|
7307
|
-
|
|
7455
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
7308
7456
|
});
|
|
7309
7457
|
}
|
|
7310
7458
|
|
|
@@ -7569,7 +7717,7 @@ function setHooks(hooks) {
|
|
|
7569
7717
|
hooksAreSet = true;
|
|
7570
7718
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7571
7719
|
}
|
|
7572
|
-
/* version: 2.6.
|
|
7720
|
+
/* version: 2.6.3 */
|
|
7573
7721
|
|
|
7574
7722
|
/*
|
|
7575
7723
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -7643,7 +7791,7 @@ function registerCustomElement(name, ctor) {
|
|
|
7643
7791
|
reverseRegistry.set(ctor, name);
|
|
7644
7792
|
}
|
|
7645
7793
|
|
|
7646
|
-
class
|
|
7794
|
+
class HTMLElementImpl {
|
|
7647
7795
|
constructor() {
|
|
7648
7796
|
const {
|
|
7649
7797
|
constructor
|
|
@@ -7659,275 +7807,321 @@ class HTMLElement$1 {
|
|
|
7659
7807
|
|
|
7660
7808
|
}
|
|
7661
7809
|
|
|
7662
|
-
const
|
|
7663
|
-
ssr: true,
|
|
7810
|
+
const ssr = true;
|
|
7664
7811
|
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7812
|
+
function isHydrating() {
|
|
7813
|
+
return false;
|
|
7814
|
+
}
|
|
7668
7815
|
|
|
7669
|
-
|
|
7670
|
-
|
|
7816
|
+
const isNativeShadowDefined = false;
|
|
7817
|
+
const isSyntheticShadowDefined = false;
|
|
7671
7818
|
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7819
|
+
function insert(node, parent, anchor) {
|
|
7820
|
+
if (node.parent !== null && node.parent !== parent) {
|
|
7821
|
+
const nodeIndex = node.parent.children.indexOf(node);
|
|
7822
|
+
node.parent.children.splice(nodeIndex, 1);
|
|
7823
|
+
}
|
|
7677
7824
|
|
|
7678
|
-
|
|
7679
|
-
|
|
7825
|
+
node.parent = parent;
|
|
7826
|
+
const anchorIndex = isNull(anchor) ? -1 : parent.children.indexOf(anchor);
|
|
7680
7827
|
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
remove(node, parent) {
|
|
7689
|
-
const nodeIndex = parent.children.indexOf(node);
|
|
7690
|
-
parent.children.splice(nodeIndex, 1);
|
|
7691
|
-
},
|
|
7828
|
+
if (anchorIndex === -1) {
|
|
7829
|
+
parent.children.push(node);
|
|
7830
|
+
} else {
|
|
7831
|
+
parent.children.splice(anchorIndex, 0, node);
|
|
7832
|
+
}
|
|
7833
|
+
}
|
|
7692
7834
|
|
|
7693
|
-
|
|
7835
|
+
function remove(node, parent) {
|
|
7836
|
+
const nodeIndex = parent.children.indexOf(node);
|
|
7837
|
+
parent.children.splice(nodeIndex, 1);
|
|
7838
|
+
}
|
|
7694
7839
|
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7840
|
+
function createText(content) {
|
|
7841
|
+
return {
|
|
7842
|
+
type: HostNodeType.Text,
|
|
7843
|
+
value: String(content),
|
|
7844
|
+
parent: null
|
|
7845
|
+
};
|
|
7846
|
+
}
|
|
7702
7847
|
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7848
|
+
function createComment(content) {
|
|
7849
|
+
return {
|
|
7850
|
+
type: HostNodeType.Comment,
|
|
7851
|
+
value: content,
|
|
7852
|
+
parent: null
|
|
7853
|
+
};
|
|
7854
|
+
}
|
|
7710
7855
|
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7856
|
+
function nextSibling(node) {
|
|
7857
|
+
const {
|
|
7858
|
+
parent
|
|
7859
|
+
} = node;
|
|
7715
7860
|
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7861
|
+
if (isNull(parent)) {
|
|
7862
|
+
return null;
|
|
7863
|
+
}
|
|
7719
7864
|
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7865
|
+
const nodeIndex = parent.children.indexOf(node);
|
|
7866
|
+
return parent.children[nodeIndex + 1] || null;
|
|
7867
|
+
}
|
|
7723
7868
|
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7869
|
+
function attachShadow(element, config) {
|
|
7870
|
+
element.shadowRoot = {
|
|
7871
|
+
type: HostNodeType.ShadowRoot,
|
|
7872
|
+
children: [],
|
|
7873
|
+
mode: config.mode,
|
|
7874
|
+
delegatesFocus: !!config.delegatesFocus
|
|
7875
|
+
};
|
|
7876
|
+
return element.shadowRoot;
|
|
7877
|
+
}
|
|
7733
7878
|
|
|
7734
|
-
|
|
7735
|
-
|
|
7879
|
+
function getProperty(node, key) {
|
|
7880
|
+
var _a, _b;
|
|
7736
7881
|
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7882
|
+
if (key in node) {
|
|
7883
|
+
return node[key];
|
|
7884
|
+
}
|
|
7740
7885
|
|
|
7741
|
-
|
|
7742
|
-
|
|
7886
|
+
if (node.type === HostNodeType.Element) {
|
|
7887
|
+
const attrName = htmlPropertyToAttribute(key); // Handle all the boolean properties.
|
|
7743
7888
|
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7889
|
+
if (isBooleanAttribute(attrName, node.name)) {
|
|
7890
|
+
return (_a = getAttribute(node, attrName)) !== null && _a !== void 0 ? _a : false;
|
|
7891
|
+
} // Handle global html attributes and AOM.
|
|
7747
7892
|
|
|
7748
7893
|
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7894
|
+
if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
|
|
7895
|
+
return getAttribute(node, attrName);
|
|
7896
|
+
} // Handle special elements live bindings. The checked property is already handled above
|
|
7897
|
+
// in the boolean case.
|
|
7753
7898
|
|
|
7754
7899
|
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
}
|
|
7900
|
+
if (node.name === 'input' && key === 'value') {
|
|
7901
|
+
return (_b = getAttribute(node, 'value')) !== null && _b !== void 0 ? _b : '';
|
|
7758
7902
|
}
|
|
7903
|
+
}
|
|
7759
7904
|
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7905
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7906
|
+
// eslint-disable-next-line no-console
|
|
7907
|
+
console.error(`Unexpected "${key}" property access from the renderer`);
|
|
7908
|
+
}
|
|
7909
|
+
}
|
|
7765
7910
|
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7911
|
+
function setProperty(node, key, value) {
|
|
7912
|
+
if (key in node) {
|
|
7913
|
+
return node[key] = value;
|
|
7914
|
+
}
|
|
7770
7915
|
|
|
7771
|
-
|
|
7772
|
-
|
|
7916
|
+
if (node.type === HostNodeType.Element) {
|
|
7917
|
+
const attrName = htmlPropertyToAttribute(key);
|
|
7773
7918
|
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7919
|
+
if (key === 'innerHTML') {
|
|
7920
|
+
node.children = [{
|
|
7921
|
+
type: HostNodeType.Raw,
|
|
7922
|
+
parent: node,
|
|
7923
|
+
value
|
|
7924
|
+
}];
|
|
7925
|
+
return;
|
|
7926
|
+
} // Handle all the boolean properties.
|
|
7782
7927
|
|
|
7783
7928
|
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7929
|
+
if (isBooleanAttribute(attrName, node.name)) {
|
|
7930
|
+
return value === true ? setAttribute(node, attrName, '') : removeAttribute(node, attrName);
|
|
7931
|
+
} // Handle global html attributes and AOM.
|
|
7787
7932
|
|
|
7788
7933
|
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7934
|
+
if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
|
|
7935
|
+
return setAttribute(node, attrName, value);
|
|
7936
|
+
} // Handle special elements live bindings. The checked property is already handled above
|
|
7937
|
+
// in the boolean case.
|
|
7793
7938
|
|
|
7794
7939
|
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
}
|
|
7940
|
+
if (node.name === 'input' && attrName === 'value') {
|
|
7941
|
+
return isNull(value) || isUndefined$1(value) ? removeAttribute(node, 'value') : setAttribute(node, 'value', value);
|
|
7798
7942
|
}
|
|
7943
|
+
}
|
|
7799
7944
|
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7945
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7946
|
+
// eslint-disable-next-line no-console
|
|
7947
|
+
console.error(`Unexpected attempt to set "${key}=${value}" property from the renderer`);
|
|
7948
|
+
}
|
|
7949
|
+
}
|
|
7805
7950
|
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7951
|
+
function setText(node, content) {
|
|
7952
|
+
if (node.type === HostNodeType.Text) {
|
|
7953
|
+
node.value = content;
|
|
7954
|
+
} else if (node.type === HostNodeType.Element) {
|
|
7955
|
+
node.children = [{
|
|
7956
|
+
type: HostNodeType.Text,
|
|
7957
|
+
parent: node,
|
|
7958
|
+
value: content
|
|
7959
|
+
}];
|
|
7960
|
+
}
|
|
7961
|
+
}
|
|
7817
7962
|
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7963
|
+
function getAttribute(element, name, namespace = null) {
|
|
7964
|
+
const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
|
|
7965
|
+
return attribute ? attribute.value : null;
|
|
7966
|
+
}
|
|
7822
7967
|
|
|
7823
|
-
|
|
7824
|
-
|
|
7968
|
+
function setAttribute(element, name, value, namespace = null) {
|
|
7969
|
+
const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
|
|
7825
7970
|
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7971
|
+
if (isUndefined$1(namespace)) {
|
|
7972
|
+
namespace = null;
|
|
7973
|
+
}
|
|
7974
|
+
|
|
7975
|
+
if (isUndefined$1(attribute)) {
|
|
7976
|
+
element.attributes.push({
|
|
7977
|
+
name,
|
|
7978
|
+
namespace,
|
|
7979
|
+
value: String(value)
|
|
7980
|
+
});
|
|
7981
|
+
} else {
|
|
7982
|
+
attribute.value = value;
|
|
7983
|
+
}
|
|
7984
|
+
}
|
|
7985
|
+
|
|
7986
|
+
function removeAttribute(element, name, namespace) {
|
|
7987
|
+
element.attributes = element.attributes.filter(attr => attr.name !== name && attr.namespace !== namespace);
|
|
7988
|
+
}
|
|
7989
|
+
|
|
7990
|
+
function getClassList(element) {
|
|
7991
|
+
function getClassAttribute() {
|
|
7992
|
+
let classAttribute = element.attributes.find(attr => attr.name === 'class' && isNull(attr.namespace));
|
|
7993
|
+
|
|
7994
|
+
if (isUndefined$1(classAttribute)) {
|
|
7995
|
+
classAttribute = {
|
|
7996
|
+
name: 'class',
|
|
7997
|
+
namespace: null,
|
|
7998
|
+
value: ''
|
|
7999
|
+
};
|
|
8000
|
+
element.attributes.push(classAttribute);
|
|
7834
8001
|
}
|
|
7835
|
-
},
|
|
7836
8002
|
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
},
|
|
8003
|
+
return classAttribute;
|
|
8004
|
+
}
|
|
7840
8005
|
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
namespace: null,
|
|
7849
|
-
value: ''
|
|
7850
|
-
};
|
|
7851
|
-
element.attributes.push(classAttribute);
|
|
7852
|
-
}
|
|
8006
|
+
return {
|
|
8007
|
+
add(...names) {
|
|
8008
|
+
const classAttribute = getClassAttribute();
|
|
8009
|
+
const tokenList = classNameToTokenList(classAttribute.value);
|
|
8010
|
+
names.forEach(name => tokenList.add(name));
|
|
8011
|
+
classAttribute.value = tokenListToClassName(tokenList);
|
|
8012
|
+
},
|
|
7853
8013
|
|
|
7854
|
-
|
|
8014
|
+
remove(...names) {
|
|
8015
|
+
const classAttribute = getClassAttribute();
|
|
8016
|
+
const tokenList = classNameToTokenList(classAttribute.value);
|
|
8017
|
+
names.forEach(name => tokenList.delete(name));
|
|
8018
|
+
classAttribute.value = tokenListToClassName(tokenList);
|
|
7855
8019
|
}
|
|
7856
8020
|
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
const classAttribute = getClassAttribute();
|
|
7860
|
-
const tokenList = classNameToTokenList(classAttribute.value);
|
|
7861
|
-
names.forEach(name => tokenList.add(name));
|
|
7862
|
-
classAttribute.value = tokenListToClassName(tokenList);
|
|
7863
|
-
},
|
|
8021
|
+
};
|
|
8022
|
+
}
|
|
7864
8023
|
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
names.forEach(name => tokenList.delete(name));
|
|
7869
|
-
classAttribute.value = tokenListToClassName(tokenList);
|
|
7870
|
-
}
|
|
8024
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
8025
|
+
const styleAttribute = element.attributes.find(attr => attr.name === 'style' && isNull(attr.namespace));
|
|
8026
|
+
const serializedProperty = `${name}: ${value}${important ? ' !important' : ''}`;
|
|
7871
8027
|
|
|
7872
|
-
|
|
7873
|
-
|
|
8028
|
+
if (isUndefined$1(styleAttribute)) {
|
|
8029
|
+
element.attributes.push({
|
|
8030
|
+
name: 'style',
|
|
8031
|
+
namespace: null,
|
|
8032
|
+
value: serializedProperty
|
|
8033
|
+
});
|
|
8034
|
+
} else {
|
|
8035
|
+
styleAttribute.value += `; ${serializedProperty}`;
|
|
8036
|
+
}
|
|
8037
|
+
}
|
|
7874
8038
|
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
8039
|
+
function isConnected(node) {
|
|
8040
|
+
return !isNull(node.parent);
|
|
8041
|
+
} // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
8042
|
+
// synthetic shadow.
|
|
7878
8043
|
|
|
7879
|
-
if (isUndefined$1(styleAttribute)) {
|
|
7880
|
-
element.attributes.push({
|
|
7881
|
-
name: 'style',
|
|
7882
|
-
namespace: null,
|
|
7883
|
-
value: serializedProperty
|
|
7884
|
-
});
|
|
7885
|
-
} else {
|
|
7886
|
-
styleAttribute.value += `; ${serializedProperty}`;
|
|
7887
|
-
}
|
|
7888
|
-
},
|
|
7889
8044
|
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
},
|
|
8045
|
+
const insertGlobalStylesheet = noop; // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
8046
|
+
// synthetic shadow.
|
|
7893
8047
|
|
|
7894
|
-
|
|
7895
|
-
// synthetic shadow.
|
|
7896
|
-
},
|
|
8048
|
+
const insertStylesheet = noop; // Noop on SSR.
|
|
7897
8049
|
|
|
7898
|
-
|
|
7899
|
-
// synthetic shadow.
|
|
7900
|
-
},
|
|
8050
|
+
const addEventListener = noop; // Noop on SSR.
|
|
7901
8051
|
|
|
7902
|
-
|
|
7903
|
-
|
|
8052
|
+
const removeEventListener = noop;
|
|
8053
|
+
const dispatchEvent = unsupportedMethod('dispatchEvent');
|
|
8054
|
+
const getBoundingClientRect = unsupportedMethod('getBoundingClientRect');
|
|
8055
|
+
const querySelector = unsupportedMethod('querySelector');
|
|
8056
|
+
const querySelectorAll = unsupportedMethod('querySelectorAll');
|
|
8057
|
+
const getElementsByTagName = unsupportedMethod('getElementsByTagName');
|
|
8058
|
+
const getElementsByClassName = unsupportedMethod('getElementsByClassName');
|
|
8059
|
+
const getChildren = unsupportedMethod('getChildren');
|
|
8060
|
+
const getChildNodes = unsupportedMethod('getChildNodes');
|
|
8061
|
+
const getFirstChild = unsupportedMethod('getFirstChild');
|
|
8062
|
+
const getFirstElementChild = unsupportedMethod('getFirstElementChild');
|
|
8063
|
+
const getLastChild = unsupportedMethod('getLastChild');
|
|
8064
|
+
const getLastElementChild = unsupportedMethod('getLastElementChild');
|
|
7904
8065
|
|
|
7905
|
-
|
|
7906
|
-
|
|
8066
|
+
function defineCustomElement(name, constructor, _options) {
|
|
8067
|
+
registerCustomElement(name, constructor);
|
|
8068
|
+
}
|
|
7907
8069
|
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
querySelectorAll: unsupportedMethod('querySelectorAll'),
|
|
7912
|
-
getElementsByTagName: unsupportedMethod('getElementsByTagName'),
|
|
7913
|
-
getElementsByClassName: unsupportedMethod('getElementsByClassName'),
|
|
7914
|
-
getChildren: unsupportedMethod('getChildren'),
|
|
7915
|
-
getChildNodes: unsupportedMethod('getChildNodes'),
|
|
7916
|
-
getFirstChild: unsupportedMethod('getFirstChild'),
|
|
7917
|
-
getFirstElementChild: unsupportedMethod('getFirstElementChild'),
|
|
7918
|
-
getLastChild: unsupportedMethod('getLastChild'),
|
|
7919
|
-
getLastElementChild: unsupportedMethod('getLastElementChild'),
|
|
7920
|
-
|
|
7921
|
-
defineCustomElement(name, constructor, _options) {
|
|
7922
|
-
registerCustomElement(name, constructor);
|
|
7923
|
-
},
|
|
8070
|
+
function getCustomElement(name) {
|
|
8071
|
+
return registry[name];
|
|
8072
|
+
}
|
|
7924
8073
|
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
},
|
|
8074
|
+
const HTMLElementExported = HTMLElementImpl;
|
|
8075
|
+
/* noop */
|
|
7928
8076
|
|
|
7929
|
-
|
|
7930
|
-
|
|
8077
|
+
const assertInstanceOfHTMLElement = noop;
|
|
8078
|
+
/*
|
|
8079
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
8080
|
+
* All rights reserved.
|
|
8081
|
+
* SPDX-License-Identifier: MIT
|
|
8082
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8083
|
+
*/
|
|
8084
|
+
|
|
8085
|
+
setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
|
|
8086
|
+
setAttachShadow(attachShadow);
|
|
8087
|
+
setCreateComment(createComment);
|
|
8088
|
+
setCreateElement(createElement);
|
|
8089
|
+
setCreateText(createText);
|
|
8090
|
+
setDefineCustomElement(defineCustomElement);
|
|
8091
|
+
setDispatchEvent(dispatchEvent);
|
|
8092
|
+
setGetAttribute(getAttribute);
|
|
8093
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
8094
|
+
setGetChildNodes(getChildNodes);
|
|
8095
|
+
setGetChildren(getChildren);
|
|
8096
|
+
setGetClassList(getClassList);
|
|
8097
|
+
setGetCustomElement(getCustomElement);
|
|
8098
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
8099
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
8100
|
+
setGetFirstChild(getFirstChild);
|
|
8101
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
8102
|
+
setGetLastChild(getLastChild);
|
|
8103
|
+
setGetLastElementChild(getLastElementChild);
|
|
8104
|
+
setGetProperty(getProperty);
|
|
8105
|
+
setHTMLElement(HTMLElementExported);
|
|
8106
|
+
setInsert(insert);
|
|
8107
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
8108
|
+
setInsertStylesheet(insertStylesheet);
|
|
8109
|
+
setIsConnected(isConnected);
|
|
8110
|
+
setIsHydrating(isHydrating);
|
|
8111
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
8112
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
8113
|
+
setNextSibling(nextSibling);
|
|
8114
|
+
setQuerySelector(querySelector);
|
|
8115
|
+
setQuerySelectorAll(querySelectorAll);
|
|
8116
|
+
setRemove(remove);
|
|
8117
|
+
setRemoveAttribute(removeAttribute);
|
|
8118
|
+
setRemoveEventListener(removeEventListener);
|
|
8119
|
+
setSetAttribute(setAttribute);
|
|
8120
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
8121
|
+
setSetProperty(setProperty);
|
|
8122
|
+
setSetText(setText);
|
|
8123
|
+
setSsr(ssr);
|
|
8124
|
+
setAddEventListener(addEventListener);
|
|
7931
8125
|
/*
|
|
7932
8126
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
7933
8127
|
* All rights reserved.
|
|
@@ -8038,12 +8232,11 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8038
8232
|
throw new TypeError(`"renderComponent" expects an object as the third parameter but instead received ${props}.`);
|
|
8039
8233
|
}
|
|
8040
8234
|
|
|
8041
|
-
const element =
|
|
8235
|
+
const element = createElement(tagName);
|
|
8042
8236
|
const def = getComponentInternalDef(Ctor);
|
|
8043
8237
|
createVM(element, def, {
|
|
8044
8238
|
mode: 'open',
|
|
8045
8239
|
owner: null,
|
|
8046
|
-
renderer,
|
|
8047
8240
|
tagName
|
|
8048
8241
|
});
|
|
8049
8242
|
|
|
@@ -8065,7 +8258,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8065
8258
|
|
|
8066
8259
|
freeze(LightningElement);
|
|
8067
8260
|
seal(LightningElement.prototype);
|
|
8068
|
-
/* version: 2.6.
|
|
8261
|
+
/* version: 2.6.3 */
|
|
8069
8262
|
|
|
8070
8263
|
exports.LightningElement = LightningElement;
|
|
8071
8264
|
exports.api = api$1;
|