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