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
|
@@ -346,7 +346,7 @@ var LWC = (function (exports) {
|
|
|
346
346
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
347
347
|
return attributeName;
|
|
348
348
|
}
|
|
349
|
-
/** version: 2.23.
|
|
349
|
+
/** version: 2.23.2 */
|
|
350
350
|
|
|
351
351
|
/**
|
|
352
352
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -440,7 +440,7 @@ var LWC = (function (exports) {
|
|
|
440
440
|
patch$1(propName);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
/** version: 2.23.
|
|
443
|
+
/** version: 2.23.2 */
|
|
444
444
|
|
|
445
445
|
/**
|
|
446
446
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -462,6 +462,7 @@ var LWC = (function (exports) {
|
|
|
462
462
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
463
463
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
464
464
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
465
|
+
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
465
466
|
ENABLE_NODE_LIST_PATCH: null,
|
|
466
467
|
ENABLE_NODE_PATCH: null,
|
|
467
468
|
ENABLE_REACTIVE_SETTER: null,
|
|
@@ -866,8 +867,8 @@ var LWC = (function (exports) {
|
|
|
866
867
|
// to inject at runtime.
|
|
867
868
|
|
|
868
869
|
|
|
869
|
-
var HTMLElementConstructor
|
|
870
|
-
var HTMLElementPrototype = HTMLElementConstructor
|
|
870
|
+
var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
|
|
871
|
+
var HTMLElementPrototype = HTMLElementConstructor.prototype;
|
|
871
872
|
/*
|
|
872
873
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
873
874
|
* All rights reserved.
|
|
@@ -2669,7 +2670,7 @@ var LWC = (function (exports) {
|
|
|
2669
2670
|
return HTMLBridgeElement;
|
|
2670
2671
|
}
|
|
2671
2672
|
|
|
2672
|
-
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor
|
|
2673
|
+
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
|
|
2673
2674
|
freeze(BaseBridgeElement);
|
|
2674
2675
|
seal(BaseBridgeElement.prototype);
|
|
2675
2676
|
|
|
@@ -3171,6 +3172,12 @@ var LWC = (function (exports) {
|
|
|
3171
3172
|
*/
|
|
3172
3173
|
|
|
3173
3174
|
|
|
3175
|
+
function checkHasVM(elm) {
|
|
3176
|
+
var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
3177
|
+
|
|
3178
|
+
return hasVM;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3174
3181
|
function getUpgradableConstructor(tagName, renderer) {
|
|
3175
3182
|
var getCustomElement = renderer.getCustomElement,
|
|
3176
3183
|
RendererHTMLElement = renderer.HTMLElementExported,
|
|
@@ -3212,6 +3219,20 @@ var LWC = (function (exports) {
|
|
|
3212
3219
|
return _createClass(LWCUpgradableElement);
|
|
3213
3220
|
}(RendererHTMLElement);
|
|
3214
3221
|
|
|
3222
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3223
|
+
CE.prototype.connectedCallback = function () {
|
|
3224
|
+
if (checkHasVM(this)) {
|
|
3225
|
+
connectRootElement(this);
|
|
3226
|
+
}
|
|
3227
|
+
};
|
|
3228
|
+
|
|
3229
|
+
CE.prototype.disconnectedCallback = function () {
|
|
3230
|
+
if (checkHasVM(this)) {
|
|
3231
|
+
disconnectRootElement(this);
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3215
3236
|
defineCustomElement(tagName, CE);
|
|
3216
3237
|
return CE;
|
|
3217
3238
|
}
|
|
@@ -3323,6 +3344,7 @@ var LWC = (function (exports) {
|
|
|
3323
3344
|
// different than the one previously set.
|
|
3324
3345
|
|
|
3325
3346
|
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
3347
|
+
|
|
3326
3348
|
setProperty(elm, key, cur);
|
|
3327
3349
|
}
|
|
3328
3350
|
}
|
|
@@ -3716,8 +3738,12 @@ var LWC = (function (exports) {
|
|
|
3716
3738
|
insertNode(elm, parent, anchor, renderer);
|
|
3717
3739
|
|
|
3718
3740
|
if (vm) {
|
|
3741
|
+
{
|
|
3742
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3719
3743
|
|
|
3720
|
-
|
|
3744
|
+
runConnectedCallback(vm);
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3721
3747
|
}
|
|
3722
3748
|
|
|
3723
3749
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3885,10 +3911,10 @@ var LWC = (function (exports) {
|
|
|
3885
3911
|
var scopeToken = getScopeTokenClass(owner);
|
|
3886
3912
|
|
|
3887
3913
|
if (!isNull(scopeToken)) {
|
|
3888
|
-
var
|
|
3914
|
+
var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
3889
3915
|
// probably we should have a renderer api for just the add operation
|
|
3890
3916
|
|
|
3891
|
-
|
|
3917
|
+
getClassList(elm).add(scopeToken);
|
|
3892
3918
|
} // Set property element for synthetic shadow DOM style scoping.
|
|
3893
3919
|
|
|
3894
3920
|
|
|
@@ -6053,6 +6079,8 @@ var LWC = (function (exports) {
|
|
|
6053
6079
|
return renderer.nextSibling(hydratedNode);
|
|
6054
6080
|
}
|
|
6055
6081
|
|
|
6082
|
+
var NODE_VALUE_PROP = 'nodeValue';
|
|
6083
|
+
|
|
6056
6084
|
function hydrateText(node, vnode, renderer) {
|
|
6057
6085
|
var _a;
|
|
6058
6086
|
|
|
@@ -6078,7 +6106,7 @@ var LWC = (function (exports) {
|
|
|
6078
6106
|
}
|
|
6079
6107
|
|
|
6080
6108
|
var setProperty = renderer.setProperty;
|
|
6081
|
-
setProperty(node,
|
|
6109
|
+
setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6082
6110
|
vnode.elm = node;
|
|
6083
6111
|
return node;
|
|
6084
6112
|
}
|
|
@@ -6110,10 +6138,10 @@ var LWC = (function (exports) {
|
|
|
6110
6138
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6111
6139
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6112
6140
|
var props = vnode.data.props;
|
|
6113
|
-
var
|
|
6141
|
+
var getProperty = renderer.getProperty;
|
|
6114
6142
|
|
|
6115
6143
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6116
|
-
if (
|
|
6144
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
6117
6145
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6118
6146
|
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6119
6147
|
props: cloneAndOmitKey(props, 'innerHTML')
|
|
@@ -6125,8 +6153,8 @@ var LWC = (function (exports) {
|
|
|
6125
6153
|
patchElementPropsAndAttrs(vnode, renderer);
|
|
6126
6154
|
|
|
6127
6155
|
if (!isDomManual) {
|
|
6128
|
-
var
|
|
6129
|
-
hydrateChildren(
|
|
6156
|
+
var getFirstChild = renderer.getFirstChild;
|
|
6157
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
6130
6158
|
}
|
|
6131
6159
|
|
|
6132
6160
|
return elm;
|
|
@@ -6159,10 +6187,10 @@ var LWC = (function (exports) {
|
|
|
6159
6187
|
if (vm.renderMode !== 0
|
|
6160
6188
|
/* RenderMode.Light */
|
|
6161
6189
|
) {
|
|
6162
|
-
var
|
|
6190
|
+
var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6163
6191
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6164
6192
|
|
|
6165
|
-
hydrateChildren(
|
|
6193
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
6166
6194
|
}
|
|
6167
6195
|
|
|
6168
6196
|
hydrateVM(vm);
|
|
@@ -6197,11 +6225,11 @@ var LWC = (function (exports) {
|
|
|
6197
6225
|
// next node in the list to be hydrated.
|
|
6198
6226
|
|
|
6199
6227
|
|
|
6200
|
-
var
|
|
6228
|
+
var nextSibling = renderer.nextSibling;
|
|
6201
6229
|
|
|
6202
6230
|
do {
|
|
6203
6231
|
var current = nextNode;
|
|
6204
|
-
nextNode =
|
|
6232
|
+
nextNode = nextSibling(nextNode);
|
|
6205
6233
|
removeNode(current, parentNode, renderer);
|
|
6206
6234
|
} while (nextNode);
|
|
6207
6235
|
}
|
|
@@ -6258,9 +6286,8 @@ var LWC = (function (exports) {
|
|
|
6258
6286
|
attrValue = _Object$entries$_i[1];
|
|
6259
6287
|
|
|
6260
6288
|
vnode.owner;
|
|
6261
|
-
var
|
|
6262
|
-
|
|
6263
|
-
var elmAttrValue = _getAttribute(elm, attrName);
|
|
6289
|
+
var getAttribute = renderer.getAttribute;
|
|
6290
|
+
var elmAttrValue = getAttribute(elm, attrName);
|
|
6264
6291
|
|
|
6265
6292
|
if (String(attrValue) !== elmAttrValue) {
|
|
6266
6293
|
|
|
@@ -6376,7 +6403,7 @@ var LWC = (function (exports) {
|
|
|
6376
6403
|
return false;
|
|
6377
6404
|
}
|
|
6378
6405
|
|
|
6379
|
-
return getProperty(client,
|
|
6406
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6380
6407
|
}
|
|
6381
6408
|
|
|
6382
6409
|
if (getProperty(client, 'nodeType') === 8
|
|
@@ -6388,7 +6415,7 @@ var LWC = (function (exports) {
|
|
|
6388
6415
|
return false;
|
|
6389
6416
|
}
|
|
6390
6417
|
|
|
6391
|
-
return getProperty(client,
|
|
6418
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6392
6419
|
}
|
|
6393
6420
|
|
|
6394
6421
|
if (!hasCorrectNodeType(vnode, ssr, 1
|
|
@@ -6460,7 +6487,7 @@ var LWC = (function (exports) {
|
|
|
6460
6487
|
|
|
6461
6488
|
return ctor;
|
|
6462
6489
|
}
|
|
6463
|
-
/* version: 2.23.
|
|
6490
|
+
/* version: 2.23.2 */
|
|
6464
6491
|
|
|
6465
6492
|
/*
|
|
6466
6493
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6618,355 +6645,395 @@ var LWC = (function (exports) {
|
|
|
6618
6645
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6619
6646
|
*/
|
|
6620
6647
|
|
|
6648
|
+
/**
|
|
6649
|
+
* A factory function that produces a renderer.
|
|
6650
|
+
* Renderer encapsulates operations that are required to render an LWC component into the underlying
|
|
6651
|
+
* runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
|
|
6652
|
+
* Example usage:
|
|
6653
|
+
* import { renderer, rendererFactory } from 'lwc';
|
|
6654
|
+
* const customRenderer = rendererFactory(renderer);
|
|
6655
|
+
*
|
|
6656
|
+
* @param baseRenderer Either null or the base renderer imported from 'lwc'.
|
|
6657
|
+
*/
|
|
6621
6658
|
|
|
6622
|
-
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6623
|
-
var createFragment;
|
|
6624
6659
|
|
|
6625
|
-
|
|
6626
|
-
//
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
}
|
|
6632
|
-
} else {
|
|
6633
|
-
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6634
|
-
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6635
|
-
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6636
|
-
// With other elements added from:
|
|
6637
|
-
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6638
|
-
// Using the test:
|
|
6639
|
-
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6640
|
-
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6641
|
-
var topLevelWrappingMap = {
|
|
6642
|
-
caption: ['table'],
|
|
6643
|
-
col: ['colgroup', 'table'],
|
|
6644
|
-
colgroup: ['table'],
|
|
6645
|
-
option: ['select'],
|
|
6646
|
-
tbody: ['table'],
|
|
6647
|
-
td: ['tr', 'tbody', 'table'],
|
|
6648
|
-
th: ['tr', 'tbody', 'table'],
|
|
6649
|
-
thead: ['table'],
|
|
6650
|
-
tfoot: ['table'],
|
|
6651
|
-
tr: ['tbody', 'table']
|
|
6652
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6653
|
-
|
|
6654
|
-
var getTagName = function getTagName(text) {
|
|
6655
|
-
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6656
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
createFragment = function createFragment(html) {
|
|
6660
|
-
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6661
|
-
|
|
6662
|
-
if (!isUndefined$1(wrapperTags)) {
|
|
6663
|
-
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6664
|
-
_step5;
|
|
6660
|
+
function rendererFactory(baseRenderer) {
|
|
6661
|
+
// Util functions
|
|
6662
|
+
function assertInvariant(value, msg) {
|
|
6663
|
+
if (!value) {
|
|
6664
|
+
throw new Error("Invariant Violation: ".concat(msg));
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6665
6667
|
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6670
|
-
}
|
|
6671
|
-
} catch (err) {
|
|
6672
|
-
_iterator5.e(err);
|
|
6673
|
-
} finally {
|
|
6674
|
-
_iterator5.f();
|
|
6675
|
-
}
|
|
6676
|
-
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6677
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6668
|
+
function isNull(obj) {
|
|
6669
|
+
return obj === null;
|
|
6670
|
+
}
|
|
6678
6671
|
|
|
6672
|
+
function isUndefined(obj) {
|
|
6673
|
+
return obj === undefined;
|
|
6674
|
+
}
|
|
6679
6675
|
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6676
|
+
var getCustomElement;
|
|
6677
|
+
var defineCustomElement;
|
|
6678
|
+
var HTMLElementConstructor;
|
|
6683
6679
|
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
}
|
|
6680
|
+
function isCustomElementRegistryAvailable() {
|
|
6681
|
+
if (typeof customElements === 'undefined') {
|
|
6682
|
+
return false;
|
|
6688
6683
|
}
|
|
6689
6684
|
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
*/
|
|
6685
|
+
try {
|
|
6686
|
+
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
6687
|
+
// _wrapNativeSuper()
|
|
6688
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
6689
|
+
// get wrapped by babel.
|
|
6690
|
+
var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
|
|
6691
|
+
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
6692
|
+
// which are not equipped to be initialized that way.
|
|
6699
6693
|
|
|
6694
|
+
var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
|
|
6695
|
+
_inherits(clazz, _HTMLElementAlias);
|
|
6700
6696
|
|
|
6701
|
-
|
|
6702
|
-
var defineCustomElement;
|
|
6703
|
-
var HTMLElementConstructor;
|
|
6697
|
+
var _super7 = _createSuper(clazz);
|
|
6704
6698
|
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6699
|
+
function clazz() {
|
|
6700
|
+
_classCallCheck(this, clazz);
|
|
6701
|
+
|
|
6702
|
+
return _super7.apply(this, arguments);
|
|
6703
|
+
}
|
|
6704
|
+
|
|
6705
|
+
return _createClass(clazz);
|
|
6706
|
+
}(HTMLElementAlias);
|
|
6707
|
+
|
|
6708
|
+
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
6709
|
+
new clazz();
|
|
6710
|
+
return true;
|
|
6711
|
+
} catch (_a) {
|
|
6712
|
+
return false;
|
|
6713
|
+
}
|
|
6708
6714
|
}
|
|
6709
6715
|
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
var
|
|
6716
|
-
|
|
6717
|
-
// which are not equipped to be initialized that way.
|
|
6716
|
+
if (isCustomElementRegistryAvailable()) {
|
|
6717
|
+
getCustomElement = customElements.get.bind(customElements);
|
|
6718
|
+
defineCustomElement = customElements.define.bind(customElements);
|
|
6719
|
+
HTMLElementConstructor = HTMLElement;
|
|
6720
|
+
} else {
|
|
6721
|
+
var registry = Object.create(null);
|
|
6722
|
+
var reverseRegistry = new WeakMap();
|
|
6718
6723
|
|
|
6719
|
-
|
|
6720
|
-
|
|
6724
|
+
defineCustomElement = function define(name, ctor) {
|
|
6725
|
+
if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
|
|
6726
|
+
throw new TypeError("Invalid Registration");
|
|
6727
|
+
}
|
|
6721
6728
|
|
|
6722
|
-
|
|
6729
|
+
registry[name] = ctor;
|
|
6730
|
+
reverseRegistry.set(ctor, name);
|
|
6731
|
+
};
|
|
6723
6732
|
|
|
6724
|
-
|
|
6725
|
-
|
|
6733
|
+
getCustomElement = function get(name) {
|
|
6734
|
+
return registry[name];
|
|
6735
|
+
};
|
|
6726
6736
|
|
|
6727
|
-
|
|
6737
|
+
HTMLElementConstructor = function HTMLElement() {
|
|
6738
|
+
if (!(this instanceof HTMLElement)) {
|
|
6739
|
+
throw new TypeError("Invalid Invocation");
|
|
6728
6740
|
}
|
|
6729
6741
|
|
|
6730
|
-
|
|
6731
|
-
|
|
6742
|
+
var constructor = this.constructor;
|
|
6743
|
+
var name = reverseRegistry.get(constructor);
|
|
6732
6744
|
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6745
|
+
if (!name) {
|
|
6746
|
+
throw new TypeError("Invalid Construction");
|
|
6747
|
+
}
|
|
6748
|
+
|
|
6749
|
+
var elm = document.createElement(name);
|
|
6750
|
+
Object.setPrototypeOf(elm, constructor.prototype);
|
|
6751
|
+
return elm;
|
|
6752
|
+
};
|
|
6753
|
+
|
|
6754
|
+
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
6738
6755
|
}
|
|
6739
|
-
}
|
|
6740
6756
|
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
HTMLElementConstructor = HTMLElement;
|
|
6745
|
-
} else {
|
|
6746
|
-
var registry = create(null);
|
|
6747
|
-
var reverseRegistry = new WeakMap();
|
|
6757
|
+
function cloneNode(node, deep) {
|
|
6758
|
+
return node.cloneNode(deep);
|
|
6759
|
+
}
|
|
6748
6760
|
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
}
|
|
6761
|
+
function createElement(tagName, namespace) {
|
|
6762
|
+
return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6763
|
+
}
|
|
6753
6764
|
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
}
|
|
6765
|
+
function createText(content) {
|
|
6766
|
+
return document.createTextNode(content);
|
|
6767
|
+
}
|
|
6757
6768
|
|
|
6758
|
-
|
|
6759
|
-
return
|
|
6760
|
-
}
|
|
6769
|
+
function createComment(content) {
|
|
6770
|
+
return document.createComment(content);
|
|
6771
|
+
}
|
|
6761
6772
|
|
|
6762
|
-
|
|
6763
|
-
if (!(this instanceof HTMLElement)) {
|
|
6764
|
-
throw new TypeError("Invalid Invocation");
|
|
6765
|
-
}
|
|
6773
|
+
var createFragment; // IE11 lacks support for this feature
|
|
6766
6774
|
|
|
6767
|
-
|
|
6768
|
-
var name = reverseRegistry.get(constructor);
|
|
6775
|
+
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6769
6776
|
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6777
|
+
if (SUPPORTS_TEMPLATE) {
|
|
6778
|
+
// Parse the fragment HTML string into DOM
|
|
6779
|
+
createFragment = function createFragment(html) {
|
|
6780
|
+
var template = document.createElement('template');
|
|
6781
|
+
template.innerHTML = html;
|
|
6782
|
+
return template.content.firstChild;
|
|
6783
|
+
};
|
|
6784
|
+
} else {
|
|
6785
|
+
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6786
|
+
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6787
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6788
|
+
// With other elements added from:
|
|
6789
|
+
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6790
|
+
// Using the test:
|
|
6791
|
+
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6792
|
+
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6793
|
+
var topLevelWrappingMap = {
|
|
6794
|
+
caption: ['table'],
|
|
6795
|
+
col: ['colgroup', 'table'],
|
|
6796
|
+
colgroup: ['table'],
|
|
6797
|
+
option: ['select'],
|
|
6798
|
+
tbody: ['table'],
|
|
6799
|
+
td: ['tr', 'tbody', 'table'],
|
|
6800
|
+
th: ['tr', 'tbody', 'table'],
|
|
6801
|
+
thead: ['table'],
|
|
6802
|
+
tfoot: ['table'],
|
|
6803
|
+
tr: ['tbody', 'table']
|
|
6804
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6805
|
+
|
|
6806
|
+
var getTagName = function getTagName(text) {
|
|
6807
|
+
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6808
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6809
|
+
|
|
6810
|
+
|
|
6811
|
+
createFragment = function createFragment(html) {
|
|
6812
|
+
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6813
|
+
|
|
6814
|
+
if (!isUndefined(wrapperTags)) {
|
|
6815
|
+
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6816
|
+
_step5;
|
|
6817
|
+
|
|
6818
|
+
try {
|
|
6819
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
6820
|
+
var wrapperTag = _step5.value;
|
|
6821
|
+
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6822
|
+
}
|
|
6823
|
+
} catch (err) {
|
|
6824
|
+
_iterator5.e(err);
|
|
6825
|
+
} finally {
|
|
6826
|
+
_iterator5.f();
|
|
6827
|
+
}
|
|
6828
|
+
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6829
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6773
6830
|
|
|
6774
|
-
var elm = document.createElement(name);
|
|
6775
|
-
setPrototypeOf(elm, constructor.prototype);
|
|
6776
|
-
return elm;
|
|
6777
|
-
};
|
|
6778
6831
|
|
|
6779
|
-
|
|
6780
|
-
|
|
6832
|
+
var doc = document.implementation.createHTMLDocument('');
|
|
6833
|
+
doc.body.innerHTML = html;
|
|
6834
|
+
var content = doc.body;
|
|
6781
6835
|
|
|
6782
|
-
|
|
6783
|
-
|
|
6836
|
+
if (!isUndefined(wrapperTags)) {
|
|
6837
|
+
for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
|
|
6838
|
+
content = content.firstChild;
|
|
6839
|
+
}
|
|
6840
|
+
}
|
|
6784
6841
|
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6842
|
+
return content.firstChild;
|
|
6843
|
+
};
|
|
6844
|
+
}
|
|
6788
6845
|
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6846
|
+
function insert(node, parent, anchor) {
|
|
6847
|
+
parent.insertBefore(node, anchor);
|
|
6848
|
+
}
|
|
6792
6849
|
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6850
|
+
function remove(node, parent) {
|
|
6851
|
+
parent.removeChild(node);
|
|
6852
|
+
}
|
|
6796
6853
|
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6854
|
+
function nextSibling(node) {
|
|
6855
|
+
return node.nextSibling;
|
|
6856
|
+
}
|
|
6800
6857
|
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6858
|
+
function attachShadow(element, options) {
|
|
6859
|
+
// `shadowRoot` will be non-null in two cases:
|
|
6860
|
+
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
6861
|
+
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
6862
|
+
// root component with customElement.define('c-app', Ctor)
|
|
6863
|
+
if (!isNull(element.shadowRoot)) {
|
|
6864
|
+
return element.shadowRoot;
|
|
6865
|
+
}
|
|
6804
6866
|
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
}
|
|
6867
|
+
return element.attachShadow(options);
|
|
6868
|
+
}
|
|
6808
6869
|
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6870
|
+
function setText(node, content) {
|
|
6871
|
+
node.nodeValue = content;
|
|
6872
|
+
}
|
|
6812
6873
|
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
6816
|
-
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
6817
|
-
// root component with customElement.define('c-app', Ctor)
|
|
6818
|
-
if (!isNull(element.shadowRoot)) {
|
|
6819
|
-
return element.shadowRoot;
|
|
6874
|
+
function getProperty(node, key) {
|
|
6875
|
+
return node[key];
|
|
6820
6876
|
}
|
|
6821
6877
|
|
|
6822
|
-
|
|
6823
|
-
|
|
6878
|
+
function setProperty(node, key, value) {
|
|
6879
|
+
node[key] = value;
|
|
6880
|
+
}
|
|
6824
6881
|
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6882
|
+
function getAttribute(element, name, namespace) {
|
|
6883
|
+
return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6884
|
+
}
|
|
6828
6885
|
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6886
|
+
function setAttribute(element, name, value, namespace) {
|
|
6887
|
+
return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6888
|
+
}
|
|
6832
6889
|
|
|
6833
|
-
|
|
6890
|
+
function removeAttribute(element, name, namespace) {
|
|
6891
|
+
if (isUndefined(namespace)) {
|
|
6892
|
+
element.removeAttribute(name);
|
|
6893
|
+
} else {
|
|
6894
|
+
element.removeAttributeNS(namespace, name);
|
|
6895
|
+
}
|
|
6896
|
+
}
|
|
6834
6897
|
|
|
6835
|
-
|
|
6836
|
-
|
|
6898
|
+
function addEventListener(target, type, callback, options) {
|
|
6899
|
+
target.addEventListener(type, callback, options);
|
|
6900
|
+
}
|
|
6837
6901
|
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6902
|
+
function removeEventListener(target, type, callback, options) {
|
|
6903
|
+
target.removeEventListener(type, callback, options);
|
|
6904
|
+
}
|
|
6841
6905
|
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6906
|
+
function dispatchEvent(target, event) {
|
|
6907
|
+
return target.dispatchEvent(event);
|
|
6908
|
+
}
|
|
6845
6909
|
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
element.removeAttribute(name);
|
|
6849
|
-
} else {
|
|
6850
|
-
element.removeAttributeNS(namespace, name);
|
|
6910
|
+
function getClassList(element) {
|
|
6911
|
+
return element.classList;
|
|
6851
6912
|
}
|
|
6852
|
-
}
|
|
6853
6913
|
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6914
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
6915
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6916
|
+
// represent elements in the engine?
|
|
6917
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6918
|
+
}
|
|
6857
6919
|
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6920
|
+
function getBoundingClientRect(element) {
|
|
6921
|
+
return element.getBoundingClientRect();
|
|
6922
|
+
}
|
|
6861
6923
|
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6924
|
+
function querySelector(element, selectors) {
|
|
6925
|
+
return element.querySelector(selectors);
|
|
6926
|
+
}
|
|
6865
6927
|
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6928
|
+
function querySelectorAll(element, selectors) {
|
|
6929
|
+
return element.querySelectorAll(selectors);
|
|
6930
|
+
}
|
|
6869
6931
|
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6874
|
-
}
|
|
6932
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6933
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6934
|
+
}
|
|
6875
6935
|
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6936
|
+
function getElementsByClassName(element, names) {
|
|
6937
|
+
return element.getElementsByClassName(names);
|
|
6938
|
+
}
|
|
6879
6939
|
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6940
|
+
function getChildren(element) {
|
|
6941
|
+
return element.children;
|
|
6942
|
+
}
|
|
6883
6943
|
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6944
|
+
function getChildNodes(element) {
|
|
6945
|
+
return element.childNodes;
|
|
6946
|
+
}
|
|
6887
6947
|
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6948
|
+
function getFirstChild(element) {
|
|
6949
|
+
return element.firstChild;
|
|
6950
|
+
}
|
|
6891
6951
|
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6952
|
+
function getFirstElementChild(element) {
|
|
6953
|
+
return element.firstElementChild;
|
|
6954
|
+
}
|
|
6895
6955
|
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6956
|
+
function getLastChild(element) {
|
|
6957
|
+
return element.lastChild;
|
|
6958
|
+
}
|
|
6899
6959
|
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6960
|
+
function getLastElementChild(element) {
|
|
6961
|
+
return element.lastElementChild;
|
|
6962
|
+
}
|
|
6903
6963
|
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6964
|
+
function isConnected(node) {
|
|
6965
|
+
return node.isConnected;
|
|
6966
|
+
}
|
|
6907
6967
|
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6968
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6969
|
+
assertInvariant(elm instanceof HTMLElement, msg);
|
|
6970
|
+
}
|
|
6911
6971
|
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6972
|
+
var HTMLElementExported = HTMLElementConstructor;
|
|
6973
|
+
var renderer = {
|
|
6974
|
+
HTMLElementExported: HTMLElementExported,
|
|
6975
|
+
insert: insert,
|
|
6976
|
+
remove: remove,
|
|
6977
|
+
cloneNode: cloneNode,
|
|
6978
|
+
createFragment: createFragment,
|
|
6979
|
+
createElement: createElement,
|
|
6980
|
+
createText: createText,
|
|
6981
|
+
createComment: createComment,
|
|
6982
|
+
nextSibling: nextSibling,
|
|
6983
|
+
attachShadow: attachShadow,
|
|
6984
|
+
getProperty: getProperty,
|
|
6985
|
+
setProperty: setProperty,
|
|
6986
|
+
setText: setText,
|
|
6987
|
+
getAttribute: getAttribute,
|
|
6988
|
+
setAttribute: setAttribute,
|
|
6989
|
+
removeAttribute: removeAttribute,
|
|
6990
|
+
addEventListener: addEventListener,
|
|
6991
|
+
removeEventListener: removeEventListener,
|
|
6992
|
+
dispatchEvent: dispatchEvent,
|
|
6993
|
+
getClassList: getClassList,
|
|
6994
|
+
setCSSStyleProperty: setCSSStyleProperty,
|
|
6995
|
+
getBoundingClientRect: getBoundingClientRect,
|
|
6996
|
+
querySelector: querySelector,
|
|
6997
|
+
querySelectorAll: querySelectorAll,
|
|
6998
|
+
getElementsByTagName: getElementsByTagName,
|
|
6999
|
+
getElementsByClassName: getElementsByClassName,
|
|
7000
|
+
getChildren: getChildren,
|
|
7001
|
+
getChildNodes: getChildNodes,
|
|
7002
|
+
getFirstChild: getFirstChild,
|
|
7003
|
+
getFirstElementChild: getFirstElementChild,
|
|
7004
|
+
getLastChild: getLastChild,
|
|
7005
|
+
getLastElementChild: getLastElementChild,
|
|
7006
|
+
isConnected: isConnected,
|
|
7007
|
+
assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
|
|
7008
|
+
defineCustomElement: defineCustomElement,
|
|
7009
|
+
getCustomElement: getCustomElement
|
|
7010
|
+
}; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
|
|
6915
7011
|
|
|
6916
|
-
|
|
6917
|
-
return
|
|
7012
|
+
Object.setPrototypeOf(renderer, baseRenderer);
|
|
7013
|
+
return renderer;
|
|
6918
7014
|
}
|
|
7015
|
+
/*
|
|
7016
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
7017
|
+
* All rights reserved.
|
|
7018
|
+
* SPDX-License-Identifier: MIT
|
|
7019
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7020
|
+
*/
|
|
6919
7021
|
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
7022
|
+
/**
|
|
7023
|
+
* The base renderer that will be used by engine-core.
|
|
7024
|
+
* This will be used for DOM operations when lwc is running in a browser environment.
|
|
7025
|
+
*/
|
|
6923
7026
|
|
|
6924
|
-
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6925
|
-
assert.invariant(elm instanceof HTMLElement, msg);
|
|
6926
|
-
}
|
|
6927
7027
|
|
|
6928
|
-
var
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
insert: insert,
|
|
6934
|
-
remove: remove,
|
|
6935
|
-
cloneNode: cloneNode,
|
|
6936
|
-
createFragment: createFragment,
|
|
6937
|
-
createElement: createElement$1,
|
|
6938
|
-
createText: createText,
|
|
6939
|
-
createComment: createComment,
|
|
6940
|
-
nextSibling: nextSibling,
|
|
6941
|
-
attachShadow: attachShadow,
|
|
6942
|
-
getProperty: getProperty,
|
|
6943
|
-
setProperty: setProperty,
|
|
6944
|
-
setText: setText,
|
|
6945
|
-
getAttribute: getAttribute,
|
|
6946
|
-
setAttribute: setAttribute,
|
|
6947
|
-
removeAttribute: removeAttribute,
|
|
6948
|
-
addEventListener: addEventListener,
|
|
6949
|
-
removeEventListener: removeEventListener,
|
|
6950
|
-
dispatchEvent: dispatchEvent,
|
|
6951
|
-
getClassList: getClassList,
|
|
6952
|
-
setCSSStyleProperty: setCSSStyleProperty,
|
|
6953
|
-
getBoundingClientRect: getBoundingClientRect,
|
|
6954
|
-
querySelector: querySelector,
|
|
6955
|
-
querySelectorAll: querySelectorAll,
|
|
6956
|
-
getElementsByTagName: getElementsByTagName,
|
|
6957
|
-
getElementsByClassName: getElementsByClassName,
|
|
6958
|
-
getChildren: getChildren,
|
|
6959
|
-
getChildNodes: getChildNodes,
|
|
6960
|
-
getFirstChild: getFirstChild,
|
|
6961
|
-
getFirstElementChild: getFirstElementChild,
|
|
6962
|
-
getLastChild: getLastChild,
|
|
6963
|
-
getLastElementChild: getLastElementChild,
|
|
6964
|
-
isConnected: isConnected,
|
|
7028
|
+
var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
|
|
7029
|
+
// shared across renderers
|
|
7030
|
+
rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
|
|
7031
|
+
{
|
|
7032
|
+
// insertStyleSheet implementation shares a global cache of stylesheet data
|
|
6965
7033
|
insertStylesheet: insertStylesheet,
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
};
|
|
7034
|
+
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
7035
|
+
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
|
|
7036
|
+
});
|
|
6970
7037
|
/*
|
|
6971
7038
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6972
7039
|
* All rights reserved.
|
|
@@ -7134,7 +7201,6 @@ var LWC = (function (exports) {
|
|
|
7134
7201
|
* SPDX-License-Identifier: MIT
|
|
7135
7202
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7136
7203
|
*/
|
|
7137
|
-
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7138
7204
|
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7139
7205
|
|
|
7140
7206
|
|
|
@@ -7151,39 +7217,41 @@ var LWC = (function (exports) {
|
|
|
7151
7217
|
}
|
|
7152
7218
|
|
|
7153
7219
|
return node; // for convenience
|
|
7154
|
-
}
|
|
7155
|
-
// created via createElement.
|
|
7156
|
-
|
|
7220
|
+
}
|
|
7157
7221
|
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7222
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7223
|
+
// Monkey patching Node methods to be able to detect the insertions and removal of root elements
|
|
7224
|
+
// created via createElement.
|
|
7225
|
+
var _Node$1$prototype = _Node$1.prototype,
|
|
7226
|
+
_appendChild = _Node$1$prototype.appendChild,
|
|
7227
|
+
_insertBefore = _Node$1$prototype.insertBefore,
|
|
7228
|
+
_removeChild = _Node$1$prototype.removeChild,
|
|
7229
|
+
_replaceChild = _Node$1$prototype.replaceChild;
|
|
7230
|
+
assign(_Node$1.prototype, {
|
|
7231
|
+
appendChild: function appendChild(newChild) {
|
|
7232
|
+
var appendedNode = _appendChild.call(this, newChild);
|
|
7166
7233
|
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7234
|
+
return callNodeSlot(appendedNode, ConnectingSlot);
|
|
7235
|
+
},
|
|
7236
|
+
insertBefore: function insertBefore(newChild, referenceNode) {
|
|
7237
|
+
var insertedNode = _insertBefore.call(this, newChild, referenceNode);
|
|
7171
7238
|
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7239
|
+
return callNodeSlot(insertedNode, ConnectingSlot);
|
|
7240
|
+
},
|
|
7241
|
+
removeChild: function removeChild(oldChild) {
|
|
7242
|
+
var removedNode = _removeChild.call(this, oldChild);
|
|
7176
7243
|
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7244
|
+
return callNodeSlot(removedNode, DisconnectingSlot);
|
|
7245
|
+
},
|
|
7246
|
+
replaceChild: function replaceChild(newChild, oldChild) {
|
|
7247
|
+
var replacedNode = _replaceChild.call(this, newChild, oldChild);
|
|
7181
7248
|
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7249
|
+
callNodeSlot(replacedNode, DisconnectingSlot);
|
|
7250
|
+
callNodeSlot(newChild, ConnectingSlot);
|
|
7251
|
+
return replacedNode;
|
|
7252
|
+
}
|
|
7253
|
+
});
|
|
7254
|
+
}
|
|
7187
7255
|
/**
|
|
7188
7256
|
* EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
|
|
7189
7257
|
* difference that in the options, you can pass the `is` property set to a Constructor instead of
|
|
@@ -7196,6 +7264,7 @@ var LWC = (function (exports) {
|
|
|
7196
7264
|
* ```
|
|
7197
7265
|
*/
|
|
7198
7266
|
|
|
7267
|
+
|
|
7199
7268
|
function createElement(sel, options) {
|
|
7200
7269
|
if (!isObject(options) || isNull(options)) {
|
|
7201
7270
|
throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
|
|
@@ -7223,8 +7292,12 @@ var LWC = (function (exports) {
|
|
|
7223
7292
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
7224
7293
|
owner: null
|
|
7225
7294
|
});
|
|
7226
|
-
|
|
7227
|
-
|
|
7295
|
+
|
|
7296
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7297
|
+
ConnectingSlot.set(elm, connectRootElement);
|
|
7298
|
+
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
7299
|
+
}
|
|
7300
|
+
|
|
7228
7301
|
wasComponentUpgraded = true;
|
|
7229
7302
|
});
|
|
7230
7303
|
|
|
@@ -7271,7 +7344,7 @@ var LWC = (function (exports) {
|
|
|
7271
7344
|
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
7272
7345
|
|
|
7273
7346
|
|
|
7274
|
-
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7347
|
+
return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7275
7348
|
}
|
|
7276
7349
|
/*
|
|
7277
7350
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7315,7 +7388,7 @@ var LWC = (function (exports) {
|
|
|
7315
7388
|
});
|
|
7316
7389
|
freeze(LightningElement);
|
|
7317
7390
|
seal(LightningElement.prototype);
|
|
7318
|
-
/* version: 2.23.
|
|
7391
|
+
/* version: 2.23.2 */
|
|
7319
7392
|
|
|
7320
7393
|
exports.LightningElement = LightningElement;
|
|
7321
7394
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -7337,6 +7410,7 @@ var LWC = (function (exports) {
|
|
|
7337
7410
|
exports.registerDecorators = registerDecorators;
|
|
7338
7411
|
exports.registerTemplate = registerTemplate;
|
|
7339
7412
|
exports.renderer = renderer;
|
|
7413
|
+
exports.rendererFactory = rendererFactory;
|
|
7340
7414
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
7341
7415
|
exports.setFeatureFlag = setFeatureFlag;
|
|
7342
7416
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|