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
|
@@ -349,7 +349,11 @@
|
|
|
349
349
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
350
350
|
return attributeName;
|
|
351
351
|
}
|
|
352
|
-
/** version: 2.23.
|
|
352
|
+
/** version: 2.23.3 */
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
356
|
+
*/
|
|
353
357
|
|
|
354
358
|
/*
|
|
355
359
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -359,7 +363,7 @@
|
|
|
359
363
|
*/
|
|
360
364
|
|
|
361
365
|
function detect(propName) {
|
|
362
|
-
return
|
|
366
|
+
return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
|
|
363
367
|
}
|
|
364
368
|
/*
|
|
365
369
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -439,6 +443,8 @@
|
|
|
439
443
|
patch$1(propName);
|
|
440
444
|
}
|
|
441
445
|
}
|
|
446
|
+
/** version: 2.23.3 */
|
|
447
|
+
|
|
442
448
|
/**
|
|
443
449
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
444
450
|
*/
|
|
@@ -459,6 +465,7 @@
|
|
|
459
465
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
460
466
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
461
467
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
468
|
+
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
462
469
|
ENABLE_NODE_LIST_PATCH: null,
|
|
463
470
|
ENABLE_NODE_PATCH: null,
|
|
464
471
|
ENABLE_REACTIVE_SETTER: null,
|
|
@@ -471,7 +478,7 @@
|
|
|
471
478
|
});
|
|
472
479
|
}
|
|
473
480
|
|
|
474
|
-
var
|
|
481
|
+
var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
|
|
475
482
|
/**
|
|
476
483
|
* Set the value at runtime of a given feature flag. This method only be invoked once per feature
|
|
477
484
|
* flag. It is meant to be used during the app initialization.
|
|
@@ -499,7 +506,7 @@
|
|
|
499
506
|
|
|
500
507
|
{
|
|
501
508
|
// Disallow the same flag to be set more than once in production
|
|
502
|
-
var runtimeValue =
|
|
509
|
+
var runtimeValue = lwcRuntimeFlags[name];
|
|
503
510
|
|
|
504
511
|
if (!isUndefined$1(runtimeValue)) {
|
|
505
512
|
// eslint-disable-next-line no-console
|
|
@@ -507,7 +514,7 @@
|
|
|
507
514
|
return;
|
|
508
515
|
}
|
|
509
516
|
|
|
510
|
-
defineProperty(
|
|
517
|
+
defineProperty(lwcRuntimeFlags, name, {
|
|
511
518
|
value: value
|
|
512
519
|
});
|
|
513
520
|
}
|
|
@@ -863,8 +870,8 @@
|
|
|
863
870
|
// to inject at runtime.
|
|
864
871
|
|
|
865
872
|
|
|
866
|
-
var HTMLElementConstructor
|
|
867
|
-
var HTMLElementPrototype = HTMLElementConstructor
|
|
873
|
+
var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
|
|
874
|
+
var HTMLElementPrototype = HTMLElementConstructor.prototype;
|
|
868
875
|
/*
|
|
869
876
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
870
877
|
* All rights reserved.
|
|
@@ -2173,7 +2180,7 @@
|
|
|
2173
2180
|
var vm = getAssociatedVM(this);
|
|
2174
2181
|
|
|
2175
2182
|
if (_set2) {
|
|
2176
|
-
if (
|
|
2183
|
+
if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
|
|
2177
2184
|
var ro = vm.oar[key];
|
|
2178
2185
|
|
|
2179
2186
|
if (isUndefined$1(ro)) {
|
|
@@ -2666,7 +2673,7 @@
|
|
|
2666
2673
|
return HTMLBridgeElement;
|
|
2667
2674
|
}
|
|
2668
2675
|
|
|
2669
|
-
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor
|
|
2676
|
+
var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
|
|
2670
2677
|
freeze(BaseBridgeElement);
|
|
2671
2678
|
seal(BaseBridgeElement.prototype);
|
|
2672
2679
|
|
|
@@ -2679,7 +2686,7 @@
|
|
|
2679
2686
|
|
|
2680
2687
|
function swapTemplate(oldTpl, newTpl) {
|
|
2681
2688
|
|
|
2682
|
-
if (!
|
|
2689
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2683
2690
|
throw new Error('HMR is not enabled');
|
|
2684
2691
|
}
|
|
2685
2692
|
|
|
@@ -2688,7 +2695,7 @@
|
|
|
2688
2695
|
|
|
2689
2696
|
function swapComponent(oldComponent, newComponent) {
|
|
2690
2697
|
|
|
2691
|
-
if (!
|
|
2698
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2692
2699
|
throw new Error('HMR is not enabled');
|
|
2693
2700
|
}
|
|
2694
2701
|
|
|
@@ -2697,7 +2704,7 @@
|
|
|
2697
2704
|
|
|
2698
2705
|
function swapStyle(oldStyle, newStyle) {
|
|
2699
2706
|
|
|
2700
|
-
if (!
|
|
2707
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
2701
2708
|
throw new Error('HMR is not enabled');
|
|
2702
2709
|
}
|
|
2703
2710
|
|
|
@@ -3168,6 +3175,12 @@
|
|
|
3168
3175
|
*/
|
|
3169
3176
|
|
|
3170
3177
|
|
|
3178
|
+
function checkHasVM(elm) {
|
|
3179
|
+
var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
3180
|
+
|
|
3181
|
+
return hasVM;
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3171
3184
|
function getUpgradableConstructor(tagName, renderer) {
|
|
3172
3185
|
var getCustomElement = renderer.getCustomElement,
|
|
3173
3186
|
RendererHTMLElement = renderer.HTMLElementExported,
|
|
@@ -3209,6 +3222,20 @@
|
|
|
3209
3222
|
return _createClass(LWCUpgradableElement);
|
|
3210
3223
|
}(RendererHTMLElement);
|
|
3211
3224
|
|
|
3225
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3226
|
+
CE.prototype.connectedCallback = function () {
|
|
3227
|
+
if (checkHasVM(this)) {
|
|
3228
|
+
connectRootElement(this);
|
|
3229
|
+
}
|
|
3230
|
+
};
|
|
3231
|
+
|
|
3232
|
+
CE.prototype.disconnectedCallback = function () {
|
|
3233
|
+
if (checkHasVM(this)) {
|
|
3234
|
+
disconnectRootElement(this);
|
|
3235
|
+
}
|
|
3236
|
+
};
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3212
3239
|
defineCustomElement(tagName, CE);
|
|
3213
3240
|
return CE;
|
|
3214
3241
|
}
|
|
@@ -3320,6 +3347,7 @@
|
|
|
3320
3347
|
// different than the one previously set.
|
|
3321
3348
|
|
|
3322
3349
|
if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
3350
|
+
|
|
3323
3351
|
setProperty(elm, key, cur);
|
|
3324
3352
|
}
|
|
3325
3353
|
}
|
|
@@ -3713,8 +3741,12 @@
|
|
|
3713
3741
|
insertNode(elm, parent, anchor, renderer);
|
|
3714
3742
|
|
|
3715
3743
|
if (vm) {
|
|
3744
|
+
{
|
|
3745
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3716
3746
|
|
|
3717
|
-
|
|
3747
|
+
runConnectedCallback(vm);
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3718
3750
|
}
|
|
3719
3751
|
|
|
3720
3752
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3882,10 +3914,10 @@
|
|
|
3882
3914
|
var scopeToken = getScopeTokenClass(owner);
|
|
3883
3915
|
|
|
3884
3916
|
if (!isNull(scopeToken)) {
|
|
3885
|
-
var
|
|
3917
|
+
var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
|
|
3886
3918
|
// probably we should have a renderer api for just the add operation
|
|
3887
3919
|
|
|
3888
|
-
|
|
3920
|
+
getClassList(elm).add(scopeToken);
|
|
3889
3921
|
} // Set property element for synthetic shadow DOM style scoping.
|
|
3890
3922
|
|
|
3891
3923
|
|
|
@@ -5231,7 +5263,7 @@
|
|
|
5231
5263
|
} else if (isNativeShadowDefined) {
|
|
5232
5264
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
5233
5265
|
// the if-condition.
|
|
5234
|
-
if (
|
|
5266
|
+
if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
5235
5267
|
if (def.shadowSupportMode === "any"
|
|
5236
5268
|
/* ShadowSupportMode.Any */
|
|
5237
5269
|
) {
|
|
@@ -5876,7 +5908,7 @@
|
|
|
5876
5908
|
ArrayPush$1.call(wiredConnecting, function () {
|
|
5877
5909
|
connector.connect();
|
|
5878
5910
|
|
|
5879
|
-
if (!
|
|
5911
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
5880
5912
|
if (hasDynamicParams) {
|
|
5881
5913
|
Promise.resolve().then(computeConfigAndUpdate);
|
|
5882
5914
|
return;
|
|
@@ -6050,6 +6082,8 @@
|
|
|
6050
6082
|
return renderer.nextSibling(hydratedNode);
|
|
6051
6083
|
}
|
|
6052
6084
|
|
|
6085
|
+
var NODE_VALUE_PROP = 'nodeValue';
|
|
6086
|
+
|
|
6053
6087
|
function hydrateText(node, vnode, renderer) {
|
|
6054
6088
|
var _a;
|
|
6055
6089
|
|
|
@@ -6075,7 +6109,7 @@
|
|
|
6075
6109
|
}
|
|
6076
6110
|
|
|
6077
6111
|
var setProperty = renderer.setProperty;
|
|
6078
|
-
setProperty(node,
|
|
6112
|
+
setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6079
6113
|
vnode.elm = node;
|
|
6080
6114
|
return node;
|
|
6081
6115
|
}
|
|
@@ -6107,10 +6141,10 @@
|
|
|
6107
6141
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6108
6142
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6109
6143
|
var props = vnode.data.props;
|
|
6110
|
-
var
|
|
6144
|
+
var getProperty = renderer.getProperty;
|
|
6111
6145
|
|
|
6112
6146
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6113
|
-
if (
|
|
6147
|
+
if (getProperty(elm, 'innerHTML') === props.innerHTML) {
|
|
6114
6148
|
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6115
6149
|
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6116
6150
|
props: cloneAndOmitKey(props, 'innerHTML')
|
|
@@ -6122,8 +6156,8 @@
|
|
|
6122
6156
|
patchElementPropsAndAttrs(vnode, renderer);
|
|
6123
6157
|
|
|
6124
6158
|
if (!isDomManual) {
|
|
6125
|
-
var
|
|
6126
|
-
hydrateChildren(
|
|
6159
|
+
var getFirstChild = renderer.getFirstChild;
|
|
6160
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
|
|
6127
6161
|
}
|
|
6128
6162
|
|
|
6129
6163
|
return elm;
|
|
@@ -6156,10 +6190,10 @@
|
|
|
6156
6190
|
if (vm.renderMode !== 0
|
|
6157
6191
|
/* RenderMode.Light */
|
|
6158
6192
|
) {
|
|
6159
|
-
var
|
|
6193
|
+
var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6160
6194
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6161
6195
|
|
|
6162
|
-
hydrateChildren(
|
|
6196
|
+
hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
|
|
6163
6197
|
}
|
|
6164
6198
|
|
|
6165
6199
|
hydrateVM(vm);
|
|
@@ -6194,11 +6228,11 @@
|
|
|
6194
6228
|
// next node in the list to be hydrated.
|
|
6195
6229
|
|
|
6196
6230
|
|
|
6197
|
-
var
|
|
6231
|
+
var nextSibling = renderer.nextSibling;
|
|
6198
6232
|
|
|
6199
6233
|
do {
|
|
6200
6234
|
var current = nextNode;
|
|
6201
|
-
nextNode =
|
|
6235
|
+
nextNode = nextSibling(nextNode);
|
|
6202
6236
|
removeNode(current, parentNode, renderer);
|
|
6203
6237
|
} while (nextNode);
|
|
6204
6238
|
}
|
|
@@ -6255,9 +6289,8 @@
|
|
|
6255
6289
|
attrValue = _Object$entries$_i[1];
|
|
6256
6290
|
|
|
6257
6291
|
vnode.owner;
|
|
6258
|
-
var
|
|
6259
|
-
|
|
6260
|
-
var elmAttrValue = _getAttribute(elm, attrName);
|
|
6292
|
+
var getAttribute = renderer.getAttribute;
|
|
6293
|
+
var elmAttrValue = getAttribute(elm, attrName);
|
|
6261
6294
|
|
|
6262
6295
|
if (String(attrValue) !== elmAttrValue) {
|
|
6263
6296
|
|
|
@@ -6373,7 +6406,7 @@
|
|
|
6373
6406
|
return false;
|
|
6374
6407
|
}
|
|
6375
6408
|
|
|
6376
|
-
return getProperty(client,
|
|
6409
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6377
6410
|
}
|
|
6378
6411
|
|
|
6379
6412
|
if (getProperty(client, 'nodeType') === 8
|
|
@@ -6385,7 +6418,7 @@
|
|
|
6385
6418
|
return false;
|
|
6386
6419
|
}
|
|
6387
6420
|
|
|
6388
|
-
return getProperty(client,
|
|
6421
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6389
6422
|
}
|
|
6390
6423
|
|
|
6391
6424
|
if (!hasCorrectNodeType(vnode, ssr, 1
|
|
@@ -6457,7 +6490,7 @@
|
|
|
6457
6490
|
|
|
6458
6491
|
return ctor;
|
|
6459
6492
|
}
|
|
6460
|
-
/* version: 2.23.
|
|
6493
|
+
/* version: 2.23.3 */
|
|
6461
6494
|
|
|
6462
6495
|
/*
|
|
6463
6496
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6615,355 +6648,395 @@
|
|
|
6615
6648
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6616
6649
|
*/
|
|
6617
6650
|
|
|
6651
|
+
/**
|
|
6652
|
+
* A factory function that produces a renderer.
|
|
6653
|
+
* Renderer encapsulates operations that are required to render an LWC component into the underlying
|
|
6654
|
+
* runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
|
|
6655
|
+
* Example usage:
|
|
6656
|
+
* import { renderer, rendererFactory } from 'lwc';
|
|
6657
|
+
* const customRenderer = rendererFactory(renderer);
|
|
6658
|
+
*
|
|
6659
|
+
* @param baseRenderer Either null or the base renderer imported from 'lwc'.
|
|
6660
|
+
*/
|
|
6618
6661
|
|
|
6619
|
-
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6620
|
-
var createFragment;
|
|
6621
6662
|
|
|
6622
|
-
|
|
6623
|
-
//
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
}
|
|
6629
|
-
} else {
|
|
6630
|
-
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6631
|
-
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6632
|
-
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6633
|
-
// With other elements added from:
|
|
6634
|
-
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6635
|
-
// Using the test:
|
|
6636
|
-
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6637
|
-
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6638
|
-
var topLevelWrappingMap = {
|
|
6639
|
-
caption: ['table'],
|
|
6640
|
-
col: ['colgroup', 'table'],
|
|
6641
|
-
colgroup: ['table'],
|
|
6642
|
-
option: ['select'],
|
|
6643
|
-
tbody: ['table'],
|
|
6644
|
-
td: ['tr', 'tbody', 'table'],
|
|
6645
|
-
th: ['tr', 'tbody', 'table'],
|
|
6646
|
-
thead: ['table'],
|
|
6647
|
-
tfoot: ['table'],
|
|
6648
|
-
tr: ['tbody', 'table']
|
|
6649
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6650
|
-
|
|
6651
|
-
var getTagName = function getTagName(text) {
|
|
6652
|
-
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6653
|
-
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
createFragment = function createFragment(html) {
|
|
6657
|
-
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6658
|
-
|
|
6659
|
-
if (!isUndefined$1(wrapperTags)) {
|
|
6660
|
-
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6661
|
-
_step5;
|
|
6663
|
+
function rendererFactory(baseRenderer) {
|
|
6664
|
+
// Util functions
|
|
6665
|
+
function assertInvariant(value, msg) {
|
|
6666
|
+
if (!value) {
|
|
6667
|
+
throw new Error("Invariant Violation: ".concat(msg));
|
|
6668
|
+
}
|
|
6669
|
+
}
|
|
6662
6670
|
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6667
|
-
}
|
|
6668
|
-
} catch (err) {
|
|
6669
|
-
_iterator5.e(err);
|
|
6670
|
-
} finally {
|
|
6671
|
-
_iterator5.f();
|
|
6672
|
-
}
|
|
6673
|
-
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6674
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6671
|
+
function isNull(obj) {
|
|
6672
|
+
return obj === null;
|
|
6673
|
+
}
|
|
6675
6674
|
|
|
6675
|
+
function isUndefined(obj) {
|
|
6676
|
+
return obj === undefined;
|
|
6677
|
+
}
|
|
6676
6678
|
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6679
|
+
var getCustomElement;
|
|
6680
|
+
var defineCustomElement;
|
|
6681
|
+
var HTMLElementConstructor;
|
|
6680
6682
|
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
}
|
|
6683
|
+
function isCustomElementRegistryAvailable() {
|
|
6684
|
+
if (typeof customElements === 'undefined') {
|
|
6685
|
+
return false;
|
|
6685
6686
|
}
|
|
6686
6687
|
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
*/
|
|
6688
|
+
try {
|
|
6689
|
+
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
6690
|
+
// _wrapNativeSuper()
|
|
6691
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
6692
|
+
// get wrapped by babel.
|
|
6693
|
+
var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
|
|
6694
|
+
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
6695
|
+
// which are not equipped to be initialized that way.
|
|
6696
6696
|
|
|
6697
|
+
var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
|
|
6698
|
+
_inherits(clazz, _HTMLElementAlias);
|
|
6697
6699
|
|
|
6698
|
-
|
|
6699
|
-
var defineCustomElement;
|
|
6700
|
-
var HTMLElementConstructor;
|
|
6700
|
+
var _super7 = _createSuper(clazz);
|
|
6701
6701
|
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6702
|
+
function clazz() {
|
|
6703
|
+
_classCallCheck(this, clazz);
|
|
6704
|
+
|
|
6705
|
+
return _super7.apply(this, arguments);
|
|
6706
|
+
}
|
|
6707
|
+
|
|
6708
|
+
return _createClass(clazz);
|
|
6709
|
+
}(HTMLElementAlias);
|
|
6710
|
+
|
|
6711
|
+
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
6712
|
+
new clazz();
|
|
6713
|
+
return true;
|
|
6714
|
+
} catch (_a) {
|
|
6715
|
+
return false;
|
|
6716
|
+
}
|
|
6705
6717
|
}
|
|
6706
6718
|
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
var
|
|
6713
|
-
|
|
6714
|
-
// which are not equipped to be initialized that way.
|
|
6719
|
+
if (isCustomElementRegistryAvailable()) {
|
|
6720
|
+
getCustomElement = customElements.get.bind(customElements);
|
|
6721
|
+
defineCustomElement = customElements.define.bind(customElements);
|
|
6722
|
+
HTMLElementConstructor = HTMLElement;
|
|
6723
|
+
} else {
|
|
6724
|
+
var registry = Object.create(null);
|
|
6725
|
+
var reverseRegistry = new WeakMap();
|
|
6715
6726
|
|
|
6716
|
-
|
|
6717
|
-
|
|
6727
|
+
defineCustomElement = function define(name, ctor) {
|
|
6728
|
+
if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
|
|
6729
|
+
throw new TypeError("Invalid Registration");
|
|
6730
|
+
}
|
|
6718
6731
|
|
|
6719
|
-
|
|
6732
|
+
registry[name] = ctor;
|
|
6733
|
+
reverseRegistry.set(ctor, name);
|
|
6734
|
+
};
|
|
6720
6735
|
|
|
6721
|
-
|
|
6722
|
-
|
|
6736
|
+
getCustomElement = function get(name) {
|
|
6737
|
+
return registry[name];
|
|
6738
|
+
};
|
|
6723
6739
|
|
|
6724
|
-
|
|
6740
|
+
HTMLElementConstructor = function HTMLElement() {
|
|
6741
|
+
if (!(this instanceof HTMLElement)) {
|
|
6742
|
+
throw new TypeError("Invalid Invocation");
|
|
6725
6743
|
}
|
|
6726
6744
|
|
|
6727
|
-
|
|
6728
|
-
|
|
6745
|
+
var constructor = this.constructor;
|
|
6746
|
+
var name = reverseRegistry.get(constructor);
|
|
6729
6747
|
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6748
|
+
if (!name) {
|
|
6749
|
+
throw new TypeError("Invalid Construction");
|
|
6750
|
+
}
|
|
6751
|
+
|
|
6752
|
+
var elm = document.createElement(name);
|
|
6753
|
+
Object.setPrototypeOf(elm, constructor.prototype);
|
|
6754
|
+
return elm;
|
|
6755
|
+
};
|
|
6756
|
+
|
|
6757
|
+
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
6735
6758
|
}
|
|
6736
|
-
}
|
|
6737
6759
|
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
HTMLElementConstructor = HTMLElement;
|
|
6742
|
-
} else {
|
|
6743
|
-
var registry = create(null);
|
|
6744
|
-
var reverseRegistry = new WeakMap();
|
|
6760
|
+
function cloneNode(node, deep) {
|
|
6761
|
+
return node.cloneNode(deep);
|
|
6762
|
+
}
|
|
6745
6763
|
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
}
|
|
6764
|
+
function createElement(tagName, namespace) {
|
|
6765
|
+
return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
|
|
6766
|
+
}
|
|
6750
6767
|
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
}
|
|
6768
|
+
function createText(content) {
|
|
6769
|
+
return document.createTextNode(content);
|
|
6770
|
+
}
|
|
6754
6771
|
|
|
6755
|
-
|
|
6756
|
-
return
|
|
6757
|
-
}
|
|
6772
|
+
function createComment(content) {
|
|
6773
|
+
return document.createComment(content);
|
|
6774
|
+
}
|
|
6758
6775
|
|
|
6759
|
-
|
|
6760
|
-
if (!(this instanceof HTMLElement)) {
|
|
6761
|
-
throw new TypeError("Invalid Invocation");
|
|
6762
|
-
}
|
|
6776
|
+
var createFragment; // IE11 lacks support for this feature
|
|
6763
6777
|
|
|
6764
|
-
|
|
6765
|
-
var name = reverseRegistry.get(constructor);
|
|
6778
|
+
var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
6766
6779
|
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6780
|
+
if (SUPPORTS_TEMPLATE) {
|
|
6781
|
+
// Parse the fragment HTML string into DOM
|
|
6782
|
+
createFragment = function createFragment(html) {
|
|
6783
|
+
var template = document.createElement('template');
|
|
6784
|
+
template.innerHTML = html;
|
|
6785
|
+
return template.content.firstChild;
|
|
6786
|
+
};
|
|
6787
|
+
} else {
|
|
6788
|
+
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
6789
|
+
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
6790
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
6791
|
+
// With other elements added from:
|
|
6792
|
+
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
6793
|
+
// Using the test:
|
|
6794
|
+
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
6795
|
+
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
6796
|
+
var topLevelWrappingMap = {
|
|
6797
|
+
caption: ['table'],
|
|
6798
|
+
col: ['colgroup', 'table'],
|
|
6799
|
+
colgroup: ['table'],
|
|
6800
|
+
option: ['select'],
|
|
6801
|
+
tbody: ['table'],
|
|
6802
|
+
td: ['tr', 'tbody', 'table'],
|
|
6803
|
+
th: ['tr', 'tbody', 'table'],
|
|
6804
|
+
thead: ['table'],
|
|
6805
|
+
tfoot: ['table'],
|
|
6806
|
+
tr: ['tbody', 'table']
|
|
6807
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
6808
|
+
|
|
6809
|
+
var getTagName = function getTagName(text) {
|
|
6810
|
+
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
6811
|
+
}; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
6812
|
+
|
|
6813
|
+
|
|
6814
|
+
createFragment = function createFragment(html) {
|
|
6815
|
+
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6816
|
+
|
|
6817
|
+
if (!isUndefined(wrapperTags)) {
|
|
6818
|
+
var _iterator5 = _createForOfIteratorHelper(wrapperTags),
|
|
6819
|
+
_step5;
|
|
6820
|
+
|
|
6821
|
+
try {
|
|
6822
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
6823
|
+
var wrapperTag = _step5.value;
|
|
6824
|
+
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6825
|
+
}
|
|
6826
|
+
} catch (err) {
|
|
6827
|
+
_iterator5.e(err);
|
|
6828
|
+
} finally {
|
|
6829
|
+
_iterator5.f();
|
|
6830
|
+
}
|
|
6831
|
+
} // For IE11, the document title must not be undefined, but it can be an empty string
|
|
6832
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
6770
6833
|
|
|
6771
|
-
var elm = document.createElement(name);
|
|
6772
|
-
setPrototypeOf(elm, constructor.prototype);
|
|
6773
|
-
return elm;
|
|
6774
|
-
};
|
|
6775
6834
|
|
|
6776
|
-
|
|
6777
|
-
|
|
6835
|
+
var doc = document.implementation.createHTMLDocument('');
|
|
6836
|
+
doc.body.innerHTML = html;
|
|
6837
|
+
var content = doc.body;
|
|
6778
6838
|
|
|
6779
|
-
|
|
6780
|
-
|
|
6839
|
+
if (!isUndefined(wrapperTags)) {
|
|
6840
|
+
for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
|
|
6841
|
+
content = content.firstChild;
|
|
6842
|
+
}
|
|
6843
|
+
}
|
|
6781
6844
|
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6845
|
+
return content.firstChild;
|
|
6846
|
+
};
|
|
6847
|
+
}
|
|
6785
6848
|
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6849
|
+
function insert(node, parent, anchor) {
|
|
6850
|
+
parent.insertBefore(node, anchor);
|
|
6851
|
+
}
|
|
6789
6852
|
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6853
|
+
function remove(node, parent) {
|
|
6854
|
+
parent.removeChild(node);
|
|
6855
|
+
}
|
|
6793
6856
|
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6857
|
+
function nextSibling(node) {
|
|
6858
|
+
return node.nextSibling;
|
|
6859
|
+
}
|
|
6797
6860
|
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6861
|
+
function attachShadow(element, options) {
|
|
6862
|
+
// `shadowRoot` will be non-null in two cases:
|
|
6863
|
+
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
6864
|
+
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
6865
|
+
// root component with customElement.define('c-app', Ctor)
|
|
6866
|
+
if (!isNull(element.shadowRoot)) {
|
|
6867
|
+
return element.shadowRoot;
|
|
6868
|
+
}
|
|
6801
6869
|
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
}
|
|
6870
|
+
return element.attachShadow(options);
|
|
6871
|
+
}
|
|
6805
6872
|
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6873
|
+
function setText(node, content) {
|
|
6874
|
+
node.nodeValue = content;
|
|
6875
|
+
}
|
|
6809
6876
|
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
6813
|
-
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
6814
|
-
// root component with customElement.define('c-app', Ctor)
|
|
6815
|
-
if (!isNull(element.shadowRoot)) {
|
|
6816
|
-
return element.shadowRoot;
|
|
6877
|
+
function getProperty(node, key) {
|
|
6878
|
+
return node[key];
|
|
6817
6879
|
}
|
|
6818
6880
|
|
|
6819
|
-
|
|
6820
|
-
|
|
6881
|
+
function setProperty(node, key, value) {
|
|
6882
|
+
node[key] = value;
|
|
6883
|
+
}
|
|
6821
6884
|
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6885
|
+
function getAttribute(element, name, namespace) {
|
|
6886
|
+
return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
|
|
6887
|
+
}
|
|
6825
6888
|
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6889
|
+
function setAttribute(element, name, value, namespace) {
|
|
6890
|
+
return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
|
|
6891
|
+
}
|
|
6829
6892
|
|
|
6830
|
-
|
|
6893
|
+
function removeAttribute(element, name, namespace) {
|
|
6894
|
+
if (isUndefined(namespace)) {
|
|
6895
|
+
element.removeAttribute(name);
|
|
6896
|
+
} else {
|
|
6897
|
+
element.removeAttributeNS(namespace, name);
|
|
6898
|
+
}
|
|
6899
|
+
}
|
|
6831
6900
|
|
|
6832
|
-
|
|
6833
|
-
|
|
6901
|
+
function addEventListener(target, type, callback, options) {
|
|
6902
|
+
target.addEventListener(type, callback, options);
|
|
6903
|
+
}
|
|
6834
6904
|
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6905
|
+
function removeEventListener(target, type, callback, options) {
|
|
6906
|
+
target.removeEventListener(type, callback, options);
|
|
6907
|
+
}
|
|
6838
6908
|
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6909
|
+
function dispatchEvent(target, event) {
|
|
6910
|
+
return target.dispatchEvent(event);
|
|
6911
|
+
}
|
|
6842
6912
|
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
element.removeAttribute(name);
|
|
6846
|
-
} else {
|
|
6847
|
-
element.removeAttributeNS(namespace, name);
|
|
6913
|
+
function getClassList(element) {
|
|
6914
|
+
return element.classList;
|
|
6848
6915
|
}
|
|
6849
|
-
}
|
|
6850
6916
|
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6917
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
6918
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
6919
|
+
// represent elements in the engine?
|
|
6920
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6921
|
+
}
|
|
6854
6922
|
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6923
|
+
function getBoundingClientRect(element) {
|
|
6924
|
+
return element.getBoundingClientRect();
|
|
6925
|
+
}
|
|
6858
6926
|
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6927
|
+
function querySelector(element, selectors) {
|
|
6928
|
+
return element.querySelector(selectors);
|
|
6929
|
+
}
|
|
6862
6930
|
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6931
|
+
function querySelectorAll(element, selectors) {
|
|
6932
|
+
return element.querySelectorAll(selectors);
|
|
6933
|
+
}
|
|
6866
6934
|
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
6871
|
-
}
|
|
6935
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
6936
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
6937
|
+
}
|
|
6872
6938
|
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6939
|
+
function getElementsByClassName(element, names) {
|
|
6940
|
+
return element.getElementsByClassName(names);
|
|
6941
|
+
}
|
|
6876
6942
|
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6943
|
+
function getChildren(element) {
|
|
6944
|
+
return element.children;
|
|
6945
|
+
}
|
|
6880
6946
|
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6947
|
+
function getChildNodes(element) {
|
|
6948
|
+
return element.childNodes;
|
|
6949
|
+
}
|
|
6884
6950
|
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6951
|
+
function getFirstChild(element) {
|
|
6952
|
+
return element.firstChild;
|
|
6953
|
+
}
|
|
6888
6954
|
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6955
|
+
function getFirstElementChild(element) {
|
|
6956
|
+
return element.firstElementChild;
|
|
6957
|
+
}
|
|
6892
6958
|
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6959
|
+
function getLastChild(element) {
|
|
6960
|
+
return element.lastChild;
|
|
6961
|
+
}
|
|
6896
6962
|
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6963
|
+
function getLastElementChild(element) {
|
|
6964
|
+
return element.lastElementChild;
|
|
6965
|
+
}
|
|
6900
6966
|
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6967
|
+
function isConnected(node) {
|
|
6968
|
+
return node.isConnected;
|
|
6969
|
+
}
|
|
6904
6970
|
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6971
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6972
|
+
assertInvariant(elm instanceof HTMLElement, msg);
|
|
6973
|
+
}
|
|
6908
6974
|
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6975
|
+
var HTMLElementExported = HTMLElementConstructor;
|
|
6976
|
+
var renderer = {
|
|
6977
|
+
HTMLElementExported: HTMLElementExported,
|
|
6978
|
+
insert: insert,
|
|
6979
|
+
remove: remove,
|
|
6980
|
+
cloneNode: cloneNode,
|
|
6981
|
+
createFragment: createFragment,
|
|
6982
|
+
createElement: createElement,
|
|
6983
|
+
createText: createText,
|
|
6984
|
+
createComment: createComment,
|
|
6985
|
+
nextSibling: nextSibling,
|
|
6986
|
+
attachShadow: attachShadow,
|
|
6987
|
+
getProperty: getProperty,
|
|
6988
|
+
setProperty: setProperty,
|
|
6989
|
+
setText: setText,
|
|
6990
|
+
getAttribute: getAttribute,
|
|
6991
|
+
setAttribute: setAttribute,
|
|
6992
|
+
removeAttribute: removeAttribute,
|
|
6993
|
+
addEventListener: addEventListener,
|
|
6994
|
+
removeEventListener: removeEventListener,
|
|
6995
|
+
dispatchEvent: dispatchEvent,
|
|
6996
|
+
getClassList: getClassList,
|
|
6997
|
+
setCSSStyleProperty: setCSSStyleProperty,
|
|
6998
|
+
getBoundingClientRect: getBoundingClientRect,
|
|
6999
|
+
querySelector: querySelector,
|
|
7000
|
+
querySelectorAll: querySelectorAll,
|
|
7001
|
+
getElementsByTagName: getElementsByTagName,
|
|
7002
|
+
getElementsByClassName: getElementsByClassName,
|
|
7003
|
+
getChildren: getChildren,
|
|
7004
|
+
getChildNodes: getChildNodes,
|
|
7005
|
+
getFirstChild: getFirstChild,
|
|
7006
|
+
getFirstElementChild: getFirstElementChild,
|
|
7007
|
+
getLastChild: getLastChild,
|
|
7008
|
+
getLastElementChild: getLastElementChild,
|
|
7009
|
+
isConnected: isConnected,
|
|
7010
|
+
assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
|
|
7011
|
+
defineCustomElement: defineCustomElement,
|
|
7012
|
+
getCustomElement: getCustomElement
|
|
7013
|
+
}; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
|
|
6912
7014
|
|
|
6913
|
-
|
|
6914
|
-
return
|
|
7015
|
+
Object.setPrototypeOf(renderer, baseRenderer);
|
|
7016
|
+
return renderer;
|
|
6915
7017
|
}
|
|
7018
|
+
/*
|
|
7019
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
7020
|
+
* All rights reserved.
|
|
7021
|
+
* SPDX-License-Identifier: MIT
|
|
7022
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7023
|
+
*/
|
|
6916
7024
|
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
7025
|
+
/**
|
|
7026
|
+
* The base renderer that will be used by engine-core.
|
|
7027
|
+
* This will be used for DOM operations when lwc is running in a browser environment.
|
|
7028
|
+
*/
|
|
6920
7029
|
|
|
6921
|
-
function assertInstanceOfHTMLElement(elm, msg) {
|
|
6922
|
-
assert.invariant(elm instanceof HTMLElement, msg);
|
|
6923
|
-
}
|
|
6924
7030
|
|
|
6925
|
-
var
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
insert: insert,
|
|
6931
|
-
remove: remove,
|
|
6932
|
-
cloneNode: cloneNode,
|
|
6933
|
-
createFragment: createFragment,
|
|
6934
|
-
createElement: createElement$1,
|
|
6935
|
-
createText: createText,
|
|
6936
|
-
createComment: createComment,
|
|
6937
|
-
nextSibling: nextSibling,
|
|
6938
|
-
attachShadow: attachShadow,
|
|
6939
|
-
getProperty: getProperty,
|
|
6940
|
-
setProperty: setProperty,
|
|
6941
|
-
setText: setText,
|
|
6942
|
-
getAttribute: getAttribute,
|
|
6943
|
-
setAttribute: setAttribute,
|
|
6944
|
-
removeAttribute: removeAttribute,
|
|
6945
|
-
addEventListener: addEventListener,
|
|
6946
|
-
removeEventListener: removeEventListener,
|
|
6947
|
-
dispatchEvent: dispatchEvent,
|
|
6948
|
-
getClassList: getClassList,
|
|
6949
|
-
setCSSStyleProperty: setCSSStyleProperty,
|
|
6950
|
-
getBoundingClientRect: getBoundingClientRect,
|
|
6951
|
-
querySelector: querySelector,
|
|
6952
|
-
querySelectorAll: querySelectorAll,
|
|
6953
|
-
getElementsByTagName: getElementsByTagName,
|
|
6954
|
-
getElementsByClassName: getElementsByClassName,
|
|
6955
|
-
getChildren: getChildren,
|
|
6956
|
-
getChildNodes: getChildNodes,
|
|
6957
|
-
getFirstChild: getFirstChild,
|
|
6958
|
-
getFirstElementChild: getFirstElementChild,
|
|
6959
|
-
getLastChild: getLastChild,
|
|
6960
|
-
getLastElementChild: getLastElementChild,
|
|
6961
|
-
isConnected: isConnected,
|
|
7031
|
+
var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
|
|
7032
|
+
// shared across renderers
|
|
7033
|
+
rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
|
|
7034
|
+
{
|
|
7035
|
+
// insertStyleSheet implementation shares a global cache of stylesheet data
|
|
6962
7036
|
insertStylesheet: insertStylesheet,
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
};
|
|
7037
|
+
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
7038
|
+
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
|
|
7039
|
+
});
|
|
6967
7040
|
/*
|
|
6968
7041
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6969
7042
|
* All rights reserved.
|
|
@@ -7131,7 +7204,6 @@
|
|
|
7131
7204
|
* SPDX-License-Identifier: MIT
|
|
7132
7205
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7133
7206
|
*/
|
|
7134
|
-
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7135
7207
|
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7136
7208
|
|
|
7137
7209
|
|
|
@@ -7148,39 +7220,41 @@
|
|
|
7148
7220
|
}
|
|
7149
7221
|
|
|
7150
7222
|
return node; // for convenience
|
|
7151
|
-
}
|
|
7152
|
-
// created via createElement.
|
|
7153
|
-
|
|
7223
|
+
}
|
|
7154
7224
|
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7225
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7226
|
+
// Monkey patching Node methods to be able to detect the insertions and removal of root elements
|
|
7227
|
+
// created via createElement.
|
|
7228
|
+
var _Node$1$prototype = _Node$1.prototype,
|
|
7229
|
+
_appendChild = _Node$1$prototype.appendChild,
|
|
7230
|
+
_insertBefore = _Node$1$prototype.insertBefore,
|
|
7231
|
+
_removeChild = _Node$1$prototype.removeChild,
|
|
7232
|
+
_replaceChild = _Node$1$prototype.replaceChild;
|
|
7233
|
+
assign(_Node$1.prototype, {
|
|
7234
|
+
appendChild: function appendChild(newChild) {
|
|
7235
|
+
var appendedNode = _appendChild.call(this, newChild);
|
|
7163
7236
|
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7237
|
+
return callNodeSlot(appendedNode, ConnectingSlot);
|
|
7238
|
+
},
|
|
7239
|
+
insertBefore: function insertBefore(newChild, referenceNode) {
|
|
7240
|
+
var insertedNode = _insertBefore.call(this, newChild, referenceNode);
|
|
7168
7241
|
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7242
|
+
return callNodeSlot(insertedNode, ConnectingSlot);
|
|
7243
|
+
},
|
|
7244
|
+
removeChild: function removeChild(oldChild) {
|
|
7245
|
+
var removedNode = _removeChild.call(this, oldChild);
|
|
7173
7246
|
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7247
|
+
return callNodeSlot(removedNode, DisconnectingSlot);
|
|
7248
|
+
},
|
|
7249
|
+
replaceChild: function replaceChild(newChild, oldChild) {
|
|
7250
|
+
var replacedNode = _replaceChild.call(this, newChild, oldChild);
|
|
7178
7251
|
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7252
|
+
callNodeSlot(replacedNode, DisconnectingSlot);
|
|
7253
|
+
callNodeSlot(newChild, ConnectingSlot);
|
|
7254
|
+
return replacedNode;
|
|
7255
|
+
}
|
|
7256
|
+
});
|
|
7257
|
+
}
|
|
7184
7258
|
/**
|
|
7185
7259
|
* EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
|
|
7186
7260
|
* difference that in the options, you can pass the `is` property set to a Constructor instead of
|
|
@@ -7193,6 +7267,7 @@
|
|
|
7193
7267
|
* ```
|
|
7194
7268
|
*/
|
|
7195
7269
|
|
|
7270
|
+
|
|
7196
7271
|
function createElement(sel, options) {
|
|
7197
7272
|
if (!isObject(options) || isNull(options)) {
|
|
7198
7273
|
throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
|
|
@@ -7220,8 +7295,12 @@
|
|
|
7220
7295
|
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
7221
7296
|
owner: null
|
|
7222
7297
|
});
|
|
7223
|
-
|
|
7224
|
-
|
|
7298
|
+
|
|
7299
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7300
|
+
ConnectingSlot.set(elm, connectRootElement);
|
|
7301
|
+
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
7302
|
+
}
|
|
7303
|
+
|
|
7225
7304
|
wasComponentUpgraded = true;
|
|
7226
7305
|
});
|
|
7227
7306
|
|
|
@@ -7268,7 +7347,7 @@
|
|
|
7268
7347
|
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
7269
7348
|
|
|
7270
7349
|
|
|
7271
|
-
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7350
|
+
return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7272
7351
|
}
|
|
7273
7352
|
/*
|
|
7274
7353
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7312,7 +7391,7 @@
|
|
|
7312
7391
|
});
|
|
7313
7392
|
freeze(LightningElement);
|
|
7314
7393
|
seal(LightningElement.prototype);
|
|
7315
|
-
/* version: 2.23.
|
|
7394
|
+
/* version: 2.23.3 */
|
|
7316
7395
|
|
|
7317
7396
|
exports.LightningElement = LightningElement;
|
|
7318
7397
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -7334,6 +7413,7 @@
|
|
|
7334
7413
|
exports.registerDecorators = registerDecorators;
|
|
7335
7414
|
exports.registerTemplate = registerTemplate;
|
|
7336
7415
|
exports.renderer = renderer;
|
|
7416
|
+
exports.rendererFactory = rendererFactory;
|
|
7337
7417
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
7338
7418
|
exports.setFeatureFlag = setFeatureFlag;
|
|
7339
7419
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|