lwc 2.23.0 → 2.23.3
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 +1208 -877
- package/dist/engine-dom/iife/es2017/engine-dom.js +1208 -876
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1115 -812
- package/dist/engine-dom/iife/es5/engine-dom.js +473 -386
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +424 -344
- package/dist/engine-dom/umd/es2017/engine-dom.js +1208 -876
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1115 -812
- package/dist/engine-dom/umd/es5/engine-dom.js +473 -386
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +424 -344
- package/dist/engine-server/commonjs/es2017/engine-server.js +803 -537
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +803 -537
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +19 -19
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +19 -19
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +19 -19
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +19 -19
- 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 +17 -9
|
@@ -346,7 +346,11 @@ 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.3 */
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
353
|
+
*/
|
|
350
354
|
|
|
351
355
|
/*
|
|
352
356
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -356,7 +360,7 @@ var LWC = (function (exports) {
|
|
|
356
360
|
*/
|
|
357
361
|
|
|
358
362
|
function detect(propName) {
|
|
359
|
-
return
|
|
363
|
+
return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
|
|
360
364
|
}
|
|
361
365
|
/*
|
|
362
366
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -436,6 +440,8 @@ var LWC = (function (exports) {
|
|
|
436
440
|
patch$1(propName);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
443
|
+
/** version: 2.23.3 */
|
|
444
|
+
|
|
439
445
|
/**
|
|
440
446
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
441
447
|
*/
|
|
@@ -456,6 +462,7 @@ var LWC = (function (exports) {
|
|
|
456
462
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
457
463
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
458
464
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
465
|
+
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
459
466
|
ENABLE_NODE_LIST_PATCH: null,
|
|
460
467
|
ENABLE_NODE_PATCH: null,
|
|
461
468
|
ENABLE_REACTIVE_SETTER: null,
|
|
@@ -468,7 +475,7 @@ var LWC = (function (exports) {
|
|
|
468
475
|
});
|
|
469
476
|
}
|
|
470
477
|
|
|
471
|
-
var
|
|
478
|
+
var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
|
|
472
479
|
/**
|
|
473
480
|
* Set the value at runtime of a given feature flag. This method only be invoked once per feature
|
|
474
481
|
* flag. It is meant to be used during the app initialization.
|
|
@@ -496,7 +503,7 @@ var LWC = (function (exports) {
|
|
|
496
503
|
|
|
497
504
|
{
|
|
498
505
|
// Disallow the same flag to be set more than once in production
|
|
499
|
-
var runtimeValue =
|
|
506
|
+
var runtimeValue = lwcRuntimeFlags[name];
|
|
500
507
|
|
|
501
508
|
if (!isUndefined$1(runtimeValue)) {
|
|
502
509
|
// eslint-disable-next-line no-console
|
|
@@ -504,7 +511,7 @@ var LWC = (function (exports) {
|
|
|
504
511
|
return;
|
|
505
512
|
}
|
|
506
513
|
|
|
507
|
-
defineProperty(
|
|
514
|
+
defineProperty(lwcRuntimeFlags, name, {
|
|
508
515
|
value: value
|
|
509
516
|
});
|
|
510
517
|
}
|
|
@@ -860,8 +867,8 @@ var LWC = (function (exports) {
|
|
|
860
867
|
// to inject at runtime.
|
|
861
868
|
|
|
862
869
|
|
|
863
|
-
var HTMLElementConstructor
|
|
864
|
-
var HTMLElementPrototype = HTMLElementConstructor
|
|
870
|
+
var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
|
|
871
|
+
var HTMLElementPrototype = HTMLElementConstructor.prototype;
|
|
865
872
|
/*
|
|
866
873
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
867
874
|
* All rights reserved.
|
|
@@ -2170,7 +2177,7 @@ var LWC = (function (exports) {
|
|
|
2170
2177
|
var vm = getAssociatedVM(this);
|
|
2171
2178
|
|
|
2172
2179
|
if (_set2) {
|
|
2173
|
-
if (
|
|
2180
|
+
if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
|
|
2174
2181
|
var ro = vm.oar[key];
|
|
2175
2182
|
|
|
2176
2183
|
if (isUndefined$1(ro)) {
|
|
@@ -2663,7 +2670,7 @@ var LWC = (function (exports) {
|
|
|
2663
2670
|
return HTMLBridgeElement;
|
|
2664
2671
|
}
|
|
2665
2672
|
|
|
2666
|
-
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor
|
|
2673
|
+
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
|
|
2667
2674
|
freeze(BaseBridgeElement);
|
|
2668
2675
|
seal(BaseBridgeElement.prototype);
|
|
2669
2676
|
|
|
@@ -2676,7 +2683,7 @@ var LWC = (function (exports) {
|
|
|
2676
2683
|
|
|
2677
2684
|
function swapTemplate(oldTpl, newTpl) {
|
|
2678
2685
|
|
|
2679
|
-
if (!
|
|
2686
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2680
2687
|
throw new Error('HMR is not enabled');
|
|
2681
2688
|
}
|
|
2682
2689
|
|
|
@@ -2685,7 +2692,7 @@ var LWC = (function (exports) {
|
|
|
2685
2692
|
|
|
2686
2693
|
function swapComponent(oldComponent, newComponent) {
|
|
2687
2694
|
|
|
2688
|
-
if (!
|
|
2695
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2689
2696
|
throw new Error('HMR is not enabled');
|
|
2690
2697
|
}
|
|
2691
2698
|
|
|
@@ -2694,7 +2701,7 @@ var LWC = (function (exports) {
|
|
|
2694
2701
|
|
|
2695
2702
|
function swapStyle(oldStyle, newStyle) {
|
|
2696
2703
|
|
|
2697
|
-
if (!
|
|
2704
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2698
2705
|
throw new Error('HMR is not enabled');
|
|
2699
2706
|
}
|
|
2700
2707
|
|
|
@@ -3165,6 +3172,12 @@ var LWC = (function (exports) {
|
|
|
3165
3172
|
*/
|
|
3166
3173
|
|
|
3167
3174
|
|
|
3175
|
+
function checkHasVM(elm) {
|
|
3176
|
+
var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
3177
|
+
|
|
3178
|
+
return hasVM;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3168
3181
|
function getUpgradableConstructor(tagName, renderer) {
|
|
3169
3182
|
var getCustomElement = renderer.getCustomElement,
|
|
3170
3183
|
RendererHTMLElement = renderer.HTMLElementExported,
|
|
@@ -3206,6 +3219,20 @@ var LWC = (function (exports) {
|
|
|
3206
3219
|
return _createClass(LWCUpgradableElement);
|
|
3207
3220
|
}(RendererHTMLElement);
|
|
3208
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
|
+
|
|
3209
3236
|
defineCustomElement(tagName, CE);
|
|
3210
3237
|
return CE;
|
|
3211
3238
|
}
|
|
@@ -3317,6 +3344,7 @@ var LWC = (function (exports) {
|
|
|
3317
3344
|
// different than the one previously set.
|
|
3318
3345
|
|
|
3319
3346
|
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
3347
|
+
|
|
3320
3348
|
setProperty(elm, key, cur);
|
|
3321
3349
|
}
|
|
3322
3350
|
}
|
|
@@ -3710,8 +3738,12 @@ var LWC = (function (exports) {
|
|
|
3710
3738
|
insertNode(elm, parent, anchor, renderer);
|
|
3711
3739
|
|
|
3712
3740
|
if (vm) {
|
|
3741
|
+
{
|
|
3742
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3713
3743
|
|
|
3714
|
-
|
|
3744
|
+
runConnectedCallback(vm);
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3715
3747
|
}
|
|
3716
3748
|
|
|
3717
3749
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3879,10 +3911,10 @@ var LWC = (function (exports) {
|
|
|
3879
3911
|
var scopeToken = getScopeTokenClass(owner);
|
|
3880
3912
|
|
|
3881
3913
|
if (!isNull(scopeToken)) {
|
|
3882
|
-
var
|
|
3914
|
+
var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
3883
3915
|
// probably we should have a renderer api for just the add operation
|
|
3884
3916
|
|
|
3885
|
-
|
|
3917
|
+
getClassList(elm).add(scopeToken);
|
|
3886
3918
|
} // Set property element for synthetic shadow DOM style scoping.
|
|
3887
3919
|
|
|
3888
3920
|
|
|
@@ -5228,7 +5260,7 @@ var LWC = (function (exports) {
|
|
|
5228
5260
|
} else if (isNativeShadowDefined) {
|
|
5229
5261
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
5230
5262
|
// the if-condition.
|
|
5231
|
-
if (
|
|
5263
|
+
if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
5232
5264
|
if (def.shadowSupportMode === "any"
|
|
5233
5265
|
/* ShadowSupportMode.Any */
|
|
5234
5266
|
) {
|
|
@@ -5873,7 +5905,7 @@ var LWC = (function (exports) {
|
|
|
5873
5905
|
ArrayPush$1.call(wiredConnecting, function () {
|
|
5874
5906
|
connector.connect();
|
|
5875
5907
|
|
|
5876
|
-
if (!
|
|
5908
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
5877
5909
|
if (hasDynamicParams) {
|
|
5878
5910
|
Promise.resolve().then(computeConfigAndUpdate);
|
|
5879
5911
|
return;
|
|
@@ -6047,6 +6079,8 @@ var LWC = (function (exports) {
|
|
|
6047
6079
|
return renderer.nextSibling(hydratedNode);
|
|
6048
6080
|
}
|
|
6049
6081
|
|
|
6082
|
+
var NODE_VALUE_PROP = 'nodeValue';
|
|
6083
|
+
|
|
6050
6084
|
function hydrateText(node, vnode, renderer) {
|
|
6051
6085
|
var _a;
|
|
6052
6086
|
|
|
@@ -6072,7 +6106,7 @@ var LWC = (function (exports) {
|
|
|
6072
6106
|
}
|
|
6073
6107
|
|
|
6074
6108
|
var setProperty = renderer.setProperty;
|
|
6075
|
-
setProperty(node,
|
|
6109
|
+
setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6076
6110
|
vnode.elm = node;
|
|
6077
6111
|
return node;
|
|
6078
6112
|
}
|
|
@@ -6104,10 +6138,10 @@ var LWC = (function (exports) {
|
|
|
6104
6138
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6105
6139
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6106
6140
|
var props = vnode.data.props;
|
|
6107
|
-
var
|
|
6141
|
+
var getProperty = renderer.getProperty;
|
|
6108
6142
|
|
|
6109
6143
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6110
|
-
if (
|
|
6144
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
6111
6145
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6112
6146
|
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6113
6147
|
props: cloneAndOmitKey(props, 'innerHTML')
|
|
@@ -6119,8 +6153,8 @@ var LWC = (function (exports) {
|
|
|
6119
6153
|
patchElementPropsAndAttrs(vnode, renderer);
|
|
6120
6154
|
|
|
6121
6155
|
if (!isDomManual) {
|
|
6122
|
-
var
|
|
6123
|
-
hydrateChildren(
|
|
6156
|
+
var getFirstChild = renderer.getFirstChild;
|
|
6157
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
6124
6158
|
}
|
|
6125
6159
|
|
|
6126
6160
|
return elm;
|
|
@@ -6153,10 +6187,10 @@ var LWC = (function (exports) {
|
|
|
6153
6187
|
if (vm.renderMode !== 0
|
|
6154
6188
|
/* RenderMode.Light */
|
|
6155
6189
|
) {
|
|
6156
|
-
var
|
|
6190
|
+
var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6157
6191
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6158
6192
|
|
|
6159
|
-
hydrateChildren(
|
|
6193
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
6160
6194
|
}
|
|
6161
6195
|
|
|
6162
6196
|
hydrateVM(vm);
|
|
@@ -6191,11 +6225,11 @@ var LWC = (function (exports) {
|
|
|
6191
6225
|
// next node in the list to be hydrated.
|
|
6192
6226
|
|
|
6193
6227
|
|
|
6194
|
-
var
|
|
6228
|
+
var nextSibling = renderer.nextSibling;
|
|
6195
6229
|
|
|
6196
6230
|
do {
|
|
6197
6231
|
var current = nextNode;
|
|
6198
|
-
nextNode =
|
|
6232
|
+
nextNode = nextSibling(nextNode);
|
|
6199
6233
|
removeNode(current, parentNode, renderer);
|
|
6200
6234
|
} while (nextNode);
|
|
6201
6235
|
}
|
|
@@ -6252,9 +6286,8 @@ var LWC = (function (exports) {
|
|
|
6252
6286
|
attrValue = _Object$entries$_i[1];
|
|
6253
6287
|
|
|
6254
6288
|
vnode.owner;
|
|
6255
|
-
var
|
|
6256
|
-
|
|
6257
|
-
var elmAttrValue = _getAttribute(elm, attrName);
|
|
6289
|
+
var getAttribute = renderer.getAttribute;
|
|
6290
|
+
var elmAttrValue = getAttribute(elm, attrName);
|
|
6258
6291
|
|
|
6259
6292
|
if (String(attrValue) !== elmAttrValue) {
|
|
6260
6293
|
|
|
@@ -6370,7 +6403,7 @@ var LWC = (function (exports) {
|
|
|
6370
6403
|
return false;
|
|
6371
6404
|
}
|
|
6372
6405
|
|
|
6373
|
-
return getProperty(client,
|
|
6406
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6374
6407
|
}
|
|
6375
6408
|
|
|
6376
6409
|
if (getProperty(client, 'nodeType') === 8
|
|
@@ -6382,7 +6415,7 @@ var LWC = (function (exports) {
|
|
|
6382
6415
|
return false;
|
|
6383
6416
|
}
|
|
6384
6417
|
|
|
6385
|
-
return getProperty(client,
|
|
6418
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6386
6419
|
}
|
|
6387
6420
|
|
|
6388
6421
|
if (!hasCorrectNodeType(vnode, ssr, 1
|
|
@@ -6454,7 +6487,7 @@ var LWC = (function (exports) {
|
|
|
6454
6487
|
|
|
6455
6488
|
return ctor;
|
|
6456
6489
|
}
|
|
6457
|
-
/* version: 2.23.
|
|
6490
|
+
/* version: 2.23.3 */
|
|
6458
6491
|
|
|
6459
6492
|
/*
|
|
6460
6493
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6612,355 +6645,395 @@ var LWC = (function (exports) {
|
|
|
6612
6645
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6613
6646
|
*/
|
|
6614
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
|
+
*/
|
|
6615
6658
|
|
|
6616
|
-
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6617
|
-
var createFragment;
|
|
6618
6659
|
|
|
6619
|
-
|
|
6620
|
-
//
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
}
|
|
6626
|
-
} else {
|
|
6627
|
-
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6628
|
-
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6629
|
-
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6630
|
-
// With other elements added from:
|
|
6631
|
-
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6632
|
-
// Using the test:
|
|
6633
|
-
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6634
|
-
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6635
|
-
var topLevelWrappingMap = {
|
|
6636
|
-
caption: ['table'],
|
|
6637
|
-
col: ['colgroup', 'table'],
|
|
6638
|
-
colgroup: ['table'],
|
|
6639
|
-
option: ['select'],
|
|
6640
|
-
tbody: ['table'],
|
|
6641
|
-
td: ['tr', 'tbody', 'table'],
|
|
6642
|
-
th: ['tr', 'tbody', 'table'],
|
|
6643
|
-
thead: ['table'],
|
|
6644
|
-
tfoot: ['table'],
|
|
6645
|
-
tr: ['tbody', 'table']
|
|
6646
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6647
|
-
|
|
6648
|
-
var getTagName = function getTagName(text) {
|
|
6649
|
-
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6650
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
createFragment = function createFragment(html) {
|
|
6654
|
-
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6655
|
-
|
|
6656
|
-
if (!isUndefined$1(wrapperTags)) {
|
|
6657
|
-
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6658
|
-
_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
|
+
}
|
|
6659
6667
|
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6664
|
-
}
|
|
6665
|
-
} catch (err) {
|
|
6666
|
-
_iterator5.e(err);
|
|
6667
|
-
} finally {
|
|
6668
|
-
_iterator5.f();
|
|
6669
|
-
}
|
|
6670
|
-
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6671
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6668
|
+
function isNull(obj) {
|
|
6669
|
+
return obj === null;
|
|
6670
|
+
}
|
|
6672
6671
|
|
|
6672
|
+
function isUndefined(obj) {
|
|
6673
|
+
return obj === undefined;
|
|
6674
|
+
}
|
|
6673
6675
|
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6676
|
+
var getCustomElement;
|
|
6677
|
+
var defineCustomElement;
|
|
6678
|
+
var HTMLElementConstructor;
|
|
6677
6679
|
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
}
|
|
6680
|
+
function isCustomElementRegistryAvailable() {
|
|
6681
|
+
if (typeof customElements === 'undefined') {
|
|
6682
|
+
return false;
|
|
6682
6683
|
}
|
|
6683
6684
|
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
*/
|
|
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.
|
|
6693
6693
|
|
|
6694
|
+
var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
|
|
6695
|
+
_inherits(clazz, _HTMLElementAlias);
|
|
6694
6696
|
|
|
6695
|
-
|
|
6696
|
-
var defineCustomElement;
|
|
6697
|
-
var HTMLElementConstructor;
|
|
6697
|
+
var _super7 = _createSuper(clazz);
|
|
6698
6698
|
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
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
|
+
}
|
|
6702
6714
|
}
|
|
6703
6715
|
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
var
|
|
6710
|
-
|
|
6711
|
-
// 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();
|
|
6712
6723
|
|
|
6713
|
-
|
|
6714
|
-
|
|
6724
|
+
defineCustomElement = function define(name, ctor) {
|
|
6725
|
+
if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
|
|
6726
|
+
throw new TypeError("Invalid Registration");
|
|
6727
|
+
}
|
|
6715
6728
|
|
|
6716
|
-
|
|
6729
|
+
registry[name] = ctor;
|
|
6730
|
+
reverseRegistry.set(ctor, name);
|
|
6731
|
+
};
|
|
6717
6732
|
|
|
6718
|
-
|
|
6719
|
-
|
|
6733
|
+
getCustomElement = function get(name) {
|
|
6734
|
+
return registry[name];
|
|
6735
|
+
};
|
|
6720
6736
|
|
|
6721
|
-
|
|
6737
|
+
HTMLElementConstructor = function HTMLElement() {
|
|
6738
|
+
if (!(this instanceof HTMLElement)) {
|
|
6739
|
+
throw new TypeError("Invalid Invocation");
|
|
6722
6740
|
}
|
|
6723
6741
|
|
|
6724
|
-
|
|
6725
|
-
|
|
6742
|
+
var constructor = this.constructor;
|
|
6743
|
+
var name = reverseRegistry.get(constructor);
|
|
6726
6744
|
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
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;
|
|
6732
6755
|
}
|
|
6733
|
-
}
|
|
6734
6756
|
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
HTMLElementConstructor = HTMLElement;
|
|
6739
|
-
} else {
|
|
6740
|
-
var registry = create(null);
|
|
6741
|
-
var reverseRegistry = new WeakMap();
|
|
6757
|
+
function cloneNode(node, deep) {
|
|
6758
|
+
return node.cloneNode(deep);
|
|
6759
|
+
}
|
|
6742
6760
|
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
}
|
|
6761
|
+
function createElement(tagName, namespace) {
|
|
6762
|
+
return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6763
|
+
}
|
|
6747
6764
|
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
}
|
|
6765
|
+
function createText(content) {
|
|
6766
|
+
return document.createTextNode(content);
|
|
6767
|
+
}
|
|
6751
6768
|
|
|
6752
|
-
|
|
6753
|
-
return
|
|
6754
|
-
}
|
|
6769
|
+
function createComment(content) {
|
|
6770
|
+
return document.createComment(content);
|
|
6771
|
+
}
|
|
6755
6772
|
|
|
6756
|
-
|
|
6757
|
-
if (!(this instanceof HTMLElement)) {
|
|
6758
|
-
throw new TypeError("Invalid Invocation");
|
|
6759
|
-
}
|
|
6773
|
+
var createFragment; // IE11 lacks support for this feature
|
|
6760
6774
|
|
|
6761
|
-
|
|
6762
|
-
var name = reverseRegistry.get(constructor);
|
|
6775
|
+
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6763
6776
|
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
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
|
|
6767
6830
|
|
|
6768
|
-
var elm = document.createElement(name);
|
|
6769
|
-
setPrototypeOf(elm, constructor.prototype);
|
|
6770
|
-
return elm;
|
|
6771
|
-
};
|
|
6772
6831
|
|
|
6773
|
-
|
|
6774
|
-
|
|
6832
|
+
var doc = document.implementation.createHTMLDocument('');
|
|
6833
|
+
doc.body.innerHTML = html;
|
|
6834
|
+
var content = doc.body;
|
|
6775
6835
|
|
|
6776
|
-
|
|
6777
|
-
|
|
6836
|
+
if (!isUndefined(wrapperTags)) {
|
|
6837
|
+
for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
|
|
6838
|
+
content = content.firstChild;
|
|
6839
|
+
}
|
|
6840
|
+
}
|
|
6778
6841
|
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6842
|
+
return content.firstChild;
|
|
6843
|
+
};
|
|
6844
|
+
}
|
|
6782
6845
|
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6846
|
+
function insert(node, parent, anchor) {
|
|
6847
|
+
parent.insertBefore(node, anchor);
|
|
6848
|
+
}
|
|
6786
6849
|
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6850
|
+
function remove(node, parent) {
|
|
6851
|
+
parent.removeChild(node);
|
|
6852
|
+
}
|
|
6790
6853
|
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6854
|
+
function nextSibling(node) {
|
|
6855
|
+
return node.nextSibling;
|
|
6856
|
+
}
|
|
6794
6857
|
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
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
|
+
}
|
|
6798
6866
|
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
}
|
|
6867
|
+
return element.attachShadow(options);
|
|
6868
|
+
}
|
|
6802
6869
|
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6870
|
+
function setText(node, content) {
|
|
6871
|
+
node.nodeValue = content;
|
|
6872
|
+
}
|
|
6806
6873
|
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
6810
|
-
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
6811
|
-
// root component with customElement.define('c-app', Ctor)
|
|
6812
|
-
if (!isNull(element.shadowRoot)) {
|
|
6813
|
-
return element.shadowRoot;
|
|
6874
|
+
function getProperty(node, key) {
|
|
6875
|
+
return node[key];
|
|
6814
6876
|
}
|
|
6815
6877
|
|
|
6816
|
-
|
|
6817
|
-
|
|
6878
|
+
function setProperty(node, key, value) {
|
|
6879
|
+
node[key] = value;
|
|
6880
|
+
}
|
|
6818
6881
|
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6882
|
+
function getAttribute(element, name, namespace) {
|
|
6883
|
+
return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6884
|
+
}
|
|
6822
6885
|
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6886
|
+
function setAttribute(element, name, value, namespace) {
|
|
6887
|
+
return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6888
|
+
}
|
|
6826
6889
|
|
|
6827
|
-
|
|
6890
|
+
function removeAttribute(element, name, namespace) {
|
|
6891
|
+
if (isUndefined(namespace)) {
|
|
6892
|
+
element.removeAttribute(name);
|
|
6893
|
+
} else {
|
|
6894
|
+
element.removeAttributeNS(namespace, name);
|
|
6895
|
+
}
|
|
6896
|
+
}
|
|
6828
6897
|
|
|
6829
|
-
|
|
6830
|
-
|
|
6898
|
+
function addEventListener(target, type, callback, options) {
|
|
6899
|
+
target.addEventListener(type, callback, options);
|
|
6900
|
+
}
|
|
6831
6901
|
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6902
|
+
function removeEventListener(target, type, callback, options) {
|
|
6903
|
+
target.removeEventListener(type, callback, options);
|
|
6904
|
+
}
|
|
6835
6905
|
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6906
|
+
function dispatchEvent(target, event) {
|
|
6907
|
+
return target.dispatchEvent(event);
|
|
6908
|
+
}
|
|
6839
6909
|
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
element.removeAttribute(name);
|
|
6843
|
-
} else {
|
|
6844
|
-
element.removeAttributeNS(namespace, name);
|
|
6910
|
+
function getClassList(element) {
|
|
6911
|
+
return element.classList;
|
|
6845
6912
|
}
|
|
6846
|
-
}
|
|
6847
6913
|
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
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
|
+
}
|
|
6851
6919
|
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6920
|
+
function getBoundingClientRect(element) {
|
|
6921
|
+
return element.getBoundingClientRect();
|
|
6922
|
+
}
|
|
6855
6923
|
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6924
|
+
function querySelector(element, selectors) {
|
|
6925
|
+
return element.querySelector(selectors);
|
|
6926
|
+
}
|
|
6859
6927
|
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6928
|
+
function querySelectorAll(element, selectors) {
|
|
6929
|
+
return element.querySelectorAll(selectors);
|
|
6930
|
+
}
|
|
6863
6931
|
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6868
|
-
}
|
|
6932
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6933
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6934
|
+
}
|
|
6869
6935
|
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6936
|
+
function getElementsByClassName(element, names) {
|
|
6937
|
+
return element.getElementsByClassName(names);
|
|
6938
|
+
}
|
|
6873
6939
|
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6940
|
+
function getChildren(element) {
|
|
6941
|
+
return element.children;
|
|
6942
|
+
}
|
|
6877
6943
|
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6944
|
+
function getChildNodes(element) {
|
|
6945
|
+
return element.childNodes;
|
|
6946
|
+
}
|
|
6881
6947
|
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6948
|
+
function getFirstChild(element) {
|
|
6949
|
+
return element.firstChild;
|
|
6950
|
+
}
|
|
6885
6951
|
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6952
|
+
function getFirstElementChild(element) {
|
|
6953
|
+
return element.firstElementChild;
|
|
6954
|
+
}
|
|
6889
6955
|
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6956
|
+
function getLastChild(element) {
|
|
6957
|
+
return element.lastChild;
|
|
6958
|
+
}
|
|
6893
6959
|
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6960
|
+
function getLastElementChild(element) {
|
|
6961
|
+
return element.lastElementChild;
|
|
6962
|
+
}
|
|
6897
6963
|
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6964
|
+
function isConnected(node) {
|
|
6965
|
+
return node.isConnected;
|
|
6966
|
+
}
|
|
6901
6967
|
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6968
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6969
|
+
assertInvariant(elm instanceof HTMLElement, msg);
|
|
6970
|
+
}
|
|
6905
6971
|
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
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.
|
|
6909
7011
|
|
|
6910
|
-
|
|
6911
|
-
return
|
|
7012
|
+
Object.setPrototypeOf(renderer, baseRenderer);
|
|
7013
|
+
return renderer;
|
|
6912
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
|
+
*/
|
|
6913
7021
|
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
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
|
+
*/
|
|
6917
7026
|
|
|
6918
|
-
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6919
|
-
assert.invariant(elm instanceof HTMLElement, msg);
|
|
6920
|
-
}
|
|
6921
7027
|
|
|
6922
|
-
var
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
insert: insert,
|
|
6928
|
-
remove: remove,
|
|
6929
|
-
cloneNode: cloneNode,
|
|
6930
|
-
createFragment: createFragment,
|
|
6931
|
-
createElement: createElement$1,
|
|
6932
|
-
createText: createText,
|
|
6933
|
-
createComment: createComment,
|
|
6934
|
-
nextSibling: nextSibling,
|
|
6935
|
-
attachShadow: attachShadow,
|
|
6936
|
-
getProperty: getProperty,
|
|
6937
|
-
setProperty: setProperty,
|
|
6938
|
-
setText: setText,
|
|
6939
|
-
getAttribute: getAttribute,
|
|
6940
|
-
setAttribute: setAttribute,
|
|
6941
|
-
removeAttribute: removeAttribute,
|
|
6942
|
-
addEventListener: addEventListener,
|
|
6943
|
-
removeEventListener: removeEventListener,
|
|
6944
|
-
dispatchEvent: dispatchEvent,
|
|
6945
|
-
getClassList: getClassList,
|
|
6946
|
-
setCSSStyleProperty: setCSSStyleProperty,
|
|
6947
|
-
getBoundingClientRect: getBoundingClientRect,
|
|
6948
|
-
querySelector: querySelector,
|
|
6949
|
-
querySelectorAll: querySelectorAll,
|
|
6950
|
-
getElementsByTagName: getElementsByTagName,
|
|
6951
|
-
getElementsByClassName: getElementsByClassName,
|
|
6952
|
-
getChildren: getChildren,
|
|
6953
|
-
getChildNodes: getChildNodes,
|
|
6954
|
-
getFirstChild: getFirstChild,
|
|
6955
|
-
getFirstElementChild: getFirstElementChild,
|
|
6956
|
-
getLastChild: getLastChild,
|
|
6957
|
-
getLastElementChild: getLastElementChild,
|
|
6958
|
-
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
|
|
6959
7033
|
insertStylesheet: insertStylesheet,
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
};
|
|
7034
|
+
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
7035
|
+
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
|
|
7036
|
+
});
|
|
6964
7037
|
/*
|
|
6965
7038
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6966
7039
|
* All rights reserved.
|
|
@@ -7128,7 +7201,6 @@ var LWC = (function (exports) {
|
|
|
7128
7201
|
* SPDX-License-Identifier: MIT
|
|
7129
7202
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7130
7203
|
*/
|
|
7131
|
-
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7132
7204
|
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7133
7205
|
|
|
7134
7206
|
|
|
@@ -7145,39 +7217,41 @@ var LWC = (function (exports) {
|
|
|
7145
7217
|
}
|
|
7146
7218
|
|
|
7147
7219
|
return node; // for convenience
|
|
7148
|
-
}
|
|
7149
|
-
// created via createElement.
|
|
7150
|
-
|
|
7220
|
+
}
|
|
7151
7221
|
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
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);
|
|
7160
7233
|
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7234
|
+
return callNodeSlot(appendedNode, ConnectingSlot);
|
|
7235
|
+
},
|
|
7236
|
+
insertBefore: function insertBefore(newChild, referenceNode) {
|
|
7237
|
+
var insertedNode = _insertBefore.call(this, newChild, referenceNode);
|
|
7165
7238
|
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7239
|
+
return callNodeSlot(insertedNode, ConnectingSlot);
|
|
7240
|
+
},
|
|
7241
|
+
removeChild: function removeChild(oldChild) {
|
|
7242
|
+
var removedNode = _removeChild.call(this, oldChild);
|
|
7170
7243
|
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7244
|
+
return callNodeSlot(removedNode, DisconnectingSlot);
|
|
7245
|
+
},
|
|
7246
|
+
replaceChild: function replaceChild(newChild, oldChild) {
|
|
7247
|
+
var replacedNode = _replaceChild.call(this, newChild, oldChild);
|
|
7175
7248
|
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7249
|
+
callNodeSlot(replacedNode, DisconnectingSlot);
|
|
7250
|
+
callNodeSlot(newChild, ConnectingSlot);
|
|
7251
|
+
return replacedNode;
|
|
7252
|
+
}
|
|
7253
|
+
});
|
|
7254
|
+
}
|
|
7181
7255
|
/**
|
|
7182
7256
|
* EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
|
|
7183
7257
|
* difference that in the options, you can pass the `is` property set to a Constructor instead of
|
|
@@ -7190,6 +7264,7 @@ var LWC = (function (exports) {
|
|
|
7190
7264
|
* ```
|
|
7191
7265
|
*/
|
|
7192
7266
|
|
|
7267
|
+
|
|
7193
7268
|
function createElement(sel, options) {
|
|
7194
7269
|
if (!isObject(options) || isNull(options)) {
|
|
7195
7270
|
throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
|
|
@@ -7217,8 +7292,12 @@ var LWC = (function (exports) {
|
|
|
7217
7292
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
7218
7293
|
owner: null
|
|
7219
7294
|
});
|
|
7220
|
-
|
|
7221
|
-
|
|
7295
|
+
|
|
7296
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7297
|
+
ConnectingSlot.set(elm, connectRootElement);
|
|
7298
|
+
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
7299
|
+
}
|
|
7300
|
+
|
|
7222
7301
|
wasComponentUpgraded = true;
|
|
7223
7302
|
});
|
|
7224
7303
|
|
|
@@ -7265,7 +7344,7 @@ var LWC = (function (exports) {
|
|
|
7265
7344
|
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
7266
7345
|
|
|
7267
7346
|
|
|
7268
|
-
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7347
|
+
return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7269
7348
|
}
|
|
7270
7349
|
/*
|
|
7271
7350
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7309,7 +7388,7 @@ var LWC = (function (exports) {
|
|
|
7309
7388
|
});
|
|
7310
7389
|
freeze(LightningElement);
|
|
7311
7390
|
seal(LightningElement.prototype);
|
|
7312
|
-
/* version: 2.23.
|
|
7391
|
+
/* version: 2.23.3 */
|
|
7313
7392
|
|
|
7314
7393
|
exports.LightningElement = LightningElement;
|
|
7315
7394
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -7331,6 +7410,7 @@ var LWC = (function (exports) {
|
|
|
7331
7410
|
exports.registerDecorators = registerDecorators;
|
|
7332
7411
|
exports.registerTemplate = registerTemplate;
|
|
7333
7412
|
exports.renderer = renderer;
|
|
7413
|
+
exports.rendererFactory = rendererFactory;
|
|
7334
7414
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
7335
7415
|
exports.setFeatureFlag = setFeatureFlag;
|
|
7336
7416
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|