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