lwc 2.23.1 → 2.23.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 +1182 -856
- package/dist/engine-dom/iife/es2017/engine-dom.js +1182 -855
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1101 -803
- package/dist/engine-dom/iife/es5/engine-dom.js +449 -368
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +409 -335
- package/dist/engine-dom/umd/es2017/engine-dom.js +1182 -855
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1101 -803
- package/dist/engine-dom/umd/es5/engine-dom.js +449 -368
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +409 -335
- package/dist/engine-server/commonjs/es2017/engine-server.js +782 -521
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +782 -521
- 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
|
@@ -368,9 +368,9 @@
|
|
|
368
368
|
// Increment whenever the LWC template compiler changes
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
var LWC_VERSION = "2.23.
|
|
371
|
+
var LWC_VERSION = "2.23.2";
|
|
372
372
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
373
|
-
/** version: 2.23.
|
|
373
|
+
/** version: 2.23.2 */
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
patch$1(propName);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
/** version: 2.23.
|
|
467
|
+
/** version: 2.23.2 */
|
|
468
468
|
|
|
469
469
|
/**
|
|
470
470
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -486,6 +486,7 @@
|
|
|
486
486
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
487
487
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
488
488
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
489
|
+
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
489
490
|
ENABLE_NODE_LIST_PATCH: null,
|
|
490
491
|
ENABLE_NODE_PATCH: null,
|
|
491
492
|
ENABLE_REACTIVE_SETTER: null,
|
|
@@ -555,7 +556,7 @@
|
|
|
555
556
|
setFeatureFlag(name, value);
|
|
556
557
|
}
|
|
557
558
|
}
|
|
558
|
-
/** version: 2.23.
|
|
559
|
+
/** version: 2.23.2 */
|
|
559
560
|
|
|
560
561
|
/*
|
|
561
562
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -997,8 +998,8 @@
|
|
|
997
998
|
// to inject at runtime.
|
|
998
999
|
|
|
999
1000
|
|
|
1000
|
-
var HTMLElementConstructor
|
|
1001
|
-
var HTMLElementPrototype = HTMLElementConstructor
|
|
1001
|
+
var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
|
|
1002
|
+
var HTMLElementPrototype = HTMLElementConstructor.prototype;
|
|
1002
1003
|
/*
|
|
1003
1004
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1004
1005
|
* All rights reserved.
|
|
@@ -1218,10 +1219,10 @@
|
|
|
1218
1219
|
}; // Apply extra restriction related to DOM manipulation if the element is not a portal.
|
|
1219
1220
|
|
|
1220
1221
|
if (!options.isLight && !options.isPortal) {
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1222
|
+
var appendChild = elm.appendChild,
|
|
1223
|
+
insertBefore = elm.insertBefore,
|
|
1224
|
+
removeChild = elm.removeChild,
|
|
1225
|
+
replaceChild = elm.replaceChild;
|
|
1225
1226
|
var originalNodeValueDescriptor = getPropertyDescriptor(elm, 'nodeValue');
|
|
1226
1227
|
var originalInnerHTMLDescriptor = getPropertyDescriptor(elm, 'innerHTML');
|
|
1227
1228
|
var originalTextContentDescriptor = getPropertyDescriptor(elm, 'textContent');
|
|
@@ -1229,7 +1230,7 @@
|
|
|
1229
1230
|
appendChild: generateDataDescriptor({
|
|
1230
1231
|
value: function value(aChild) {
|
|
1231
1232
|
logMissingPortalError('appendChild', 'method');
|
|
1232
|
-
return
|
|
1233
|
+
return appendChild.call(this, aChild);
|
|
1233
1234
|
}
|
|
1234
1235
|
}),
|
|
1235
1236
|
insertBefore: generateDataDescriptor({
|
|
@@ -1238,7 +1239,7 @@
|
|
|
1238
1239
|
logMissingPortalError('insertBefore', 'method');
|
|
1239
1240
|
}
|
|
1240
1241
|
|
|
1241
|
-
return
|
|
1242
|
+
return insertBefore.call(this, newNode, referenceNode);
|
|
1242
1243
|
}
|
|
1243
1244
|
}),
|
|
1244
1245
|
removeChild: generateDataDescriptor({
|
|
@@ -1247,13 +1248,13 @@
|
|
|
1247
1248
|
logMissingPortalError('removeChild', 'method');
|
|
1248
1249
|
}
|
|
1249
1250
|
|
|
1250
|
-
return
|
|
1251
|
+
return removeChild.call(this, aChild);
|
|
1251
1252
|
}
|
|
1252
1253
|
}),
|
|
1253
1254
|
replaceChild: generateDataDescriptor({
|
|
1254
1255
|
value: function value(newChild, oldChild) {
|
|
1255
1256
|
logMissingPortalError('replaceChild', 'method');
|
|
1256
|
-
return
|
|
1257
|
+
return replaceChild.call(this, newChild, oldChild);
|
|
1257
1258
|
}
|
|
1258
1259
|
}),
|
|
1259
1260
|
nodeValue: generateAccessorDescriptor({
|
|
@@ -2414,9 +2415,8 @@
|
|
|
2414
2415
|
var bridge = def.bridge;
|
|
2415
2416
|
|
|
2416
2417
|
if (process.env.NODE_ENV !== 'production') {
|
|
2417
|
-
var
|
|
2418
|
-
|
|
2419
|
-
_assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
|
|
2418
|
+
var assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
|
|
2419
|
+
assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
|
|
2420
2420
|
}
|
|
2421
2421
|
|
|
2422
2422
|
var component = this;
|
|
@@ -3593,7 +3593,7 @@
|
|
|
3593
3593
|
return HTMLBridgeElement;
|
|
3594
3594
|
}
|
|
3595
3595
|
|
|
3596
|
-
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor
|
|
3596
|
+
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
|
|
3597
3597
|
freeze(BaseBridgeElement);
|
|
3598
3598
|
seal(BaseBridgeElement.prototype);
|
|
3599
3599
|
/*
|
|
@@ -4388,6 +4388,18 @@
|
|
|
4388
4388
|
*/
|
|
4389
4389
|
|
|
4390
4390
|
|
|
4391
|
+
function checkHasVM(elm) {
|
|
4392
|
+
var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
4393
|
+
|
|
4394
|
+
if (process.env.NODE_ENV !== 'production' && !hasVM) {
|
|
4395
|
+
// Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
|
|
4396
|
+
// we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
|
|
4397
|
+
logError("VM for tag name \"".concat(elm.tagName.toLowerCase(), "\" is undefined. ") + "This indicates that an element was created with this tag name, " + "which is already reserved by an LWC component. Use lwc.createElement " + "instead to create elements.");
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
return hasVM;
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4391
4403
|
function getUpgradableConstructor(tagName, renderer) {
|
|
4392
4404
|
var getCustomElement = renderer.getCustomElement,
|
|
4393
4405
|
RendererHTMLElement = renderer.HTMLElementExported,
|
|
@@ -4429,6 +4441,20 @@
|
|
|
4429
4441
|
return _createClass(LWCUpgradableElement);
|
|
4430
4442
|
}(RendererHTMLElement);
|
|
4431
4443
|
|
|
4444
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4445
|
+
CE.prototype.connectedCallback = function () {
|
|
4446
|
+
if (checkHasVM(this)) {
|
|
4447
|
+
connectRootElement(this);
|
|
4448
|
+
}
|
|
4449
|
+
};
|
|
4450
|
+
|
|
4451
|
+
CE.prototype.disconnectedCallback = function () {
|
|
4452
|
+
if (checkHasVM(this)) {
|
|
4453
|
+
disconnectRootElement(this);
|
|
4454
|
+
}
|
|
4455
|
+
};
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4432
4458
|
defineCustomElement(tagName, CE);
|
|
4433
4459
|
return CE;
|
|
4434
4460
|
}
|
|
@@ -4540,6 +4566,15 @@
|
|
|
4540
4566
|
// different than the one previously set.
|
|
4541
4567
|
|
|
4542
4568
|
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
4569
|
+
// Additional verification if properties are supported by the element
|
|
4570
|
+
// Validation relies on html properties and public properties being defined on the element,
|
|
4571
|
+
// SSR has its own custom validation.
|
|
4572
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4573
|
+
if (!(key in elm)) {
|
|
4574
|
+
logWarn("Unknown public property \"".concat(key, "\" of element <").concat(elm.tagName.toLowerCase(), ">. This is either a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\", or the attribute does not exist in this browser or DOM implementation."));
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4543
4578
|
setProperty(elm, key, cur);
|
|
4544
4579
|
}
|
|
4545
4580
|
}
|
|
@@ -4952,13 +4987,19 @@
|
|
|
4952
4987
|
insertNode(elm, parent, anchor, renderer);
|
|
4953
4988
|
|
|
4954
4989
|
if (vm) {
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4990
|
+
{
|
|
4991
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
4992
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4993
|
+
// With synthetic lifecycle callbacks, it's possible for elements to be removed without the engine
|
|
4994
|
+
// noticing it (e.g. `appendChild` the same host element twice). This test ensures we don't regress.
|
|
4995
|
+
assert.isTrue(vm.state === 0
|
|
4996
|
+
/* VMState.created */
|
|
4997
|
+
, "".concat(vm, " cannot be recycled."));
|
|
4998
|
+
}
|
|
4960
4999
|
|
|
4961
|
-
|
|
5000
|
+
runConnectedCallback(vm);
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
4962
5003
|
}
|
|
4963
5004
|
|
|
4964
5005
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -5148,10 +5189,10 @@
|
|
|
5148
5189
|
var scopeToken = getScopeTokenClass(owner);
|
|
5149
5190
|
|
|
5150
5191
|
if (!isNull(scopeToken)) {
|
|
5151
|
-
var
|
|
5192
|
+
var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
5152
5193
|
// probably we should have a renderer api for just the add operation
|
|
5153
5194
|
|
|
5154
|
-
|
|
5195
|
+
getClassList(elm).add(scopeToken);
|
|
5155
5196
|
} // Set property element for synthetic shadow DOM style scoping.
|
|
5156
5197
|
|
|
5157
5198
|
|
|
@@ -7666,6 +7707,8 @@
|
|
|
7666
7707
|
return renderer.nextSibling(hydratedNode);
|
|
7667
7708
|
}
|
|
7668
7709
|
|
|
7710
|
+
var NODE_VALUE_PROP = 'nodeValue';
|
|
7711
|
+
|
|
7669
7712
|
function hydrateText(node, vnode, renderer) {
|
|
7670
7713
|
var _a;
|
|
7671
7714
|
|
|
@@ -7676,9 +7719,8 @@
|
|
|
7676
7719
|
}
|
|
7677
7720
|
|
|
7678
7721
|
if (process.env.NODE_ENV !== 'production') {
|
|
7679
|
-
var
|
|
7680
|
-
|
|
7681
|
-
var nodeValue = _getProperty(node, 'nodeValue');
|
|
7722
|
+
var getProperty = renderer.getProperty;
|
|
7723
|
+
var nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
7682
7724
|
|
|
7683
7725
|
if (nodeValue !== vnode.text && !(nodeValue === "\u200D" && vnode.text === '')) {
|
|
7684
7726
|
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
@@ -7701,9 +7743,8 @@
|
|
|
7701
7743
|
}
|
|
7702
7744
|
|
|
7703
7745
|
if (process.env.NODE_ENV !== 'production') {
|
|
7704
|
-
var
|
|
7705
|
-
|
|
7706
|
-
var nodeValue = _getProperty2(node, 'nodeValue');
|
|
7746
|
+
var getProperty = renderer.getProperty;
|
|
7747
|
+
var nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
7707
7748
|
|
|
7708
7749
|
if (nodeValue !== vnode.text) {
|
|
7709
7750
|
logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
|
|
@@ -7711,7 +7752,7 @@
|
|
|
7711
7752
|
}
|
|
7712
7753
|
|
|
7713
7754
|
var setProperty = renderer.setProperty;
|
|
7714
|
-
setProperty(node,
|
|
7755
|
+
setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
7715
7756
|
vnode.elm = node;
|
|
7716
7757
|
return node;
|
|
7717
7758
|
}
|
|
@@ -7743,17 +7784,17 @@
|
|
|
7743
7784
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
7744
7785
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
7745
7786
|
var props = vnode.data.props;
|
|
7746
|
-
var
|
|
7787
|
+
var getProperty = renderer.getProperty;
|
|
7747
7788
|
|
|
7748
7789
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
7749
|
-
if (
|
|
7790
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
7750
7791
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
7751
7792
|
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
7752
7793
|
props: cloneAndOmitKey(props, 'innerHTML')
|
|
7753
7794
|
});
|
|
7754
7795
|
} else {
|
|
7755
7796
|
if (process.env.NODE_ENV !== 'production') {
|
|
7756
|
-
logWarn("Mismatch hydrating element <".concat(
|
|
7797
|
+
logWarn("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
|
|
7757
7798
|
}
|
|
7758
7799
|
}
|
|
7759
7800
|
}
|
|
@@ -7762,8 +7803,8 @@
|
|
|
7762
7803
|
patchElementPropsAndAttrs(vnode, renderer);
|
|
7763
7804
|
|
|
7764
7805
|
if (!isDomManual) {
|
|
7765
|
-
var
|
|
7766
|
-
hydrateChildren(
|
|
7806
|
+
var getFirstChild = renderer.getFirstChild;
|
|
7807
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
7767
7808
|
}
|
|
7768
7809
|
|
|
7769
7810
|
return elm;
|
|
@@ -7802,10 +7843,10 @@
|
|
|
7802
7843
|
if (vm.renderMode !== 0
|
|
7803
7844
|
/* RenderMode.Light */
|
|
7804
7845
|
) {
|
|
7805
|
-
var
|
|
7846
|
+
var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
7806
7847
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
7807
7848
|
|
|
7808
|
-
hydrateChildren(
|
|
7849
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
7809
7850
|
}
|
|
7810
7851
|
|
|
7811
7852
|
hydrateVM(vm);
|
|
@@ -7854,11 +7895,11 @@
|
|
|
7854
7895
|
// next node in the list to be hydrated.
|
|
7855
7896
|
|
|
7856
7897
|
|
|
7857
|
-
var
|
|
7898
|
+
var nextSibling = renderer.nextSibling;
|
|
7858
7899
|
|
|
7859
7900
|
do {
|
|
7860
7901
|
var current = nextNode;
|
|
7861
|
-
nextNode =
|
|
7902
|
+
nextNode = nextSibling(nextNode);
|
|
7862
7903
|
removeNode(current, parentNode, renderer);
|
|
7863
7904
|
} while (nextNode);
|
|
7864
7905
|
}
|
|
@@ -7921,14 +7962,13 @@
|
|
|
7921
7962
|
attrValue = _Object$entries$_i[1];
|
|
7922
7963
|
|
|
7923
7964
|
var owner = vnode.owner;
|
|
7924
|
-
var
|
|
7925
|
-
|
|
7926
|
-
var elmAttrValue = _getAttribute(elm, attrName);
|
|
7965
|
+
var getAttribute = renderer.getAttribute;
|
|
7966
|
+
var elmAttrValue = getAttribute(elm, attrName);
|
|
7927
7967
|
|
|
7928
7968
|
if (String(attrValue) !== elmAttrValue) {
|
|
7929
7969
|
if (process.env.NODE_ENV !== 'production') {
|
|
7930
|
-
var
|
|
7931
|
-
logError("Mismatch hydrating element <".concat(
|
|
7970
|
+
var getProperty = renderer.getProperty;
|
|
7971
|
+
logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
|
|
7932
7972
|
}
|
|
7933
7973
|
|
|
7934
7974
|
nodesAreCompatible = false;
|
|
@@ -8039,8 +8079,8 @@
|
|
|
8039
8079
|
|
|
8040
8080
|
if (!nodesAreCompatible) {
|
|
8041
8081
|
if (process.env.NODE_ENV !== 'production') {
|
|
8042
|
-
var
|
|
8043
|
-
logError("Mismatch hydrating element <".concat(
|
|
8082
|
+
var getProperty = renderer.getProperty;
|
|
8083
|
+
logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
|
|
8044
8084
|
}
|
|
8045
8085
|
}
|
|
8046
8086
|
|
|
@@ -8060,7 +8100,7 @@
|
|
|
8060
8100
|
return false;
|
|
8061
8101
|
}
|
|
8062
8102
|
|
|
8063
|
-
return getProperty(client,
|
|
8103
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
8064
8104
|
}
|
|
8065
8105
|
|
|
8066
8106
|
if (getProperty(client, 'nodeType') === 8
|
|
@@ -8072,7 +8112,7 @@
|
|
|
8072
8112
|
return false;
|
|
8073
8113
|
}
|
|
8074
8114
|
|
|
8075
|
-
return getProperty(client,
|
|
8115
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
8076
8116
|
}
|
|
8077
8117
|
|
|
8078
8118
|
if (!hasCorrectNodeType(vnode, ssr, 1
|
|
@@ -8272,7 +8312,7 @@
|
|
|
8272
8312
|
|
|
8273
8313
|
return ctor;
|
|
8274
8314
|
}
|
|
8275
|
-
/* version: 2.23.
|
|
8315
|
+
/* version: 2.23.2 */
|
|
8276
8316
|
|
|
8277
8317
|
/*
|
|
8278
8318
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8439,361 +8479,395 @@
|
|
|
8439
8479
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8440
8480
|
*/
|
|
8441
8481
|
|
|
8482
|
+
/**
|
|
8483
|
+
* A factory function that produces a renderer.
|
|
8484
|
+
* Renderer encapsulates operations that are required to render an LWC component into the underlying
|
|
8485
|
+
* runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
|
|
8486
|
+
* Example usage:
|
|
8487
|
+
* import { renderer, rendererFactory } from 'lwc';
|
|
8488
|
+
* const customRenderer = rendererFactory(renderer);
|
|
8489
|
+
*
|
|
8490
|
+
* @param baseRenderer Either null or the base renderer imported from 'lwc'.
|
|
8491
|
+
*/
|
|
8442
8492
|
|
|
8443
|
-
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
8444
|
-
var createFragment;
|
|
8445
8493
|
|
|
8446
|
-
|
|
8447
|
-
//
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
}
|
|
8453
|
-
} else {
|
|
8454
|
-
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
8455
|
-
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
8456
|
-
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
8457
|
-
// With other elements added from:
|
|
8458
|
-
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
8459
|
-
// Using the test:
|
|
8460
|
-
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
8461
|
-
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
8462
|
-
var topLevelWrappingMap = {
|
|
8463
|
-
caption: ['table'],
|
|
8464
|
-
col: ['colgroup', 'table'],
|
|
8465
|
-
colgroup: ['table'],
|
|
8466
|
-
option: ['select'],
|
|
8467
|
-
tbody: ['table'],
|
|
8468
|
-
td: ['tr', 'tbody', 'table'],
|
|
8469
|
-
th: ['tr', 'tbody', 'table'],
|
|
8470
|
-
thead: ['table'],
|
|
8471
|
-
tfoot: ['table'],
|
|
8472
|
-
tr: ['tbody', 'table']
|
|
8473
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
8474
|
-
|
|
8475
|
-
var getTagName = function getTagName(text) {
|
|
8476
|
-
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
8477
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
createFragment = function createFragment(html) {
|
|
8481
|
-
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8482
|
-
|
|
8483
|
-
if (!isUndefined$1(wrapperTags)) {
|
|
8484
|
-
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
8485
|
-
_step5;
|
|
8494
|
+
function rendererFactory(baseRenderer) {
|
|
8495
|
+
// Util functions
|
|
8496
|
+
function assertInvariant(value, msg) {
|
|
8497
|
+
if (!value) {
|
|
8498
|
+
throw new Error("Invariant Violation: ".concat(msg));
|
|
8499
|
+
}
|
|
8500
|
+
}
|
|
8486
8501
|
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8491
|
-
}
|
|
8492
|
-
} catch (err) {
|
|
8493
|
-
_iterator5.e(err);
|
|
8494
|
-
} finally {
|
|
8495
|
-
_iterator5.f();
|
|
8496
|
-
}
|
|
8497
|
-
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
8498
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
8502
|
+
function isNull(obj) {
|
|
8503
|
+
return obj === null;
|
|
8504
|
+
}
|
|
8499
8505
|
|
|
8506
|
+
function isUndefined(obj) {
|
|
8507
|
+
return obj === undefined;
|
|
8508
|
+
}
|
|
8500
8509
|
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8510
|
+
var getCustomElement;
|
|
8511
|
+
var defineCustomElement;
|
|
8512
|
+
var HTMLElementConstructor;
|
|
8504
8513
|
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
}
|
|
8514
|
+
function isCustomElementRegistryAvailable() {
|
|
8515
|
+
if (typeof customElements === 'undefined') {
|
|
8516
|
+
return false;
|
|
8509
8517
|
}
|
|
8510
8518
|
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
*/
|
|
8519
|
+
try {
|
|
8520
|
+
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
8521
|
+
// _wrapNativeSuper()
|
|
8522
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
8523
|
+
// get wrapped by babel.
|
|
8524
|
+
var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
|
|
8525
|
+
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
8526
|
+
// which are not equipped to be initialized that way.
|
|
8520
8527
|
|
|
8528
|
+
var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
|
|
8529
|
+
_inherits(clazz, _HTMLElementAlias);
|
|
8521
8530
|
|
|
8522
|
-
|
|
8523
|
-
var defineCustomElement;
|
|
8524
|
-
var HTMLElementConstructor;
|
|
8531
|
+
var _super7 = _createSuper(clazz);
|
|
8525
8532
|
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8533
|
+
function clazz() {
|
|
8534
|
+
_classCallCheck(this, clazz);
|
|
8535
|
+
|
|
8536
|
+
return _super7.apply(this, arguments);
|
|
8537
|
+
}
|
|
8538
|
+
|
|
8539
|
+
return _createClass(clazz);
|
|
8540
|
+
}(HTMLElementAlias);
|
|
8541
|
+
|
|
8542
|
+
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
8543
|
+
new clazz();
|
|
8544
|
+
return true;
|
|
8545
|
+
} catch (_a) {
|
|
8546
|
+
return false;
|
|
8547
|
+
}
|
|
8529
8548
|
}
|
|
8530
8549
|
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
var
|
|
8537
|
-
|
|
8538
|
-
// which are not equipped to be initialized that way.
|
|
8550
|
+
if (isCustomElementRegistryAvailable()) {
|
|
8551
|
+
getCustomElement = customElements.get.bind(customElements);
|
|
8552
|
+
defineCustomElement = customElements.define.bind(customElements);
|
|
8553
|
+
HTMLElementConstructor = HTMLElement;
|
|
8554
|
+
} else {
|
|
8555
|
+
var registry = Object.create(null);
|
|
8556
|
+
var reverseRegistry = new WeakMap();
|
|
8539
8557
|
|
|
8540
|
-
|
|
8541
|
-
|
|
8558
|
+
defineCustomElement = function define(name, ctor) {
|
|
8559
|
+
if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
|
|
8560
|
+
throw new TypeError("Invalid Registration");
|
|
8561
|
+
}
|
|
8542
8562
|
|
|
8543
|
-
|
|
8563
|
+
registry[name] = ctor;
|
|
8564
|
+
reverseRegistry.set(ctor, name);
|
|
8565
|
+
};
|
|
8544
8566
|
|
|
8545
|
-
|
|
8546
|
-
|
|
8567
|
+
getCustomElement = function get(name) {
|
|
8568
|
+
return registry[name];
|
|
8569
|
+
};
|
|
8547
8570
|
|
|
8548
|
-
|
|
8571
|
+
HTMLElementConstructor = function HTMLElement() {
|
|
8572
|
+
if (!(this instanceof HTMLElement)) {
|
|
8573
|
+
throw new TypeError("Invalid Invocation");
|
|
8549
8574
|
}
|
|
8550
8575
|
|
|
8551
|
-
|
|
8552
|
-
|
|
8576
|
+
var constructor = this.constructor;
|
|
8577
|
+
var name = reverseRegistry.get(constructor);
|
|
8553
8578
|
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8579
|
+
if (!name) {
|
|
8580
|
+
throw new TypeError("Invalid Construction");
|
|
8581
|
+
}
|
|
8582
|
+
|
|
8583
|
+
var elm = document.createElement(name);
|
|
8584
|
+
Object.setPrototypeOf(elm, constructor.prototype);
|
|
8585
|
+
return elm;
|
|
8586
|
+
};
|
|
8587
|
+
|
|
8588
|
+
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
8559
8589
|
}
|
|
8560
|
-
}
|
|
8561
8590
|
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
HTMLElementConstructor = HTMLElement;
|
|
8566
|
-
} else {
|
|
8567
|
-
var registry = create(null);
|
|
8568
|
-
var reverseRegistry = new WeakMap();
|
|
8591
|
+
function cloneNode(node, deep) {
|
|
8592
|
+
return node.cloneNode(deep);
|
|
8593
|
+
}
|
|
8569
8594
|
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
}
|
|
8595
|
+
function createElement(tagName, namespace) {
|
|
8596
|
+
return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
8597
|
+
}
|
|
8574
8598
|
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
}
|
|
8599
|
+
function createText(content) {
|
|
8600
|
+
return document.createTextNode(content);
|
|
8601
|
+
}
|
|
8578
8602
|
|
|
8579
|
-
|
|
8580
|
-
return
|
|
8581
|
-
}
|
|
8603
|
+
function createComment(content) {
|
|
8604
|
+
return document.createComment(content);
|
|
8605
|
+
}
|
|
8582
8606
|
|
|
8583
|
-
|
|
8584
|
-
if (!(this instanceof HTMLElement)) {
|
|
8585
|
-
throw new TypeError("Invalid Invocation");
|
|
8586
|
-
}
|
|
8607
|
+
var createFragment; // IE11 lacks support for this feature
|
|
8587
8608
|
|
|
8588
|
-
|
|
8589
|
-
var name = reverseRegistry.get(constructor);
|
|
8609
|
+
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
8590
8610
|
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8611
|
+
if (SUPPORTS_TEMPLATE) {
|
|
8612
|
+
// Parse the fragment HTML string into DOM
|
|
8613
|
+
createFragment = function createFragment(html) {
|
|
8614
|
+
var template = document.createElement('template');
|
|
8615
|
+
template.innerHTML = html;
|
|
8616
|
+
return template.content.firstChild;
|
|
8617
|
+
};
|
|
8618
|
+
} else {
|
|
8619
|
+
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
8620
|
+
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
8621
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
8622
|
+
// With other elements added from:
|
|
8623
|
+
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
8624
|
+
// Using the test:
|
|
8625
|
+
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
8626
|
+
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
8627
|
+
var topLevelWrappingMap = {
|
|
8628
|
+
caption: ['table'],
|
|
8629
|
+
col: ['colgroup', 'table'],
|
|
8630
|
+
colgroup: ['table'],
|
|
8631
|
+
option: ['select'],
|
|
8632
|
+
tbody: ['table'],
|
|
8633
|
+
td: ['tr', 'tbody', 'table'],
|
|
8634
|
+
th: ['tr', 'tbody', 'table'],
|
|
8635
|
+
thead: ['table'],
|
|
8636
|
+
tfoot: ['table'],
|
|
8637
|
+
tr: ['tbody', 'table']
|
|
8638
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
8639
|
+
|
|
8640
|
+
var getTagName = function getTagName(text) {
|
|
8641
|
+
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
8642
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
8643
|
+
|
|
8644
|
+
|
|
8645
|
+
createFragment = function createFragment(html) {
|
|
8646
|
+
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8647
|
+
|
|
8648
|
+
if (!isUndefined(wrapperTags)) {
|
|
8649
|
+
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
8650
|
+
_step5;
|
|
8651
|
+
|
|
8652
|
+
try {
|
|
8653
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
8654
|
+
var wrapperTag = _step5.value;
|
|
8655
|
+
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8656
|
+
}
|
|
8657
|
+
} catch (err) {
|
|
8658
|
+
_iterator5.e(err);
|
|
8659
|
+
} finally {
|
|
8660
|
+
_iterator5.f();
|
|
8661
|
+
}
|
|
8662
|
+
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
8663
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
8594
8664
|
|
|
8595
|
-
var elm = document.createElement(name);
|
|
8596
|
-
setPrototypeOf(elm, constructor.prototype);
|
|
8597
|
-
return elm;
|
|
8598
|
-
};
|
|
8599
8665
|
|
|
8600
|
-
|
|
8601
|
-
|
|
8666
|
+
var doc = document.implementation.createHTMLDocument('');
|
|
8667
|
+
doc.body.innerHTML = html;
|
|
8668
|
+
var content = doc.body;
|
|
8602
8669
|
|
|
8603
|
-
|
|
8604
|
-
|
|
8670
|
+
if (!isUndefined(wrapperTags)) {
|
|
8671
|
+
for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
|
|
8672
|
+
content = content.firstChild;
|
|
8673
|
+
}
|
|
8674
|
+
}
|
|
8605
8675
|
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8676
|
+
return content.firstChild;
|
|
8677
|
+
};
|
|
8678
|
+
}
|
|
8609
8679
|
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8680
|
+
function insert(node, parent, anchor) {
|
|
8681
|
+
parent.insertBefore(node, anchor);
|
|
8682
|
+
}
|
|
8613
8683
|
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8684
|
+
function remove(node, parent) {
|
|
8685
|
+
parent.removeChild(node);
|
|
8686
|
+
}
|
|
8617
8687
|
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8688
|
+
function nextSibling(node) {
|
|
8689
|
+
return node.nextSibling;
|
|
8690
|
+
}
|
|
8621
8691
|
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8692
|
+
function attachShadow(element, options) {
|
|
8693
|
+
// `shadowRoot` will be non-null in two cases:
|
|
8694
|
+
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
8695
|
+
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
8696
|
+
// root component with customElement.define('c-app', Ctor)
|
|
8697
|
+
if (!isNull(element.shadowRoot)) {
|
|
8698
|
+
return element.shadowRoot;
|
|
8699
|
+
}
|
|
8625
8700
|
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
}
|
|
8701
|
+
return element.attachShadow(options);
|
|
8702
|
+
}
|
|
8629
8703
|
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8704
|
+
function setText(node, content) {
|
|
8705
|
+
node.nodeValue = content;
|
|
8706
|
+
}
|
|
8633
8707
|
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
8637
|
-
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
8638
|
-
// root component with customElement.define('c-app', Ctor)
|
|
8639
|
-
if (!isNull(element.shadowRoot)) {
|
|
8640
|
-
return element.shadowRoot;
|
|
8708
|
+
function getProperty(node, key) {
|
|
8709
|
+
return node[key];
|
|
8641
8710
|
}
|
|
8642
8711
|
|
|
8643
|
-
|
|
8644
|
-
|
|
8712
|
+
function setProperty(node, key, value) {
|
|
8713
|
+
node[key] = value;
|
|
8714
|
+
}
|
|
8645
8715
|
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8716
|
+
function getAttribute(element, name, namespace) {
|
|
8717
|
+
return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
8718
|
+
}
|
|
8649
8719
|
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8720
|
+
function setAttribute(element, name, value, namespace) {
|
|
8721
|
+
return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
8722
|
+
}
|
|
8653
8723
|
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8724
|
+
function removeAttribute(element, name, namespace) {
|
|
8725
|
+
if (isUndefined(namespace)) {
|
|
8726
|
+
element.removeAttribute(name);
|
|
8727
|
+
} else {
|
|
8728
|
+
element.removeAttributeNS(namespace, name);
|
|
8659
8729
|
}
|
|
8660
8730
|
}
|
|
8661
8731
|
|
|
8662
|
-
|
|
8663
|
-
|
|
8732
|
+
function addEventListener(target, type, callback, options) {
|
|
8733
|
+
target.addEventListener(type, callback, options);
|
|
8734
|
+
}
|
|
8664
8735
|
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8736
|
+
function removeEventListener(target, type, callback, options) {
|
|
8737
|
+
target.removeEventListener(type, callback, options);
|
|
8738
|
+
}
|
|
8668
8739
|
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8740
|
+
function dispatchEvent(target, event) {
|
|
8741
|
+
return target.dispatchEvent(event);
|
|
8742
|
+
}
|
|
8672
8743
|
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
element.removeAttribute(name);
|
|
8676
|
-
} else {
|
|
8677
|
-
element.removeAttributeNS(namespace, name);
|
|
8744
|
+
function getClassList(element) {
|
|
8745
|
+
return element.classList;
|
|
8678
8746
|
}
|
|
8679
|
-
}
|
|
8680
8747
|
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8748
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
8749
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
8750
|
+
// represent elements in the engine?
|
|
8751
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
8752
|
+
}
|
|
8684
8753
|
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8754
|
+
function getBoundingClientRect(element) {
|
|
8755
|
+
return element.getBoundingClientRect();
|
|
8756
|
+
}
|
|
8688
8757
|
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8758
|
+
function querySelector(element, selectors) {
|
|
8759
|
+
return element.querySelector(selectors);
|
|
8760
|
+
}
|
|
8692
8761
|
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8762
|
+
function querySelectorAll(element, selectors) {
|
|
8763
|
+
return element.querySelectorAll(selectors);
|
|
8764
|
+
}
|
|
8696
8765
|
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
8701
|
-
}
|
|
8766
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
8767
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
8768
|
+
}
|
|
8702
8769
|
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8770
|
+
function getElementsByClassName(element, names) {
|
|
8771
|
+
return element.getElementsByClassName(names);
|
|
8772
|
+
}
|
|
8706
8773
|
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8774
|
+
function getChildren(element) {
|
|
8775
|
+
return element.children;
|
|
8776
|
+
}
|
|
8710
8777
|
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8778
|
+
function getChildNodes(element) {
|
|
8779
|
+
return element.childNodes;
|
|
8780
|
+
}
|
|
8714
8781
|
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8782
|
+
function getFirstChild(element) {
|
|
8783
|
+
return element.firstChild;
|
|
8784
|
+
}
|
|
8718
8785
|
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8786
|
+
function getFirstElementChild(element) {
|
|
8787
|
+
return element.firstElementChild;
|
|
8788
|
+
}
|
|
8722
8789
|
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8790
|
+
function getLastChild(element) {
|
|
8791
|
+
return element.lastChild;
|
|
8792
|
+
}
|
|
8726
8793
|
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8794
|
+
function getLastElementChild(element) {
|
|
8795
|
+
return element.lastElementChild;
|
|
8796
|
+
}
|
|
8730
8797
|
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8798
|
+
function isConnected(node) {
|
|
8799
|
+
return node.isConnected;
|
|
8800
|
+
}
|
|
8734
8801
|
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8802
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
8803
|
+
assertInvariant(elm instanceof HTMLElement, msg);
|
|
8804
|
+
}
|
|
8738
8805
|
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8806
|
+
var HTMLElementExported = HTMLElementConstructor;
|
|
8807
|
+
var renderer = {
|
|
8808
|
+
HTMLElementExported: HTMLElementExported,
|
|
8809
|
+
insert: insert,
|
|
8810
|
+
remove: remove,
|
|
8811
|
+
cloneNode: cloneNode,
|
|
8812
|
+
createFragment: createFragment,
|
|
8813
|
+
createElement: createElement,
|
|
8814
|
+
createText: createText,
|
|
8815
|
+
createComment: createComment,
|
|
8816
|
+
nextSibling: nextSibling,
|
|
8817
|
+
attachShadow: attachShadow,
|
|
8818
|
+
getProperty: getProperty,
|
|
8819
|
+
setProperty: setProperty,
|
|
8820
|
+
setText: setText,
|
|
8821
|
+
getAttribute: getAttribute,
|
|
8822
|
+
setAttribute: setAttribute,
|
|
8823
|
+
removeAttribute: removeAttribute,
|
|
8824
|
+
addEventListener: addEventListener,
|
|
8825
|
+
removeEventListener: removeEventListener,
|
|
8826
|
+
dispatchEvent: dispatchEvent,
|
|
8827
|
+
getClassList: getClassList,
|
|
8828
|
+
setCSSStyleProperty: setCSSStyleProperty,
|
|
8829
|
+
getBoundingClientRect: getBoundingClientRect,
|
|
8830
|
+
querySelector: querySelector,
|
|
8831
|
+
querySelectorAll: querySelectorAll,
|
|
8832
|
+
getElementsByTagName: getElementsByTagName,
|
|
8833
|
+
getElementsByClassName: getElementsByClassName,
|
|
8834
|
+
getChildren: getChildren,
|
|
8835
|
+
getChildNodes: getChildNodes,
|
|
8836
|
+
getFirstChild: getFirstChild,
|
|
8837
|
+
getFirstElementChild: getFirstElementChild,
|
|
8838
|
+
getLastChild: getLastChild,
|
|
8839
|
+
getLastElementChild: getLastElementChild,
|
|
8840
|
+
isConnected: isConnected,
|
|
8841
|
+
assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
|
|
8842
|
+
defineCustomElement: defineCustomElement,
|
|
8843
|
+
getCustomElement: getCustomElement
|
|
8844
|
+
}; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
|
|
8742
8845
|
|
|
8743
|
-
|
|
8744
|
-
return
|
|
8846
|
+
Object.setPrototypeOf(renderer, baseRenderer);
|
|
8847
|
+
return renderer;
|
|
8745
8848
|
}
|
|
8849
|
+
/*
|
|
8850
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
8851
|
+
* All rights reserved.
|
|
8852
|
+
* SPDX-License-Identifier: MIT
|
|
8853
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8854
|
+
*/
|
|
8746
8855
|
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8856
|
+
/**
|
|
8857
|
+
* The base renderer that will be used by engine-core.
|
|
8858
|
+
* This will be used for DOM operations when lwc is running in a browser environment.
|
|
8859
|
+
*/
|
|
8750
8860
|
|
|
8751
|
-
function assertInstanceOfHTMLElement(elm, msg) {
|
|
8752
|
-
assert.invariant(elm instanceof HTMLElement, msg);
|
|
8753
|
-
}
|
|
8754
8861
|
|
|
8755
|
-
var
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
insert: insert,
|
|
8761
|
-
remove: remove,
|
|
8762
|
-
cloneNode: cloneNode,
|
|
8763
|
-
createFragment: createFragment,
|
|
8764
|
-
createElement: createElement$1,
|
|
8765
|
-
createText: createText,
|
|
8766
|
-
createComment: createComment,
|
|
8767
|
-
nextSibling: nextSibling,
|
|
8768
|
-
attachShadow: attachShadow,
|
|
8769
|
-
getProperty: getProperty,
|
|
8770
|
-
setProperty: setProperty,
|
|
8771
|
-
setText: setText,
|
|
8772
|
-
getAttribute: getAttribute,
|
|
8773
|
-
setAttribute: setAttribute,
|
|
8774
|
-
removeAttribute: removeAttribute,
|
|
8775
|
-
addEventListener: addEventListener,
|
|
8776
|
-
removeEventListener: removeEventListener,
|
|
8777
|
-
dispatchEvent: dispatchEvent,
|
|
8778
|
-
getClassList: getClassList,
|
|
8779
|
-
setCSSStyleProperty: setCSSStyleProperty,
|
|
8780
|
-
getBoundingClientRect: getBoundingClientRect,
|
|
8781
|
-
querySelector: querySelector,
|
|
8782
|
-
querySelectorAll: querySelectorAll,
|
|
8783
|
-
getElementsByTagName: getElementsByTagName,
|
|
8784
|
-
getElementsByClassName: getElementsByClassName,
|
|
8785
|
-
getChildren: getChildren,
|
|
8786
|
-
getChildNodes: getChildNodes,
|
|
8787
|
-
getFirstChild: getFirstChild,
|
|
8788
|
-
getFirstElementChild: getFirstElementChild,
|
|
8789
|
-
getLastChild: getLastChild,
|
|
8790
|
-
getLastElementChild: getLastElementChild,
|
|
8791
|
-
isConnected: isConnected,
|
|
8862
|
+
var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
|
|
8863
|
+
// shared across renderers
|
|
8864
|
+
rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
|
|
8865
|
+
{
|
|
8866
|
+
// insertStyleSheet implementation shares a global cache of stylesheet data
|
|
8792
8867
|
insertStylesheet: insertStylesheet,
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
};
|
|
8868
|
+
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
8869
|
+
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
|
|
8870
|
+
});
|
|
8797
8871
|
/*
|
|
8798
8872
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
8799
8873
|
* All rights reserved.
|
|
@@ -8965,7 +9039,6 @@
|
|
|
8965
9039
|
* SPDX-License-Identifier: MIT
|
|
8966
9040
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8967
9041
|
*/
|
|
8968
|
-
// TODO [#2472]: Remove this workaround when appropriate.
|
|
8969
9042
|
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
8970
9043
|
|
|
8971
9044
|
|
|
@@ -8985,39 +9058,41 @@
|
|
|
8985
9058
|
}
|
|
8986
9059
|
|
|
8987
9060
|
return node; // for convenience
|
|
8988
|
-
}
|
|
8989
|
-
// created via createElement.
|
|
8990
|
-
|
|
9061
|
+
}
|
|
8991
9062
|
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9063
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
9064
|
+
// Monkey patching Node methods to be able to detect the insertions and removal of root elements
|
|
9065
|
+
// created via createElement.
|
|
9066
|
+
var _Node$1$prototype = _Node$1.prototype,
|
|
9067
|
+
_appendChild = _Node$1$prototype.appendChild,
|
|
9068
|
+
_insertBefore = _Node$1$prototype.insertBefore,
|
|
9069
|
+
_removeChild = _Node$1$prototype.removeChild,
|
|
9070
|
+
_replaceChild = _Node$1$prototype.replaceChild;
|
|
9071
|
+
assign(_Node$1.prototype, {
|
|
9072
|
+
appendChild: function appendChild(newChild) {
|
|
9073
|
+
var appendedNode = _appendChild.call(this, newChild);
|
|
9000
9074
|
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9075
|
+
return callNodeSlot(appendedNode, ConnectingSlot);
|
|
9076
|
+
},
|
|
9077
|
+
insertBefore: function insertBefore(newChild, referenceNode) {
|
|
9078
|
+
var insertedNode = _insertBefore.call(this, newChild, referenceNode);
|
|
9005
9079
|
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9080
|
+
return callNodeSlot(insertedNode, ConnectingSlot);
|
|
9081
|
+
},
|
|
9082
|
+
removeChild: function removeChild(oldChild) {
|
|
9083
|
+
var removedNode = _removeChild.call(this, oldChild);
|
|
9010
9084
|
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9085
|
+
return callNodeSlot(removedNode, DisconnectingSlot);
|
|
9086
|
+
},
|
|
9087
|
+
replaceChild: function replaceChild(newChild, oldChild) {
|
|
9088
|
+
var replacedNode = _replaceChild.call(this, newChild, oldChild);
|
|
9015
9089
|
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9090
|
+
callNodeSlot(replacedNode, DisconnectingSlot);
|
|
9091
|
+
callNodeSlot(newChild, ConnectingSlot);
|
|
9092
|
+
return replacedNode;
|
|
9093
|
+
}
|
|
9094
|
+
});
|
|
9095
|
+
}
|
|
9021
9096
|
/**
|
|
9022
9097
|
* EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
|
|
9023
9098
|
* difference that in the options, you can pass the `is` property set to a Constructor instead of
|
|
@@ -9030,6 +9105,7 @@
|
|
|
9030
9105
|
* ```
|
|
9031
9106
|
*/
|
|
9032
9107
|
|
|
9108
|
+
|
|
9033
9109
|
function createElement(sel, options) {
|
|
9034
9110
|
if (!isObject(options) || isNull(options)) {
|
|
9035
9111
|
throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
|
|
@@ -9057,8 +9133,12 @@
|
|
|
9057
9133
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
9058
9134
|
owner: null
|
|
9059
9135
|
});
|
|
9060
|
-
|
|
9061
|
-
|
|
9136
|
+
|
|
9137
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
9138
|
+
ConnectingSlot.set(elm, connectRootElement);
|
|
9139
|
+
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
9140
|
+
}
|
|
9141
|
+
|
|
9062
9142
|
wasComponentUpgraded = true;
|
|
9063
9143
|
});
|
|
9064
9144
|
|
|
@@ -9105,7 +9185,7 @@
|
|
|
9105
9185
|
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
9106
9186
|
|
|
9107
9187
|
|
|
9108
|
-
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
9188
|
+
return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
9109
9189
|
}
|
|
9110
9190
|
/*
|
|
9111
9191
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -9149,7 +9229,7 @@
|
|
|
9149
9229
|
});
|
|
9150
9230
|
freeze(LightningElement);
|
|
9151
9231
|
seal(LightningElement.prototype);
|
|
9152
|
-
/* version: 2.23.
|
|
9232
|
+
/* version: 2.23.2 */
|
|
9153
9233
|
|
|
9154
9234
|
exports.LightningElement = LightningElement;
|
|
9155
9235
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -9171,6 +9251,7 @@
|
|
|
9171
9251
|
exports.registerDecorators = registerDecorators;
|
|
9172
9252
|
exports.registerTemplate = registerTemplate;
|
|
9173
9253
|
exports.renderer = renderer;
|
|
9254
|
+
exports.rendererFactory = rendererFactory;
|
|
9174
9255
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
9175
9256
|
exports.setFeatureFlag = setFeatureFlag;
|
|
9176
9257
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|