lwc 2.5.10 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/iife/es5/engine-dom.js +737 -433
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +704 -408
- package/dist/engine-dom/umd/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/umd/es5/engine-dom.js +737 -433
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +704 -408
- package/dist/engine-server/commonjs/es2017/engine-server.js +754 -549
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +754 -549
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +146 -137
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +146 -137
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +11 -11
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +11 -11
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
- package/package.json +8 -8
|
@@ -335,7 +335,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
335
335
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
336
336
|
return attributeName;
|
|
337
337
|
}
|
|
338
|
-
/** version: 2.
|
|
338
|
+
/** version: 2.6.3 */
|
|
339
339
|
|
|
340
340
|
/*
|
|
341
341
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -348,25 +348,28 @@ function htmlPropertyToAttribute(propName) {
|
|
|
348
348
|
* The following constructor might be used in either the constructor or the connectedCallback. In
|
|
349
349
|
* order to ensure that the component evaluates, we attach those mock constructors to the global
|
|
350
350
|
* object.
|
|
351
|
+
* Also note that Event is defined in Node 16+, but CustomEvent is not, so they have to be
|
|
352
|
+
* polyfilled separately.
|
|
351
353
|
*/
|
|
352
354
|
|
|
353
355
|
|
|
354
|
-
if (typeof Event !== 'function'
|
|
356
|
+
if (typeof Event !== 'function') {
|
|
355
357
|
class Event {}
|
|
356
358
|
|
|
359
|
+
defineProperty(_globalThis, 'Event', {
|
|
360
|
+
value: Event,
|
|
361
|
+
configurable: true,
|
|
362
|
+
writable: true
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (typeof CustomEvent !== 'function') {
|
|
357
367
|
class CustomEvent extends Event {}
|
|
358
368
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
writable: true
|
|
364
|
-
},
|
|
365
|
-
CustomEvent: {
|
|
366
|
-
value: CustomEvent,
|
|
367
|
-
configurable: true,
|
|
368
|
-
writable: true
|
|
369
|
-
}
|
|
369
|
+
defineProperty(_globalThis, 'CustomEvent', {
|
|
370
|
+
value: CustomEvent,
|
|
371
|
+
configurable: true,
|
|
372
|
+
writable: true
|
|
370
373
|
});
|
|
371
374
|
}
|
|
372
375
|
/**
|
|
@@ -390,8 +393,6 @@ const features = {
|
|
|
390
393
|
ENABLE_NODE_LIST_PATCH: null,
|
|
391
394
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
392
395
|
ENABLE_NODE_PATCH: null,
|
|
393
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
394
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
395
396
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
396
397
|
};
|
|
397
398
|
|
|
@@ -456,7 +457,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
456
457
|
setFeatureFlag(name, value);
|
|
457
458
|
}
|
|
458
459
|
}
|
|
459
|
-
/** version: 2.
|
|
460
|
+
/** version: 2.6.3 */
|
|
460
461
|
|
|
461
462
|
/* proxy-compat-disable */
|
|
462
463
|
|
|
@@ -530,6 +531,249 @@ function parseStyleText(cssText) {
|
|
|
530
531
|
}
|
|
531
532
|
|
|
532
533
|
return styleMap;
|
|
534
|
+
} //
|
|
535
|
+
// Primitives
|
|
536
|
+
//
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
let ssr$1;
|
|
540
|
+
|
|
541
|
+
function setSsr(ssrImpl) {
|
|
542
|
+
ssr$1 = ssrImpl;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
let isNativeShadowDefined$1;
|
|
546
|
+
|
|
547
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
548
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
let isSyntheticShadowDefined$1;
|
|
552
|
+
|
|
553
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
554
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
let HTMLElementExported$1;
|
|
558
|
+
|
|
559
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
560
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
let isHydrating$1;
|
|
564
|
+
|
|
565
|
+
function setIsHydrating(isHydratingImpl) {
|
|
566
|
+
isHydrating$1 = isHydratingImpl;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
let insert$1;
|
|
570
|
+
|
|
571
|
+
function setInsert(insertImpl) {
|
|
572
|
+
insert$1 = insertImpl;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
let remove$1;
|
|
576
|
+
|
|
577
|
+
function setRemove(removeImpl) {
|
|
578
|
+
remove$1 = removeImpl;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
let createElement$1;
|
|
582
|
+
|
|
583
|
+
function setCreateElement(createElementImpl) {
|
|
584
|
+
createElement$1 = createElementImpl;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
let createText$1;
|
|
588
|
+
|
|
589
|
+
function setCreateText(createTextImpl) {
|
|
590
|
+
createText$1 = createTextImpl;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
let createComment$1;
|
|
594
|
+
|
|
595
|
+
function setCreateComment(createCommentImpl) {
|
|
596
|
+
createComment$1 = createCommentImpl;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
let nextSibling$1;
|
|
600
|
+
|
|
601
|
+
function setNextSibling(nextSiblingImpl) {
|
|
602
|
+
nextSibling$1 = nextSiblingImpl;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
let attachShadow$1;
|
|
606
|
+
|
|
607
|
+
function setAttachShadow(attachShadowImpl) {
|
|
608
|
+
attachShadow$1 = attachShadowImpl;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
let getProperty$1;
|
|
612
|
+
|
|
613
|
+
function setGetProperty(getPropertyImpl) {
|
|
614
|
+
getProperty$1 = getPropertyImpl;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
let setProperty$1;
|
|
618
|
+
|
|
619
|
+
function setSetProperty(setPropertyImpl) {
|
|
620
|
+
setProperty$1 = setPropertyImpl;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
let setText$1;
|
|
624
|
+
|
|
625
|
+
function setSetText(setTextImpl) {
|
|
626
|
+
setText$1 = setTextImpl;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
let getAttribute$1;
|
|
630
|
+
|
|
631
|
+
function setGetAttribute(getAttributeImpl) {
|
|
632
|
+
getAttribute$1 = getAttributeImpl;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
let setAttribute$1;
|
|
636
|
+
|
|
637
|
+
function setSetAttribute(setAttributeImpl) {
|
|
638
|
+
setAttribute$1 = setAttributeImpl;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
let removeAttribute$1;
|
|
642
|
+
|
|
643
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
644
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
let addEventListener$1;
|
|
648
|
+
|
|
649
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
650
|
+
addEventListener$1 = addEventListenerImpl;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
let removeEventListener$1;
|
|
654
|
+
|
|
655
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
656
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
let dispatchEvent$1;
|
|
660
|
+
|
|
661
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
662
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
let getClassList$1;
|
|
666
|
+
|
|
667
|
+
function setGetClassList(getClassListImpl) {
|
|
668
|
+
getClassList$1 = getClassListImpl;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
let setCSSStyleProperty$1;
|
|
672
|
+
|
|
673
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
674
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
let getBoundingClientRect$1;
|
|
678
|
+
|
|
679
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
680
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
let querySelector$1;
|
|
684
|
+
|
|
685
|
+
function setQuerySelector(querySelectorImpl) {
|
|
686
|
+
querySelector$1 = querySelectorImpl;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
let querySelectorAll$1;
|
|
690
|
+
|
|
691
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
692
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
let getElementsByTagName$1;
|
|
696
|
+
|
|
697
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
698
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
let getElementsByClassName$1;
|
|
702
|
+
|
|
703
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
704
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
let getChildren$1;
|
|
708
|
+
|
|
709
|
+
function setGetChildren(getChildrenImpl) {
|
|
710
|
+
getChildren$1 = getChildrenImpl;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
let getChildNodes$1;
|
|
714
|
+
|
|
715
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
716
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
let getFirstChild$1;
|
|
720
|
+
|
|
721
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
722
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
let getFirstElementChild$1;
|
|
726
|
+
|
|
727
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
728
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
let getLastChild$1;
|
|
732
|
+
|
|
733
|
+
function setGetLastChild(getLastChildImpl) {
|
|
734
|
+
getLastChild$1 = getLastChildImpl;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let getLastElementChild$1;
|
|
738
|
+
|
|
739
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
740
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
let isConnected$1;
|
|
744
|
+
|
|
745
|
+
function setIsConnected(isConnectedImpl) {
|
|
746
|
+
isConnected$1 = isConnectedImpl;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
let insertGlobalStylesheet$1;
|
|
750
|
+
|
|
751
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
752
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
let insertStylesheet$1;
|
|
756
|
+
|
|
757
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
758
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
let assertInstanceOfHTMLElement$1;
|
|
762
|
+
|
|
763
|
+
function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
|
|
764
|
+
assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
let defineCustomElement$1;
|
|
768
|
+
|
|
769
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
770
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
let getCustomElement$1;
|
|
774
|
+
|
|
775
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
776
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
533
777
|
}
|
|
534
778
|
/*
|
|
535
779
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -783,9 +1027,6 @@ function createAllEventListeners(vnode) {
|
|
|
783
1027
|
elm,
|
|
784
1028
|
data: {
|
|
785
1029
|
on
|
|
786
|
-
},
|
|
787
|
-
owner: {
|
|
788
|
-
renderer
|
|
789
1030
|
}
|
|
790
1031
|
} = vnode;
|
|
791
1032
|
|
|
@@ -798,7 +1039,7 @@ function createAllEventListeners(vnode) {
|
|
|
798
1039
|
let name;
|
|
799
1040
|
|
|
800
1041
|
for (name in on) {
|
|
801
|
-
|
|
1042
|
+
addEventListener$1(elm, name, listener);
|
|
802
1043
|
}
|
|
803
1044
|
}
|
|
804
1045
|
|
|
@@ -940,9 +1181,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
940
1181
|
const {
|
|
941
1182
|
data: {
|
|
942
1183
|
attrs
|
|
943
|
-
},
|
|
944
|
-
owner: {
|
|
945
|
-
renderer
|
|
946
1184
|
}
|
|
947
1185
|
} = vnode;
|
|
948
1186
|
|
|
@@ -965,10 +1203,6 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
965
1203
|
}
|
|
966
1204
|
|
|
967
1205
|
const elm = vnode.elm;
|
|
968
|
-
const {
|
|
969
|
-
setAttribute,
|
|
970
|
-
removeAttribute
|
|
971
|
-
} = renderer;
|
|
972
1206
|
let key;
|
|
973
1207
|
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
974
1208
|
// this routine is only useful for data-* attributes in all kind of elements
|
|
@@ -983,14 +1217,14 @@ function updateAttrs(oldVnode, vnode) {
|
|
|
983
1217
|
|
|
984
1218
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
985
1219
|
// Assume xml namespace
|
|
986
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
1220
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
987
1221
|
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
988
1222
|
// Assume xlink namespace
|
|
989
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
990
|
-
} else if (isNull(cur)) {
|
|
991
|
-
removeAttribute(elm, key);
|
|
1223
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
1224
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
1225
|
+
removeAttribute$1(elm, key);
|
|
992
1226
|
} else {
|
|
993
|
-
setAttribute(elm, key, cur);
|
|
1227
|
+
setAttribute$1(elm, key, cur);
|
|
994
1228
|
}
|
|
995
1229
|
|
|
996
1230
|
lockAttribute();
|
|
@@ -1038,17 +1272,14 @@ function update(oldVnode, vnode) {
|
|
|
1038
1272
|
const isFirstPatch = isUndefined$1(oldProps);
|
|
1039
1273
|
const {
|
|
1040
1274
|
elm,
|
|
1041
|
-
sel
|
|
1042
|
-
owner: {
|
|
1043
|
-
renderer
|
|
1044
|
-
}
|
|
1275
|
+
sel
|
|
1045
1276
|
} = vnode;
|
|
1046
1277
|
|
|
1047
1278
|
for (const key in props) {
|
|
1048
1279
|
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1049
1280
|
|
|
1050
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ?
|
|
1051
|
-
|
|
1281
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
1282
|
+
setProperty$1(elm, key, cur);
|
|
1052
1283
|
}
|
|
1053
1284
|
}
|
|
1054
1285
|
}
|
|
@@ -1117,9 +1348,6 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1117
1348
|
elm,
|
|
1118
1349
|
data: {
|
|
1119
1350
|
className: newClass
|
|
1120
|
-
},
|
|
1121
|
-
owner: {
|
|
1122
|
-
renderer
|
|
1123
1351
|
}
|
|
1124
1352
|
} = vnode;
|
|
1125
1353
|
const {
|
|
@@ -1132,7 +1360,7 @@ function updateClassAttribute(oldVnode, vnode) {
|
|
|
1132
1360
|
return;
|
|
1133
1361
|
}
|
|
1134
1362
|
|
|
1135
|
-
const classList =
|
|
1363
|
+
const classList = getClassList$1(elm);
|
|
1136
1364
|
const newClassMap = getMapFromClassName(newClass);
|
|
1137
1365
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
1138
1366
|
let name;
|
|
@@ -1170,24 +1398,17 @@ function updateStyleAttribute(oldVnode, vnode) {
|
|
|
1170
1398
|
elm,
|
|
1171
1399
|
data: {
|
|
1172
1400
|
style: newStyle
|
|
1173
|
-
},
|
|
1174
|
-
owner: {
|
|
1175
|
-
renderer
|
|
1176
1401
|
}
|
|
1177
1402
|
} = vnode;
|
|
1178
|
-
const {
|
|
1179
|
-
setAttribute,
|
|
1180
|
-
removeAttribute
|
|
1181
|
-
} = renderer;
|
|
1182
1403
|
|
|
1183
1404
|
if (oldVnode.data.style === newStyle) {
|
|
1184
1405
|
return;
|
|
1185
1406
|
}
|
|
1186
1407
|
|
|
1187
1408
|
if (!isString(newStyle) || newStyle === '') {
|
|
1188
|
-
removeAttribute(elm, 'style');
|
|
1409
|
+
removeAttribute$1(elm, 'style');
|
|
1189
1410
|
} else {
|
|
1190
|
-
setAttribute(elm, 'style', newStyle);
|
|
1411
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
1191
1412
|
}
|
|
1192
1413
|
}
|
|
1193
1414
|
|
|
@@ -1212,9 +1433,6 @@ function createClassAttribute(vnode) {
|
|
|
1212
1433
|
elm,
|
|
1213
1434
|
data: {
|
|
1214
1435
|
classMap
|
|
1215
|
-
},
|
|
1216
|
-
owner: {
|
|
1217
|
-
renderer
|
|
1218
1436
|
}
|
|
1219
1437
|
} = vnode;
|
|
1220
1438
|
|
|
@@ -1222,7 +1440,7 @@ function createClassAttribute(vnode) {
|
|
|
1222
1440
|
return;
|
|
1223
1441
|
}
|
|
1224
1442
|
|
|
1225
|
-
const classList =
|
|
1443
|
+
const classList = getClassList$1(elm);
|
|
1226
1444
|
|
|
1227
1445
|
for (const name in classMap) {
|
|
1228
1446
|
classList.add(name);
|
|
@@ -1246,9 +1464,6 @@ function createStyleAttribute(vnode) {
|
|
|
1246
1464
|
elm,
|
|
1247
1465
|
data: {
|
|
1248
1466
|
styleDecls
|
|
1249
|
-
},
|
|
1250
|
-
owner: {
|
|
1251
|
-
renderer
|
|
1252
1467
|
}
|
|
1253
1468
|
} = vnode;
|
|
1254
1469
|
|
|
@@ -1258,7 +1473,7 @@ function createStyleAttribute(vnode) {
|
|
|
1258
1473
|
|
|
1259
1474
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
1260
1475
|
const [prop, value, important] = styleDecls[i];
|
|
1261
|
-
|
|
1476
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
1262
1477
|
}
|
|
1263
1478
|
}
|
|
1264
1479
|
|
|
@@ -1272,15 +1487,6 @@ var modStaticStyle = {
|
|
|
1272
1487
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1273
1488
|
*/
|
|
1274
1489
|
|
|
1275
|
-
/**
|
|
1276
|
-
@license
|
|
1277
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1278
|
-
This code may only be used under the MIT License found at
|
|
1279
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1280
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1281
|
-
https://github.com/snabbdom/snabbdom/
|
|
1282
|
-
*/
|
|
1283
|
-
|
|
1284
1490
|
function isUndef(s) {
|
|
1285
1491
|
return s === undefined;
|
|
1286
1492
|
}
|
|
@@ -1368,7 +1574,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
|
|
|
1368
1574
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1369
1575
|
// Vnode moved right
|
|
1370
1576
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1371
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1577
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1372
1578
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1373
1579
|
newEndVnode = newCh[--newEndIdx];
|
|
1374
1580
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1850,7 +2056,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
|
1850
2056
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1851
2057
|
}
|
|
1852
2058
|
/*
|
|
1853
|
-
* Copyright (c)
|
|
2059
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1854
2060
|
* All rights reserved.
|
|
1855
2061
|
* SPDX-License-Identifier: MIT
|
|
1856
2062
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -1903,6 +2109,7 @@ const {
|
|
|
1903
2109
|
isArray
|
|
1904
2110
|
} = Array;
|
|
1905
2111
|
const {
|
|
2112
|
+
prototype: ObjectDotPrototype,
|
|
1906
2113
|
getPrototypeOf,
|
|
1907
2114
|
create: ObjectCreate,
|
|
1908
2115
|
defineProperty: ObjectDefineProperty,
|
|
@@ -2552,8 +2759,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2552
2759
|
init();
|
|
2553
2760
|
}
|
|
2554
2761
|
|
|
2555
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2556
|
-
|
|
2557
2762
|
function defaultValueIsObservable(value) {
|
|
2558
2763
|
// intentionally checking for null
|
|
2559
2764
|
if (value === null) {
|
|
@@ -2581,99 +2786,85 @@ const defaultValueMutated = (obj, key) => {
|
|
|
2581
2786
|
/* do nothing */
|
|
2582
2787
|
};
|
|
2583
2788
|
|
|
2584
|
-
const defaultValueDistortion = value => value;
|
|
2585
|
-
|
|
2586
2789
|
function createShadowTarget(value) {
|
|
2587
2790
|
return isArray(value) ? [] : {};
|
|
2588
2791
|
}
|
|
2589
2792
|
|
|
2590
|
-
class
|
|
2591
|
-
constructor(options) {
|
|
2592
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2593
|
-
this.valueMutated = defaultValueMutated;
|
|
2594
|
-
this.valueObserved = defaultValueObserved;
|
|
2595
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2793
|
+
class ObservableMembrane {
|
|
2794
|
+
constructor(options = {}) {
|
|
2596
2795
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2597
2796
|
this.reactiveObjectGraph = new WeakMap();
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2609
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2610
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2611
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2612
|
-
}
|
|
2797
|
+
const {
|
|
2798
|
+
valueMutated,
|
|
2799
|
+
valueObserved,
|
|
2800
|
+
valueIsObservable,
|
|
2801
|
+
tagPropertyKey
|
|
2802
|
+
} = options;
|
|
2803
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2804
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2805
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2806
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2613
2807
|
}
|
|
2614
2808
|
|
|
2615
2809
|
getProxy(value) {
|
|
2616
2810
|
const unwrappedValue = unwrap$1(value);
|
|
2617
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2618
2811
|
|
|
2619
|
-
if (this.valueIsObservable(
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
// we return the readonly.
|
|
2812
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2813
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2814
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2623
2815
|
return value;
|
|
2624
2816
|
}
|
|
2625
2817
|
|
|
2626
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2818
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2627
2819
|
}
|
|
2628
2820
|
|
|
2629
|
-
return
|
|
2821
|
+
return unwrappedValue;
|
|
2630
2822
|
}
|
|
2631
2823
|
|
|
2632
2824
|
getReadOnlyProxy(value) {
|
|
2633
2825
|
value = unwrap$1(value);
|
|
2634
|
-
const distorted = this.valueDistortion(value);
|
|
2635
2826
|
|
|
2636
|
-
if (this.valueIsObservable(
|
|
2637
|
-
return this.getReadOnlyHandler(value
|
|
2827
|
+
if (this.valueIsObservable(value)) {
|
|
2828
|
+
return this.getReadOnlyHandler(value);
|
|
2638
2829
|
}
|
|
2639
2830
|
|
|
2640
|
-
return
|
|
2831
|
+
return value;
|
|
2641
2832
|
}
|
|
2642
2833
|
|
|
2643
2834
|
unwrapProxy(p) {
|
|
2644
2835
|
return unwrap$1(p);
|
|
2645
2836
|
}
|
|
2646
2837
|
|
|
2647
|
-
getReactiveHandler(value
|
|
2648
|
-
let proxy = this.reactiveObjectGraph.get(
|
|
2838
|
+
getReactiveHandler(value) {
|
|
2839
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2649
2840
|
|
|
2650
2841
|
if (isUndefined(proxy)) {
|
|
2651
2842
|
// caching the proxy after the first time it is accessed
|
|
2652
|
-
const handler = new ReactiveProxyHandler(this,
|
|
2653
|
-
proxy = new Proxy(createShadowTarget(
|
|
2843
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2844
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2654
2845
|
registerProxy(proxy, value);
|
|
2655
|
-
this.reactiveObjectGraph.set(
|
|
2846
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2656
2847
|
}
|
|
2657
2848
|
|
|
2658
2849
|
return proxy;
|
|
2659
2850
|
}
|
|
2660
2851
|
|
|
2661
|
-
getReadOnlyHandler(value
|
|
2662
|
-
let proxy = this.readOnlyObjectGraph.get(
|
|
2852
|
+
getReadOnlyHandler(value) {
|
|
2853
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2663
2854
|
|
|
2664
2855
|
if (isUndefined(proxy)) {
|
|
2665
2856
|
// caching the proxy after the first time it is accessed
|
|
2666
|
-
const handler = new ReadOnlyHandler(this,
|
|
2667
|
-
proxy = new Proxy(createShadowTarget(
|
|
2857
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2858
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2668
2859
|
registerProxy(proxy, value);
|
|
2669
|
-
this.readOnlyObjectGraph.set(
|
|
2860
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2670
2861
|
}
|
|
2671
2862
|
|
|
2672
2863
|
return proxy;
|
|
2673
2864
|
}
|
|
2674
2865
|
|
|
2675
2866
|
}
|
|
2676
|
-
/** version:
|
|
2867
|
+
/** version: 2.0.0 */
|
|
2677
2868
|
|
|
2678
2869
|
/*
|
|
2679
2870
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2684,15 +2875,9 @@ class ReactiveMembrane {
|
|
|
2684
2875
|
|
|
2685
2876
|
|
|
2686
2877
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2687
|
-
|
|
2688
|
-
function valueDistortion(value) {
|
|
2689
|
-
return value;
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2878
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2693
2879
|
valueObserved,
|
|
2694
2880
|
valueMutated,
|
|
2695
|
-
valueDistortion,
|
|
2696
2881
|
tagPropertyKey: lockerLivePropertyKey
|
|
2697
2882
|
});
|
|
2698
2883
|
/**
|
|
@@ -2701,16 +2886,9 @@ const reactiveMembrane = new ReactiveMembrane({
|
|
|
2701
2886
|
* change or being removed.
|
|
2702
2887
|
*/
|
|
2703
2888
|
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
if (unwrapped !== value) {
|
|
2708
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2709
|
-
return valueDistortion(unwrapped);
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2712
|
-
return value;
|
|
2713
|
-
};
|
|
2889
|
+
function unwrap(value) {
|
|
2890
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2891
|
+
}
|
|
2714
2892
|
/*
|
|
2715
2893
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2716
2894
|
* All rights reserved.
|
|
@@ -2798,9 +2976,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
2798
2976
|
|
|
2799
2977
|
|
|
2800
2978
|
const LightningElement = function () {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2979
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2804
2980
|
if (isNull(vmBeingConstructed)) {
|
|
2805
2981
|
throw new ReferenceError('Illegal constructor');
|
|
2806
2982
|
}
|
|
@@ -2808,15 +2984,14 @@ const LightningElement = function () {
|
|
|
2808
2984
|
const vm = vmBeingConstructed;
|
|
2809
2985
|
const {
|
|
2810
2986
|
def,
|
|
2811
|
-
elm
|
|
2812
|
-
renderer
|
|
2987
|
+
elm
|
|
2813
2988
|
} = vm;
|
|
2814
2989
|
const {
|
|
2815
2990
|
bridge
|
|
2816
2991
|
} = def;
|
|
2817
2992
|
|
|
2818
2993
|
if (process.env.NODE_ENV !== 'production') {
|
|
2819
|
-
|
|
2994
|
+
assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
|
|
2820
2995
|
}
|
|
2821
2996
|
|
|
2822
2997
|
const component = this;
|
|
@@ -2846,7 +3021,7 @@ const LightningElement = function () {
|
|
|
2846
3021
|
if (vm.renderMode === 1
|
|
2847
3022
|
/* Shadow */
|
|
2848
3023
|
) {
|
|
2849
|
-
|
|
3024
|
+
doAttachShadow(vm);
|
|
2850
3025
|
} // Adding extra guard rails in DEV mode.
|
|
2851
3026
|
|
|
2852
3027
|
|
|
@@ -2858,17 +3033,16 @@ const LightningElement = function () {
|
|
|
2858
3033
|
return this;
|
|
2859
3034
|
};
|
|
2860
3035
|
|
|
2861
|
-
function
|
|
3036
|
+
function doAttachShadow(vm) {
|
|
2862
3037
|
const {
|
|
2863
3038
|
elm,
|
|
2864
3039
|
mode,
|
|
2865
|
-
renderer,
|
|
2866
3040
|
shadowMode,
|
|
2867
3041
|
def: {
|
|
2868
3042
|
ctor
|
|
2869
3043
|
}
|
|
2870
3044
|
} = vm;
|
|
2871
|
-
const cmpRoot =
|
|
3045
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2872
3046
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2873
3047
|
/* Synthetic */
|
|
2874
3048
|
,
|
|
@@ -2895,21 +3069,15 @@ LightningElement.prototype = {
|
|
|
2895
3069
|
|
|
2896
3070
|
dispatchEvent(event) {
|
|
2897
3071
|
const {
|
|
2898
|
-
elm
|
|
2899
|
-
renderer: {
|
|
2900
|
-
dispatchEvent
|
|
2901
|
-
}
|
|
3072
|
+
elm
|
|
2902
3073
|
} = getAssociatedVM(this);
|
|
2903
|
-
return dispatchEvent(elm, event);
|
|
3074
|
+
return dispatchEvent$1(elm, event);
|
|
2904
3075
|
},
|
|
2905
3076
|
|
|
2906
3077
|
addEventListener(type, listener, options) {
|
|
2907
3078
|
const vm = getAssociatedVM(this);
|
|
2908
3079
|
const {
|
|
2909
|
-
elm
|
|
2910
|
-
renderer: {
|
|
2911
|
-
addEventListener
|
|
2912
|
-
}
|
|
3080
|
+
elm
|
|
2913
3081
|
} = vm;
|
|
2914
3082
|
|
|
2915
3083
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2920,92 +3088,68 @@ LightningElement.prototype = {
|
|
|
2920
3088
|
}
|
|
2921
3089
|
|
|
2922
3090
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2923
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
3091
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2924
3092
|
},
|
|
2925
3093
|
|
|
2926
3094
|
removeEventListener(type, listener, options) {
|
|
2927
3095
|
const vm = getAssociatedVM(this);
|
|
2928
3096
|
const {
|
|
2929
|
-
elm
|
|
2930
|
-
renderer: {
|
|
2931
|
-
removeEventListener
|
|
2932
|
-
}
|
|
3097
|
+
elm
|
|
2933
3098
|
} = vm;
|
|
2934
3099
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2935
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
3100
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2936
3101
|
},
|
|
2937
3102
|
|
|
2938
3103
|
hasAttribute(name) {
|
|
2939
3104
|
const {
|
|
2940
|
-
elm
|
|
2941
|
-
renderer: {
|
|
2942
|
-
getAttribute
|
|
2943
|
-
}
|
|
3105
|
+
elm
|
|
2944
3106
|
} = getAssociatedVM(this);
|
|
2945
|
-
return !isNull(getAttribute(elm, name));
|
|
3107
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2946
3108
|
},
|
|
2947
3109
|
|
|
2948
3110
|
hasAttributeNS(namespace, name) {
|
|
2949
3111
|
const {
|
|
2950
|
-
elm
|
|
2951
|
-
renderer: {
|
|
2952
|
-
getAttribute
|
|
2953
|
-
}
|
|
3112
|
+
elm
|
|
2954
3113
|
} = getAssociatedVM(this);
|
|
2955
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
3114
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2956
3115
|
},
|
|
2957
3116
|
|
|
2958
3117
|
removeAttribute(name) {
|
|
2959
3118
|
const {
|
|
2960
|
-
elm
|
|
2961
|
-
renderer: {
|
|
2962
|
-
removeAttribute
|
|
2963
|
-
}
|
|
3119
|
+
elm
|
|
2964
3120
|
} = getAssociatedVM(this);
|
|
2965
3121
|
unlockAttribute(elm, name);
|
|
2966
|
-
removeAttribute(elm, name);
|
|
3122
|
+
removeAttribute$1(elm, name);
|
|
2967
3123
|
lockAttribute();
|
|
2968
3124
|
},
|
|
2969
3125
|
|
|
2970
3126
|
removeAttributeNS(namespace, name) {
|
|
2971
3127
|
const {
|
|
2972
|
-
elm
|
|
2973
|
-
renderer: {
|
|
2974
|
-
removeAttribute
|
|
2975
|
-
}
|
|
3128
|
+
elm
|
|
2976
3129
|
} = getAssociatedVM(this);
|
|
2977
3130
|
unlockAttribute(elm, name);
|
|
2978
|
-
removeAttribute(elm, name, namespace);
|
|
3131
|
+
removeAttribute$1(elm, name, namespace);
|
|
2979
3132
|
lockAttribute();
|
|
2980
3133
|
},
|
|
2981
3134
|
|
|
2982
3135
|
getAttribute(name) {
|
|
2983
3136
|
const {
|
|
2984
|
-
elm
|
|
2985
|
-
renderer: {
|
|
2986
|
-
getAttribute
|
|
2987
|
-
}
|
|
3137
|
+
elm
|
|
2988
3138
|
} = getAssociatedVM(this);
|
|
2989
|
-
return getAttribute(elm, name);
|
|
3139
|
+
return getAttribute$1(elm, name);
|
|
2990
3140
|
},
|
|
2991
3141
|
|
|
2992
3142
|
getAttributeNS(namespace, name) {
|
|
2993
3143
|
const {
|
|
2994
|
-
elm
|
|
2995
|
-
renderer: {
|
|
2996
|
-
getAttribute
|
|
2997
|
-
}
|
|
3144
|
+
elm
|
|
2998
3145
|
} = getAssociatedVM(this);
|
|
2999
|
-
return getAttribute(elm, name, namespace);
|
|
3146
|
+
return getAttribute$1(elm, name, namespace);
|
|
3000
3147
|
},
|
|
3001
3148
|
|
|
3002
3149
|
setAttribute(name, value) {
|
|
3003
3150
|
const vm = getAssociatedVM(this);
|
|
3004
3151
|
const {
|
|
3005
|
-
elm
|
|
3006
|
-
renderer: {
|
|
3007
|
-
setAttribute
|
|
3008
|
-
}
|
|
3152
|
+
elm
|
|
3009
3153
|
} = vm;
|
|
3010
3154
|
|
|
3011
3155
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3013,17 +3157,14 @@ LightningElement.prototype = {
|
|
|
3013
3157
|
}
|
|
3014
3158
|
|
|
3015
3159
|
unlockAttribute(elm, name);
|
|
3016
|
-
setAttribute(elm, name, value);
|
|
3160
|
+
setAttribute$1(elm, name, value);
|
|
3017
3161
|
lockAttribute();
|
|
3018
3162
|
},
|
|
3019
3163
|
|
|
3020
3164
|
setAttributeNS(namespace, name, value) {
|
|
3021
3165
|
const vm = getAssociatedVM(this);
|
|
3022
3166
|
const {
|
|
3023
|
-
elm
|
|
3024
|
-
renderer: {
|
|
3025
|
-
setAttribute
|
|
3026
|
-
}
|
|
3167
|
+
elm
|
|
3027
3168
|
} = vm;
|
|
3028
3169
|
|
|
3029
3170
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3031,43 +3172,34 @@ LightningElement.prototype = {
|
|
|
3031
3172
|
}
|
|
3032
3173
|
|
|
3033
3174
|
unlockAttribute(elm, name);
|
|
3034
|
-
setAttribute(elm, name, value, namespace);
|
|
3175
|
+
setAttribute$1(elm, name, value, namespace);
|
|
3035
3176
|
lockAttribute();
|
|
3036
3177
|
},
|
|
3037
3178
|
|
|
3038
3179
|
getBoundingClientRect() {
|
|
3039
3180
|
const vm = getAssociatedVM(this);
|
|
3040
3181
|
const {
|
|
3041
|
-
elm
|
|
3042
|
-
renderer: {
|
|
3043
|
-
getBoundingClientRect
|
|
3044
|
-
}
|
|
3182
|
+
elm
|
|
3045
3183
|
} = vm;
|
|
3046
3184
|
|
|
3047
3185
|
if (process.env.NODE_ENV !== 'production') {
|
|
3048
3186
|
warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
|
|
3049
3187
|
}
|
|
3050
3188
|
|
|
3051
|
-
return getBoundingClientRect(elm);
|
|
3189
|
+
return getBoundingClientRect$1(elm);
|
|
3052
3190
|
},
|
|
3053
3191
|
|
|
3054
3192
|
get isConnected() {
|
|
3055
3193
|
const {
|
|
3056
|
-
elm
|
|
3057
|
-
renderer: {
|
|
3058
|
-
isConnected
|
|
3059
|
-
}
|
|
3194
|
+
elm
|
|
3060
3195
|
} = getAssociatedVM(this);
|
|
3061
|
-
return isConnected(elm);
|
|
3196
|
+
return isConnected$1(elm);
|
|
3062
3197
|
},
|
|
3063
3198
|
|
|
3064
3199
|
get classList() {
|
|
3065
3200
|
const vm = getAssociatedVM(this);
|
|
3066
3201
|
const {
|
|
3067
|
-
elm
|
|
3068
|
-
renderer: {
|
|
3069
|
-
getClassList
|
|
3070
|
-
}
|
|
3202
|
+
elm
|
|
3071
3203
|
} = vm;
|
|
3072
3204
|
|
|
3073
3205
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3076,7 +3208,7 @@ LightningElement.prototype = {
|
|
|
3076
3208
|
assert.isFalse(isBeingConstructed(vm), `Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
|
|
3077
3209
|
}
|
|
3078
3210
|
|
|
3079
|
-
return getClassList(elm);
|
|
3211
|
+
return getClassList$1(elm);
|
|
3080
3212
|
},
|
|
3081
3213
|
|
|
3082
3214
|
get template() {
|
|
@@ -3110,23 +3242,48 @@ LightningElement.prototype = {
|
|
|
3110
3242
|
}
|
|
3111
3243
|
|
|
3112
3244
|
};
|
|
3113
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
3114
|
-
|
|
3245
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
3246
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
3247
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
3248
|
+
|
|
3249
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
3250
|
+
|
|
3251
|
+
function getChildGetter(methodName) {
|
|
3252
|
+
switch (methodName) {
|
|
3253
|
+
case 'children':
|
|
3254
|
+
return getChildren$1;
|
|
3255
|
+
|
|
3256
|
+
case 'childNodes':
|
|
3257
|
+
return getChildNodes$1;
|
|
3258
|
+
|
|
3259
|
+
case 'firstChild':
|
|
3260
|
+
return getFirstChild$1;
|
|
3261
|
+
|
|
3262
|
+
case 'firstElementChild':
|
|
3263
|
+
return getFirstElementChild$1;
|
|
3264
|
+
|
|
3265
|
+
case 'lastChild':
|
|
3266
|
+
return getLastChild$1;
|
|
3115
3267
|
|
|
3116
|
-
|
|
3117
|
-
|
|
3268
|
+
case 'lastElementChild':
|
|
3269
|
+
return getLastElementChild$1;
|
|
3270
|
+
}
|
|
3271
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
3272
|
+
|
|
3273
|
+
|
|
3274
|
+
for (const childGetter of childGetters) {
|
|
3275
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
3118
3276
|
get() {
|
|
3119
3277
|
const vm = getAssociatedVM(this);
|
|
3120
3278
|
const {
|
|
3121
|
-
elm
|
|
3122
|
-
renderer
|
|
3279
|
+
elm
|
|
3123
3280
|
} = vm;
|
|
3124
3281
|
|
|
3125
3282
|
if (process.env.NODE_ENV !== 'production') {
|
|
3126
|
-
warnIfInvokedDuringConstruction(vm,
|
|
3283
|
+
warnIfInvokedDuringConstruction(vm, childGetter);
|
|
3127
3284
|
}
|
|
3128
3285
|
|
|
3129
|
-
return
|
|
3286
|
+
return getChildGetter(childGetter)(elm);
|
|
3130
3287
|
},
|
|
3131
3288
|
|
|
3132
3289
|
configurable: true,
|
|
@@ -3134,22 +3291,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
|
|
|
3134
3291
|
};
|
|
3135
3292
|
}
|
|
3136
3293
|
|
|
3137
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3294
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
3295
|
+
|
|
3296
|
+
function getQueryMethod(methodName) {
|
|
3297
|
+
switch (methodName) {
|
|
3298
|
+
case 'getElementsByClassName':
|
|
3299
|
+
return getElementsByClassName$1;
|
|
3300
|
+
|
|
3301
|
+
case 'getElementsByTagName':
|
|
3302
|
+
return getElementsByTagName$1;
|
|
3303
|
+
|
|
3304
|
+
case 'querySelector':
|
|
3305
|
+
return querySelector$1;
|
|
3306
|
+
|
|
3307
|
+
case 'querySelectorAll':
|
|
3308
|
+
return querySelectorAll$1;
|
|
3309
|
+
}
|
|
3310
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
3311
|
+
|
|
3138
3312
|
|
|
3139
3313
|
for (const queryMethod of queryMethods) {
|
|
3140
3314
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
3141
3315
|
value(arg) {
|
|
3142
3316
|
const vm = getAssociatedVM(this);
|
|
3143
3317
|
const {
|
|
3144
|
-
elm
|
|
3145
|
-
renderer
|
|
3318
|
+
elm
|
|
3146
3319
|
} = vm;
|
|
3147
3320
|
|
|
3148
3321
|
if (process.env.NODE_ENV !== 'production') {
|
|
3149
3322
|
warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
|
|
3150
3323
|
}
|
|
3151
3324
|
|
|
3152
|
-
return
|
|
3325
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
3153
3326
|
},
|
|
3154
3327
|
|
|
3155
3328
|
configurable: true,
|
|
@@ -4185,10 +4358,6 @@ function createComponentDef(Ctor) {
|
|
|
4185
4358
|
|
|
4186
4359
|
assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
4187
4360
|
|
|
4188
|
-
if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
4189
|
-
assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
|
|
4190
|
-
}
|
|
4191
|
-
|
|
4192
4361
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
4193
4362
|
assert.invariant(ctorShadowSupportMode === "any"
|
|
4194
4363
|
/* Any */
|
|
@@ -4432,17 +4601,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
|
|
|
4432
4601
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
4433
4602
|
|
|
4434
4603
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
4435
|
-
|
|
4604
|
+
getClassList$1(elm).add(token);
|
|
4436
4605
|
}
|
|
4437
4606
|
}
|
|
4438
4607
|
|
|
4439
4608
|
function updateNodeHook(oldVnode, vnode) {
|
|
4440
4609
|
const {
|
|
4441
4610
|
elm,
|
|
4442
|
-
text
|
|
4443
|
-
owner: {
|
|
4444
|
-
renderer
|
|
4445
|
-
}
|
|
4611
|
+
text
|
|
4446
4612
|
} = vnode;
|
|
4447
4613
|
|
|
4448
4614
|
if (oldVnode.text !== text) {
|
|
@@ -4450,7 +4616,7 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4450
4616
|
unlockDomMutation();
|
|
4451
4617
|
}
|
|
4452
4618
|
|
|
4453
|
-
|
|
4619
|
+
setText$1(elm, text);
|
|
4454
4620
|
|
|
4455
4621
|
if (process.env.NODE_ENV !== 'production') {
|
|
4456
4622
|
lockDomMutation();
|
|
@@ -4459,15 +4625,11 @@ function updateNodeHook(oldVnode, vnode) {
|
|
|
4459
4625
|
}
|
|
4460
4626
|
|
|
4461
4627
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
4462
|
-
const {
|
|
4463
|
-
renderer
|
|
4464
|
-
} = vnode.owner;
|
|
4465
|
-
|
|
4466
4628
|
if (process.env.NODE_ENV !== 'production') {
|
|
4467
4629
|
unlockDomMutation();
|
|
4468
4630
|
}
|
|
4469
4631
|
|
|
4470
|
-
|
|
4632
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
4471
4633
|
|
|
4472
4634
|
if (process.env.NODE_ENV !== 'production') {
|
|
4473
4635
|
lockDomMutation();
|
|
@@ -4475,15 +4637,11 @@ function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
|
4475
4637
|
}
|
|
4476
4638
|
|
|
4477
4639
|
function removeNodeHook(vnode, parentNode) {
|
|
4478
|
-
const {
|
|
4479
|
-
renderer
|
|
4480
|
-
} = vnode.owner;
|
|
4481
|
-
|
|
4482
4640
|
if (process.env.NODE_ENV !== 'production') {
|
|
4483
4641
|
unlockDomMutation();
|
|
4484
4642
|
}
|
|
4485
4643
|
|
|
4486
|
-
|
|
4644
|
+
remove$1(vnode.elm, parentNode);
|
|
4487
4645
|
|
|
4488
4646
|
if (process.env.NODE_ENV !== 'production') {
|
|
4489
4647
|
lockDomMutation();
|
|
@@ -4575,13 +4733,15 @@ function updateElmHook(oldVnode, vnode) {
|
|
|
4575
4733
|
|
|
4576
4734
|
function updateChildrenHook(oldVnode, vnode) {
|
|
4577
4735
|
const {
|
|
4578
|
-
|
|
4579
|
-
|
|
4736
|
+
elm,
|
|
4737
|
+
children
|
|
4580
4738
|
} = vnode;
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
}
|
|
4739
|
+
|
|
4740
|
+
if (hasDynamicChildren(children)) {
|
|
4741
|
+
updateDynamicChildren(elm, oldVnode.children, children);
|
|
4742
|
+
} else {
|
|
4743
|
+
updateStaticChildren(elm, oldVnode.children, children);
|
|
4744
|
+
}
|
|
4585
4745
|
}
|
|
4586
4746
|
|
|
4587
4747
|
function allocateChildrenHook(vnode, vm) {
|
|
@@ -4647,8 +4807,7 @@ function createViewModelHook(elm, vnode) {
|
|
|
4647
4807
|
createVM(elm, def, {
|
|
4648
4808
|
mode,
|
|
4649
4809
|
owner,
|
|
4650
|
-
tagName: sel
|
|
4651
|
-
renderer: owner.renderer
|
|
4810
|
+
tagName: sel
|
|
4652
4811
|
});
|
|
4653
4812
|
|
|
4654
4813
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4694,16 +4853,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
|
|
|
4694
4853
|
const {
|
|
4695
4854
|
data: {
|
|
4696
4855
|
attrs = {}
|
|
4697
|
-
},
|
|
4698
|
-
owner: {
|
|
4699
|
-
renderer
|
|
4700
4856
|
}
|
|
4701
4857
|
} = vnode;
|
|
4702
4858
|
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4703
4859
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4704
4860
|
|
|
4705
4861
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4706
|
-
const elmAttrValue =
|
|
4862
|
+
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
4707
4863
|
|
|
4708
4864
|
if (String(attrValue) !== elmAttrValue) {
|
|
4709
4865
|
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
@@ -4719,9 +4875,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4719
4875
|
data: {
|
|
4720
4876
|
className,
|
|
4721
4877
|
classMap
|
|
4722
|
-
},
|
|
4723
|
-
owner: {
|
|
4724
|
-
renderer
|
|
4725
4878
|
}
|
|
4726
4879
|
} = vnode;
|
|
4727
4880
|
let nodesAreCompatible = true;
|
|
@@ -4733,7 +4886,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
|
4733
4886
|
vnodeClassName = className;
|
|
4734
4887
|
} else if (!isUndefined$1(classMap)) {
|
|
4735
4888
|
// classMap is used when class is set to static value.
|
|
4736
|
-
const classList =
|
|
4889
|
+
const classList = getClassList$1(elm);
|
|
4737
4890
|
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4738
4891
|
|
|
4739
4892
|
for (const name in classMap) {
|
|
@@ -4763,12 +4916,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
|
|
|
4763
4916
|
data: {
|
|
4764
4917
|
style,
|
|
4765
4918
|
styleDecls
|
|
4766
|
-
},
|
|
4767
|
-
owner: {
|
|
4768
|
-
renderer
|
|
4769
4919
|
}
|
|
4770
4920
|
} = vnode;
|
|
4771
|
-
const elmStyle =
|
|
4921
|
+
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
4772
4922
|
let vnodeStyle;
|
|
4773
4923
|
let nodesAreCompatible = true;
|
|
4774
4924
|
|
|
@@ -4905,12 +5055,12 @@ function hasDynamicChildren(children) {
|
|
|
4905
5055
|
*/
|
|
4906
5056
|
|
|
4907
5057
|
|
|
4908
|
-
function getUpgradableConstructor(tagName
|
|
5058
|
+
function getUpgradableConstructor(tagName) {
|
|
4909
5059
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
4910
5060
|
// produce only tags with lowercase letters
|
|
4911
5061
|
// But, for backwards compatibility, we will lower case the tagName
|
|
4912
5062
|
tagName = tagName.toLowerCase();
|
|
4913
|
-
let CE =
|
|
5063
|
+
let CE = getCustomElement$1(tagName);
|
|
4914
5064
|
|
|
4915
5065
|
if (!isUndefined$1(CE)) {
|
|
4916
5066
|
return CE;
|
|
@@ -4921,7 +5071,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4921
5071
|
*/
|
|
4922
5072
|
|
|
4923
5073
|
|
|
4924
|
-
CE = class LWCUpgradableElement extends
|
|
5074
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
4925
5075
|
constructor(upgradeCallback) {
|
|
4926
5076
|
super();
|
|
4927
5077
|
|
|
@@ -4931,7 +5081,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
4931
5081
|
}
|
|
4932
5082
|
|
|
4933
5083
|
};
|
|
4934
|
-
|
|
5084
|
+
defineCustomElement$1(tagName, CE);
|
|
4935
5085
|
return CE;
|
|
4936
5086
|
}
|
|
4937
5087
|
/*
|
|
@@ -4949,10 +5099,7 @@ const TextHook = {
|
|
|
4949
5099
|
const {
|
|
4950
5100
|
owner
|
|
4951
5101
|
} = vnode;
|
|
4952
|
-
const
|
|
4953
|
-
renderer
|
|
4954
|
-
} = owner;
|
|
4955
|
-
const elm = renderer.createText(vnode.text);
|
|
5102
|
+
const elm = createText$1(vnode.text);
|
|
4956
5103
|
linkNodeToShadow(elm, owner);
|
|
4957
5104
|
vnode.elm = elm;
|
|
4958
5105
|
},
|
|
@@ -4986,10 +5133,7 @@ const CommentHook = {
|
|
|
4986
5133
|
owner,
|
|
4987
5134
|
text
|
|
4988
5135
|
} = vnode;
|
|
4989
|
-
const
|
|
4990
|
-
renderer
|
|
4991
|
-
} = owner;
|
|
4992
|
-
const elm = renderer.createComment(text);
|
|
5136
|
+
const elm = createComment$1(text);
|
|
4993
5137
|
linkNodeToShadow(elm, owner);
|
|
4994
5138
|
vnode.elm = elm;
|
|
4995
5139
|
},
|
|
@@ -5031,11 +5175,8 @@ const ElementHook = {
|
|
|
5031
5175
|
svg
|
|
5032
5176
|
}
|
|
5033
5177
|
} = vnode;
|
|
5034
|
-
const {
|
|
5035
|
-
renderer
|
|
5036
|
-
} = owner;
|
|
5037
5178
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
5038
|
-
const elm =
|
|
5179
|
+
const elm = createElement$1(sel, namespace);
|
|
5039
5180
|
linkNodeToShadow(elm, owner);
|
|
5040
5181
|
fallbackElmHook(elm, vnode);
|
|
5041
5182
|
vnode.elm = elm;
|
|
@@ -5095,10 +5236,7 @@ const CustomElementHook = {
|
|
|
5095
5236
|
sel,
|
|
5096
5237
|
owner
|
|
5097
5238
|
} = vnode;
|
|
5098
|
-
const
|
|
5099
|
-
renderer
|
|
5100
|
-
} = owner;
|
|
5101
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5239
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5102
5240
|
/**
|
|
5103
5241
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
5104
5242
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -5191,8 +5329,7 @@ const CustomElementHook = {
|
|
|
5191
5329
|
createVM(elm, def, {
|
|
5192
5330
|
mode,
|
|
5193
5331
|
owner,
|
|
5194
|
-
tagName: sel
|
|
5195
|
-
renderer: owner.renderer
|
|
5332
|
+
tagName: sel
|
|
5196
5333
|
});
|
|
5197
5334
|
vnode.elm = elm;
|
|
5198
5335
|
const vm = getAssociatedVM(elm);
|
|
@@ -5221,12 +5358,11 @@ const CustomElementHook = {
|
|
|
5221
5358
|
|
|
5222
5359
|
function linkNodeToShadow(elm, owner) {
|
|
5223
5360
|
const {
|
|
5224
|
-
renderer,
|
|
5225
5361
|
renderMode,
|
|
5226
5362
|
shadowMode
|
|
5227
5363
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
5228
5364
|
|
|
5229
|
-
if (
|
|
5365
|
+
if (isSyntheticShadowDefined$1) {
|
|
5230
5366
|
if (shadowMode === 1
|
|
5231
5367
|
/* Synthetic */
|
|
5232
5368
|
|| renderMode === 0
|
|
@@ -5758,7 +5894,6 @@ function updateStylesheetToken(vm, template) {
|
|
|
5758
5894
|
const {
|
|
5759
5895
|
elm,
|
|
5760
5896
|
context,
|
|
5761
|
-
renderer,
|
|
5762
5897
|
renderMode,
|
|
5763
5898
|
shadowMode
|
|
5764
5899
|
} = vm;
|
|
@@ -5785,11 +5920,11 @@ function updateStylesheetToken(vm, template) {
|
|
|
5785
5920
|
} = context;
|
|
5786
5921
|
|
|
5787
5922
|
if (oldHasTokenInClass) {
|
|
5788
|
-
|
|
5923
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
5789
5924
|
}
|
|
5790
5925
|
|
|
5791
5926
|
if (oldHasTokenInAttribute) {
|
|
5792
|
-
|
|
5927
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
5793
5928
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5794
5929
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5795
5930
|
|
|
@@ -5801,12 +5936,12 @@ function updateStylesheetToken(vm, template) {
|
|
|
5801
5936
|
|
|
5802
5937
|
if (!isUndefined$1(newToken)) {
|
|
5803
5938
|
if (hasScopedStyles) {
|
|
5804
|
-
|
|
5939
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
5805
5940
|
newHasTokenInClass = true;
|
|
5806
5941
|
}
|
|
5807
5942
|
|
|
5808
5943
|
if (isSyntheticShadow) {
|
|
5809
|
-
|
|
5944
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
5810
5945
|
newHasTokenInAttribute = true;
|
|
5811
5946
|
}
|
|
5812
5947
|
} // Update the styling tokens present on the context object.
|
|
@@ -5819,6 +5954,7 @@ function updateStylesheetToken(vm, template) {
|
|
|
5819
5954
|
|
|
5820
5955
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5821
5956
|
const content = [];
|
|
5957
|
+
let root;
|
|
5822
5958
|
|
|
5823
5959
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5824
5960
|
let stylesheet = stylesheets[i];
|
|
@@ -5831,23 +5967,46 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5831
5967
|
// the component instance might be attempting to use an old version of
|
|
5832
5968
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5833
5969
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5834
|
-
}
|
|
5835
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5970
|
+
}
|
|
5836
5971
|
|
|
5972
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5973
|
+
|
|
5974
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5975
|
+
/* Synthetic */
|
|
5976
|
+
&& vm.renderMode === 1
|
|
5977
|
+
/* Shadow */
|
|
5978
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5979
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5837
5980
|
|
|
5838
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5839
5981
|
const useActualHostSelector = vm.renderMode === 0
|
|
5840
5982
|
/* Light */
|
|
5841
5983
|
? !isScopedCss : vm.shadowMode === 0
|
|
5842
5984
|
/* Native */
|
|
5843
|
-
; //
|
|
5985
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5986
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5844
5987
|
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5988
|
+
let useNativeDirPseudoclass;
|
|
5989
|
+
|
|
5990
|
+
if (vm.renderMode === 1
|
|
5848
5991
|
/* Shadow */
|
|
5849
|
-
|
|
5850
|
-
|
|
5992
|
+
) {
|
|
5993
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5994
|
+
/* Native */
|
|
5995
|
+
;
|
|
5996
|
+
} else {
|
|
5997
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5998
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5999
|
+
if (isUndefined$1(root)) {
|
|
6000
|
+
// Only calculate the root once as necessary
|
|
6001
|
+
root = getNearestShadowComponent(vm);
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
6005
|
+
/* Native */
|
|
6006
|
+
;
|
|
6007
|
+
}
|
|
6008
|
+
|
|
6009
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5851
6010
|
}
|
|
5852
6011
|
}
|
|
5853
6012
|
|
|
@@ -5871,14 +6030,12 @@ function getStylesheetsContent(vm, template) {
|
|
|
5871
6030
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
5872
6031
|
|
|
5873
6032
|
|
|
5874
|
-
function
|
|
6033
|
+
function getNearestShadowComponent(vm) {
|
|
5875
6034
|
let owner = vm;
|
|
5876
6035
|
|
|
5877
6036
|
while (!isNull(owner)) {
|
|
5878
6037
|
if (owner.renderMode === 1
|
|
5879
6038
|
/* Shadow */
|
|
5880
|
-
&& owner.shadowMode === 0
|
|
5881
|
-
/* Native */
|
|
5882
6039
|
) {
|
|
5883
6040
|
return owner;
|
|
5884
6041
|
}
|
|
@@ -5889,9 +6046,22 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
5889
6046
|
return owner;
|
|
5890
6047
|
}
|
|
5891
6048
|
|
|
6049
|
+
function getNearestNativeShadowComponent(vm) {
|
|
6050
|
+
const owner = getNearestShadowComponent(vm);
|
|
6051
|
+
|
|
6052
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
6053
|
+
/* Synthetic */
|
|
6054
|
+
) {
|
|
6055
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
6056
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
6057
|
+
return null;
|
|
6058
|
+
}
|
|
6059
|
+
|
|
6060
|
+
return owner;
|
|
6061
|
+
}
|
|
6062
|
+
|
|
5892
6063
|
function createStylesheet(vm, stylesheets) {
|
|
5893
6064
|
const {
|
|
5894
|
-
renderer,
|
|
5895
6065
|
renderMode,
|
|
5896
6066
|
shadowMode
|
|
5897
6067
|
} = vm;
|
|
@@ -5902,9 +6072,9 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5902
6072
|
/* Synthetic */
|
|
5903
6073
|
) {
|
|
5904
6074
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5905
|
-
|
|
6075
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
5906
6076
|
}
|
|
5907
|
-
} else if (
|
|
6077
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
5908
6078
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
5909
6079
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
5910
6080
|
// the first time the VM renders.
|
|
@@ -5918,10 +6088,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5918
6088
|
|
|
5919
6089
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5920
6090
|
if (isGlobal) {
|
|
5921
|
-
|
|
6091
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
5922
6092
|
} else {
|
|
5923
6093
|
// local level
|
|
5924
|
-
|
|
6094
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
5925
6095
|
}
|
|
5926
6096
|
}
|
|
5927
6097
|
}
|
|
@@ -6555,7 +6725,6 @@ function createVM(elm, def, options) {
|
|
|
6555
6725
|
const {
|
|
6556
6726
|
mode,
|
|
6557
6727
|
owner,
|
|
6558
|
-
renderer,
|
|
6559
6728
|
tagName
|
|
6560
6729
|
} = options;
|
|
6561
6730
|
const vm = {
|
|
@@ -6570,7 +6739,6 @@ function createVM(elm, def, options) {
|
|
|
6570
6739
|
tagName,
|
|
6571
6740
|
mode,
|
|
6572
6741
|
owner,
|
|
6573
|
-
renderer,
|
|
6574
6742
|
children: EmptyArray,
|
|
6575
6743
|
aChildren: EmptyArray,
|
|
6576
6744
|
velements: EmptyArray,
|
|
@@ -6625,16 +6793,11 @@ function createVM(elm, def, options) {
|
|
|
6625
6793
|
|
|
6626
6794
|
function computeShadowMode(vm) {
|
|
6627
6795
|
const {
|
|
6628
|
-
def
|
|
6629
|
-
renderer
|
|
6796
|
+
def
|
|
6630
6797
|
} = vm;
|
|
6631
|
-
const {
|
|
6632
|
-
isNativeShadowDefined,
|
|
6633
|
-
isSyntheticShadowDefined
|
|
6634
|
-
} = renderer;
|
|
6635
6798
|
let shadowMode;
|
|
6636
6799
|
|
|
6637
|
-
if (isSyntheticShadowDefined) {
|
|
6800
|
+
if (isSyntheticShadowDefined$1) {
|
|
6638
6801
|
if (def.renderMode === 0
|
|
6639
6802
|
/* Light */
|
|
6640
6803
|
) {
|
|
@@ -6643,7 +6806,7 @@ function computeShadowMode(vm) {
|
|
|
6643
6806
|
shadowMode = 0
|
|
6644
6807
|
/* Native */
|
|
6645
6808
|
;
|
|
6646
|
-
} else if (isNativeShadowDefined) {
|
|
6809
|
+
} else if (isNativeShadowDefined$1) {
|
|
6647
6810
|
if (def.shadowSupportMode === "any"
|
|
6648
6811
|
/* Any */
|
|
6649
6812
|
) {
|
|
@@ -6783,13 +6946,12 @@ function patchShadowRoot(vm, newCh) {
|
|
|
6783
6946
|
|
|
6784
6947
|
function runRenderedCallback(vm) {
|
|
6785
6948
|
const {
|
|
6786
|
-
renderer,
|
|
6787
6949
|
def: {
|
|
6788
6950
|
renderedCallback
|
|
6789
6951
|
}
|
|
6790
6952
|
} = vm;
|
|
6791
6953
|
|
|
6792
|
-
if (isTrue(
|
|
6954
|
+
if (isTrue(ssr$1)) {
|
|
6793
6955
|
return;
|
|
6794
6956
|
}
|
|
6795
6957
|
|
|
@@ -7015,8 +7177,7 @@ function recursivelyDisconnectChildren(vnodes) {
|
|
|
7015
7177
|
|
|
7016
7178
|
function resetComponentRoot(vm) {
|
|
7017
7179
|
const {
|
|
7018
|
-
children
|
|
7019
|
-
renderer
|
|
7180
|
+
children
|
|
7020
7181
|
} = vm;
|
|
7021
7182
|
const rootNode = getRenderRoot(vm);
|
|
7022
7183
|
|
|
@@ -7024,7 +7185,7 @@ function resetComponentRoot(vm) {
|
|
|
7024
7185
|
const child = children[i];
|
|
7025
7186
|
|
|
7026
7187
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
7027
|
-
|
|
7188
|
+
remove$1(child.elm, rootNode);
|
|
7028
7189
|
}
|
|
7029
7190
|
}
|
|
7030
7191
|
|
|
@@ -7034,7 +7195,7 @@ function resetComponentRoot(vm) {
|
|
|
7034
7195
|
}
|
|
7035
7196
|
|
|
7036
7197
|
function scheduleRehydration(vm) {
|
|
7037
|
-
if (isTrue(
|
|
7198
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
7038
7199
|
return;
|
|
7039
7200
|
}
|
|
7040
7201
|
|
|
@@ -7261,7 +7422,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7261
7422
|
|
|
7262
7423
|
const {
|
|
7263
7424
|
elm,
|
|
7264
|
-
renderer,
|
|
7265
7425
|
context: {
|
|
7266
7426
|
wiredConnecting,
|
|
7267
7427
|
wiredDisconnecting
|
|
@@ -7288,7 +7448,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
7288
7448
|
}
|
|
7289
7449
|
|
|
7290
7450
|
});
|
|
7291
|
-
|
|
7451
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
7292
7452
|
});
|
|
7293
7453
|
}
|
|
7294
7454
|
|
|
@@ -7553,7 +7713,7 @@ function setHooks(hooks) {
|
|
|
7553
7713
|
hooksAreSet = true;
|
|
7554
7714
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7555
7715
|
}
|
|
7556
|
-
/* version: 2.
|
|
7716
|
+
/* version: 2.6.3 */
|
|
7557
7717
|
|
|
7558
7718
|
/*
|
|
7559
7719
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -7627,7 +7787,7 @@ function registerCustomElement(name, ctor) {
|
|
|
7627
7787
|
reverseRegistry.set(ctor, name);
|
|
7628
7788
|
}
|
|
7629
7789
|
|
|
7630
|
-
class
|
|
7790
|
+
class HTMLElementImpl {
|
|
7631
7791
|
constructor() {
|
|
7632
7792
|
const {
|
|
7633
7793
|
constructor
|
|
@@ -7643,275 +7803,321 @@ class HTMLElement$1 {
|
|
|
7643
7803
|
|
|
7644
7804
|
}
|
|
7645
7805
|
|
|
7646
|
-
const
|
|
7647
|
-
ssr: true,
|
|
7648
|
-
|
|
7649
|
-
isHydrating() {
|
|
7650
|
-
return false;
|
|
7651
|
-
},
|
|
7806
|
+
const ssr = true;
|
|
7652
7807
|
|
|
7653
|
-
|
|
7654
|
-
|
|
7808
|
+
function isHydrating() {
|
|
7809
|
+
return false;
|
|
7810
|
+
}
|
|
7655
7811
|
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
const nodeIndex = node.parent.children.indexOf(node);
|
|
7659
|
-
node.parent.children.splice(nodeIndex, 1);
|
|
7660
|
-
}
|
|
7812
|
+
const isNativeShadowDefined = false;
|
|
7813
|
+
const isSyntheticShadowDefined = false;
|
|
7661
7814
|
|
|
7662
|
-
|
|
7663
|
-
|
|
7815
|
+
function insert(node, parent, anchor) {
|
|
7816
|
+
if (node.parent !== null && node.parent !== parent) {
|
|
7817
|
+
const nodeIndex = node.parent.children.indexOf(node);
|
|
7818
|
+
node.parent.children.splice(nodeIndex, 1);
|
|
7819
|
+
}
|
|
7664
7820
|
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
} else {
|
|
7668
|
-
parent.children.splice(anchorIndex, 0, node);
|
|
7669
|
-
}
|
|
7670
|
-
},
|
|
7821
|
+
node.parent = parent;
|
|
7822
|
+
const anchorIndex = isNull(anchor) ? -1 : parent.children.indexOf(anchor);
|
|
7671
7823
|
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7824
|
+
if (anchorIndex === -1) {
|
|
7825
|
+
parent.children.push(node);
|
|
7826
|
+
} else {
|
|
7827
|
+
parent.children.splice(anchorIndex, 0, node);
|
|
7828
|
+
}
|
|
7829
|
+
}
|
|
7676
7830
|
|
|
7677
|
-
|
|
7831
|
+
function remove(node, parent) {
|
|
7832
|
+
const nodeIndex = parent.children.indexOf(node);
|
|
7833
|
+
parent.children.splice(nodeIndex, 1);
|
|
7834
|
+
}
|
|
7678
7835
|
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7836
|
+
function createText(content) {
|
|
7837
|
+
return {
|
|
7838
|
+
type: HostNodeType.Text,
|
|
7839
|
+
value: String(content),
|
|
7840
|
+
parent: null
|
|
7841
|
+
};
|
|
7842
|
+
}
|
|
7686
7843
|
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7844
|
+
function createComment(content) {
|
|
7845
|
+
return {
|
|
7846
|
+
type: HostNodeType.Comment,
|
|
7847
|
+
value: content,
|
|
7848
|
+
parent: null
|
|
7849
|
+
};
|
|
7850
|
+
}
|
|
7694
7851
|
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7852
|
+
function nextSibling(node) {
|
|
7853
|
+
const {
|
|
7854
|
+
parent
|
|
7855
|
+
} = node;
|
|
7699
7856
|
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7857
|
+
if (isNull(parent)) {
|
|
7858
|
+
return null;
|
|
7859
|
+
}
|
|
7703
7860
|
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7861
|
+
const nodeIndex = parent.children.indexOf(node);
|
|
7862
|
+
return parent.children[nodeIndex + 1] || null;
|
|
7863
|
+
}
|
|
7707
7864
|
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7865
|
+
function attachShadow(element, config) {
|
|
7866
|
+
element.shadowRoot = {
|
|
7867
|
+
type: HostNodeType.ShadowRoot,
|
|
7868
|
+
children: [],
|
|
7869
|
+
mode: config.mode,
|
|
7870
|
+
delegatesFocus: !!config.delegatesFocus
|
|
7871
|
+
};
|
|
7872
|
+
return element.shadowRoot;
|
|
7873
|
+
}
|
|
7717
7874
|
|
|
7718
|
-
|
|
7719
|
-
|
|
7875
|
+
function getProperty(node, key) {
|
|
7876
|
+
var _a, _b;
|
|
7720
7877
|
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7878
|
+
if (key in node) {
|
|
7879
|
+
return node[key];
|
|
7880
|
+
}
|
|
7724
7881
|
|
|
7725
|
-
|
|
7726
|
-
|
|
7882
|
+
if (node.type === HostNodeType.Element) {
|
|
7883
|
+
const attrName = htmlPropertyToAttribute(key); // Handle all the boolean properties.
|
|
7727
7884
|
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7885
|
+
if (isBooleanAttribute(attrName, node.name)) {
|
|
7886
|
+
return (_a = getAttribute(node, attrName)) !== null && _a !== void 0 ? _a : false;
|
|
7887
|
+
} // Handle global html attributes and AOM.
|
|
7731
7888
|
|
|
7732
7889
|
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7890
|
+
if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
|
|
7891
|
+
return getAttribute(node, attrName);
|
|
7892
|
+
} // Handle special elements live bindings. The checked property is already handled above
|
|
7893
|
+
// in the boolean case.
|
|
7737
7894
|
|
|
7738
7895
|
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
}
|
|
7896
|
+
if (node.name === 'input' && key === 'value') {
|
|
7897
|
+
return (_b = getAttribute(node, 'value')) !== null && _b !== void 0 ? _b : '';
|
|
7742
7898
|
}
|
|
7899
|
+
}
|
|
7743
7900
|
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7901
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7902
|
+
// eslint-disable-next-line no-console
|
|
7903
|
+
console.error(`Unexpected "${key}" property access from the renderer`);
|
|
7904
|
+
}
|
|
7905
|
+
}
|
|
7749
7906
|
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7907
|
+
function setProperty(node, key, value) {
|
|
7908
|
+
if (key in node) {
|
|
7909
|
+
return node[key] = value;
|
|
7910
|
+
}
|
|
7754
7911
|
|
|
7755
|
-
|
|
7756
|
-
|
|
7912
|
+
if (node.type === HostNodeType.Element) {
|
|
7913
|
+
const attrName = htmlPropertyToAttribute(key);
|
|
7757
7914
|
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7915
|
+
if (key === 'innerHTML') {
|
|
7916
|
+
node.children = [{
|
|
7917
|
+
type: HostNodeType.Raw,
|
|
7918
|
+
parent: node,
|
|
7919
|
+
value
|
|
7920
|
+
}];
|
|
7921
|
+
return;
|
|
7922
|
+
} // Handle all the boolean properties.
|
|
7766
7923
|
|
|
7767
7924
|
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7925
|
+
if (isBooleanAttribute(attrName, node.name)) {
|
|
7926
|
+
return value === true ? setAttribute(node, attrName, '') : removeAttribute(node, attrName);
|
|
7927
|
+
} // Handle global html attributes and AOM.
|
|
7771
7928
|
|
|
7772
7929
|
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7930
|
+
if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
|
|
7931
|
+
return setAttribute(node, attrName, value);
|
|
7932
|
+
} // Handle special elements live bindings. The checked property is already handled above
|
|
7933
|
+
// in the boolean case.
|
|
7777
7934
|
|
|
7778
7935
|
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
}
|
|
7936
|
+
if (node.name === 'input' && attrName === 'value') {
|
|
7937
|
+
return isNull(value) || isUndefined$1(value) ? removeAttribute(node, 'value') : setAttribute(node, 'value', value);
|
|
7782
7938
|
}
|
|
7939
|
+
}
|
|
7783
7940
|
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7941
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7942
|
+
// eslint-disable-next-line no-console
|
|
7943
|
+
console.error(`Unexpected attempt to set "${key}=${value}" property from the renderer`);
|
|
7944
|
+
}
|
|
7945
|
+
}
|
|
7789
7946
|
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7947
|
+
function setText(node, content) {
|
|
7948
|
+
if (node.type === HostNodeType.Text) {
|
|
7949
|
+
node.value = content;
|
|
7950
|
+
} else if (node.type === HostNodeType.Element) {
|
|
7951
|
+
node.children = [{
|
|
7952
|
+
type: HostNodeType.Text,
|
|
7953
|
+
parent: node,
|
|
7954
|
+
value: content
|
|
7955
|
+
}];
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7801
7958
|
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7959
|
+
function getAttribute(element, name, namespace = null) {
|
|
7960
|
+
const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
|
|
7961
|
+
return attribute ? attribute.value : null;
|
|
7962
|
+
}
|
|
7806
7963
|
|
|
7807
|
-
|
|
7808
|
-
|
|
7964
|
+
function setAttribute(element, name, value, namespace = null) {
|
|
7965
|
+
const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
|
|
7809
7966
|
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7967
|
+
if (isUndefined$1(namespace)) {
|
|
7968
|
+
namespace = null;
|
|
7969
|
+
}
|
|
7970
|
+
|
|
7971
|
+
if (isUndefined$1(attribute)) {
|
|
7972
|
+
element.attributes.push({
|
|
7973
|
+
name,
|
|
7974
|
+
namespace,
|
|
7975
|
+
value: String(value)
|
|
7976
|
+
});
|
|
7977
|
+
} else {
|
|
7978
|
+
attribute.value = value;
|
|
7979
|
+
}
|
|
7980
|
+
}
|
|
7981
|
+
|
|
7982
|
+
function removeAttribute(element, name, namespace) {
|
|
7983
|
+
element.attributes = element.attributes.filter(attr => attr.name !== name && attr.namespace !== namespace);
|
|
7984
|
+
}
|
|
7985
|
+
|
|
7986
|
+
function getClassList(element) {
|
|
7987
|
+
function getClassAttribute() {
|
|
7988
|
+
let classAttribute = element.attributes.find(attr => attr.name === 'class' && isNull(attr.namespace));
|
|
7989
|
+
|
|
7990
|
+
if (isUndefined$1(classAttribute)) {
|
|
7991
|
+
classAttribute = {
|
|
7992
|
+
name: 'class',
|
|
7993
|
+
namespace: null,
|
|
7994
|
+
value: ''
|
|
7995
|
+
};
|
|
7996
|
+
element.attributes.push(classAttribute);
|
|
7818
7997
|
}
|
|
7819
|
-
},
|
|
7820
7998
|
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
},
|
|
7999
|
+
return classAttribute;
|
|
8000
|
+
}
|
|
7824
8001
|
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
namespace: null,
|
|
7833
|
-
value: ''
|
|
7834
|
-
};
|
|
7835
|
-
element.attributes.push(classAttribute);
|
|
7836
|
-
}
|
|
8002
|
+
return {
|
|
8003
|
+
add(...names) {
|
|
8004
|
+
const classAttribute = getClassAttribute();
|
|
8005
|
+
const tokenList = classNameToTokenList(classAttribute.value);
|
|
8006
|
+
names.forEach(name => tokenList.add(name));
|
|
8007
|
+
classAttribute.value = tokenListToClassName(tokenList);
|
|
8008
|
+
},
|
|
7837
8009
|
|
|
7838
|
-
|
|
8010
|
+
remove(...names) {
|
|
8011
|
+
const classAttribute = getClassAttribute();
|
|
8012
|
+
const tokenList = classNameToTokenList(classAttribute.value);
|
|
8013
|
+
names.forEach(name => tokenList.delete(name));
|
|
8014
|
+
classAttribute.value = tokenListToClassName(tokenList);
|
|
7839
8015
|
}
|
|
7840
8016
|
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
const classAttribute = getClassAttribute();
|
|
7844
|
-
const tokenList = classNameToTokenList(classAttribute.value);
|
|
7845
|
-
names.forEach(name => tokenList.add(name));
|
|
7846
|
-
classAttribute.value = tokenListToClassName(tokenList);
|
|
7847
|
-
},
|
|
8017
|
+
};
|
|
8018
|
+
}
|
|
7848
8019
|
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
names.forEach(name => tokenList.delete(name));
|
|
7853
|
-
classAttribute.value = tokenListToClassName(tokenList);
|
|
7854
|
-
}
|
|
8020
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
8021
|
+
const styleAttribute = element.attributes.find(attr => attr.name === 'style' && isNull(attr.namespace));
|
|
8022
|
+
const serializedProperty = `${name}: ${value}${important ? ' !important' : ''}`;
|
|
7855
8023
|
|
|
7856
|
-
|
|
7857
|
-
|
|
8024
|
+
if (isUndefined$1(styleAttribute)) {
|
|
8025
|
+
element.attributes.push({
|
|
8026
|
+
name: 'style',
|
|
8027
|
+
namespace: null,
|
|
8028
|
+
value: serializedProperty
|
|
8029
|
+
});
|
|
8030
|
+
} else {
|
|
8031
|
+
styleAttribute.value += `; ${serializedProperty}`;
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
7858
8034
|
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
8035
|
+
function isConnected(node) {
|
|
8036
|
+
return !isNull(node.parent);
|
|
8037
|
+
} // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
8038
|
+
// synthetic shadow.
|
|
7862
8039
|
|
|
7863
|
-
if (isUndefined$1(styleAttribute)) {
|
|
7864
|
-
element.attributes.push({
|
|
7865
|
-
name: 'style',
|
|
7866
|
-
namespace: null,
|
|
7867
|
-
value: serializedProperty
|
|
7868
|
-
});
|
|
7869
|
-
} else {
|
|
7870
|
-
styleAttribute.value += `; ${serializedProperty}`;
|
|
7871
|
-
}
|
|
7872
|
-
},
|
|
7873
8040
|
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
},
|
|
8041
|
+
const insertGlobalStylesheet = noop; // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
8042
|
+
// synthetic shadow.
|
|
7877
8043
|
|
|
7878
|
-
|
|
7879
|
-
// synthetic shadow.
|
|
7880
|
-
},
|
|
8044
|
+
const insertStylesheet = noop; // Noop on SSR.
|
|
7881
8045
|
|
|
7882
|
-
|
|
7883
|
-
// synthetic shadow.
|
|
7884
|
-
},
|
|
8046
|
+
const addEventListener = noop; // Noop on SSR.
|
|
7885
8047
|
|
|
7886
|
-
|
|
7887
|
-
|
|
8048
|
+
const removeEventListener = noop;
|
|
8049
|
+
const dispatchEvent = unsupportedMethod('dispatchEvent');
|
|
8050
|
+
const getBoundingClientRect = unsupportedMethod('getBoundingClientRect');
|
|
8051
|
+
const querySelector = unsupportedMethod('querySelector');
|
|
8052
|
+
const querySelectorAll = unsupportedMethod('querySelectorAll');
|
|
8053
|
+
const getElementsByTagName = unsupportedMethod('getElementsByTagName');
|
|
8054
|
+
const getElementsByClassName = unsupportedMethod('getElementsByClassName');
|
|
8055
|
+
const getChildren = unsupportedMethod('getChildren');
|
|
8056
|
+
const getChildNodes = unsupportedMethod('getChildNodes');
|
|
8057
|
+
const getFirstChild = unsupportedMethod('getFirstChild');
|
|
8058
|
+
const getFirstElementChild = unsupportedMethod('getFirstElementChild');
|
|
8059
|
+
const getLastChild = unsupportedMethod('getLastChild');
|
|
8060
|
+
const getLastElementChild = unsupportedMethod('getLastElementChild');
|
|
7888
8061
|
|
|
7889
|
-
|
|
7890
|
-
|
|
8062
|
+
function defineCustomElement(name, constructor, _options) {
|
|
8063
|
+
registerCustomElement(name, constructor);
|
|
8064
|
+
}
|
|
7891
8065
|
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
querySelectorAll: unsupportedMethod('querySelectorAll'),
|
|
7896
|
-
getElementsByTagName: unsupportedMethod('getElementsByTagName'),
|
|
7897
|
-
getElementsByClassName: unsupportedMethod('getElementsByClassName'),
|
|
7898
|
-
getChildren: unsupportedMethod('getChildren'),
|
|
7899
|
-
getChildNodes: unsupportedMethod('getChildNodes'),
|
|
7900
|
-
getFirstChild: unsupportedMethod('getFirstChild'),
|
|
7901
|
-
getFirstElementChild: unsupportedMethod('getFirstElementChild'),
|
|
7902
|
-
getLastChild: unsupportedMethod('getLastChild'),
|
|
7903
|
-
getLastElementChild: unsupportedMethod('getLastElementChild'),
|
|
7904
|
-
|
|
7905
|
-
defineCustomElement(name, constructor, _options) {
|
|
7906
|
-
registerCustomElement(name, constructor);
|
|
7907
|
-
},
|
|
8066
|
+
function getCustomElement(name) {
|
|
8067
|
+
return registry[name];
|
|
8068
|
+
}
|
|
7908
8069
|
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
},
|
|
8070
|
+
const HTMLElementExported = HTMLElementImpl;
|
|
8071
|
+
/* noop */
|
|
7912
8072
|
|
|
7913
|
-
|
|
7914
|
-
|
|
8073
|
+
const assertInstanceOfHTMLElement = noop;
|
|
8074
|
+
/*
|
|
8075
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
8076
|
+
* All rights reserved.
|
|
8077
|
+
* SPDX-License-Identifier: MIT
|
|
8078
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8079
|
+
*/
|
|
8080
|
+
|
|
8081
|
+
setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
|
|
8082
|
+
setAttachShadow(attachShadow);
|
|
8083
|
+
setCreateComment(createComment);
|
|
8084
|
+
setCreateElement(createElement);
|
|
8085
|
+
setCreateText(createText);
|
|
8086
|
+
setDefineCustomElement(defineCustomElement);
|
|
8087
|
+
setDispatchEvent(dispatchEvent);
|
|
8088
|
+
setGetAttribute(getAttribute);
|
|
8089
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
8090
|
+
setGetChildNodes(getChildNodes);
|
|
8091
|
+
setGetChildren(getChildren);
|
|
8092
|
+
setGetClassList(getClassList);
|
|
8093
|
+
setGetCustomElement(getCustomElement);
|
|
8094
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
8095
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
8096
|
+
setGetFirstChild(getFirstChild);
|
|
8097
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
8098
|
+
setGetLastChild(getLastChild);
|
|
8099
|
+
setGetLastElementChild(getLastElementChild);
|
|
8100
|
+
setGetProperty(getProperty);
|
|
8101
|
+
setHTMLElement(HTMLElementExported);
|
|
8102
|
+
setInsert(insert);
|
|
8103
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
8104
|
+
setInsertStylesheet(insertStylesheet);
|
|
8105
|
+
setIsConnected(isConnected);
|
|
8106
|
+
setIsHydrating(isHydrating);
|
|
8107
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
8108
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
8109
|
+
setNextSibling(nextSibling);
|
|
8110
|
+
setQuerySelector(querySelector);
|
|
8111
|
+
setQuerySelectorAll(querySelectorAll);
|
|
8112
|
+
setRemove(remove);
|
|
8113
|
+
setRemoveAttribute(removeAttribute);
|
|
8114
|
+
setRemoveEventListener(removeEventListener);
|
|
8115
|
+
setSetAttribute(setAttribute);
|
|
8116
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
8117
|
+
setSetProperty(setProperty);
|
|
8118
|
+
setSetText(setText);
|
|
8119
|
+
setSsr(ssr);
|
|
8120
|
+
setAddEventListener(addEventListener);
|
|
7915
8121
|
/*
|
|
7916
8122
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
7917
8123
|
* All rights reserved.
|
|
@@ -8022,12 +8228,11 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8022
8228
|
throw new TypeError(`"renderComponent" expects an object as the third parameter but instead received ${props}.`);
|
|
8023
8229
|
}
|
|
8024
8230
|
|
|
8025
|
-
const element =
|
|
8231
|
+
const element = createElement(tagName);
|
|
8026
8232
|
const def = getComponentInternalDef(Ctor);
|
|
8027
8233
|
createVM(element, def, {
|
|
8028
8234
|
mode: 'open',
|
|
8029
8235
|
owner: null,
|
|
8030
|
-
renderer,
|
|
8031
8236
|
tagName
|
|
8032
8237
|
});
|
|
8033
8238
|
|
|
@@ -8049,6 +8254,6 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8049
8254
|
|
|
8050
8255
|
freeze(LightningElement);
|
|
8051
8256
|
seal(LightningElement.prototype);
|
|
8052
|
-
/* version: 2.
|
|
8257
|
+
/* version: 2.6.3 */
|
|
8053
8258
|
|
|
8054
8259
|
export { LightningElement, api$1 as api, createContextProvider, getComponentDef, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|