lwc 2.14.1 → 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 +449 -534
- package/dist/engine-dom/iife/es2017/engine-dom.js +449 -533
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +393 -478
- package/dist/engine-dom/iife/es5/engine-dom.js +561 -700
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +498 -642
- package/dist/engine-dom/umd/es2017/engine-dom.js +449 -533
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +393 -478
- package/dist/engine-dom/umd/es5/engine-dom.js +561 -700
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +498 -642
- package/dist/engine-server/commonjs/es2017/engine-server.js +332 -437
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +332 -438
- 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.14.
|
|
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,34 +2699,36 @@ 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
2726
|
switch (type) {
|
|
2870
2727
|
case 2 /* Element */: {
|
|
2871
2728
|
// Slot content is removed to trigger slotchange event when removing slot.
|
|
2872
2729
|
// Only required for synthetic shadow.
|
|
2873
|
-
const
|
|
2874
|
-
unmountVNodes(vnode.children, elm,
|
|
2730
|
+
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
|
|
2731
|
+
unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
|
|
2875
2732
|
break;
|
|
2876
2733
|
}
|
|
2877
2734
|
case 3 /* CustomElement */: {
|
|
@@ -2884,11 +2741,11 @@ var LWC = (function (exports) {
|
|
|
2884
2741
|
}
|
|
2885
2742
|
}
|
|
2886
2743
|
}
|
|
2887
|
-
function unmountVNodes(vnodes, parent, doRemove = false, start = 0, end = vnodes.length) {
|
|
2744
|
+
function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, end = vnodes.length) {
|
|
2888
2745
|
for (; start < end; ++start) {
|
|
2889
2746
|
const ch = vnodes[start];
|
|
2890
2747
|
if (isVNode(ch)) {
|
|
2891
|
-
unmount(ch, parent, doRemove);
|
|
2748
|
+
unmount(ch, parent, renderer, doRemove);
|
|
2892
2749
|
}
|
|
2893
2750
|
}
|
|
2894
2751
|
}
|
|
@@ -2902,48 +2759,53 @@ var LWC = (function (exports) {
|
|
|
2902
2759
|
elm.$shadowToken$ = token;
|
|
2903
2760
|
}
|
|
2904
2761
|
// Set the scope token class for *.scoped.css styles
|
|
2905
|
-
function setScopeTokenClassIfNecessary(elm, owner) {
|
|
2762
|
+
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
2906
2763
|
const { cmpTemplate, context } = owner;
|
|
2764
|
+
const { getClassList } = renderer;
|
|
2907
2765
|
const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
|
|
2908
2766
|
if (!isUndefined$1(token) && context.hasScopedStyles) {
|
|
2909
|
-
|
|
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);
|
|
2910
2770
|
}
|
|
2911
2771
|
}
|
|
2912
|
-
function linkNodeToShadow(elm, owner) {
|
|
2772
|
+
function linkNodeToShadow(elm, owner, renderer) {
|
|
2913
2773
|
const { renderRoot, renderMode, shadowMode } = owner;
|
|
2774
|
+
const { isSyntheticShadowDefined } = renderer;
|
|
2914
2775
|
// TODO [#1164]: this should eventually be done by the polyfill directly
|
|
2915
|
-
if (isSyntheticShadowDefined
|
|
2776
|
+
if (isSyntheticShadowDefined) {
|
|
2916
2777
|
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
2917
2778
|
elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
|
|
2918
2779
|
}
|
|
2919
2780
|
}
|
|
2920
2781
|
}
|
|
2921
|
-
function updateTextContent(vnode) {
|
|
2782
|
+
function updateTextContent(vnode, renderer) {
|
|
2922
2783
|
const { elm, text } = vnode;
|
|
2923
|
-
setText
|
|
2784
|
+
const { setText } = renderer;
|
|
2785
|
+
setText(elm, text);
|
|
2924
2786
|
}
|
|
2925
|
-
function insertNode(node, parent, anchor) {
|
|
2926
|
-
insert
|
|
2787
|
+
function insertNode(node, parent, anchor, renderer) {
|
|
2788
|
+
renderer.insert(node, parent, anchor);
|
|
2927
2789
|
}
|
|
2928
|
-
function removeNode(node, parent) {
|
|
2929
|
-
remove
|
|
2790
|
+
function removeNode(node, parent, renderer) {
|
|
2791
|
+
renderer.remove(node, parent);
|
|
2930
2792
|
}
|
|
2931
|
-
function patchElementPropsAndAttrs$1(oldVnode, vnode) {
|
|
2793
|
+
function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
2932
2794
|
if (isNull(oldVnode)) {
|
|
2933
|
-
applyEventListeners(vnode);
|
|
2934
|
-
applyStaticClassAttribute(vnode);
|
|
2935
|
-
applyStaticStyleAttribute(vnode);
|
|
2795
|
+
applyEventListeners(vnode, renderer);
|
|
2796
|
+
applyStaticClassAttribute(vnode, renderer);
|
|
2797
|
+
applyStaticStyleAttribute(vnode, renderer);
|
|
2936
2798
|
}
|
|
2937
2799
|
// Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
|
|
2938
2800
|
// value is set before type=radio.
|
|
2939
|
-
patchClassAttribute(oldVnode, vnode);
|
|
2940
|
-
patchStyleAttribute(oldVnode, vnode);
|
|
2941
|
-
patchAttributes(oldVnode, vnode);
|
|
2942
|
-
patchProps(oldVnode, vnode);
|
|
2801
|
+
patchClassAttribute(oldVnode, vnode, renderer);
|
|
2802
|
+
patchStyleAttribute(oldVnode, vnode, renderer);
|
|
2803
|
+
patchAttributes(oldVnode, vnode, renderer);
|
|
2804
|
+
patchProps(oldVnode, vnode, renderer);
|
|
2943
2805
|
}
|
|
2944
|
-
function fallbackElmHook(elm, vnode) {
|
|
2806
|
+
function fallbackElmHook(elm, vnode, renderer) {
|
|
2945
2807
|
const { owner } = vnode;
|
|
2946
|
-
setScopeTokenClassIfNecessary(elm, owner);
|
|
2808
|
+
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
2947
2809
|
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
2948
2810
|
const { data: { context }, } = vnode;
|
|
2949
2811
|
const { stylesheetToken } = owner.context;
|
|
@@ -2983,7 +2845,7 @@ var LWC = (function (exports) {
|
|
|
2983
2845
|
vnode.children = EmptyArray;
|
|
2984
2846
|
}
|
|
2985
2847
|
}
|
|
2986
|
-
function createViewModelHook(elm, vnode) {
|
|
2848
|
+
function createViewModelHook(elm, vnode, renderer) {
|
|
2987
2849
|
let vm = getAssociatedVMIfPresent(elm);
|
|
2988
2850
|
// There is a possibility that a custom element is registered under tagName, in which case, the
|
|
2989
2851
|
// initialization is already carry on, and there is nothing else to do here since this hook is
|
|
@@ -2992,7 +2854,7 @@ var LWC = (function (exports) {
|
|
|
2992
2854
|
return vm;
|
|
2993
2855
|
}
|
|
2994
2856
|
const { sel, mode, ctor, owner } = vnode;
|
|
2995
|
-
setScopeTokenClassIfNecessary(elm, owner);
|
|
2857
|
+
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
2996
2858
|
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
2997
2859
|
const { stylesheetToken } = owner.context;
|
|
2998
2860
|
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
@@ -3001,7 +2863,7 @@ var LWC = (function (exports) {
|
|
|
3001
2863
|
setElementShadowToken(elm, stylesheetToken);
|
|
3002
2864
|
}
|
|
3003
2865
|
}
|
|
3004
|
-
vm = createVM(elm, ctor, {
|
|
2866
|
+
vm = createVM(elm, ctor, renderer, {
|
|
3005
2867
|
mode,
|
|
3006
2868
|
owner,
|
|
3007
2869
|
tagName: sel,
|
|
@@ -3073,7 +2935,7 @@ var LWC = (function (exports) {
|
|
|
3073
2935
|
}
|
|
3074
2936
|
return map;
|
|
3075
2937
|
}
|
|
3076
|
-
function updateDynamicChildren(oldCh, newCh, parent) {
|
|
2938
|
+
function updateDynamicChildren(oldCh, newCh, parent, renderer) {
|
|
3077
2939
|
let oldStartIdx = 0;
|
|
3078
2940
|
let newStartIdx = 0;
|
|
3079
2941
|
let oldEndIdx = oldCh.length - 1;
|
|
@@ -3102,26 +2964,26 @@ var LWC = (function (exports) {
|
|
|
3102
2964
|
newEndVnode = newCh[--newEndIdx];
|
|
3103
2965
|
}
|
|
3104
2966
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
3105
|
-
patch(oldStartVnode, newStartVnode);
|
|
2967
|
+
patch(oldStartVnode, newStartVnode, renderer);
|
|
3106
2968
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
3107
2969
|
newStartVnode = newCh[++newStartIdx];
|
|
3108
2970
|
}
|
|
3109
2971
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
3110
|
-
patch(oldEndVnode, newEndVnode);
|
|
2972
|
+
patch(oldEndVnode, newEndVnode, renderer);
|
|
3111
2973
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
3112
2974
|
newEndVnode = newCh[--newEndIdx];
|
|
3113
2975
|
}
|
|
3114
2976
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
3115
2977
|
// Vnode moved right
|
|
3116
|
-
patch(oldStartVnode, newEndVnode);
|
|
3117
|
-
insertNode(oldStartVnode.elm, parent, nextSibling
|
|
2978
|
+
patch(oldStartVnode, newEndVnode, renderer);
|
|
2979
|
+
insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
|
|
3118
2980
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
3119
2981
|
newEndVnode = newCh[--newEndIdx];
|
|
3120
2982
|
}
|
|
3121
2983
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
3122
2984
|
// Vnode moved left
|
|
3123
|
-
patch(oldEndVnode, newStartVnode);
|
|
3124
|
-
insertNode(newStartVnode.elm, parent, oldStartVnode.elm);
|
|
2985
|
+
patch(oldEndVnode, newStartVnode, renderer);
|
|
2986
|
+
insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
|
|
3125
2987
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
3126
2988
|
newStartVnode = newCh[++newStartIdx];
|
|
3127
2989
|
}
|
|
@@ -3132,7 +2994,7 @@ var LWC = (function (exports) {
|
|
|
3132
2994
|
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
3133
2995
|
if (isUndefined$1(idxInOld)) {
|
|
3134
2996
|
// New element
|
|
3135
|
-
mount(newStartVnode, parent, oldStartVnode.elm);
|
|
2997
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
3136
2998
|
newStartVnode = newCh[++newStartIdx];
|
|
3137
2999
|
}
|
|
3138
3000
|
else {
|
|
@@ -3140,10 +3002,10 @@ var LWC = (function (exports) {
|
|
|
3140
3002
|
if (isVNode(elmToMove)) {
|
|
3141
3003
|
if (elmToMove.sel !== newStartVnode.sel) {
|
|
3142
3004
|
// New element
|
|
3143
|
-
mount(newStartVnode, parent, oldStartVnode.elm);
|
|
3005
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
3144
3006
|
}
|
|
3145
3007
|
else {
|
|
3146
|
-
patch(elmToMove, newStartVnode);
|
|
3008
|
+
patch(elmToMove, newStartVnode, renderer);
|
|
3147
3009
|
// Delete the old child, but copy the array since it is read-only.
|
|
3148
3010
|
// The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
|
|
3149
3011
|
// so we only care about the `oldCh` object inside this function.
|
|
@@ -3155,7 +3017,7 @@ var LWC = (function (exports) {
|
|
|
3155
3017
|
}
|
|
3156
3018
|
// We've already cloned at least once, so it's no longer read-only
|
|
3157
3019
|
oldCh[idxInOld] = undefined;
|
|
3158
|
-
insertNode(elmToMove.elm, parent, oldStartVnode.elm);
|
|
3020
|
+
insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
|
|
3159
3021
|
}
|
|
3160
3022
|
}
|
|
3161
3023
|
newStartVnode = newCh[++newStartIdx];
|
|
@@ -3172,25 +3034,25 @@ var LWC = (function (exports) {
|
|
|
3172
3034
|
n = newCh[++i];
|
|
3173
3035
|
} while (!isVNode(n) && i < newChEnd);
|
|
3174
3036
|
before = isVNode(n) ? n.elm : null;
|
|
3175
|
-
mountVNodes(newCh, parent, before, newStartIdx, newEndIdx + 1);
|
|
3037
|
+
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
3176
3038
|
}
|
|
3177
3039
|
else {
|
|
3178
|
-
unmountVNodes(oldCh, parent, true, oldStartIdx, oldEndIdx + 1);
|
|
3040
|
+
unmountVNodes(oldCh, parent, renderer, true, oldStartIdx, oldEndIdx + 1);
|
|
3179
3041
|
}
|
|
3180
3042
|
}
|
|
3181
3043
|
}
|
|
3182
|
-
function updateStaticChildren(c1, c2, parent) {
|
|
3044
|
+
function updateStaticChildren(c1, c2, parent, renderer) {
|
|
3183
3045
|
const c1Length = c1.length;
|
|
3184
3046
|
const c2Length = c2.length;
|
|
3185
3047
|
if (c1Length === 0) {
|
|
3186
3048
|
// the old list is empty, we can directly insert anything new
|
|
3187
|
-
mountVNodes(c2, parent, null);
|
|
3049
|
+
mountVNodes(c2, parent, renderer, null);
|
|
3188
3050
|
return;
|
|
3189
3051
|
}
|
|
3190
3052
|
if (c2Length === 0) {
|
|
3191
3053
|
// the old list is nonempty and the new list is empty so we can directly remove all old nodes
|
|
3192
3054
|
// this is the case in which the dynamic children of an if-directive should be removed
|
|
3193
|
-
unmountVNodes(c1, parent, true);
|
|
3055
|
+
unmountVNodes(c1, parent, renderer, true);
|
|
3194
3056
|
return;
|
|
3195
3057
|
}
|
|
3196
3058
|
// if the old list is not empty, the new list MUST have the same
|
|
@@ -3203,16 +3065,16 @@ var LWC = (function (exports) {
|
|
|
3203
3065
|
if (isVNode(n1)) {
|
|
3204
3066
|
if (isVNode(n2)) {
|
|
3205
3067
|
// both vnodes are equivalent, and we just need to patch them
|
|
3206
|
-
patch(n1, n2);
|
|
3068
|
+
patch(n1, n2, renderer);
|
|
3207
3069
|
anchor = n2.elm;
|
|
3208
3070
|
}
|
|
3209
3071
|
else {
|
|
3210
3072
|
// removing the old vnode since the new one is null
|
|
3211
|
-
unmount(n1, parent, true);
|
|
3073
|
+
unmount(n1, parent, renderer, true);
|
|
3212
3074
|
}
|
|
3213
3075
|
}
|
|
3214
3076
|
else if (isVNode(n2)) {
|
|
3215
|
-
mount(n2, parent, anchor);
|
|
3077
|
+
mount(n2, parent, renderer, anchor);
|
|
3216
3078
|
anchor = n2.elm;
|
|
3217
3079
|
}
|
|
3218
3080
|
}
|
|
@@ -3528,7 +3390,7 @@ var LWC = (function (exports) {
|
|
|
3528
3390
|
}, [api.t(content)]);
|
|
3529
3391
|
}
|
|
3530
3392
|
function updateStylesheetToken(vm, template) {
|
|
3531
|
-
const { elm, context, renderMode, shadowMode } = vm;
|
|
3393
|
+
const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
|
|
3532
3394
|
const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
|
|
3533
3395
|
const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
|
|
3534
3396
|
const { hasScopedStyles } = context;
|
|
@@ -3539,10 +3401,10 @@ var LWC = (function (exports) {
|
|
|
3539
3401
|
const { stylesheetToken: oldToken, hasTokenInClass: oldHasTokenInClass, hasTokenInAttribute: oldHasTokenInAttribute, } = context;
|
|
3540
3402
|
if (!isUndefined$1(oldToken)) {
|
|
3541
3403
|
if (oldHasTokenInClass) {
|
|
3542
|
-
getClassList
|
|
3404
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
3543
3405
|
}
|
|
3544
3406
|
if (oldHasTokenInAttribute) {
|
|
3545
|
-
removeAttribute
|
|
3407
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
3546
3408
|
}
|
|
3547
3409
|
}
|
|
3548
3410
|
// Apply the new template styling token to the host element, if the new template has any
|
|
@@ -3553,11 +3415,11 @@ var LWC = (function (exports) {
|
|
|
3553
3415
|
// Set the new styling token on the host element
|
|
3554
3416
|
if (!isUndefined$1(newToken)) {
|
|
3555
3417
|
if (hasScopedStyles) {
|
|
3556
|
-
getClassList
|
|
3418
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
3557
3419
|
newHasTokenInClass = true;
|
|
3558
3420
|
}
|
|
3559
3421
|
if (isSyntheticShadow) {
|
|
3560
|
-
setAttribute
|
|
3422
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
3561
3423
|
newHasTokenInAttribute = true;
|
|
3562
3424
|
}
|
|
3563
3425
|
}
|
|
@@ -3637,13 +3499,13 @@ var LWC = (function (exports) {
|
|
|
3637
3499
|
return owner;
|
|
3638
3500
|
}
|
|
3639
3501
|
function createStylesheet(vm, stylesheets) {
|
|
3640
|
-
const { renderMode, shadowMode } = vm;
|
|
3502
|
+
const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
|
|
3641
3503
|
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
3642
3504
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3643
|
-
insertStylesheet
|
|
3505
|
+
insertStylesheet(stylesheets[i]);
|
|
3644
3506
|
}
|
|
3645
3507
|
}
|
|
3646
|
-
else if (ssr
|
|
3508
|
+
else if (ssr || vm.hydrated) {
|
|
3647
3509
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3648
3510
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3649
3511
|
// the first time the VM renders.
|
|
@@ -3657,7 +3519,7 @@ var LWC = (function (exports) {
|
|
|
3657
3519
|
// null root means a global style
|
|
3658
3520
|
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
3659
3521
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3660
|
-
insertStylesheet
|
|
3522
|
+
insertStylesheet(stylesheets[i], target);
|
|
3661
3523
|
}
|
|
3662
3524
|
}
|
|
3663
3525
|
return null;
|
|
@@ -4069,7 +3931,7 @@ var LWC = (function (exports) {
|
|
|
4069
3931
|
return ancestor;
|
|
4070
3932
|
}
|
|
4071
3933
|
|
|
4072
|
-
function createVM(elm, ctor, options) {
|
|
3934
|
+
function createVM(elm, ctor, renderer, options) {
|
|
4073
3935
|
const {
|
|
4074
3936
|
mode,
|
|
4075
3937
|
owner,
|
|
@@ -4118,9 +3980,10 @@ var LWC = (function (exports) {
|
|
|
4118
3980
|
renderRoot: null,
|
|
4119
3981
|
callHook,
|
|
4120
3982
|
setHook,
|
|
4121
|
-
getHook
|
|
3983
|
+
getHook,
|
|
3984
|
+
renderer
|
|
4122
3985
|
};
|
|
4123
|
-
vm.shadowMode = computeShadowMode(vm);
|
|
3986
|
+
vm.shadowMode = computeShadowMode(vm, renderer);
|
|
4124
3987
|
vm.tro = getTemplateReactiveObserver(vm);
|
|
4125
3988
|
|
|
4126
3989
|
|
|
@@ -4133,13 +3996,17 @@ var LWC = (function (exports) {
|
|
|
4133
3996
|
return vm;
|
|
4134
3997
|
}
|
|
4135
3998
|
|
|
4136
|
-
function computeShadowMode(vm) {
|
|
3999
|
+
function computeShadowMode(vm, renderer) {
|
|
4137
4000
|
const {
|
|
4138
4001
|
def
|
|
4139
4002
|
} = vm;
|
|
4003
|
+
const {
|
|
4004
|
+
isSyntheticShadowDefined,
|
|
4005
|
+
isNativeShadowDefined
|
|
4006
|
+
} = renderer;
|
|
4140
4007
|
let shadowMode;
|
|
4141
4008
|
|
|
4142
|
-
if (isSyntheticShadowDefined
|
|
4009
|
+
if (isSyntheticShadowDefined) {
|
|
4143
4010
|
if (def.renderMode === 0
|
|
4144
4011
|
/* Light */
|
|
4145
4012
|
) {
|
|
@@ -4148,7 +4015,7 @@ var LWC = (function (exports) {
|
|
|
4148
4015
|
shadowMode = 0
|
|
4149
4016
|
/* Native */
|
|
4150
4017
|
;
|
|
4151
|
-
} else if (isNativeShadowDefined
|
|
4018
|
+
} else if (isNativeShadowDefined) {
|
|
4152
4019
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
4153
4020
|
// the if-condition.
|
|
4154
4021
|
if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
@@ -4222,7 +4089,8 @@ var LWC = (function (exports) {
|
|
|
4222
4089
|
function patchShadowRoot(vm, newCh) {
|
|
4223
4090
|
const {
|
|
4224
4091
|
renderRoot,
|
|
4225
|
-
children: oldCh
|
|
4092
|
+
children: oldCh,
|
|
4093
|
+
renderer
|
|
4226
4094
|
} = vm; // caching the new children collection
|
|
4227
4095
|
|
|
4228
4096
|
vm.children = newCh;
|
|
@@ -4238,7 +4106,7 @@ var LWC = (function (exports) {
|
|
|
4238
4106
|
, vm);
|
|
4239
4107
|
}, () => {
|
|
4240
4108
|
// job
|
|
4241
|
-
patchChildren(oldCh, newCh, renderRoot);
|
|
4109
|
+
patchChildren(oldCh, newCh, renderRoot, renderer);
|
|
4242
4110
|
}, () => {
|
|
4243
4111
|
// post
|
|
4244
4112
|
logOperationEnd(2
|
|
@@ -4263,10 +4131,13 @@ var LWC = (function (exports) {
|
|
|
4263
4131
|
const {
|
|
4264
4132
|
def: {
|
|
4265
4133
|
renderedCallback
|
|
4134
|
+
},
|
|
4135
|
+
renderer: {
|
|
4136
|
+
ssr
|
|
4266
4137
|
}
|
|
4267
4138
|
} = vm;
|
|
4268
4139
|
|
|
4269
|
-
if (isTrue(ssr
|
|
4140
|
+
if (isTrue(ssr)) {
|
|
4270
4141
|
return;
|
|
4271
4142
|
}
|
|
4272
4143
|
|
|
@@ -4491,14 +4362,17 @@ var LWC = (function (exports) {
|
|
|
4491
4362
|
function resetComponentRoot(vm) {
|
|
4492
4363
|
const {
|
|
4493
4364
|
children,
|
|
4494
|
-
renderRoot
|
|
4365
|
+
renderRoot,
|
|
4366
|
+
renderer: {
|
|
4367
|
+
remove
|
|
4368
|
+
}
|
|
4495
4369
|
} = vm;
|
|
4496
4370
|
|
|
4497
4371
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
4498
4372
|
const child = children[i];
|
|
4499
4373
|
|
|
4500
4374
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
4501
|
-
remove
|
|
4375
|
+
remove(child.elm, renderRoot);
|
|
4502
4376
|
}
|
|
4503
4377
|
}
|
|
4504
4378
|
|
|
@@ -4507,7 +4381,13 @@ var LWC = (function (exports) {
|
|
|
4507
4381
|
vm.velements = EmptyArray;
|
|
4508
4382
|
}
|
|
4509
4383
|
function scheduleRehydration(vm) {
|
|
4510
|
-
|
|
4384
|
+
const {
|
|
4385
|
+
renderer: {
|
|
4386
|
+
ssr
|
|
4387
|
+
}
|
|
4388
|
+
} = vm;
|
|
4389
|
+
|
|
4390
|
+
if (isTrue(ssr) || isTrue(vm.isScheduled)) {
|
|
4511
4391
|
return;
|
|
4512
4392
|
}
|
|
4513
4393
|
|
|
@@ -4666,6 +4546,9 @@ var LWC = (function (exports) {
|
|
|
4666
4546
|
context: {
|
|
4667
4547
|
wiredConnecting,
|
|
4668
4548
|
wiredDisconnecting
|
|
4549
|
+
},
|
|
4550
|
+
renderer: {
|
|
4551
|
+
dispatchEvent
|
|
4669
4552
|
}
|
|
4670
4553
|
} = vm; // waiting for the component to be connected to formally request the context via the token
|
|
4671
4554
|
|
|
@@ -4689,7 +4572,7 @@ var LWC = (function (exports) {
|
|
|
4689
4572
|
}
|
|
4690
4573
|
|
|
4691
4574
|
});
|
|
4692
|
-
dispatchEvent
|
|
4575
|
+
dispatchEvent(elm, contextRegistrationEvent);
|
|
4693
4576
|
});
|
|
4694
4577
|
}
|
|
4695
4578
|
|
|
@@ -4927,78 +4810,86 @@ var LWC = (function (exports) {
|
|
|
4927
4810
|
function hydrateVM(vm) {
|
|
4928
4811
|
const children = renderComponent(vm);
|
|
4929
4812
|
vm.children = children;
|
|
4930
|
-
const parentNode = vm
|
|
4931
|
-
hydrateChildren(getFirstChild
|
|
4813
|
+
const { renderRoot: parentNode, renderer: { getFirstChild }, } = vm;
|
|
4814
|
+
hydrateChildren(getFirstChild(parentNode), children, parentNode, vm);
|
|
4932
4815
|
runRenderedCallback(vm);
|
|
4933
4816
|
}
|
|
4934
|
-
function hydrateNode(node, vnode) {
|
|
4817
|
+
function hydrateNode(node, vnode, renderer) {
|
|
4818
|
+
var _a, _b;
|
|
4935
4819
|
let hydratedNode;
|
|
4936
4820
|
switch (vnode.type) {
|
|
4937
4821
|
case 0 /* Text */:
|
|
4938
|
-
|
|
4822
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
4823
|
+
hydratedNode = hydrateText(node, vnode, renderer);
|
|
4939
4824
|
break;
|
|
4940
4825
|
case 1 /* Comment */:
|
|
4941
|
-
|
|
4826
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
4827
|
+
hydratedNode = hydrateComment(node, vnode, renderer);
|
|
4942
4828
|
break;
|
|
4943
4829
|
case 2 /* Element */:
|
|
4944
|
-
hydratedNode = hydrateElement(node, vnode);
|
|
4830
|
+
hydratedNode = hydrateElement(node, vnode, (_a = vnode.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
4945
4831
|
break;
|
|
4946
4832
|
case 3 /* CustomElement */:
|
|
4947
|
-
hydratedNode = hydrateCustomElement(node, vnode);
|
|
4833
|
+
hydratedNode = hydrateCustomElement(node, vnode, (_b = vnode.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
4948
4834
|
break;
|
|
4949
4835
|
}
|
|
4950
|
-
return nextSibling
|
|
4836
|
+
return renderer.nextSibling(hydratedNode);
|
|
4951
4837
|
}
|
|
4952
|
-
function hydrateText(node, vnode) {
|
|
4838
|
+
function hydrateText(node, vnode, renderer) {
|
|
4953
4839
|
var _a;
|
|
4954
|
-
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT
|
|
4955
|
-
return handleMismatch(node, vnode);
|
|
4840
|
+
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */, renderer)) {
|
|
4841
|
+
return handleMismatch(node, vnode, renderer);
|
|
4956
4842
|
}
|
|
4957
|
-
setText
|
|
4843
|
+
const { setText } = renderer;
|
|
4844
|
+
setText(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
4958
4845
|
vnode.elm = node;
|
|
4959
4846
|
return node;
|
|
4960
4847
|
}
|
|
4961
|
-
function hydrateComment(node, vnode) {
|
|
4848
|
+
function hydrateComment(node, vnode, renderer) {
|
|
4962
4849
|
var _a;
|
|
4963
|
-
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT
|
|
4964
|
-
return handleMismatch(node, vnode);
|
|
4850
|
+
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */, renderer)) {
|
|
4851
|
+
return handleMismatch(node, vnode, renderer);
|
|
4965
4852
|
}
|
|
4966
|
-
setProperty
|
|
4853
|
+
const { setProperty } = renderer;
|
|
4854
|
+
setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
4967
4855
|
vnode.elm = node;
|
|
4968
4856
|
return node;
|
|
4969
4857
|
}
|
|
4970
|
-
function hydrateElement(elm, vnode) {
|
|
4971
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT
|
|
4972
|
-
!isMatchingElement(vnode, elm)) {
|
|
4973
|
-
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);
|
|
4974
4862
|
}
|
|
4975
4863
|
vnode.elm = elm;
|
|
4864
|
+
const { owner } = vnode;
|
|
4976
4865
|
const { context } = vnode.data;
|
|
4977
4866
|
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
|
|
4978
4867
|
if (isDomManual) {
|
|
4979
4868
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
4980
4869
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
4981
|
-
const { props } = vnode
|
|
4870
|
+
const { data: { props }, } = vnode;
|
|
4871
|
+
const { getProperty } = renderer;
|
|
4982
4872
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
4983
|
-
if (getProperty
|
|
4873
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
4984
4874
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
4985
4875
|
vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
|
|
4986
4876
|
}
|
|
4987
4877
|
}
|
|
4988
4878
|
}
|
|
4989
|
-
patchElementPropsAndAttrs(vnode);
|
|
4879
|
+
patchElementPropsAndAttrs(vnode, renderer);
|
|
4990
4880
|
if (!isDomManual) {
|
|
4991
|
-
|
|
4881
|
+
const { getFirstChild } = renderer;
|
|
4882
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
4992
4883
|
}
|
|
4993
4884
|
return elm;
|
|
4994
4885
|
}
|
|
4995
|
-
function hydrateCustomElement(elm, vnode) {
|
|
4996
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT
|
|
4997
|
-
!isMatchingElement(vnode, elm)) {
|
|
4998
|
-
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);
|
|
4999
4890
|
}
|
|
5000
4891
|
const { sel, mode, ctor, owner } = vnode;
|
|
5001
|
-
const vm = createVM(elm, ctor, {
|
|
4892
|
+
const vm = createVM(elm, ctor, renderer, {
|
|
5002
4893
|
mode,
|
|
5003
4894
|
owner,
|
|
5004
4895
|
tagName: sel,
|
|
@@ -5007,12 +4898,13 @@ var LWC = (function (exports) {
|
|
|
5007
4898
|
vnode.elm = elm;
|
|
5008
4899
|
vnode.vm = vm;
|
|
5009
4900
|
allocateChildren(vnode, vm);
|
|
5010
|
-
patchElementPropsAndAttrs(vnode);
|
|
4901
|
+
patchElementPropsAndAttrs(vnode, renderer);
|
|
5011
4902
|
runConnectedCallback(vm);
|
|
5012
4903
|
if (vm.renderMode !== 0 /* Light */) {
|
|
4904
|
+
const { getFirstChild } = renderer;
|
|
5013
4905
|
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
5014
4906
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
5015
|
-
hydrateChildren(getFirstChild
|
|
4907
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
5016
4908
|
}
|
|
5017
4909
|
hydrateVM(vm);
|
|
5018
4910
|
return elm;
|
|
@@ -5020,78 +4912,89 @@ var LWC = (function (exports) {
|
|
|
5020
4912
|
function hydrateChildren(node, children, parentNode, owner) {
|
|
5021
4913
|
let nextNode = node;
|
|
5022
4914
|
let anchor = null;
|
|
4915
|
+
const { renderer } = owner;
|
|
5023
4916
|
for (let i = 0; i < children.length; i++) {
|
|
5024
4917
|
const childVnode = children[i];
|
|
5025
4918
|
if (!isNull(childVnode)) {
|
|
5026
4919
|
if (nextNode) {
|
|
5027
|
-
nextNode = hydrateNode(nextNode, childVnode);
|
|
4920
|
+
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
5028
4921
|
anchor = childVnode.elm;
|
|
5029
4922
|
}
|
|
5030
4923
|
else {
|
|
5031
4924
|
hasMismatch = true;
|
|
5032
|
-
mount(childVnode, parentNode, anchor);
|
|
4925
|
+
mount(childVnode, parentNode, renderer, anchor);
|
|
5033
4926
|
anchor = childVnode.elm;
|
|
5034
4927
|
}
|
|
5035
4928
|
}
|
|
5036
4929
|
}
|
|
5037
4930
|
if (nextNode) {
|
|
5038
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;
|
|
5039
4937
|
do {
|
|
5040
4938
|
const current = nextNode;
|
|
5041
|
-
nextNode = nextSibling
|
|
5042
|
-
removeNode(current, parentNode);
|
|
4939
|
+
nextNode = nextSibling(nextNode);
|
|
4940
|
+
removeNode(current, parentNode, renderer);
|
|
5043
4941
|
} while (nextNode);
|
|
5044
4942
|
}
|
|
5045
4943
|
}
|
|
5046
|
-
function handleMismatch(node, vnode,
|
|
4944
|
+
function handleMismatch(node, vnode, renderer) {
|
|
5047
4945
|
hasMismatch = true;
|
|
5048
|
-
const
|
|
5049
|
-
|
|
5050
|
-
|
|
4946
|
+
const { getProperty } = renderer;
|
|
4947
|
+
const parentNode = getProperty(node, 'parentNode');
|
|
4948
|
+
mount(vnode, parentNode, renderer, node);
|
|
4949
|
+
removeNode(node, parentNode, renderer);
|
|
5051
4950
|
return vnode.elm;
|
|
5052
4951
|
}
|
|
5053
|
-
function patchElementPropsAndAttrs(vnode) {
|
|
5054
|
-
applyEventListeners(vnode);
|
|
5055
|
-
patchProps(null, vnode);
|
|
4952
|
+
function patchElementPropsAndAttrs(vnode, renderer) {
|
|
4953
|
+
applyEventListeners(vnode, renderer);
|
|
4954
|
+
patchProps(null, vnode, renderer);
|
|
5056
4955
|
}
|
|
5057
|
-
function hasCorrectNodeType(vnode, node, nodeType) {
|
|
5058
|
-
|
|
4956
|
+
function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
4957
|
+
const { getProperty } = renderer;
|
|
4958
|
+
if (getProperty(node, 'nodeType') !== nodeType) {
|
|
5059
4959
|
return false;
|
|
5060
4960
|
}
|
|
5061
4961
|
return true;
|
|
5062
4962
|
}
|
|
5063
|
-
function isMatchingElement(vnode, elm) {
|
|
5064
|
-
|
|
4963
|
+
function isMatchingElement(vnode, elm, renderer) {
|
|
4964
|
+
const { getProperty } = renderer;
|
|
4965
|
+
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
5065
4966
|
return false;
|
|
5066
4967
|
}
|
|
5067
|
-
const hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
5068
|
-
const hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
5069
|
-
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);
|
|
5070
4971
|
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
5071
4972
|
}
|
|
5072
|
-
function validateAttrs(vnode, elm) {
|
|
4973
|
+
function validateAttrs(vnode, elm, renderer) {
|
|
5073
4974
|
const { data: { attrs = {} }, } = vnode;
|
|
5074
4975
|
let nodesAreCompatible = true;
|
|
5075
4976
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5076
4977
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5077
4978
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
5078
|
-
const
|
|
4979
|
+
const { getAttribute } = renderer;
|
|
4980
|
+
const elmAttrValue = getAttribute(elm, attrName);
|
|
5079
4981
|
if (String(attrValue) !== elmAttrValue) {
|
|
5080
4982
|
nodesAreCompatible = false;
|
|
5081
4983
|
}
|
|
5082
4984
|
}
|
|
5083
4985
|
return nodesAreCompatible;
|
|
5084
4986
|
}
|
|
5085
|
-
function validateClassAttr(vnode, elm) {
|
|
4987
|
+
function validateClassAttr(vnode, elm, renderer) {
|
|
5086
4988
|
const { data: { className, classMap }, } = vnode;
|
|
4989
|
+
const { getProperty, getClassList } = renderer;
|
|
5087
4990
|
let nodesAreCompatible = true;
|
|
5088
|
-
if (!isUndefined$1(className) && String(className) !== getProperty
|
|
4991
|
+
if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
|
|
5089
4992
|
// className is used when class is bound to an expr.
|
|
5090
4993
|
nodesAreCompatible = false;
|
|
5091
4994
|
}
|
|
5092
4995
|
else if (!isUndefined$1(classMap)) {
|
|
5093
4996
|
// classMap is used when class is set to static value.
|
|
5094
|
-
const classList = getClassList
|
|
4997
|
+
const classList = getClassList(elm);
|
|
5095
4998
|
let computedClassName = '';
|
|
5096
4999
|
// all classes from the vnode should be in the element.classList
|
|
5097
5000
|
for (const name in classMap) {
|
|
@@ -5107,9 +5010,10 @@ var LWC = (function (exports) {
|
|
|
5107
5010
|
}
|
|
5108
5011
|
return nodesAreCompatible;
|
|
5109
5012
|
}
|
|
5110
|
-
function validateStyleAttr(vnode, elm) {
|
|
5013
|
+
function validateStyleAttr(vnode, elm, renderer) {
|
|
5111
5014
|
const { data: { style, styleDecls }, } = vnode;
|
|
5112
|
-
const
|
|
5015
|
+
const { getAttribute } = renderer;
|
|
5016
|
+
const elmStyle = getAttribute(elm, 'style') || '';
|
|
5113
5017
|
let nodesAreCompatible = true;
|
|
5114
5018
|
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
5115
5019
|
nodesAreCompatible = false;
|
|
@@ -5179,7 +5083,7 @@ var LWC = (function (exports) {
|
|
|
5179
5083
|
}
|
|
5180
5084
|
return ctor;
|
|
5181
5085
|
}
|
|
5182
|
-
/* version: 2.14.
|
|
5086
|
+
/* version: 2.14.2 */
|
|
5183
5087
|
|
|
5184
5088
|
/*
|
|
5185
5089
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5329,7 +5233,7 @@ var LWC = (function (exports) {
|
|
|
5329
5233
|
try {
|
|
5330
5234
|
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
5331
5235
|
// _wrapNativeSuper()
|
|
5332
|
-
// This is a problem because LWCUpgradableElement extends renderer.
|
|
5236
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
5333
5237
|
// get wrapped by babel.
|
|
5334
5238
|
const HTMLElementAlias = HTMLElement;
|
|
5335
5239
|
// In case we use compat mode with a modern browser, the compat mode transformation
|
|
@@ -5383,6 +5287,9 @@ var LWC = (function (exports) {
|
|
|
5383
5287
|
hydrating = value;
|
|
5384
5288
|
}
|
|
5385
5289
|
const ssr = false;
|
|
5290
|
+
function isHydrating() {
|
|
5291
|
+
return hydrating;
|
|
5292
|
+
}
|
|
5386
5293
|
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
5387
5294
|
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
5388
5295
|
function createElement$1(tagName, namespace) {
|
|
@@ -5491,44 +5398,51 @@ var LWC = (function (exports) {
|
|
|
5491
5398
|
function isConnected(node) {
|
|
5492
5399
|
return node.isConnected;
|
|
5493
5400
|
}
|
|
5401
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
5402
|
+
assert.invariant(elm instanceof HTMLElement, msg);
|
|
5403
|
+
}
|
|
5494
5404
|
const HTMLElementExported = HTMLElementConstructor;
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
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
|
+
};
|
|
5532
5446
|
|
|
5533
5447
|
/*
|
|
5534
5448
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5550,7 +5464,7 @@ var LWC = (function (exports) {
|
|
|
5550
5464
|
}
|
|
5551
5465
|
}
|
|
5552
5466
|
function createVMWithProps(element, Ctor, props) {
|
|
5553
|
-
const vm = createVM(element, Ctor, {
|
|
5467
|
+
const vm = createVM(element, Ctor, renderer, {
|
|
5554
5468
|
mode: 'open',
|
|
5555
5469
|
owner: null,
|
|
5556
5470
|
tagName: element.tagName.toLowerCase(),
|
|
@@ -5641,7 +5555,7 @@ var LWC = (function (exports) {
|
|
|
5641
5555
|
hydratedCustomElements.add(this);
|
|
5642
5556
|
}
|
|
5643
5557
|
else {
|
|
5644
|
-
createVM(this, Ctor, {
|
|
5558
|
+
createVM(this, Ctor, renderer, {
|
|
5645
5559
|
mode: 'open',
|
|
5646
5560
|
owner: null,
|
|
5647
5561
|
tagName: this.tagName,
|
|
@@ -5723,7 +5637,7 @@ var LWC = (function (exports) {
|
|
|
5723
5637
|
if (!isFunction$1(Ctor)) {
|
|
5724
5638
|
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
5725
5639
|
}
|
|
5726
|
-
const UpgradableConstructor = getUpgradableConstructor(sel);
|
|
5640
|
+
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
5727
5641
|
let wasComponentUpgraded = false;
|
|
5728
5642
|
// the custom element from the registry is expecting an upgrade callback
|
|
5729
5643
|
/**
|
|
@@ -5733,7 +5647,7 @@ var LWC = (function (exports) {
|
|
|
5733
5647
|
* an upgradable custom element.
|
|
5734
5648
|
*/
|
|
5735
5649
|
const element = new UpgradableConstructor((elm) => {
|
|
5736
|
-
createVM(elm, Ctor, {
|
|
5650
|
+
createVM(elm, Ctor, renderer, {
|
|
5737
5651
|
tagName: sel,
|
|
5738
5652
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
5739
5653
|
owner: null,
|
|
@@ -5817,7 +5731,7 @@ var LWC = (function (exports) {
|
|
|
5817
5731
|
});
|
|
5818
5732
|
freeze(LightningElement);
|
|
5819
5733
|
seal(LightningElement.prototype);
|
|
5820
|
-
/* version: 2.14.
|
|
5734
|
+
/* version: 2.14.2 */
|
|
5821
5735
|
|
|
5822
5736
|
exports.LightningElement = LightningElement;
|
|
5823
5737
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -5836,6 +5750,7 @@ var LWC = (function (exports) {
|
|
|
5836
5750
|
exports.registerComponent = registerComponent;
|
|
5837
5751
|
exports.registerDecorators = registerDecorators;
|
|
5838
5752
|
exports.registerTemplate = registerTemplate;
|
|
5753
|
+
exports.renderer = renderer;
|
|
5839
5754
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
5840
5755
|
exports.setFeatureFlag = setFeatureFlag;
|
|
5841
5756
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|