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