lwc 2.6.2 → 2.7.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 +1114 -1054
- package/dist/engine-dom/iife/es2017/engine-dom.js +1114 -1054
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1084 -1018
- package/dist/engine-dom/iife/es5/engine-dom.js +1166 -999
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +1181 -1014
- package/dist/engine-dom/umd/es2017/engine-dom.js +1114 -1054
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1084 -1018
- package/dist/engine-dom/umd/es5/engine-dom.js +1166 -999
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +1181 -1014
- package/dist/engine-server/commonjs/es2017/engine-server.js +1286 -1227
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +1286 -1227
- 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 +78 -9
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +78 -9
- 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 +78 -9
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +78 -9
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +3 -3
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +3 -3
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +3 -3
- package/package.json +8 -8
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
26
|
|
|
27
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); }
|
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
28
28
|
|
|
29
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
30
|
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
345
345
|
return attributeName;
|
|
346
346
|
}
|
|
347
|
-
/** version: 2.
|
|
347
|
+
/** version: 2.7.3 */
|
|
348
348
|
|
|
349
349
|
/*
|
|
350
350
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -456,7 +456,6 @@
|
|
|
456
456
|
ENABLE_NODE_LIST_PATCH: null,
|
|
457
457
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
458
458
|
ENABLE_NODE_PATCH: null,
|
|
459
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
460
459
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
461
460
|
};
|
|
462
461
|
|
|
@@ -515,7 +514,7 @@
|
|
|
515
514
|
|
|
516
515
|
function setFeatureFlagForTest(name, value) {
|
|
517
516
|
}
|
|
518
|
-
/** version: 2.
|
|
517
|
+
/** version: 2.7.3 */
|
|
519
518
|
|
|
520
519
|
/* proxy-compat-disable */
|
|
521
520
|
|
|
@@ -558,6 +557,243 @@
|
|
|
558
557
|
|
|
559
558
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
560
559
|
} // Borrowed from Vue template compiler.
|
|
560
|
+
// Primitives
|
|
561
|
+
//
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
var ssr$1;
|
|
565
|
+
|
|
566
|
+
function setSsr(ssrImpl) {
|
|
567
|
+
ssr$1 = ssrImpl;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
var isNativeShadowDefined$1;
|
|
571
|
+
|
|
572
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
573
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
var isSyntheticShadowDefined$1;
|
|
577
|
+
|
|
578
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
579
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
var HTMLElementExported$1;
|
|
583
|
+
|
|
584
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
585
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
var isHydrating$1;
|
|
589
|
+
|
|
590
|
+
function setIsHydrating$1(isHydratingImpl) {
|
|
591
|
+
isHydrating$1 = isHydratingImpl;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
var insert$1;
|
|
595
|
+
|
|
596
|
+
function setInsert(insertImpl) {
|
|
597
|
+
insert$1 = insertImpl;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
var remove$1;
|
|
601
|
+
|
|
602
|
+
function setRemove(removeImpl) {
|
|
603
|
+
remove$1 = removeImpl;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
var createElement$2;
|
|
607
|
+
|
|
608
|
+
function setCreateElement(createElementImpl) {
|
|
609
|
+
createElement$2 = createElementImpl;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
var createText$1;
|
|
613
|
+
|
|
614
|
+
function setCreateText(createTextImpl) {
|
|
615
|
+
createText$1 = createTextImpl;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
var createComment$1;
|
|
619
|
+
|
|
620
|
+
function setCreateComment(createCommentImpl) {
|
|
621
|
+
createComment$1 = createCommentImpl;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
var nextSibling$1;
|
|
625
|
+
|
|
626
|
+
function setNextSibling(nextSiblingImpl) {
|
|
627
|
+
nextSibling$1 = nextSiblingImpl;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
var attachShadow$1;
|
|
631
|
+
|
|
632
|
+
function setAttachShadow(attachShadowImpl) {
|
|
633
|
+
attachShadow$1 = attachShadowImpl;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
var getProperty$1;
|
|
637
|
+
|
|
638
|
+
function setGetProperty(getPropertyImpl) {
|
|
639
|
+
getProperty$1 = getPropertyImpl;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
var setProperty$1;
|
|
643
|
+
|
|
644
|
+
function setSetProperty(setPropertyImpl) {
|
|
645
|
+
setProperty$1 = setPropertyImpl;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
var setText$1;
|
|
649
|
+
|
|
650
|
+
function setSetText(setTextImpl) {
|
|
651
|
+
setText$1 = setTextImpl;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
var getAttribute$1;
|
|
655
|
+
|
|
656
|
+
function setGetAttribute(getAttributeImpl) {
|
|
657
|
+
getAttribute$1 = getAttributeImpl;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
var setAttribute$1;
|
|
661
|
+
|
|
662
|
+
function setSetAttribute(setAttributeImpl) {
|
|
663
|
+
setAttribute$1 = setAttributeImpl;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
var removeAttribute$1;
|
|
667
|
+
|
|
668
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
669
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
var addEventListener$1;
|
|
673
|
+
|
|
674
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
675
|
+
addEventListener$1 = addEventListenerImpl;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
var removeEventListener$1;
|
|
679
|
+
|
|
680
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
681
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
var dispatchEvent$1;
|
|
685
|
+
|
|
686
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
687
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
var getClassList$1;
|
|
691
|
+
|
|
692
|
+
function setGetClassList(getClassListImpl) {
|
|
693
|
+
getClassList$1 = getClassListImpl;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
var setCSSStyleProperty$1;
|
|
697
|
+
|
|
698
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
699
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
var getBoundingClientRect$1;
|
|
703
|
+
|
|
704
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
705
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
var querySelector$1;
|
|
709
|
+
|
|
710
|
+
function setQuerySelector(querySelectorImpl) {
|
|
711
|
+
querySelector$1 = querySelectorImpl;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
var querySelectorAll$1;
|
|
715
|
+
|
|
716
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
717
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
var getElementsByTagName$1;
|
|
721
|
+
|
|
722
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
723
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
var getElementsByClassName$1;
|
|
727
|
+
|
|
728
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
729
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
var getChildren$1;
|
|
733
|
+
|
|
734
|
+
function setGetChildren(getChildrenImpl) {
|
|
735
|
+
getChildren$1 = getChildrenImpl;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
var getChildNodes$1;
|
|
739
|
+
|
|
740
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
741
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
var getFirstChild$1;
|
|
745
|
+
|
|
746
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
747
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
var getFirstElementChild$1;
|
|
751
|
+
|
|
752
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
753
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
var getLastChild$1;
|
|
757
|
+
|
|
758
|
+
function setGetLastChild(getLastChildImpl) {
|
|
759
|
+
getLastChild$1 = getLastChildImpl;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
var getLastElementChild$1;
|
|
763
|
+
|
|
764
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
765
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
var isConnected$1;
|
|
769
|
+
|
|
770
|
+
function setIsConnected(isConnectedImpl) {
|
|
771
|
+
isConnected$1 = isConnectedImpl;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
var insertGlobalStylesheet$1;
|
|
775
|
+
|
|
776
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
777
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
var insertStylesheet$1;
|
|
781
|
+
|
|
782
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
783
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
var defineCustomElement$1;
|
|
787
|
+
|
|
788
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
789
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
var getCustomElement$1;
|
|
793
|
+
|
|
794
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
795
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
796
|
+
}
|
|
561
797
|
/*
|
|
562
798
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
563
799
|
* All rights reserved.
|
|
@@ -771,591 +1007,116 @@
|
|
|
771
1007
|
*/
|
|
772
1008
|
|
|
773
1009
|
|
|
774
|
-
function
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
var handler = on && on[type]; // call event handler if exists
|
|
1010
|
+
function isUndef(s) {
|
|
1011
|
+
return s === undefined;
|
|
1012
|
+
}
|
|
778
1013
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
1014
|
+
function sameVnode(vnode1, vnode2) {
|
|
1015
|
+
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
782
1016
|
}
|
|
783
1017
|
|
|
784
|
-
function
|
|
785
|
-
return
|
|
786
|
-
handleEvent(event, handler.vnode);
|
|
787
|
-
};
|
|
1018
|
+
function isVNode(vnode) {
|
|
1019
|
+
return vnode != null;
|
|
788
1020
|
}
|
|
789
1021
|
|
|
790
|
-
function
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1022
|
+
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
|
1023
|
+
var map = {};
|
|
1024
|
+
var j, key, ch; // TODO [#1637]: simplify this by assuming that all vnodes has keys
|
|
1025
|
+
|
|
1026
|
+
for (j = beginIdx; j <= endIdx; ++j) {
|
|
1027
|
+
ch = children[j];
|
|
1028
|
+
|
|
1029
|
+
if (isVNode(ch)) {
|
|
1030
|
+
key = ch.key;
|
|
1031
|
+
|
|
1032
|
+
if (key !== undefined) {
|
|
1033
|
+
map[key] = j;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
796
1036
|
}
|
|
1037
|
+
|
|
1038
|
+
return map;
|
|
797
1039
|
}
|
|
798
1040
|
|
|
799
|
-
function
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
renderer = vnode.owner.renderer;
|
|
1041
|
+
function addVnodes(parentElm, before, vnodes, startIdx, endIdx) {
|
|
1042
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
1043
|
+
var ch = vnodes[startIdx];
|
|
803
1044
|
|
|
804
|
-
|
|
805
|
-
|
|
1045
|
+
if (isVNode(ch)) {
|
|
1046
|
+
ch.hook.create(ch);
|
|
1047
|
+
ch.hook.insert(ch, parentElm, before);
|
|
1048
|
+
}
|
|
806
1049
|
}
|
|
1050
|
+
}
|
|
807
1051
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1052
|
+
function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
|
|
1053
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
1054
|
+
var ch = vnodes[startIdx]; // text nodes do not have logic associated to them
|
|
811
1055
|
|
|
812
|
-
|
|
813
|
-
|
|
1056
|
+
if (isVNode(ch)) {
|
|
1057
|
+
ch.hook.remove(ch, parentElm);
|
|
1058
|
+
}
|
|
814
1059
|
}
|
|
815
1060
|
}
|
|
816
1061
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
1062
|
+
function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
1063
|
+
var oldStartIdx = 0;
|
|
1064
|
+
var newStartIdx = 0;
|
|
1065
|
+
var oldEndIdx = oldCh.length - 1;
|
|
1066
|
+
var oldStartVnode = oldCh[0];
|
|
1067
|
+
var oldEndVnode = oldCh[oldEndIdx];
|
|
1068
|
+
var newChEnd = newCh.length - 1;
|
|
1069
|
+
var newEndIdx = newChEnd;
|
|
1070
|
+
var newStartVnode = newCh[0];
|
|
1071
|
+
var newEndVnode = newCh[newEndIdx];
|
|
1072
|
+
var oldKeyToIdx;
|
|
1073
|
+
var idxInOld;
|
|
1074
|
+
var elmToMove;
|
|
1075
|
+
var before;
|
|
827
1076
|
|
|
828
|
-
|
|
1077
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
1078
|
+
if (!isVNode(oldStartVnode)) {
|
|
1079
|
+
oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
|
|
1080
|
+
} else if (!isVNode(oldEndVnode)) {
|
|
1081
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1082
|
+
} else if (!isVNode(newStartVnode)) {
|
|
1083
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1084
|
+
} else if (!isVNode(newEndVnode)) {
|
|
1085
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1086
|
+
} else if (sameVnode(oldStartVnode, newStartVnode)) {
|
|
1087
|
+
patchVnode(oldStartVnode, newStartVnode);
|
|
1088
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1089
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1090
|
+
} else if (sameVnode(oldEndVnode, newEndVnode)) {
|
|
1091
|
+
patchVnode(oldEndVnode, newEndVnode);
|
|
1092
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1093
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1094
|
+
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1095
|
+
// Vnode moved right
|
|
1096
|
+
patchVnode(oldStartVnode, newEndVnode);
|
|
1097
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1098
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1099
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1100
|
+
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
1101
|
+
// Vnode moved left
|
|
1102
|
+
patchVnode(oldEndVnode, newStartVnode);
|
|
1103
|
+
newStartVnode.hook.move(oldEndVnode, parentElm, oldStartVnode.elm);
|
|
1104
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1105
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1106
|
+
} else {
|
|
1107
|
+
if (oldKeyToIdx === undefined) {
|
|
1108
|
+
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
|
1109
|
+
}
|
|
829
1110
|
|
|
830
|
-
|
|
831
|
-
return "Using the `".concat(name, "` property is an anti-pattern because it rounds the value to an integer. Instead, use the `getBoundingClientRect` method to obtain fractional values for the size of an element and its position relative to the viewport.");
|
|
832
|
-
} // Global HTML Attributes & Properties
|
|
833
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
834
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
1111
|
+
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
835
1112
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
},
|
|
844
|
-
className: {
|
|
845
|
-
attribute: 'class',
|
|
846
|
-
error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
|
|
847
|
-
},
|
|
848
|
-
contentEditable: {
|
|
849
|
-
attribute: 'contenteditable'
|
|
850
|
-
},
|
|
851
|
-
dataset: {
|
|
852
|
-
readOnly: true,
|
|
853
|
-
error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
|
|
854
|
-
},
|
|
855
|
-
dir: {
|
|
856
|
-
attribute: 'dir'
|
|
857
|
-
},
|
|
858
|
-
draggable: {
|
|
859
|
-
attribute: 'draggable'
|
|
860
|
-
},
|
|
861
|
-
dropzone: {
|
|
862
|
-
attribute: 'dropzone',
|
|
863
|
-
readOnly: true
|
|
864
|
-
},
|
|
865
|
-
hidden: {
|
|
866
|
-
attribute: 'hidden'
|
|
867
|
-
},
|
|
868
|
-
id: {
|
|
869
|
-
attribute: 'id'
|
|
870
|
-
},
|
|
871
|
-
inputMode: {
|
|
872
|
-
attribute: 'inputmode'
|
|
873
|
-
},
|
|
874
|
-
lang: {
|
|
875
|
-
attribute: 'lang'
|
|
876
|
-
},
|
|
877
|
-
slot: {
|
|
878
|
-
attribute: 'slot',
|
|
879
|
-
error: 'Using the `slot` property is an anti-pattern.'
|
|
880
|
-
},
|
|
881
|
-
spellcheck: {
|
|
882
|
-
attribute: 'spellcheck'
|
|
883
|
-
},
|
|
884
|
-
style: {
|
|
885
|
-
attribute: 'style'
|
|
886
|
-
},
|
|
887
|
-
tabIndex: {
|
|
888
|
-
attribute: 'tabindex'
|
|
889
|
-
},
|
|
890
|
-
title: {
|
|
891
|
-
attribute: 'title'
|
|
892
|
-
},
|
|
893
|
-
translate: {
|
|
894
|
-
attribute: 'translate'
|
|
895
|
-
},
|
|
896
|
-
// additional "global attributes" that are not present in the link above.
|
|
897
|
-
isContentEditable: {
|
|
898
|
-
readOnly: true
|
|
899
|
-
},
|
|
900
|
-
offsetHeight: {
|
|
901
|
-
readOnly: true,
|
|
902
|
-
error: offsetPropertyErrorMessage('offsetHeight')
|
|
903
|
-
},
|
|
904
|
-
offsetLeft: {
|
|
905
|
-
readOnly: true,
|
|
906
|
-
error: offsetPropertyErrorMessage('offsetLeft')
|
|
907
|
-
},
|
|
908
|
-
offsetParent: {
|
|
909
|
-
readOnly: true
|
|
910
|
-
},
|
|
911
|
-
offsetTop: {
|
|
912
|
-
readOnly: true,
|
|
913
|
-
error: offsetPropertyErrorMessage('offsetTop')
|
|
914
|
-
},
|
|
915
|
-
offsetWidth: {
|
|
916
|
-
readOnly: true,
|
|
917
|
-
error: offsetPropertyErrorMessage('offsetWidth')
|
|
918
|
-
},
|
|
919
|
-
role: {
|
|
920
|
-
attribute: 'role'
|
|
921
|
-
}
|
|
922
|
-
});
|
|
923
|
-
var controlledElement = null;
|
|
924
|
-
var controlledAttributeName;
|
|
925
|
-
|
|
926
|
-
function isAttributeLocked(elm, attrName) {
|
|
927
|
-
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
function lockAttribute(_elm, _key) {
|
|
931
|
-
controlledElement = null;
|
|
932
|
-
controlledAttributeName = undefined;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
function unlockAttribute(elm, key) {
|
|
936
|
-
controlledElement = elm;
|
|
937
|
-
controlledAttributeName = key;
|
|
938
|
-
}
|
|
939
|
-
/*
|
|
940
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
941
|
-
* All rights reserved.
|
|
942
|
-
* SPDX-License-Identifier: MIT
|
|
943
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
944
|
-
*/
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
948
|
-
var xmlNS = 'http://www.w3.org/XML/1998/namespace';
|
|
949
|
-
var ColonCharCode = 58;
|
|
950
|
-
|
|
951
|
-
function updateAttrs(oldVnode, vnode) {
|
|
952
|
-
var attrs = vnode.data.attrs,
|
|
953
|
-
renderer = vnode.owner.renderer;
|
|
954
|
-
|
|
955
|
-
if (isUndefined$1(attrs)) {
|
|
956
|
-
return;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
var oldAttrs = oldVnode.data.attrs;
|
|
960
|
-
|
|
961
|
-
if (oldAttrs === attrs) {
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
var elm = vnode.elm;
|
|
966
|
-
var setAttribute = renderer.setAttribute,
|
|
967
|
-
removeAttribute = renderer.removeAttribute;
|
|
968
|
-
var key;
|
|
969
|
-
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
970
|
-
// this routine is only useful for data-* attributes in all kind of elements
|
|
971
|
-
// and aria-* in standard elements (custom elements will use props for these)
|
|
972
|
-
|
|
973
|
-
for (key in attrs) {
|
|
974
|
-
var cur = attrs[key];
|
|
975
|
-
var old = oldAttrs[key];
|
|
976
|
-
|
|
977
|
-
if (old !== cur) {
|
|
978
|
-
unlockAttribute(elm, key);
|
|
979
|
-
|
|
980
|
-
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
981
|
-
// Assume xml namespace
|
|
982
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
983
|
-
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
984
|
-
// Assume xlink namespace
|
|
985
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
986
|
-
} else if (isNull(cur)) {
|
|
987
|
-
removeAttribute(elm, key);
|
|
988
|
-
} else {
|
|
989
|
-
setAttribute(elm, key, cur);
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
lockAttribute();
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
var emptyVNode$3 = {
|
|
998
|
-
data: {}
|
|
999
|
-
};
|
|
1000
|
-
var modAttrs = {
|
|
1001
|
-
create: function create(vnode) {
|
|
1002
|
-
return updateAttrs(emptyVNode$3, vnode);
|
|
1003
|
-
},
|
|
1004
|
-
update: updateAttrs
|
|
1005
|
-
};
|
|
1006
|
-
/*
|
|
1007
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1008
|
-
* All rights reserved.
|
|
1009
|
-
* SPDX-License-Identifier: MIT
|
|
1010
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1011
|
-
*/
|
|
1012
|
-
|
|
1013
|
-
function isLiveBindingProp(sel, key) {
|
|
1014
|
-
// For properties with live bindings, we read values from the DOM element
|
|
1015
|
-
// instead of relying on internally tracked values.
|
|
1016
|
-
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
function update(oldVnode, vnode) {
|
|
1020
|
-
var props = vnode.data.props;
|
|
1021
|
-
|
|
1022
|
-
if (isUndefined$1(props)) {
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
var oldProps = oldVnode.data.props;
|
|
1027
|
-
|
|
1028
|
-
if (oldProps === props) {
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
var isFirstPatch = isUndefined$1(oldProps);
|
|
1033
|
-
var elm = vnode.elm,
|
|
1034
|
-
sel = vnode.sel,
|
|
1035
|
-
renderer = vnode.owner.renderer;
|
|
1036
|
-
|
|
1037
|
-
for (var key in props) {
|
|
1038
|
-
var cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1039
|
-
|
|
1040
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
|
|
1041
|
-
renderer.setProperty(elm, key, cur);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
var emptyVNode$2 = {
|
|
1047
|
-
data: {}
|
|
1048
|
-
};
|
|
1049
|
-
var modProps = {
|
|
1050
|
-
create: function create(vnode) {
|
|
1051
|
-
return update(emptyVNode$2, vnode);
|
|
1052
|
-
},
|
|
1053
|
-
update: update
|
|
1054
|
-
};
|
|
1055
|
-
/*
|
|
1056
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1057
|
-
* All rights reserved.
|
|
1058
|
-
* SPDX-License-Identifier: MIT
|
|
1059
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1060
|
-
*/
|
|
1061
|
-
|
|
1062
|
-
var classNameToClassMap = create(null);
|
|
1063
|
-
|
|
1064
|
-
function getMapFromClassName(className) {
|
|
1065
|
-
// Intentionally using == to match undefined and null values from computed style attribute
|
|
1066
|
-
if (className == null) {
|
|
1067
|
-
return EmptyObject;
|
|
1068
|
-
} // computed class names must be string
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
className = isString(className) ? className : className + '';
|
|
1072
|
-
var map = classNameToClassMap[className];
|
|
1073
|
-
|
|
1074
|
-
if (map) {
|
|
1075
|
-
return map;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
map = create(null);
|
|
1079
|
-
var start = 0;
|
|
1080
|
-
var o;
|
|
1081
|
-
var len = className.length;
|
|
1082
|
-
|
|
1083
|
-
for (o = 0; o < len; o++) {
|
|
1084
|
-
if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
|
|
1085
|
-
if (o > start) {
|
|
1086
|
-
map[StringSlice.call(className, start, o)] = true;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
start = o + 1;
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
if (o > start) {
|
|
1094
|
-
map[StringSlice.call(className, start, o)] = true;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
classNameToClassMap[className] = map;
|
|
1098
|
-
|
|
1099
|
-
return map;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
function updateClassAttribute(oldVnode, vnode) {
|
|
1103
|
-
var elm = vnode.elm,
|
|
1104
|
-
newClass = vnode.data.className,
|
|
1105
|
-
renderer = vnode.owner.renderer;
|
|
1106
|
-
var oldClass = oldVnode.data.className;
|
|
1107
|
-
|
|
1108
|
-
if (oldClass === newClass) {
|
|
1109
|
-
return;
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
var classList = renderer.getClassList(elm);
|
|
1113
|
-
var newClassMap = getMapFromClassName(newClass);
|
|
1114
|
-
var oldClassMap = getMapFromClassName(oldClass);
|
|
1115
|
-
var name;
|
|
1116
|
-
|
|
1117
|
-
for (name in oldClassMap) {
|
|
1118
|
-
// remove only if it is not in the new class collection and it is not set from within the instance
|
|
1119
|
-
if (isUndefined$1(newClassMap[name])) {
|
|
1120
|
-
classList.remove(name);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
for (name in newClassMap) {
|
|
1125
|
-
if (isUndefined$1(oldClassMap[name])) {
|
|
1126
|
-
classList.add(name);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
var emptyVNode$1 = {
|
|
1132
|
-
data: {}
|
|
1133
|
-
};
|
|
1134
|
-
var modComputedClassName = {
|
|
1135
|
-
create: function create(vnode) {
|
|
1136
|
-
return updateClassAttribute(emptyVNode$1, vnode);
|
|
1137
|
-
},
|
|
1138
|
-
update: updateClassAttribute
|
|
1139
|
-
};
|
|
1140
|
-
/*
|
|
1141
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1142
|
-
* All rights reserved.
|
|
1143
|
-
* SPDX-License-Identifier: MIT
|
|
1144
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1145
|
-
*/
|
|
1146
|
-
|
|
1147
|
-
function updateStyleAttribute(oldVnode, vnode) {
|
|
1148
|
-
var elm = vnode.elm,
|
|
1149
|
-
newStyle = vnode.data.style,
|
|
1150
|
-
renderer = vnode.owner.renderer;
|
|
1151
|
-
var setAttribute = renderer.setAttribute,
|
|
1152
|
-
removeAttribute = renderer.removeAttribute;
|
|
1153
|
-
|
|
1154
|
-
if (oldVnode.data.style === newStyle) {
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
if (!isString(newStyle) || newStyle === '') {
|
|
1159
|
-
removeAttribute(elm, 'style');
|
|
1160
|
-
} else {
|
|
1161
|
-
setAttribute(elm, 'style', newStyle);
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
var emptyVNode = {
|
|
1166
|
-
data: {}
|
|
1167
|
-
};
|
|
1168
|
-
var modComputedStyle = {
|
|
1169
|
-
create: function create(vnode) {
|
|
1170
|
-
return updateStyleAttribute(emptyVNode, vnode);
|
|
1171
|
-
},
|
|
1172
|
-
update: updateStyleAttribute
|
|
1173
|
-
};
|
|
1174
|
-
/*
|
|
1175
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1176
|
-
* All rights reserved.
|
|
1177
|
-
* SPDX-License-Identifier: MIT
|
|
1178
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1179
|
-
*/
|
|
1180
|
-
// The compiler takes care of transforming the inline classnames into an object. It's faster to set the
|
|
1181
|
-
// different classnames properties individually instead of via a string.
|
|
1182
|
-
|
|
1183
|
-
function createClassAttribute(vnode) {
|
|
1184
|
-
var elm = vnode.elm,
|
|
1185
|
-
classMap = vnode.data.classMap,
|
|
1186
|
-
renderer = vnode.owner.renderer;
|
|
1187
|
-
|
|
1188
|
-
if (isUndefined$1(classMap)) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
var classList = renderer.getClassList(elm);
|
|
1193
|
-
|
|
1194
|
-
for (var name in classMap) {
|
|
1195
|
-
classList.add(name);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
var modStaticClassName = {
|
|
1200
|
-
create: createClassAttribute
|
|
1201
|
-
};
|
|
1202
|
-
/*
|
|
1203
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1204
|
-
* All rights reserved.
|
|
1205
|
-
* SPDX-License-Identifier: MIT
|
|
1206
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1207
|
-
*/
|
|
1208
|
-
// The compiler takes care of transforming the inline style into an object. It's faster to set the
|
|
1209
|
-
// different style properties individually instead of via a string.
|
|
1210
|
-
|
|
1211
|
-
function createStyleAttribute(vnode) {
|
|
1212
|
-
var elm = vnode.elm,
|
|
1213
|
-
styleDecls = vnode.data.styleDecls,
|
|
1214
|
-
renderer = vnode.owner.renderer;
|
|
1215
|
-
|
|
1216
|
-
if (isUndefined$1(styleDecls)) {
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
for (var _i6 = 0; _i6 < styleDecls.length; _i6++) {
|
|
1221
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[_i6], 3),
|
|
1222
|
-
prop = _styleDecls$_i[0],
|
|
1223
|
-
value = _styleDecls$_i[1],
|
|
1224
|
-
important = _styleDecls$_i[2];
|
|
1225
|
-
|
|
1226
|
-
renderer.setCSSStyleProperty(elm, prop, value, important);
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
var modStaticStyle = {
|
|
1231
|
-
create: createStyleAttribute
|
|
1232
|
-
};
|
|
1233
|
-
/*
|
|
1234
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1235
|
-
* All rights reserved.
|
|
1236
|
-
* SPDX-License-Identifier: MIT
|
|
1237
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1238
|
-
*/
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
@license
|
|
1242
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1243
|
-
This code may only be used under the MIT License found at
|
|
1244
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1245
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1246
|
-
https://github.com/snabbdom/snabbdom/
|
|
1247
|
-
*/
|
|
1248
|
-
|
|
1249
|
-
function isUndef(s) {
|
|
1250
|
-
return s === undefined;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
function sameVnode(vnode1, vnode2) {
|
|
1254
|
-
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
function isVNode(vnode) {
|
|
1258
|
-
return vnode != null;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
|
1262
|
-
var map = {};
|
|
1263
|
-
var j, key, ch; // TODO [#1637]: simplify this by assuming that all vnodes has keys
|
|
1264
|
-
|
|
1265
|
-
for (j = beginIdx; j <= endIdx; ++j) {
|
|
1266
|
-
ch = children[j];
|
|
1267
|
-
|
|
1268
|
-
if (isVNode(ch)) {
|
|
1269
|
-
key = ch.key;
|
|
1270
|
-
|
|
1271
|
-
if (key !== undefined) {
|
|
1272
|
-
map[key] = j;
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
return map;
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
function addVnodes(parentElm, before, vnodes, startIdx, endIdx) {
|
|
1281
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
1282
|
-
var ch = vnodes[startIdx];
|
|
1283
|
-
|
|
1284
|
-
if (isVNode(ch)) {
|
|
1285
|
-
ch.hook.create(ch);
|
|
1286
|
-
ch.hook.insert(ch, parentElm, before);
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
|
|
1292
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
1293
|
-
var ch = vnodes[startIdx]; // text nodes do not have logic associated to them
|
|
1294
|
-
|
|
1295
|
-
if (isVNode(ch)) {
|
|
1296
|
-
ch.hook.remove(ch, parentElm);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
1302
|
-
var oldStartIdx = 0;
|
|
1303
|
-
var newStartIdx = 0;
|
|
1304
|
-
var oldEndIdx = oldCh.length - 1;
|
|
1305
|
-
var oldStartVnode = oldCh[0];
|
|
1306
|
-
var oldEndVnode = oldCh[oldEndIdx];
|
|
1307
|
-
var newChEnd = newCh.length - 1;
|
|
1308
|
-
var newEndIdx = newChEnd;
|
|
1309
|
-
var newStartVnode = newCh[0];
|
|
1310
|
-
var newEndVnode = newCh[newEndIdx];
|
|
1311
|
-
var oldKeyToIdx;
|
|
1312
|
-
var idxInOld;
|
|
1313
|
-
var elmToMove;
|
|
1314
|
-
var before;
|
|
1315
|
-
|
|
1316
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
1317
|
-
if (!isVNode(oldStartVnode)) {
|
|
1318
|
-
oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
|
|
1319
|
-
} else if (!isVNode(oldEndVnode)) {
|
|
1320
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
1321
|
-
} else if (!isVNode(newStartVnode)) {
|
|
1322
|
-
newStartVnode = newCh[++newStartIdx];
|
|
1323
|
-
} else if (!isVNode(newEndVnode)) {
|
|
1324
|
-
newEndVnode = newCh[--newEndIdx];
|
|
1325
|
-
} else if (sameVnode(oldStartVnode, newStartVnode)) {
|
|
1326
|
-
patchVnode(oldStartVnode, newStartVnode);
|
|
1327
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
1328
|
-
newStartVnode = newCh[++newStartIdx];
|
|
1329
|
-
} else if (sameVnode(oldEndVnode, newEndVnode)) {
|
|
1330
|
-
patchVnode(oldEndVnode, newEndVnode);
|
|
1331
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
1332
|
-
newEndVnode = newCh[--newEndIdx];
|
|
1333
|
-
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1334
|
-
// Vnode moved right
|
|
1335
|
-
patchVnode(oldStartVnode, newEndVnode);
|
|
1336
|
-
newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
|
|
1337
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
1338
|
-
newEndVnode = newCh[--newEndIdx];
|
|
1339
|
-
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
1340
|
-
// Vnode moved left
|
|
1341
|
-
patchVnode(oldEndVnode, newStartVnode);
|
|
1342
|
-
newStartVnode.hook.move(oldEndVnode, parentElm, oldStartVnode.elm);
|
|
1343
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
1344
|
-
newStartVnode = newCh[++newStartIdx];
|
|
1345
|
-
} else {
|
|
1346
|
-
if (oldKeyToIdx === undefined) {
|
|
1347
|
-
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
1351
|
-
|
|
1352
|
-
if (isUndef(idxInOld)) {
|
|
1353
|
-
// New element
|
|
1354
|
-
newStartVnode.hook.create(newStartVnode);
|
|
1355
|
-
newStartVnode.hook.insert(newStartVnode, parentElm, oldStartVnode.elm);
|
|
1356
|
-
newStartVnode = newCh[++newStartIdx];
|
|
1357
|
-
} else {
|
|
1358
|
-
elmToMove = oldCh[idxInOld];
|
|
1113
|
+
if (isUndef(idxInOld)) {
|
|
1114
|
+
// New element
|
|
1115
|
+
newStartVnode.hook.create(newStartVnode);
|
|
1116
|
+
newStartVnode.hook.insert(newStartVnode, parentElm, oldStartVnode.elm);
|
|
1117
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1118
|
+
} else {
|
|
1119
|
+
elmToMove = oldCh[idxInOld];
|
|
1359
1120
|
|
|
1360
1121
|
if (isVNode(elmToMove)) {
|
|
1361
1122
|
if (elmToMove.sel !== newStartVnode.sel) {
|
|
@@ -1378,12 +1139,12 @@
|
|
|
1378
1139
|
if (oldStartIdx > oldEndIdx) {
|
|
1379
1140
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
1380
1141
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
1381
|
-
var
|
|
1142
|
+
var _i6 = newEndIdx;
|
|
1382
1143
|
var n;
|
|
1383
1144
|
|
|
1384
1145
|
do {
|
|
1385
|
-
n = newCh[++
|
|
1386
|
-
} while (!isVNode(n) &&
|
|
1146
|
+
n = newCh[++_i6];
|
|
1147
|
+
} while (!isVNode(n) && _i6 < newChEnd);
|
|
1387
1148
|
|
|
1388
1149
|
before = isVNode(n) ? n.elm : null;
|
|
1389
1150
|
addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);
|
|
@@ -1414,9 +1175,9 @@
|
|
|
1414
1175
|
|
|
1415
1176
|
var referenceElm = null;
|
|
1416
1177
|
|
|
1417
|
-
for (var
|
|
1418
|
-
var vnode = newCh[
|
|
1419
|
-
var oldVNode = oldCh[
|
|
1178
|
+
for (var _i7 = newChLength - 1; _i7 >= 0; _i7 -= 1) {
|
|
1179
|
+
var vnode = newCh[_i7];
|
|
1180
|
+
var oldVNode = oldCh[_i7];
|
|
1420
1181
|
|
|
1421
1182
|
if (vnode !== oldVNode) {
|
|
1422
1183
|
if (isVNode(oldVNode)) {
|
|
@@ -1432,21 +1193,140 @@
|
|
|
1432
1193
|
// this condition is unnecessary
|
|
1433
1194
|
vnode.hook.create(vnode); // insert the new node one since the old one is null
|
|
1434
1195
|
|
|
1435
|
-
vnode.hook.insert(vnode, parentElm, referenceElm);
|
|
1436
|
-
referenceElm = vnode.elm;
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1196
|
+
vnode.hook.insert(vnode, parentElm, referenceElm);
|
|
1197
|
+
referenceElm = vnode.elm;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
function patchVnode(oldVnode, vnode) {
|
|
1204
|
+
if (oldVnode !== vnode) {
|
|
1205
|
+
vnode.elm = oldVnode.elm;
|
|
1206
|
+
vnode.hook.update(oldVnode, vnode);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
/*
|
|
1210
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1211
|
+
* All rights reserved.
|
|
1212
|
+
* SPDX-License-Identifier: MIT
|
|
1213
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1214
|
+
*/
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
|
|
1218
|
+
|
|
1219
|
+
function offsetPropertyErrorMessage(name) {
|
|
1220
|
+
return "Using the `".concat(name, "` property is an anti-pattern because it rounds the value to an integer. Instead, use the `getBoundingClientRect` method to obtain fractional values for the size of an element and its position relative to the viewport.");
|
|
1221
|
+
} // Global HTML Attributes & Properties
|
|
1222
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
1223
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
assign(create(null), {
|
|
1227
|
+
accessKey: {
|
|
1228
|
+
attribute: 'accesskey'
|
|
1229
|
+
},
|
|
1230
|
+
accessKeyLabel: {
|
|
1231
|
+
readOnly: true
|
|
1232
|
+
},
|
|
1233
|
+
className: {
|
|
1234
|
+
attribute: 'class',
|
|
1235
|
+
error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
|
|
1236
|
+
},
|
|
1237
|
+
contentEditable: {
|
|
1238
|
+
attribute: 'contenteditable'
|
|
1239
|
+
},
|
|
1240
|
+
dataset: {
|
|
1241
|
+
readOnly: true,
|
|
1242
|
+
error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
|
|
1243
|
+
},
|
|
1244
|
+
dir: {
|
|
1245
|
+
attribute: 'dir'
|
|
1246
|
+
},
|
|
1247
|
+
draggable: {
|
|
1248
|
+
attribute: 'draggable'
|
|
1249
|
+
},
|
|
1250
|
+
dropzone: {
|
|
1251
|
+
attribute: 'dropzone',
|
|
1252
|
+
readOnly: true
|
|
1253
|
+
},
|
|
1254
|
+
hidden: {
|
|
1255
|
+
attribute: 'hidden'
|
|
1256
|
+
},
|
|
1257
|
+
id: {
|
|
1258
|
+
attribute: 'id'
|
|
1259
|
+
},
|
|
1260
|
+
inputMode: {
|
|
1261
|
+
attribute: 'inputmode'
|
|
1262
|
+
},
|
|
1263
|
+
lang: {
|
|
1264
|
+
attribute: 'lang'
|
|
1265
|
+
},
|
|
1266
|
+
slot: {
|
|
1267
|
+
attribute: 'slot',
|
|
1268
|
+
error: 'Using the `slot` property is an anti-pattern.'
|
|
1269
|
+
},
|
|
1270
|
+
spellcheck: {
|
|
1271
|
+
attribute: 'spellcheck'
|
|
1272
|
+
},
|
|
1273
|
+
style: {
|
|
1274
|
+
attribute: 'style'
|
|
1275
|
+
},
|
|
1276
|
+
tabIndex: {
|
|
1277
|
+
attribute: 'tabindex'
|
|
1278
|
+
},
|
|
1279
|
+
title: {
|
|
1280
|
+
attribute: 'title'
|
|
1281
|
+
},
|
|
1282
|
+
translate: {
|
|
1283
|
+
attribute: 'translate'
|
|
1284
|
+
},
|
|
1285
|
+
// additional "global attributes" that are not present in the link above.
|
|
1286
|
+
isContentEditable: {
|
|
1287
|
+
readOnly: true
|
|
1288
|
+
},
|
|
1289
|
+
offsetHeight: {
|
|
1290
|
+
readOnly: true,
|
|
1291
|
+
error: offsetPropertyErrorMessage('offsetHeight')
|
|
1292
|
+
},
|
|
1293
|
+
offsetLeft: {
|
|
1294
|
+
readOnly: true,
|
|
1295
|
+
error: offsetPropertyErrorMessage('offsetLeft')
|
|
1296
|
+
},
|
|
1297
|
+
offsetParent: {
|
|
1298
|
+
readOnly: true
|
|
1299
|
+
},
|
|
1300
|
+
offsetTop: {
|
|
1301
|
+
readOnly: true,
|
|
1302
|
+
error: offsetPropertyErrorMessage('offsetTop')
|
|
1303
|
+
},
|
|
1304
|
+
offsetWidth: {
|
|
1305
|
+
readOnly: true,
|
|
1306
|
+
error: offsetPropertyErrorMessage('offsetWidth')
|
|
1307
|
+
},
|
|
1308
|
+
role: {
|
|
1309
|
+
attribute: 'role'
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
var controlledElement = null;
|
|
1313
|
+
var controlledAttributeName;
|
|
1314
|
+
|
|
1315
|
+
function isAttributeLocked(elm, attrName) {
|
|
1316
|
+
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
function lockAttribute(_elm, _key) {
|
|
1320
|
+
controlledElement = null;
|
|
1321
|
+
controlledAttributeName = undefined;
|
|
1440
1322
|
}
|
|
1441
1323
|
|
|
1442
|
-
function
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
vnode.hook.update(oldVnode, vnode);
|
|
1446
|
-
}
|
|
1324
|
+
function unlockAttribute(elm, key) {
|
|
1325
|
+
controlledElement = elm;
|
|
1326
|
+
controlledAttributeName = key;
|
|
1447
1327
|
}
|
|
1448
1328
|
/*
|
|
1449
|
-
* Copyright (c)
|
|
1329
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1450
1330
|
* All rights reserved.
|
|
1451
1331
|
* SPDX-License-Identifier: MIT
|
|
1452
1332
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2217,8 +2097,7 @@
|
|
|
2217
2097
|
|
|
2218
2098
|
|
|
2219
2099
|
var LightningElement = function LightningElement() {
|
|
2220
|
-
|
|
2221
|
-
|
|
2100
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2222
2101
|
if (isNull(vmBeingConstructed)) {
|
|
2223
2102
|
throw new ReferenceError('Illegal constructor');
|
|
2224
2103
|
}
|
|
@@ -2226,7 +2105,6 @@
|
|
|
2226
2105
|
var vm = vmBeingConstructed;
|
|
2227
2106
|
var def = vm.def,
|
|
2228
2107
|
elm = vm.elm;
|
|
2229
|
-
vm.renderer;
|
|
2230
2108
|
var bridge = def.bridge;
|
|
2231
2109
|
|
|
2232
2110
|
var component = this;
|
|
@@ -2255,21 +2133,20 @@
|
|
|
2255
2133
|
if (vm.renderMode === 1
|
|
2256
2134
|
/* Shadow */
|
|
2257
2135
|
) {
|
|
2258
|
-
|
|
2136
|
+
doAttachShadow(vm);
|
|
2259
2137
|
} // Adding extra guard rails in DEV mode.
|
|
2260
2138
|
|
|
2261
2139
|
return this;
|
|
2262
2140
|
};
|
|
2263
2141
|
|
|
2264
|
-
function
|
|
2265
|
-
var
|
|
2142
|
+
function doAttachShadow(vm) {
|
|
2143
|
+
var _attachShadow$;
|
|
2266
2144
|
|
|
2267
2145
|
var elm = vm.elm,
|
|
2268
2146
|
mode = vm.mode,
|
|
2269
|
-
renderer = vm.renderer,
|
|
2270
2147
|
shadowMode = vm.shadowMode,
|
|
2271
2148
|
ctor = vm.def.ctor;
|
|
2272
|
-
var cmpRoot =
|
|
2149
|
+
var cmpRoot = attachShadow$1(elm, (_attachShadow$ = {}, _defineProperty(_attachShadow$, KEY__SYNTHETIC_MODE, shadowMode === 1), _defineProperty(_attachShadow$, "delegatesFocus", Boolean(ctor.delegatesFocus)), _defineProperty(_attachShadow$, "mode", mode), _attachShadow$));
|
|
2273
2150
|
vm.cmpRoot = cmpRoot;
|
|
2274
2151
|
associateVM(cmpRoot, vm);
|
|
2275
2152
|
}
|
|
@@ -2279,112 +2156,98 @@
|
|
|
2279
2156
|
constructor: LightningElement,
|
|
2280
2157
|
dispatchEvent: function dispatchEvent(event) {
|
|
2281
2158
|
var _getAssociatedVM = getAssociatedVM(this),
|
|
2282
|
-
elm = _getAssociatedVM.elm
|
|
2283
|
-
dispatchEvent = _getAssociatedVM.renderer.dispatchEvent;
|
|
2159
|
+
elm = _getAssociatedVM.elm;
|
|
2284
2160
|
|
|
2285
|
-
return dispatchEvent(elm, event);
|
|
2161
|
+
return dispatchEvent$1(elm, event);
|
|
2286
2162
|
},
|
|
2287
2163
|
addEventListener: function addEventListener(type, listener, options) {
|
|
2288
2164
|
var vm = getAssociatedVM(this);
|
|
2289
|
-
var elm = vm.elm
|
|
2290
|
-
addEventListener = vm.renderer.addEventListener;
|
|
2165
|
+
var elm = vm.elm;
|
|
2291
2166
|
|
|
2292
2167
|
var wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2293
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
2168
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2294
2169
|
},
|
|
2295
2170
|
removeEventListener: function removeEventListener(type, listener, options) {
|
|
2296
2171
|
var vm = getAssociatedVM(this);
|
|
2297
|
-
var elm = vm.elm
|
|
2298
|
-
removeEventListener = vm.renderer.removeEventListener;
|
|
2172
|
+
var elm = vm.elm;
|
|
2299
2173
|
var wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2300
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
2174
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2301
2175
|
},
|
|
2302
2176
|
hasAttribute: function hasAttribute(name) {
|
|
2303
2177
|
var _getAssociatedVM2 = getAssociatedVM(this),
|
|
2304
|
-
elm = _getAssociatedVM2.elm
|
|
2305
|
-
getAttribute = _getAssociatedVM2.renderer.getAttribute;
|
|
2178
|
+
elm = _getAssociatedVM2.elm;
|
|
2306
2179
|
|
|
2307
|
-
return !isNull(getAttribute(elm, name));
|
|
2180
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2308
2181
|
},
|
|
2309
2182
|
hasAttributeNS: function hasAttributeNS(namespace, name) {
|
|
2310
2183
|
var _getAssociatedVM3 = getAssociatedVM(this),
|
|
2311
|
-
elm = _getAssociatedVM3.elm
|
|
2312
|
-
getAttribute = _getAssociatedVM3.renderer.getAttribute;
|
|
2184
|
+
elm = _getAssociatedVM3.elm;
|
|
2313
2185
|
|
|
2314
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
2186
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2315
2187
|
},
|
|
2316
2188
|
removeAttribute: function removeAttribute(name) {
|
|
2317
2189
|
var _getAssociatedVM4 = getAssociatedVM(this),
|
|
2318
|
-
elm = _getAssociatedVM4.elm
|
|
2319
|
-
removeAttribute = _getAssociatedVM4.renderer.removeAttribute;
|
|
2190
|
+
elm = _getAssociatedVM4.elm;
|
|
2320
2191
|
|
|
2321
2192
|
unlockAttribute(elm, name);
|
|
2322
|
-
removeAttribute(elm, name);
|
|
2193
|
+
removeAttribute$1(elm, name);
|
|
2323
2194
|
lockAttribute();
|
|
2324
2195
|
},
|
|
2325
2196
|
removeAttributeNS: function removeAttributeNS(namespace, name) {
|
|
2326
2197
|
var _getAssociatedVM5 = getAssociatedVM(this),
|
|
2327
|
-
elm = _getAssociatedVM5.elm
|
|
2328
|
-
removeAttribute = _getAssociatedVM5.renderer.removeAttribute;
|
|
2198
|
+
elm = _getAssociatedVM5.elm;
|
|
2329
2199
|
|
|
2330
2200
|
unlockAttribute(elm, name);
|
|
2331
|
-
removeAttribute(elm, name, namespace);
|
|
2201
|
+
removeAttribute$1(elm, name, namespace);
|
|
2332
2202
|
lockAttribute();
|
|
2333
2203
|
},
|
|
2334
2204
|
getAttribute: function getAttribute(name) {
|
|
2335
2205
|
var _getAssociatedVM6 = getAssociatedVM(this),
|
|
2336
|
-
elm = _getAssociatedVM6.elm
|
|
2337
|
-
getAttribute = _getAssociatedVM6.renderer.getAttribute;
|
|
2206
|
+
elm = _getAssociatedVM6.elm;
|
|
2338
2207
|
|
|
2339
|
-
return getAttribute(elm, name);
|
|
2208
|
+
return getAttribute$1(elm, name);
|
|
2340
2209
|
},
|
|
2341
2210
|
getAttributeNS: function getAttributeNS(namespace, name) {
|
|
2342
2211
|
var _getAssociatedVM7 = getAssociatedVM(this),
|
|
2343
|
-
elm = _getAssociatedVM7.elm
|
|
2344
|
-
getAttribute = _getAssociatedVM7.renderer.getAttribute;
|
|
2212
|
+
elm = _getAssociatedVM7.elm;
|
|
2345
2213
|
|
|
2346
|
-
return getAttribute(elm, name, namespace);
|
|
2214
|
+
return getAttribute$1(elm, name, namespace);
|
|
2347
2215
|
},
|
|
2348
2216
|
setAttribute: function setAttribute(name, value) {
|
|
2349
2217
|
var vm = getAssociatedVM(this);
|
|
2350
|
-
var elm = vm.elm
|
|
2351
|
-
setAttribute = vm.renderer.setAttribute;
|
|
2218
|
+
var elm = vm.elm;
|
|
2352
2219
|
|
|
2353
2220
|
unlockAttribute(elm, name);
|
|
2354
|
-
setAttribute(elm, name, value);
|
|
2221
|
+
setAttribute$1(elm, name, value);
|
|
2355
2222
|
lockAttribute();
|
|
2356
2223
|
},
|
|
2357
2224
|
setAttributeNS: function setAttributeNS(namespace, name, value) {
|
|
2358
2225
|
var vm = getAssociatedVM(this);
|
|
2359
|
-
var elm = vm.elm
|
|
2360
|
-
setAttribute = vm.renderer.setAttribute;
|
|
2226
|
+
var elm = vm.elm;
|
|
2361
2227
|
|
|
2362
2228
|
unlockAttribute(elm, name);
|
|
2363
|
-
setAttribute(elm, name, value, namespace);
|
|
2229
|
+
setAttribute$1(elm, name, value, namespace);
|
|
2364
2230
|
lockAttribute();
|
|
2365
2231
|
},
|
|
2366
2232
|
getBoundingClientRect: function getBoundingClientRect() {
|
|
2367
2233
|
var vm = getAssociatedVM(this);
|
|
2368
|
-
var elm = vm.elm
|
|
2369
|
-
getBoundingClientRect = vm.renderer.getBoundingClientRect;
|
|
2234
|
+
var elm = vm.elm;
|
|
2370
2235
|
|
|
2371
|
-
return getBoundingClientRect(elm);
|
|
2236
|
+
return getBoundingClientRect$1(elm);
|
|
2372
2237
|
},
|
|
2373
2238
|
|
|
2374
2239
|
get isConnected() {
|
|
2375
2240
|
var _getAssociatedVM8 = getAssociatedVM(this),
|
|
2376
|
-
elm = _getAssociatedVM8.elm
|
|
2377
|
-
isConnected = _getAssociatedVM8.renderer.isConnected;
|
|
2241
|
+
elm = _getAssociatedVM8.elm;
|
|
2378
2242
|
|
|
2379
|
-
return isConnected(elm);
|
|
2243
|
+
return isConnected$1(elm);
|
|
2380
2244
|
},
|
|
2381
2245
|
|
|
2382
2246
|
get classList() {
|
|
2383
2247
|
var vm = getAssociatedVM(this);
|
|
2384
|
-
var elm = vm.elm
|
|
2385
|
-
getClassList = vm.renderer.getClassList;
|
|
2248
|
+
var elm = vm.elm;
|
|
2386
2249
|
|
|
2387
|
-
return getClassList(elm);
|
|
2250
|
+
return getClassList$1(elm);
|
|
2388
2251
|
},
|
|
2389
2252
|
|
|
2390
2253
|
get template() {
|
|
@@ -2408,42 +2271,80 @@
|
|
|
2408
2271
|
return "[object ".concat(vm.def.name, "]");
|
|
2409
2272
|
}
|
|
2410
2273
|
};
|
|
2411
|
-
var queryAndChildGetterDescriptors = create(null);
|
|
2412
|
-
|
|
2274
|
+
var queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
2275
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
2276
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
2413
2277
|
|
|
2414
|
-
var
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2278
|
+
var childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
2279
|
+
|
|
2280
|
+
function getChildGetter(methodName) {
|
|
2281
|
+
switch (methodName) {
|
|
2282
|
+
case 'children':
|
|
2283
|
+
return getChildren$1;
|
|
2284
|
+
|
|
2285
|
+
case 'childNodes':
|
|
2286
|
+
return getChildNodes$1;
|
|
2418
2287
|
|
|
2419
|
-
|
|
2288
|
+
case 'firstChild':
|
|
2289
|
+
return getFirstChild$1;
|
|
2290
|
+
|
|
2291
|
+
case 'firstElementChild':
|
|
2292
|
+
return getFirstElementChild$1;
|
|
2293
|
+
|
|
2294
|
+
case 'lastChild':
|
|
2295
|
+
return getLastChild$1;
|
|
2296
|
+
|
|
2297
|
+
case 'lastElementChild':
|
|
2298
|
+
return getLastElementChild$1;
|
|
2299
|
+
}
|
|
2300
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
var _loop = function _loop() {
|
|
2304
|
+
var childGetter = _childGetters[_i8];
|
|
2305
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
2420
2306
|
get: function get() {
|
|
2421
2307
|
var vm = getAssociatedVM(this);
|
|
2422
|
-
var elm = vm.elm
|
|
2423
|
-
renderer = vm.renderer;
|
|
2308
|
+
var elm = vm.elm;
|
|
2424
2309
|
|
|
2425
|
-
return
|
|
2310
|
+
return getChildGetter(childGetter)(elm);
|
|
2426
2311
|
},
|
|
2427
2312
|
configurable: true,
|
|
2428
2313
|
enumerable: true
|
|
2429
2314
|
};
|
|
2430
2315
|
};
|
|
2431
2316
|
|
|
2432
|
-
for (var
|
|
2317
|
+
for (var _i8 = 0, _childGetters = childGetters; _i8 < _childGetters.length; _i8++) {
|
|
2433
2318
|
_loop();
|
|
2434
2319
|
}
|
|
2435
2320
|
|
|
2436
|
-
var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2321
|
+
var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2322
|
+
|
|
2323
|
+
function getQueryMethod(methodName) {
|
|
2324
|
+
switch (methodName) {
|
|
2325
|
+
case 'getElementsByClassName':
|
|
2326
|
+
return getElementsByClassName$1;
|
|
2327
|
+
|
|
2328
|
+
case 'getElementsByTagName':
|
|
2329
|
+
return getElementsByTagName$1;
|
|
2330
|
+
|
|
2331
|
+
case 'querySelector':
|
|
2332
|
+
return querySelector$1;
|
|
2333
|
+
|
|
2334
|
+
case 'querySelectorAll':
|
|
2335
|
+
return querySelectorAll$1;
|
|
2336
|
+
}
|
|
2337
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
2338
|
+
|
|
2437
2339
|
|
|
2438
2340
|
var _loop2 = function _loop2() {
|
|
2439
|
-
var queryMethod = _queryMethods[
|
|
2341
|
+
var queryMethod = _queryMethods[_i9];
|
|
2440
2342
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
2441
2343
|
value: function value(arg) {
|
|
2442
2344
|
var vm = getAssociatedVM(this);
|
|
2443
|
-
var elm = vm.elm
|
|
2444
|
-
renderer = vm.renderer;
|
|
2345
|
+
var elm = vm.elm;
|
|
2445
2346
|
|
|
2446
|
-
return
|
|
2347
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
2447
2348
|
},
|
|
2448
2349
|
configurable: true,
|
|
2449
2350
|
enumerable: true,
|
|
@@ -2451,7 +2352,7 @@
|
|
|
2451
2352
|
};
|
|
2452
2353
|
};
|
|
2453
2354
|
|
|
2454
|
-
for (var
|
|
2355
|
+
for (var _i9 = 0, _queryMethods = queryMethods; _i9 < _queryMethods.length; _i9++) {
|
|
2455
2356
|
_loop2();
|
|
2456
2357
|
}
|
|
2457
2358
|
|
|
@@ -2812,8 +2713,8 @@
|
|
|
2812
2713
|
}
|
|
2813
2714
|
|
|
2814
2715
|
if (!isUndefined$1(fields)) {
|
|
2815
|
-
for (var
|
|
2816
|
-
var _fieldName2 = fields[
|
|
2716
|
+
for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
|
|
2717
|
+
var _fieldName2 = fields[_i10];
|
|
2817
2718
|
descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
|
|
2818
2719
|
// tracked property. This is only here for backward compatibility purposes.
|
|
2819
2720
|
|
|
@@ -3030,8 +2931,8 @@
|
|
|
3030
2931
|
superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
|
|
3031
2932
|
var descriptors = create(null); // expose getters and setters for each public props on the new Element Bridge
|
|
3032
2933
|
|
|
3033
|
-
for (var
|
|
3034
|
-
var _propName2 = props[
|
|
2934
|
+
for (var _i11 = 0, _len3 = props.length; _i11 < _len3; _i11 += 1) {
|
|
2935
|
+
var _propName2 = props[_i11];
|
|
3035
2936
|
attributeToPropMap[htmlPropertyToAttribute(_propName2)] = _propName2;
|
|
3036
2937
|
descriptors[_propName2] = {
|
|
3037
2938
|
get: createGetter(_propName2),
|
|
@@ -3042,8 +2943,8 @@
|
|
|
3042
2943
|
} // expose public methods as props on the new Element Bridge
|
|
3043
2944
|
|
|
3044
2945
|
|
|
3045
|
-
for (var
|
|
3046
|
-
var methodName = methods[
|
|
2946
|
+
for (var _i12 = 0, _len4 = methods.length; _i12 < _len4; _i12 += 1) {
|
|
2947
|
+
var methodName = methods[_i12];
|
|
3047
2948
|
descriptors[methodName] = {
|
|
3048
2949
|
value: createMethodCaller(methodName),
|
|
3049
2950
|
writable: true,
|
|
@@ -3341,12 +3242,272 @@
|
|
|
3341
3242
|
publicMethods[_key2] = methods[_key2].value;
|
|
3342
3243
|
}
|
|
3343
3244
|
|
|
3344
|
-
return {
|
|
3345
|
-
ctor: ctor,
|
|
3346
|
-
name: name,
|
|
3347
|
-
props: publicProps,
|
|
3348
|
-
methods: publicMethods
|
|
3349
|
-
};
|
|
3245
|
+
return {
|
|
3246
|
+
ctor: ctor,
|
|
3247
|
+
name: name,
|
|
3248
|
+
props: publicProps,
|
|
3249
|
+
methods: publicMethods
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
/*
|
|
3253
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3254
|
+
* All rights reserved.
|
|
3255
|
+
* SPDX-License-Identifier: MIT
|
|
3256
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3257
|
+
*/
|
|
3258
|
+
|
|
3259
|
+
|
|
3260
|
+
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
3261
|
+
var xmlNS = 'http://www.w3.org/XML/1998/namespace';
|
|
3262
|
+
var ColonCharCode = 58;
|
|
3263
|
+
|
|
3264
|
+
function patchAttributes(oldVnode, vnode) {
|
|
3265
|
+
var attrs = vnode.data.attrs;
|
|
3266
|
+
|
|
3267
|
+
if (isUndefined$1(attrs)) {
|
|
3268
|
+
return;
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
var oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
|
|
3272
|
+
|
|
3273
|
+
if (oldAttrs === attrs) {
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
var elm = vnode.elm;
|
|
3278
|
+
|
|
3279
|
+
for (var key in attrs) {
|
|
3280
|
+
var cur = attrs[key];
|
|
3281
|
+
var old = oldAttrs[key];
|
|
3282
|
+
|
|
3283
|
+
if (old !== cur) {
|
|
3284
|
+
unlockAttribute(elm, key);
|
|
3285
|
+
|
|
3286
|
+
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
3287
|
+
// Assume xml namespace
|
|
3288
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
3289
|
+
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
3290
|
+
// Assume xlink namespace
|
|
3291
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
3292
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
3293
|
+
removeAttribute$1(elm, key);
|
|
3294
|
+
} else {
|
|
3295
|
+
setAttribute$1(elm, key, cur);
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
lockAttribute();
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
/*
|
|
3303
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3304
|
+
* All rights reserved.
|
|
3305
|
+
* SPDX-License-Identifier: MIT
|
|
3306
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3307
|
+
*/
|
|
3308
|
+
|
|
3309
|
+
|
|
3310
|
+
function isLiveBindingProp(sel, key) {
|
|
3311
|
+
// For properties with live bindings, we read values from the DOM element
|
|
3312
|
+
// instead of relying on internally tracked values.
|
|
3313
|
+
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
function patchProps(oldVnode, vnode) {
|
|
3317
|
+
var props = vnode.data.props;
|
|
3318
|
+
|
|
3319
|
+
if (isUndefined$1(props)) {
|
|
3320
|
+
return;
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
var oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
|
|
3324
|
+
|
|
3325
|
+
if (oldProps === props) {
|
|
3326
|
+
return;
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
var isFirstPatch = isNull(oldVnode);
|
|
3330
|
+
var elm = vnode.elm,
|
|
3331
|
+
sel = vnode.sel;
|
|
3332
|
+
|
|
3333
|
+
for (var key in props) {
|
|
3334
|
+
var cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
|
|
3335
|
+
// different than the one previously set.
|
|
3336
|
+
|
|
3337
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
3338
|
+
setProperty$1(elm, key, cur);
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
/*
|
|
3343
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3344
|
+
* All rights reserved.
|
|
3345
|
+
* SPDX-License-Identifier: MIT
|
|
3346
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3347
|
+
*/
|
|
3348
|
+
|
|
3349
|
+
|
|
3350
|
+
var classNameToClassMap = create(null);
|
|
3351
|
+
|
|
3352
|
+
function getMapFromClassName(className) {
|
|
3353
|
+
// Intentionally using == to match undefined and null values from computed style attribute
|
|
3354
|
+
if (className == null) {
|
|
3355
|
+
return EmptyObject;
|
|
3356
|
+
} // computed class names must be string
|
|
3357
|
+
|
|
3358
|
+
|
|
3359
|
+
className = isString(className) ? className : className + '';
|
|
3360
|
+
var map = classNameToClassMap[className];
|
|
3361
|
+
|
|
3362
|
+
if (map) {
|
|
3363
|
+
return map;
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
map = create(null);
|
|
3367
|
+
var start = 0;
|
|
3368
|
+
var o;
|
|
3369
|
+
var len = className.length;
|
|
3370
|
+
|
|
3371
|
+
for (o = 0; o < len; o++) {
|
|
3372
|
+
if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
|
|
3373
|
+
if (o > start) {
|
|
3374
|
+
map[StringSlice.call(className, start, o)] = true;
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
start = o + 1;
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
if (o > start) {
|
|
3382
|
+
map[StringSlice.call(className, start, o)] = true;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
classNameToClassMap[className] = map;
|
|
3386
|
+
|
|
3387
|
+
return map;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
function patchClassAttribute(oldVnode, vnode) {
|
|
3391
|
+
var elm = vnode.elm,
|
|
3392
|
+
newClass = vnode.data.className;
|
|
3393
|
+
var oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
|
|
3394
|
+
|
|
3395
|
+
if (oldClass === newClass) {
|
|
3396
|
+
return;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
var classList = getClassList$1(elm);
|
|
3400
|
+
var newClassMap = getMapFromClassName(newClass);
|
|
3401
|
+
var oldClassMap = getMapFromClassName(oldClass);
|
|
3402
|
+
var name;
|
|
3403
|
+
|
|
3404
|
+
for (name in oldClassMap) {
|
|
3405
|
+
// remove only if it is not in the new class collection and it is not set from within the instance
|
|
3406
|
+
if (isUndefined$1(newClassMap[name])) {
|
|
3407
|
+
classList.remove(name);
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
for (name in newClassMap) {
|
|
3412
|
+
if (isUndefined$1(oldClassMap[name])) {
|
|
3413
|
+
classList.add(name);
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
/*
|
|
3418
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3419
|
+
* All rights reserved.
|
|
3420
|
+
* SPDX-License-Identifier: MIT
|
|
3421
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3422
|
+
*/
|
|
3423
|
+
|
|
3424
|
+
|
|
3425
|
+
function patchStyleAttribute(oldVnode, vnode) {
|
|
3426
|
+
var elm = vnode.elm,
|
|
3427
|
+
newStyle = vnode.data.style;
|
|
3428
|
+
var oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
|
|
3429
|
+
|
|
3430
|
+
if (oldStyle === newStyle) {
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
if (!isString(newStyle) || newStyle === '') {
|
|
3435
|
+
removeAttribute$1(elm, 'style');
|
|
3436
|
+
} else {
|
|
3437
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
/*
|
|
3441
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3442
|
+
* All rights reserved.
|
|
3443
|
+
* SPDX-License-Identifier: MIT
|
|
3444
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3445
|
+
*/
|
|
3446
|
+
|
|
3447
|
+
|
|
3448
|
+
function applyEventListeners(vnode) {
|
|
3449
|
+
var elm = vnode.elm,
|
|
3450
|
+
on = vnode.data.on;
|
|
3451
|
+
|
|
3452
|
+
if (isUndefined$1(on)) {
|
|
3453
|
+
return;
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
for (var name in on) {
|
|
3457
|
+
var handler = on[name];
|
|
3458
|
+
addEventListener$1(elm, name, handler);
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
/*
|
|
3462
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3463
|
+
* All rights reserved.
|
|
3464
|
+
* SPDX-License-Identifier: MIT
|
|
3465
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3466
|
+
*/
|
|
3467
|
+
// The compiler takes care of transforming the inline classnames into an object. It's faster to set the
|
|
3468
|
+
// different classnames properties individually instead of via a string.
|
|
3469
|
+
|
|
3470
|
+
|
|
3471
|
+
function applyStaticClassAttribute(vnode) {
|
|
3472
|
+
var elm = vnode.elm,
|
|
3473
|
+
classMap = vnode.data.classMap;
|
|
3474
|
+
|
|
3475
|
+
if (isUndefined$1(classMap)) {
|
|
3476
|
+
return;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
var classList = getClassList$1(elm);
|
|
3480
|
+
|
|
3481
|
+
for (var name in classMap) {
|
|
3482
|
+
classList.add(name);
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
/*
|
|
3486
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3487
|
+
* All rights reserved.
|
|
3488
|
+
* SPDX-License-Identifier: MIT
|
|
3489
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3490
|
+
*/
|
|
3491
|
+
// The compiler takes care of transforming the inline style into an object. It's faster to set the
|
|
3492
|
+
// different style properties individually instead of via a string.
|
|
3493
|
+
|
|
3494
|
+
|
|
3495
|
+
function applyStaticStyleAttribute(vnode) {
|
|
3496
|
+
var elm = vnode.elm,
|
|
3497
|
+
styleDecls = vnode.data.styleDecls;
|
|
3498
|
+
|
|
3499
|
+
if (isUndefined$1(styleDecls)) {
|
|
3500
|
+
return;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
for (var _i13 = 0; _i13 < styleDecls.length; _i13++) {
|
|
3504
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i13], 3),
|
|
3505
|
+
prop = _styleDecls$_i[0],
|
|
3506
|
+
value = _styleDecls$_i[1],
|
|
3507
|
+
important = _styleDecls$_i[2];
|
|
3508
|
+
|
|
3509
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
3510
|
+
}
|
|
3350
3511
|
}
|
|
3351
3512
|
/*
|
|
3352
3513
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3371,55 +3532,48 @@
|
|
|
3371
3532
|
var token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
3372
3533
|
|
|
3373
3534
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
3374
|
-
|
|
3535
|
+
getClassList$1(elm).add(token);
|
|
3375
3536
|
}
|
|
3376
3537
|
}
|
|
3377
3538
|
|
|
3378
3539
|
function updateNodeHook(oldVnode, vnode) {
|
|
3379
3540
|
var elm = vnode.elm,
|
|
3380
|
-
text = vnode.text
|
|
3381
|
-
renderer = vnode.owner.renderer;
|
|
3541
|
+
text = vnode.text;
|
|
3382
3542
|
|
|
3383
3543
|
if (oldVnode.text !== text) {
|
|
3384
3544
|
|
|
3385
|
-
|
|
3545
|
+
setText$1(elm, text);
|
|
3386
3546
|
}
|
|
3387
3547
|
}
|
|
3388
3548
|
|
|
3389
3549
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
3390
|
-
var renderer = vnode.owner.renderer;
|
|
3391
3550
|
|
|
3392
|
-
|
|
3551
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
3393
3552
|
}
|
|
3394
3553
|
|
|
3395
3554
|
function removeNodeHook(vnode, parentNode) {
|
|
3396
|
-
var renderer = vnode.owner.renderer;
|
|
3397
3555
|
|
|
3398
|
-
|
|
3556
|
+
remove$1(vnode.elm, parentNode);
|
|
3399
3557
|
}
|
|
3400
3558
|
|
|
3401
|
-
function
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3559
|
+
function patchElementPropsAndAttrs(oldVnode, vnode) {
|
|
3560
|
+
if (isNull(oldVnode)) {
|
|
3561
|
+
applyEventListeners(vnode);
|
|
3562
|
+
applyStaticClassAttribute(vnode);
|
|
3563
|
+
applyStaticStyleAttribute(vnode);
|
|
3564
|
+
} // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
|
|
3565
|
+
// value is set before type=radio.
|
|
3566
|
+
|
|
3405
3567
|
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
modComputedClassName.create(vnode);
|
|
3411
|
-
modComputedStyle.create(vnode);
|
|
3568
|
+
patchClassAttribute(oldVnode, vnode);
|
|
3569
|
+
patchStyleAttribute(oldVnode, vnode);
|
|
3570
|
+
patchAttributes(oldVnode, vnode);
|
|
3571
|
+
patchProps(oldVnode, vnode);
|
|
3412
3572
|
}
|
|
3413
3573
|
|
|
3414
3574
|
function hydrateElmHook(vnode) {
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
modProps.create(vnode); // Already set.
|
|
3419
|
-
// modStaticClassName.create(vnode);
|
|
3420
|
-
// modStaticStyle.create(vnode);
|
|
3421
|
-
// modComputedClassName.create(vnode);
|
|
3422
|
-
// modComputedStyle.create(vnode);
|
|
3575
|
+
applyEventListeners(vnode);
|
|
3576
|
+
patchProps(null, vnode);
|
|
3423
3577
|
}
|
|
3424
3578
|
|
|
3425
3579
|
function fallbackElmHook(elm, vnode) {
|
|
@@ -3445,24 +3599,11 @@
|
|
|
3445
3599
|
}
|
|
3446
3600
|
}
|
|
3447
3601
|
|
|
3448
|
-
function
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
// is set before type=radio.
|
|
3452
|
-
modAttrs.update(oldVnode, vnode);
|
|
3453
|
-
modProps.update(oldVnode, vnode);
|
|
3454
|
-
modComputedClassName.update(oldVnode, vnode);
|
|
3455
|
-
modComputedStyle.update(oldVnode, vnode);
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
function updateChildrenHook(oldVnode, vnode) {
|
|
3459
|
-
var elm = vnode.elm,
|
|
3460
|
-
children = vnode.children;
|
|
3461
|
-
|
|
3462
|
-
if (hasDynamicChildren(children)) {
|
|
3463
|
-
updateDynamicChildren(elm, oldVnode.children, children);
|
|
3602
|
+
function patchChildren(parent, oldCh, newCh) {
|
|
3603
|
+
if (hasDynamicChildren(newCh)) {
|
|
3604
|
+
updateDynamicChildren(parent, oldCh, newCh);
|
|
3464
3605
|
} else {
|
|
3465
|
-
updateStaticChildren(
|
|
3606
|
+
updateStaticChildren(parent, oldCh, newCh);
|
|
3466
3607
|
}
|
|
3467
3608
|
}
|
|
3468
3609
|
|
|
@@ -3523,24 +3664,10 @@
|
|
|
3523
3664
|
createVM(elm, def, {
|
|
3524
3665
|
mode: mode,
|
|
3525
3666
|
owner: owner,
|
|
3526
|
-
tagName: sel
|
|
3527
|
-
renderer: owner.renderer
|
|
3667
|
+
tagName: sel
|
|
3528
3668
|
});
|
|
3529
3669
|
}
|
|
3530
3670
|
|
|
3531
|
-
function createCustomElmHook(vnode) {
|
|
3532
|
-
modEvents.create(vnode); // Attrs need to be applied to element before props
|
|
3533
|
-
// IE11 will wipe out value on radio inputs if value
|
|
3534
|
-
// is set before type=radio.
|
|
3535
|
-
|
|
3536
|
-
modAttrs.create(vnode);
|
|
3537
|
-
modProps.create(vnode);
|
|
3538
|
-
modStaticClassName.create(vnode);
|
|
3539
|
-
modStaticStyle.create(vnode);
|
|
3540
|
-
modComputedClassName.create(vnode);
|
|
3541
|
-
modComputedStyle.create(vnode);
|
|
3542
|
-
}
|
|
3543
|
-
|
|
3544
3671
|
function createChildrenHook(vnode) {
|
|
3545
3672
|
var elm = vnode.elm,
|
|
3546
3673
|
children = vnode.children;
|
|
@@ -3571,16 +3698,6 @@
|
|
|
3571
3698
|
}
|
|
3572
3699
|
}
|
|
3573
3700
|
|
|
3574
|
-
function updateCustomElmHook(oldVnode, vnode) {
|
|
3575
|
-
// Attrs need to be applied to element before props
|
|
3576
|
-
// IE11 will wipe out value on radio inputs if value
|
|
3577
|
-
// is set before type=radio.
|
|
3578
|
-
modAttrs.update(oldVnode, vnode);
|
|
3579
|
-
modProps.update(oldVnode, vnode);
|
|
3580
|
-
modComputedClassName.update(oldVnode, vnode);
|
|
3581
|
-
modComputedStyle.update(oldVnode, vnode);
|
|
3582
|
-
}
|
|
3583
|
-
|
|
3584
3701
|
function removeElmHook(vnode) {
|
|
3585
3702
|
// this method only needs to search on child vnodes from template
|
|
3586
3703
|
// to trigger the remove hook just in case some of those children
|
|
@@ -3595,6 +3712,62 @@
|
|
|
3595
3712
|
ch.hook.remove(ch, elm);
|
|
3596
3713
|
}
|
|
3597
3714
|
}
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
function allocateInSlot(vm, children) {
|
|
3718
|
+
var oldSlots = vm.cmpSlots;
|
|
3719
|
+
var cmpSlots = vm.cmpSlots = create(null);
|
|
3720
|
+
|
|
3721
|
+
for (var _i16 = 0, _len6 = children.length; _i16 < _len6; _i16 += 1) {
|
|
3722
|
+
var vnode = children[_i16];
|
|
3723
|
+
|
|
3724
|
+
if (isNull(vnode)) {
|
|
3725
|
+
continue;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
var data = vnode.data;
|
|
3729
|
+
var slotName = data.attrs && data.attrs.slot || '';
|
|
3730
|
+
var vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
|
|
3731
|
+
// which might have similar keys. Each vnode will always have a key that
|
|
3732
|
+
// starts with a numeric character from compiler. In this case, we add a unique
|
|
3733
|
+
// notation for slotted vnodes keys, e.g.: `@foo:1:1`
|
|
3734
|
+
|
|
3735
|
+
if (!isUndefined$1(vnode.key)) {
|
|
3736
|
+
vnode.key = "@".concat(slotName, ":").concat(vnode.key);
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
ArrayPush$1.call(vnodes, vnode);
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
if (isFalse(vm.isDirty)) {
|
|
3743
|
+
// We need to determine if the old allocation is really different from the new one
|
|
3744
|
+
// and mark the vm as dirty
|
|
3745
|
+
var oldKeys = keys(oldSlots);
|
|
3746
|
+
|
|
3747
|
+
if (oldKeys.length !== keys(cmpSlots).length) {
|
|
3748
|
+
markComponentAsDirty(vm);
|
|
3749
|
+
return;
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
for (var _i17 = 0, _len7 = oldKeys.length; _i17 < _len7; _i17 += 1) {
|
|
3753
|
+
var key = oldKeys[_i17];
|
|
3754
|
+
|
|
3755
|
+
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
3756
|
+
markComponentAsDirty(vm);
|
|
3757
|
+
return;
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
var oldVNodes = oldSlots[key];
|
|
3761
|
+
var _vnodes = cmpSlots[key];
|
|
3762
|
+
|
|
3763
|
+
for (var j = 0, a = cmpSlots[key].length; j < a; j += 1) {
|
|
3764
|
+
if (oldVNodes[j] !== _vnodes[j]) {
|
|
3765
|
+
markComponentAsDirty(vm);
|
|
3766
|
+
return;
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3598
3771
|
} // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
|
|
3599
3772
|
|
|
3600
3773
|
|
|
@@ -3616,12 +3789,12 @@
|
|
|
3616
3789
|
*/
|
|
3617
3790
|
|
|
3618
3791
|
|
|
3619
|
-
function getUpgradableConstructor(tagName
|
|
3792
|
+
function getUpgradableConstructor(tagName) {
|
|
3620
3793
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
3621
3794
|
// produce only tags with lowercase letters
|
|
3622
3795
|
// But, for backwards compatibility, we will lower case the tagName
|
|
3623
3796
|
tagName = tagName.toLowerCase();
|
|
3624
|
-
var CE =
|
|
3797
|
+
var CE = getCustomElement$1(tagName);
|
|
3625
3798
|
|
|
3626
3799
|
if (!isUndefined$1(CE)) {
|
|
3627
3800
|
return CE;
|
|
@@ -3632,8 +3805,8 @@
|
|
|
3632
3805
|
*/
|
|
3633
3806
|
|
|
3634
3807
|
|
|
3635
|
-
CE = /*#__PURE__*/function (
|
|
3636
|
-
_inherits(LWCUpgradableElement,
|
|
3808
|
+
CE = /*#__PURE__*/function (_HTMLElementExported$) {
|
|
3809
|
+
_inherits(LWCUpgradableElement, _HTMLElementExported$);
|
|
3637
3810
|
|
|
3638
3811
|
var _super5 = _createSuper(LWCUpgradableElement);
|
|
3639
3812
|
|
|
@@ -3652,9 +3825,9 @@
|
|
|
3652
3825
|
}
|
|
3653
3826
|
|
|
3654
3827
|
return _createClass(LWCUpgradableElement);
|
|
3655
|
-
}(
|
|
3828
|
+
}(HTMLElementExported$1);
|
|
3656
3829
|
|
|
3657
|
-
|
|
3830
|
+
defineCustomElement$1(tagName, CE);
|
|
3658
3831
|
return CE;
|
|
3659
3832
|
}
|
|
3660
3833
|
/*
|
|
@@ -3670,8 +3843,7 @@
|
|
|
3670
3843
|
var TextHook = {
|
|
3671
3844
|
create: function create(vnode) {
|
|
3672
3845
|
var owner = vnode.owner;
|
|
3673
|
-
var
|
|
3674
|
-
var elm = renderer.createText(vnode.text);
|
|
3846
|
+
var elm = createText$1(vnode.text);
|
|
3675
3847
|
linkNodeToShadow(elm, owner);
|
|
3676
3848
|
vnode.elm = elm;
|
|
3677
3849
|
},
|
|
@@ -3691,8 +3863,7 @@
|
|
|
3691
3863
|
create: function create(vnode) {
|
|
3692
3864
|
var owner = vnode.owner,
|
|
3693
3865
|
text = vnode.text;
|
|
3694
|
-
var
|
|
3695
|
-
var elm = renderer.createComment(text);
|
|
3866
|
+
var elm = createComment$1(text);
|
|
3696
3867
|
linkNodeToShadow(elm, owner);
|
|
3697
3868
|
vnode.elm = elm;
|
|
3698
3869
|
},
|
|
@@ -3718,17 +3889,16 @@
|
|
|
3718
3889
|
var sel = vnode.sel,
|
|
3719
3890
|
owner = vnode.owner,
|
|
3720
3891
|
svg = vnode.data.svg;
|
|
3721
|
-
var renderer = owner.renderer;
|
|
3722
3892
|
var namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3723
|
-
var elm =
|
|
3893
|
+
var elm = createElement$2(sel, namespace);
|
|
3724
3894
|
linkNodeToShadow(elm, owner);
|
|
3725
3895
|
fallbackElmHook(elm, vnode);
|
|
3726
3896
|
vnode.elm = elm;
|
|
3727
|
-
|
|
3897
|
+
patchElementPropsAndAttrs(null, vnode);
|
|
3728
3898
|
},
|
|
3729
3899
|
update: function update(oldVnode, vnode) {
|
|
3730
|
-
|
|
3731
|
-
|
|
3900
|
+
patchElementPropsAndAttrs(oldVnode, vnode);
|
|
3901
|
+
patchChildren(vnode.elm, oldVnode.children, vnode.children);
|
|
3732
3902
|
},
|
|
3733
3903
|
insert: function insert(vnode, parentNode, referenceNode) {
|
|
3734
3904
|
insertNodeHook(vnode, parentNode, referenceNode);
|
|
@@ -3774,8 +3944,7 @@
|
|
|
3774
3944
|
create: function create(vnode) {
|
|
3775
3945
|
var sel = vnode.sel,
|
|
3776
3946
|
owner = vnode.owner;
|
|
3777
|
-
var
|
|
3778
|
-
var UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
3947
|
+
var UpgradableConstructor = getUpgradableConstructor(sel);
|
|
3779
3948
|
/**
|
|
3780
3949
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
3781
3950
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -3797,10 +3966,10 @@
|
|
|
3797
3966
|
throw new TypeError("Incorrect Component Constructor");
|
|
3798
3967
|
}
|
|
3799
3968
|
|
|
3800
|
-
|
|
3969
|
+
patchElementPropsAndAttrs(null, vnode);
|
|
3801
3970
|
},
|
|
3802
3971
|
update: function update(oldVnode, vnode) {
|
|
3803
|
-
|
|
3972
|
+
patchElementPropsAndAttrs(oldVnode, vnode);
|
|
3804
3973
|
var vm = getAssociatedVMIfPresent(vnode.elm);
|
|
3805
3974
|
|
|
3806
3975
|
if (vm) {
|
|
@@ -3811,7 +3980,7 @@
|
|
|
3811
3980
|
// will happen, but in native, it does allocate the light dom
|
|
3812
3981
|
|
|
3813
3982
|
|
|
3814
|
-
|
|
3983
|
+
patchChildren(vnode.elm, oldVnode.children, vnode.children);
|
|
3815
3984
|
|
|
3816
3985
|
if (vm) {
|
|
3817
3986
|
// this is important to preserve the top to bottom synchronous rendering phase.
|
|
@@ -3858,8 +4027,7 @@
|
|
|
3858
4027
|
createVM(elm, def, {
|
|
3859
4028
|
mode: mode,
|
|
3860
4029
|
owner: owner,
|
|
3861
|
-
tagName: sel
|
|
3862
|
-
renderer: owner.renderer
|
|
4030
|
+
tagName: sel
|
|
3863
4031
|
});
|
|
3864
4032
|
vnode.elm = elm;
|
|
3865
4033
|
var vm = getAssociatedVM(elm);
|
|
@@ -3881,11 +4049,10 @@
|
|
|
3881
4049
|
};
|
|
3882
4050
|
|
|
3883
4051
|
function linkNodeToShadow(elm, owner) {
|
|
3884
|
-
var
|
|
3885
|
-
renderMode = owner.renderMode,
|
|
4052
|
+
var renderMode = owner.renderMode,
|
|
3886
4053
|
shadowMode = owner.shadowMode; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
3887
4054
|
|
|
3888
|
-
if (
|
|
4055
|
+
if (isSyntheticShadowDefined$1) {
|
|
3889
4056
|
if (shadowMode === 1
|
|
3890
4057
|
/* Synthetic */
|
|
3891
4058
|
|| renderMode === 0
|
|
@@ -4284,7 +4451,6 @@
|
|
|
4284
4451
|
function updateStylesheetToken(vm, template) {
|
|
4285
4452
|
var elm = vm.elm,
|
|
4286
4453
|
context = vm.context,
|
|
4287
|
-
renderer = vm.renderer,
|
|
4288
4454
|
renderMode = vm.renderMode,
|
|
4289
4455
|
shadowMode = vm.shadowMode;
|
|
4290
4456
|
var newStylesheets = template.stylesheets,
|
|
@@ -4304,11 +4470,11 @@
|
|
|
4304
4470
|
oldHasTokenInAttribute = context.hasTokenInAttribute;
|
|
4305
4471
|
|
|
4306
4472
|
if (oldHasTokenInClass) {
|
|
4307
|
-
|
|
4473
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
4308
4474
|
}
|
|
4309
4475
|
|
|
4310
4476
|
if (oldHasTokenInAttribute) {
|
|
4311
|
-
|
|
4477
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
4312
4478
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
4313
4479
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
4314
4480
|
|
|
@@ -4320,12 +4486,12 @@
|
|
|
4320
4486
|
|
|
4321
4487
|
if (!isUndefined$1(newToken)) {
|
|
4322
4488
|
if (hasScopedStyles) {
|
|
4323
|
-
|
|
4489
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
4324
4490
|
newHasTokenInClass = true;
|
|
4325
4491
|
}
|
|
4326
4492
|
|
|
4327
4493
|
if (isSyntheticShadow) {
|
|
4328
|
-
|
|
4494
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
4329
4495
|
newHasTokenInAttribute = true;
|
|
4330
4496
|
}
|
|
4331
4497
|
} // Update the styling tokens present on the context object.
|
|
@@ -4340,8 +4506,8 @@
|
|
|
4340
4506
|
var content = [];
|
|
4341
4507
|
var root;
|
|
4342
4508
|
|
|
4343
|
-
for (var
|
|
4344
|
-
var stylesheet = stylesheets[
|
|
4509
|
+
for (var _i18 = 0; _i18 < stylesheets.length; _i18++) {
|
|
4510
|
+
var stylesheet = stylesheets[_i18];
|
|
4345
4511
|
|
|
4346
4512
|
if (isArray$1(stylesheet)) {
|
|
4347
4513
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
@@ -4437,8 +4603,7 @@
|
|
|
4437
4603
|
}
|
|
4438
4604
|
|
|
4439
4605
|
function createStylesheet(vm, stylesheets) {
|
|
4440
|
-
var
|
|
4441
|
-
renderMode = vm.renderMode,
|
|
4606
|
+
var renderMode = vm.renderMode,
|
|
4442
4607
|
shadowMode = vm.shadowMode;
|
|
4443
4608
|
|
|
4444
4609
|
if (renderMode === 1
|
|
@@ -4446,10 +4611,10 @@
|
|
|
4446
4611
|
&& shadowMode === 1
|
|
4447
4612
|
/* Synthetic */
|
|
4448
4613
|
) {
|
|
4449
|
-
for (var
|
|
4450
|
-
|
|
4614
|
+
for (var _i19 = 0; _i19 < stylesheets.length; _i19++) {
|
|
4615
|
+
insertGlobalStylesheet$1(stylesheets[_i19]);
|
|
4451
4616
|
}
|
|
4452
|
-
} else if (
|
|
4617
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
4453
4618
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
4454
4619
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
4455
4620
|
// the first time the VM renders.
|
|
@@ -4461,12 +4626,12 @@
|
|
|
4461
4626
|
var root = getNearestNativeShadowComponent(vm);
|
|
4462
4627
|
var isGlobal = isNull(root);
|
|
4463
4628
|
|
|
4464
|
-
for (var
|
|
4629
|
+
for (var _i20 = 0; _i20 < stylesheets.length; _i20++) {
|
|
4465
4630
|
if (isGlobal) {
|
|
4466
|
-
|
|
4631
|
+
insertGlobalStylesheet$1(stylesheets[_i20]);
|
|
4467
4632
|
} else {
|
|
4468
4633
|
// local level
|
|
4469
|
-
|
|
4634
|
+
insertStylesheet$1(stylesheets[_i20], root.cmpRoot);
|
|
4470
4635
|
}
|
|
4471
4636
|
}
|
|
4472
4637
|
}
|
|
@@ -4651,8 +4816,8 @@
|
|
|
4651
4816
|
var stylesheets = template.stylesheets;
|
|
4652
4817
|
|
|
4653
4818
|
if (!isUndefined$1(stylesheets)) {
|
|
4654
|
-
for (var
|
|
4655
|
-
if (isTrue(stylesheets[
|
|
4819
|
+
for (var _i21 = 0; _i21 < stylesheets.length; _i21++) {
|
|
4820
|
+
if (isTrue(stylesheets[_i21][KEY__SCOPED_CSS])) {
|
|
4656
4821
|
return true;
|
|
4657
4822
|
}
|
|
4658
4823
|
}
|
|
@@ -4853,8 +5018,8 @@
|
|
|
4853
5018
|
|
|
4854
5019
|
function register(service) {
|
|
4855
5020
|
|
|
4856
|
-
for (var
|
|
4857
|
-
var hookName = hooks[
|
|
5021
|
+
for (var _i22 = 0; _i22 < hooks.length; ++_i22) {
|
|
5022
|
+
var hookName = hooks[_i22];
|
|
4858
5023
|
|
|
4859
5024
|
if (hookName in service) {
|
|
4860
5025
|
var l = Services[hookName];
|
|
@@ -4874,8 +5039,8 @@
|
|
|
4874
5039
|
def = vm.def,
|
|
4875
5040
|
context = vm.context;
|
|
4876
5041
|
|
|
4877
|
-
for (var
|
|
4878
|
-
cbs[
|
|
5042
|
+
for (var _i23 = 0, _len8 = cbs.length; _i23 < _len8; ++_i23) {
|
|
5043
|
+
cbs[_i23].call(undefined, component, {}, def, context);
|
|
4879
5044
|
}
|
|
4880
5045
|
}
|
|
4881
5046
|
/*
|
|
@@ -4993,7 +5158,6 @@
|
|
|
4993
5158
|
function createVM(elm, def, options) {
|
|
4994
5159
|
var mode = options.mode,
|
|
4995
5160
|
owner = options.owner,
|
|
4996
|
-
renderer = options.renderer,
|
|
4997
5161
|
tagName = options.tagName;
|
|
4998
5162
|
var vm = {
|
|
4999
5163
|
elm: elm,
|
|
@@ -5007,7 +5171,6 @@
|
|
|
5007
5171
|
tagName: tagName,
|
|
5008
5172
|
mode: mode,
|
|
5009
5173
|
owner: owner,
|
|
5010
|
-
renderer: renderer,
|
|
5011
5174
|
children: EmptyArray,
|
|
5012
5175
|
aChildren: EmptyArray,
|
|
5013
5176
|
velements: EmptyArray,
|
|
@@ -5049,13 +5212,10 @@
|
|
|
5049
5212
|
}
|
|
5050
5213
|
|
|
5051
5214
|
function computeShadowMode(vm) {
|
|
5052
|
-
var def = vm.def
|
|
5053
|
-
renderer = vm.renderer;
|
|
5054
|
-
var isNativeShadowDefined = renderer.isNativeShadowDefined,
|
|
5055
|
-
isSyntheticShadowDefined = renderer.isSyntheticShadowDefined;
|
|
5215
|
+
var def = vm.def;
|
|
5056
5216
|
var shadowMode;
|
|
5057
5217
|
|
|
5058
|
-
if (isSyntheticShadowDefined) {
|
|
5218
|
+
if (isSyntheticShadowDefined$1) {
|
|
5059
5219
|
if (def.renderMode === 0
|
|
5060
5220
|
/* Light */
|
|
5061
5221
|
) {
|
|
@@ -5064,7 +5224,7 @@
|
|
|
5064
5224
|
shadowMode = 0
|
|
5065
5225
|
/* Native */
|
|
5066
5226
|
;
|
|
5067
|
-
} else if (isNativeShadowDefined) {
|
|
5227
|
+
} else if (isNativeShadowDefined$1) {
|
|
5068
5228
|
if (def.shadowSupportMode === "any"
|
|
5069
5229
|
/* Any */
|
|
5070
5230
|
) {
|
|
@@ -5154,7 +5314,6 @@
|
|
|
5154
5314
|
// patch function mutates vnodes by adding the element reference,
|
|
5155
5315
|
// however, if patching fails it contains partial changes.
|
|
5156
5316
|
if (oldCh !== newCh) {
|
|
5157
|
-
var fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
|
|
5158
5317
|
runWithBoundaryProtection(vm, vm, function () {
|
|
5159
5318
|
// pre
|
|
5160
5319
|
logOperationStart(2
|
|
@@ -5162,8 +5321,8 @@
|
|
|
5162
5321
|
, vm);
|
|
5163
5322
|
}, function () {
|
|
5164
5323
|
// job
|
|
5165
|
-
var
|
|
5166
|
-
|
|
5324
|
+
var renderRoot = getRenderRoot(vm);
|
|
5325
|
+
patchChildren(renderRoot, oldCh, newCh);
|
|
5167
5326
|
}, function () {
|
|
5168
5327
|
// post
|
|
5169
5328
|
logOperationEnd(2
|
|
@@ -5185,10 +5344,9 @@
|
|
|
5185
5344
|
}
|
|
5186
5345
|
|
|
5187
5346
|
function runRenderedCallback(vm) {
|
|
5188
|
-
var
|
|
5189
|
-
renderedCallback = vm.def.renderedCallback;
|
|
5347
|
+
var renderedCallback = vm.def.renderedCallback;
|
|
5190
5348
|
|
|
5191
|
-
if (isTrue(
|
|
5349
|
+
if (isTrue(ssr$1)) {
|
|
5192
5350
|
return;
|
|
5193
5351
|
}
|
|
5194
5352
|
|
|
@@ -5221,19 +5379,19 @@
|
|
|
5221
5379
|
});
|
|
5222
5380
|
rehydrateQueue = []; // reset to a new queue
|
|
5223
5381
|
|
|
5224
|
-
for (var
|
|
5225
|
-
var vm = vms[
|
|
5382
|
+
for (var _i24 = 0, _len9 = vms.length; _i24 < _len9; _i24 += 1) {
|
|
5383
|
+
var vm = vms[_i24];
|
|
5226
5384
|
|
|
5227
5385
|
try {
|
|
5228
5386
|
rehydrate(vm);
|
|
5229
5387
|
} catch (error) {
|
|
5230
|
-
if (
|
|
5388
|
+
if (_i24 + 1 < _len9) {
|
|
5231
5389
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
5232
5390
|
if (rehydrateQueue.length === 0) {
|
|
5233
5391
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
5234
5392
|
}
|
|
5235
5393
|
|
|
5236
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
5394
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i24 + 1));
|
|
5237
5395
|
} // we need to end the measure before throwing.
|
|
5238
5396
|
|
|
5239
5397
|
|
|
@@ -5332,8 +5490,8 @@
|
|
|
5332
5490
|
var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
|
|
5333
5491
|
// inserted in reserved order.
|
|
5334
5492
|
|
|
5335
|
-
for (var
|
|
5336
|
-
var elm = vCustomElementCollection[
|
|
5493
|
+
for (var _i25 = vCustomElementCollection.length - 1; _i25 >= 0; _i25 -= 1) {
|
|
5494
|
+
var elm = vCustomElementCollection[_i25].elm; // There are two cases where the element could be undefined:
|
|
5337
5495
|
// * when there is an error during the construction phase, and an error
|
|
5338
5496
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
5339
5497
|
// is not properly initialized, and therefore is should be ignored.
|
|
@@ -5367,8 +5525,8 @@
|
|
|
5367
5525
|
|
|
5368
5526
|
|
|
5369
5527
|
function recursivelyDisconnectChildren(vnodes) {
|
|
5370
|
-
for (var
|
|
5371
|
-
var vnode = vnodes[
|
|
5528
|
+
for (var _i26 = 0, _len10 = vnodes.length; _i26 < _len10; _i26 += 1) {
|
|
5529
|
+
var vnode = vnodes[_i26];
|
|
5372
5530
|
|
|
5373
5531
|
if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$1(vnode.elm)) {
|
|
5374
5532
|
// vnode is a VElement with children
|
|
@@ -5388,15 +5546,14 @@
|
|
|
5388
5546
|
|
|
5389
5547
|
|
|
5390
5548
|
function resetComponentRoot(vm) {
|
|
5391
|
-
var children = vm.children
|
|
5392
|
-
renderer = vm.renderer;
|
|
5549
|
+
var children = vm.children;
|
|
5393
5550
|
var rootNode = getRenderRoot(vm);
|
|
5394
5551
|
|
|
5395
|
-
for (var
|
|
5396
|
-
var child = children[
|
|
5552
|
+
for (var _i27 = 0, _len11 = children.length; _i27 < _len11; _i27++) {
|
|
5553
|
+
var child = children[_i27];
|
|
5397
5554
|
|
|
5398
5555
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5399
|
-
|
|
5556
|
+
remove$1(child.elm, rootNode);
|
|
5400
5557
|
}
|
|
5401
5558
|
}
|
|
5402
5559
|
|
|
@@ -5406,7 +5563,7 @@
|
|
|
5406
5563
|
}
|
|
5407
5564
|
|
|
5408
5565
|
function scheduleRehydration(vm) {
|
|
5409
|
-
if (isTrue(
|
|
5566
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
5410
5567
|
return;
|
|
5411
5568
|
}
|
|
5412
5569
|
|
|
@@ -5429,65 +5586,6 @@
|
|
|
5429
5586
|
|
|
5430
5587
|
currentVm = currentVm.owner;
|
|
5431
5588
|
}
|
|
5432
|
-
} // slow path routine
|
|
5433
|
-
// NOTE: we should probably more this routine to the synthetic shadow folder
|
|
5434
|
-
// and get the allocation to be cached by in the elm instead of in the VM
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
function allocateInSlot(vm, children) {
|
|
5438
|
-
var oldSlots = vm.cmpSlots;
|
|
5439
|
-
var cmpSlots = vm.cmpSlots = create(null);
|
|
5440
|
-
|
|
5441
|
-
for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26 += 1) {
|
|
5442
|
-
var vnode = children[_i26];
|
|
5443
|
-
|
|
5444
|
-
if (isNull(vnode)) {
|
|
5445
|
-
continue;
|
|
5446
|
-
}
|
|
5447
|
-
|
|
5448
|
-
var data = vnode.data;
|
|
5449
|
-
var slotName = data.attrs && data.attrs.slot || '';
|
|
5450
|
-
var vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
|
|
5451
|
-
// which might have similar keys. Each vnode will always have a key that
|
|
5452
|
-
// starts with a numeric character from compiler. In this case, we add a unique
|
|
5453
|
-
// notation for slotted vnodes keys, e.g.: `@foo:1:1`
|
|
5454
|
-
|
|
5455
|
-
if (!isUndefined$1(vnode.key)) {
|
|
5456
|
-
vnode.key = "@".concat(slotName, ":").concat(vnode.key);
|
|
5457
|
-
}
|
|
5458
|
-
|
|
5459
|
-
ArrayPush$1.call(vnodes, vnode);
|
|
5460
|
-
}
|
|
5461
|
-
|
|
5462
|
-
if (isFalse(vm.isDirty)) {
|
|
5463
|
-
// We need to determine if the old allocation is really different from the new one
|
|
5464
|
-
// and mark the vm as dirty
|
|
5465
|
-
var oldKeys = keys(oldSlots);
|
|
5466
|
-
|
|
5467
|
-
if (oldKeys.length !== keys(cmpSlots).length) {
|
|
5468
|
-
markComponentAsDirty(vm);
|
|
5469
|
-
return;
|
|
5470
|
-
}
|
|
5471
|
-
|
|
5472
|
-
for (var _i27 = 0, _len11 = oldKeys.length; _i27 < _len11; _i27 += 1) {
|
|
5473
|
-
var key = oldKeys[_i27];
|
|
5474
|
-
|
|
5475
|
-
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
5476
|
-
markComponentAsDirty(vm);
|
|
5477
|
-
return;
|
|
5478
|
-
}
|
|
5479
|
-
|
|
5480
|
-
var oldVNodes = oldSlots[key];
|
|
5481
|
-
var _vnodes = cmpSlots[key];
|
|
5482
|
-
|
|
5483
|
-
for (var j = 0, a = cmpSlots[key].length; j < a; j += 1) {
|
|
5484
|
-
if (oldVNodes[j] !== _vnodes[j]) {
|
|
5485
|
-
markComponentAsDirty(vm);
|
|
5486
|
-
return;
|
|
5487
|
-
}
|
|
5488
|
-
}
|
|
5489
|
-
}
|
|
5490
|
-
}
|
|
5491
5589
|
}
|
|
5492
5590
|
|
|
5493
5591
|
function runWithBoundaryProtection(vm, owner, pre, job, post) {
|
|
@@ -5636,7 +5734,6 @@
|
|
|
5636
5734
|
}
|
|
5637
5735
|
|
|
5638
5736
|
var elm = vm.elm,
|
|
5639
|
-
renderer = vm.renderer,
|
|
5640
5737
|
_vm$context = vm.context,
|
|
5641
5738
|
wiredConnecting = _vm$context.wiredConnecting,
|
|
5642
5739
|
wiredDisconnecting = _vm$context.wiredDisconnecting; // waiting for the component to be connected to formally request the context via the token
|
|
@@ -5659,7 +5756,7 @@
|
|
|
5659
5756
|
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
5660
5757
|
}
|
|
5661
5758
|
});
|
|
5662
|
-
|
|
5759
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
5663
5760
|
});
|
|
5664
5761
|
}
|
|
5665
5762
|
|
|
@@ -5903,7 +6000,7 @@
|
|
|
5903
6000
|
hooksAreSet = true;
|
|
5904
6001
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5905
6002
|
}
|
|
5906
|
-
/* version: 2.
|
|
6003
|
+
/* version: 2.7.3 */
|
|
5907
6004
|
|
|
5908
6005
|
/*
|
|
5909
6006
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5923,7 +6020,9 @@
|
|
|
5923
6020
|
var styleElements = create(null);
|
|
5924
6021
|
var styleSheets = create(null);
|
|
5925
6022
|
var nodesToStyleSheets = new WeakMap();
|
|
5926
|
-
var getCustomElement
|
|
6023
|
+
var getCustomElement;
|
|
6024
|
+
var defineCustomElement;
|
|
6025
|
+
var HTMLElementConstructor;
|
|
5927
6026
|
|
|
5928
6027
|
function isCustomElementRegistryAvailable() {
|
|
5929
6028
|
if (typeof customElements === 'undefined') {
|
|
@@ -6048,146 +6147,213 @@
|
|
|
6048
6147
|
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
6049
6148
|
}
|
|
6050
6149
|
|
|
6051
|
-
var
|
|
6150
|
+
var hydrating = false;
|
|
6052
6151
|
|
|
6053
|
-
function setIsHydrating(
|
|
6054
|
-
|
|
6152
|
+
function setIsHydrating(value) {
|
|
6153
|
+
hydrating = value;
|
|
6055
6154
|
}
|
|
6056
6155
|
|
|
6057
|
-
var
|
|
6058
|
-
ssr: false,
|
|
6059
|
-
isHydrating: function isHydrating() {
|
|
6060
|
-
return _isHydrating;
|
|
6061
|
-
},
|
|
6062
|
-
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
6063
|
-
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
|
|
6064
|
-
createElement: function createElement(tagName, namespace) {
|
|
6065
|
-
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6066
|
-
},
|
|
6067
|
-
createText: function createText(content) {
|
|
6068
|
-
return document.createTextNode(content);
|
|
6069
|
-
},
|
|
6070
|
-
createComment: function createComment(content) {
|
|
6071
|
-
return document.createComment(content);
|
|
6072
|
-
},
|
|
6073
|
-
insert: function insert(node, parent, anchor) {
|
|
6074
|
-
parent.insertBefore(node, anchor);
|
|
6075
|
-
},
|
|
6076
|
-
remove: function remove(node, parent) {
|
|
6077
|
-
parent.removeChild(node);
|
|
6078
|
-
},
|
|
6079
|
-
nextSibling: function nextSibling(node) {
|
|
6080
|
-
return node.nextSibling;
|
|
6081
|
-
},
|
|
6082
|
-
attachShadow: function attachShadow(element, options) {
|
|
6083
|
-
if (_isHydrating) {
|
|
6084
|
-
return element.shadowRoot;
|
|
6085
|
-
}
|
|
6156
|
+
var ssr = false;
|
|
6086
6157
|
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
node.nodeValue = content;
|
|
6091
|
-
},
|
|
6092
|
-
getProperty: function getProperty(node, key) {
|
|
6093
|
-
return node[key];
|
|
6094
|
-
},
|
|
6095
|
-
setProperty: function setProperty(node, key, value) {
|
|
6158
|
+
function isHydrating() {
|
|
6159
|
+
return hydrating;
|
|
6160
|
+
}
|
|
6096
6161
|
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
getAttribute: function getAttribute(element, name, namespace) {
|
|
6100
|
-
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6101
|
-
},
|
|
6102
|
-
setAttribute: function setAttribute(element, name, value, namespace) {
|
|
6103
|
-
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6104
|
-
},
|
|
6105
|
-
removeAttribute: function removeAttribute(element, name, namespace) {
|
|
6106
|
-
if (isUndefined$1(namespace)) {
|
|
6107
|
-
element.removeAttribute(name);
|
|
6108
|
-
} else {
|
|
6109
|
-
element.removeAttributeNS(namespace, name);
|
|
6110
|
-
}
|
|
6111
|
-
},
|
|
6112
|
-
addEventListener: function addEventListener(target, type, callback, options) {
|
|
6113
|
-
target.addEventListener(type, callback, options);
|
|
6114
|
-
},
|
|
6115
|
-
removeEventListener: function removeEventListener(target, type, callback, options) {
|
|
6116
|
-
target.removeEventListener(type, callback, options);
|
|
6117
|
-
},
|
|
6118
|
-
dispatchEvent: function dispatchEvent(target, event) {
|
|
6119
|
-
return target.dispatchEvent(event);
|
|
6120
|
-
},
|
|
6121
|
-
getClassList: function getClassList(element) {
|
|
6122
|
-
return element.classList;
|
|
6123
|
-
},
|
|
6124
|
-
setCSSStyleProperty: function setCSSStyleProperty(element, name, value, important) {
|
|
6125
|
-
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6126
|
-
// represent elements in the engine?
|
|
6127
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6128
|
-
},
|
|
6129
|
-
getBoundingClientRect: function getBoundingClientRect(element) {
|
|
6130
|
-
return element.getBoundingClientRect();
|
|
6131
|
-
},
|
|
6132
|
-
querySelector: function querySelector(element, selectors) {
|
|
6133
|
-
return element.querySelector(selectors);
|
|
6134
|
-
},
|
|
6135
|
-
querySelectorAll: function querySelectorAll(element, selectors) {
|
|
6136
|
-
return element.querySelectorAll(selectors);
|
|
6137
|
-
},
|
|
6138
|
-
getElementsByTagName: function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6139
|
-
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6140
|
-
},
|
|
6141
|
-
getElementsByClassName: function getElementsByClassName(element, names) {
|
|
6142
|
-
return element.getElementsByClassName(names);
|
|
6143
|
-
},
|
|
6144
|
-
getChildren: function getChildren(element) {
|
|
6145
|
-
return element.children;
|
|
6146
|
-
},
|
|
6147
|
-
getChildNodes: function getChildNodes(element) {
|
|
6148
|
-
return element.childNodes;
|
|
6149
|
-
},
|
|
6150
|
-
getFirstChild: function getFirstChild(element) {
|
|
6151
|
-
return element.firstChild;
|
|
6152
|
-
},
|
|
6153
|
-
getFirstElementChild: function getFirstElementChild(element) {
|
|
6154
|
-
return element.firstElementChild;
|
|
6155
|
-
},
|
|
6156
|
-
getLastChild: function getLastChild(element) {
|
|
6157
|
-
return element.lastChild;
|
|
6158
|
-
},
|
|
6159
|
-
getLastElementChild: function getLastElementChild(element) {
|
|
6160
|
-
return element.lastElementChild;
|
|
6161
|
-
},
|
|
6162
|
-
isConnected: function isConnected(node) {
|
|
6163
|
-
return node.isConnected;
|
|
6164
|
-
},
|
|
6165
|
-
insertGlobalStylesheet: function insertGlobalStylesheet(content) {
|
|
6166
|
-
if (!isUndefined$1(globalStylesheets[content])) {
|
|
6167
|
-
return;
|
|
6168
|
-
}
|
|
6162
|
+
var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
6163
|
+
var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
6169
6164
|
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6165
|
+
function createElement$1(tagName, namespace) {
|
|
6166
|
+
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6167
|
+
}
|
|
6168
|
+
|
|
6169
|
+
function createText(content) {
|
|
6170
|
+
return document.createTextNode(content);
|
|
6171
|
+
}
|
|
6172
|
+
|
|
6173
|
+
function createComment(content) {
|
|
6174
|
+
return document.createComment(content);
|
|
6175
|
+
}
|
|
6176
|
+
|
|
6177
|
+
function insert(node, parent, anchor) {
|
|
6178
|
+
parent.insertBefore(node, anchor);
|
|
6179
|
+
}
|
|
6180
|
+
|
|
6181
|
+
function remove(node, parent) {
|
|
6182
|
+
parent.removeChild(node);
|
|
6183
|
+
}
|
|
6184
|
+
|
|
6185
|
+
function nextSibling(node) {
|
|
6186
|
+
return node.nextSibling;
|
|
6187
|
+
}
|
|
6188
|
+
|
|
6189
|
+
function attachShadow(element, options) {
|
|
6190
|
+
if (hydrating) {
|
|
6191
|
+
return element.shadowRoot;
|
|
6192
|
+
}
|
|
6193
|
+
|
|
6194
|
+
return element.attachShadow(options);
|
|
6195
|
+
}
|
|
6196
|
+
|
|
6197
|
+
function setText(node, content) {
|
|
6198
|
+
node.nodeValue = content;
|
|
6199
|
+
}
|
|
6200
|
+
|
|
6201
|
+
function getProperty(node, key) {
|
|
6202
|
+
return node[key];
|
|
6203
|
+
}
|
|
6204
|
+
|
|
6205
|
+
function setProperty(node, key, value) {
|
|
6206
|
+
|
|
6207
|
+
node[key] = value;
|
|
6208
|
+
}
|
|
6209
|
+
|
|
6210
|
+
function getAttribute(element, name, namespace) {
|
|
6211
|
+
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6212
|
+
}
|
|
6213
|
+
|
|
6214
|
+
function setAttribute(element, name, value, namespace) {
|
|
6215
|
+
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6216
|
+
}
|
|
6217
|
+
|
|
6218
|
+
function removeAttribute(element, name, namespace) {
|
|
6219
|
+
if (isUndefined$1(namespace)) {
|
|
6220
|
+
element.removeAttribute(name);
|
|
6221
|
+
} else {
|
|
6222
|
+
element.removeAttributeNS(namespace, name);
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6226
|
+
function addEventListener(target, type, callback, options) {
|
|
6227
|
+
target.addEventListener(type, callback, options);
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
function removeEventListener(target, type, callback, options) {
|
|
6231
|
+
target.removeEventListener(type, callback, options);
|
|
6232
|
+
}
|
|
6233
|
+
|
|
6234
|
+
function dispatchEvent(target, event) {
|
|
6235
|
+
return target.dispatchEvent(event);
|
|
6236
|
+
}
|
|
6237
|
+
|
|
6238
|
+
function getClassList(element) {
|
|
6239
|
+
return element.classList;
|
|
6240
|
+
}
|
|
6241
|
+
|
|
6242
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
6243
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6244
|
+
// represent elements in the engine?
|
|
6245
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6246
|
+
}
|
|
6247
|
+
|
|
6248
|
+
function getBoundingClientRect(element) {
|
|
6249
|
+
return element.getBoundingClientRect();
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
function querySelector(element, selectors) {
|
|
6253
|
+
return element.querySelector(selectors);
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
function querySelectorAll(element, selectors) {
|
|
6257
|
+
return element.querySelectorAll(selectors);
|
|
6258
|
+
}
|
|
6259
|
+
|
|
6260
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6261
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6262
|
+
}
|
|
6263
|
+
|
|
6264
|
+
function getElementsByClassName(element, names) {
|
|
6265
|
+
return element.getElementsByClassName(names);
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
function getChildren(element) {
|
|
6269
|
+
return element.children;
|
|
6270
|
+
}
|
|
6271
|
+
|
|
6272
|
+
function getChildNodes(element) {
|
|
6273
|
+
return element.childNodes;
|
|
6274
|
+
}
|
|
6275
|
+
|
|
6276
|
+
function getFirstChild(element) {
|
|
6277
|
+
return element.firstChild;
|
|
6278
|
+
}
|
|
6279
|
+
|
|
6280
|
+
function getFirstElementChild(element) {
|
|
6281
|
+
return element.firstElementChild;
|
|
6282
|
+
}
|
|
6283
|
+
|
|
6284
|
+
function getLastChild(element) {
|
|
6285
|
+
return element.lastChild;
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
function getLastElementChild(element) {
|
|
6289
|
+
return element.lastElementChild;
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6292
|
+
function isConnected(node) {
|
|
6293
|
+
return node.isConnected;
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
function insertGlobalStylesheet(content) {
|
|
6297
|
+
if (!isUndefined$1(globalStylesheets[content])) {
|
|
6298
|
+
return;
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
globalStylesheets[content] = true;
|
|
6302
|
+
var elm = document.createElement('style');
|
|
6303
|
+
elm.type = 'text/css';
|
|
6304
|
+
elm.textContent = content;
|
|
6305
|
+
globalStylesheetsParentElement.appendChild(elm);
|
|
6306
|
+
}
|
|
6307
|
+
|
|
6308
|
+
function insertStylesheet(content, target) {
|
|
6309
|
+
if (supportsConstructableStyleSheets) {
|
|
6310
|
+
insertConstructableStyleSheet(content, target);
|
|
6311
|
+
} else {
|
|
6312
|
+
// Fall back to <style> element
|
|
6313
|
+
insertStyleElement(content, target);
|
|
6314
|
+
}
|
|
6315
|
+
}
|
|
6316
|
+
|
|
6317
|
+
var HTMLElementExported = HTMLElementConstructor;
|
|
6318
|
+
setAttachShadow(attachShadow);
|
|
6319
|
+
setCreateComment(createComment);
|
|
6320
|
+
setCreateElement(createElement$1);
|
|
6321
|
+
setCreateText(createText);
|
|
6322
|
+
setDefineCustomElement(defineCustomElement);
|
|
6323
|
+
setDispatchEvent(dispatchEvent);
|
|
6324
|
+
setGetAttribute(getAttribute);
|
|
6325
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
6326
|
+
setGetChildNodes(getChildNodes);
|
|
6327
|
+
setGetChildren(getChildren);
|
|
6328
|
+
setGetClassList(getClassList);
|
|
6329
|
+
setGetCustomElement(getCustomElement);
|
|
6330
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
6331
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
6332
|
+
setGetFirstChild(getFirstChild);
|
|
6333
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
6334
|
+
setGetLastChild(getLastChild);
|
|
6335
|
+
setGetLastElementChild(getLastElementChild);
|
|
6336
|
+
setGetProperty(getProperty);
|
|
6337
|
+
setHTMLElement(HTMLElementExported);
|
|
6338
|
+
setInsert(insert);
|
|
6339
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
6340
|
+
setInsertStylesheet(insertStylesheet);
|
|
6341
|
+
setIsConnected(isConnected);
|
|
6342
|
+
setIsHydrating$1(isHydrating);
|
|
6343
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
6344
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
6345
|
+
setNextSibling(nextSibling);
|
|
6346
|
+
setQuerySelector(querySelector);
|
|
6347
|
+
setQuerySelectorAll(querySelectorAll);
|
|
6348
|
+
setRemove(remove);
|
|
6349
|
+
setRemoveAttribute(removeAttribute);
|
|
6350
|
+
setRemoveEventListener(removeEventListener);
|
|
6351
|
+
setSetAttribute(setAttribute);
|
|
6352
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
6353
|
+
setSetProperty(setProperty);
|
|
6354
|
+
setSetText(setText);
|
|
6355
|
+
setSsr(ssr);
|
|
6356
|
+
setAddEventListener(addEventListener);
|
|
6191
6357
|
/*
|
|
6192
6358
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6193
6359
|
* All rights reserved.
|
|
@@ -6266,7 +6432,7 @@
|
|
|
6266
6432
|
throw new TypeError("\"createElement\" function expects an \"is\" option with a valid component constructor.");
|
|
6267
6433
|
}
|
|
6268
6434
|
|
|
6269
|
-
var UpgradableConstructor = getUpgradableConstructor(sel
|
|
6435
|
+
var UpgradableConstructor = getUpgradableConstructor(sel);
|
|
6270
6436
|
var wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
6271
6437
|
|
|
6272
6438
|
/**
|
|
@@ -6281,8 +6447,7 @@
|
|
|
6281
6447
|
createVM(elm, def, {
|
|
6282
6448
|
tagName: sel,
|
|
6283
6449
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
6284
|
-
owner: null
|
|
6285
|
-
renderer: renderer
|
|
6450
|
+
owner: null
|
|
6286
6451
|
});
|
|
6287
6452
|
ConnectingSlot.set(elm, connectRootElement);
|
|
6288
6453
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
@@ -6307,6 +6472,10 @@
|
|
|
6307
6472
|
function hydrateComponent(element, Ctor) {
|
|
6308
6473
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6309
6474
|
|
|
6475
|
+
if (!(element instanceof Element)) {
|
|
6476
|
+
throw new TypeError("\"hydrateComponent\" expects a valid DOM element as the first parameter but instead received ".concat(element, "."));
|
|
6477
|
+
}
|
|
6478
|
+
|
|
6310
6479
|
if (!isFunction$1(Ctor)) {
|
|
6311
6480
|
throw new TypeError("\"hydrateComponent\" expects a valid component constructor as the second parameter but instead received ".concat(Ctor, "."));
|
|
6312
6481
|
}
|
|
@@ -6324,7 +6493,6 @@
|
|
|
6324
6493
|
createVM(element, def, {
|
|
6325
6494
|
mode: 'open',
|
|
6326
6495
|
owner: null,
|
|
6327
|
-
renderer: renderer,
|
|
6328
6496
|
tagName: element.tagName.toLowerCase()
|
|
6329
6497
|
});
|
|
6330
6498
|
|
|
@@ -6407,8 +6575,7 @@
|
|
|
6407
6575
|
createVM(_assertThisInitialized(_this6), def, {
|
|
6408
6576
|
mode: 'open',
|
|
6409
6577
|
owner: null,
|
|
6410
|
-
tagName: _this6.tagName
|
|
6411
|
-
renderer: renderer
|
|
6578
|
+
tagName: _this6.tagName
|
|
6412
6579
|
});
|
|
6413
6580
|
return _this6;
|
|
6414
6581
|
}
|
|
@@ -6481,7 +6648,7 @@
|
|
|
6481
6648
|
return false;
|
|
6482
6649
|
}
|
|
6483
6650
|
|
|
6484
|
-
if (
|
|
6651
|
+
if (isSyntheticShadowDefined) {
|
|
6485
6652
|
// TODO [#1252]: old behavior that is still used by some pieces of the platform,
|
|
6486
6653
|
// specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
|
|
6487
6654
|
// used, will be considered global elements.
|
|
@@ -6533,7 +6700,7 @@
|
|
|
6533
6700
|
});
|
|
6534
6701
|
freeze(LightningElement);
|
|
6535
6702
|
seal(LightningElement.prototype);
|
|
6536
|
-
/* version: 2.
|
|
6703
|
+
/* version: 2.7.3 */
|
|
6537
6704
|
|
|
6538
6705
|
exports.LightningElement = LightningElement;
|
|
6539
6706
|
exports.__unstable__ProfilerControl = profilerControl;
|