lwc 2.5.10 → 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 +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/iife/es5/engine-dom.js +737 -433
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +704 -408
- package/dist/engine-dom/umd/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/umd/es5/engine-dom.js +737 -433
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +704 -408
- package/dist/engine-server/commonjs/es2017/engine-server.js +754 -549
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +754 -549
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +146 -137
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +146 -137
- 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
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
302
302
|
return attributeName;
|
|
303
303
|
}
|
|
304
|
-
/** version: 2.
|
|
304
|
+
/** version: 2.6.3 */
|
|
305
305
|
|
|
306
306
|
/*
|
|
307
307
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -415,8 +415,6 @@
|
|
|
415
415
|
ENABLE_NODE_LIST_PATCH: null,
|
|
416
416
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
417
417
|
ENABLE_NODE_PATCH: null,
|
|
418
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
419
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
420
418
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
421
419
|
};
|
|
422
420
|
|
|
@@ -473,7 +471,7 @@
|
|
|
473
471
|
|
|
474
472
|
function setFeatureFlagForTest(name, value) {
|
|
475
473
|
}
|
|
476
|
-
/** version: 2.
|
|
474
|
+
/** version: 2.6.3 */
|
|
477
475
|
|
|
478
476
|
/* proxy-compat-disable */
|
|
479
477
|
|
|
@@ -516,6 +514,243 @@
|
|
|
516
514
|
|
|
517
515
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
518
516
|
} // Borrowed from Vue template compiler.
|
|
517
|
+
// Primitives
|
|
518
|
+
//
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
let ssr$1;
|
|
522
|
+
|
|
523
|
+
function setSsr(ssrImpl) {
|
|
524
|
+
ssr$1 = ssrImpl;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
let isNativeShadowDefined$1;
|
|
528
|
+
|
|
529
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
530
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
let isSyntheticShadowDefined$1;
|
|
534
|
+
|
|
535
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
536
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
let HTMLElementExported$1;
|
|
540
|
+
|
|
541
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
542
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
let isHydrating$1;
|
|
546
|
+
|
|
547
|
+
function setIsHydrating$1(isHydratingImpl) {
|
|
548
|
+
isHydrating$1 = isHydratingImpl;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
let insert$1;
|
|
552
|
+
|
|
553
|
+
function setInsert(insertImpl) {
|
|
554
|
+
insert$1 = insertImpl;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
let remove$1;
|
|
558
|
+
|
|
559
|
+
function setRemove(removeImpl) {
|
|
560
|
+
remove$1 = removeImpl;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
let createElement$2;
|
|
564
|
+
|
|
565
|
+
function setCreateElement(createElementImpl) {
|
|
566
|
+
createElement$2 = createElementImpl;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
let createText$1;
|
|
570
|
+
|
|
571
|
+
function setCreateText(createTextImpl) {
|
|
572
|
+
createText$1 = createTextImpl;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
let createComment$1;
|
|
576
|
+
|
|
577
|
+
function setCreateComment(createCommentImpl) {
|
|
578
|
+
createComment$1 = createCommentImpl;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
let nextSibling$1;
|
|
582
|
+
|
|
583
|
+
function setNextSibling(nextSiblingImpl) {
|
|
584
|
+
nextSibling$1 = nextSiblingImpl;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
let attachShadow$1;
|
|
588
|
+
|
|
589
|
+
function setAttachShadow(attachShadowImpl) {
|
|
590
|
+
attachShadow$1 = attachShadowImpl;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
let getProperty$1;
|
|
594
|
+
|
|
595
|
+
function setGetProperty(getPropertyImpl) {
|
|
596
|
+
getProperty$1 = getPropertyImpl;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
let setProperty$1;
|
|
600
|
+
|
|
601
|
+
function setSetProperty(setPropertyImpl) {
|
|
602
|
+
setProperty$1 = setPropertyImpl;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
let setText$1;
|
|
606
|
+
|
|
607
|
+
function setSetText(setTextImpl) {
|
|
608
|
+
setText$1 = setTextImpl;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
let getAttribute$1;
|
|
612
|
+
|
|
613
|
+
function setGetAttribute(getAttributeImpl) {
|
|
614
|
+
getAttribute$1 = getAttributeImpl;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
let setAttribute$1;
|
|
618
|
+
|
|
619
|
+
function setSetAttribute(setAttributeImpl) {
|
|
620
|
+
setAttribute$1 = setAttributeImpl;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
let removeAttribute$1;
|
|
624
|
+
|
|
625
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
626
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
let addEventListener$1;
|
|
630
|
+
|
|
631
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
632
|
+
addEventListener$1 = addEventListenerImpl;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
let removeEventListener$1;
|
|
636
|
+
|
|
637
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
638
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
let dispatchEvent$1;
|
|
642
|
+
|
|
643
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
644
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
let getClassList$1;
|
|
648
|
+
|
|
649
|
+
function setGetClassList(getClassListImpl) {
|
|
650
|
+
getClassList$1 = getClassListImpl;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
let setCSSStyleProperty$1;
|
|
654
|
+
|
|
655
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
656
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
let getBoundingClientRect$1;
|
|
660
|
+
|
|
661
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
662
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
let querySelector$1;
|
|
666
|
+
|
|
667
|
+
function setQuerySelector(querySelectorImpl) {
|
|
668
|
+
querySelector$1 = querySelectorImpl;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
let querySelectorAll$1;
|
|
672
|
+
|
|
673
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
674
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
let getElementsByTagName$1;
|
|
678
|
+
|
|
679
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
680
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
let getElementsByClassName$1;
|
|
684
|
+
|
|
685
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
686
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
let getChildren$1;
|
|
690
|
+
|
|
691
|
+
function setGetChildren(getChildrenImpl) {
|
|
692
|
+
getChildren$1 = getChildrenImpl;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
let getChildNodes$1;
|
|
696
|
+
|
|
697
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
698
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
let getFirstChild$1;
|
|
702
|
+
|
|
703
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
704
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
let getFirstElementChild$1;
|
|
708
|
+
|
|
709
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
710
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
let getLastChild$1;
|
|
714
|
+
|
|
715
|
+
function setGetLastChild(getLastChildImpl) {
|
|
716
|
+
getLastChild$1 = getLastChildImpl;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
let getLastElementChild$1;
|
|
720
|
+
|
|
721
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
722
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
let isConnected$1;
|
|
726
|
+
|
|
727
|
+
function setIsConnected(isConnectedImpl) {
|
|
728
|
+
isConnected$1 = isConnectedImpl;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
let insertGlobalStylesheet$1;
|
|
732
|
+
|
|
733
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
734
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let insertStylesheet$1;
|
|
738
|
+
|
|
739
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
740
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
let defineCustomElement$1;
|
|
744
|
+
|
|
745
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
746
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
let getCustomElement$1;
|
|
750
|
+
|
|
751
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
752
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
753
|
+
}
|
|
519
754
|
/*
|
|
520
755
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
521
756
|
* All rights reserved.
|
|
@@ -758,9 +993,6 @@
|
|
|
758
993
|
elm,
|
|
759
994
|
data: {
|
|
760
995
|
on
|
|
761
|
-
},
|
|
762
|
-
owner: {
|
|
763
|
-
renderer
|
|
764
996
|
}
|
|
765
997
|
} = vnode;
|
|
766
998
|
|
|
@@ -773,7 +1005,7 @@
|
|
|
773
1005
|
let name;
|
|
774
1006
|
|
|
775
1007
|
for (name in on) {
|
|
776
|
-
|
|
1008
|
+
addEventListener$1(elm, name, listener);
|
|
777
1009
|
}
|
|
778
1010
|
}
|
|
779
1011
|
|
|
@@ -915,9 +1147,6 @@
|
|
|
915
1147
|
const {
|
|
916
1148
|
data: {
|
|
917
1149
|
attrs
|
|
918
|
-
},
|
|
919
|
-
owner: {
|
|
920
|
-
renderer
|
|
921
1150
|
}
|
|
922
1151
|
} = vnode;
|
|
923
1152
|
|
|
@@ -936,10 +1165,6 @@
|
|
|
936
1165
|
}
|
|
937
1166
|
|
|
938
1167
|
const elm = vnode.elm;
|
|
939
|
-
const {
|
|
940
|
-
setAttribute,
|
|
941
|
-
removeAttribute
|
|
942
|
-
} = renderer;
|
|
943
1168
|
let key;
|
|
944
1169
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
945
1170
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -954,14 +1179,14 @@
|
|
|
954
1179
|
|
|
955
1180
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
956
1181
|
// Assume xml namespace
|
|
957
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
1182
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
958
1183
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
959
1184
|
// Assume xlink namespace
|
|
960
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
961
|
-
} else if (isNull(cur)) {
|
|
962
|
-
removeAttribute(elm, key);
|
|
1185
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
1186
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
1187
|
+
removeAttribute$1(elm, key);
|
|
963
1188
|
} else {
|
|
964
|
-
setAttribute(elm, key, cur);
|
|
1189
|
+
setAttribute$1(elm, key, cur);
|
|
965
1190
|
}
|
|
966
1191
|
|
|
967
1192
|
lockAttribute();
|
|
@@ -1005,17 +1230,14 @@
|
|
|
1005
1230
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
1006
1231
|
const {
|
|
1007
1232
|
elm,
|
|
1008
|
-
sel
|
|
1009
|
-
owner: {
|
|
1010
|
-
renderer
|
|
1011
|
-
}
|
|
1233
|
+
sel
|
|
1012
1234
|
} = vnode;
|
|
1013
1235
|
|
|
1014
1236
|
for (const key in props) {
|
|
1015
1237
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1016
1238
|
|
|
1017
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
1018
|
-
|
|
1239
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
1240
|
+
setProperty$1(elm, key, cur);
|
|
1019
1241
|
}
|
|
1020
1242
|
}
|
|
1021
1243
|
}
|
|
@@ -1079,9 +1301,6 @@
|
|
|
1079
1301
|
elm,
|
|
1080
1302
|
data: {
|
|
1081
1303
|
className: newClass
|
|
1082
|
-
},
|
|
1083
|
-
owner: {
|
|
1084
|
-
renderer
|
|
1085
1304
|
}
|
|
1086
1305
|
} = vnode;
|
|
1087
1306
|
const {
|
|
@@ -1094,7 +1313,7 @@
|
|
|
1094
1313
|
return;
|
|
1095
1314
|
}
|
|
1096
1315
|
|
|
1097
|
-
const classList =
|
|
1316
|
+
const classList = getClassList$1(elm);
|
|
1098
1317
|
const newClassMap = getMapFromClassName(newClass);
|
|
1099
1318
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
1100
1319
|
let name;
|
|
@@ -1132,24 +1351,17 @@
|
|
|
1132
1351
|
elm,
|
|
1133
1352
|
data: {
|
|
1134
1353
|
style: newStyle
|
|
1135
|
-
},
|
|
1136
|
-
owner: {
|
|
1137
|
-
renderer
|
|
1138
1354
|
}
|
|
1139
1355
|
} = vnode;
|
|
1140
|
-
const {
|
|
1141
|
-
setAttribute,
|
|
1142
|
-
removeAttribute
|
|
1143
|
-
} = renderer;
|
|
1144
1356
|
|
|
1145
1357
|
if (oldVnode.data.style === newStyle) {
|
|
1146
1358
|
return;
|
|
1147
1359
|
}
|
|
1148
1360
|
|
|
1149
1361
|
if (!isString(newStyle) || newStyle === '') {
|
|
1150
|
-
removeAttribute(elm, 'style');
|
|
1362
|
+
removeAttribute$1(elm, 'style');
|
|
1151
1363
|
} else {
|
|
1152
|
-
setAttribute(elm, 'style', newStyle);
|
|
1364
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
1153
1365
|
}
|
|
1154
1366
|
}
|
|
1155
1367
|
|
|
@@ -1174,9 +1386,6 @@
|
|
|
1174
1386
|
elm,
|
|
1175
1387
|
data: {
|
|
1176
1388
|
classMap
|
|
1177
|
-
},
|
|
1178
|
-
owner: {
|
|
1179
|
-
renderer
|
|
1180
1389
|
}
|
|
1181
1390
|
} = vnode;
|
|
1182
1391
|
|
|
@@ -1184,7 +1393,7 @@
|
|
|
1184
1393
|
return;
|
|
1185
1394
|
}
|
|
1186
1395
|
|
|
1187
|
-
const classList =
|
|
1396
|
+
const classList = getClassList$1(elm);
|
|
1188
1397
|
|
|
1189
1398
|
for (const name in classMap) {
|
|
1190
1399
|
classList.add(name);
|
|
@@ -1208,9 +1417,6 @@
|
|
|
1208
1417
|
elm,
|
|
1209
1418
|
data: {
|
|
1210
1419
|
styleDecls
|
|
1211
|
-
},
|
|
1212
|
-
owner: {
|
|
1213
|
-
renderer
|
|
1214
1420
|
}
|
|
1215
1421
|
} = vnode;
|
|
1216
1422
|
|
|
@@ -1220,7 +1426,7 @@
|
|
|
1220
1426
|
|
|
1221
1427
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
1222
1428
|
const [prop, value, important] = styleDecls[i];
|
|
1223
|
-
|
|
1429
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
1224
1430
|
}
|
|
1225
1431
|
}
|
|
1226
1432
|
|
|
@@ -1234,15 +1440,6 @@
|
|
|
1234
1440
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1235
1441
|
*/
|
|
1236
1442
|
|
|
1237
|
-
/**
|
|
1238
|
-
@license
|
|
1239
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1240
|
-
This code may only be used under the MIT License found at
|
|
1241
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1242
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1243
|
-
https://github.com/snabbdom/snabbdom/
|
|
1244
|
-
*/
|
|
1245
|
-
|
|
1246
1443
|
function isUndef(s) {
|
|
1247
1444
|
return s === undefined;
|
|
1248
1445
|
}
|
|
@@ -1330,7 +1527,7 @@
|
|
|
1330
1527
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1331
1528
|
// Vnode moved right
|
|
1332
1529
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1333
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1530
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1334
1531
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1335
1532
|
newEndVnode = newCh[--newEndIdx];
|
|
1336
1533
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1443,7 +1640,7 @@
|
|
|
1443
1640
|
}
|
|
1444
1641
|
}
|
|
1445
1642
|
/*
|
|
1446
|
-
* Copyright (c)
|
|
1643
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1447
1644
|
* All rights reserved.
|
|
1448
1645
|
* SPDX-License-Identifier: MIT
|
|
1449
1646
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -1496,6 +1693,7 @@
|
|
|
1496
1693
|
isArray
|
|
1497
1694
|
} = Array;
|
|
1498
1695
|
const {
|
|
1696
|
+
prototype: ObjectDotPrototype,
|
|
1499
1697
|
getPrototypeOf,
|
|
1500
1698
|
create: ObjectCreate,
|
|
1501
1699
|
defineProperty: ObjectDefineProperty,
|
|
@@ -1986,8 +2184,6 @@
|
|
|
1986
2184
|
|
|
1987
2185
|
}
|
|
1988
2186
|
|
|
1989
|
-
const ObjectDotPrototype = Object.prototype;
|
|
1990
|
-
|
|
1991
2187
|
function defaultValueIsObservable(value) {
|
|
1992
2188
|
// intentionally checking for null
|
|
1993
2189
|
if (value === null) {
|
|
@@ -2015,99 +2211,85 @@
|
|
|
2015
2211
|
/* do nothing */
|
|
2016
2212
|
};
|
|
2017
2213
|
|
|
2018
|
-
const defaultValueDistortion = value => value;
|
|
2019
|
-
|
|
2020
2214
|
function createShadowTarget(value) {
|
|
2021
2215
|
return isArray(value) ? [] : {};
|
|
2022
2216
|
}
|
|
2023
2217
|
|
|
2024
|
-
class
|
|
2025
|
-
constructor(options) {
|
|
2026
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2027
|
-
this.valueMutated = defaultValueMutated;
|
|
2028
|
-
this.valueObserved = defaultValueObserved;
|
|
2029
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2218
|
+
class ObservableMembrane {
|
|
2219
|
+
constructor(options = {}) {
|
|
2030
2220
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2031
2221
|
this.reactiveObjectGraph = new WeakMap();
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2043
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2044
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2045
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2046
|
-
}
|
|
2222
|
+
const {
|
|
2223
|
+
valueMutated,
|
|
2224
|
+
valueObserved,
|
|
2225
|
+
valueIsObservable,
|
|
2226
|
+
tagPropertyKey
|
|
2227
|
+
} = options;
|
|
2228
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2229
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2230
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2231
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2047
2232
|
}
|
|
2048
2233
|
|
|
2049
2234
|
getProxy(value) {
|
|
2050
2235
|
const unwrappedValue = unwrap$1(value);
|
|
2051
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2052
2236
|
|
|
2053
|
-
if (this.valueIsObservable(
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
// we return the readonly.
|
|
2237
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2238
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2239
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2057
2240
|
return value;
|
|
2058
2241
|
}
|
|
2059
2242
|
|
|
2060
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2243
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2061
2244
|
}
|
|
2062
2245
|
|
|
2063
|
-
return
|
|
2246
|
+
return unwrappedValue;
|
|
2064
2247
|
}
|
|
2065
2248
|
|
|
2066
2249
|
getReadOnlyProxy(value) {
|
|
2067
2250
|
value = unwrap$1(value);
|
|
2068
|
-
const distorted = this.valueDistortion(value);
|
|
2069
2251
|
|
|
2070
|
-
if (this.valueIsObservable(
|
|
2071
|
-
return this.getReadOnlyHandler(value
|
|
2252
|
+
if (this.valueIsObservable(value)) {
|
|
2253
|
+
return this.getReadOnlyHandler(value);
|
|
2072
2254
|
}
|
|
2073
2255
|
|
|
2074
|
-
return
|
|
2256
|
+
return value;
|
|
2075
2257
|
}
|
|
2076
2258
|
|
|
2077
2259
|
unwrapProxy(p) {
|
|
2078
2260
|
return unwrap$1(p);
|
|
2079
2261
|
}
|
|
2080
2262
|
|
|
2081
|
-
getReactiveHandler(value
|
|
2082
|
-
let proxy = this.reactiveObjectGraph.get(
|
|
2263
|
+
getReactiveHandler(value) {
|
|
2264
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2083
2265
|
|
|
2084
2266
|
if (isUndefined(proxy)) {
|
|
2085
2267
|
// caching the proxy after the first time it is accessed
|
|
2086
|
-
const handler = new ReactiveProxyHandler(this,
|
|
2087
|
-
proxy = new Proxy(createShadowTarget(
|
|
2268
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2269
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2088
2270
|
registerProxy(proxy, value);
|
|
2089
|
-
this.reactiveObjectGraph.set(
|
|
2271
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2090
2272
|
}
|
|
2091
2273
|
|
|
2092
2274
|
return proxy;
|
|
2093
2275
|
}
|
|
2094
2276
|
|
|
2095
|
-
getReadOnlyHandler(value
|
|
2096
|
-
let proxy = this.readOnlyObjectGraph.get(
|
|
2277
|
+
getReadOnlyHandler(value) {
|
|
2278
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2097
2279
|
|
|
2098
2280
|
if (isUndefined(proxy)) {
|
|
2099
2281
|
// caching the proxy after the first time it is accessed
|
|
2100
|
-
const handler = new ReadOnlyHandler(this,
|
|
2101
|
-
proxy = new Proxy(createShadowTarget(
|
|
2282
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2283
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2102
2284
|
registerProxy(proxy, value);
|
|
2103
|
-
this.readOnlyObjectGraph.set(
|
|
2285
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2104
2286
|
}
|
|
2105
2287
|
|
|
2106
2288
|
return proxy;
|
|
2107
2289
|
}
|
|
2108
2290
|
|
|
2109
2291
|
}
|
|
2110
|
-
/** version:
|
|
2292
|
+
/** version: 2.0.0 */
|
|
2111
2293
|
|
|
2112
2294
|
/*
|
|
2113
2295
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2118,15 +2300,9 @@
|
|
|
2118
2300
|
|
|
2119
2301
|
|
|
2120
2302
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2121
|
-
|
|
2122
|
-
function valueDistortion(value) {
|
|
2123
|
-
return value;
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2303
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2127
2304
|
valueObserved,
|
|
2128
2305
|
valueMutated,
|
|
2129
|
-
valueDistortion,
|
|
2130
2306
|
tagPropertyKey: lockerLivePropertyKey
|
|
2131
2307
|
});
|
|
2132
2308
|
/**
|
|
@@ -2135,16 +2311,9 @@
|
|
|
2135
2311
|
* change or being removed.
|
|
2136
2312
|
*/
|
|
2137
2313
|
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
if (unwrapped !== value) {
|
|
2142
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2143
|
-
return valueDistortion(unwrapped);
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
return value;
|
|
2147
|
-
};
|
|
2314
|
+
function unwrap(value) {
|
|
2315
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2316
|
+
}
|
|
2148
2317
|
/*
|
|
2149
2318
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2150
2319
|
* All rights reserved.
|
|
@@ -2215,8 +2384,7 @@
|
|
|
2215
2384
|
|
|
2216
2385
|
|
|
2217
2386
|
const LightningElement = function () {
|
|
2218
|
-
|
|
2219
|
-
|
|
2387
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2220
2388
|
if (isNull(vmBeingConstructed)) {
|
|
2221
2389
|
throw new ReferenceError('Illegal constructor');
|
|
2222
2390
|
}
|
|
@@ -2224,8 +2392,7 @@
|
|
|
2224
2392
|
const vm = vmBeingConstructed;
|
|
2225
2393
|
const {
|
|
2226
2394
|
def,
|
|
2227
|
-
elm
|
|
2228
|
-
renderer
|
|
2395
|
+
elm
|
|
2229
2396
|
} = vm;
|
|
2230
2397
|
const {
|
|
2231
2398
|
bridge
|
|
@@ -2258,23 +2425,22 @@
|
|
|
2258
2425
|
if (vm.renderMode === 1
|
|
2259
2426
|
/* Shadow */
|
|
2260
2427
|
) {
|
|
2261
|
-
|
|
2428
|
+
doAttachShadow(vm);
|
|
2262
2429
|
} // Adding extra guard rails in DEV mode.
|
|
2263
2430
|
|
|
2264
2431
|
return this;
|
|
2265
2432
|
};
|
|
2266
2433
|
|
|
2267
|
-
function
|
|
2434
|
+
function doAttachShadow(vm) {
|
|
2268
2435
|
const {
|
|
2269
2436
|
elm,
|
|
2270
2437
|
mode,
|
|
2271
|
-
renderer,
|
|
2272
2438
|
shadowMode,
|
|
2273
2439
|
def: {
|
|
2274
2440
|
ctor
|
|
2275
2441
|
}
|
|
2276
2442
|
} = vm;
|
|
2277
|
-
const cmpRoot =
|
|
2443
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2278
2444
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2279
2445
|
/* Synthetic */
|
|
2280
2446
|
,
|
|
@@ -2291,163 +2457,121 @@
|
|
|
2291
2457
|
|
|
2292
2458
|
dispatchEvent(event) {
|
|
2293
2459
|
const {
|
|
2294
|
-
elm
|
|
2295
|
-
renderer: {
|
|
2296
|
-
dispatchEvent
|
|
2297
|
-
}
|
|
2460
|
+
elm
|
|
2298
2461
|
} = getAssociatedVM(this);
|
|
2299
|
-
return dispatchEvent(elm, event);
|
|
2462
|
+
return dispatchEvent$1(elm, event);
|
|
2300
2463
|
},
|
|
2301
2464
|
|
|
2302
2465
|
addEventListener(type, listener, options) {
|
|
2303
2466
|
const vm = getAssociatedVM(this);
|
|
2304
2467
|
const {
|
|
2305
|
-
elm
|
|
2306
|
-
renderer: {
|
|
2307
|
-
addEventListener
|
|
2308
|
-
}
|
|
2468
|
+
elm
|
|
2309
2469
|
} = vm;
|
|
2310
2470
|
|
|
2311
2471
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2312
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
2472
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2313
2473
|
},
|
|
2314
2474
|
|
|
2315
2475
|
removeEventListener(type, listener, options) {
|
|
2316
2476
|
const vm = getAssociatedVM(this);
|
|
2317
2477
|
const {
|
|
2318
|
-
elm
|
|
2319
|
-
renderer: {
|
|
2320
|
-
removeEventListener
|
|
2321
|
-
}
|
|
2478
|
+
elm
|
|
2322
2479
|
} = vm;
|
|
2323
2480
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2324
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
2481
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2325
2482
|
},
|
|
2326
2483
|
|
|
2327
2484
|
hasAttribute(name) {
|
|
2328
2485
|
const {
|
|
2329
|
-
elm
|
|
2330
|
-
renderer: {
|
|
2331
|
-
getAttribute
|
|
2332
|
-
}
|
|
2486
|
+
elm
|
|
2333
2487
|
} = getAssociatedVM(this);
|
|
2334
|
-
return !isNull(getAttribute(elm, name));
|
|
2488
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2335
2489
|
},
|
|
2336
2490
|
|
|
2337
2491
|
hasAttributeNS(namespace, name) {
|
|
2338
2492
|
const {
|
|
2339
|
-
elm
|
|
2340
|
-
renderer: {
|
|
2341
|
-
getAttribute
|
|
2342
|
-
}
|
|
2493
|
+
elm
|
|
2343
2494
|
} = getAssociatedVM(this);
|
|
2344
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
2495
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2345
2496
|
},
|
|
2346
2497
|
|
|
2347
2498
|
removeAttribute(name) {
|
|
2348
2499
|
const {
|
|
2349
|
-
elm
|
|
2350
|
-
renderer: {
|
|
2351
|
-
removeAttribute
|
|
2352
|
-
}
|
|
2500
|
+
elm
|
|
2353
2501
|
} = getAssociatedVM(this);
|
|
2354
2502
|
unlockAttribute(elm, name);
|
|
2355
|
-
removeAttribute(elm, name);
|
|
2503
|
+
removeAttribute$1(elm, name);
|
|
2356
2504
|
lockAttribute();
|
|
2357
2505
|
},
|
|
2358
2506
|
|
|
2359
2507
|
removeAttributeNS(namespace, name) {
|
|
2360
2508
|
const {
|
|
2361
|
-
elm
|
|
2362
|
-
renderer: {
|
|
2363
|
-
removeAttribute
|
|
2364
|
-
}
|
|
2509
|
+
elm
|
|
2365
2510
|
} = getAssociatedVM(this);
|
|
2366
2511
|
unlockAttribute(elm, name);
|
|
2367
|
-
removeAttribute(elm, name, namespace);
|
|
2512
|
+
removeAttribute$1(elm, name, namespace);
|
|
2368
2513
|
lockAttribute();
|
|
2369
2514
|
},
|
|
2370
2515
|
|
|
2371
2516
|
getAttribute(name) {
|
|
2372
2517
|
const {
|
|
2373
|
-
elm
|
|
2374
|
-
renderer: {
|
|
2375
|
-
getAttribute
|
|
2376
|
-
}
|
|
2518
|
+
elm
|
|
2377
2519
|
} = getAssociatedVM(this);
|
|
2378
|
-
return getAttribute(elm, name);
|
|
2520
|
+
return getAttribute$1(elm, name);
|
|
2379
2521
|
},
|
|
2380
2522
|
|
|
2381
2523
|
getAttributeNS(namespace, name) {
|
|
2382
2524
|
const {
|
|
2383
|
-
elm
|
|
2384
|
-
renderer: {
|
|
2385
|
-
getAttribute
|
|
2386
|
-
}
|
|
2525
|
+
elm
|
|
2387
2526
|
} = getAssociatedVM(this);
|
|
2388
|
-
return getAttribute(elm, name, namespace);
|
|
2527
|
+
return getAttribute$1(elm, name, namespace);
|
|
2389
2528
|
},
|
|
2390
2529
|
|
|
2391
2530
|
setAttribute(name, value) {
|
|
2392
2531
|
const vm = getAssociatedVM(this);
|
|
2393
2532
|
const {
|
|
2394
|
-
elm
|
|
2395
|
-
renderer: {
|
|
2396
|
-
setAttribute
|
|
2397
|
-
}
|
|
2533
|
+
elm
|
|
2398
2534
|
} = vm;
|
|
2399
2535
|
|
|
2400
2536
|
unlockAttribute(elm, name);
|
|
2401
|
-
setAttribute(elm, name, value);
|
|
2537
|
+
setAttribute$1(elm, name, value);
|
|
2402
2538
|
lockAttribute();
|
|
2403
2539
|
},
|
|
2404
2540
|
|
|
2405
2541
|
setAttributeNS(namespace, name, value) {
|
|
2406
2542
|
const vm = getAssociatedVM(this);
|
|
2407
2543
|
const {
|
|
2408
|
-
elm
|
|
2409
|
-
renderer: {
|
|
2410
|
-
setAttribute
|
|
2411
|
-
}
|
|
2544
|
+
elm
|
|
2412
2545
|
} = vm;
|
|
2413
2546
|
|
|
2414
2547
|
unlockAttribute(elm, name);
|
|
2415
|
-
setAttribute(elm, name, value, namespace);
|
|
2548
|
+
setAttribute$1(elm, name, value, namespace);
|
|
2416
2549
|
lockAttribute();
|
|
2417
2550
|
},
|
|
2418
2551
|
|
|
2419
2552
|
getBoundingClientRect() {
|
|
2420
2553
|
const vm = getAssociatedVM(this);
|
|
2421
2554
|
const {
|
|
2422
|
-
elm
|
|
2423
|
-
renderer: {
|
|
2424
|
-
getBoundingClientRect
|
|
2425
|
-
}
|
|
2555
|
+
elm
|
|
2426
2556
|
} = vm;
|
|
2427
2557
|
|
|
2428
|
-
return getBoundingClientRect(elm);
|
|
2558
|
+
return getBoundingClientRect$1(elm);
|
|
2429
2559
|
},
|
|
2430
2560
|
|
|
2431
2561
|
get isConnected() {
|
|
2432
2562
|
const {
|
|
2433
|
-
elm
|
|
2434
|
-
renderer: {
|
|
2435
|
-
isConnected
|
|
2436
|
-
}
|
|
2563
|
+
elm
|
|
2437
2564
|
} = getAssociatedVM(this);
|
|
2438
|
-
return isConnected(elm);
|
|
2565
|
+
return isConnected$1(elm);
|
|
2439
2566
|
},
|
|
2440
2567
|
|
|
2441
2568
|
get classList() {
|
|
2442
2569
|
const vm = getAssociatedVM(this);
|
|
2443
2570
|
const {
|
|
2444
|
-
elm
|
|
2445
|
-
renderer: {
|
|
2446
|
-
getClassList
|
|
2447
|
-
}
|
|
2571
|
+
elm
|
|
2448
2572
|
} = vm;
|
|
2449
2573
|
|
|
2450
|
-
return getClassList(elm);
|
|
2574
|
+
return getClassList$1(elm);
|
|
2451
2575
|
},
|
|
2452
2576
|
|
|
2453
2577
|
get template() {
|
|
@@ -2473,19 +2597,44 @@
|
|
|
2473
2597
|
}
|
|
2474
2598
|
|
|
2475
2599
|
};
|
|
2476
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
2477
|
-
|
|
2600
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
2601
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
2602
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
2603
|
+
|
|
2604
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
2605
|
+
|
|
2606
|
+
function getChildGetter(methodName) {
|
|
2607
|
+
switch (methodName) {
|
|
2608
|
+
case 'children':
|
|
2609
|
+
return getChildren$1;
|
|
2610
|
+
|
|
2611
|
+
case 'childNodes':
|
|
2612
|
+
return getChildNodes$1;
|
|
2613
|
+
|
|
2614
|
+
case 'firstChild':
|
|
2615
|
+
return getFirstChild$1;
|
|
2616
|
+
|
|
2617
|
+
case 'firstElementChild':
|
|
2618
|
+
return getFirstElementChild$1;
|
|
2478
2619
|
|
|
2479
|
-
|
|
2480
|
-
|
|
2620
|
+
case 'lastChild':
|
|
2621
|
+
return getLastChild$1;
|
|
2622
|
+
|
|
2623
|
+
case 'lastElementChild':
|
|
2624
|
+
return getLastElementChild$1;
|
|
2625
|
+
}
|
|
2626
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
for (const childGetter of childGetters) {
|
|
2630
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
2481
2631
|
get() {
|
|
2482
2632
|
const vm = getAssociatedVM(this);
|
|
2483
2633
|
const {
|
|
2484
|
-
elm
|
|
2485
|
-
renderer
|
|
2634
|
+
elm
|
|
2486
2635
|
} = vm;
|
|
2487
2636
|
|
|
2488
|
-
return
|
|
2637
|
+
return getChildGetter(childGetter)(elm);
|
|
2489
2638
|
},
|
|
2490
2639
|
|
|
2491
2640
|
configurable: true,
|
|
@@ -2493,18 +2642,34 @@
|
|
|
2493
2642
|
};
|
|
2494
2643
|
}
|
|
2495
2644
|
|
|
2496
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2645
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2646
|
+
|
|
2647
|
+
function getQueryMethod(methodName) {
|
|
2648
|
+
switch (methodName) {
|
|
2649
|
+
case 'getElementsByClassName':
|
|
2650
|
+
return getElementsByClassName$1;
|
|
2651
|
+
|
|
2652
|
+
case 'getElementsByTagName':
|
|
2653
|
+
return getElementsByTagName$1;
|
|
2654
|
+
|
|
2655
|
+
case 'querySelector':
|
|
2656
|
+
return querySelector$1;
|
|
2657
|
+
|
|
2658
|
+
case 'querySelectorAll':
|
|
2659
|
+
return querySelectorAll$1;
|
|
2660
|
+
}
|
|
2661
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
2662
|
+
|
|
2497
2663
|
|
|
2498
2664
|
for (const queryMethod of queryMethods) {
|
|
2499
2665
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
2500
2666
|
value(arg) {
|
|
2501
2667
|
const vm = getAssociatedVM(this);
|
|
2502
2668
|
const {
|
|
2503
|
-
elm
|
|
2504
|
-
renderer
|
|
2669
|
+
elm
|
|
2505
2670
|
} = vm;
|
|
2506
2671
|
|
|
2507
|
-
return
|
|
2672
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
2508
2673
|
},
|
|
2509
2674
|
|
|
2510
2675
|
configurable: true,
|
|
@@ -3438,39 +3603,30 @@
|
|
|
3438
3603
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
3439
3604
|
|
|
3440
3605
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
3441
|
-
|
|
3606
|
+
getClassList$1(elm).add(token);
|
|
3442
3607
|
}
|
|
3443
3608
|
}
|
|
3444
3609
|
|
|
3445
3610
|
function updateNodeHook(oldVnode, vnode) {
|
|
3446
3611
|
const {
|
|
3447
3612
|
elm,
|
|
3448
|
-
text
|
|
3449
|
-
owner: {
|
|
3450
|
-
renderer
|
|
3451
|
-
}
|
|
3613
|
+
text
|
|
3452
3614
|
} = vnode;
|
|
3453
3615
|
|
|
3454
3616
|
if (oldVnode.text !== text) {
|
|
3455
3617
|
|
|
3456
|
-
|
|
3618
|
+
setText$1(elm, text);
|
|
3457
3619
|
}
|
|
3458
3620
|
}
|
|
3459
3621
|
|
|
3460
3622
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
3461
|
-
const {
|
|
3462
|
-
renderer
|
|
3463
|
-
} = vnode.owner;
|
|
3464
3623
|
|
|
3465
|
-
|
|
3624
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
3466
3625
|
}
|
|
3467
3626
|
|
|
3468
3627
|
function removeNodeHook(vnode, parentNode) {
|
|
3469
|
-
const {
|
|
3470
|
-
renderer
|
|
3471
|
-
} = vnode.owner;
|
|
3472
3628
|
|
|
3473
|
-
|
|
3629
|
+
remove$1(vnode.elm, parentNode);
|
|
3474
3630
|
}
|
|
3475
3631
|
|
|
3476
3632
|
function createElmHook(vnode) {
|
|
@@ -3540,13 +3696,15 @@
|
|
|
3540
3696
|
|
|
3541
3697
|
function updateChildrenHook(oldVnode, vnode) {
|
|
3542
3698
|
const {
|
|
3543
|
-
|
|
3544
|
-
|
|
3699
|
+
elm,
|
|
3700
|
+
children
|
|
3545
3701
|
} = vnode;
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
}
|
|
3702
|
+
|
|
3703
|
+
if (hasDynamicChildren(children)) {
|
|
3704
|
+
updateDynamicChildren(elm, oldVnode.children, children);
|
|
3705
|
+
} else {
|
|
3706
|
+
updateStaticChildren(elm, oldVnode.children, children);
|
|
3707
|
+
}
|
|
3550
3708
|
}
|
|
3551
3709
|
|
|
3552
3710
|
function allocateChildrenHook(vnode, vm) {
|
|
@@ -3612,8 +3770,7 @@
|
|
|
3612
3770
|
createVM(elm, def, {
|
|
3613
3771
|
mode,
|
|
3614
3772
|
owner,
|
|
3615
|
-
tagName: sel
|
|
3616
|
-
renderer: owner.renderer
|
|
3773
|
+
tagName: sel
|
|
3617
3774
|
});
|
|
3618
3775
|
}
|
|
3619
3776
|
|
|
@@ -3709,12 +3866,12 @@
|
|
|
3709
3866
|
*/
|
|
3710
3867
|
|
|
3711
3868
|
|
|
3712
|
-
function getUpgradableConstructor(tagName
|
|
3869
|
+
function getUpgradableConstructor(tagName) {
|
|
3713
3870
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
3714
3871
|
// produce only tags with lowercase letters
|
|
3715
3872
|
// But, for backwards compatibility, we will lower case the tagName
|
|
3716
3873
|
tagName = tagName.toLowerCase();
|
|
3717
|
-
let CE =
|
|
3874
|
+
let CE = getCustomElement$1(tagName);
|
|
3718
3875
|
|
|
3719
3876
|
if (!isUndefined$1(CE)) {
|
|
3720
3877
|
return CE;
|
|
@@ -3725,7 +3882,7 @@
|
|
|
3725
3882
|
*/
|
|
3726
3883
|
|
|
3727
3884
|
|
|
3728
|
-
CE = class LWCUpgradableElement extends
|
|
3885
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
3729
3886
|
constructor(upgradeCallback) {
|
|
3730
3887
|
super();
|
|
3731
3888
|
|
|
@@ -3735,7 +3892,7 @@
|
|
|
3735
3892
|
}
|
|
3736
3893
|
|
|
3737
3894
|
};
|
|
3738
|
-
|
|
3895
|
+
defineCustomElement$1(tagName, CE);
|
|
3739
3896
|
return CE;
|
|
3740
3897
|
}
|
|
3741
3898
|
/*
|
|
@@ -3753,10 +3910,7 @@
|
|
|
3753
3910
|
const {
|
|
3754
3911
|
owner
|
|
3755
3912
|
} = vnode;
|
|
3756
|
-
const
|
|
3757
|
-
renderer
|
|
3758
|
-
} = owner;
|
|
3759
|
-
const elm = renderer.createText(vnode.text);
|
|
3913
|
+
const elm = createText$1(vnode.text);
|
|
3760
3914
|
linkNodeToShadow(elm, owner);
|
|
3761
3915
|
vnode.elm = elm;
|
|
3762
3916
|
},
|
|
@@ -3778,10 +3932,7 @@
|
|
|
3778
3932
|
owner,
|
|
3779
3933
|
text
|
|
3780
3934
|
} = vnode;
|
|
3781
|
-
const
|
|
3782
|
-
renderer
|
|
3783
|
-
} = owner;
|
|
3784
|
-
const elm = renderer.createComment(text);
|
|
3935
|
+
const elm = createComment$1(text);
|
|
3785
3936
|
linkNodeToShadow(elm, owner);
|
|
3786
3937
|
vnode.elm = elm;
|
|
3787
3938
|
},
|
|
@@ -3811,11 +3962,8 @@
|
|
|
3811
3962
|
svg
|
|
3812
3963
|
}
|
|
3813
3964
|
} = vnode;
|
|
3814
|
-
const {
|
|
3815
|
-
renderer
|
|
3816
|
-
} = owner;
|
|
3817
3965
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3818
|
-
const elm =
|
|
3966
|
+
const elm = createElement$2(sel, namespace);
|
|
3819
3967
|
linkNodeToShadow(elm, owner);
|
|
3820
3968
|
fallbackElmHook(elm, vnode);
|
|
3821
3969
|
vnode.elm = elm;
|
|
@@ -3875,10 +4023,7 @@
|
|
|
3875
4023
|
sel,
|
|
3876
4024
|
owner
|
|
3877
4025
|
} = vnode;
|
|
3878
|
-
const
|
|
3879
|
-
renderer
|
|
3880
|
-
} = owner;
|
|
3881
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
4026
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
3882
4027
|
/**
|
|
3883
4028
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
3884
4029
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -3963,8 +4108,7 @@
|
|
|
3963
4108
|
createVM(elm, def, {
|
|
3964
4109
|
mode,
|
|
3965
4110
|
owner,
|
|
3966
|
-
tagName: sel
|
|
3967
|
-
renderer: owner.renderer
|
|
4111
|
+
tagName: sel
|
|
3968
4112
|
});
|
|
3969
4113
|
vnode.elm = elm;
|
|
3970
4114
|
const vm = getAssociatedVM(elm);
|
|
@@ -3987,12 +4131,11 @@
|
|
|
3987
4131
|
|
|
3988
4132
|
function linkNodeToShadow(elm, owner) {
|
|
3989
4133
|
const {
|
|
3990
|
-
renderer,
|
|
3991
4134
|
renderMode,
|
|
3992
4135
|
shadowMode
|
|
3993
4136
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
3994
4137
|
|
|
3995
|
-
if (
|
|
4138
|
+
if (isSyntheticShadowDefined$1) {
|
|
3996
4139
|
if (shadowMode === 1
|
|
3997
4140
|
/* Synthetic */
|
|
3998
4141
|
|| renderMode === 0
|
|
@@ -4400,7 +4543,6 @@
|
|
|
4400
4543
|
const {
|
|
4401
4544
|
elm,
|
|
4402
4545
|
context,
|
|
4403
|
-
renderer,
|
|
4404
4546
|
renderMode,
|
|
4405
4547
|
shadowMode
|
|
4406
4548
|
} = vm;
|
|
@@ -4427,11 +4569,11 @@
|
|
|
4427
4569
|
} = context;
|
|
4428
4570
|
|
|
4429
4571
|
if (oldHasTokenInClass) {
|
|
4430
|
-
|
|
4572
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
4431
4573
|
}
|
|
4432
4574
|
|
|
4433
4575
|
if (oldHasTokenInAttribute) {
|
|
4434
|
-
|
|
4576
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
4435
4577
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
4436
4578
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
4437
4579
|
|
|
@@ -4443,12 +4585,12 @@
|
|
|
4443
4585
|
|
|
4444
4586
|
if (!isUndefined$1(newToken)) {
|
|
4445
4587
|
if (hasScopedStyles) {
|
|
4446
|
-
|
|
4588
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
4447
4589
|
newHasTokenInClass = true;
|
|
4448
4590
|
}
|
|
4449
4591
|
|
|
4450
4592
|
if (isSyntheticShadow) {
|
|
4451
|
-
|
|
4593
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
4452
4594
|
newHasTokenInAttribute = true;
|
|
4453
4595
|
}
|
|
4454
4596
|
} // Update the styling tokens present on the context object.
|
|
@@ -4461,6 +4603,7 @@
|
|
|
4461
4603
|
|
|
4462
4604
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
4463
4605
|
const content = [];
|
|
4606
|
+
let root;
|
|
4464
4607
|
|
|
4465
4608
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4466
4609
|
let stylesheet = stylesheets[i];
|
|
@@ -4468,22 +4611,45 @@
|
|
|
4468
4611
|
if (isArray$1(stylesheet)) {
|
|
4469
4612
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
4470
4613
|
} else {
|
|
4471
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4472
4614
|
|
|
4615
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4616
|
+
|
|
4617
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
4618
|
+
/* Synthetic */
|
|
4619
|
+
&& vm.renderMode === 1
|
|
4620
|
+
/* Shadow */
|
|
4621
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
4622
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4473
4623
|
|
|
4474
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4475
4624
|
const useActualHostSelector = vm.renderMode === 0
|
|
4476
4625
|
/* Light */
|
|
4477
4626
|
? !isScopedCss : vm.shadowMode === 0
|
|
4478
4627
|
/* Native */
|
|
4479
|
-
; //
|
|
4628
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
4629
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
4480
4630
|
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4631
|
+
let useNativeDirPseudoclass;
|
|
4632
|
+
|
|
4633
|
+
if (vm.renderMode === 1
|
|
4484
4634
|
/* Shadow */
|
|
4485
|
-
|
|
4486
|
-
|
|
4635
|
+
) {
|
|
4636
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
4637
|
+
/* Native */
|
|
4638
|
+
;
|
|
4639
|
+
} else {
|
|
4640
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
4641
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
4642
|
+
if (isUndefined$1(root)) {
|
|
4643
|
+
// Only calculate the root once as necessary
|
|
4644
|
+
root = getNearestShadowComponent(vm);
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
4648
|
+
/* Native */
|
|
4649
|
+
;
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4652
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
4487
4653
|
}
|
|
4488
4654
|
}
|
|
4489
4655
|
|
|
@@ -4507,14 +4673,12 @@
|
|
|
4507
4673
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
4508
4674
|
|
|
4509
4675
|
|
|
4510
|
-
function
|
|
4676
|
+
function getNearestShadowComponent(vm) {
|
|
4511
4677
|
let owner = vm;
|
|
4512
4678
|
|
|
4513
4679
|
while (!isNull(owner)) {
|
|
4514
4680
|
if (owner.renderMode === 1
|
|
4515
4681
|
/* Shadow */
|
|
4516
|
-
&& owner.shadowMode === 0
|
|
4517
|
-
/* Native */
|
|
4518
4682
|
) {
|
|
4519
4683
|
return owner;
|
|
4520
4684
|
}
|
|
@@ -4525,9 +4689,22 @@
|
|
|
4525
4689
|
return owner;
|
|
4526
4690
|
}
|
|
4527
4691
|
|
|
4692
|
+
function getNearestNativeShadowComponent(vm) {
|
|
4693
|
+
const owner = getNearestShadowComponent(vm);
|
|
4694
|
+
|
|
4695
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
4696
|
+
/* Synthetic */
|
|
4697
|
+
) {
|
|
4698
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
4699
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
4700
|
+
return null;
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
return owner;
|
|
4704
|
+
}
|
|
4705
|
+
|
|
4528
4706
|
function createStylesheet(vm, stylesheets) {
|
|
4529
4707
|
const {
|
|
4530
|
-
renderer,
|
|
4531
4708
|
renderMode,
|
|
4532
4709
|
shadowMode
|
|
4533
4710
|
} = vm;
|
|
@@ -4538,9 +4715,9 @@
|
|
|
4538
4715
|
/* Synthetic */
|
|
4539
4716
|
) {
|
|
4540
4717
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4541
|
-
|
|
4718
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
4542
4719
|
}
|
|
4543
|
-
} else if (
|
|
4720
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
4544
4721
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
4545
4722
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
4546
4723
|
// the first time the VM renders.
|
|
@@ -4554,10 +4731,10 @@
|
|
|
4554
4731
|
|
|
4555
4732
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4556
4733
|
if (isGlobal) {
|
|
4557
|
-
|
|
4734
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
4558
4735
|
} else {
|
|
4559
4736
|
// local level
|
|
4560
|
-
|
|
4737
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
4561
4738
|
}
|
|
4562
4739
|
}
|
|
4563
4740
|
}
|
|
@@ -4598,7 +4775,7 @@
|
|
|
4598
4775
|
if (isProfilerEnabled) {
|
|
4599
4776
|
currentDispatcher(opId, 0
|
|
4600
4777
|
/* Start */
|
|
4601
|
-
, vm.tagName, vm.idx);
|
|
4778
|
+
, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4602
4779
|
}
|
|
4603
4780
|
}
|
|
4604
4781
|
|
|
@@ -4607,7 +4784,7 @@
|
|
|
4607
4784
|
if (isProfilerEnabled) {
|
|
4608
4785
|
currentDispatcher(opId, 1
|
|
4609
4786
|
/* Stop */
|
|
4610
|
-
, vm.tagName, vm.idx);
|
|
4787
|
+
, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4611
4788
|
}
|
|
4612
4789
|
}
|
|
4613
4790
|
|
|
@@ -4616,7 +4793,7 @@
|
|
|
4616
4793
|
if (isProfilerEnabled) {
|
|
4617
4794
|
currentDispatcher(opId, 0
|
|
4618
4795
|
/* Start */
|
|
4619
|
-
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
|
|
4796
|
+
, 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);
|
|
4620
4797
|
}
|
|
4621
4798
|
}
|
|
4622
4799
|
|
|
@@ -4625,7 +4802,7 @@
|
|
|
4625
4802
|
if (isProfilerEnabled) {
|
|
4626
4803
|
currentDispatcher(opId, 1
|
|
4627
4804
|
/* Stop */
|
|
4628
|
-
, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
|
|
4805
|
+
, 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);
|
|
4629
4806
|
}
|
|
4630
4807
|
}
|
|
4631
4808
|
/*
|
|
@@ -5112,7 +5289,6 @@
|
|
|
5112
5289
|
const {
|
|
5113
5290
|
mode,
|
|
5114
5291
|
owner,
|
|
5115
|
-
renderer,
|
|
5116
5292
|
tagName
|
|
5117
5293
|
} = options;
|
|
5118
5294
|
const vm = {
|
|
@@ -5127,7 +5303,6 @@
|
|
|
5127
5303
|
tagName,
|
|
5128
5304
|
mode,
|
|
5129
5305
|
owner,
|
|
5130
|
-
renderer,
|
|
5131
5306
|
children: EmptyArray,
|
|
5132
5307
|
aChildren: EmptyArray,
|
|
5133
5308
|
velements: EmptyArray,
|
|
@@ -5170,16 +5345,11 @@
|
|
|
5170
5345
|
|
|
5171
5346
|
function computeShadowMode(vm) {
|
|
5172
5347
|
const {
|
|
5173
|
-
def
|
|
5174
|
-
renderer
|
|
5348
|
+
def
|
|
5175
5349
|
} = vm;
|
|
5176
|
-
const {
|
|
5177
|
-
isNativeShadowDefined,
|
|
5178
|
-
isSyntheticShadowDefined
|
|
5179
|
-
} = renderer;
|
|
5180
5350
|
let shadowMode;
|
|
5181
5351
|
|
|
5182
|
-
if (isSyntheticShadowDefined) {
|
|
5352
|
+
if (isSyntheticShadowDefined$1) {
|
|
5183
5353
|
if (def.renderMode === 0
|
|
5184
5354
|
/* Light */
|
|
5185
5355
|
) {
|
|
@@ -5188,7 +5358,7 @@
|
|
|
5188
5358
|
shadowMode = 0
|
|
5189
5359
|
/* Native */
|
|
5190
5360
|
;
|
|
5191
|
-
} else if (isNativeShadowDefined) {
|
|
5361
|
+
} else if (isNativeShadowDefined$1) {
|
|
5192
5362
|
if (def.shadowSupportMode === "any"
|
|
5193
5363
|
/* Any */
|
|
5194
5364
|
) {
|
|
@@ -5312,13 +5482,12 @@
|
|
|
5312
5482
|
|
|
5313
5483
|
function runRenderedCallback(vm) {
|
|
5314
5484
|
const {
|
|
5315
|
-
renderer,
|
|
5316
5485
|
def: {
|
|
5317
5486
|
renderedCallback
|
|
5318
5487
|
}
|
|
5319
5488
|
} = vm;
|
|
5320
5489
|
|
|
5321
|
-
if (isTrue(
|
|
5490
|
+
if (isTrue(ssr$1)) {
|
|
5322
5491
|
return;
|
|
5323
5492
|
}
|
|
5324
5493
|
|
|
@@ -5535,8 +5704,7 @@
|
|
|
5535
5704
|
|
|
5536
5705
|
function resetComponentRoot(vm) {
|
|
5537
5706
|
const {
|
|
5538
|
-
children
|
|
5539
|
-
renderer
|
|
5707
|
+
children
|
|
5540
5708
|
} = vm;
|
|
5541
5709
|
const rootNode = getRenderRoot(vm);
|
|
5542
5710
|
|
|
@@ -5544,7 +5712,7 @@
|
|
|
5544
5712
|
const child = children[i];
|
|
5545
5713
|
|
|
5546
5714
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5547
|
-
|
|
5715
|
+
remove$1(child.elm, rootNode);
|
|
5548
5716
|
}
|
|
5549
5717
|
}
|
|
5550
5718
|
|
|
@@ -5554,7 +5722,7 @@
|
|
|
5554
5722
|
}
|
|
5555
5723
|
|
|
5556
5724
|
function scheduleRehydration(vm) {
|
|
5557
|
-
if (isTrue(
|
|
5725
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
5558
5726
|
return;
|
|
5559
5727
|
}
|
|
5560
5728
|
|
|
@@ -5781,7 +5949,6 @@
|
|
|
5781
5949
|
|
|
5782
5950
|
const {
|
|
5783
5951
|
elm,
|
|
5784
|
-
renderer,
|
|
5785
5952
|
context: {
|
|
5786
5953
|
wiredConnecting,
|
|
5787
5954
|
wiredDisconnecting
|
|
@@ -5808,7 +5975,7 @@
|
|
|
5808
5975
|
}
|
|
5809
5976
|
|
|
5810
5977
|
});
|
|
5811
|
-
|
|
5978
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
5812
5979
|
});
|
|
5813
5980
|
}
|
|
5814
5981
|
|
|
@@ -6063,7 +6230,7 @@
|
|
|
6063
6230
|
hooksAreSet = true;
|
|
6064
6231
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6065
6232
|
}
|
|
6066
|
-
/* version: 2.
|
|
6233
|
+
/* version: 2.6.3 */
|
|
6067
6234
|
|
|
6068
6235
|
/*
|
|
6069
6236
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6083,7 +6250,9 @@
|
|
|
6083
6250
|
const styleElements = create(null);
|
|
6084
6251
|
const styleSheets = create(null);
|
|
6085
6252
|
const nodesToStyleSheets = new WeakMap();
|
|
6086
|
-
let getCustomElement
|
|
6253
|
+
let getCustomElement;
|
|
6254
|
+
let defineCustomElement;
|
|
6255
|
+
let HTMLElementConstructor;
|
|
6087
6256
|
|
|
6088
6257
|
function isCustomElementRegistryAvailable() {
|
|
6089
6258
|
if (typeof customElements === 'undefined') {
|
|
@@ -6198,182 +6367,213 @@
|
|
|
6198
6367
|
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
6199
6368
|
}
|
|
6200
6369
|
|
|
6201
|
-
let
|
|
6370
|
+
let hydrating = false;
|
|
6202
6371
|
|
|
6203
|
-
function setIsHydrating(
|
|
6204
|
-
|
|
6372
|
+
function setIsHydrating(value) {
|
|
6373
|
+
hydrating = value;
|
|
6205
6374
|
}
|
|
6206
6375
|
|
|
6207
|
-
const
|
|
6208
|
-
ssr: false,
|
|
6209
|
-
|
|
6210
|
-
isHydrating() {
|
|
6211
|
-
return isHydrating;
|
|
6212
|
-
},
|
|
6213
|
-
|
|
6214
|
-
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
6215
|
-
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
|
|
6376
|
+
const ssr = false;
|
|
6216
6377
|
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6378
|
+
function isHydrating() {
|
|
6379
|
+
return hydrating;
|
|
6380
|
+
}
|
|
6220
6381
|
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
},
|
|
6382
|
+
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
6383
|
+
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
6224
6384
|
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6385
|
+
function createElement$1(tagName, namespace) {
|
|
6386
|
+
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6387
|
+
}
|
|
6228
6388
|
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6389
|
+
function createText(content) {
|
|
6390
|
+
return document.createTextNode(content);
|
|
6391
|
+
}
|
|
6232
6392
|
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6393
|
+
function createComment(content) {
|
|
6394
|
+
return document.createComment(content);
|
|
6395
|
+
}
|
|
6236
6396
|
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6397
|
+
function insert(node, parent, anchor) {
|
|
6398
|
+
parent.insertBefore(node, anchor);
|
|
6399
|
+
}
|
|
6240
6400
|
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
}
|
|
6401
|
+
function remove(node, parent) {
|
|
6402
|
+
parent.removeChild(node);
|
|
6403
|
+
}
|
|
6245
6404
|
|
|
6246
|
-
|
|
6247
|
-
|
|
6405
|
+
function nextSibling(node) {
|
|
6406
|
+
return node.nextSibling;
|
|
6407
|
+
}
|
|
6248
6408
|
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6409
|
+
function attachShadow(element, options) {
|
|
6410
|
+
if (hydrating) {
|
|
6411
|
+
return element.shadowRoot;
|
|
6412
|
+
}
|
|
6252
6413
|
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
},
|
|
6414
|
+
return element.attachShadow(options);
|
|
6415
|
+
}
|
|
6256
6416
|
|
|
6257
|
-
|
|
6417
|
+
function setText(node, content) {
|
|
6418
|
+
node.nodeValue = content;
|
|
6419
|
+
}
|
|
6258
6420
|
|
|
6259
|
-
|
|
6260
|
-
|
|
6421
|
+
function getProperty(node, key) {
|
|
6422
|
+
return node[key];
|
|
6423
|
+
}
|
|
6261
6424
|
|
|
6262
|
-
|
|
6263
|
-
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6264
|
-
},
|
|
6425
|
+
function setProperty(node, key, value) {
|
|
6265
6426
|
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
},
|
|
6427
|
+
node[key] = value;
|
|
6428
|
+
}
|
|
6269
6429
|
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
} else {
|
|
6274
|
-
element.removeAttributeNS(namespace, name);
|
|
6275
|
-
}
|
|
6276
|
-
},
|
|
6430
|
+
function getAttribute(element, name, namespace) {
|
|
6431
|
+
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6432
|
+
}
|
|
6277
6433
|
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6434
|
+
function setAttribute(element, name, value, namespace) {
|
|
6435
|
+
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6436
|
+
}
|
|
6281
6437
|
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6438
|
+
function removeAttribute(element, name, namespace) {
|
|
6439
|
+
if (isUndefined$1(namespace)) {
|
|
6440
|
+
element.removeAttribute(name);
|
|
6441
|
+
} else {
|
|
6442
|
+
element.removeAttributeNS(namespace, name);
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6285
6445
|
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6446
|
+
function addEventListener(target, type, callback, options) {
|
|
6447
|
+
target.addEventListener(type, callback, options);
|
|
6448
|
+
}
|
|
6289
6449
|
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6450
|
+
function removeEventListener(target, type, callback, options) {
|
|
6451
|
+
target.removeEventListener(type, callback, options);
|
|
6452
|
+
}
|
|
6293
6453
|
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6298
|
-
},
|
|
6454
|
+
function dispatchEvent(target, event) {
|
|
6455
|
+
return target.dispatchEvent(event);
|
|
6456
|
+
}
|
|
6299
6457
|
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6458
|
+
function getClassList(element) {
|
|
6459
|
+
return element.classList;
|
|
6460
|
+
}
|
|
6303
6461
|
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6462
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
6463
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6464
|
+
// represent elements in the engine?
|
|
6465
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6466
|
+
}
|
|
6307
6467
|
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6468
|
+
function getBoundingClientRect(element) {
|
|
6469
|
+
return element.getBoundingClientRect();
|
|
6470
|
+
}
|
|
6311
6471
|
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6472
|
+
function querySelector(element, selectors) {
|
|
6473
|
+
return element.querySelector(selectors);
|
|
6474
|
+
}
|
|
6315
6475
|
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6476
|
+
function querySelectorAll(element, selectors) {
|
|
6477
|
+
return element.querySelectorAll(selectors);
|
|
6478
|
+
}
|
|
6319
6479
|
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6480
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6481
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6482
|
+
}
|
|
6323
6483
|
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6484
|
+
function getElementsByClassName(element, names) {
|
|
6485
|
+
return element.getElementsByClassName(names);
|
|
6486
|
+
}
|
|
6327
6487
|
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6488
|
+
function getChildren(element) {
|
|
6489
|
+
return element.children;
|
|
6490
|
+
}
|
|
6331
6491
|
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6492
|
+
function getChildNodes(element) {
|
|
6493
|
+
return element.childNodes;
|
|
6494
|
+
}
|
|
6335
6495
|
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6496
|
+
function getFirstChild(element) {
|
|
6497
|
+
return element.firstChild;
|
|
6498
|
+
}
|
|
6339
6499
|
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6500
|
+
function getFirstElementChild(element) {
|
|
6501
|
+
return element.firstElementChild;
|
|
6502
|
+
}
|
|
6343
6503
|
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6504
|
+
function getLastChild(element) {
|
|
6505
|
+
return element.lastChild;
|
|
6506
|
+
}
|
|
6347
6507
|
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
}
|
|
6508
|
+
function getLastElementChild(element) {
|
|
6509
|
+
return element.lastElementChild;
|
|
6510
|
+
}
|
|
6352
6511
|
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
elm.textContent = content;
|
|
6357
|
-
globalStylesheetsParentElement.appendChild(elm);
|
|
6358
|
-
},
|
|
6512
|
+
function isConnected(node) {
|
|
6513
|
+
return node.isConnected;
|
|
6514
|
+
}
|
|
6359
6515
|
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
// Fall back to <style> element
|
|
6365
|
-
insertStyleElement(content, target);
|
|
6366
|
-
}
|
|
6367
|
-
},
|
|
6516
|
+
function insertGlobalStylesheet(content) {
|
|
6517
|
+
if (!isUndefined$1(globalStylesheets[content])) {
|
|
6518
|
+
return;
|
|
6519
|
+
}
|
|
6368
6520
|
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6521
|
+
globalStylesheets[content] = true;
|
|
6522
|
+
const elm = document.createElement('style');
|
|
6523
|
+
elm.type = 'text/css';
|
|
6524
|
+
elm.textContent = content;
|
|
6525
|
+
globalStylesheetsParentElement.appendChild(elm);
|
|
6526
|
+
}
|
|
6372
6527
|
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6528
|
+
function insertStylesheet(content, target) {
|
|
6529
|
+
if (supportsConstructableStyleSheets) {
|
|
6530
|
+
insertConstructableStyleSheet(content, target);
|
|
6531
|
+
} else {
|
|
6532
|
+
// Fall back to <style> element
|
|
6533
|
+
insertStyleElement(content, target);
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
|
|
6537
|
+
const HTMLElementExported = HTMLElementConstructor;
|
|
6538
|
+
setAttachShadow(attachShadow);
|
|
6539
|
+
setCreateComment(createComment);
|
|
6540
|
+
setCreateElement(createElement$1);
|
|
6541
|
+
setCreateText(createText);
|
|
6542
|
+
setDefineCustomElement(defineCustomElement);
|
|
6543
|
+
setDispatchEvent(dispatchEvent);
|
|
6544
|
+
setGetAttribute(getAttribute);
|
|
6545
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
6546
|
+
setGetChildNodes(getChildNodes);
|
|
6547
|
+
setGetChildren(getChildren);
|
|
6548
|
+
setGetClassList(getClassList);
|
|
6549
|
+
setGetCustomElement(getCustomElement);
|
|
6550
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
6551
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
6552
|
+
setGetFirstChild(getFirstChild);
|
|
6553
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
6554
|
+
setGetLastChild(getLastChild);
|
|
6555
|
+
setGetLastElementChild(getLastElementChild);
|
|
6556
|
+
setGetProperty(getProperty);
|
|
6557
|
+
setHTMLElement(HTMLElementExported);
|
|
6558
|
+
setInsert(insert);
|
|
6559
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
6560
|
+
setInsertStylesheet(insertStylesheet);
|
|
6561
|
+
setIsConnected(isConnected);
|
|
6562
|
+
setIsHydrating$1(isHydrating);
|
|
6563
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
6564
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
6565
|
+
setNextSibling(nextSibling);
|
|
6566
|
+
setQuerySelector(querySelector);
|
|
6567
|
+
setQuerySelectorAll(querySelectorAll);
|
|
6568
|
+
setRemove(remove);
|
|
6569
|
+
setRemoveAttribute(removeAttribute);
|
|
6570
|
+
setRemoveEventListener(removeEventListener);
|
|
6571
|
+
setSetAttribute(setAttribute);
|
|
6572
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
6573
|
+
setSetProperty(setProperty);
|
|
6574
|
+
setSetText(setText);
|
|
6575
|
+
setSsr(ssr);
|
|
6576
|
+
setAddEventListener(addEventListener);
|
|
6377
6577
|
/*
|
|
6378
6578
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6379
6579
|
* All rights reserved.
|
|
@@ -6453,7 +6653,7 @@
|
|
|
6453
6653
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
6454
6654
|
}
|
|
6455
6655
|
|
|
6456
|
-
const UpgradableConstructor = getUpgradableConstructor(sel
|
|
6656
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
6457
6657
|
let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
6458
6658
|
|
|
6459
6659
|
/**
|
|
@@ -6468,8 +6668,7 @@
|
|
|
6468
6668
|
createVM(elm, def, {
|
|
6469
6669
|
tagName: sel,
|
|
6470
6670
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
6471
|
-
owner: null
|
|
6472
|
-
renderer
|
|
6671
|
+
owner: null
|
|
6473
6672
|
});
|
|
6474
6673
|
ConnectingSlot.set(elm, connectRootElement);
|
|
6475
6674
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
@@ -6492,6 +6691,10 @@
|
|
|
6492
6691
|
|
|
6493
6692
|
|
|
6494
6693
|
function hydrateComponent(element, Ctor, props = {}) {
|
|
6694
|
+
if (!(element instanceof Element)) {
|
|
6695
|
+
throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
|
|
6696
|
+
}
|
|
6697
|
+
|
|
6495
6698
|
if (!isFunction$1(Ctor)) {
|
|
6496
6699
|
throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
|
|
6497
6700
|
}
|
|
@@ -6509,7 +6712,6 @@
|
|
|
6509
6712
|
createVM(element, def, {
|
|
6510
6713
|
mode: 'open',
|
|
6511
6714
|
owner: null,
|
|
6512
|
-
renderer,
|
|
6513
6715
|
tagName: element.tagName.toLowerCase()
|
|
6514
6716
|
});
|
|
6515
6717
|
|
|
@@ -6576,8 +6778,7 @@
|
|
|
6576
6778
|
createVM(this, def, {
|
|
6577
6779
|
mode: 'open',
|
|
6578
6780
|
owner: null,
|
|
6579
|
-
tagName: this.tagName
|
|
6580
|
-
renderer
|
|
6781
|
+
tagName: this.tagName
|
|
6581
6782
|
});
|
|
6582
6783
|
}
|
|
6583
6784
|
|
|
@@ -6644,7 +6845,7 @@
|
|
|
6644
6845
|
return false;
|
|
6645
6846
|
}
|
|
6646
6847
|
|
|
6647
|
-
if (
|
|
6848
|
+
if (isSyntheticShadowDefined) {
|
|
6648
6849
|
// TODO [#1252]: old behavior that is still used by some pieces of the platform,
|
|
6649
6850
|
// specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
|
|
6650
6851
|
// used, will be considered global elements.
|
|
@@ -6697,7 +6898,7 @@
|
|
|
6697
6898
|
});
|
|
6698
6899
|
freeze(LightningElement);
|
|
6699
6900
|
seal(LightningElement.prototype);
|
|
6700
|
-
/* version: 2.
|
|
6901
|
+
/* version: 2.6.3 */
|
|
6701
6902
|
|
|
6702
6903
|
exports.LightningElement = LightningElement;
|
|
6703
6904
|
exports.__unstable__ProfilerControl = profilerControl;
|