lwc 2.13.4 → 2.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +488 -547
- package/dist/engine-dom/iife/es2017/engine-dom.js +488 -546
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +430 -490
- package/dist/engine-dom/iife/es5/engine-dom.js +600 -715
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +535 -655
- package/dist/engine-dom/umd/es2017/engine-dom.js +488 -546
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +430 -490
- package/dist/engine-dom/umd/es5/engine-dom.js +600 -715
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +535 -655
- package/dist/engine-server/commonjs/es2017/engine-server.js +371 -450
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +371 -451
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- 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 +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- 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 +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -290,7 +290,7 @@ var LWC = (function (exports) {
|
|
|
290
290
|
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
291
291
|
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
292
292
|
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
293
|
-
/** version: 2.
|
|
293
|
+
/** version: 2.14.2 */
|
|
294
294
|
|
|
295
295
|
/*
|
|
296
296
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -494,158 +494,6 @@ var LWC = (function (exports) {
|
|
|
494
494
|
return result;
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
//
|
|
498
|
-
// Primitives
|
|
499
|
-
//
|
|
500
|
-
let ssr$1;
|
|
501
|
-
function setSsr(ssrImpl) {
|
|
502
|
-
ssr$1 = ssrImpl;
|
|
503
|
-
}
|
|
504
|
-
let isNativeShadowDefined$1;
|
|
505
|
-
function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
|
|
506
|
-
isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
|
|
507
|
-
}
|
|
508
|
-
let isSyntheticShadowDefined$1;
|
|
509
|
-
function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
|
|
510
|
-
isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
|
|
511
|
-
}
|
|
512
|
-
let HTMLElementExported$1;
|
|
513
|
-
function setHTMLElement(HTMLElementImpl) {
|
|
514
|
-
HTMLElementExported$1 = HTMLElementImpl;
|
|
515
|
-
}
|
|
516
|
-
let insert$1;
|
|
517
|
-
function setInsert(insertImpl) {
|
|
518
|
-
insert$1 = insertImpl;
|
|
519
|
-
}
|
|
520
|
-
let remove$1;
|
|
521
|
-
function setRemove(removeImpl) {
|
|
522
|
-
remove$1 = removeImpl;
|
|
523
|
-
}
|
|
524
|
-
let createElement$2;
|
|
525
|
-
function setCreateElement(createElementImpl) {
|
|
526
|
-
createElement$2 = createElementImpl;
|
|
527
|
-
}
|
|
528
|
-
let createText$1;
|
|
529
|
-
function setCreateText(createTextImpl) {
|
|
530
|
-
createText$1 = createTextImpl;
|
|
531
|
-
}
|
|
532
|
-
let createComment$1;
|
|
533
|
-
function setCreateComment(createCommentImpl) {
|
|
534
|
-
createComment$1 = createCommentImpl;
|
|
535
|
-
}
|
|
536
|
-
let nextSibling$1;
|
|
537
|
-
function setNextSibling(nextSiblingImpl) {
|
|
538
|
-
nextSibling$1 = nextSiblingImpl;
|
|
539
|
-
}
|
|
540
|
-
let attachShadow$1;
|
|
541
|
-
function setAttachShadow(attachShadowImpl) {
|
|
542
|
-
attachShadow$1 = attachShadowImpl;
|
|
543
|
-
}
|
|
544
|
-
let getProperty$1;
|
|
545
|
-
function setGetProperty(getPropertyImpl) {
|
|
546
|
-
getProperty$1 = getPropertyImpl;
|
|
547
|
-
}
|
|
548
|
-
let setProperty$1;
|
|
549
|
-
function setSetProperty(setPropertyImpl) {
|
|
550
|
-
setProperty$1 = setPropertyImpl;
|
|
551
|
-
}
|
|
552
|
-
let setText$1;
|
|
553
|
-
function setSetText(setTextImpl) {
|
|
554
|
-
setText$1 = setTextImpl;
|
|
555
|
-
}
|
|
556
|
-
let getAttribute$1;
|
|
557
|
-
function setGetAttribute(getAttributeImpl) {
|
|
558
|
-
getAttribute$1 = getAttributeImpl;
|
|
559
|
-
}
|
|
560
|
-
let setAttribute$1;
|
|
561
|
-
function setSetAttribute(setAttributeImpl) {
|
|
562
|
-
setAttribute$1 = setAttributeImpl;
|
|
563
|
-
}
|
|
564
|
-
let removeAttribute$1;
|
|
565
|
-
function setRemoveAttribute(removeAttributeImpl) {
|
|
566
|
-
removeAttribute$1 = removeAttributeImpl;
|
|
567
|
-
}
|
|
568
|
-
let addEventListener$1;
|
|
569
|
-
function setAddEventListener(addEventListenerImpl) {
|
|
570
|
-
addEventListener$1 = addEventListenerImpl;
|
|
571
|
-
}
|
|
572
|
-
let removeEventListener$1;
|
|
573
|
-
function setRemoveEventListener(removeEventListenerImpl) {
|
|
574
|
-
removeEventListener$1 = removeEventListenerImpl;
|
|
575
|
-
}
|
|
576
|
-
let dispatchEvent$1;
|
|
577
|
-
function setDispatchEvent(dispatchEventImpl) {
|
|
578
|
-
dispatchEvent$1 = dispatchEventImpl;
|
|
579
|
-
}
|
|
580
|
-
let getClassList$1;
|
|
581
|
-
function setGetClassList(getClassListImpl) {
|
|
582
|
-
getClassList$1 = getClassListImpl;
|
|
583
|
-
}
|
|
584
|
-
let setCSSStyleProperty$1;
|
|
585
|
-
function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
|
|
586
|
-
setCSSStyleProperty$1 = setCSSStylePropertyImpl;
|
|
587
|
-
}
|
|
588
|
-
let getBoundingClientRect$1;
|
|
589
|
-
function setGetBoundingClientRect(getBoundingClientRectImpl) {
|
|
590
|
-
getBoundingClientRect$1 = getBoundingClientRectImpl;
|
|
591
|
-
}
|
|
592
|
-
let querySelector$1;
|
|
593
|
-
function setQuerySelector(querySelectorImpl) {
|
|
594
|
-
querySelector$1 = querySelectorImpl;
|
|
595
|
-
}
|
|
596
|
-
let querySelectorAll$1;
|
|
597
|
-
function setQuerySelectorAll(querySelectorAllImpl) {
|
|
598
|
-
querySelectorAll$1 = querySelectorAllImpl;
|
|
599
|
-
}
|
|
600
|
-
let getElementsByTagName$1;
|
|
601
|
-
function setGetElementsByTagName(getElementsByTagNameImpl) {
|
|
602
|
-
getElementsByTagName$1 = getElementsByTagNameImpl;
|
|
603
|
-
}
|
|
604
|
-
let getElementsByClassName$1;
|
|
605
|
-
function setGetElementsByClassName(getElementsByClassNameImpl) {
|
|
606
|
-
getElementsByClassName$1 = getElementsByClassNameImpl;
|
|
607
|
-
}
|
|
608
|
-
let getChildren$1;
|
|
609
|
-
function setGetChildren(getChildrenImpl) {
|
|
610
|
-
getChildren$1 = getChildrenImpl;
|
|
611
|
-
}
|
|
612
|
-
let getChildNodes$1;
|
|
613
|
-
function setGetChildNodes(getChildNodesImpl) {
|
|
614
|
-
getChildNodes$1 = getChildNodesImpl;
|
|
615
|
-
}
|
|
616
|
-
let getFirstChild$1;
|
|
617
|
-
function setGetFirstChild(getFirstChildImpl) {
|
|
618
|
-
getFirstChild$1 = getFirstChildImpl;
|
|
619
|
-
}
|
|
620
|
-
let getFirstElementChild$1;
|
|
621
|
-
function setGetFirstElementChild(getFirstElementChildImpl) {
|
|
622
|
-
getFirstElementChild$1 = getFirstElementChildImpl;
|
|
623
|
-
}
|
|
624
|
-
let getLastChild$1;
|
|
625
|
-
function setGetLastChild(getLastChildImpl) {
|
|
626
|
-
getLastChild$1 = getLastChildImpl;
|
|
627
|
-
}
|
|
628
|
-
let getLastElementChild$1;
|
|
629
|
-
function setGetLastElementChild(getLastElementChildImpl) {
|
|
630
|
-
getLastElementChild$1 = getLastElementChildImpl;
|
|
631
|
-
}
|
|
632
|
-
let isConnected$1;
|
|
633
|
-
function setIsConnected(isConnectedImpl) {
|
|
634
|
-
isConnected$1 = isConnectedImpl;
|
|
635
|
-
}
|
|
636
|
-
let insertStylesheet$1;
|
|
637
|
-
function setInsertStylesheet(insertStylesheetImpl) {
|
|
638
|
-
insertStylesheet$1 = insertStylesheetImpl;
|
|
639
|
-
}
|
|
640
|
-
let defineCustomElement$1;
|
|
641
|
-
function setDefineCustomElement(defineCustomElementImpl) {
|
|
642
|
-
defineCustomElement$1 = defineCustomElementImpl;
|
|
643
|
-
}
|
|
644
|
-
let getCustomElement$1;
|
|
645
|
-
function setGetCustomElement(getCustomElementImpl) {
|
|
646
|
-
getCustomElement$1 = getCustomElementImpl;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
497
|
/*
|
|
650
498
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
651
499
|
* All rights reserved.
|
|
@@ -1521,8 +1369,8 @@ var LWC = (function (exports) {
|
|
|
1521
1369
|
return this;
|
|
1522
1370
|
};
|
|
1523
1371
|
function doAttachShadow(vm) {
|
|
1524
|
-
const { elm, mode, shadowMode, def: { ctor }, } = vm;
|
|
1525
|
-
const shadowRoot = attachShadow
|
|
1372
|
+
const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
|
|
1373
|
+
const shadowRoot = attachShadow(elm, {
|
|
1526
1374
|
[KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
|
|
1527
1375
|
delegatesFocus: Boolean(ctor.delegatesFocus),
|
|
1528
1376
|
mode,
|
|
@@ -1535,76 +1383,85 @@ var LWC = (function (exports) {
|
|
|
1535
1383
|
LightningElement.prototype = {
|
|
1536
1384
|
constructor: LightningElement,
|
|
1537
1385
|
dispatchEvent(event) {
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1386
|
+
const vm = getAssociatedVM(this);
|
|
1387
|
+
const { elm, renderer: { dispatchEvent }, } = vm;
|
|
1388
|
+
return dispatchEvent(elm, event);
|
|
1540
1389
|
},
|
|
1541
1390
|
addEventListener(type, listener, options) {
|
|
1542
1391
|
const vm = getAssociatedVM(this);
|
|
1543
|
-
const { elm } = vm;
|
|
1392
|
+
const { elm, renderer: { addEventListener }, } = vm;
|
|
1544
1393
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
1545
|
-
addEventListener
|
|
1394
|
+
addEventListener(elm, type, wrappedListener, options);
|
|
1546
1395
|
},
|
|
1547
1396
|
removeEventListener(type, listener, options) {
|
|
1548
1397
|
const vm = getAssociatedVM(this);
|
|
1549
|
-
const { elm } = vm;
|
|
1398
|
+
const { elm, renderer: { removeEventListener }, } = vm;
|
|
1550
1399
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
1551
|
-
removeEventListener
|
|
1400
|
+
removeEventListener(elm, type, wrappedListener, options);
|
|
1552
1401
|
},
|
|
1553
1402
|
hasAttribute(name) {
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1403
|
+
const vm = getAssociatedVM(this);
|
|
1404
|
+
const { elm, renderer: { getAttribute }, } = vm;
|
|
1405
|
+
return !isNull(getAttribute(elm, name));
|
|
1556
1406
|
},
|
|
1557
1407
|
hasAttributeNS(namespace, name) {
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1408
|
+
const vm = getAssociatedVM(this);
|
|
1409
|
+
const { elm, renderer: { getAttribute }, } = vm;
|
|
1410
|
+
return !isNull(getAttribute(elm, name, namespace));
|
|
1560
1411
|
},
|
|
1561
1412
|
removeAttribute(name) {
|
|
1562
|
-
const
|
|
1413
|
+
const vm = getAssociatedVM(this);
|
|
1414
|
+
const { elm, renderer: { removeAttribute }, } = vm;
|
|
1563
1415
|
unlockAttribute(elm, name);
|
|
1564
|
-
removeAttribute
|
|
1416
|
+
removeAttribute(elm, name);
|
|
1565
1417
|
lockAttribute();
|
|
1566
1418
|
},
|
|
1567
1419
|
removeAttributeNS(namespace, name) {
|
|
1568
|
-
const { elm } = getAssociatedVM(this);
|
|
1420
|
+
const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
|
|
1569
1421
|
unlockAttribute(elm, name);
|
|
1570
|
-
removeAttribute
|
|
1422
|
+
removeAttribute(elm, name, namespace);
|
|
1571
1423
|
lockAttribute();
|
|
1572
1424
|
},
|
|
1573
1425
|
getAttribute(name) {
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1426
|
+
const vm = getAssociatedVM(this);
|
|
1427
|
+
const { elm } = vm;
|
|
1428
|
+
const { getAttribute } = vm.renderer;
|
|
1429
|
+
return getAttribute(elm, name);
|
|
1576
1430
|
},
|
|
1577
1431
|
getAttributeNS(namespace, name) {
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1432
|
+
const vm = getAssociatedVM(this);
|
|
1433
|
+
const { elm } = vm;
|
|
1434
|
+
const { getAttribute } = vm.renderer;
|
|
1435
|
+
return getAttribute(elm, name, namespace);
|
|
1580
1436
|
},
|
|
1581
1437
|
setAttribute(name, value) {
|
|
1582
1438
|
const vm = getAssociatedVM(this);
|
|
1583
|
-
const { elm } = vm;
|
|
1439
|
+
const { elm, renderer: { setAttribute }, } = vm;
|
|
1584
1440
|
unlockAttribute(elm, name);
|
|
1585
|
-
setAttribute
|
|
1441
|
+
setAttribute(elm, name, value);
|
|
1586
1442
|
lockAttribute();
|
|
1587
1443
|
},
|
|
1588
1444
|
setAttributeNS(namespace, name, value) {
|
|
1589
1445
|
const vm = getAssociatedVM(this);
|
|
1590
|
-
const { elm } = vm;
|
|
1446
|
+
const { elm, renderer: { setAttribute }, } = vm;
|
|
1591
1447
|
unlockAttribute(elm, name);
|
|
1592
|
-
setAttribute
|
|
1448
|
+
setAttribute(elm, name, value, namespace);
|
|
1593
1449
|
lockAttribute();
|
|
1594
1450
|
},
|
|
1595
1451
|
getBoundingClientRect() {
|
|
1596
1452
|
const vm = getAssociatedVM(this);
|
|
1597
|
-
const { elm } = vm;
|
|
1598
|
-
return getBoundingClientRect
|
|
1453
|
+
const { elm, renderer: { getBoundingClientRect }, } = vm;
|
|
1454
|
+
return getBoundingClientRect(elm);
|
|
1599
1455
|
},
|
|
1600
1456
|
get isConnected() {
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1457
|
+
const vm = getAssociatedVM(this);
|
|
1458
|
+
const { elm, renderer: { isConnected }, } = vm;
|
|
1459
|
+
return isConnected(elm);
|
|
1603
1460
|
},
|
|
1604
1461
|
get classList() {
|
|
1605
1462
|
const vm = getAssociatedVM(this);
|
|
1606
|
-
const { elm } = vm;
|
|
1607
|
-
return getClassList
|
|
1463
|
+
const { elm, renderer: { getClassList }, } = vm;
|
|
1464
|
+
return getClassList(elm);
|
|
1608
1465
|
},
|
|
1609
1466
|
get template() {
|
|
1610
1467
|
const vm = getAssociatedVM(this);
|
|
@@ -1615,6 +1472,36 @@ var LWC = (function (exports) {
|
|
|
1615
1472
|
// Authors should rely on this.template instead.
|
|
1616
1473
|
return null;
|
|
1617
1474
|
},
|
|
1475
|
+
get children() {
|
|
1476
|
+
const vm = getAssociatedVM(this);
|
|
1477
|
+
const renderer = vm.renderer;
|
|
1478
|
+
return renderer.getChildren(vm.elm);
|
|
1479
|
+
},
|
|
1480
|
+
get childNodes() {
|
|
1481
|
+
const vm = getAssociatedVM(this);
|
|
1482
|
+
const renderer = vm.renderer;
|
|
1483
|
+
return renderer.getChildNodes(vm.elm);
|
|
1484
|
+
},
|
|
1485
|
+
get firstChild() {
|
|
1486
|
+
const vm = getAssociatedVM(this);
|
|
1487
|
+
const renderer = vm.renderer;
|
|
1488
|
+
return renderer.getFirstChild(vm.elm);
|
|
1489
|
+
},
|
|
1490
|
+
get firstElementChild() {
|
|
1491
|
+
const vm = getAssociatedVM(this);
|
|
1492
|
+
const renderer = vm.renderer;
|
|
1493
|
+
return renderer.getFirstElementChild(vm.elm);
|
|
1494
|
+
},
|
|
1495
|
+
get lastChild() {
|
|
1496
|
+
const vm = getAssociatedVM(this);
|
|
1497
|
+
const renderer = vm.renderer;
|
|
1498
|
+
return renderer.getLastChild(vm.elm);
|
|
1499
|
+
},
|
|
1500
|
+
get lastElementChild() {
|
|
1501
|
+
const vm = getAssociatedVM(this);
|
|
1502
|
+
const renderer = vm.renderer;
|
|
1503
|
+
return renderer.getLastElementChild(vm.elm);
|
|
1504
|
+
},
|
|
1618
1505
|
render() {
|
|
1619
1506
|
const vm = getAssociatedVM(this);
|
|
1620
1507
|
return vm.def.template;
|
|
@@ -1625,70 +1512,19 @@ var LWC = (function (exports) {
|
|
|
1625
1512
|
},
|
|
1626
1513
|
};
|
|
1627
1514
|
const queryAndChildGetterDescriptors = create(null);
|
|
1628
|
-
// The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
|
|
1629
|
-
// is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
|
|
1630
|
-
// object representing the renderer, with a lot of methods we don't actually need.
|
|
1631
|
-
const childGetters = [
|
|
1632
|
-
'children',
|
|
1633
|
-
'childNodes',
|
|
1634
|
-
'firstChild',
|
|
1635
|
-
'firstElementChild',
|
|
1636
|
-
'lastChild',
|
|
1637
|
-
'lastElementChild',
|
|
1638
|
-
];
|
|
1639
|
-
function getChildGetter(methodName) {
|
|
1640
|
-
switch (methodName) {
|
|
1641
|
-
case 'children':
|
|
1642
|
-
return getChildren$1;
|
|
1643
|
-
case 'childNodes':
|
|
1644
|
-
return getChildNodes$1;
|
|
1645
|
-
case 'firstChild':
|
|
1646
|
-
return getFirstChild$1;
|
|
1647
|
-
case 'firstElementChild':
|
|
1648
|
-
return getFirstElementChild$1;
|
|
1649
|
-
case 'lastChild':
|
|
1650
|
-
return getLastChild$1;
|
|
1651
|
-
case 'lastElementChild':
|
|
1652
|
-
return getLastElementChild$1;
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
// Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
|
|
1656
|
-
for (const childGetter of childGetters) {
|
|
1657
|
-
queryAndChildGetterDescriptors[childGetter] = {
|
|
1658
|
-
get() {
|
|
1659
|
-
const vm = getAssociatedVM(this);
|
|
1660
|
-
const { elm } = vm;
|
|
1661
|
-
return getChildGetter(childGetter)(elm);
|
|
1662
|
-
},
|
|
1663
|
-
configurable: true,
|
|
1664
|
-
enumerable: true,
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
1515
|
const queryMethods = [
|
|
1668
1516
|
'getElementsByClassName',
|
|
1669
1517
|
'getElementsByTagName',
|
|
1670
1518
|
'querySelector',
|
|
1671
1519
|
'querySelectorAll',
|
|
1672
1520
|
];
|
|
1673
|
-
function getQueryMethod(methodName) {
|
|
1674
|
-
switch (methodName) {
|
|
1675
|
-
case 'getElementsByClassName':
|
|
1676
|
-
return getElementsByClassName$1;
|
|
1677
|
-
case 'getElementsByTagName':
|
|
1678
|
-
return getElementsByTagName$1;
|
|
1679
|
-
case 'querySelector':
|
|
1680
|
-
return querySelector$1;
|
|
1681
|
-
case 'querySelectorAll':
|
|
1682
|
-
return querySelectorAll$1;
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
1521
|
// Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
1686
1522
|
for (const queryMethod of queryMethods) {
|
|
1687
1523
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
1688
1524
|
value(arg) {
|
|
1689
1525
|
const vm = getAssociatedVM(this);
|
|
1690
|
-
const { elm } = vm;
|
|
1691
|
-
return
|
|
1526
|
+
const { elm, renderer } = vm;
|
|
1527
|
+
return renderer[queryMethod](elm, arg);
|
|
1692
1528
|
},
|
|
1693
1529
|
configurable: true,
|
|
1694
1530
|
enumerable: true,
|
|
@@ -2459,12 +2295,13 @@ var LWC = (function (exports) {
|
|
|
2459
2295
|
* SPDX-License-Identifier: MIT
|
|
2460
2296
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2461
2297
|
*/
|
|
2462
|
-
function getUpgradableConstructor(tagName) {
|
|
2298
|
+
function getUpgradableConstructor(tagName, renderer) {
|
|
2299
|
+
const { getCustomElement, HTMLElementExported: RendererHTMLElement, defineCustomElement, } = renderer;
|
|
2463
2300
|
// Should never get a tag with upper case letter at this point, the compiler should
|
|
2464
2301
|
// produce only tags with lowercase letters
|
|
2465
2302
|
// But, for backwards compatibility, we will lower case the tagName
|
|
2466
2303
|
tagName = tagName.toLowerCase();
|
|
2467
|
-
let CE = getCustomElement
|
|
2304
|
+
let CE = getCustomElement(tagName);
|
|
2468
2305
|
if (!isUndefined$1(CE)) {
|
|
2469
2306
|
return CE;
|
|
2470
2307
|
}
|
|
@@ -2472,7 +2309,7 @@ var LWC = (function (exports) {
|
|
|
2472
2309
|
* LWC Upgradable Element reference to an element that was created
|
|
2473
2310
|
* via the scoped registry mechanism, and that is ready to be upgraded.
|
|
2474
2311
|
*/
|
|
2475
|
-
CE = class LWCUpgradableElement extends
|
|
2312
|
+
CE = class LWCUpgradableElement extends RendererHTMLElement {
|
|
2476
2313
|
constructor(upgradeCallback) {
|
|
2477
2314
|
super();
|
|
2478
2315
|
if (isFunction$1(upgradeCallback)) {
|
|
@@ -2480,7 +2317,7 @@ var LWC = (function (exports) {
|
|
|
2480
2317
|
}
|
|
2481
2318
|
}
|
|
2482
2319
|
};
|
|
2483
|
-
defineCustomElement
|
|
2320
|
+
defineCustomElement(tagName, CE);
|
|
2484
2321
|
return CE;
|
|
2485
2322
|
}
|
|
2486
2323
|
|
|
@@ -2505,7 +2342,7 @@ var LWC = (function (exports) {
|
|
|
2505
2342
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2506
2343
|
*/
|
|
2507
2344
|
const ColonCharCode = 58;
|
|
2508
|
-
function patchAttributes(oldVnode, vnode) {
|
|
2345
|
+
function patchAttributes(oldVnode, vnode, renderer) {
|
|
2509
2346
|
const { attrs } = vnode.data;
|
|
2510
2347
|
if (isUndefined$1(attrs)) {
|
|
2511
2348
|
return;
|
|
@@ -2515,6 +2352,7 @@ var LWC = (function (exports) {
|
|
|
2515
2352
|
return;
|
|
2516
2353
|
}
|
|
2517
2354
|
const { elm } = vnode;
|
|
2355
|
+
const { setAttribute, removeAttribute } = renderer;
|
|
2518
2356
|
for (const key in attrs) {
|
|
2519
2357
|
const cur = attrs[key];
|
|
2520
2358
|
const old = oldAttrs[key];
|
|
@@ -2522,17 +2360,17 @@ var LWC = (function (exports) {
|
|
|
2522
2360
|
unlockAttribute(elm, key);
|
|
2523
2361
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
|
|
2524
2362
|
// Assume xml namespace
|
|
2525
|
-
setAttribute
|
|
2363
|
+
setAttribute(elm, key, cur, XML_NAMESPACE);
|
|
2526
2364
|
}
|
|
2527
2365
|
else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
|
|
2528
2366
|
// Assume xlink namespace
|
|
2529
|
-
setAttribute
|
|
2367
|
+
setAttribute(elm, key, cur, XLINK_NAMESPACE);
|
|
2530
2368
|
}
|
|
2531
2369
|
else if (isNull(cur) || isUndefined$1(cur)) {
|
|
2532
|
-
removeAttribute
|
|
2370
|
+
removeAttribute(elm, key);
|
|
2533
2371
|
}
|
|
2534
2372
|
else {
|
|
2535
|
-
setAttribute
|
|
2373
|
+
setAttribute(elm, key, cur);
|
|
2536
2374
|
}
|
|
2537
2375
|
lockAttribute();
|
|
2538
2376
|
}
|
|
@@ -2550,7 +2388,7 @@ var LWC = (function (exports) {
|
|
|
2550
2388
|
// instead of relying on internally tracked values.
|
|
2551
2389
|
return sel === 'input' && (key === 'value' || key === 'checked');
|
|
2552
2390
|
}
|
|
2553
|
-
function patchProps(oldVnode, vnode) {
|
|
2391
|
+
function patchProps(oldVnode, vnode, renderer) {
|
|
2554
2392
|
const { props } = vnode.data;
|
|
2555
2393
|
if (isUndefined$1(props)) {
|
|
2556
2394
|
return;
|
|
@@ -2561,13 +2399,14 @@ var LWC = (function (exports) {
|
|
|
2561
2399
|
}
|
|
2562
2400
|
const isFirstPatch = isNull(oldVnode);
|
|
2563
2401
|
const { elm, sel } = vnode;
|
|
2402
|
+
const { getProperty, setProperty } = renderer;
|
|
2564
2403
|
for (const key in props) {
|
|
2565
2404
|
const cur = props[key];
|
|
2566
2405
|
// Set the property if it's the first time is is patched or if the previous property is
|
|
2567
2406
|
// different than the one previously set.
|
|
2568
2407
|
if (isFirstPatch ||
|
|
2569
|
-
cur !== (isLiveBindingProp(sel, key) ? getProperty
|
|
2570
|
-
setProperty
|
|
2408
|
+
cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
2409
|
+
setProperty(elm, key, cur);
|
|
2571
2410
|
}
|
|
2572
2411
|
}
|
|
2573
2412
|
}
|
|
@@ -2608,13 +2447,14 @@ var LWC = (function (exports) {
|
|
|
2608
2447
|
classNameToClassMap[className] = map;
|
|
2609
2448
|
return map;
|
|
2610
2449
|
}
|
|
2611
|
-
function patchClassAttribute(oldVnode, vnode) {
|
|
2450
|
+
function patchClassAttribute(oldVnode, vnode, renderer) {
|
|
2612
2451
|
const { elm, data: { className: newClass }, } = vnode;
|
|
2613
2452
|
const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
|
|
2614
2453
|
if (oldClass === newClass) {
|
|
2615
2454
|
return;
|
|
2616
2455
|
}
|
|
2617
|
-
const
|
|
2456
|
+
const { getClassList } = renderer;
|
|
2457
|
+
const classList = getClassList(elm);
|
|
2618
2458
|
const newClassMap = getMapFromClassName(newClass);
|
|
2619
2459
|
const oldClassMap = getMapFromClassName(oldClass);
|
|
2620
2460
|
let name;
|
|
@@ -2638,17 +2478,18 @@ var LWC = (function (exports) {
|
|
|
2638
2478
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2639
2479
|
*/
|
|
2640
2480
|
// The style property is a string when defined via an expression in the template.
|
|
2641
|
-
function patchStyleAttribute(oldVnode, vnode) {
|
|
2481
|
+
function patchStyleAttribute(oldVnode, vnode, renderer) {
|
|
2642
2482
|
const { elm, data: { style: newStyle }, } = vnode;
|
|
2643
2483
|
const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
|
|
2644
2484
|
if (oldStyle === newStyle) {
|
|
2645
2485
|
return;
|
|
2646
2486
|
}
|
|
2487
|
+
const { setAttribute, removeAttribute } = renderer;
|
|
2647
2488
|
if (!isString(newStyle) || newStyle === '') {
|
|
2648
|
-
removeAttribute
|
|
2489
|
+
removeAttribute(elm, 'style');
|
|
2649
2490
|
}
|
|
2650
2491
|
else {
|
|
2651
|
-
setAttribute
|
|
2492
|
+
setAttribute(elm, 'style', newStyle);
|
|
2652
2493
|
}
|
|
2653
2494
|
}
|
|
2654
2495
|
|
|
@@ -2658,14 +2499,15 @@ var LWC = (function (exports) {
|
|
|
2658
2499
|
* SPDX-License-Identifier: MIT
|
|
2659
2500
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2660
2501
|
*/
|
|
2661
|
-
function applyEventListeners(vnode) {
|
|
2502
|
+
function applyEventListeners(vnode, renderer) {
|
|
2662
2503
|
const { elm, data: { on }, } = vnode;
|
|
2663
2504
|
if (isUndefined$1(on)) {
|
|
2664
2505
|
return;
|
|
2665
2506
|
}
|
|
2507
|
+
const { addEventListener } = renderer;
|
|
2666
2508
|
for (const name in on) {
|
|
2667
2509
|
const handler = on[name];
|
|
2668
|
-
addEventListener
|
|
2510
|
+
addEventListener(elm, name, handler);
|
|
2669
2511
|
}
|
|
2670
2512
|
}
|
|
2671
2513
|
|
|
@@ -2678,12 +2520,13 @@ var LWC = (function (exports) {
|
|
|
2678
2520
|
// The HTML class property becomes the vnode.data.classMap object when defined as a string in the template.
|
|
2679
2521
|
// The compiler takes care of transforming the inline classnames into an object. It's faster to set the
|
|
2680
2522
|
// different classnames properties individually instead of via a string.
|
|
2681
|
-
function applyStaticClassAttribute(vnode) {
|
|
2523
|
+
function applyStaticClassAttribute(vnode, renderer) {
|
|
2682
2524
|
const { elm, data: { classMap }, } = vnode;
|
|
2683
2525
|
if (isUndefined$1(classMap)) {
|
|
2684
2526
|
return;
|
|
2685
2527
|
}
|
|
2686
|
-
const
|
|
2528
|
+
const { getClassList } = renderer;
|
|
2529
|
+
const classList = getClassList(elm);
|
|
2687
2530
|
for (const name in classMap) {
|
|
2688
2531
|
classList.add(name);
|
|
2689
2532
|
}
|
|
@@ -2698,14 +2541,15 @@ var LWC = (function (exports) {
|
|
|
2698
2541
|
// The HTML style property becomes the vnode.data.styleDecls object when defined as a string in the template.
|
|
2699
2542
|
// The compiler takes care of transforming the inline style into an object. It's faster to set the
|
|
2700
2543
|
// different style properties individually instead of via a string.
|
|
2701
|
-
function applyStaticStyleAttribute(vnode) {
|
|
2544
|
+
function applyStaticStyleAttribute(vnode, renderer) {
|
|
2702
2545
|
const { elm, data: { styleDecls }, } = vnode;
|
|
2703
2546
|
if (isUndefined$1(styleDecls)) {
|
|
2704
2547
|
return;
|
|
2705
2548
|
}
|
|
2549
|
+
const { setCSSStyleProperty } = renderer;
|
|
2706
2550
|
for (let i = 0; i < styleDecls.length; i++) {
|
|
2707
2551
|
const [prop, value, important] = styleDecls[i];
|
|
2708
|
-
setCSSStyleProperty
|
|
2552
|
+
setCSSStyleProperty(elm, prop, value, important);
|
|
2709
2553
|
}
|
|
2710
2554
|
}
|
|
2711
2555
|
|
|
@@ -2715,94 +2559,105 @@ var LWC = (function (exports) {
|
|
|
2715
2559
|
* SPDX-License-Identifier: MIT
|
|
2716
2560
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2717
2561
|
*/
|
|
2718
|
-
function patchChildren(c1, c2, parent) {
|
|
2562
|
+
function patchChildren(c1, c2, parent, renderer) {
|
|
2719
2563
|
if (hasDynamicChildren(c2)) {
|
|
2720
|
-
updateDynamicChildren(c1, c2, parent);
|
|
2564
|
+
updateDynamicChildren(c1, c2, parent, renderer);
|
|
2721
2565
|
}
|
|
2722
2566
|
else {
|
|
2723
|
-
updateStaticChildren(c1, c2, parent);
|
|
2567
|
+
updateStaticChildren(c1, c2, parent, renderer);
|
|
2724
2568
|
}
|
|
2725
2569
|
}
|
|
2726
|
-
function patch(n1, n2) {
|
|
2570
|
+
function patch(n1, n2, renderer) {
|
|
2571
|
+
var _a, _b;
|
|
2727
2572
|
if (n1 === n2) {
|
|
2728
2573
|
return;
|
|
2729
2574
|
}
|
|
2730
2575
|
switch (n2.type) {
|
|
2731
2576
|
case 0 /* Text */:
|
|
2732
|
-
|
|
2577
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
2578
|
+
patchText(n1, n2, renderer);
|
|
2733
2579
|
break;
|
|
2734
2580
|
case 1 /* Comment */:
|
|
2735
|
-
|
|
2581
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
2582
|
+
patchComment(n1, n2, renderer);
|
|
2736
2583
|
break;
|
|
2737
2584
|
case 2 /* Element */:
|
|
2738
|
-
patchElement(n1, n2);
|
|
2585
|
+
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
2739
2586
|
break;
|
|
2740
2587
|
case 3 /* CustomElement */:
|
|
2741
|
-
patchCustomElement(n1, n2);
|
|
2588
|
+
patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
2742
2589
|
break;
|
|
2743
2590
|
}
|
|
2744
2591
|
}
|
|
2745
|
-
function mount(node, parent, anchor) {
|
|
2592
|
+
function mount(node, parent, renderer, anchor) {
|
|
2593
|
+
var _a, _b;
|
|
2746
2594
|
switch (node.type) {
|
|
2747
2595
|
case 0 /* Text */:
|
|
2748
|
-
|
|
2596
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
2597
|
+
mountText(node, parent, anchor, renderer);
|
|
2749
2598
|
break;
|
|
2750
2599
|
case 1 /* Comment */:
|
|
2751
|
-
|
|
2600
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
2601
|
+
mountComment(node, parent, anchor, renderer);
|
|
2752
2602
|
break;
|
|
2753
2603
|
case 2 /* Element */:
|
|
2754
|
-
|
|
2604
|
+
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
2605
|
+
mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
2755
2606
|
break;
|
|
2756
2607
|
case 3 /* CustomElement */:
|
|
2757
|
-
|
|
2608
|
+
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
2609
|
+
mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
2758
2610
|
break;
|
|
2759
2611
|
}
|
|
2760
2612
|
}
|
|
2761
|
-
function patchText(n1, n2) {
|
|
2613
|
+
function patchText(n1, n2, renderer) {
|
|
2762
2614
|
n2.elm = n1.elm;
|
|
2763
2615
|
if (n2.text !== n1.text) {
|
|
2764
|
-
updateTextContent(n2);
|
|
2616
|
+
updateTextContent(n2, renderer);
|
|
2765
2617
|
}
|
|
2766
2618
|
}
|
|
2767
|
-
function mountText(
|
|
2768
|
-
const { owner } =
|
|
2769
|
-
const
|
|
2770
|
-
|
|
2771
|
-
|
|
2619
|
+
function mountText(vnode, parent, anchor, renderer) {
|
|
2620
|
+
const { owner } = vnode;
|
|
2621
|
+
const { createText } = renderer;
|
|
2622
|
+
const textNode = (vnode.elm = createText(vnode.text));
|
|
2623
|
+
linkNodeToShadow(textNode, owner, renderer);
|
|
2624
|
+
insertNode(textNode, parent, anchor, renderer);
|
|
2772
2625
|
}
|
|
2773
|
-
function patchComment(n1, n2) {
|
|
2626
|
+
function patchComment(n1, n2, renderer) {
|
|
2774
2627
|
n2.elm = n1.elm;
|
|
2775
2628
|
// FIXME: Comment nodes should be static, we shouldn't need to diff them together. However
|
|
2776
2629
|
// it is the case today.
|
|
2777
2630
|
if (n2.text !== n1.text) {
|
|
2778
|
-
updateTextContent(n2);
|
|
2631
|
+
updateTextContent(n2, renderer);
|
|
2779
2632
|
}
|
|
2780
2633
|
}
|
|
2781
|
-
function mountComment(
|
|
2782
|
-
const { owner } =
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2785
|
-
|
|
2634
|
+
function mountComment(vnode, parent, anchor, renderer) {
|
|
2635
|
+
const { owner } = vnode;
|
|
2636
|
+
const { createComment } = renderer;
|
|
2637
|
+
const commentNode = (vnode.elm = createComment(vnode.text));
|
|
2638
|
+
linkNodeToShadow(commentNode, owner, renderer);
|
|
2639
|
+
insertNode(commentNode, parent, anchor, renderer);
|
|
2786
2640
|
}
|
|
2787
|
-
function mountElement(vnode, parent, anchor) {
|
|
2641
|
+
function mountElement(vnode, parent, anchor, renderer) {
|
|
2788
2642
|
const { sel, owner, data: { svg }, } = vnode;
|
|
2643
|
+
const { createElement } = renderer;
|
|
2789
2644
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
2790
|
-
const elm = createElement
|
|
2791
|
-
linkNodeToShadow(elm, owner);
|
|
2792
|
-
fallbackElmHook(elm, vnode);
|
|
2645
|
+
const elm = createElement(sel, namespace);
|
|
2646
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
2647
|
+
fallbackElmHook(elm, vnode, renderer);
|
|
2793
2648
|
vnode.elm = elm;
|
|
2794
|
-
patchElementPropsAndAttrs$1(null, vnode);
|
|
2795
|
-
insertNode(elm, parent, anchor);
|
|
2796
|
-
mountVNodes(vnode.children, elm, null);
|
|
2649
|
+
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
2650
|
+
insertNode(elm, parent, anchor, renderer);
|
|
2651
|
+
mountVNodes(vnode.children, elm, renderer, null);
|
|
2797
2652
|
}
|
|
2798
|
-
function patchElement(n1, n2) {
|
|
2653
|
+
function patchElement(n1, n2, renderer) {
|
|
2799
2654
|
const elm = (n2.elm = n1.elm);
|
|
2800
|
-
patchElementPropsAndAttrs$1(n1, n2);
|
|
2801
|
-
patchChildren(n1.children, n2.children, elm);
|
|
2655
|
+
patchElementPropsAndAttrs$1(n1, n2, renderer);
|
|
2656
|
+
patchChildren(n1.children, n2.children, elm, renderer);
|
|
2802
2657
|
}
|
|
2803
|
-
function mountCustomElement(vnode, parent, anchor) {
|
|
2658
|
+
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
2804
2659
|
const { sel, owner } = vnode;
|
|
2805
|
-
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
2660
|
+
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
2806
2661
|
/**
|
|
2807
2662
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
2808
2663
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -2812,9 +2667,9 @@ var LWC = (function (exports) {
|
|
|
2812
2667
|
let vm;
|
|
2813
2668
|
const elm = new UpgradableConstructor((elm) => {
|
|
2814
2669
|
// the custom element from the registry is expecting an upgrade callback
|
|
2815
|
-
vm = createViewModelHook(elm, vnode);
|
|
2670
|
+
vm = createViewModelHook(elm, vnode, renderer);
|
|
2816
2671
|
});
|
|
2817
|
-
linkNodeToShadow(elm, owner);
|
|
2672
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
2818
2673
|
vnode.elm = elm;
|
|
2819
2674
|
vnode.vm = vm;
|
|
2820
2675
|
if (vm) {
|
|
@@ -2823,20 +2678,20 @@ var LWC = (function (exports) {
|
|
|
2823
2678
|
else if (vnode.ctor !== UpgradableConstructor) {
|
|
2824
2679
|
throw new TypeError(`Incorrect Component Constructor`);
|
|
2825
2680
|
}
|
|
2826
|
-
patchElementPropsAndAttrs$1(null, vnode);
|
|
2827
|
-
insertNode(elm, parent, anchor);
|
|
2681
|
+
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
2682
|
+
insertNode(elm, parent, anchor, renderer);
|
|
2828
2683
|
if (vm) {
|
|
2829
2684
|
runConnectedCallback(vm);
|
|
2830
2685
|
}
|
|
2831
|
-
mountVNodes(vnode.children, elm, null);
|
|
2686
|
+
mountVNodes(vnode.children, elm, renderer, null);
|
|
2832
2687
|
if (vm) {
|
|
2833
2688
|
appendVM(vm);
|
|
2834
2689
|
}
|
|
2835
2690
|
}
|
|
2836
|
-
function patchCustomElement(n1, n2) {
|
|
2691
|
+
function patchCustomElement(n1, n2, renderer) {
|
|
2837
2692
|
const elm = (n2.elm = n1.elm);
|
|
2838
2693
|
const vm = (n2.vm = n1.vm);
|
|
2839
|
-
patchElementPropsAndAttrs$1(n1, n2);
|
|
2694
|
+
patchElementPropsAndAttrs$1(n1, n2, renderer);
|
|
2840
2695
|
if (!isUndefined$1(vm)) {
|
|
2841
2696
|
// in fallback mode, the allocation will always set children to
|
|
2842
2697
|
// empty and delegate the real allocation to the slot elements
|
|
@@ -2844,33 +2699,38 @@ var LWC = (function (exports) {
|
|
|
2844
2699
|
}
|
|
2845
2700
|
// in fallback mode, the children will be always empty, so, nothing
|
|
2846
2701
|
// will happen, but in native, it does allocate the light dom
|
|
2847
|
-
patchChildren(n1.children, n2.children, elm);
|
|
2702
|
+
patchChildren(n1.children, n2.children, elm, renderer);
|
|
2848
2703
|
if (!isUndefined$1(vm)) {
|
|
2849
2704
|
// this will probably update the shadowRoot, but only if the vm is in a dirty state
|
|
2850
2705
|
// this is important to preserve the top to bottom synchronous rendering phase.
|
|
2851
2706
|
rerenderVM(vm);
|
|
2852
2707
|
}
|
|
2853
2708
|
}
|
|
2854
|
-
function mountVNodes(vnodes, parent, anchor, start = 0, end = vnodes.length) {
|
|
2709
|
+
function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
|
|
2855
2710
|
for (; start < end; ++start) {
|
|
2856
2711
|
const vnode = vnodes[start];
|
|
2857
2712
|
if (isVNode(vnode)) {
|
|
2858
|
-
mount(vnode, parent, anchor);
|
|
2713
|
+
mount(vnode, parent, renderer, anchor);
|
|
2859
2714
|
}
|
|
2860
2715
|
}
|
|
2861
2716
|
}
|
|
2862
|
-
function unmount(vnode, parent, doRemove = false) {
|
|
2717
|
+
function unmount(vnode, parent, renderer, doRemove = false) {
|
|
2863
2718
|
const { type, elm, sel } = vnode;
|
|
2864
2719
|
// When unmounting a VNode subtree not all the elements have to removed from the DOM. The
|
|
2865
2720
|
// subtree root, is the only element worth unmounting from the subtree.
|
|
2866
2721
|
if (doRemove) {
|
|
2867
|
-
|
|
2722
|
+
// The vnode might or might not have a data.renderer associated to it
|
|
2723
|
+
// but the removal used here is from the owner instead.
|
|
2724
|
+
removeNode(elm, parent, renderer);
|
|
2868
2725
|
}
|
|
2869
|
-
const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
|
|
2870
2726
|
switch (type) {
|
|
2871
|
-
case 2 /* Element */:
|
|
2872
|
-
|
|
2727
|
+
case 2 /* Element */: {
|
|
2728
|
+
// Slot content is removed to trigger slotchange event when removing slot.
|
|
2729
|
+
// Only required for synthetic shadow.
|
|
2730
|
+
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
|
|
2731
|
+
unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
|
|
2873
2732
|
break;
|
|
2733
|
+
}
|
|
2874
2734
|
case 3 /* CustomElement */: {
|
|
2875
2735
|
const { vm } = vnode;
|
|
2876
2736
|
// No need to unmount the children here, `removeVM` will take care of removing the
|
|
@@ -2881,11 +2741,11 @@ var LWC = (function (exports) {
|
|
|
2881
2741
|
}
|
|
2882
2742
|
}
|
|
2883
2743
|
}
|
|
2884
|
-
function unmountVNodes(vnodes, parent, doRemove = false, start = 0, end = vnodes.length) {
|
|
2744
|
+
function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, end = vnodes.length) {
|
|
2885
2745
|
for (; start < end; ++start) {
|
|
2886
2746
|
const ch = vnodes[start];
|
|
2887
2747
|
if (isVNode(ch)) {
|
|
2888
|
-
unmount(ch, parent, doRemove);
|
|
2748
|
+
unmount(ch, parent, renderer, doRemove);
|
|
2889
2749
|
}
|
|
2890
2750
|
}
|
|
2891
2751
|
}
|
|
@@ -2899,48 +2759,53 @@ var LWC = (function (exports) {
|
|
|
2899
2759
|
elm.$shadowToken$ = token;
|
|
2900
2760
|
}
|
|
2901
2761
|
// Set the scope token class for *.scoped.css styles
|
|
2902
|
-
function setScopeTokenClassIfNecessary(elm, owner) {
|
|
2762
|
+
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
2903
2763
|
const { cmpTemplate, context } = owner;
|
|
2764
|
+
const { getClassList } = renderer;
|
|
2904
2765
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
2905
2766
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
2906
|
-
|
|
2767
|
+
// TODO [#2762]: this dot notation with add is probably problematic
|
|
2768
|
+
// probably we should have a renderer api for just the add operation
|
|
2769
|
+
getClassList(elm).add(token);
|
|
2907
2770
|
}
|
|
2908
2771
|
}
|
|
2909
|
-
function linkNodeToShadow(elm, owner) {
|
|
2772
|
+
function linkNodeToShadow(elm, owner, renderer) {
|
|
2910
2773
|
const { renderRoot, renderMode, shadowMode } = owner;
|
|
2774
|
+
const { isSyntheticShadowDefined } = renderer;
|
|
2911
2775
|
// TODO [#1164]: this should eventually be done by the polyfill directly
|
|
2912
|
-
if (isSyntheticShadowDefined
|
|
2776
|
+
if (isSyntheticShadowDefined) {
|
|
2913
2777
|
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
2914
2778
|
elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
|
|
2915
2779
|
}
|
|
2916
2780
|
}
|
|
2917
2781
|
}
|
|
2918
|
-
function updateTextContent(vnode) {
|
|
2782
|
+
function updateTextContent(vnode, renderer) {
|
|
2919
2783
|
const { elm, text } = vnode;
|
|
2920
|
-
setText
|
|
2784
|
+
const { setText } = renderer;
|
|
2785
|
+
setText(elm, text);
|
|
2921
2786
|
}
|
|
2922
|
-
function insertNode(node, parent, anchor) {
|
|
2923
|
-
insert
|
|
2787
|
+
function insertNode(node, parent, anchor, renderer) {
|
|
2788
|
+
renderer.insert(node, parent, anchor);
|
|
2924
2789
|
}
|
|
2925
|
-
function removeNode(node, parent) {
|
|
2926
|
-
remove
|
|
2790
|
+
function removeNode(node, parent, renderer) {
|
|
2791
|
+
renderer.remove(node, parent);
|
|
2927
2792
|
}
|
|
2928
|
-
function patchElementPropsAndAttrs$1(oldVnode, vnode) {
|
|
2793
|
+
function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
2929
2794
|
if (isNull(oldVnode)) {
|
|
2930
|
-
applyEventListeners(vnode);
|
|
2931
|
-
applyStaticClassAttribute(vnode);
|
|
2932
|
-
applyStaticStyleAttribute(vnode);
|
|
2795
|
+
applyEventListeners(vnode, renderer);
|
|
2796
|
+
applyStaticClassAttribute(vnode, renderer);
|
|
2797
|
+
applyStaticStyleAttribute(vnode, renderer);
|
|
2933
2798
|
}
|
|
2934
2799
|
// Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
|
|
2935
2800
|
// value is set before type=radio.
|
|
2936
|
-
patchClassAttribute(oldVnode, vnode);
|
|
2937
|
-
patchStyleAttribute(oldVnode, vnode);
|
|
2938
|
-
patchAttributes(oldVnode, vnode);
|
|
2939
|
-
patchProps(oldVnode, vnode);
|
|
2801
|
+
patchClassAttribute(oldVnode, vnode, renderer);
|
|
2802
|
+
patchStyleAttribute(oldVnode, vnode, renderer);
|
|
2803
|
+
patchAttributes(oldVnode, vnode, renderer);
|
|
2804
|
+
patchProps(oldVnode, vnode, renderer);
|
|
2940
2805
|
}
|
|
2941
|
-
function fallbackElmHook(elm, vnode) {
|
|
2806
|
+
function fallbackElmHook(elm, vnode, renderer) {
|
|
2942
2807
|
const { owner } = vnode;
|
|
2943
|
-
setScopeTokenClassIfNecessary(elm, owner);
|
|
2808
|
+
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
2944
2809
|
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
2945
2810
|
const { data: { context }, } = vnode;
|
|
2946
2811
|
const { stylesheetToken } = owner.context;
|
|
@@ -2980,7 +2845,7 @@ var LWC = (function (exports) {
|
|
|
2980
2845
|
vnode.children = EmptyArray;
|
|
2981
2846
|
}
|
|
2982
2847
|
}
|
|
2983
|
-
function createViewModelHook(elm, vnode) {
|
|
2848
|
+
function createViewModelHook(elm, vnode, renderer) {
|
|
2984
2849
|
let vm = getAssociatedVMIfPresent(elm);
|
|
2985
2850
|
// There is a possibility that a custom element is registered under tagName, in which case, the
|
|
2986
2851
|
// initialization is already carry on, and there is nothing else to do here since this hook is
|
|
@@ -2989,7 +2854,7 @@ var LWC = (function (exports) {
|
|
|
2989
2854
|
return vm;
|
|
2990
2855
|
}
|
|
2991
2856
|
const { sel, mode, ctor, owner } = vnode;
|
|
2992
|
-
setScopeTokenClassIfNecessary(elm, owner);
|
|
2857
|
+
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
2993
2858
|
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
2994
2859
|
const { stylesheetToken } = owner.context;
|
|
2995
2860
|
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
@@ -2998,7 +2863,7 @@ var LWC = (function (exports) {
|
|
|
2998
2863
|
setElementShadowToken(elm, stylesheetToken);
|
|
2999
2864
|
}
|
|
3000
2865
|
}
|
|
3001
|
-
vm = createVM(elm, ctor, {
|
|
2866
|
+
vm = createVM(elm, ctor, renderer, {
|
|
3002
2867
|
mode,
|
|
3003
2868
|
owner,
|
|
3004
2869
|
tagName: sel,
|
|
@@ -3070,7 +2935,7 @@ var LWC = (function (exports) {
|
|
|
3070
2935
|
}
|
|
3071
2936
|
return map;
|
|
3072
2937
|
}
|
|
3073
|
-
function updateDynamicChildren(oldCh, newCh, parent) {
|
|
2938
|
+
function updateDynamicChildren(oldCh, newCh, parent, renderer) {
|
|
3074
2939
|
let oldStartIdx = 0;
|
|
3075
2940
|
let newStartIdx = 0;
|
|
3076
2941
|
let oldEndIdx = oldCh.length - 1;
|
|
@@ -3099,26 +2964,26 @@ var LWC = (function (exports) {
|
|
|
3099
2964
|
newEndVnode = newCh[--newEndIdx];
|
|
3100
2965
|
}
|
|
3101
2966
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
3102
|
-
patch(oldStartVnode, newStartVnode);
|
|
2967
|
+
patch(oldStartVnode, newStartVnode, renderer);
|
|
3103
2968
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
3104
2969
|
newStartVnode = newCh[++newStartIdx];
|
|
3105
2970
|
}
|
|
3106
2971
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
3107
|
-
patch(oldEndVnode, newEndVnode);
|
|
2972
|
+
patch(oldEndVnode, newEndVnode, renderer);
|
|
3108
2973
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
3109
2974
|
newEndVnode = newCh[--newEndIdx];
|
|
3110
2975
|
}
|
|
3111
2976
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
3112
2977
|
// Vnode moved right
|
|
3113
|
-
patch(oldStartVnode, newEndVnode);
|
|
3114
|
-
insertNode(oldStartVnode.elm, parent, nextSibling
|
|
2978
|
+
patch(oldStartVnode, newEndVnode, renderer);
|
|
2979
|
+
insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
|
|
3115
2980
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
3116
2981
|
newEndVnode = newCh[--newEndIdx];
|
|
3117
2982
|
}
|
|
3118
2983
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
3119
2984
|
// Vnode moved left
|
|
3120
|
-
patch(oldEndVnode, newStartVnode);
|
|
3121
|
-
insertNode(newStartVnode.elm, parent, oldStartVnode.elm);
|
|
2985
|
+
patch(oldEndVnode, newStartVnode, renderer);
|
|
2986
|
+
insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
|
|
3122
2987
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
3123
2988
|
newStartVnode = newCh[++newStartIdx];
|
|
3124
2989
|
}
|
|
@@ -3129,7 +2994,7 @@ var LWC = (function (exports) {
|
|
|
3129
2994
|
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
3130
2995
|
if (isUndefined$1(idxInOld)) {
|
|
3131
2996
|
// New element
|
|
3132
|
-
mount(newStartVnode, parent, oldStartVnode.elm);
|
|
2997
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
3133
2998
|
newStartVnode = newCh[++newStartIdx];
|
|
3134
2999
|
}
|
|
3135
3000
|
else {
|
|
@@ -3137,10 +3002,10 @@ var LWC = (function (exports) {
|
|
|
3137
3002
|
if (isVNode(elmToMove)) {
|
|
3138
3003
|
if (elmToMove.sel !== newStartVnode.sel) {
|
|
3139
3004
|
// New element
|
|
3140
|
-
mount(newStartVnode, parent, oldStartVnode.elm);
|
|
3005
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
3141
3006
|
}
|
|
3142
3007
|
else {
|
|
3143
|
-
patch(elmToMove, newStartVnode);
|
|
3008
|
+
patch(elmToMove, newStartVnode, renderer);
|
|
3144
3009
|
// Delete the old child, but copy the array since it is read-only.
|
|
3145
3010
|
// The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
|
|
3146
3011
|
// so we only care about the `oldCh` object inside this function.
|
|
@@ -3152,7 +3017,7 @@ var LWC = (function (exports) {
|
|
|
3152
3017
|
}
|
|
3153
3018
|
// We've already cloned at least once, so it's no longer read-only
|
|
3154
3019
|
oldCh[idxInOld] = undefined;
|
|
3155
|
-
insertNode(elmToMove.elm, parent, oldStartVnode.elm);
|
|
3020
|
+
insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
|
|
3156
3021
|
}
|
|
3157
3022
|
}
|
|
3158
3023
|
newStartVnode = newCh[++newStartIdx];
|
|
@@ -3169,25 +3034,25 @@ var LWC = (function (exports) {
|
|
|
3169
3034
|
n = newCh[++i];
|
|
3170
3035
|
} while (!isVNode(n) && i < newChEnd);
|
|
3171
3036
|
before = isVNode(n) ? n.elm : null;
|
|
3172
|
-
mountVNodes(newCh, parent, before, newStartIdx, newEndIdx + 1);
|
|
3037
|
+
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
3173
3038
|
}
|
|
3174
3039
|
else {
|
|
3175
|
-
unmountVNodes(oldCh, parent, true, oldStartIdx, oldEndIdx + 1);
|
|
3040
|
+
unmountVNodes(oldCh, parent, renderer, true, oldStartIdx, oldEndIdx + 1);
|
|
3176
3041
|
}
|
|
3177
3042
|
}
|
|
3178
3043
|
}
|
|
3179
|
-
function updateStaticChildren(c1, c2, parent) {
|
|
3044
|
+
function updateStaticChildren(c1, c2, parent, renderer) {
|
|
3180
3045
|
const c1Length = c1.length;
|
|
3181
3046
|
const c2Length = c2.length;
|
|
3182
3047
|
if (c1Length === 0) {
|
|
3183
3048
|
// the old list is empty, we can directly insert anything new
|
|
3184
|
-
mountVNodes(c2, parent, null);
|
|
3049
|
+
mountVNodes(c2, parent, renderer, null);
|
|
3185
3050
|
return;
|
|
3186
3051
|
}
|
|
3187
3052
|
if (c2Length === 0) {
|
|
3188
3053
|
// the old list is nonempty and the new list is empty so we can directly remove all old nodes
|
|
3189
3054
|
// this is the case in which the dynamic children of an if-directive should be removed
|
|
3190
|
-
unmountVNodes(c1, parent, true);
|
|
3055
|
+
unmountVNodes(c1, parent, renderer, true);
|
|
3191
3056
|
return;
|
|
3192
3057
|
}
|
|
3193
3058
|
// if the old list is not empty, the new list MUST have the same
|
|
@@ -3200,16 +3065,16 @@ var LWC = (function (exports) {
|
|
|
3200
3065
|
if (isVNode(n1)) {
|
|
3201
3066
|
if (isVNode(n2)) {
|
|
3202
3067
|
// both vnodes are equivalent, and we just need to patch them
|
|
3203
|
-
patch(n1, n2);
|
|
3068
|
+
patch(n1, n2, renderer);
|
|
3204
3069
|
anchor = n2.elm;
|
|
3205
3070
|
}
|
|
3206
3071
|
else {
|
|
3207
3072
|
// removing the old vnode since the new one is null
|
|
3208
|
-
unmount(n1, parent, true);
|
|
3073
|
+
unmount(n1, parent, renderer, true);
|
|
3209
3074
|
}
|
|
3210
3075
|
}
|
|
3211
3076
|
else if (isVNode(n2)) {
|
|
3212
|
-
mount(n2, parent, anchor);
|
|
3077
|
+
mount(n2, parent, renderer, anchor);
|
|
3213
3078
|
anchor = n2.elm;
|
|
3214
3079
|
}
|
|
3215
3080
|
}
|
|
@@ -3525,7 +3390,7 @@ var LWC = (function (exports) {
|
|
|
3525
3390
|
}, [api.t(content)]);
|
|
3526
3391
|
}
|
|
3527
3392
|
function updateStylesheetToken(vm, template) {
|
|
3528
|
-
const { elm, context, renderMode, shadowMode } = vm;
|
|
3393
|
+
const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
|
|
3529
3394
|
const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
|
|
3530
3395
|
const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
|
|
3531
3396
|
const { hasScopedStyles } = context;
|
|
@@ -3536,10 +3401,10 @@ var LWC = (function (exports) {
|
|
|
3536
3401
|
const { stylesheetToken: oldToken, hasTokenInClass: oldHasTokenInClass, hasTokenInAttribute: oldHasTokenInAttribute, } = context;
|
|
3537
3402
|
if (!isUndefined$1(oldToken)) {
|
|
3538
3403
|
if (oldHasTokenInClass) {
|
|
3539
|
-
getClassList
|
|
3404
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
3540
3405
|
}
|
|
3541
3406
|
if (oldHasTokenInAttribute) {
|
|
3542
|
-
removeAttribute
|
|
3407
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
3543
3408
|
}
|
|
3544
3409
|
}
|
|
3545
3410
|
// Apply the new template styling token to the host element, if the new template has any
|
|
@@ -3550,11 +3415,11 @@ var LWC = (function (exports) {
|
|
|
3550
3415
|
// Set the new styling token on the host element
|
|
3551
3416
|
if (!isUndefined$1(newToken)) {
|
|
3552
3417
|
if (hasScopedStyles) {
|
|
3553
|
-
getClassList
|
|
3418
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
3554
3419
|
newHasTokenInClass = true;
|
|
3555
3420
|
}
|
|
3556
3421
|
if (isSyntheticShadow) {
|
|
3557
|
-
setAttribute
|
|
3422
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
3558
3423
|
newHasTokenInAttribute = true;
|
|
3559
3424
|
}
|
|
3560
3425
|
}
|
|
@@ -3634,13 +3499,13 @@ var LWC = (function (exports) {
|
|
|
3634
3499
|
return owner;
|
|
3635
3500
|
}
|
|
3636
3501
|
function createStylesheet(vm, stylesheets) {
|
|
3637
|
-
const { renderMode, shadowMode } = vm;
|
|
3502
|
+
const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
|
|
3638
3503
|
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
3639
3504
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3640
|
-
insertStylesheet
|
|
3505
|
+
insertStylesheet(stylesheets[i]);
|
|
3641
3506
|
}
|
|
3642
3507
|
}
|
|
3643
|
-
else if (ssr
|
|
3508
|
+
else if (ssr || vm.hydrated) {
|
|
3644
3509
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3645
3510
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3646
3511
|
// the first time the VM renders.
|
|
@@ -3654,7 +3519,7 @@ var LWC = (function (exports) {
|
|
|
3654
3519
|
// null root means a global style
|
|
3655
3520
|
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
3656
3521
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3657
|
-
insertStylesheet
|
|
3522
|
+
insertStylesheet(stylesheets[i], target);
|
|
3658
3523
|
}
|
|
3659
3524
|
}
|
|
3660
3525
|
return null;
|
|
@@ -4053,9 +3918,20 @@ var LWC = (function (exports) {
|
|
|
4053
3918
|
|
|
4054
3919
|
resetComponentStateWhenRemoved(vm);
|
|
4055
3920
|
}
|
|
4056
|
-
function createVM(elm, ctor, options) {
|
|
4057
|
-
var _a;
|
|
4058
3921
|
|
|
3922
|
+
function getNearestShadowAncestor(vm) {
|
|
3923
|
+
let ancestor = vm.owner;
|
|
3924
|
+
|
|
3925
|
+
while (!isNull(ancestor) && ancestor.renderMode === 0
|
|
3926
|
+
/* Light */
|
|
3927
|
+
) {
|
|
3928
|
+
ancestor = ancestor.owner;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
return ancestor;
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
function createVM(elm, ctor, renderer, options) {
|
|
4059
3935
|
const {
|
|
4060
3936
|
mode,
|
|
4061
3937
|
owner,
|
|
@@ -4085,8 +3961,6 @@ var LWC = (function (exports) {
|
|
|
4085
3961
|
cmpTemplate: null,
|
|
4086
3962
|
hydrated: Boolean(hydrated),
|
|
4087
3963
|
renderMode: def.renderMode,
|
|
4088
|
-
shadowMode: computeShadowMode(def, owner),
|
|
4089
|
-
nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
|
|
4090
3964
|
context: {
|
|
4091
3965
|
stylesheetToken: undefined,
|
|
4092
3966
|
hasTokenInClass: undefined,
|
|
@@ -4099,14 +3973,17 @@ var LWC = (function (exports) {
|
|
|
4099
3973
|
},
|
|
4100
3974
|
// Properties set right after VM creation.
|
|
4101
3975
|
tro: null,
|
|
3976
|
+
shadowMode: null,
|
|
4102
3977
|
// Properties set by the LightningElement constructor.
|
|
4103
3978
|
component: null,
|
|
4104
3979
|
shadowRoot: null,
|
|
4105
3980
|
renderRoot: null,
|
|
4106
3981
|
callHook,
|
|
4107
3982
|
setHook,
|
|
4108
|
-
getHook
|
|
3983
|
+
getHook,
|
|
3984
|
+
renderer
|
|
4109
3985
|
};
|
|
3986
|
+
vm.shadowMode = computeShadowMode(vm, renderer);
|
|
4110
3987
|
vm.tro = getTemplateReactiveObserver(vm);
|
|
4111
3988
|
|
|
4112
3989
|
|
|
@@ -4119,12 +3996,17 @@ var LWC = (function (exports) {
|
|
|
4119
3996
|
return vm;
|
|
4120
3997
|
}
|
|
4121
3998
|
|
|
4122
|
-
function computeShadowMode(
|
|
4123
|
-
|
|
4124
|
-
|
|
3999
|
+
function computeShadowMode(vm, renderer) {
|
|
4000
|
+
const {
|
|
4001
|
+
def
|
|
4002
|
+
} = vm;
|
|
4003
|
+
const {
|
|
4004
|
+
isSyntheticShadowDefined,
|
|
4005
|
+
isNativeShadowDefined
|
|
4006
|
+
} = renderer;
|
|
4125
4007
|
let shadowMode;
|
|
4126
4008
|
|
|
4127
|
-
if (isSyntheticShadowDefined
|
|
4009
|
+
if (isSyntheticShadowDefined) {
|
|
4128
4010
|
if (def.renderMode === 0
|
|
4129
4011
|
/* Light */
|
|
4130
4012
|
) {
|
|
@@ -4133,7 +4015,7 @@ var LWC = (function (exports) {
|
|
|
4133
4015
|
shadowMode = 0
|
|
4134
4016
|
/* Native */
|
|
4135
4017
|
;
|
|
4136
|
-
} else if (isNativeShadowDefined
|
|
4018
|
+
} else if (isNativeShadowDefined) {
|
|
4137
4019
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
4138
4020
|
// the if-condition.
|
|
4139
4021
|
if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
@@ -4144,13 +4026,23 @@ var LWC = (function (exports) {
|
|
|
4144
4026
|
/* Native */
|
|
4145
4027
|
;
|
|
4146
4028
|
} else {
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4029
|
+
const shadowAncestor = getNearestShadowAncestor(vm);
|
|
4030
|
+
|
|
4031
|
+
if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
|
|
4032
|
+
/* Native */
|
|
4033
|
+
) {
|
|
4034
|
+
// Transitive support for native Shadow DOM. A component in native mode
|
|
4035
|
+
// transitively opts all of its descendants into native.
|
|
4036
|
+
shadowMode = 0
|
|
4037
|
+
/* Native */
|
|
4038
|
+
;
|
|
4039
|
+
} else {
|
|
4040
|
+
// Synthetic if neither this component nor any of its ancestors are configured
|
|
4041
|
+
// to be native.
|
|
4042
|
+
shadowMode = 1
|
|
4043
|
+
/* Synthetic */
|
|
4044
|
+
;
|
|
4045
|
+
}
|
|
4154
4046
|
}
|
|
4155
4047
|
} else {
|
|
4156
4048
|
shadowMode = 1
|
|
@@ -4197,7 +4089,8 @@ var LWC = (function (exports) {
|
|
|
4197
4089
|
function patchShadowRoot(vm, newCh) {
|
|
4198
4090
|
const {
|
|
4199
4091
|
renderRoot,
|
|
4200
|
-
children: oldCh
|
|
4092
|
+
children: oldCh,
|
|
4093
|
+
renderer
|
|
4201
4094
|
} = vm; // caching the new children collection
|
|
4202
4095
|
|
|
4203
4096
|
vm.children = newCh;
|
|
@@ -4213,7 +4106,7 @@ var LWC = (function (exports) {
|
|
|
4213
4106
|
, vm);
|
|
4214
4107
|
}, () => {
|
|
4215
4108
|
// job
|
|
4216
|
-
patchChildren(oldCh, newCh, renderRoot);
|
|
4109
|
+
patchChildren(oldCh, newCh, renderRoot, renderer);
|
|
4217
4110
|
}, () => {
|
|
4218
4111
|
// post
|
|
4219
4112
|
logOperationEnd(2
|
|
@@ -4238,10 +4131,13 @@ var LWC = (function (exports) {
|
|
|
4238
4131
|
const {
|
|
4239
4132
|
def: {
|
|
4240
4133
|
renderedCallback
|
|
4134
|
+
},
|
|
4135
|
+
renderer: {
|
|
4136
|
+
ssr
|
|
4241
4137
|
}
|
|
4242
4138
|
} = vm;
|
|
4243
4139
|
|
|
4244
|
-
if (isTrue(ssr
|
|
4140
|
+
if (isTrue(ssr)) {
|
|
4245
4141
|
return;
|
|
4246
4142
|
}
|
|
4247
4143
|
|
|
@@ -4466,14 +4362,17 @@ var LWC = (function (exports) {
|
|
|
4466
4362
|
function resetComponentRoot(vm) {
|
|
4467
4363
|
const {
|
|
4468
4364
|
children,
|
|
4469
|
-
renderRoot
|
|
4365
|
+
renderRoot,
|
|
4366
|
+
renderer: {
|
|
4367
|
+
remove
|
|
4368
|
+
}
|
|
4470
4369
|
} = vm;
|
|
4471
4370
|
|
|
4472
4371
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
4473
4372
|
const child = children[i];
|
|
4474
4373
|
|
|
4475
4374
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
4476
|
-
remove
|
|
4375
|
+
remove(child.elm, renderRoot);
|
|
4477
4376
|
}
|
|
4478
4377
|
}
|
|
4479
4378
|
|
|
@@ -4482,7 +4381,13 @@ var LWC = (function (exports) {
|
|
|
4482
4381
|
vm.velements = EmptyArray;
|
|
4483
4382
|
}
|
|
4484
4383
|
function scheduleRehydration(vm) {
|
|
4485
|
-
|
|
4384
|
+
const {
|
|
4385
|
+
renderer: {
|
|
4386
|
+
ssr
|
|
4387
|
+
}
|
|
4388
|
+
} = vm;
|
|
4389
|
+
|
|
4390
|
+
if (isTrue(ssr) || isTrue(vm.isScheduled)) {
|
|
4486
4391
|
return;
|
|
4487
4392
|
}
|
|
4488
4393
|
|
|
@@ -4641,6 +4546,9 @@ var LWC = (function (exports) {
|
|
|
4641
4546
|
context: {
|
|
4642
4547
|
wiredConnecting,
|
|
4643
4548
|
wiredDisconnecting
|
|
4549
|
+
},
|
|
4550
|
+
renderer: {
|
|
4551
|
+
dispatchEvent
|
|
4644
4552
|
}
|
|
4645
4553
|
} = vm; // waiting for the component to be connected to formally request the context via the token
|
|
4646
4554
|
|
|
@@ -4664,7 +4572,7 @@ var LWC = (function (exports) {
|
|
|
4664
4572
|
}
|
|
4665
4573
|
|
|
4666
4574
|
});
|
|
4667
|
-
dispatchEvent
|
|
4575
|
+
dispatchEvent(elm, contextRegistrationEvent);
|
|
4668
4576
|
});
|
|
4669
4577
|
}
|
|
4670
4578
|
|
|
@@ -4902,78 +4810,86 @@ var LWC = (function (exports) {
|
|
|
4902
4810
|
function hydrateVM(vm) {
|
|
4903
4811
|
const children = renderComponent(vm);
|
|
4904
4812
|
vm.children = children;
|
|
4905
|
-
const parentNode = vm
|
|
4906
|
-
hydrateChildren(getFirstChild
|
|
4813
|
+
const { renderRoot: parentNode, renderer: { getFirstChild }, } = vm;
|
|
4814
|
+
hydrateChildren(getFirstChild(parentNode), children, parentNode, vm);
|
|
4907
4815
|
runRenderedCallback(vm);
|
|
4908
4816
|
}
|
|
4909
|
-
function hydrateNode(node, vnode) {
|
|
4817
|
+
function hydrateNode(node, vnode, renderer) {
|
|
4818
|
+
var _a, _b;
|
|
4910
4819
|
let hydratedNode;
|
|
4911
4820
|
switch (vnode.type) {
|
|
4912
4821
|
case 0 /* Text */:
|
|
4913
|
-
|
|
4822
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
4823
|
+
hydratedNode = hydrateText(node, vnode, renderer);
|
|
4914
4824
|
break;
|
|
4915
4825
|
case 1 /* Comment */:
|
|
4916
|
-
|
|
4826
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
4827
|
+
hydratedNode = hydrateComment(node, vnode, renderer);
|
|
4917
4828
|
break;
|
|
4918
4829
|
case 2 /* Element */:
|
|
4919
|
-
hydratedNode = hydrateElement(node, vnode);
|
|
4830
|
+
hydratedNode = hydrateElement(node, vnode, (_a = vnode.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
4920
4831
|
break;
|
|
4921
4832
|
case 3 /* CustomElement */:
|
|
4922
|
-
hydratedNode = hydrateCustomElement(node, vnode);
|
|
4833
|
+
hydratedNode = hydrateCustomElement(node, vnode, (_b = vnode.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
4923
4834
|
break;
|
|
4924
4835
|
}
|
|
4925
|
-
return nextSibling
|
|
4836
|
+
return renderer.nextSibling(hydratedNode);
|
|
4926
4837
|
}
|
|
4927
|
-
function hydrateText(node, vnode) {
|
|
4838
|
+
function hydrateText(node, vnode, renderer) {
|
|
4928
4839
|
var _a;
|
|
4929
|
-
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT
|
|
4930
|
-
return handleMismatch(node, vnode);
|
|
4840
|
+
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */, renderer)) {
|
|
4841
|
+
return handleMismatch(node, vnode, renderer);
|
|
4931
4842
|
}
|
|
4932
|
-
setText
|
|
4843
|
+
const { setText } = renderer;
|
|
4844
|
+
setText(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
4933
4845
|
vnode.elm = node;
|
|
4934
4846
|
return node;
|
|
4935
4847
|
}
|
|
4936
|
-
function hydrateComment(node, vnode) {
|
|
4848
|
+
function hydrateComment(node, vnode, renderer) {
|
|
4937
4849
|
var _a;
|
|
4938
|
-
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT
|
|
4939
|
-
return handleMismatch(node, vnode);
|
|
4850
|
+
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */, renderer)) {
|
|
4851
|
+
return handleMismatch(node, vnode, renderer);
|
|
4940
4852
|
}
|
|
4941
|
-
setProperty
|
|
4853
|
+
const { setProperty } = renderer;
|
|
4854
|
+
setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
4942
4855
|
vnode.elm = node;
|
|
4943
4856
|
return node;
|
|
4944
4857
|
}
|
|
4945
|
-
function hydrateElement(elm, vnode) {
|
|
4946
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT
|
|
4947
|
-
!isMatchingElement(vnode, elm)) {
|
|
4948
|
-
return handleMismatch(elm, vnode);
|
|
4858
|
+
function hydrateElement(elm, vnode, renderer) {
|
|
4859
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
|
|
4860
|
+
!isMatchingElement(vnode, elm, renderer)) {
|
|
4861
|
+
return handleMismatch(elm, vnode, renderer);
|
|
4949
4862
|
}
|
|
4950
4863
|
vnode.elm = elm;
|
|
4864
|
+
const { owner } = vnode;
|
|
4951
4865
|
const { context } = vnode.data;
|
|
4952
4866
|
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
|
|
4953
4867
|
if (isDomManual) {
|
|
4954
4868
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
4955
4869
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
4956
|
-
const { props } = vnode
|
|
4870
|
+
const { data: { props }, } = vnode;
|
|
4871
|
+
const { getProperty } = renderer;
|
|
4957
4872
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
4958
|
-
if (getProperty
|
|
4873
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
4959
4874
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
4960
4875
|
vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
|
|
4961
4876
|
}
|
|
4962
4877
|
}
|
|
4963
4878
|
}
|
|
4964
|
-
patchElementPropsAndAttrs(vnode);
|
|
4879
|
+
patchElementPropsAndAttrs(vnode, renderer);
|
|
4965
4880
|
if (!isDomManual) {
|
|
4966
|
-
|
|
4881
|
+
const { getFirstChild } = renderer;
|
|
4882
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
4967
4883
|
}
|
|
4968
4884
|
return elm;
|
|
4969
4885
|
}
|
|
4970
|
-
function hydrateCustomElement(elm, vnode) {
|
|
4971
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT
|
|
4972
|
-
!isMatchingElement(vnode, elm)) {
|
|
4973
|
-
return handleMismatch(elm, vnode);
|
|
4886
|
+
function hydrateCustomElement(elm, vnode, renderer) {
|
|
4887
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
|
|
4888
|
+
!isMatchingElement(vnode, elm, renderer)) {
|
|
4889
|
+
return handleMismatch(elm, vnode, renderer);
|
|
4974
4890
|
}
|
|
4975
4891
|
const { sel, mode, ctor, owner } = vnode;
|
|
4976
|
-
const vm = createVM(elm, ctor, {
|
|
4892
|
+
const vm = createVM(elm, ctor, renderer, {
|
|
4977
4893
|
mode,
|
|
4978
4894
|
owner,
|
|
4979
4895
|
tagName: sel,
|
|
@@ -4982,12 +4898,13 @@ var LWC = (function (exports) {
|
|
|
4982
4898
|
vnode.elm = elm;
|
|
4983
4899
|
vnode.vm = vm;
|
|
4984
4900
|
allocateChildren(vnode, vm);
|
|
4985
|
-
patchElementPropsAndAttrs(vnode);
|
|
4901
|
+
patchElementPropsAndAttrs(vnode, renderer);
|
|
4986
4902
|
runConnectedCallback(vm);
|
|
4987
4903
|
if (vm.renderMode !== 0 /* Light */) {
|
|
4904
|
+
const { getFirstChild } = renderer;
|
|
4988
4905
|
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
4989
4906
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
4990
|
-
hydrateChildren(getFirstChild
|
|
4907
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
4991
4908
|
}
|
|
4992
4909
|
hydrateVM(vm);
|
|
4993
4910
|
return elm;
|
|
@@ -4995,78 +4912,89 @@ var LWC = (function (exports) {
|
|
|
4995
4912
|
function hydrateChildren(node, children, parentNode, owner) {
|
|
4996
4913
|
let nextNode = node;
|
|
4997
4914
|
let anchor = null;
|
|
4915
|
+
const { renderer } = owner;
|
|
4998
4916
|
for (let i = 0; i < children.length; i++) {
|
|
4999
4917
|
const childVnode = children[i];
|
|
5000
4918
|
if (!isNull(childVnode)) {
|
|
5001
4919
|
if (nextNode) {
|
|
5002
|
-
nextNode = hydrateNode(nextNode, childVnode);
|
|
4920
|
+
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
5003
4921
|
anchor = childVnode.elm;
|
|
5004
4922
|
}
|
|
5005
4923
|
else {
|
|
5006
4924
|
hasMismatch = true;
|
|
5007
|
-
mount(childVnode, parentNode, anchor);
|
|
4925
|
+
mount(childVnode, parentNode, renderer, anchor);
|
|
5008
4926
|
anchor = childVnode.elm;
|
|
5009
4927
|
}
|
|
5010
4928
|
}
|
|
5011
4929
|
}
|
|
5012
4930
|
if (nextNode) {
|
|
5013
4931
|
hasMismatch = true;
|
|
4932
|
+
// nextSibling is mostly harmless, and since we don't have
|
|
4933
|
+
// a good reference to what element to act upon, we instead
|
|
4934
|
+
// rely on the vm's associated renderer for navigating to the
|
|
4935
|
+
// next node in the list to be hydrated.
|
|
4936
|
+
const { nextSibling } = renderer;
|
|
5014
4937
|
do {
|
|
5015
4938
|
const current = nextNode;
|
|
5016
|
-
nextNode = nextSibling
|
|
5017
|
-
removeNode(current, parentNode);
|
|
4939
|
+
nextNode = nextSibling(nextNode);
|
|
4940
|
+
removeNode(current, parentNode, renderer);
|
|
5018
4941
|
} while (nextNode);
|
|
5019
4942
|
}
|
|
5020
4943
|
}
|
|
5021
|
-
function handleMismatch(node, vnode,
|
|
4944
|
+
function handleMismatch(node, vnode, renderer) {
|
|
5022
4945
|
hasMismatch = true;
|
|
5023
|
-
const
|
|
5024
|
-
|
|
5025
|
-
|
|
4946
|
+
const { getProperty } = renderer;
|
|
4947
|
+
const parentNode = getProperty(node, 'parentNode');
|
|
4948
|
+
mount(vnode, parentNode, renderer, node);
|
|
4949
|
+
removeNode(node, parentNode, renderer);
|
|
5026
4950
|
return vnode.elm;
|
|
5027
4951
|
}
|
|
5028
|
-
function patchElementPropsAndAttrs(vnode) {
|
|
5029
|
-
applyEventListeners(vnode);
|
|
5030
|
-
patchProps(null, vnode);
|
|
4952
|
+
function patchElementPropsAndAttrs(vnode, renderer) {
|
|
4953
|
+
applyEventListeners(vnode, renderer);
|
|
4954
|
+
patchProps(null, vnode, renderer);
|
|
5031
4955
|
}
|
|
5032
|
-
function hasCorrectNodeType(vnode, node, nodeType) {
|
|
5033
|
-
|
|
4956
|
+
function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
4957
|
+
const { getProperty } = renderer;
|
|
4958
|
+
if (getProperty(node, 'nodeType') !== nodeType) {
|
|
5034
4959
|
return false;
|
|
5035
4960
|
}
|
|
5036
4961
|
return true;
|
|
5037
4962
|
}
|
|
5038
|
-
function isMatchingElement(vnode, elm) {
|
|
5039
|
-
|
|
4963
|
+
function isMatchingElement(vnode, elm, renderer) {
|
|
4964
|
+
const { getProperty } = renderer;
|
|
4965
|
+
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
5040
4966
|
return false;
|
|
5041
4967
|
}
|
|
5042
|
-
const hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
5043
|
-
const hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
5044
|
-
const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
|
|
4968
|
+
const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
|
|
4969
|
+
const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
|
|
4970
|
+
const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
|
|
5045
4971
|
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
5046
4972
|
}
|
|
5047
|
-
function validateAttrs(vnode, elm) {
|
|
4973
|
+
function validateAttrs(vnode, elm, renderer) {
|
|
5048
4974
|
const { data: { attrs = {} }, } = vnode;
|
|
5049
4975
|
let nodesAreCompatible = true;
|
|
5050
4976
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5051
4977
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5052
4978
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
5053
|
-
const
|
|
4979
|
+
const { getAttribute } = renderer;
|
|
4980
|
+
const elmAttrValue = getAttribute(elm, attrName);
|
|
5054
4981
|
if (String(attrValue) !== elmAttrValue) {
|
|
5055
4982
|
nodesAreCompatible = false;
|
|
5056
4983
|
}
|
|
5057
4984
|
}
|
|
5058
4985
|
return nodesAreCompatible;
|
|
5059
4986
|
}
|
|
5060
|
-
function validateClassAttr(vnode, elm) {
|
|
4987
|
+
function validateClassAttr(vnode, elm, renderer) {
|
|
5061
4988
|
const { data: { className, classMap }, } = vnode;
|
|
4989
|
+
const { getProperty, getClassList } = renderer;
|
|
5062
4990
|
let nodesAreCompatible = true;
|
|
5063
|
-
if (!isUndefined$1(className) && String(className) !== getProperty
|
|
4991
|
+
if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
|
|
5064
4992
|
// className is used when class is bound to an expr.
|
|
5065
4993
|
nodesAreCompatible = false;
|
|
5066
4994
|
}
|
|
5067
4995
|
else if (!isUndefined$1(classMap)) {
|
|
5068
4996
|
// classMap is used when class is set to static value.
|
|
5069
|
-
const classList = getClassList
|
|
4997
|
+
const classList = getClassList(elm);
|
|
5070
4998
|
let computedClassName = '';
|
|
5071
4999
|
// all classes from the vnode should be in the element.classList
|
|
5072
5000
|
for (const name in classMap) {
|
|
@@ -5082,9 +5010,10 @@ var LWC = (function (exports) {
|
|
|
5082
5010
|
}
|
|
5083
5011
|
return nodesAreCompatible;
|
|
5084
5012
|
}
|
|
5085
|
-
function validateStyleAttr(vnode, elm) {
|
|
5013
|
+
function validateStyleAttr(vnode, elm, renderer) {
|
|
5086
5014
|
const { data: { style, styleDecls }, } = vnode;
|
|
5087
|
-
const
|
|
5015
|
+
const { getAttribute } = renderer;
|
|
5016
|
+
const elmStyle = getAttribute(elm, 'style') || '';
|
|
5088
5017
|
let nodesAreCompatible = true;
|
|
5089
5018
|
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
5090
5019
|
nodesAreCompatible = false;
|
|
@@ -5154,7 +5083,7 @@ var LWC = (function (exports) {
|
|
|
5154
5083
|
}
|
|
5155
5084
|
return ctor;
|
|
5156
5085
|
}
|
|
5157
|
-
/* version: 2.
|
|
5086
|
+
/* version: 2.14.2 */
|
|
5158
5087
|
|
|
5159
5088
|
/*
|
|
5160
5089
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5304,7 +5233,7 @@ var LWC = (function (exports) {
|
|
|
5304
5233
|
try {
|
|
5305
5234
|
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
5306
5235
|
// _wrapNativeSuper()
|
|
5307
|
-
// This is a problem because LWCUpgradableElement extends renderer.
|
|
5236
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
5308
5237
|
// get wrapped by babel.
|
|
5309
5238
|
const HTMLElementAlias = HTMLElement;
|
|
5310
5239
|
// In case we use compat mode with a modern browser, the compat mode transformation
|
|
@@ -5358,6 +5287,9 @@ var LWC = (function (exports) {
|
|
|
5358
5287
|
hydrating = value;
|
|
5359
5288
|
}
|
|
5360
5289
|
const ssr = false;
|
|
5290
|
+
function isHydrating() {
|
|
5291
|
+
return hydrating;
|
|
5292
|
+
}
|
|
5361
5293
|
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
5362
5294
|
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
5363
5295
|
function createElement$1(tagName, namespace) {
|
|
@@ -5466,44 +5398,51 @@ var LWC = (function (exports) {
|
|
|
5466
5398
|
function isConnected(node) {
|
|
5467
5399
|
return node.isConnected;
|
|
5468
5400
|
}
|
|
5401
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
5402
|
+
assert.invariant(elm instanceof HTMLElement, msg);
|
|
5403
|
+
}
|
|
5469
5404
|
const HTMLElementExported = HTMLElementConstructor;
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5405
|
+
const renderer = {
|
|
5406
|
+
ssr,
|
|
5407
|
+
isNativeShadowDefined,
|
|
5408
|
+
isSyntheticShadowDefined,
|
|
5409
|
+
HTMLElementExported,
|
|
5410
|
+
isHydrating,
|
|
5411
|
+
insert,
|
|
5412
|
+
remove,
|
|
5413
|
+
createElement: createElement$1,
|
|
5414
|
+
createText,
|
|
5415
|
+
createComment,
|
|
5416
|
+
nextSibling,
|
|
5417
|
+
attachShadow,
|
|
5418
|
+
getProperty,
|
|
5419
|
+
setProperty,
|
|
5420
|
+
setText,
|
|
5421
|
+
getAttribute,
|
|
5422
|
+
setAttribute,
|
|
5423
|
+
removeAttribute,
|
|
5424
|
+
addEventListener,
|
|
5425
|
+
removeEventListener,
|
|
5426
|
+
dispatchEvent,
|
|
5427
|
+
getClassList,
|
|
5428
|
+
setCSSStyleProperty,
|
|
5429
|
+
getBoundingClientRect,
|
|
5430
|
+
querySelector,
|
|
5431
|
+
querySelectorAll,
|
|
5432
|
+
getElementsByTagName,
|
|
5433
|
+
getElementsByClassName,
|
|
5434
|
+
getChildren,
|
|
5435
|
+
getChildNodes,
|
|
5436
|
+
getFirstChild,
|
|
5437
|
+
getFirstElementChild,
|
|
5438
|
+
getLastChild,
|
|
5439
|
+
getLastElementChild,
|
|
5440
|
+
isConnected,
|
|
5441
|
+
insertStylesheet,
|
|
5442
|
+
assertInstanceOfHTMLElement,
|
|
5443
|
+
defineCustomElement,
|
|
5444
|
+
getCustomElement,
|
|
5445
|
+
};
|
|
5507
5446
|
|
|
5508
5447
|
/*
|
|
5509
5448
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5525,7 +5464,7 @@ var LWC = (function (exports) {
|
|
|
5525
5464
|
}
|
|
5526
5465
|
}
|
|
5527
5466
|
function createVMWithProps(element, Ctor, props) {
|
|
5528
|
-
const vm = createVM(element, Ctor, {
|
|
5467
|
+
const vm = createVM(element, Ctor, renderer, {
|
|
5529
5468
|
mode: 'open',
|
|
5530
5469
|
owner: null,
|
|
5531
5470
|
tagName: element.tagName.toLowerCase(),
|
|
@@ -5616,7 +5555,7 @@ var LWC = (function (exports) {
|
|
|
5616
5555
|
hydratedCustomElements.add(this);
|
|
5617
5556
|
}
|
|
5618
5557
|
else {
|
|
5619
|
-
createVM(this, Ctor, {
|
|
5558
|
+
createVM(this, Ctor, renderer, {
|
|
5620
5559
|
mode: 'open',
|
|
5621
5560
|
owner: null,
|
|
5622
5561
|
tagName: this.tagName,
|
|
@@ -5698,7 +5637,7 @@ var LWC = (function (exports) {
|
|
|
5698
5637
|
if (!isFunction$1(Ctor)) {
|
|
5699
5638
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
5700
5639
|
}
|
|
5701
|
-
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5640
|
+
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5702
5641
|
let wasComponentUpgraded = false;
|
|
5703
5642
|
// the custom element from the registry is expecting an upgrade callback
|
|
5704
5643
|
/**
|
|
@@ -5708,7 +5647,7 @@ var LWC = (function (exports) {
|
|
|
5708
5647
|
* an upgradable custom element.
|
|
5709
5648
|
*/
|
|
5710
5649
|
const element = new UpgradableConstructor((elm) => {
|
|
5711
|
-
createVM(elm, Ctor, {
|
|
5650
|
+
createVM(elm, Ctor, renderer, {
|
|
5712
5651
|
tagName: sel,
|
|
5713
5652
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
5714
5653
|
owner: null,
|
|
@@ -5792,7 +5731,7 @@ var LWC = (function (exports) {
|
|
|
5792
5731
|
});
|
|
5793
5732
|
freeze(LightningElement);
|
|
5794
5733
|
seal(LightningElement.prototype);
|
|
5795
|
-
/* version: 2.
|
|
5734
|
+
/* version: 2.14.2 */
|
|
5796
5735
|
|
|
5797
5736
|
exports.LightningElement = LightningElement;
|
|
5798
5737
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -5811,6 +5750,7 @@ var LWC = (function (exports) {
|
|
|
5811
5750
|
exports.registerComponent = registerComponent;
|
|
5812
5751
|
exports.registerDecorators = registerDecorators;
|
|
5813
5752
|
exports.registerTemplate = registerTemplate;
|
|
5753
|
+
exports.renderer = renderer;
|
|
5814
5754
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
5815
5755
|
exports.setFeatureFlag = setFeatureFlag;
|
|
5816
5756
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|