lwc 2.26.0 → 2.27.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 +75 -27
- package/dist/engine-dom/iife/es2017/engine-dom.js +75 -27
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +71 -23
- package/dist/engine-dom/iife/es5/engine-dom.js +78 -26
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +74 -22
- package/dist/engine-dom/umd/es2017/engine-dom.js +75 -27
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +71 -23
- package/dist/engine-dom/umd/es5/engine-dom.js +78 -26
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +74 -22
- package/dist/engine-server/commonjs/es2017/engine-server.js +73 -25
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +73 -25
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- 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 +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- 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
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
setPrototypeOf = Object.setPrototypeOf;
|
|
124
124
|
var isArray$1 = Array.isArray;
|
|
125
125
|
var _Array$prototype = Array.prototype,
|
|
126
|
+
ArrayConcat$1 = _Array$prototype.concat,
|
|
126
127
|
ArrayFilter = _Array$prototype.filter,
|
|
127
128
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
128
129
|
ArrayJoin = _Array$prototype.join,
|
|
@@ -350,7 +351,7 @@
|
|
|
350
351
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
351
352
|
return attributeName;
|
|
352
353
|
}
|
|
353
|
-
/** version: 2.
|
|
354
|
+
/** version: 2.27.0 */
|
|
354
355
|
|
|
355
356
|
/**
|
|
356
357
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -444,7 +445,7 @@
|
|
|
444
445
|
patch$1(propName);
|
|
445
446
|
}
|
|
446
447
|
}
|
|
447
|
-
/** version: 2.
|
|
448
|
+
/** version: 2.27.0 */
|
|
448
449
|
|
|
449
450
|
/**
|
|
450
451
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -3297,6 +3298,12 @@
|
|
|
3297
3298
|
/* VNodeType.CustomElement */
|
|
3298
3299
|
;
|
|
3299
3300
|
}
|
|
3301
|
+
|
|
3302
|
+
function isVScopedSlotFragment(vnode) {
|
|
3303
|
+
return vnode.type === 6
|
|
3304
|
+
/* VNodeType.ScopedSlotFragment */
|
|
3305
|
+
;
|
|
3306
|
+
}
|
|
3300
3307
|
/*
|
|
3301
3308
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3302
3309
|
* All rights reserved.
|
|
@@ -4076,7 +4083,7 @@
|
|
|
4076
4083
|
/* RenderMode.Light */
|
|
4077
4084
|
) {
|
|
4078
4085
|
// slow path
|
|
4079
|
-
allocateInSlot(vm, children); // save the allocated children in case this vnode is reused.
|
|
4086
|
+
allocateInSlot(vm, children, vnode.owner); // save the allocated children in case this vnode is reused.
|
|
4080
4087
|
|
|
4081
4088
|
vnode.aChildren = children; // every child vnode is now allocated, and the host should receive none directly, it receives them via the shadow!
|
|
4082
4089
|
|
|
@@ -4106,11 +4113,15 @@
|
|
|
4106
4113
|
return vm;
|
|
4107
4114
|
}
|
|
4108
4115
|
|
|
4109
|
-
function allocateInSlot(vm, children) {
|
|
4110
|
-
var _a;
|
|
4116
|
+
function allocateInSlot(vm, children, owner) {
|
|
4117
|
+
var _a, _b;
|
|
4111
4118
|
|
|
4112
|
-
var
|
|
4113
|
-
var
|
|
4119
|
+
var oldSlotsMapping = vm.cmpSlots.slotAssignments;
|
|
4120
|
+
var cmpSlotsMapping = create(null);
|
|
4121
|
+
vm.cmpSlots = {
|
|
4122
|
+
owner: owner,
|
|
4123
|
+
slotAssignments: cmpSlotsMapping
|
|
4124
|
+
};
|
|
4114
4125
|
|
|
4115
4126
|
for (var _i15 = 0, len = children.length; _i15 < len; _i15 += 1) {
|
|
4116
4127
|
var vnode = children[_i15];
|
|
@@ -4122,19 +4133,21 @@
|
|
|
4122
4133
|
var slotName = '';
|
|
4123
4134
|
|
|
4124
4135
|
if (isVBaseElement(vnode)) {
|
|
4125
|
-
slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot)
|
|
4136
|
+
slotName = (_b = (_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : '';
|
|
4137
|
+
} else if (isVScopedSlotFragment(vnode)) {
|
|
4138
|
+
slotName = vnode.slotName;
|
|
4126
4139
|
}
|
|
4127
4140
|
|
|
4128
|
-
var vnodes =
|
|
4141
|
+
var vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
|
|
4129
4142
|
ArrayPush$1.call(vnodes, vnode);
|
|
4130
4143
|
}
|
|
4131
4144
|
|
|
4132
4145
|
if (isFalse(vm.isDirty)) {
|
|
4133
4146
|
// We need to determine if the old allocation is really different from the new one
|
|
4134
4147
|
// and mark the vm as dirty
|
|
4135
|
-
var oldKeys = keys(
|
|
4148
|
+
var oldKeys = keys(oldSlotsMapping);
|
|
4136
4149
|
|
|
4137
|
-
if (oldKeys.length !== keys(
|
|
4150
|
+
if (oldKeys.length !== keys(cmpSlotsMapping).length) {
|
|
4138
4151
|
markComponentAsDirty(vm);
|
|
4139
4152
|
return;
|
|
4140
4153
|
}
|
|
@@ -4142,15 +4155,15 @@
|
|
|
4142
4155
|
for (var _i16 = 0, _len4 = oldKeys.length; _i16 < _len4; _i16 += 1) {
|
|
4143
4156
|
var key = oldKeys[_i16];
|
|
4144
4157
|
|
|
4145
|
-
if (isUndefined$1(
|
|
4158
|
+
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4146
4159
|
markComponentAsDirty(vm);
|
|
4147
4160
|
return;
|
|
4148
4161
|
}
|
|
4149
4162
|
|
|
4150
|
-
var oldVNodes =
|
|
4151
|
-
var _vnodes =
|
|
4163
|
+
var oldVNodes = oldSlotsMapping[key];
|
|
4164
|
+
var _vnodes = cmpSlotsMapping[key];
|
|
4152
4165
|
|
|
4153
|
-
for (var j = 0, a =
|
|
4166
|
+
for (var j = 0, a = cmpSlotsMapping[key].length; j < a; j += 1) {
|
|
4154
4167
|
if (oldVNodes[j] !== _vnodes[j]) {
|
|
4155
4168
|
markComponentAsDirty(vm);
|
|
4156
4169
|
return;
|
|
@@ -4349,6 +4362,21 @@
|
|
|
4349
4362
|
|
|
4350
4363
|
function addVNodeToChildLWC(vnode) {
|
|
4351
4364
|
ArrayPush$1.call(getVMBeingRendered().velements, vnode);
|
|
4365
|
+
} // [s]coped [s]lot [f]actory
|
|
4366
|
+
|
|
4367
|
+
|
|
4368
|
+
function ssf(slotName, factory) {
|
|
4369
|
+
return {
|
|
4370
|
+
type: 6
|
|
4371
|
+
/* VNodeType.ScopedSlotFragment */
|
|
4372
|
+
,
|
|
4373
|
+
factory: factory,
|
|
4374
|
+
owner: getVMBeingRendered(),
|
|
4375
|
+
elm: undefined,
|
|
4376
|
+
sel: undefined,
|
|
4377
|
+
key: undefined,
|
|
4378
|
+
slotName: slotName
|
|
4379
|
+
};
|
|
4352
4380
|
} // [st]atic node
|
|
4353
4381
|
|
|
4354
4382
|
|
|
@@ -4419,8 +4447,29 @@
|
|
|
4419
4447
|
|
|
4420
4448
|
function s(slotName, data, children, slotset) {
|
|
4421
4449
|
|
|
4422
|
-
if (!isUndefined$1(slotset) && !isUndefined$1(slotset[slotName]) && slotset[slotName].length !== 0) {
|
|
4423
|
-
children = slotset[slotName]
|
|
4450
|
+
if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
|
|
4451
|
+
children = slotset.slotAssignments[slotName].reduce(function (acc, vnode) {
|
|
4452
|
+
// If the passed slot content is factory, evaluate it and use the produced vnodes
|
|
4453
|
+
if (vnode && isVScopedSlotFragment(vnode)) {
|
|
4454
|
+
var vmBeingRenderedInception = getVMBeingRendered();
|
|
4455
|
+
var _children = []; // Evaluate in the scope of the slot content's owner
|
|
4456
|
+
// if a slotset is provided, there will always be an owner. The only case where owner is
|
|
4457
|
+
// undefined is for root components, but root components cannot accept slotted content
|
|
4458
|
+
|
|
4459
|
+
setVMBeingRendered(slotset.owner);
|
|
4460
|
+
|
|
4461
|
+
try {
|
|
4462
|
+
_children = vnode.factory(data.slotData);
|
|
4463
|
+
} finally {
|
|
4464
|
+
setVMBeingRendered(vmBeingRenderedInception);
|
|
4465
|
+
}
|
|
4466
|
+
|
|
4467
|
+
return ArrayConcat$1.call(acc, _children);
|
|
4468
|
+
} else {
|
|
4469
|
+
// If the slot content is a static list of child nodes provided by the parent, nothing to do
|
|
4470
|
+
return ArrayConcat$1.call(acc, vnode);
|
|
4471
|
+
}
|
|
4472
|
+
}, []);
|
|
4424
4473
|
}
|
|
4425
4474
|
|
|
4426
4475
|
var vmBeingRendered = getVMBeingRendered();
|
|
@@ -4737,7 +4786,8 @@
|
|
|
4737
4786
|
st: st,
|
|
4738
4787
|
gid: gid,
|
|
4739
4788
|
fid: fid,
|
|
4740
|
-
shc: shc
|
|
4789
|
+
shc: shc,
|
|
4790
|
+
ssf: ssf
|
|
4741
4791
|
});
|
|
4742
4792
|
/** Indicates if operations should be logged by the profiler. */
|
|
4743
4793
|
|
|
@@ -5348,7 +5398,9 @@
|
|
|
5348
5398
|
velements: EmptyArray,
|
|
5349
5399
|
cmpProps: create(null),
|
|
5350
5400
|
cmpFields: create(null),
|
|
5351
|
-
cmpSlots:
|
|
5401
|
+
cmpSlots: {
|
|
5402
|
+
slotAssignments: create(null)
|
|
5403
|
+
},
|
|
5352
5404
|
oar: create(null),
|
|
5353
5405
|
cmpTemplate: null,
|
|
5354
5406
|
hydrated: Boolean(hydrated),
|
|
@@ -6664,7 +6716,7 @@
|
|
|
6664
6716
|
|
|
6665
6717
|
return ctor;
|
|
6666
6718
|
}
|
|
6667
|
-
/* version: 2.
|
|
6719
|
+
/* version: 2.27.0 */
|
|
6668
6720
|
|
|
6669
6721
|
/*
|
|
6670
6722
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7656,7 +7708,7 @@
|
|
|
7656
7708
|
function isNull(obj) {
|
|
7657
7709
|
return obj === null;
|
|
7658
7710
|
}
|
|
7659
|
-
/** version: 2.
|
|
7711
|
+
/** version: 2.27.0 */
|
|
7660
7712
|
|
|
7661
7713
|
/*
|
|
7662
7714
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8316,7 +8368,7 @@
|
|
|
8316
8368
|
});
|
|
8317
8369
|
freeze(LightningElement);
|
|
8318
8370
|
seal(LightningElement.prototype);
|
|
8319
|
-
/* version: 2.
|
|
8371
|
+
/* version: 2.27.0 */
|
|
8320
8372
|
|
|
8321
8373
|
exports.LightningElement = LightningElement;
|
|
8322
8374
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -47,7 +47,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
47
47
|
*/
|
|
48
48
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
49
49
|
const { isArray: isArray$1 } = Array;
|
|
50
|
-
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
50
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
51
51
|
const { fromCharCode: StringFromCharCode } = String;
|
|
52
52
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
53
53
|
function isUndefined$1(obj) {
|
|
@@ -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.27.0";
|
|
440
440
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
441
|
-
/** version: 2.
|
|
441
|
+
/** version: 2.27.0 */
|
|
442
442
|
|
|
443
443
|
/*
|
|
444
444
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -550,7 +550,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
550
550
|
setFeatureFlag(name, value);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
/** version: 2.
|
|
553
|
+
/** version: 2.27.0 */
|
|
554
554
|
|
|
555
555
|
/* proxy-compat-disable */
|
|
556
556
|
|
|
@@ -3441,6 +3441,9 @@ function isVBaseElement(vnode) {
|
|
|
3441
3441
|
function isSameVnode(vnode1, vnode2) {
|
|
3442
3442
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
3443
3443
|
}
|
|
3444
|
+
function isVScopedSlotFragment(vnode) {
|
|
3445
|
+
return vnode.type === 6 /* VNodeType.ScopedSlotFragment */;
|
|
3446
|
+
}
|
|
3444
3447
|
|
|
3445
3448
|
/*
|
|
3446
3449
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4259,7 +4262,7 @@ function allocateChildren(vnode, vm) {
|
|
|
4259
4262
|
/* RenderMode.Light */
|
|
4260
4263
|
) {
|
|
4261
4264
|
// slow path
|
|
4262
|
-
allocateInSlot(vm, children); // save the allocated children in case this vnode is reused.
|
|
4265
|
+
allocateInSlot(vm, children, vnode.owner); // save the allocated children in case this vnode is reused.
|
|
4263
4266
|
|
|
4264
4267
|
vnode.aChildren = children; // every child vnode is now allocated, and the host should receive none directly, it receives them via the shadow!
|
|
4265
4268
|
|
|
@@ -4295,13 +4298,19 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
4295
4298
|
return vm;
|
|
4296
4299
|
}
|
|
4297
4300
|
|
|
4298
|
-
function allocateInSlot(vm, children) {
|
|
4299
|
-
var _a;
|
|
4301
|
+
function allocateInSlot(vm, children, owner) {
|
|
4302
|
+
var _a, _b;
|
|
4300
4303
|
|
|
4301
4304
|
const {
|
|
4302
|
-
cmpSlots:
|
|
4305
|
+
cmpSlots: {
|
|
4306
|
+
slotAssignments: oldSlotsMapping
|
|
4307
|
+
}
|
|
4303
4308
|
} = vm;
|
|
4304
|
-
const
|
|
4309
|
+
const cmpSlotsMapping = create(null);
|
|
4310
|
+
vm.cmpSlots = {
|
|
4311
|
+
owner,
|
|
4312
|
+
slotAssignments: cmpSlotsMapping
|
|
4313
|
+
};
|
|
4305
4314
|
|
|
4306
4315
|
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
4307
4316
|
const vnode = children[i];
|
|
@@ -4313,19 +4322,21 @@ function allocateInSlot(vm, children) {
|
|
|
4313
4322
|
let slotName = '';
|
|
4314
4323
|
|
|
4315
4324
|
if (isVBaseElement(vnode)) {
|
|
4316
|
-
slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot)
|
|
4325
|
+
slotName = (_b = (_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : '';
|
|
4326
|
+
} else if (isVScopedSlotFragment(vnode)) {
|
|
4327
|
+
slotName = vnode.slotName;
|
|
4317
4328
|
}
|
|
4318
4329
|
|
|
4319
|
-
const vnodes =
|
|
4330
|
+
const vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
|
|
4320
4331
|
ArrayPush$1.call(vnodes, vnode);
|
|
4321
4332
|
}
|
|
4322
4333
|
|
|
4323
4334
|
if (isFalse(vm.isDirty)) {
|
|
4324
4335
|
// We need to determine if the old allocation is really different from the new one
|
|
4325
4336
|
// and mark the vm as dirty
|
|
4326
|
-
const oldKeys = keys(
|
|
4337
|
+
const oldKeys = keys(oldSlotsMapping);
|
|
4327
4338
|
|
|
4328
|
-
if (oldKeys.length !== keys(
|
|
4339
|
+
if (oldKeys.length !== keys(cmpSlotsMapping).length) {
|
|
4329
4340
|
markComponentAsDirty(vm);
|
|
4330
4341
|
return;
|
|
4331
4342
|
}
|
|
@@ -4333,15 +4344,15 @@ function allocateInSlot(vm, children) {
|
|
|
4333
4344
|
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
4334
4345
|
const key = oldKeys[i];
|
|
4335
4346
|
|
|
4336
|
-
if (isUndefined$1(
|
|
4347
|
+
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4337
4348
|
markComponentAsDirty(vm);
|
|
4338
4349
|
return;
|
|
4339
4350
|
}
|
|
4340
4351
|
|
|
4341
|
-
const oldVNodes =
|
|
4342
|
-
const vnodes =
|
|
4352
|
+
const oldVNodes = oldSlotsMapping[key];
|
|
4353
|
+
const vnodes = cmpSlotsMapping[key];
|
|
4343
4354
|
|
|
4344
|
-
for (let j = 0, a =
|
|
4355
|
+
for (let j = 0, a = cmpSlotsMapping[key].length; j < a; j += 1) {
|
|
4345
4356
|
if (oldVNodes[j] !== vnodes[j]) {
|
|
4346
4357
|
markComponentAsDirty(vm);
|
|
4347
4358
|
return;
|
|
@@ -4541,6 +4552,18 @@ const SymbolIterator = Symbol.iterator;
|
|
|
4541
4552
|
function addVNodeToChildLWC(vnode) {
|
|
4542
4553
|
ArrayPush$1.call(getVMBeingRendered().velements, vnode);
|
|
4543
4554
|
}
|
|
4555
|
+
// [s]coped [s]lot [f]actory
|
|
4556
|
+
function ssf(slotName, factory) {
|
|
4557
|
+
return {
|
|
4558
|
+
type: 6 /* VNodeType.ScopedSlotFragment */,
|
|
4559
|
+
factory,
|
|
4560
|
+
owner: getVMBeingRendered(),
|
|
4561
|
+
elm: undefined,
|
|
4562
|
+
sel: undefined,
|
|
4563
|
+
key: undefined,
|
|
4564
|
+
slotName,
|
|
4565
|
+
};
|
|
4566
|
+
}
|
|
4544
4567
|
// [st]atic node
|
|
4545
4568
|
function st(fragment, key) {
|
|
4546
4569
|
return {
|
|
@@ -4624,9 +4647,31 @@ function s(slotName, data, children, slotset) {
|
|
|
4624
4647
|
assert.isTrue(isArray$1(children), `h() 3rd argument children must be an array.`);
|
|
4625
4648
|
}
|
|
4626
4649
|
if (!isUndefined$1(slotset) &&
|
|
4627
|
-
!isUndefined$1(slotset
|
|
4628
|
-
slotset[slotName]
|
|
4629
|
-
|
|
4650
|
+
!isUndefined$1(slotset.slotAssignments) &&
|
|
4651
|
+
!isUndefined$1(slotset.slotAssignments[slotName]) &&
|
|
4652
|
+
slotset.slotAssignments[slotName].length !== 0) {
|
|
4653
|
+
children = slotset.slotAssignments[slotName].reduce((acc, vnode) => {
|
|
4654
|
+
// If the passed slot content is factory, evaluate it and use the produced vnodes
|
|
4655
|
+
if (vnode && isVScopedSlotFragment(vnode)) {
|
|
4656
|
+
const vmBeingRenderedInception = getVMBeingRendered();
|
|
4657
|
+
let children = [];
|
|
4658
|
+
// Evaluate in the scope of the slot content's owner
|
|
4659
|
+
// if a slotset is provided, there will always be an owner. The only case where owner is
|
|
4660
|
+
// undefined is for root components, but root components cannot accept slotted content
|
|
4661
|
+
setVMBeingRendered(slotset.owner);
|
|
4662
|
+
try {
|
|
4663
|
+
children = vnode.factory(data.slotData);
|
|
4664
|
+
}
|
|
4665
|
+
finally {
|
|
4666
|
+
setVMBeingRendered(vmBeingRenderedInception);
|
|
4667
|
+
}
|
|
4668
|
+
return ArrayConcat$1.call(acc, children);
|
|
4669
|
+
}
|
|
4670
|
+
else {
|
|
4671
|
+
// If the slot content is a static list of child nodes provided by the parent, nothing to do
|
|
4672
|
+
return ArrayConcat$1.call(acc, vnode);
|
|
4673
|
+
}
|
|
4674
|
+
}, []);
|
|
4630
4675
|
}
|
|
4631
4676
|
const vmBeingRendered = getVMBeingRendered();
|
|
4632
4677
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
@@ -4946,6 +4991,7 @@ const api = freeze({
|
|
|
4946
4991
|
gid,
|
|
4947
4992
|
fid,
|
|
4948
4993
|
shc,
|
|
4994
|
+
ssf,
|
|
4949
4995
|
});
|
|
4950
4996
|
|
|
4951
4997
|
/*
|
|
@@ -5048,9 +5094,9 @@ function validateSlots(vm, html) {
|
|
|
5048
5094
|
}
|
|
5049
5095
|
const { cmpSlots } = vm;
|
|
5050
5096
|
const { slots = EmptyArray } = html;
|
|
5051
|
-
for (const slotName in cmpSlots) {
|
|
5097
|
+
for (const slotName in cmpSlots.slotAssignments) {
|
|
5052
5098
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
5053
|
-
assert.isTrue(isArray$1(cmpSlots[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots[slotName])} for slot "${slotName}" in ${vm}.`);
|
|
5099
|
+
assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots.slotAssignments[slotName])} for slot "${slotName}" in ${vm}.`);
|
|
5054
5100
|
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
5055
5101
|
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
5056
5102
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
@@ -5536,7 +5582,9 @@ function createVM(elm, ctor, renderer, options) {
|
|
|
5536
5582
|
velements: EmptyArray,
|
|
5537
5583
|
cmpProps: create(null),
|
|
5538
5584
|
cmpFields: create(null),
|
|
5539
|
-
cmpSlots:
|
|
5585
|
+
cmpSlots: {
|
|
5586
|
+
slotAssignments: create(null)
|
|
5587
|
+
},
|
|
5540
5588
|
oar: create(null),
|
|
5541
5589
|
cmpTemplate: null,
|
|
5542
5590
|
hydrated: Boolean(hydrated),
|
|
@@ -6408,7 +6456,7 @@ function freezeTemplate(tmpl) {
|
|
|
6408
6456
|
});
|
|
6409
6457
|
}
|
|
6410
6458
|
}
|
|
6411
|
-
/* version: 2.
|
|
6459
|
+
/* version: 2.27.0 */
|
|
6412
6460
|
|
|
6413
6461
|
/*
|
|
6414
6462
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6873,7 +6921,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6873
6921
|
*/
|
|
6874
6922
|
freeze(LightningElement);
|
|
6875
6923
|
seal(LightningElement.prototype);
|
|
6876
|
-
/* version: 2.
|
|
6924
|
+
/* version: 2.27.0 */
|
|
6877
6925
|
|
|
6878
6926
|
exports.LightningElement = LightningElement;
|
|
6879
6927
|
exports.api = api$1;
|