lwc 2.25.1 → 2.26.0
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 +885 -411
- package/dist/engine-dom/iife/es2017/engine-dom.js +885 -411
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +731 -205
- package/dist/engine-dom/iife/es5/engine-dom.js +954 -311
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +883 -224
- package/dist/engine-dom/umd/es2017/engine-dom.js +885 -411
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +731 -205
- package/dist/engine-dom/umd/es5/engine-dom.js +954 -311
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +883 -224
- package/dist/engine-server/commonjs/es2017/engine-server.js +133 -227
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +133 -227
- 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
|
@@ -436,9 +436,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
436
436
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
437
437
|
*/
|
|
438
438
|
// Increment whenever the LWC template compiler changes
|
|
439
|
-
const LWC_VERSION = "2.
|
|
439
|
+
const LWC_VERSION = "2.26.0";
|
|
440
440
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
441
|
-
/** version: 2.
|
|
441
|
+
/** version: 2.26.0 */
|
|
442
442
|
|
|
443
443
|
/*
|
|
444
444
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -486,7 +486,6 @@ const features = {
|
|
|
486
486
|
DUMMY_TEST_FLAG: null,
|
|
487
487
|
ENABLE_ELEMENT_PATCH: null,
|
|
488
488
|
ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
|
|
489
|
-
ENABLE_HMR: null,
|
|
490
489
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
491
490
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
492
491
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
@@ -497,6 +496,7 @@ const features = {
|
|
|
497
496
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
498
497
|
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
499
498
|
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
|
|
499
|
+
ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY: null,
|
|
500
500
|
};
|
|
501
501
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
502
502
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
@@ -550,7 +550,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
550
550
|
setFeatureFlag(name, value);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
/** version: 2.
|
|
553
|
+
/** version: 2.26.0 */
|
|
554
554
|
|
|
555
555
|
/* proxy-compat-disable */
|
|
556
556
|
|
|
@@ -1859,7 +1859,9 @@ const refsCache = new WeakMap();
|
|
|
1859
1859
|
const LightningElement = function () {
|
|
1860
1860
|
// This should be as performant as possible, while any initialization should be done lazily
|
|
1861
1861
|
if (isNull(vmBeingConstructed)) {
|
|
1862
|
-
|
|
1862
|
+
// Thrown when doing something like `new LightningElement()` or
|
|
1863
|
+
// `class Foo extends LightningElement {}; new Foo()`
|
|
1864
|
+
throw new TypeError('Illegal constructor');
|
|
1863
1865
|
}
|
|
1864
1866
|
const vm = vmBeingConstructed;
|
|
1865
1867
|
const { def, elm } = vm;
|
|
@@ -2880,157 +2882,120 @@ const swappedStyleMap = new WeakMap();
|
|
|
2880
2882
|
const activeTemplates = new WeakMap();
|
|
2881
2883
|
const activeComponents = new WeakMap();
|
|
2882
2884
|
const activeStyles = new WeakMap();
|
|
2883
|
-
|
|
2884
2885
|
function getTemplateOrSwappedTemplate(tpl) {
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2886
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2887
|
+
// this method should never leak to prod
|
|
2888
|
+
throw new ReferenceError();
|
|
2889
|
+
}
|
|
2891
2890
|
const visited = new Set();
|
|
2892
|
-
|
|
2893
2891
|
while (swappedTemplateMap.has(tpl) && !visited.has(tpl)) {
|
|
2894
|
-
|
|
2895
|
-
|
|
2892
|
+
visited.add(tpl);
|
|
2893
|
+
tpl = swappedTemplateMap.get(tpl);
|
|
2896
2894
|
}
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
return tpl;
|
|
2895
|
+
return tpl;
|
|
2900
2896
|
}
|
|
2901
2897
|
function getComponentOrSwappedComponent(Ctor) {
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2898
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2899
|
+
// this method should never leak to prod
|
|
2900
|
+
throw new ReferenceError();
|
|
2901
|
+
}
|
|
2908
2902
|
const visited = new Set();
|
|
2909
|
-
|
|
2910
2903
|
while (swappedComponentMap.has(Ctor) && !visited.has(Ctor)) {
|
|
2911
|
-
|
|
2912
|
-
|
|
2904
|
+
visited.add(Ctor);
|
|
2905
|
+
Ctor = swappedComponentMap.get(Ctor);
|
|
2913
2906
|
}
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
return Ctor;
|
|
2907
|
+
return Ctor;
|
|
2917
2908
|
}
|
|
2918
2909
|
function getStyleOrSwappedStyle(style) {
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2910
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2911
|
+
// this method should never leak to prod
|
|
2912
|
+
throw new ReferenceError();
|
|
2913
|
+
}
|
|
2925
2914
|
const visited = new Set();
|
|
2926
|
-
|
|
2927
2915
|
while (swappedStyleMap.has(style) && !visited.has(style)) {
|
|
2928
|
-
|
|
2929
|
-
|
|
2916
|
+
visited.add(style);
|
|
2917
|
+
style = swappedStyleMap.get(style);
|
|
2930
2918
|
}
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
return style;
|
|
2919
|
+
return style;
|
|
2934
2920
|
}
|
|
2935
2921
|
function setActiveVM(vm) {
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2922
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2923
|
+
// this method should never leak to prod
|
|
2924
|
+
throw new ReferenceError();
|
|
2925
|
+
}
|
|
2942
2926
|
// tracking active component
|
|
2943
2927
|
const Ctor = vm.def.ctor;
|
|
2944
2928
|
let componentVMs = activeComponents.get(Ctor);
|
|
2945
|
-
|
|
2946
2929
|
if (isUndefined$1(componentVMs)) {
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2930
|
+
componentVMs = new Set();
|
|
2931
|
+
activeComponents.set(Ctor, componentVMs);
|
|
2932
|
+
}
|
|
2933
|
+
// this will allow us to keep track of the hot components
|
|
2934
|
+
componentVMs.add(vm);
|
|
2935
|
+
// tracking active template
|
|
2954
2936
|
const tpl = vm.cmpTemplate;
|
|
2955
|
-
|
|
2956
2937
|
if (tpl) {
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
stylesheetVMs.add(vm);
|
|
2987
|
-
});
|
|
2988
|
-
}
|
|
2938
|
+
let templateVMs = activeTemplates.get(tpl);
|
|
2939
|
+
if (isUndefined$1(templateVMs)) {
|
|
2940
|
+
templateVMs = new Set();
|
|
2941
|
+
activeTemplates.set(tpl, templateVMs);
|
|
2942
|
+
}
|
|
2943
|
+
// this will allow us to keep track of the templates that are
|
|
2944
|
+
// being used by a hot component
|
|
2945
|
+
templateVMs.add(vm);
|
|
2946
|
+
// tracking active styles associated to template
|
|
2947
|
+
const stylesheets = tpl.stylesheets;
|
|
2948
|
+
if (!isUndefined$1(stylesheets)) {
|
|
2949
|
+
flattenStylesheets(stylesheets).forEach((stylesheet) => {
|
|
2950
|
+
// this is necessary because we don't hold the list of styles
|
|
2951
|
+
// in the vm, we only hold the selected (already swapped template)
|
|
2952
|
+
// but the styles attached to the template might not be the actual
|
|
2953
|
+
// active ones, but the swapped versions of those.
|
|
2954
|
+
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
2955
|
+
let stylesheetVMs = activeStyles.get(stylesheet);
|
|
2956
|
+
if (isUndefined$1(stylesheetVMs)) {
|
|
2957
|
+
stylesheetVMs = new Set();
|
|
2958
|
+
activeStyles.set(stylesheet, stylesheetVMs);
|
|
2959
|
+
}
|
|
2960
|
+
// this will allow us to keep track of the stylesheet that are
|
|
2961
|
+
// being used by a hot component
|
|
2962
|
+
stylesheetVMs.add(vm);
|
|
2963
|
+
});
|
|
2964
|
+
}
|
|
2989
2965
|
}
|
|
2990
|
-
}
|
|
2991
2966
|
}
|
|
2992
2967
|
function removeActiveVM(vm) {
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2968
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2969
|
+
// this method should never leak to prod
|
|
2970
|
+
throw new ReferenceError();
|
|
2971
|
+
}
|
|
2999
2972
|
// tracking inactive component
|
|
3000
2973
|
const Ctor = vm.def.ctor;
|
|
3001
2974
|
let list = activeComponents.get(Ctor);
|
|
3002
|
-
|
|
3003
2975
|
if (!isUndefined$1(list)) {
|
|
3004
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3005
|
-
list.delete(vm);
|
|
3006
|
-
} // removing inactive template
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
const tpl = vm.cmpTemplate;
|
|
3010
|
-
|
|
3011
|
-
if (tpl) {
|
|
3012
|
-
list = activeTemplates.get(tpl);
|
|
3013
|
-
|
|
3014
|
-
if (!isUndefined$1(list)) {
|
|
3015
2976
|
// deleting the vm from the set to avoid leaking memory
|
|
3016
2977
|
list.delete(vm);
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
flattenStylesheets(styles).forEach(style => {
|
|
3024
|
-
list = activeStyles.get(style);
|
|
3025
|
-
|
|
3026
|
-
if (!isUndefined$1(list)) {
|
|
2978
|
+
}
|
|
2979
|
+
// removing inactive template
|
|
2980
|
+
const tpl = vm.cmpTemplate;
|
|
2981
|
+
if (tpl) {
|
|
2982
|
+
list = activeTemplates.get(tpl);
|
|
2983
|
+
if (!isUndefined$1(list)) {
|
|
3027
2984
|
// deleting the vm from the set to avoid leaking memory
|
|
3028
2985
|
list.delete(vm);
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
2986
|
+
}
|
|
2987
|
+
// removing active styles associated to template
|
|
2988
|
+
const styles = tpl.stylesheets;
|
|
2989
|
+
if (!isUndefined$1(styles)) {
|
|
2990
|
+
flattenStylesheets(styles).forEach((style) => {
|
|
2991
|
+
list = activeStyles.get(style);
|
|
2992
|
+
if (!isUndefined$1(list)) {
|
|
2993
|
+
// deleting the vm from the set to avoid leaking memory
|
|
2994
|
+
list.delete(vm);
|
|
2995
|
+
}
|
|
2996
|
+
});
|
|
2997
|
+
}
|
|
3032
2998
|
}
|
|
3033
|
-
}
|
|
3034
2999
|
}
|
|
3035
3000
|
|
|
3036
3001
|
/*
|
|
@@ -3463,75 +3428,6 @@ function createStylesheet(vm, stylesheets) {
|
|
|
3463
3428
|
return null;
|
|
3464
3429
|
}
|
|
3465
3430
|
|
|
3466
|
-
/*
|
|
3467
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
3468
|
-
* All rights reserved.
|
|
3469
|
-
* SPDX-License-Identifier: MIT
|
|
3470
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3471
|
-
*/
|
|
3472
|
-
|
|
3473
|
-
function checkHasVM(elm) {
|
|
3474
|
-
const hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
3475
|
-
|
|
3476
|
-
if (process.env.NODE_ENV !== 'production' && !hasVM) {
|
|
3477
|
-
// Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
|
|
3478
|
-
// we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
|
|
3479
|
-
logError(`VM for tag name "${elm.tagName.toLowerCase()}" is undefined. ` + `This indicates that an element was created with this tag name, ` + `which is already reserved by an LWC component. Use lwc.createElement ` + `instead to create elements.`);
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
|
-
return hasVM;
|
|
3483
|
-
}
|
|
3484
|
-
|
|
3485
|
-
function getUpgradableConstructor(tagName, renderer) {
|
|
3486
|
-
const {
|
|
3487
|
-
getCustomElement,
|
|
3488
|
-
HTMLElementExported: RendererHTMLElement,
|
|
3489
|
-
defineCustomElement
|
|
3490
|
-
} = renderer; // Should never get a tag with upper case letter at this point, the compiler should
|
|
3491
|
-
// produce only tags with lowercase letters
|
|
3492
|
-
// But, for backwards compatibility, we will lower case the tagName
|
|
3493
|
-
|
|
3494
|
-
tagName = tagName.toLowerCase();
|
|
3495
|
-
let CE = getCustomElement(tagName);
|
|
3496
|
-
|
|
3497
|
-
if (!isUndefined$1(CE)) {
|
|
3498
|
-
return CE;
|
|
3499
|
-
}
|
|
3500
|
-
/**
|
|
3501
|
-
* LWC Upgradable Element reference to an element that was created
|
|
3502
|
-
* via the scoped registry mechanism, and that is ready to be upgraded.
|
|
3503
|
-
*/
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
CE = class LWCUpgradableElement extends RendererHTMLElement {
|
|
3507
|
-
constructor(upgradeCallback) {
|
|
3508
|
-
super();
|
|
3509
|
-
|
|
3510
|
-
if (isFunction$1(upgradeCallback)) {
|
|
3511
|
-
upgradeCallback(this); // nothing to do with the result for now
|
|
3512
|
-
}
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
|
-
};
|
|
3516
|
-
|
|
3517
|
-
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3518
|
-
CE.prototype.connectedCallback = function () {
|
|
3519
|
-
if (checkHasVM(this)) {
|
|
3520
|
-
connectRootElement(this);
|
|
3521
|
-
}
|
|
3522
|
-
};
|
|
3523
|
-
|
|
3524
|
-
CE.prototype.disconnectedCallback = function () {
|
|
3525
|
-
if (checkHasVM(this)) {
|
|
3526
|
-
disconnectRootElement(this);
|
|
3527
|
-
}
|
|
3528
|
-
};
|
|
3529
|
-
}
|
|
3530
|
-
|
|
3531
|
-
defineCustomElement(tagName, CE);
|
|
3532
|
-
return CE;
|
|
3533
|
-
}
|
|
3534
|
-
|
|
3535
3431
|
/*
|
|
3536
3432
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3537
3433
|
* All rights reserved.
|
|
@@ -4034,7 +3930,9 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4034
3930
|
sel,
|
|
4035
3931
|
owner
|
|
4036
3932
|
} = vnode;
|
|
4037
|
-
const
|
|
3933
|
+
const {
|
|
3934
|
+
createCustomElement
|
|
3935
|
+
} = renderer;
|
|
4038
3936
|
/**
|
|
4039
3937
|
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
4040
3938
|
* with a callback as the first argument, we could implement a more advanced
|
|
@@ -4043,10 +3941,25 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4043
3941
|
*/
|
|
4044
3942
|
|
|
4045
3943
|
let vm;
|
|
4046
|
-
|
|
3944
|
+
|
|
3945
|
+
const upgradeCallback = elm => {
|
|
4047
3946
|
// the custom element from the registry is expecting an upgrade callback
|
|
4048
3947
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
4049
|
-
}
|
|
3948
|
+
};
|
|
3949
|
+
|
|
3950
|
+
const connectedCallback = elm => {
|
|
3951
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3952
|
+
connectRootElement(elm);
|
|
3953
|
+
}
|
|
3954
|
+
};
|
|
3955
|
+
|
|
3956
|
+
const disconnectedCallback = elm => {
|
|
3957
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3958
|
+
disconnectRootElement(elm);
|
|
3959
|
+
}
|
|
3960
|
+
};
|
|
3961
|
+
|
|
3962
|
+
const elm = createCustomElement(sel, upgradeCallback, connectedCallback, disconnectedCallback);
|
|
4050
3963
|
vnode.elm = elm;
|
|
4051
3964
|
vnode.vm = vm;
|
|
4052
3965
|
linkNodeToShadow(elm, owner, renderer);
|
|
@@ -4054,8 +3967,6 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4054
3967
|
|
|
4055
3968
|
if (vm) {
|
|
4056
3969
|
allocateChildren(vnode, vm);
|
|
4057
|
-
} else if (vnode.ctor !== UpgradableConstructor) {
|
|
4058
|
-
throw new TypeError(`Incorrect Component Constructor`);
|
|
4059
3970
|
}
|
|
4060
3971
|
|
|
4061
3972
|
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
@@ -6497,7 +6408,7 @@ function freezeTemplate(tmpl) {
|
|
|
6497
6408
|
});
|
|
6498
6409
|
}
|
|
6499
6410
|
}
|
|
6500
|
-
/* version: 2.
|
|
6411
|
+
/* version: 2.26.0 */
|
|
6501
6412
|
|
|
6502
6413
|
/*
|
|
6503
6414
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6561,25 +6472,6 @@ function createElement(tagName, namespace) {
|
|
|
6561
6472
|
[HostEventListenersKey]: {},
|
|
6562
6473
|
};
|
|
6563
6474
|
}
|
|
6564
|
-
const registry = create(null);
|
|
6565
|
-
const reverseRegistry = new WeakMap();
|
|
6566
|
-
function registerCustomElement(name, ctor) {
|
|
6567
|
-
if (name !== StringToLowerCase.call(name) || registry[name]) {
|
|
6568
|
-
throw new TypeError(`Invalid Registration`);
|
|
6569
|
-
}
|
|
6570
|
-
registry[name] = ctor;
|
|
6571
|
-
reverseRegistry.set(ctor, name);
|
|
6572
|
-
}
|
|
6573
|
-
class HTMLElementImpl {
|
|
6574
|
-
constructor() {
|
|
6575
|
-
const { constructor } = this;
|
|
6576
|
-
const tagName = reverseRegistry.get(constructor);
|
|
6577
|
-
if (!tagName) {
|
|
6578
|
-
throw new TypeError(`Invalid Construction`);
|
|
6579
|
-
}
|
|
6580
|
-
return createElement(tagName);
|
|
6581
|
-
}
|
|
6582
|
-
}
|
|
6583
6475
|
const isNativeShadowDefined = false;
|
|
6584
6476
|
const isSyntheticShadowDefined = false;
|
|
6585
6477
|
function insert(node, parent, anchor) {
|
|
@@ -6808,19 +6700,34 @@ const getFirstChild = unsupportedMethod('getFirstChild');
|
|
|
6808
6700
|
const getFirstElementChild = unsupportedMethod('getFirstElementChild');
|
|
6809
6701
|
const getLastChild = unsupportedMethod('getLastChild');
|
|
6810
6702
|
const getLastElementChild = unsupportedMethod('getLastElementChild');
|
|
6811
|
-
function defineCustomElement(name, constructor, _options) {
|
|
6812
|
-
registerCustomElement(name, constructor);
|
|
6813
|
-
}
|
|
6814
|
-
function getCustomElement(name) {
|
|
6815
|
-
return registry[name];
|
|
6816
|
-
}
|
|
6817
|
-
const HTMLElementExported = HTMLElementImpl;
|
|
6818
6703
|
/* noop */
|
|
6819
6704
|
const assertInstanceOfHTMLElement = noop;
|
|
6705
|
+
const localRegistryRecord = new Map();
|
|
6706
|
+
function createUpgradableElementConstructor(tagName) {
|
|
6707
|
+
return function Ctor(upgradeCallback) {
|
|
6708
|
+
const elm = createElement(tagName);
|
|
6709
|
+
if (isFunction$1(upgradeCallback)) {
|
|
6710
|
+
upgradeCallback(elm); // nothing to do with the result for now
|
|
6711
|
+
}
|
|
6712
|
+
return elm;
|
|
6713
|
+
};
|
|
6714
|
+
}
|
|
6715
|
+
function getUpgradableElement(tagName) {
|
|
6716
|
+
let ctor = localRegistryRecord.get(tagName);
|
|
6717
|
+
if (!isUndefined$1(ctor)) {
|
|
6718
|
+
return ctor;
|
|
6719
|
+
}
|
|
6720
|
+
ctor = createUpgradableElementConstructor(tagName);
|
|
6721
|
+
localRegistryRecord.set(tagName, ctor);
|
|
6722
|
+
return ctor;
|
|
6723
|
+
}
|
|
6724
|
+
function createCustomElement(tagName, upgradeCallback) {
|
|
6725
|
+
const UpgradableConstructor = getUpgradableElement(tagName);
|
|
6726
|
+
return new UpgradableConstructor(upgradeCallback);
|
|
6727
|
+
}
|
|
6820
6728
|
const renderer = {
|
|
6821
6729
|
isNativeShadowDefined,
|
|
6822
6730
|
isSyntheticShadowDefined,
|
|
6823
|
-
HTMLElementExported,
|
|
6824
6731
|
insert,
|
|
6825
6732
|
remove,
|
|
6826
6733
|
cloneNode,
|
|
@@ -6828,6 +6735,7 @@ const renderer = {
|
|
|
6828
6735
|
createElement,
|
|
6829
6736
|
createText,
|
|
6830
6737
|
createComment,
|
|
6738
|
+
createCustomElement,
|
|
6831
6739
|
nextSibling,
|
|
6832
6740
|
attachShadow,
|
|
6833
6741
|
getProperty,
|
|
@@ -6855,8 +6763,6 @@ const renderer = {
|
|
|
6855
6763
|
isConnected,
|
|
6856
6764
|
insertStylesheet,
|
|
6857
6765
|
assertInstanceOfHTMLElement,
|
|
6858
|
-
defineCustomElement,
|
|
6859
|
-
getCustomElement,
|
|
6860
6766
|
};
|
|
6861
6767
|
|
|
6862
6768
|
/*
|
|
@@ -6967,7 +6873,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6967
6873
|
*/
|
|
6968
6874
|
freeze(LightningElement);
|
|
6969
6875
|
seal(LightningElement.prototype);
|
|
6970
|
-
/* version: 2.
|
|
6876
|
+
/* version: 2.26.0 */
|
|
6971
6877
|
|
|
6972
6878
|
exports.LightningElement = LightningElement;
|
|
6973
6879
|
exports.api = api$1;
|