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
|
@@ -298,7 +298,7 @@ var LWC = (function (exports) {
|
|
|
298
298
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
299
299
|
return attributeName;
|
|
300
300
|
}
|
|
301
|
-
/** version: 2.
|
|
301
|
+
/** version: 2.7.3 */
|
|
302
302
|
|
|
303
303
|
/*
|
|
304
304
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -412,7 +412,6 @@ var LWC = (function (exports) {
|
|
|
412
412
|
ENABLE_NODE_LIST_PATCH: null,
|
|
413
413
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
414
414
|
ENABLE_NODE_PATCH: null,
|
|
415
|
-
ENABLE_MIXED_SHADOW_MODE: null,
|
|
416
415
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
417
416
|
};
|
|
418
417
|
|
|
@@ -469,7 +468,7 @@ var LWC = (function (exports) {
|
|
|
469
468
|
|
|
470
469
|
function setFeatureFlagForTest(name, value) {
|
|
471
470
|
}
|
|
472
|
-
/** version: 2.
|
|
471
|
+
/** version: 2.7.3 */
|
|
473
472
|
|
|
474
473
|
/* proxy-compat-disable */
|
|
475
474
|
|
|
@@ -512,6 +511,243 @@ var LWC = (function (exports) {
|
|
|
512
511
|
|
|
513
512
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
514
513
|
} // Borrowed from Vue template compiler.
|
|
514
|
+
// Primitives
|
|
515
|
+
//
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
let ssr$1;
|
|
519
|
+
|
|
520
|
+
function setSsr(ssrImpl) {
|
|
521
|
+
ssr$1 = ssrImpl;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
let isNativeShadowDefined$1;
|
|
525
|
+
|
|
526
|
+
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
527
|
+
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
let isSyntheticShadowDefined$1;
|
|
531
|
+
|
|
532
|
+
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
533
|
+
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
let HTMLElementExported$1;
|
|
537
|
+
|
|
538
|
+
function setHTMLElement(HTMLElementImpl) {
|
|
539
|
+
HTMLElementExported$1 = HTMLElementImpl;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
let isHydrating$1;
|
|
543
|
+
|
|
544
|
+
function setIsHydrating$1(isHydratingImpl) {
|
|
545
|
+
isHydrating$1 = isHydratingImpl;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
let insert$1;
|
|
549
|
+
|
|
550
|
+
function setInsert(insertImpl) {
|
|
551
|
+
insert$1 = insertImpl;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
let remove$1;
|
|
555
|
+
|
|
556
|
+
function setRemove(removeImpl) {
|
|
557
|
+
remove$1 = removeImpl;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
let createElement$2;
|
|
561
|
+
|
|
562
|
+
function setCreateElement(createElementImpl) {
|
|
563
|
+
createElement$2 = createElementImpl;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
let createText$1;
|
|
567
|
+
|
|
568
|
+
function setCreateText(createTextImpl) {
|
|
569
|
+
createText$1 = createTextImpl;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
let createComment$1;
|
|
573
|
+
|
|
574
|
+
function setCreateComment(createCommentImpl) {
|
|
575
|
+
createComment$1 = createCommentImpl;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
let nextSibling$1;
|
|
579
|
+
|
|
580
|
+
function setNextSibling(nextSiblingImpl) {
|
|
581
|
+
nextSibling$1 = nextSiblingImpl;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
let attachShadow$1;
|
|
585
|
+
|
|
586
|
+
function setAttachShadow(attachShadowImpl) {
|
|
587
|
+
attachShadow$1 = attachShadowImpl;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
let getProperty$1;
|
|
591
|
+
|
|
592
|
+
function setGetProperty(getPropertyImpl) {
|
|
593
|
+
getProperty$1 = getPropertyImpl;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
let setProperty$1;
|
|
597
|
+
|
|
598
|
+
function setSetProperty(setPropertyImpl) {
|
|
599
|
+
setProperty$1 = setPropertyImpl;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
let setText$1;
|
|
603
|
+
|
|
604
|
+
function setSetText(setTextImpl) {
|
|
605
|
+
setText$1 = setTextImpl;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
let getAttribute$1;
|
|
609
|
+
|
|
610
|
+
function setGetAttribute(getAttributeImpl) {
|
|
611
|
+
getAttribute$1 = getAttributeImpl;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
let setAttribute$1;
|
|
615
|
+
|
|
616
|
+
function setSetAttribute(setAttributeImpl) {
|
|
617
|
+
setAttribute$1 = setAttributeImpl;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
let removeAttribute$1;
|
|
621
|
+
|
|
622
|
+
function setRemoveAttribute(removeAttributeImpl) {
|
|
623
|
+
removeAttribute$1 = removeAttributeImpl;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
let addEventListener$1;
|
|
627
|
+
|
|
628
|
+
function setAddEventListener(addEventListenerImpl) {
|
|
629
|
+
addEventListener$1 = addEventListenerImpl;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
let removeEventListener$1;
|
|
633
|
+
|
|
634
|
+
function setRemoveEventListener(removeEventListenerImpl) {
|
|
635
|
+
removeEventListener$1 = removeEventListenerImpl;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
let dispatchEvent$1;
|
|
639
|
+
|
|
640
|
+
function setDispatchEvent(dispatchEventImpl) {
|
|
641
|
+
dispatchEvent$1 = dispatchEventImpl;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
let getClassList$1;
|
|
645
|
+
|
|
646
|
+
function setGetClassList(getClassListImpl) {
|
|
647
|
+
getClassList$1 = getClassListImpl;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
let setCSSStyleProperty$1;
|
|
651
|
+
|
|
652
|
+
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
653
|
+
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
let getBoundingClientRect$1;
|
|
657
|
+
|
|
658
|
+
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
659
|
+
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
let querySelector$1;
|
|
663
|
+
|
|
664
|
+
function setQuerySelector(querySelectorImpl) {
|
|
665
|
+
querySelector$1 = querySelectorImpl;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
let querySelectorAll$1;
|
|
669
|
+
|
|
670
|
+
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
671
|
+
querySelectorAll$1 = querySelectorAllImpl;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
let getElementsByTagName$1;
|
|
675
|
+
|
|
676
|
+
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
677
|
+
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
let getElementsByClassName$1;
|
|
681
|
+
|
|
682
|
+
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
683
|
+
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
let getChildren$1;
|
|
687
|
+
|
|
688
|
+
function setGetChildren(getChildrenImpl) {
|
|
689
|
+
getChildren$1 = getChildrenImpl;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
let getChildNodes$1;
|
|
693
|
+
|
|
694
|
+
function setGetChildNodes(getChildNodesImpl) {
|
|
695
|
+
getChildNodes$1 = getChildNodesImpl;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
let getFirstChild$1;
|
|
699
|
+
|
|
700
|
+
function setGetFirstChild(getFirstChildImpl) {
|
|
701
|
+
getFirstChild$1 = getFirstChildImpl;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
let getFirstElementChild$1;
|
|
705
|
+
|
|
706
|
+
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
707
|
+
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
let getLastChild$1;
|
|
711
|
+
|
|
712
|
+
function setGetLastChild(getLastChildImpl) {
|
|
713
|
+
getLastChild$1 = getLastChildImpl;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
let getLastElementChild$1;
|
|
717
|
+
|
|
718
|
+
function setGetLastElementChild(getLastElementChildImpl) {
|
|
719
|
+
getLastElementChild$1 = getLastElementChildImpl;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
let isConnected$1;
|
|
723
|
+
|
|
724
|
+
function setIsConnected(isConnectedImpl) {
|
|
725
|
+
isConnected$1 = isConnectedImpl;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
let insertGlobalStylesheet$1;
|
|
729
|
+
|
|
730
|
+
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
731
|
+
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
let insertStylesheet$1;
|
|
735
|
+
|
|
736
|
+
function setInsertStylesheet(insertStylesheetImpl) {
|
|
737
|
+
insertStylesheet$1 = insertStylesheetImpl;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
let defineCustomElement$1;
|
|
741
|
+
|
|
742
|
+
function setDefineCustomElement(defineCustomElementImpl) {
|
|
743
|
+
defineCustomElement$1 = defineCustomElementImpl;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
let getCustomElement$1;
|
|
747
|
+
|
|
748
|
+
function setGetCustomElement(getCustomElementImpl) {
|
|
749
|
+
getCustomElement$1 = getCustomElementImpl;
|
|
750
|
+
}
|
|
515
751
|
/*
|
|
516
752
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
517
753
|
* All rights reserved.
|
|
@@ -630,492 +866,8 @@ var LWC = (function (exports) {
|
|
|
630
866
|
|
|
631
867
|
ArrayPush$1.call(this.listeners, reactiveObservers);
|
|
632
868
|
}
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
/*
|
|
636
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
637
|
-
* All rights reserved.
|
|
638
|
-
* SPDX-License-Identifier: MIT
|
|
639
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
function componentValueMutated(vm, key) {
|
|
644
|
-
valueMutated(vm.component, key);
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
function componentValueObserved(vm, key) {
|
|
648
|
-
valueObserved(vm.component, key);
|
|
649
|
-
}
|
|
650
|
-
/*
|
|
651
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
652
|
-
* All rights reserved.
|
|
653
|
-
* SPDX-License-Identifier: MIT
|
|
654
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
655
|
-
*/
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
function getComponentTag(vm) {
|
|
659
|
-
return `<${StringToLowerCase.call(vm.tagName)}>`;
|
|
660
|
-
} // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
function getComponentStack(vm) {
|
|
664
|
-
const stack = [];
|
|
665
|
-
let prefix = '';
|
|
666
|
-
|
|
667
|
-
while (!isNull(vm.owner)) {
|
|
668
|
-
ArrayPush$1.call(stack, prefix + getComponentTag(vm));
|
|
669
|
-
vm = vm.owner;
|
|
670
|
-
prefix += '\t';
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
return ArrayJoin.call(stack, '\n');
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
function getErrorComponentStack(vm) {
|
|
677
|
-
const wcStack = [];
|
|
678
|
-
let currentVm = vm;
|
|
679
|
-
|
|
680
|
-
while (!isNull(currentVm)) {
|
|
681
|
-
ArrayPush$1.call(wcStack, getComponentTag(currentVm));
|
|
682
|
-
currentVm = currentVm.owner;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
return wcStack.reverse().join('\n\t');
|
|
686
|
-
}
|
|
687
|
-
/*
|
|
688
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
689
|
-
* All rights reserved.
|
|
690
|
-
* SPDX-License-Identifier: MIT
|
|
691
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
692
|
-
*/
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
function log(method, message, vm) {
|
|
696
|
-
let msg = `[LWC ${method}]: ${message}`;
|
|
697
|
-
|
|
698
|
-
if (!isUndefined$1(vm)) {
|
|
699
|
-
msg = `${msg}\n${getComponentStack(vm)}`;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
try {
|
|
703
|
-
throw new Error(msg);
|
|
704
|
-
} catch (e) {
|
|
705
|
-
/* eslint-disable-next-line no-console */
|
|
706
|
-
console[method](e);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
function logWarn(message, vm) {
|
|
711
|
-
log('warn', message, vm);
|
|
712
|
-
}
|
|
713
|
-
/*
|
|
714
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
715
|
-
* All rights reserved.
|
|
716
|
-
* SPDX-License-Identifier: MIT
|
|
717
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
718
|
-
*/
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
function handleEvent(event, vnode) {
|
|
722
|
-
const {
|
|
723
|
-
type
|
|
724
|
-
} = event;
|
|
725
|
-
const {
|
|
726
|
-
data: {
|
|
727
|
-
on
|
|
728
|
-
}
|
|
729
|
-
} = vnode;
|
|
730
|
-
const handler = on && on[type]; // call event handler if exists
|
|
731
|
-
|
|
732
|
-
if (handler) {
|
|
733
|
-
handler.call(undefined, event);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
function createListener() {
|
|
738
|
-
return function handler(event) {
|
|
739
|
-
handleEvent(event, handler.vnode);
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
function updateAllEventListeners(oldVnode, vnode) {
|
|
744
|
-
if (isUndefined$1(oldVnode.listener)) {
|
|
745
|
-
createAllEventListeners(vnode);
|
|
746
|
-
} else {
|
|
747
|
-
vnode.listener = oldVnode.listener;
|
|
748
|
-
vnode.listener.vnode = vnode;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
function createAllEventListeners(vnode) {
|
|
753
|
-
const {
|
|
754
|
-
elm,
|
|
755
|
-
data: {
|
|
756
|
-
on
|
|
757
|
-
},
|
|
758
|
-
owner: {
|
|
759
|
-
renderer
|
|
760
|
-
}
|
|
761
|
-
} = vnode;
|
|
762
|
-
|
|
763
|
-
if (isUndefined$1(on)) {
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
const listener = vnode.listener = createListener();
|
|
768
|
-
listener.vnode = vnode;
|
|
769
|
-
let name;
|
|
770
|
-
|
|
771
|
-
for (name in on) {
|
|
772
|
-
renderer.addEventListener(elm, name, listener);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
var modEvents = {
|
|
777
|
-
update: updateAllEventListeners,
|
|
778
|
-
create: createAllEventListeners
|
|
779
|
-
};
|
|
780
|
-
/*
|
|
781
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
782
|
-
* All rights reserved.
|
|
783
|
-
* SPDX-License-Identifier: MIT
|
|
784
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
785
|
-
*/
|
|
786
|
-
|
|
787
|
-
const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
|
|
788
|
-
|
|
789
|
-
function offsetPropertyErrorMessage(name) {
|
|
790
|
-
return `Using the \`${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.`;
|
|
791
|
-
} // Global HTML Attributes & Properties
|
|
792
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
793
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
assign(create(null), {
|
|
797
|
-
accessKey: {
|
|
798
|
-
attribute: 'accesskey'
|
|
799
|
-
},
|
|
800
|
-
accessKeyLabel: {
|
|
801
|
-
readOnly: true
|
|
802
|
-
},
|
|
803
|
-
className: {
|
|
804
|
-
attribute: 'class',
|
|
805
|
-
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.'
|
|
806
|
-
},
|
|
807
|
-
contentEditable: {
|
|
808
|
-
attribute: 'contenteditable'
|
|
809
|
-
},
|
|
810
|
-
dataset: {
|
|
811
|
-
readOnly: true,
|
|
812
|
-
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."
|
|
813
|
-
},
|
|
814
|
-
dir: {
|
|
815
|
-
attribute: 'dir'
|
|
816
|
-
},
|
|
817
|
-
draggable: {
|
|
818
|
-
attribute: 'draggable'
|
|
819
|
-
},
|
|
820
|
-
dropzone: {
|
|
821
|
-
attribute: 'dropzone',
|
|
822
|
-
readOnly: true
|
|
823
|
-
},
|
|
824
|
-
hidden: {
|
|
825
|
-
attribute: 'hidden'
|
|
826
|
-
},
|
|
827
|
-
id: {
|
|
828
|
-
attribute: 'id'
|
|
829
|
-
},
|
|
830
|
-
inputMode: {
|
|
831
|
-
attribute: 'inputmode'
|
|
832
|
-
},
|
|
833
|
-
lang: {
|
|
834
|
-
attribute: 'lang'
|
|
835
|
-
},
|
|
836
|
-
slot: {
|
|
837
|
-
attribute: 'slot',
|
|
838
|
-
error: 'Using the `slot` property is an anti-pattern.'
|
|
839
|
-
},
|
|
840
|
-
spellcheck: {
|
|
841
|
-
attribute: 'spellcheck'
|
|
842
|
-
},
|
|
843
|
-
style: {
|
|
844
|
-
attribute: 'style'
|
|
845
|
-
},
|
|
846
|
-
tabIndex: {
|
|
847
|
-
attribute: 'tabindex'
|
|
848
|
-
},
|
|
849
|
-
title: {
|
|
850
|
-
attribute: 'title'
|
|
851
|
-
},
|
|
852
|
-
translate: {
|
|
853
|
-
attribute: 'translate'
|
|
854
|
-
},
|
|
855
|
-
// additional "global attributes" that are not present in the link above.
|
|
856
|
-
isContentEditable: {
|
|
857
|
-
readOnly: true
|
|
858
|
-
},
|
|
859
|
-
offsetHeight: {
|
|
860
|
-
readOnly: true,
|
|
861
|
-
error: offsetPropertyErrorMessage('offsetHeight')
|
|
862
|
-
},
|
|
863
|
-
offsetLeft: {
|
|
864
|
-
readOnly: true,
|
|
865
|
-
error: offsetPropertyErrorMessage('offsetLeft')
|
|
866
|
-
},
|
|
867
|
-
offsetParent: {
|
|
868
|
-
readOnly: true
|
|
869
|
-
},
|
|
870
|
-
offsetTop: {
|
|
871
|
-
readOnly: true,
|
|
872
|
-
error: offsetPropertyErrorMessage('offsetTop')
|
|
873
|
-
},
|
|
874
|
-
offsetWidth: {
|
|
875
|
-
readOnly: true,
|
|
876
|
-
error: offsetPropertyErrorMessage('offsetWidth')
|
|
877
|
-
},
|
|
878
|
-
role: {
|
|
879
|
-
attribute: 'role'
|
|
880
|
-
}
|
|
881
|
-
});
|
|
882
|
-
let controlledElement = null;
|
|
883
|
-
let controlledAttributeName;
|
|
884
|
-
|
|
885
|
-
function isAttributeLocked(elm, attrName) {
|
|
886
|
-
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
function lockAttribute(_elm, _key) {
|
|
890
|
-
controlledElement = null;
|
|
891
|
-
controlledAttributeName = undefined;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
function unlockAttribute(elm, key) {
|
|
895
|
-
controlledElement = elm;
|
|
896
|
-
controlledAttributeName = key;
|
|
897
|
-
}
|
|
898
|
-
/*
|
|
899
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
900
|
-
* All rights reserved.
|
|
901
|
-
* SPDX-License-Identifier: MIT
|
|
902
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
903
|
-
*/
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
const xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
907
|
-
const xmlNS = 'http://www.w3.org/XML/1998/namespace';
|
|
908
|
-
const ColonCharCode = 58;
|
|
909
|
-
|
|
910
|
-
function updateAttrs(oldVnode, vnode) {
|
|
911
|
-
const {
|
|
912
|
-
data: {
|
|
913
|
-
attrs
|
|
914
|
-
},
|
|
915
|
-
owner: {
|
|
916
|
-
renderer
|
|
917
|
-
}
|
|
918
|
-
} = vnode;
|
|
919
|
-
|
|
920
|
-
if (isUndefined$1(attrs)) {
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
let {
|
|
925
|
-
data: {
|
|
926
|
-
attrs: oldAttrs
|
|
927
|
-
}
|
|
928
|
-
} = oldVnode;
|
|
929
|
-
|
|
930
|
-
if (oldAttrs === attrs) {
|
|
931
|
-
return;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
const elm = vnode.elm;
|
|
935
|
-
const {
|
|
936
|
-
setAttribute,
|
|
937
|
-
removeAttribute
|
|
938
|
-
} = renderer;
|
|
939
|
-
let key;
|
|
940
|
-
oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
|
|
941
|
-
// this routine is only useful for data-* attributes in all kind of elements
|
|
942
|
-
// and aria-* in standard elements (custom elements will use props for these)
|
|
943
|
-
|
|
944
|
-
for (key in attrs) {
|
|
945
|
-
const cur = attrs[key];
|
|
946
|
-
const old = oldAttrs[key];
|
|
947
|
-
|
|
948
|
-
if (old !== cur) {
|
|
949
|
-
unlockAttribute(elm, key);
|
|
950
|
-
|
|
951
|
-
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
952
|
-
// Assume xml namespace
|
|
953
|
-
setAttribute(elm, key, cur, xmlNS);
|
|
954
|
-
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
955
|
-
// Assume xlink namespace
|
|
956
|
-
setAttribute(elm, key, cur, xlinkNS);
|
|
957
|
-
} else if (isNull(cur)) {
|
|
958
|
-
removeAttribute(elm, key);
|
|
959
|
-
} else {
|
|
960
|
-
setAttribute(elm, key, cur);
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
lockAttribute();
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
const emptyVNode$3 = {
|
|
969
|
-
data: {}
|
|
970
|
-
};
|
|
971
|
-
var modAttrs = {
|
|
972
|
-
create: vnode => updateAttrs(emptyVNode$3, vnode),
|
|
973
|
-
update: updateAttrs
|
|
974
|
-
};
|
|
975
|
-
/*
|
|
976
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
977
|
-
* All rights reserved.
|
|
978
|
-
* SPDX-License-Identifier: MIT
|
|
979
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
980
|
-
*/
|
|
981
|
-
|
|
982
|
-
function isLiveBindingProp(sel, key) {
|
|
983
|
-
// For properties with live bindings, we read values from the DOM element
|
|
984
|
-
// instead of relying on internally tracked values.
|
|
985
|
-
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
function update(oldVnode, vnode) {
|
|
989
|
-
const props = vnode.data.props;
|
|
990
|
-
|
|
991
|
-
if (isUndefined$1(props)) {
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
const oldProps = oldVnode.data.props;
|
|
996
|
-
|
|
997
|
-
if (oldProps === props) {
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
const isFirstPatch = isUndefined$1(oldProps);
|
|
1002
|
-
const {
|
|
1003
|
-
elm,
|
|
1004
|
-
sel,
|
|
1005
|
-
owner: {
|
|
1006
|
-
renderer
|
|
1007
|
-
}
|
|
1008
|
-
} = vnode;
|
|
1009
|
-
|
|
1010
|
-
for (const key in props) {
|
|
1011
|
-
const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
|
|
1012
|
-
|
|
1013
|
-
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
|
|
1014
|
-
renderer.setProperty(elm, key, cur);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
const emptyVNode$2 = {
|
|
1020
|
-
data: {}
|
|
1021
|
-
};
|
|
1022
|
-
var modProps = {
|
|
1023
|
-
create: vnode => update(emptyVNode$2, vnode),
|
|
1024
|
-
update
|
|
1025
|
-
};
|
|
1026
|
-
/*
|
|
1027
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1028
|
-
* All rights reserved.
|
|
1029
|
-
* SPDX-License-Identifier: MIT
|
|
1030
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1031
|
-
*/
|
|
1032
|
-
|
|
1033
|
-
const classNameToClassMap = create(null);
|
|
1034
|
-
|
|
1035
|
-
function getMapFromClassName(className) {
|
|
1036
|
-
// Intentionally using == to match undefined and null values from computed style attribute
|
|
1037
|
-
if (className == null) {
|
|
1038
|
-
return EmptyObject;
|
|
1039
|
-
} // computed class names must be string
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
className = isString(className) ? className : className + '';
|
|
1043
|
-
let map = classNameToClassMap[className];
|
|
1044
|
-
|
|
1045
|
-
if (map) {
|
|
1046
|
-
return map;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
map = create(null);
|
|
1050
|
-
let start = 0;
|
|
1051
|
-
let o;
|
|
1052
|
-
const len = className.length;
|
|
1053
|
-
|
|
1054
|
-
for (o = 0; o < len; o++) {
|
|
1055
|
-
if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
|
|
1056
|
-
if (o > start) {
|
|
1057
|
-
map[StringSlice.call(className, start, o)] = true;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
start = o + 1;
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
if (o > start) {
|
|
1065
|
-
map[StringSlice.call(className, start, o)] = true;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
classNameToClassMap[className] = map;
|
|
1069
|
-
|
|
1070
|
-
return map;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
function updateClassAttribute(oldVnode, vnode) {
|
|
1074
|
-
const {
|
|
1075
|
-
elm,
|
|
1076
|
-
data: {
|
|
1077
|
-
className: newClass
|
|
1078
|
-
},
|
|
1079
|
-
owner: {
|
|
1080
|
-
renderer
|
|
1081
|
-
}
|
|
1082
|
-
} = vnode;
|
|
1083
|
-
const {
|
|
1084
|
-
data: {
|
|
1085
|
-
className: oldClass
|
|
1086
|
-
}
|
|
1087
|
-
} = oldVnode;
|
|
1088
|
-
|
|
1089
|
-
if (oldClass === newClass) {
|
|
1090
|
-
return;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
const classList = renderer.getClassList(elm);
|
|
1094
|
-
const newClassMap = getMapFromClassName(newClass);
|
|
1095
|
-
const oldClassMap = getMapFromClassName(oldClass);
|
|
1096
|
-
let name;
|
|
1097
|
-
|
|
1098
|
-
for (name in oldClassMap) {
|
|
1099
|
-
// remove only if it is not in the new class collection and it is not set from within the instance
|
|
1100
|
-
if (isUndefined$1(newClassMap[name])) {
|
|
1101
|
-
classList.remove(name);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
for (name in newClassMap) {
|
|
1106
|
-
if (isUndefined$1(oldClassMap[name])) {
|
|
1107
|
-
classList.add(name);
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
const emptyVNode$1 = {
|
|
1113
|
-
data: {}
|
|
1114
|
-
};
|
|
1115
|
-
var modComputedClassName = {
|
|
1116
|
-
create: vnode => updateClassAttribute(emptyVNode$1, vnode),
|
|
1117
|
-
update: updateClassAttribute
|
|
1118
|
-
};
|
|
869
|
+
|
|
870
|
+
}
|
|
1119
871
|
/*
|
|
1120
872
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1121
873
|
* All rights reserved.
|
|
@@ -1123,106 +875,77 @@ var LWC = (function (exports) {
|
|
|
1123
875
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1124
876
|
*/
|
|
1125
877
|
|
|
1126
|
-
function updateStyleAttribute(oldVnode, vnode) {
|
|
1127
|
-
const {
|
|
1128
|
-
elm,
|
|
1129
|
-
data: {
|
|
1130
|
-
style: newStyle
|
|
1131
|
-
},
|
|
1132
|
-
owner: {
|
|
1133
|
-
renderer
|
|
1134
|
-
}
|
|
1135
|
-
} = vnode;
|
|
1136
|
-
const {
|
|
1137
|
-
setAttribute,
|
|
1138
|
-
removeAttribute
|
|
1139
|
-
} = renderer;
|
|
1140
|
-
|
|
1141
|
-
if (oldVnode.data.style === newStyle) {
|
|
1142
|
-
return;
|
|
1143
|
-
}
|
|
1144
878
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
} else {
|
|
1148
|
-
setAttribute(elm, 'style', newStyle);
|
|
1149
|
-
}
|
|
879
|
+
function componentValueMutated(vm, key) {
|
|
880
|
+
valueMutated(vm.component, key);
|
|
1150
881
|
}
|
|
1151
882
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
}
|
|
1155
|
-
var modComputedStyle = {
|
|
1156
|
-
create: vnode => updateStyleAttribute(emptyVNode, vnode),
|
|
1157
|
-
update: updateStyleAttribute
|
|
1158
|
-
};
|
|
883
|
+
function componentValueObserved(vm, key) {
|
|
884
|
+
valueObserved(vm.component, key);
|
|
885
|
+
}
|
|
1159
886
|
/*
|
|
1160
887
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1161
888
|
* All rights reserved.
|
|
1162
889
|
* SPDX-License-Identifier: MIT
|
|
1163
890
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1164
891
|
*/
|
|
1165
|
-
// The compiler takes care of transforming the inline classnames into an object. It's faster to set the
|
|
1166
|
-
// different classnames properties individually instead of via a string.
|
|
1167
892
|
|
|
1168
|
-
function createClassAttribute(vnode) {
|
|
1169
|
-
const {
|
|
1170
|
-
elm,
|
|
1171
|
-
data: {
|
|
1172
|
-
classMap
|
|
1173
|
-
},
|
|
1174
|
-
owner: {
|
|
1175
|
-
renderer
|
|
1176
|
-
}
|
|
1177
|
-
} = vnode;
|
|
1178
893
|
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
894
|
+
function getComponentTag(vm) {
|
|
895
|
+
return `<${StringToLowerCase.call(vm.tagName)}>`;
|
|
896
|
+
} // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
|
|
1182
897
|
|
|
1183
|
-
const classList = renderer.getClassList(elm);
|
|
1184
898
|
|
|
1185
|
-
|
|
1186
|
-
|
|
899
|
+
function getComponentStack(vm) {
|
|
900
|
+
const stack = [];
|
|
901
|
+
let prefix = '';
|
|
902
|
+
|
|
903
|
+
while (!isNull(vm.owner)) {
|
|
904
|
+
ArrayPush$1.call(stack, prefix + getComponentTag(vm));
|
|
905
|
+
vm = vm.owner;
|
|
906
|
+
prefix += '\t';
|
|
1187
907
|
}
|
|
908
|
+
|
|
909
|
+
return ArrayJoin.call(stack, '\n');
|
|
1188
910
|
}
|
|
1189
911
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
912
|
+
function getErrorComponentStack(vm) {
|
|
913
|
+
const wcStack = [];
|
|
914
|
+
let currentVm = vm;
|
|
915
|
+
|
|
916
|
+
while (!isNull(currentVm)) {
|
|
917
|
+
ArrayPush$1.call(wcStack, getComponentTag(currentVm));
|
|
918
|
+
currentVm = currentVm.owner;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
return wcStack.reverse().join('\n\t');
|
|
922
|
+
}
|
|
1193
923
|
/*
|
|
1194
924
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1195
925
|
* All rights reserved.
|
|
1196
926
|
* SPDX-License-Identifier: MIT
|
|
1197
927
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1198
928
|
*/
|
|
1199
|
-
// The compiler takes care of transforming the inline style into an object. It's faster to set the
|
|
1200
|
-
// different style properties individually instead of via a string.
|
|
1201
929
|
|
|
1202
|
-
function createStyleAttribute(vnode) {
|
|
1203
|
-
const {
|
|
1204
|
-
elm,
|
|
1205
|
-
data: {
|
|
1206
|
-
styleDecls
|
|
1207
|
-
},
|
|
1208
|
-
owner: {
|
|
1209
|
-
renderer
|
|
1210
|
-
}
|
|
1211
|
-
} = vnode;
|
|
1212
930
|
|
|
1213
|
-
|
|
1214
|
-
|
|
931
|
+
function log(method, message, vm) {
|
|
932
|
+
let msg = `[LWC ${method}]: ${message}`;
|
|
933
|
+
|
|
934
|
+
if (!isUndefined$1(vm)) {
|
|
935
|
+
msg = `${msg}\n${getComponentStack(vm)}`;
|
|
1215
936
|
}
|
|
1216
937
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
938
|
+
try {
|
|
939
|
+
throw new Error(msg);
|
|
940
|
+
} catch (e) {
|
|
941
|
+
/* eslint-disable-next-line no-console */
|
|
942
|
+
console[method](e);
|
|
1220
943
|
}
|
|
1221
944
|
}
|
|
1222
945
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
946
|
+
function logWarn(message, vm) {
|
|
947
|
+
log('warn', message, vm);
|
|
948
|
+
}
|
|
1226
949
|
/*
|
|
1227
950
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1228
951
|
* All rights reserved.
|
|
@@ -1230,14 +953,6 @@ var LWC = (function (exports) {
|
|
|
1230
953
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1231
954
|
*/
|
|
1232
955
|
|
|
1233
|
-
/**
|
|
1234
|
-
@license
|
|
1235
|
-
Copyright (c) 2015 Simon Friis Vindum.
|
|
1236
|
-
This code may only be used under the MIT License found at
|
|
1237
|
-
https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
1238
|
-
Code distributed by Snabbdom as part of the Snabbdom project at
|
|
1239
|
-
https://github.com/snabbdom/snabbdom/
|
|
1240
|
-
*/
|
|
1241
956
|
|
|
1242
957
|
function isUndef(s) {
|
|
1243
958
|
return s === undefined;
|
|
@@ -1326,7 +1041,7 @@ var LWC = (function (exports) {
|
|
|
1326
1041
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
|
1327
1042
|
// Vnode moved right
|
|
1328
1043
|
patchVnode(oldStartVnode, newEndVnode);
|
|
1329
|
-
newEndVnode.hook.move(oldStartVnode, parentElm,
|
|
1044
|
+
newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
|
|
1330
1045
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1331
1046
|
newEndVnode = newCh[--newEndIdx];
|
|
1332
1047
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
|
@@ -1439,7 +1154,126 @@ var LWC = (function (exports) {
|
|
|
1439
1154
|
}
|
|
1440
1155
|
}
|
|
1441
1156
|
/*
|
|
1442
|
-
* Copyright (c)
|
|
1157
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1158
|
+
* All rights reserved.
|
|
1159
|
+
* SPDX-License-Identifier: MIT
|
|
1160
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1161
|
+
*/
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
|
|
1165
|
+
|
|
1166
|
+
function offsetPropertyErrorMessage(name) {
|
|
1167
|
+
return `Using the \`${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.`;
|
|
1168
|
+
} // Global HTML Attributes & Properties
|
|
1169
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
1170
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
assign(create(null), {
|
|
1174
|
+
accessKey: {
|
|
1175
|
+
attribute: 'accesskey'
|
|
1176
|
+
},
|
|
1177
|
+
accessKeyLabel: {
|
|
1178
|
+
readOnly: true
|
|
1179
|
+
},
|
|
1180
|
+
className: {
|
|
1181
|
+
attribute: 'class',
|
|
1182
|
+
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.'
|
|
1183
|
+
},
|
|
1184
|
+
contentEditable: {
|
|
1185
|
+
attribute: 'contenteditable'
|
|
1186
|
+
},
|
|
1187
|
+
dataset: {
|
|
1188
|
+
readOnly: true,
|
|
1189
|
+
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."
|
|
1190
|
+
},
|
|
1191
|
+
dir: {
|
|
1192
|
+
attribute: 'dir'
|
|
1193
|
+
},
|
|
1194
|
+
draggable: {
|
|
1195
|
+
attribute: 'draggable'
|
|
1196
|
+
},
|
|
1197
|
+
dropzone: {
|
|
1198
|
+
attribute: 'dropzone',
|
|
1199
|
+
readOnly: true
|
|
1200
|
+
},
|
|
1201
|
+
hidden: {
|
|
1202
|
+
attribute: 'hidden'
|
|
1203
|
+
},
|
|
1204
|
+
id: {
|
|
1205
|
+
attribute: 'id'
|
|
1206
|
+
},
|
|
1207
|
+
inputMode: {
|
|
1208
|
+
attribute: 'inputmode'
|
|
1209
|
+
},
|
|
1210
|
+
lang: {
|
|
1211
|
+
attribute: 'lang'
|
|
1212
|
+
},
|
|
1213
|
+
slot: {
|
|
1214
|
+
attribute: 'slot',
|
|
1215
|
+
error: 'Using the `slot` property is an anti-pattern.'
|
|
1216
|
+
},
|
|
1217
|
+
spellcheck: {
|
|
1218
|
+
attribute: 'spellcheck'
|
|
1219
|
+
},
|
|
1220
|
+
style: {
|
|
1221
|
+
attribute: 'style'
|
|
1222
|
+
},
|
|
1223
|
+
tabIndex: {
|
|
1224
|
+
attribute: 'tabindex'
|
|
1225
|
+
},
|
|
1226
|
+
title: {
|
|
1227
|
+
attribute: 'title'
|
|
1228
|
+
},
|
|
1229
|
+
translate: {
|
|
1230
|
+
attribute: 'translate'
|
|
1231
|
+
},
|
|
1232
|
+
// additional "global attributes" that are not present in the link above.
|
|
1233
|
+
isContentEditable: {
|
|
1234
|
+
readOnly: true
|
|
1235
|
+
},
|
|
1236
|
+
offsetHeight: {
|
|
1237
|
+
readOnly: true,
|
|
1238
|
+
error: offsetPropertyErrorMessage('offsetHeight')
|
|
1239
|
+
},
|
|
1240
|
+
offsetLeft: {
|
|
1241
|
+
readOnly: true,
|
|
1242
|
+
error: offsetPropertyErrorMessage('offsetLeft')
|
|
1243
|
+
},
|
|
1244
|
+
offsetParent: {
|
|
1245
|
+
readOnly: true
|
|
1246
|
+
},
|
|
1247
|
+
offsetTop: {
|
|
1248
|
+
readOnly: true,
|
|
1249
|
+
error: offsetPropertyErrorMessage('offsetTop')
|
|
1250
|
+
},
|
|
1251
|
+
offsetWidth: {
|
|
1252
|
+
readOnly: true,
|
|
1253
|
+
error: offsetPropertyErrorMessage('offsetWidth')
|
|
1254
|
+
},
|
|
1255
|
+
role: {
|
|
1256
|
+
attribute: 'role'
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
let controlledElement = null;
|
|
1260
|
+
let controlledAttributeName;
|
|
1261
|
+
|
|
1262
|
+
function isAttributeLocked(elm, attrName) {
|
|
1263
|
+
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function lockAttribute(_elm, _key) {
|
|
1267
|
+
controlledElement = null;
|
|
1268
|
+
controlledAttributeName = undefined;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function unlockAttribute(elm, key) {
|
|
1272
|
+
controlledElement = elm;
|
|
1273
|
+
controlledAttributeName = key;
|
|
1274
|
+
}
|
|
1275
|
+
/*
|
|
1276
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1443
1277
|
* All rights reserved.
|
|
1444
1278
|
* SPDX-License-Identifier: MIT
|
|
1445
1279
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
@@ -2183,8 +2017,7 @@ var LWC = (function (exports) {
|
|
|
2183
2017
|
|
|
2184
2018
|
|
|
2185
2019
|
const LightningElement = function () {
|
|
2186
|
-
|
|
2187
|
-
|
|
2020
|
+
// This should be as performant as possible, while any initialization should be done lazily
|
|
2188
2021
|
if (isNull(vmBeingConstructed)) {
|
|
2189
2022
|
throw new ReferenceError('Illegal constructor');
|
|
2190
2023
|
}
|
|
@@ -2192,8 +2025,7 @@ var LWC = (function (exports) {
|
|
|
2192
2025
|
const vm = vmBeingConstructed;
|
|
2193
2026
|
const {
|
|
2194
2027
|
def,
|
|
2195
|
-
elm
|
|
2196
|
-
renderer
|
|
2028
|
+
elm
|
|
2197
2029
|
} = vm;
|
|
2198
2030
|
const {
|
|
2199
2031
|
bridge
|
|
@@ -2226,23 +2058,22 @@ var LWC = (function (exports) {
|
|
|
2226
2058
|
if (vm.renderMode === 1
|
|
2227
2059
|
/* Shadow */
|
|
2228
2060
|
) {
|
|
2229
|
-
|
|
2061
|
+
doAttachShadow(vm);
|
|
2230
2062
|
} // Adding extra guard rails in DEV mode.
|
|
2231
2063
|
|
|
2232
2064
|
return this;
|
|
2233
2065
|
};
|
|
2234
2066
|
|
|
2235
|
-
function
|
|
2067
|
+
function doAttachShadow(vm) {
|
|
2236
2068
|
const {
|
|
2237
2069
|
elm,
|
|
2238
2070
|
mode,
|
|
2239
|
-
renderer,
|
|
2240
2071
|
shadowMode,
|
|
2241
2072
|
def: {
|
|
2242
2073
|
ctor
|
|
2243
2074
|
}
|
|
2244
2075
|
} = vm;
|
|
2245
|
-
const cmpRoot =
|
|
2076
|
+
const cmpRoot = attachShadow$1(elm, {
|
|
2246
2077
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1
|
|
2247
2078
|
/* Synthetic */
|
|
2248
2079
|
,
|
|
@@ -2259,163 +2090,121 @@ var LWC = (function (exports) {
|
|
|
2259
2090
|
|
|
2260
2091
|
dispatchEvent(event) {
|
|
2261
2092
|
const {
|
|
2262
|
-
elm
|
|
2263
|
-
renderer: {
|
|
2264
|
-
dispatchEvent
|
|
2265
|
-
}
|
|
2093
|
+
elm
|
|
2266
2094
|
} = getAssociatedVM(this);
|
|
2267
|
-
return dispatchEvent(elm, event);
|
|
2095
|
+
return dispatchEvent$1(elm, event);
|
|
2268
2096
|
},
|
|
2269
2097
|
|
|
2270
2098
|
addEventListener(type, listener, options) {
|
|
2271
2099
|
const vm = getAssociatedVM(this);
|
|
2272
2100
|
const {
|
|
2273
|
-
elm
|
|
2274
|
-
renderer: {
|
|
2275
|
-
addEventListener
|
|
2276
|
-
}
|
|
2101
|
+
elm
|
|
2277
2102
|
} = vm;
|
|
2278
2103
|
|
|
2279
2104
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2280
|
-
addEventListener(elm, type, wrappedListener, options);
|
|
2105
|
+
addEventListener$1(elm, type, wrappedListener, options);
|
|
2281
2106
|
},
|
|
2282
2107
|
|
|
2283
2108
|
removeEventListener(type, listener, options) {
|
|
2284
2109
|
const vm = getAssociatedVM(this);
|
|
2285
2110
|
const {
|
|
2286
|
-
elm
|
|
2287
|
-
renderer: {
|
|
2288
|
-
removeEventListener
|
|
2289
|
-
}
|
|
2111
|
+
elm
|
|
2290
2112
|
} = vm;
|
|
2291
2113
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
2292
|
-
removeEventListener(elm, type, wrappedListener, options);
|
|
2114
|
+
removeEventListener$1(elm, type, wrappedListener, options);
|
|
2293
2115
|
},
|
|
2294
2116
|
|
|
2295
2117
|
hasAttribute(name) {
|
|
2296
2118
|
const {
|
|
2297
|
-
elm
|
|
2298
|
-
renderer: {
|
|
2299
|
-
getAttribute
|
|
2300
|
-
}
|
|
2119
|
+
elm
|
|
2301
2120
|
} = getAssociatedVM(this);
|
|
2302
|
-
return !isNull(getAttribute(elm, name));
|
|
2121
|
+
return !isNull(getAttribute$1(elm, name));
|
|
2303
2122
|
},
|
|
2304
2123
|
|
|
2305
2124
|
hasAttributeNS(namespace, name) {
|
|
2306
2125
|
const {
|
|
2307
|
-
elm
|
|
2308
|
-
renderer: {
|
|
2309
|
-
getAttribute
|
|
2310
|
-
}
|
|
2126
|
+
elm
|
|
2311
2127
|
} = getAssociatedVM(this);
|
|
2312
|
-
return !isNull(getAttribute(elm, name, namespace));
|
|
2128
|
+
return !isNull(getAttribute$1(elm, name, namespace));
|
|
2313
2129
|
},
|
|
2314
2130
|
|
|
2315
2131
|
removeAttribute(name) {
|
|
2316
2132
|
const {
|
|
2317
|
-
elm
|
|
2318
|
-
renderer: {
|
|
2319
|
-
removeAttribute
|
|
2320
|
-
}
|
|
2133
|
+
elm
|
|
2321
2134
|
} = getAssociatedVM(this);
|
|
2322
2135
|
unlockAttribute(elm, name);
|
|
2323
|
-
removeAttribute(elm, name);
|
|
2136
|
+
removeAttribute$1(elm, name);
|
|
2324
2137
|
lockAttribute();
|
|
2325
2138
|
},
|
|
2326
2139
|
|
|
2327
2140
|
removeAttributeNS(namespace, name) {
|
|
2328
2141
|
const {
|
|
2329
|
-
elm
|
|
2330
|
-
renderer: {
|
|
2331
|
-
removeAttribute
|
|
2332
|
-
}
|
|
2142
|
+
elm
|
|
2333
2143
|
} = getAssociatedVM(this);
|
|
2334
2144
|
unlockAttribute(elm, name);
|
|
2335
|
-
removeAttribute(elm, name, namespace);
|
|
2145
|
+
removeAttribute$1(elm, name, namespace);
|
|
2336
2146
|
lockAttribute();
|
|
2337
2147
|
},
|
|
2338
2148
|
|
|
2339
2149
|
getAttribute(name) {
|
|
2340
2150
|
const {
|
|
2341
|
-
elm
|
|
2342
|
-
renderer: {
|
|
2343
|
-
getAttribute
|
|
2344
|
-
}
|
|
2151
|
+
elm
|
|
2345
2152
|
} = getAssociatedVM(this);
|
|
2346
|
-
return getAttribute(elm, name);
|
|
2153
|
+
return getAttribute$1(elm, name);
|
|
2347
2154
|
},
|
|
2348
2155
|
|
|
2349
2156
|
getAttributeNS(namespace, name) {
|
|
2350
2157
|
const {
|
|
2351
|
-
elm
|
|
2352
|
-
renderer: {
|
|
2353
|
-
getAttribute
|
|
2354
|
-
}
|
|
2158
|
+
elm
|
|
2355
2159
|
} = getAssociatedVM(this);
|
|
2356
|
-
return getAttribute(elm, name, namespace);
|
|
2160
|
+
return getAttribute$1(elm, name, namespace);
|
|
2357
2161
|
},
|
|
2358
2162
|
|
|
2359
2163
|
setAttribute(name, value) {
|
|
2360
2164
|
const vm = getAssociatedVM(this);
|
|
2361
2165
|
const {
|
|
2362
|
-
elm
|
|
2363
|
-
renderer: {
|
|
2364
|
-
setAttribute
|
|
2365
|
-
}
|
|
2166
|
+
elm
|
|
2366
2167
|
} = vm;
|
|
2367
2168
|
|
|
2368
2169
|
unlockAttribute(elm, name);
|
|
2369
|
-
setAttribute(elm, name, value);
|
|
2170
|
+
setAttribute$1(elm, name, value);
|
|
2370
2171
|
lockAttribute();
|
|
2371
2172
|
},
|
|
2372
2173
|
|
|
2373
2174
|
setAttributeNS(namespace, name, value) {
|
|
2374
2175
|
const vm = getAssociatedVM(this);
|
|
2375
2176
|
const {
|
|
2376
|
-
elm
|
|
2377
|
-
renderer: {
|
|
2378
|
-
setAttribute
|
|
2379
|
-
}
|
|
2177
|
+
elm
|
|
2380
2178
|
} = vm;
|
|
2381
2179
|
|
|
2382
2180
|
unlockAttribute(elm, name);
|
|
2383
|
-
setAttribute(elm, name, value, namespace);
|
|
2181
|
+
setAttribute$1(elm, name, value, namespace);
|
|
2384
2182
|
lockAttribute();
|
|
2385
2183
|
},
|
|
2386
2184
|
|
|
2387
2185
|
getBoundingClientRect() {
|
|
2388
2186
|
const vm = getAssociatedVM(this);
|
|
2389
2187
|
const {
|
|
2390
|
-
elm
|
|
2391
|
-
renderer: {
|
|
2392
|
-
getBoundingClientRect
|
|
2393
|
-
}
|
|
2188
|
+
elm
|
|
2394
2189
|
} = vm;
|
|
2395
2190
|
|
|
2396
|
-
return getBoundingClientRect(elm);
|
|
2191
|
+
return getBoundingClientRect$1(elm);
|
|
2397
2192
|
},
|
|
2398
2193
|
|
|
2399
2194
|
get isConnected() {
|
|
2400
2195
|
const {
|
|
2401
|
-
elm
|
|
2402
|
-
renderer: {
|
|
2403
|
-
isConnected
|
|
2404
|
-
}
|
|
2196
|
+
elm
|
|
2405
2197
|
} = getAssociatedVM(this);
|
|
2406
|
-
return isConnected(elm);
|
|
2198
|
+
return isConnected$1(elm);
|
|
2407
2199
|
},
|
|
2408
2200
|
|
|
2409
2201
|
get classList() {
|
|
2410
2202
|
const vm = getAssociatedVM(this);
|
|
2411
2203
|
const {
|
|
2412
|
-
elm
|
|
2413
|
-
renderer: {
|
|
2414
|
-
getClassList
|
|
2415
|
-
}
|
|
2204
|
+
elm
|
|
2416
2205
|
} = vm;
|
|
2417
2206
|
|
|
2418
|
-
return getClassList(elm);
|
|
2207
|
+
return getClassList$1(elm);
|
|
2419
2208
|
},
|
|
2420
2209
|
|
|
2421
2210
|
get template() {
|
|
@@ -2435,25 +2224,50 @@ var LWC = (function (exports) {
|
|
|
2435
2224
|
return vm.def.template;
|
|
2436
2225
|
},
|
|
2437
2226
|
|
|
2438
|
-
toString() {
|
|
2439
|
-
const vm = getAssociatedVM(this);
|
|
2440
|
-
return `[object ${vm.def.name}]`;
|
|
2227
|
+
toString() {
|
|
2228
|
+
const vm = getAssociatedVM(this);
|
|
2229
|
+
return `[object ${vm.def.name}]`;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
};
|
|
2233
|
+
const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
2234
|
+
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
2235
|
+
// object representing the renderer, with a lot of methods we don't actually need.
|
|
2236
|
+
|
|
2237
|
+
const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
|
|
2238
|
+
|
|
2239
|
+
function getChildGetter(methodName) {
|
|
2240
|
+
switch (methodName) {
|
|
2241
|
+
case 'children':
|
|
2242
|
+
return getChildren$1;
|
|
2243
|
+
|
|
2244
|
+
case 'childNodes':
|
|
2245
|
+
return getChildNodes$1;
|
|
2246
|
+
|
|
2247
|
+
case 'firstChild':
|
|
2248
|
+
return getFirstChild$1;
|
|
2249
|
+
|
|
2250
|
+
case 'firstElementChild':
|
|
2251
|
+
return getFirstElementChild$1;
|
|
2252
|
+
|
|
2253
|
+
case 'lastChild':
|
|
2254
|
+
return getLastChild$1;
|
|
2255
|
+
|
|
2256
|
+
case 'lastElementChild':
|
|
2257
|
+
return getLastElementChild$1;
|
|
2441
2258
|
}
|
|
2259
|
+
} // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
2442
2260
|
|
|
2443
|
-
};
|
|
2444
|
-
const queryAndChildGetterDescriptors = create(null);
|
|
2445
|
-
const childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
2446
2261
|
|
|
2447
|
-
for (const
|
|
2448
|
-
queryAndChildGetterDescriptors[
|
|
2262
|
+
for (const childGetter of childGetters) {
|
|
2263
|
+
queryAndChildGetterDescriptors[childGetter] = {
|
|
2449
2264
|
get() {
|
|
2450
2265
|
const vm = getAssociatedVM(this);
|
|
2451
2266
|
const {
|
|
2452
|
-
elm
|
|
2453
|
-
renderer
|
|
2267
|
+
elm
|
|
2454
2268
|
} = vm;
|
|
2455
2269
|
|
|
2456
|
-
return
|
|
2270
|
+
return getChildGetter(childGetter)(elm);
|
|
2457
2271
|
},
|
|
2458
2272
|
|
|
2459
2273
|
configurable: true,
|
|
@@ -2461,18 +2275,34 @@ var LWC = (function (exports) {
|
|
|
2461
2275
|
};
|
|
2462
2276
|
}
|
|
2463
2277
|
|
|
2464
|
-
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2278
|
+
const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
2279
|
+
|
|
2280
|
+
function getQueryMethod(methodName) {
|
|
2281
|
+
switch (methodName) {
|
|
2282
|
+
case 'getElementsByClassName':
|
|
2283
|
+
return getElementsByClassName$1;
|
|
2284
|
+
|
|
2285
|
+
case 'getElementsByTagName':
|
|
2286
|
+
return getElementsByTagName$1;
|
|
2287
|
+
|
|
2288
|
+
case 'querySelector':
|
|
2289
|
+
return querySelector$1;
|
|
2290
|
+
|
|
2291
|
+
case 'querySelectorAll':
|
|
2292
|
+
return querySelectorAll$1;
|
|
2293
|
+
}
|
|
2294
|
+
} // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
2295
|
+
|
|
2465
2296
|
|
|
2466
2297
|
for (const queryMethod of queryMethods) {
|
|
2467
2298
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
2468
2299
|
value(arg) {
|
|
2469
2300
|
const vm = getAssociatedVM(this);
|
|
2470
2301
|
const {
|
|
2471
|
-
elm
|
|
2472
|
-
renderer
|
|
2302
|
+
elm
|
|
2473
2303
|
} = vm;
|
|
2474
2304
|
|
|
2475
|
-
return
|
|
2305
|
+
return getQueryMethod(queryMethod)(elm, arg);
|
|
2476
2306
|
},
|
|
2477
2307
|
|
|
2478
2308
|
configurable: true,
|
|
@@ -3369,17 +3199,301 @@ var LWC = (function (exports) {
|
|
|
3369
3199
|
|
|
3370
3200
|
const publicMethods = {};
|
|
3371
3201
|
|
|
3372
|
-
for (const key in methods) {
|
|
3373
|
-
// avoid leaking the reference to the public method descriptors
|
|
3374
|
-
publicMethods[key] = methods[key].value;
|
|
3202
|
+
for (const key in methods) {
|
|
3203
|
+
// avoid leaking the reference to the public method descriptors
|
|
3204
|
+
publicMethods[key] = methods[key].value;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
return {
|
|
3208
|
+
ctor,
|
|
3209
|
+
name,
|
|
3210
|
+
props: publicProps,
|
|
3211
|
+
methods: publicMethods
|
|
3212
|
+
};
|
|
3213
|
+
}
|
|
3214
|
+
/*
|
|
3215
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3216
|
+
* All rights reserved.
|
|
3217
|
+
* SPDX-License-Identifier: MIT
|
|
3218
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3219
|
+
*/
|
|
3220
|
+
|
|
3221
|
+
|
|
3222
|
+
const xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
3223
|
+
const xmlNS = 'http://www.w3.org/XML/1998/namespace';
|
|
3224
|
+
const ColonCharCode = 58;
|
|
3225
|
+
|
|
3226
|
+
function patchAttributes(oldVnode, vnode) {
|
|
3227
|
+
const {
|
|
3228
|
+
attrs
|
|
3229
|
+
} = vnode.data;
|
|
3230
|
+
|
|
3231
|
+
if (isUndefined$1(attrs)) {
|
|
3232
|
+
return;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
|
|
3236
|
+
|
|
3237
|
+
if (oldAttrs === attrs) {
|
|
3238
|
+
return;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
const {
|
|
3242
|
+
elm
|
|
3243
|
+
} = vnode;
|
|
3244
|
+
|
|
3245
|
+
for (const key in attrs) {
|
|
3246
|
+
const cur = attrs[key];
|
|
3247
|
+
const old = oldAttrs[key];
|
|
3248
|
+
|
|
3249
|
+
if (old !== cur) {
|
|
3250
|
+
unlockAttribute(elm, key);
|
|
3251
|
+
|
|
3252
|
+
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
3253
|
+
// Assume xml namespace
|
|
3254
|
+
setAttribute$1(elm, key, cur, xmlNS);
|
|
3255
|
+
} else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
3256
|
+
// Assume xlink namespace
|
|
3257
|
+
setAttribute$1(elm, key, cur, xlinkNS);
|
|
3258
|
+
} else if (isNull(cur) || isUndefined$1(cur)) {
|
|
3259
|
+
removeAttribute$1(elm, key);
|
|
3260
|
+
} else {
|
|
3261
|
+
setAttribute$1(elm, key, cur);
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
lockAttribute();
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
/*
|
|
3269
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3270
|
+
* All rights reserved.
|
|
3271
|
+
* SPDX-License-Identifier: MIT
|
|
3272
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3273
|
+
*/
|
|
3274
|
+
|
|
3275
|
+
|
|
3276
|
+
function isLiveBindingProp(sel, key) {
|
|
3277
|
+
// For properties with live bindings, we read values from the DOM element
|
|
3278
|
+
// instead of relying on internally tracked values.
|
|
3279
|
+
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
function patchProps(oldVnode, vnode) {
|
|
3283
|
+
const {
|
|
3284
|
+
props
|
|
3285
|
+
} = vnode.data;
|
|
3286
|
+
|
|
3287
|
+
if (isUndefined$1(props)) {
|
|
3288
|
+
return;
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
const oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
|
|
3292
|
+
|
|
3293
|
+
if (oldProps === props) {
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
const isFirstPatch = isNull(oldVnode);
|
|
3298
|
+
const {
|
|
3299
|
+
elm,
|
|
3300
|
+
sel
|
|
3301
|
+
} = vnode;
|
|
3302
|
+
|
|
3303
|
+
for (const key in props) {
|
|
3304
|
+
const cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
|
|
3305
|
+
// different than the one previously set.
|
|
3306
|
+
|
|
3307
|
+
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
|
|
3308
|
+
setProperty$1(elm, key, cur);
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
/*
|
|
3313
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3314
|
+
* All rights reserved.
|
|
3315
|
+
* SPDX-License-Identifier: MIT
|
|
3316
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3317
|
+
*/
|
|
3318
|
+
|
|
3319
|
+
|
|
3320
|
+
const classNameToClassMap = create(null);
|
|
3321
|
+
|
|
3322
|
+
function getMapFromClassName(className) {
|
|
3323
|
+
// Intentionally using == to match undefined and null values from computed style attribute
|
|
3324
|
+
if (className == null) {
|
|
3325
|
+
return EmptyObject;
|
|
3326
|
+
} // computed class names must be string
|
|
3327
|
+
|
|
3328
|
+
|
|
3329
|
+
className = isString(className) ? className : className + '';
|
|
3330
|
+
let map = classNameToClassMap[className];
|
|
3331
|
+
|
|
3332
|
+
if (map) {
|
|
3333
|
+
return map;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
map = create(null);
|
|
3337
|
+
let start = 0;
|
|
3338
|
+
let o;
|
|
3339
|
+
const len = className.length;
|
|
3340
|
+
|
|
3341
|
+
for (o = 0; o < len; o++) {
|
|
3342
|
+
if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
|
|
3343
|
+
if (o > start) {
|
|
3344
|
+
map[StringSlice.call(className, start, o)] = true;
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3347
|
+
start = o + 1;
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
if (o > start) {
|
|
3352
|
+
map[StringSlice.call(className, start, o)] = true;
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
classNameToClassMap[className] = map;
|
|
3356
|
+
|
|
3357
|
+
return map;
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
function patchClassAttribute(oldVnode, vnode) {
|
|
3361
|
+
const {
|
|
3362
|
+
elm,
|
|
3363
|
+
data: {
|
|
3364
|
+
className: newClass
|
|
3365
|
+
}
|
|
3366
|
+
} = vnode;
|
|
3367
|
+
const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
|
|
3368
|
+
|
|
3369
|
+
if (oldClass === newClass) {
|
|
3370
|
+
return;
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
const classList = getClassList$1(elm);
|
|
3374
|
+
const newClassMap = getMapFromClassName(newClass);
|
|
3375
|
+
const oldClassMap = getMapFromClassName(oldClass);
|
|
3376
|
+
let name;
|
|
3377
|
+
|
|
3378
|
+
for (name in oldClassMap) {
|
|
3379
|
+
// remove only if it is not in the new class collection and it is not set from within the instance
|
|
3380
|
+
if (isUndefined$1(newClassMap[name])) {
|
|
3381
|
+
classList.remove(name);
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
for (name in newClassMap) {
|
|
3386
|
+
if (isUndefined$1(oldClassMap[name])) {
|
|
3387
|
+
classList.add(name);
|
|
3388
|
+
}
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
/*
|
|
3392
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3393
|
+
* All rights reserved.
|
|
3394
|
+
* SPDX-License-Identifier: MIT
|
|
3395
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3396
|
+
*/
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
function patchStyleAttribute(oldVnode, vnode) {
|
|
3400
|
+
const {
|
|
3401
|
+
elm,
|
|
3402
|
+
data: {
|
|
3403
|
+
style: newStyle
|
|
3404
|
+
}
|
|
3405
|
+
} = vnode;
|
|
3406
|
+
const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
|
|
3407
|
+
|
|
3408
|
+
if (oldStyle === newStyle) {
|
|
3409
|
+
return;
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
if (!isString(newStyle) || newStyle === '') {
|
|
3413
|
+
removeAttribute$1(elm, 'style');
|
|
3414
|
+
} else {
|
|
3415
|
+
setAttribute$1(elm, 'style', newStyle);
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
/*
|
|
3419
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3420
|
+
* All rights reserved.
|
|
3421
|
+
* SPDX-License-Identifier: MIT
|
|
3422
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3423
|
+
*/
|
|
3424
|
+
|
|
3425
|
+
|
|
3426
|
+
function applyEventListeners(vnode) {
|
|
3427
|
+
const {
|
|
3428
|
+
elm,
|
|
3429
|
+
data: {
|
|
3430
|
+
on
|
|
3431
|
+
}
|
|
3432
|
+
} = vnode;
|
|
3433
|
+
|
|
3434
|
+
if (isUndefined$1(on)) {
|
|
3435
|
+
return;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
for (const name in on) {
|
|
3439
|
+
const handler = on[name];
|
|
3440
|
+
addEventListener$1(elm, name, handler);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
/*
|
|
3444
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3445
|
+
* All rights reserved.
|
|
3446
|
+
* SPDX-License-Identifier: MIT
|
|
3447
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3448
|
+
*/
|
|
3449
|
+
// The compiler takes care of transforming the inline classnames into an object. It's faster to set the
|
|
3450
|
+
// different classnames properties individually instead of via a string.
|
|
3451
|
+
|
|
3452
|
+
|
|
3453
|
+
function applyStaticClassAttribute(vnode) {
|
|
3454
|
+
const {
|
|
3455
|
+
elm,
|
|
3456
|
+
data: {
|
|
3457
|
+
classMap
|
|
3458
|
+
}
|
|
3459
|
+
} = vnode;
|
|
3460
|
+
|
|
3461
|
+
if (isUndefined$1(classMap)) {
|
|
3462
|
+
return;
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
const classList = getClassList$1(elm);
|
|
3466
|
+
|
|
3467
|
+
for (const name in classMap) {
|
|
3468
|
+
classList.add(name);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
/*
|
|
3472
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
3473
|
+
* All rights reserved.
|
|
3474
|
+
* SPDX-License-Identifier: MIT
|
|
3475
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3476
|
+
*/
|
|
3477
|
+
// The compiler takes care of transforming the inline style into an object. It's faster to set the
|
|
3478
|
+
// different style properties individually instead of via a string.
|
|
3479
|
+
|
|
3480
|
+
|
|
3481
|
+
function applyStaticStyleAttribute(vnode) {
|
|
3482
|
+
const {
|
|
3483
|
+
elm,
|
|
3484
|
+
data: {
|
|
3485
|
+
styleDecls
|
|
3486
|
+
}
|
|
3487
|
+
} = vnode;
|
|
3488
|
+
|
|
3489
|
+
if (isUndefined$1(styleDecls)) {
|
|
3490
|
+
return;
|
|
3375
3491
|
}
|
|
3376
3492
|
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
methods: publicMethods
|
|
3382
|
-
};
|
|
3493
|
+
for (let i = 0; i < styleDecls.length; i++) {
|
|
3494
|
+
const [prop, value, important] = styleDecls[i];
|
|
3495
|
+
setCSSStyleProperty$1(elm, prop, value, important);
|
|
3496
|
+
}
|
|
3383
3497
|
}
|
|
3384
3498
|
/*
|
|
3385
3499
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3406,63 +3520,50 @@ var LWC = (function (exports) {
|
|
|
3406
3520
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
3407
3521
|
|
|
3408
3522
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
3409
|
-
|
|
3523
|
+
getClassList$1(elm).add(token);
|
|
3410
3524
|
}
|
|
3411
3525
|
}
|
|
3412
3526
|
|
|
3413
3527
|
function updateNodeHook(oldVnode, vnode) {
|
|
3414
3528
|
const {
|
|
3415
3529
|
elm,
|
|
3416
|
-
text
|
|
3417
|
-
owner: {
|
|
3418
|
-
renderer
|
|
3419
|
-
}
|
|
3530
|
+
text
|
|
3420
3531
|
} = vnode;
|
|
3421
3532
|
|
|
3422
3533
|
if (oldVnode.text !== text) {
|
|
3423
3534
|
|
|
3424
|
-
|
|
3535
|
+
setText$1(elm, text);
|
|
3425
3536
|
}
|
|
3426
3537
|
}
|
|
3427
3538
|
|
|
3428
3539
|
function insertNodeHook(vnode, parentNode, referenceNode) {
|
|
3429
|
-
const {
|
|
3430
|
-
renderer
|
|
3431
|
-
} = vnode.owner;
|
|
3432
3540
|
|
|
3433
|
-
|
|
3541
|
+
insert$1(vnode.elm, parentNode, referenceNode);
|
|
3434
3542
|
}
|
|
3435
3543
|
|
|
3436
3544
|
function removeNodeHook(vnode, parentNode) {
|
|
3437
|
-
const {
|
|
3438
|
-
renderer
|
|
3439
|
-
} = vnode.owner;
|
|
3440
3545
|
|
|
3441
|
-
|
|
3546
|
+
remove$1(vnode.elm, parentNode);
|
|
3442
3547
|
}
|
|
3443
3548
|
|
|
3444
|
-
function
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3549
|
+
function patchElementPropsAndAttrs(oldVnode, vnode) {
|
|
3550
|
+
if (isNull(oldVnode)) {
|
|
3551
|
+
applyEventListeners(vnode);
|
|
3552
|
+
applyStaticClassAttribute(vnode);
|
|
3553
|
+
applyStaticStyleAttribute(vnode);
|
|
3554
|
+
} // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
|
|
3555
|
+
// value is set before type=radio.
|
|
3448
3556
|
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
modComputedStyle.create(vnode);
|
|
3557
|
+
|
|
3558
|
+
patchClassAttribute(oldVnode, vnode);
|
|
3559
|
+
patchStyleAttribute(oldVnode, vnode);
|
|
3560
|
+
patchAttributes(oldVnode, vnode);
|
|
3561
|
+
patchProps(oldVnode, vnode);
|
|
3455
3562
|
}
|
|
3456
3563
|
|
|
3457
3564
|
function hydrateElmHook(vnode) {
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
modProps.create(vnode); // Already set.
|
|
3462
|
-
// modStaticClassName.create(vnode);
|
|
3463
|
-
// modStaticStyle.create(vnode);
|
|
3464
|
-
// modComputedClassName.create(vnode);
|
|
3465
|
-
// modComputedStyle.create(vnode);
|
|
3565
|
+
applyEventListeners(vnode);
|
|
3566
|
+
patchProps(null, vnode);
|
|
3466
3567
|
}
|
|
3467
3568
|
|
|
3468
3569
|
function fallbackElmHook(elm, vnode) {
|
|
@@ -3496,26 +3597,11 @@ var LWC = (function (exports) {
|
|
|
3496
3597
|
}
|
|
3497
3598
|
}
|
|
3498
3599
|
|
|
3499
|
-
function
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
// is set before type=radio.
|
|
3503
|
-
modAttrs.update(oldVnode, vnode);
|
|
3504
|
-
modProps.update(oldVnode, vnode);
|
|
3505
|
-
modComputedClassName.update(oldVnode, vnode);
|
|
3506
|
-
modComputedStyle.update(oldVnode, vnode);
|
|
3507
|
-
}
|
|
3508
|
-
|
|
3509
|
-
function updateChildrenHook(oldVnode, vnode) {
|
|
3510
|
-
const {
|
|
3511
|
-
elm,
|
|
3512
|
-
children
|
|
3513
|
-
} = vnode;
|
|
3514
|
-
|
|
3515
|
-
if (hasDynamicChildren(children)) {
|
|
3516
|
-
updateDynamicChildren(elm, oldVnode.children, children);
|
|
3600
|
+
function patchChildren(parent, oldCh, newCh) {
|
|
3601
|
+
if (hasDynamicChildren(newCh)) {
|
|
3602
|
+
updateDynamicChildren(parent, oldCh, newCh);
|
|
3517
3603
|
} else {
|
|
3518
|
-
updateStaticChildren(
|
|
3604
|
+
updateStaticChildren(parent, oldCh, newCh);
|
|
3519
3605
|
}
|
|
3520
3606
|
}
|
|
3521
3607
|
|
|
@@ -3582,24 +3668,10 @@ var LWC = (function (exports) {
|
|
|
3582
3668
|
createVM(elm, def, {
|
|
3583
3669
|
mode,
|
|
3584
3670
|
owner,
|
|
3585
|
-
tagName: sel
|
|
3586
|
-
renderer: owner.renderer
|
|
3671
|
+
tagName: sel
|
|
3587
3672
|
});
|
|
3588
3673
|
}
|
|
3589
3674
|
|
|
3590
|
-
function createCustomElmHook(vnode) {
|
|
3591
|
-
modEvents.create(vnode); // Attrs need to be applied to element before props
|
|
3592
|
-
// IE11 will wipe out value on radio inputs if value
|
|
3593
|
-
// is set before type=radio.
|
|
3594
|
-
|
|
3595
|
-
modAttrs.create(vnode);
|
|
3596
|
-
modProps.create(vnode);
|
|
3597
|
-
modStaticClassName.create(vnode);
|
|
3598
|
-
modStaticStyle.create(vnode);
|
|
3599
|
-
modComputedClassName.create(vnode);
|
|
3600
|
-
modComputedStyle.create(vnode);
|
|
3601
|
-
}
|
|
3602
|
-
|
|
3603
3675
|
function createChildrenHook(vnode) {
|
|
3604
3676
|
const {
|
|
3605
3677
|
elm,
|
|
@@ -3632,16 +3704,6 @@ var LWC = (function (exports) {
|
|
|
3632
3704
|
}
|
|
3633
3705
|
}
|
|
3634
3706
|
|
|
3635
|
-
function updateCustomElmHook(oldVnode, vnode) {
|
|
3636
|
-
// Attrs need to be applied to element before props
|
|
3637
|
-
// IE11 will wipe out value on radio inputs if value
|
|
3638
|
-
// is set before type=radio.
|
|
3639
|
-
modAttrs.update(oldVnode, vnode);
|
|
3640
|
-
modProps.update(oldVnode, vnode);
|
|
3641
|
-
modComputedClassName.update(oldVnode, vnode);
|
|
3642
|
-
modComputedStyle.update(oldVnode, vnode);
|
|
3643
|
-
}
|
|
3644
|
-
|
|
3645
3707
|
function removeElmHook(vnode) {
|
|
3646
3708
|
// this method only needs to search on child vnodes from template
|
|
3647
3709
|
// to trigger the remove hook just in case some of those children
|
|
@@ -3658,6 +3720,66 @@ var LWC = (function (exports) {
|
|
|
3658
3720
|
ch.hook.remove(ch, elm);
|
|
3659
3721
|
}
|
|
3660
3722
|
}
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
function allocateInSlot(vm, children) {
|
|
3726
|
+
const {
|
|
3727
|
+
cmpSlots: oldSlots
|
|
3728
|
+
} = vm;
|
|
3729
|
+
const cmpSlots = vm.cmpSlots = create(null);
|
|
3730
|
+
|
|
3731
|
+
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
3732
|
+
const vnode = children[i];
|
|
3733
|
+
|
|
3734
|
+
if (isNull(vnode)) {
|
|
3735
|
+
continue;
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
const {
|
|
3739
|
+
data
|
|
3740
|
+
} = vnode;
|
|
3741
|
+
const slotName = data.attrs && data.attrs.slot || '';
|
|
3742
|
+
const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
|
|
3743
|
+
// which might have similar keys. Each vnode will always have a key that
|
|
3744
|
+
// starts with a numeric character from compiler. In this case, we add a unique
|
|
3745
|
+
// notation for slotted vnodes keys, e.g.: `@foo:1:1`
|
|
3746
|
+
|
|
3747
|
+
if (!isUndefined$1(vnode.key)) {
|
|
3748
|
+
vnode.key = `@${slotName}:${vnode.key}`;
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
ArrayPush$1.call(vnodes, vnode);
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3754
|
+
if (isFalse(vm.isDirty)) {
|
|
3755
|
+
// We need to determine if the old allocation is really different from the new one
|
|
3756
|
+
// and mark the vm as dirty
|
|
3757
|
+
const oldKeys = keys(oldSlots);
|
|
3758
|
+
|
|
3759
|
+
if (oldKeys.length !== keys(cmpSlots).length) {
|
|
3760
|
+
markComponentAsDirty(vm);
|
|
3761
|
+
return;
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
3765
|
+
const key = oldKeys[i];
|
|
3766
|
+
|
|
3767
|
+
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
3768
|
+
markComponentAsDirty(vm);
|
|
3769
|
+
return;
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
const oldVNodes = oldSlots[key];
|
|
3773
|
+
const vnodes = cmpSlots[key];
|
|
3774
|
+
|
|
3775
|
+
for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
|
|
3776
|
+
if (oldVNodes[j] !== vnodes[j]) {
|
|
3777
|
+
markComponentAsDirty(vm);
|
|
3778
|
+
return;
|
|
3779
|
+
}
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3661
3783
|
} // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
|
|
3662
3784
|
|
|
3663
3785
|
|
|
@@ -3679,12 +3801,12 @@ var LWC = (function (exports) {
|
|
|
3679
3801
|
*/
|
|
3680
3802
|
|
|
3681
3803
|
|
|
3682
|
-
function getUpgradableConstructor(tagName
|
|
3804
|
+
function getUpgradableConstructor(tagName) {
|
|
3683
3805
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
3684
3806
|
// produce only tags with lowercase letters
|
|
3685
3807
|
// But, for backwards compatibility, we will lower case the tagName
|
|
3686
3808
|
tagName = tagName.toLowerCase();
|
|
3687
|
-
let CE =
|
|
3809
|
+
let CE = getCustomElement$1(tagName);
|
|
3688
3810
|
|
|
3689
3811
|
if (!isUndefined$1(CE)) {
|
|
3690
3812
|
return CE;
|
|
@@ -3695,7 +3817,7 @@ var LWC = (function (exports) {
|
|
|
3695
3817
|
*/
|
|
3696
3818
|
|
|
3697
3819
|
|
|
3698
|
-
CE = class LWCUpgradableElement extends
|
|
3820
|
+
CE = class LWCUpgradableElement extends HTMLElementExported$1 {
|
|
3699
3821
|
constructor(upgradeCallback) {
|
|
3700
3822
|
super();
|
|
3701
3823
|
|
|
@@ -3705,7 +3827,7 @@ var LWC = (function (exports) {
|
|
|
3705
3827
|
}
|
|
3706
3828
|
|
|
3707
3829
|
};
|
|
3708
|
-
|
|
3830
|
+
defineCustomElement$1(tagName, CE);
|
|
3709
3831
|
return CE;
|
|
3710
3832
|
}
|
|
3711
3833
|
/*
|
|
@@ -3723,10 +3845,7 @@ var LWC = (function (exports) {
|
|
|
3723
3845
|
const {
|
|
3724
3846
|
owner
|
|
3725
3847
|
} = vnode;
|
|
3726
|
-
const
|
|
3727
|
-
renderer
|
|
3728
|
-
} = owner;
|
|
3729
|
-
const elm = renderer.createText(vnode.text);
|
|
3848
|
+
const elm = createText$1(vnode.text);
|
|
3730
3849
|
linkNodeToShadow(elm, owner);
|
|
3731
3850
|
vnode.elm = elm;
|
|
3732
3851
|
},
|
|
@@ -3748,10 +3867,7 @@ var LWC = (function (exports) {
|
|
|
3748
3867
|
owner,
|
|
3749
3868
|
text
|
|
3750
3869
|
} = vnode;
|
|
3751
|
-
const
|
|
3752
|
-
renderer
|
|
3753
|
-
} = owner;
|
|
3754
|
-
const elm = renderer.createComment(text);
|
|
3870
|
+
const elm = createComment$1(text);
|
|
3755
3871
|
linkNodeToShadow(elm, owner);
|
|
3756
3872
|
vnode.elm = elm;
|
|
3757
3873
|
},
|
|
@@ -3781,19 +3897,16 @@ var LWC = (function (exports) {
|
|
|
3781
3897
|
svg
|
|
3782
3898
|
}
|
|
3783
3899
|
} = vnode;
|
|
3784
|
-
const {
|
|
3785
|
-
renderer
|
|
3786
|
-
} = owner;
|
|
3787
3900
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3788
|
-
const elm =
|
|
3901
|
+
const elm = createElement$2(sel, namespace);
|
|
3789
3902
|
linkNodeToShadow(elm, owner);
|
|
3790
3903
|
fallbackElmHook(elm, vnode);
|
|
3791
3904
|
vnode.elm = elm;
|
|
3792
|
-
|
|
3905
|
+
patchElementPropsAndAttrs(null, vnode);
|
|
3793
3906
|
},
|
|
3794
3907
|
update: (oldVnode, vnode) => {
|
|
3795
|
-
|
|
3796
|
-
|
|
3908
|
+
patchElementPropsAndAttrs(oldVnode, vnode);
|
|
3909
|
+
patchChildren(vnode.elm, oldVnode.children, vnode.children);
|
|
3797
3910
|
},
|
|
3798
3911
|
insert: (vnode, parentNode, referenceNode) => {
|
|
3799
3912
|
insertNodeHook(vnode, parentNode, referenceNode);
|
|
@@ -3845,10 +3958,7 @@ var LWC = (function (exports) {
|
|
|
3845
3958
|
sel,
|
|
3846
3959
|
owner
|
|
3847
3960
|
} = vnode;
|
|
3848
|
-
const
|
|
3849
|
-
renderer
|
|
3850
|
-
} = owner;
|
|
3851
|
-
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
3961
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
3852
3962
|
/**
|
|
3853
3963
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
3854
3964
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -3870,10 +3980,10 @@ var LWC = (function (exports) {
|
|
|
3870
3980
|
throw new TypeError(`Incorrect Component Constructor`);
|
|
3871
3981
|
}
|
|
3872
3982
|
|
|
3873
|
-
|
|
3983
|
+
patchElementPropsAndAttrs(null, vnode);
|
|
3874
3984
|
},
|
|
3875
3985
|
update: (oldVnode, vnode) => {
|
|
3876
|
-
|
|
3986
|
+
patchElementPropsAndAttrs(oldVnode, vnode);
|
|
3877
3987
|
const vm = getAssociatedVMIfPresent(vnode.elm);
|
|
3878
3988
|
|
|
3879
3989
|
if (vm) {
|
|
@@ -3884,7 +3994,7 @@ var LWC = (function (exports) {
|
|
|
3884
3994
|
// will happen, but in native, it does allocate the light dom
|
|
3885
3995
|
|
|
3886
3996
|
|
|
3887
|
-
|
|
3997
|
+
patchChildren(vnode.elm, oldVnode.children, vnode.children);
|
|
3888
3998
|
|
|
3889
3999
|
if (vm) {
|
|
3890
4000
|
// this is important to preserve the top to bottom synchronous rendering phase.
|
|
@@ -3933,8 +4043,7 @@ var LWC = (function (exports) {
|
|
|
3933
4043
|
createVM(elm, def, {
|
|
3934
4044
|
mode,
|
|
3935
4045
|
owner,
|
|
3936
|
-
tagName: sel
|
|
3937
|
-
renderer: owner.renderer
|
|
4046
|
+
tagName: sel
|
|
3938
4047
|
});
|
|
3939
4048
|
vnode.elm = elm;
|
|
3940
4049
|
const vm = getAssociatedVM(elm);
|
|
@@ -3957,12 +4066,11 @@ var LWC = (function (exports) {
|
|
|
3957
4066
|
|
|
3958
4067
|
function linkNodeToShadow(elm, owner) {
|
|
3959
4068
|
const {
|
|
3960
|
-
renderer,
|
|
3961
4069
|
renderMode,
|
|
3962
4070
|
shadowMode
|
|
3963
4071
|
} = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
3964
4072
|
|
|
3965
|
-
if (
|
|
4073
|
+
if (isSyntheticShadowDefined$1) {
|
|
3966
4074
|
if (shadowMode === 1
|
|
3967
4075
|
/* Synthetic */
|
|
3968
4076
|
|| renderMode === 0
|
|
@@ -4370,7 +4478,6 @@ var LWC = (function (exports) {
|
|
|
4370
4478
|
const {
|
|
4371
4479
|
elm,
|
|
4372
4480
|
context,
|
|
4373
|
-
renderer,
|
|
4374
4481
|
renderMode,
|
|
4375
4482
|
shadowMode
|
|
4376
4483
|
} = vm;
|
|
@@ -4397,11 +4504,11 @@ var LWC = (function (exports) {
|
|
|
4397
4504
|
} = context;
|
|
4398
4505
|
|
|
4399
4506
|
if (oldHasTokenInClass) {
|
|
4400
|
-
|
|
4507
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
4401
4508
|
}
|
|
4402
4509
|
|
|
4403
4510
|
if (oldHasTokenInAttribute) {
|
|
4404
|
-
|
|
4511
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
4405
4512
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
4406
4513
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
4407
4514
|
|
|
@@ -4413,12 +4520,12 @@ var LWC = (function (exports) {
|
|
|
4413
4520
|
|
|
4414
4521
|
if (!isUndefined$1(newToken)) {
|
|
4415
4522
|
if (hasScopedStyles) {
|
|
4416
|
-
|
|
4523
|
+
getClassList$1(elm).add(makeHostToken(newToken));
|
|
4417
4524
|
newHasTokenInClass = true;
|
|
4418
4525
|
}
|
|
4419
4526
|
|
|
4420
4527
|
if (isSyntheticShadow) {
|
|
4421
|
-
|
|
4528
|
+
setAttribute$1(elm, makeHostToken(newToken), '');
|
|
4422
4529
|
newHasTokenInAttribute = true;
|
|
4423
4530
|
}
|
|
4424
4531
|
} // Update the styling tokens present on the context object.
|
|
@@ -4533,7 +4640,6 @@ var LWC = (function (exports) {
|
|
|
4533
4640
|
|
|
4534
4641
|
function createStylesheet(vm, stylesheets) {
|
|
4535
4642
|
const {
|
|
4536
|
-
renderer,
|
|
4537
4643
|
renderMode,
|
|
4538
4644
|
shadowMode
|
|
4539
4645
|
} = vm;
|
|
@@ -4544,9 +4650,9 @@ var LWC = (function (exports) {
|
|
|
4544
4650
|
/* Synthetic */
|
|
4545
4651
|
) {
|
|
4546
4652
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4547
|
-
|
|
4653
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
4548
4654
|
}
|
|
4549
|
-
} else if (
|
|
4655
|
+
} else if (ssr$1 || isHydrating$1()) {
|
|
4550
4656
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
4551
4657
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
4552
4658
|
// the first time the VM renders.
|
|
@@ -4560,10 +4666,10 @@ var LWC = (function (exports) {
|
|
|
4560
4666
|
|
|
4561
4667
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4562
4668
|
if (isGlobal) {
|
|
4563
|
-
|
|
4669
|
+
insertGlobalStylesheet$1(stylesheets[i]);
|
|
4564
4670
|
} else {
|
|
4565
4671
|
// local level
|
|
4566
|
-
|
|
4672
|
+
insertStylesheet$1(stylesheets[i], root.cmpRoot);
|
|
4567
4673
|
}
|
|
4568
4674
|
}
|
|
4569
4675
|
}
|
|
@@ -5118,7 +5224,6 @@ var LWC = (function (exports) {
|
|
|
5118
5224
|
const {
|
|
5119
5225
|
mode,
|
|
5120
5226
|
owner,
|
|
5121
|
-
renderer,
|
|
5122
5227
|
tagName
|
|
5123
5228
|
} = options;
|
|
5124
5229
|
const vm = {
|
|
@@ -5133,7 +5238,6 @@ var LWC = (function (exports) {
|
|
|
5133
5238
|
tagName,
|
|
5134
5239
|
mode,
|
|
5135
5240
|
owner,
|
|
5136
|
-
renderer,
|
|
5137
5241
|
children: EmptyArray,
|
|
5138
5242
|
aChildren: EmptyArray,
|
|
5139
5243
|
velements: EmptyArray,
|
|
@@ -5176,16 +5280,11 @@ var LWC = (function (exports) {
|
|
|
5176
5280
|
|
|
5177
5281
|
function computeShadowMode(vm) {
|
|
5178
5282
|
const {
|
|
5179
|
-
def
|
|
5180
|
-
renderer
|
|
5283
|
+
def
|
|
5181
5284
|
} = vm;
|
|
5182
|
-
const {
|
|
5183
|
-
isNativeShadowDefined,
|
|
5184
|
-
isSyntheticShadowDefined
|
|
5185
|
-
} = renderer;
|
|
5186
5285
|
let shadowMode;
|
|
5187
5286
|
|
|
5188
|
-
if (isSyntheticShadowDefined) {
|
|
5287
|
+
if (isSyntheticShadowDefined$1) {
|
|
5189
5288
|
if (def.renderMode === 0
|
|
5190
5289
|
/* Light */
|
|
5191
5290
|
) {
|
|
@@ -5194,7 +5293,7 @@ var LWC = (function (exports) {
|
|
|
5194
5293
|
shadowMode = 0
|
|
5195
5294
|
/* Native */
|
|
5196
5295
|
;
|
|
5197
|
-
} else if (isNativeShadowDefined) {
|
|
5296
|
+
} else if (isNativeShadowDefined$1) {
|
|
5198
5297
|
if (def.shadowSupportMode === "any"
|
|
5199
5298
|
/* Any */
|
|
5200
5299
|
) {
|
|
@@ -5286,7 +5385,6 @@ var LWC = (function (exports) {
|
|
|
5286
5385
|
// patch function mutates vnodes by adding the element reference,
|
|
5287
5386
|
// however, if patching fails it contains partial changes.
|
|
5288
5387
|
if (oldCh !== newCh) {
|
|
5289
|
-
const fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
|
|
5290
5388
|
runWithBoundaryProtection(vm, vm, () => {
|
|
5291
5389
|
// pre
|
|
5292
5390
|
logOperationStart(2
|
|
@@ -5294,8 +5392,8 @@ var LWC = (function (exports) {
|
|
|
5294
5392
|
, vm);
|
|
5295
5393
|
}, () => {
|
|
5296
5394
|
// job
|
|
5297
|
-
const
|
|
5298
|
-
|
|
5395
|
+
const renderRoot = getRenderRoot(vm);
|
|
5396
|
+
patchChildren(renderRoot, oldCh, newCh);
|
|
5299
5397
|
}, () => {
|
|
5300
5398
|
// post
|
|
5301
5399
|
logOperationEnd(2
|
|
@@ -5318,13 +5416,12 @@ var LWC = (function (exports) {
|
|
|
5318
5416
|
|
|
5319
5417
|
function runRenderedCallback(vm) {
|
|
5320
5418
|
const {
|
|
5321
|
-
renderer,
|
|
5322
5419
|
def: {
|
|
5323
5420
|
renderedCallback
|
|
5324
5421
|
}
|
|
5325
5422
|
} = vm;
|
|
5326
5423
|
|
|
5327
|
-
if (isTrue(
|
|
5424
|
+
if (isTrue(ssr$1)) {
|
|
5328
5425
|
return;
|
|
5329
5426
|
}
|
|
5330
5427
|
|
|
@@ -5541,8 +5638,7 @@ var LWC = (function (exports) {
|
|
|
5541
5638
|
|
|
5542
5639
|
function resetComponentRoot(vm) {
|
|
5543
5640
|
const {
|
|
5544
|
-
children
|
|
5545
|
-
renderer
|
|
5641
|
+
children
|
|
5546
5642
|
} = vm;
|
|
5547
5643
|
const rootNode = getRenderRoot(vm);
|
|
5548
5644
|
|
|
@@ -5550,7 +5646,7 @@ var LWC = (function (exports) {
|
|
|
5550
5646
|
const child = children[i];
|
|
5551
5647
|
|
|
5552
5648
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5553
|
-
|
|
5649
|
+
remove$1(child.elm, rootNode);
|
|
5554
5650
|
}
|
|
5555
5651
|
}
|
|
5556
5652
|
|
|
@@ -5560,7 +5656,7 @@ var LWC = (function (exports) {
|
|
|
5560
5656
|
}
|
|
5561
5657
|
|
|
5562
5658
|
function scheduleRehydration(vm) {
|
|
5563
|
-
if (isTrue(
|
|
5659
|
+
if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
|
|
5564
5660
|
return;
|
|
5565
5661
|
}
|
|
5566
5662
|
|
|
@@ -5583,69 +5679,6 @@ var LWC = (function (exports) {
|
|
|
5583
5679
|
|
|
5584
5680
|
currentVm = currentVm.owner;
|
|
5585
5681
|
}
|
|
5586
|
-
} // slow path routine
|
|
5587
|
-
// NOTE: we should probably more this routine to the synthetic shadow folder
|
|
5588
|
-
// and get the allocation to be cached by in the elm instead of in the VM
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
function allocateInSlot(vm, children) {
|
|
5592
|
-
const {
|
|
5593
|
-
cmpSlots: oldSlots
|
|
5594
|
-
} = vm;
|
|
5595
|
-
const cmpSlots = vm.cmpSlots = create(null);
|
|
5596
|
-
|
|
5597
|
-
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
5598
|
-
const vnode = children[i];
|
|
5599
|
-
|
|
5600
|
-
if (isNull(vnode)) {
|
|
5601
|
-
continue;
|
|
5602
|
-
}
|
|
5603
|
-
|
|
5604
|
-
const {
|
|
5605
|
-
data
|
|
5606
|
-
} = vnode;
|
|
5607
|
-
const slotName = data.attrs && data.attrs.slot || '';
|
|
5608
|
-
const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
|
|
5609
|
-
// which might have similar keys. Each vnode will always have a key that
|
|
5610
|
-
// starts with a numeric character from compiler. In this case, we add a unique
|
|
5611
|
-
// notation for slotted vnodes keys, e.g.: `@foo:1:1`
|
|
5612
|
-
|
|
5613
|
-
if (!isUndefined$1(vnode.key)) {
|
|
5614
|
-
vnode.key = `@${slotName}:${vnode.key}`;
|
|
5615
|
-
}
|
|
5616
|
-
|
|
5617
|
-
ArrayPush$1.call(vnodes, vnode);
|
|
5618
|
-
}
|
|
5619
|
-
|
|
5620
|
-
if (isFalse(vm.isDirty)) {
|
|
5621
|
-
// We need to determine if the old allocation is really different from the new one
|
|
5622
|
-
// and mark the vm as dirty
|
|
5623
|
-
const oldKeys = keys(oldSlots);
|
|
5624
|
-
|
|
5625
|
-
if (oldKeys.length !== keys(cmpSlots).length) {
|
|
5626
|
-
markComponentAsDirty(vm);
|
|
5627
|
-
return;
|
|
5628
|
-
}
|
|
5629
|
-
|
|
5630
|
-
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
5631
|
-
const key = oldKeys[i];
|
|
5632
|
-
|
|
5633
|
-
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
5634
|
-
markComponentAsDirty(vm);
|
|
5635
|
-
return;
|
|
5636
|
-
}
|
|
5637
|
-
|
|
5638
|
-
const oldVNodes = oldSlots[key];
|
|
5639
|
-
const vnodes = cmpSlots[key];
|
|
5640
|
-
|
|
5641
|
-
for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
|
|
5642
|
-
if (oldVNodes[j] !== vnodes[j]) {
|
|
5643
|
-
markComponentAsDirty(vm);
|
|
5644
|
-
return;
|
|
5645
|
-
}
|
|
5646
|
-
}
|
|
5647
|
-
}
|
|
5648
|
-
}
|
|
5649
5682
|
}
|
|
5650
5683
|
|
|
5651
5684
|
function runWithBoundaryProtection(vm, owner, pre, job, post) {
|
|
@@ -5787,7 +5820,6 @@ var LWC = (function (exports) {
|
|
|
5787
5820
|
|
|
5788
5821
|
const {
|
|
5789
5822
|
elm,
|
|
5790
|
-
renderer,
|
|
5791
5823
|
context: {
|
|
5792
5824
|
wiredConnecting,
|
|
5793
5825
|
wiredDisconnecting
|
|
@@ -5814,7 +5846,7 @@ var LWC = (function (exports) {
|
|
|
5814
5846
|
}
|
|
5815
5847
|
|
|
5816
5848
|
});
|
|
5817
|
-
|
|
5849
|
+
dispatchEvent$1(elm, contextRegistrationEvent);
|
|
5818
5850
|
});
|
|
5819
5851
|
}
|
|
5820
5852
|
|
|
@@ -6069,7 +6101,7 @@ var LWC = (function (exports) {
|
|
|
6069
6101
|
hooksAreSet = true;
|
|
6070
6102
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6071
6103
|
}
|
|
6072
|
-
/* version: 2.
|
|
6104
|
+
/* version: 2.7.3 */
|
|
6073
6105
|
|
|
6074
6106
|
/*
|
|
6075
6107
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6089,7 +6121,9 @@ var LWC = (function (exports) {
|
|
|
6089
6121
|
const styleElements = create(null);
|
|
6090
6122
|
const styleSheets = create(null);
|
|
6091
6123
|
const nodesToStyleSheets = new WeakMap();
|
|
6092
|
-
let getCustomElement
|
|
6124
|
+
let getCustomElement;
|
|
6125
|
+
let defineCustomElement;
|
|
6126
|
+
let HTMLElementConstructor;
|
|
6093
6127
|
|
|
6094
6128
|
function isCustomElementRegistryAvailable() {
|
|
6095
6129
|
if (typeof customElements === 'undefined') {
|
|
@@ -6204,182 +6238,213 @@ var LWC = (function (exports) {
|
|
|
6204
6238
|
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
6205
6239
|
}
|
|
6206
6240
|
|
|
6207
|
-
let
|
|
6241
|
+
let hydrating = false;
|
|
6208
6242
|
|
|
6209
|
-
function setIsHydrating(
|
|
6210
|
-
|
|
6243
|
+
function setIsHydrating(value) {
|
|
6244
|
+
hydrating = value;
|
|
6211
6245
|
}
|
|
6212
6246
|
|
|
6213
|
-
const
|
|
6214
|
-
ssr: false,
|
|
6247
|
+
const ssr = false;
|
|
6215
6248
|
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
6221
|
-
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
|
|
6222
|
-
|
|
6223
|
-
createElement(tagName, namespace) {
|
|
6224
|
-
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6225
|
-
},
|
|
6249
|
+
function isHydrating() {
|
|
6250
|
+
return hydrating;
|
|
6251
|
+
}
|
|
6226
6252
|
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
},
|
|
6253
|
+
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
6254
|
+
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
6230
6255
|
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6256
|
+
function createElement$1(tagName, namespace) {
|
|
6257
|
+
return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6258
|
+
}
|
|
6234
6259
|
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6260
|
+
function createText(content) {
|
|
6261
|
+
return document.createTextNode(content);
|
|
6262
|
+
}
|
|
6238
6263
|
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6264
|
+
function createComment(content) {
|
|
6265
|
+
return document.createComment(content);
|
|
6266
|
+
}
|
|
6242
6267
|
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6268
|
+
function insert(node, parent, anchor) {
|
|
6269
|
+
parent.insertBefore(node, anchor);
|
|
6270
|
+
}
|
|
6246
6271
|
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
}
|
|
6272
|
+
function remove(node, parent) {
|
|
6273
|
+
parent.removeChild(node);
|
|
6274
|
+
}
|
|
6251
6275
|
|
|
6252
|
-
|
|
6253
|
-
|
|
6276
|
+
function nextSibling(node) {
|
|
6277
|
+
return node.nextSibling;
|
|
6278
|
+
}
|
|
6254
6279
|
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6280
|
+
function attachShadow(element, options) {
|
|
6281
|
+
if (hydrating) {
|
|
6282
|
+
return element.shadowRoot;
|
|
6283
|
+
}
|
|
6258
6284
|
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
},
|
|
6285
|
+
return element.attachShadow(options);
|
|
6286
|
+
}
|
|
6262
6287
|
|
|
6263
|
-
|
|
6288
|
+
function setText(node, content) {
|
|
6289
|
+
node.nodeValue = content;
|
|
6290
|
+
}
|
|
6264
6291
|
|
|
6265
|
-
|
|
6266
|
-
|
|
6292
|
+
function getProperty(node, key) {
|
|
6293
|
+
return node[key];
|
|
6294
|
+
}
|
|
6267
6295
|
|
|
6268
|
-
|
|
6269
|
-
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6270
|
-
},
|
|
6296
|
+
function setProperty(node, key, value) {
|
|
6271
6297
|
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
},
|
|
6298
|
+
node[key] = value;
|
|
6299
|
+
}
|
|
6275
6300
|
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
} else {
|
|
6280
|
-
element.removeAttributeNS(namespace, name);
|
|
6281
|
-
}
|
|
6282
|
-
},
|
|
6301
|
+
function getAttribute(element, name, namespace) {
|
|
6302
|
+
return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6303
|
+
}
|
|
6283
6304
|
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6305
|
+
function setAttribute(element, name, value, namespace) {
|
|
6306
|
+
return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6307
|
+
}
|
|
6287
6308
|
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6309
|
+
function removeAttribute(element, name, namespace) {
|
|
6310
|
+
if (isUndefined$1(namespace)) {
|
|
6311
|
+
element.removeAttribute(name);
|
|
6312
|
+
} else {
|
|
6313
|
+
element.removeAttributeNS(namespace, name);
|
|
6314
|
+
}
|
|
6315
|
+
}
|
|
6291
6316
|
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6317
|
+
function addEventListener(target, type, callback, options) {
|
|
6318
|
+
target.addEventListener(type, callback, options);
|
|
6319
|
+
}
|
|
6295
6320
|
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6321
|
+
function removeEventListener(target, type, callback, options) {
|
|
6322
|
+
target.removeEventListener(type, callback, options);
|
|
6323
|
+
}
|
|
6299
6324
|
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6304
|
-
},
|
|
6325
|
+
function dispatchEvent(target, event) {
|
|
6326
|
+
return target.dispatchEvent(event);
|
|
6327
|
+
}
|
|
6305
6328
|
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6329
|
+
function getClassList(element) {
|
|
6330
|
+
return element.classList;
|
|
6331
|
+
}
|
|
6309
6332
|
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6333
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
6334
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6335
|
+
// represent elements in the engine?
|
|
6336
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6337
|
+
}
|
|
6313
6338
|
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6339
|
+
function getBoundingClientRect(element) {
|
|
6340
|
+
return element.getBoundingClientRect();
|
|
6341
|
+
}
|
|
6317
6342
|
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6343
|
+
function querySelector(element, selectors) {
|
|
6344
|
+
return element.querySelector(selectors);
|
|
6345
|
+
}
|
|
6321
6346
|
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6347
|
+
function querySelectorAll(element, selectors) {
|
|
6348
|
+
return element.querySelectorAll(selectors);
|
|
6349
|
+
}
|
|
6325
6350
|
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6351
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6352
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6353
|
+
}
|
|
6329
6354
|
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6355
|
+
function getElementsByClassName(element, names) {
|
|
6356
|
+
return element.getElementsByClassName(names);
|
|
6357
|
+
}
|
|
6333
6358
|
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6359
|
+
function getChildren(element) {
|
|
6360
|
+
return element.children;
|
|
6361
|
+
}
|
|
6337
6362
|
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6363
|
+
function getChildNodes(element) {
|
|
6364
|
+
return element.childNodes;
|
|
6365
|
+
}
|
|
6341
6366
|
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6367
|
+
function getFirstChild(element) {
|
|
6368
|
+
return element.firstChild;
|
|
6369
|
+
}
|
|
6345
6370
|
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6371
|
+
function getFirstElementChild(element) {
|
|
6372
|
+
return element.firstElementChild;
|
|
6373
|
+
}
|
|
6349
6374
|
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6375
|
+
function getLastChild(element) {
|
|
6376
|
+
return element.lastChild;
|
|
6377
|
+
}
|
|
6353
6378
|
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
}
|
|
6379
|
+
function getLastElementChild(element) {
|
|
6380
|
+
return element.lastElementChild;
|
|
6381
|
+
}
|
|
6358
6382
|
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
elm.textContent = content;
|
|
6363
|
-
globalStylesheetsParentElement.appendChild(elm);
|
|
6364
|
-
},
|
|
6383
|
+
function isConnected(node) {
|
|
6384
|
+
return node.isConnected;
|
|
6385
|
+
}
|
|
6365
6386
|
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
// Fall back to <style> element
|
|
6371
|
-
insertStyleElement(content, target);
|
|
6372
|
-
}
|
|
6373
|
-
},
|
|
6387
|
+
function insertGlobalStylesheet(content) {
|
|
6388
|
+
if (!isUndefined$1(globalStylesheets[content])) {
|
|
6389
|
+
return;
|
|
6390
|
+
}
|
|
6374
6391
|
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6392
|
+
globalStylesheets[content] = true;
|
|
6393
|
+
const elm = document.createElement('style');
|
|
6394
|
+
elm.type = 'text/css';
|
|
6395
|
+
elm.textContent = content;
|
|
6396
|
+
globalStylesheetsParentElement.appendChild(elm);
|
|
6397
|
+
}
|
|
6378
6398
|
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6399
|
+
function insertStylesheet(content, target) {
|
|
6400
|
+
if (supportsConstructableStyleSheets) {
|
|
6401
|
+
insertConstructableStyleSheet(content, target);
|
|
6402
|
+
} else {
|
|
6403
|
+
// Fall back to <style> element
|
|
6404
|
+
insertStyleElement(content, target);
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
|
|
6408
|
+
const HTMLElementExported = HTMLElementConstructor;
|
|
6409
|
+
setAttachShadow(attachShadow);
|
|
6410
|
+
setCreateComment(createComment);
|
|
6411
|
+
setCreateElement(createElement$1);
|
|
6412
|
+
setCreateText(createText);
|
|
6413
|
+
setDefineCustomElement(defineCustomElement);
|
|
6414
|
+
setDispatchEvent(dispatchEvent);
|
|
6415
|
+
setGetAttribute(getAttribute);
|
|
6416
|
+
setGetBoundingClientRect(getBoundingClientRect);
|
|
6417
|
+
setGetChildNodes(getChildNodes);
|
|
6418
|
+
setGetChildren(getChildren);
|
|
6419
|
+
setGetClassList(getClassList);
|
|
6420
|
+
setGetCustomElement(getCustomElement);
|
|
6421
|
+
setGetElementsByClassName(getElementsByClassName);
|
|
6422
|
+
setGetElementsByTagName(getElementsByTagName);
|
|
6423
|
+
setGetFirstChild(getFirstChild);
|
|
6424
|
+
setGetFirstElementChild(getFirstElementChild);
|
|
6425
|
+
setGetLastChild(getLastChild);
|
|
6426
|
+
setGetLastElementChild(getLastElementChild);
|
|
6427
|
+
setGetProperty(getProperty);
|
|
6428
|
+
setHTMLElement(HTMLElementExported);
|
|
6429
|
+
setInsert(insert);
|
|
6430
|
+
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
6431
|
+
setInsertStylesheet(insertStylesheet);
|
|
6432
|
+
setIsConnected(isConnected);
|
|
6433
|
+
setIsHydrating$1(isHydrating);
|
|
6434
|
+
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
6435
|
+
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
6436
|
+
setNextSibling(nextSibling);
|
|
6437
|
+
setQuerySelector(querySelector);
|
|
6438
|
+
setQuerySelectorAll(querySelectorAll);
|
|
6439
|
+
setRemove(remove);
|
|
6440
|
+
setRemoveAttribute(removeAttribute);
|
|
6441
|
+
setRemoveEventListener(removeEventListener);
|
|
6442
|
+
setSetAttribute(setAttribute);
|
|
6443
|
+
setSetCSSStyleProperty(setCSSStyleProperty);
|
|
6444
|
+
setSetProperty(setProperty);
|
|
6445
|
+
setSetText(setText);
|
|
6446
|
+
setSsr(ssr);
|
|
6447
|
+
setAddEventListener(addEventListener);
|
|
6383
6448
|
/*
|
|
6384
6449
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6385
6450
|
* All rights reserved.
|
|
@@ -6459,7 +6524,7 @@ var LWC = (function (exports) {
|
|
|
6459
6524
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
6460
6525
|
}
|
|
6461
6526
|
|
|
6462
|
-
const UpgradableConstructor = getUpgradableConstructor(sel
|
|
6527
|
+
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
6463
6528
|
let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
6464
6529
|
|
|
6465
6530
|
/**
|
|
@@ -6474,8 +6539,7 @@ var LWC = (function (exports) {
|
|
|
6474
6539
|
createVM(elm, def, {
|
|
6475
6540
|
tagName: sel,
|
|
6476
6541
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
6477
|
-
owner: null
|
|
6478
|
-
renderer
|
|
6542
|
+
owner: null
|
|
6479
6543
|
});
|
|
6480
6544
|
ConnectingSlot.set(elm, connectRootElement);
|
|
6481
6545
|
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
@@ -6498,6 +6562,10 @@ var LWC = (function (exports) {
|
|
|
6498
6562
|
|
|
6499
6563
|
|
|
6500
6564
|
function hydrateComponent(element, Ctor, props = {}) {
|
|
6565
|
+
if (!(element instanceof Element)) {
|
|
6566
|
+
throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
|
|
6567
|
+
}
|
|
6568
|
+
|
|
6501
6569
|
if (!isFunction$1(Ctor)) {
|
|
6502
6570
|
throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
|
|
6503
6571
|
}
|
|
@@ -6515,7 +6583,6 @@ var LWC = (function (exports) {
|
|
|
6515
6583
|
createVM(element, def, {
|
|
6516
6584
|
mode: 'open',
|
|
6517
6585
|
owner: null,
|
|
6518
|
-
renderer,
|
|
6519
6586
|
tagName: element.tagName.toLowerCase()
|
|
6520
6587
|
});
|
|
6521
6588
|
|
|
@@ -6582,8 +6649,7 @@ var LWC = (function (exports) {
|
|
|
6582
6649
|
createVM(this, def, {
|
|
6583
6650
|
mode: 'open',
|
|
6584
6651
|
owner: null,
|
|
6585
|
-
tagName: this.tagName
|
|
6586
|
-
renderer
|
|
6652
|
+
tagName: this.tagName
|
|
6587
6653
|
});
|
|
6588
6654
|
}
|
|
6589
6655
|
|
|
@@ -6650,7 +6716,7 @@ var LWC = (function (exports) {
|
|
|
6650
6716
|
return false;
|
|
6651
6717
|
}
|
|
6652
6718
|
|
|
6653
|
-
if (
|
|
6719
|
+
if (isSyntheticShadowDefined) {
|
|
6654
6720
|
// TODO [#1252]: old behavior that is still used by some pieces of the platform,
|
|
6655
6721
|
// specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
|
|
6656
6722
|
// used, will be considered global elements.
|
|
@@ -6703,7 +6769,7 @@ var LWC = (function (exports) {
|
|
|
6703
6769
|
});
|
|
6704
6770
|
freeze(LightningElement);
|
|
6705
6771
|
seal(LightningElement.prototype);
|
|
6706
|
-
/* version: 2.
|
|
6772
|
+
/* version: 2.7.3 */
|
|
6707
6773
|
|
|
6708
6774
|
exports.LightningElement = LightningElement;
|
|
6709
6775
|
exports.__unstable__ProfilerControl = profilerControl;
|