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
|
@@ -43,7 +43,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
43
43
|
*/
|
|
44
44
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
45
45
|
const { isArray: isArray$1 } = Array;
|
|
46
|
-
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;
|
|
46
|
+
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;
|
|
47
47
|
const { fromCharCode: StringFromCharCode } = String;
|
|
48
48
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
49
49
|
function isUndefined$1(obj) {
|
|
@@ -299,9 +299,9 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
300
300
|
*/
|
|
301
301
|
// Increment whenever the LWC template compiler changes
|
|
302
|
-
const LWC_VERSION = "2.
|
|
302
|
+
const LWC_VERSION = "2.27.0";
|
|
303
303
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
304
|
-
/** version: 2.
|
|
304
|
+
/** version: 2.27.0 */
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -383,7 +383,7 @@ for (let i = 0, len = ElementPrototypeAriaPropertyNames.length; i < len; i += 1)
|
|
|
383
383
|
patch$1(propName);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
/** version: 2.
|
|
386
|
+
/** version: 2.27.0 */
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -463,7 +463,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
463
463
|
setFeatureFlag(name, value);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
/** version: 2.
|
|
466
|
+
/** version: 2.27.0 */
|
|
467
467
|
|
|
468
468
|
/*
|
|
469
469
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3686,6 +3686,9 @@ function isSameVnode(vnode1, vnode2) {
|
|
|
3686
3686
|
function isVCustomElement(vnode) {
|
|
3687
3687
|
return vnode.type === 3 /* VNodeType.CustomElement */;
|
|
3688
3688
|
}
|
|
3689
|
+
function isVScopedSlotFragment(vnode) {
|
|
3690
|
+
return vnode.type === 6 /* VNodeType.ScopedSlotFragment */;
|
|
3691
|
+
}
|
|
3689
3692
|
|
|
3690
3693
|
/*
|
|
3691
3694
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4520,7 +4523,7 @@ function allocateChildren(vnode, vm) {
|
|
|
4520
4523
|
/* RenderMode.Light */
|
|
4521
4524
|
) {
|
|
4522
4525
|
// slow path
|
|
4523
|
-
allocateInSlot(vm, children); // save the allocated children in case this vnode is reused.
|
|
4526
|
+
allocateInSlot(vm, children, vnode.owner); // save the allocated children in case this vnode is reused.
|
|
4524
4527
|
|
|
4525
4528
|
vnode.aChildren = children; // every child vnode is now allocated, and the host should receive none directly, it receives them via the shadow!
|
|
4526
4529
|
|
|
@@ -4556,13 +4559,19 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
4556
4559
|
return vm;
|
|
4557
4560
|
}
|
|
4558
4561
|
|
|
4559
|
-
function allocateInSlot(vm, children) {
|
|
4560
|
-
var _a;
|
|
4562
|
+
function allocateInSlot(vm, children, owner) {
|
|
4563
|
+
var _a, _b;
|
|
4561
4564
|
|
|
4562
4565
|
const {
|
|
4563
|
-
cmpSlots:
|
|
4566
|
+
cmpSlots: {
|
|
4567
|
+
slotAssignments: oldSlotsMapping
|
|
4568
|
+
}
|
|
4564
4569
|
} = vm;
|
|
4565
|
-
const
|
|
4570
|
+
const cmpSlotsMapping = create(null);
|
|
4571
|
+
vm.cmpSlots = {
|
|
4572
|
+
owner,
|
|
4573
|
+
slotAssignments: cmpSlotsMapping
|
|
4574
|
+
};
|
|
4566
4575
|
|
|
4567
4576
|
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
4568
4577
|
const vnode = children[i];
|
|
@@ -4574,19 +4583,21 @@ function allocateInSlot(vm, children) {
|
|
|
4574
4583
|
let slotName = '';
|
|
4575
4584
|
|
|
4576
4585
|
if (isVBaseElement(vnode)) {
|
|
4577
|
-
slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot)
|
|
4586
|
+
slotName = (_b = (_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : '';
|
|
4587
|
+
} else if (isVScopedSlotFragment(vnode)) {
|
|
4588
|
+
slotName = vnode.slotName;
|
|
4578
4589
|
}
|
|
4579
4590
|
|
|
4580
|
-
const vnodes =
|
|
4591
|
+
const vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
|
|
4581
4592
|
ArrayPush$1.call(vnodes, vnode);
|
|
4582
4593
|
}
|
|
4583
4594
|
|
|
4584
4595
|
if (isFalse(vm.isDirty)) {
|
|
4585
4596
|
// We need to determine if the old allocation is really different from the new one
|
|
4586
4597
|
// and mark the vm as dirty
|
|
4587
|
-
const oldKeys = keys(
|
|
4598
|
+
const oldKeys = keys(oldSlotsMapping);
|
|
4588
4599
|
|
|
4589
|
-
if (oldKeys.length !== keys(
|
|
4600
|
+
if (oldKeys.length !== keys(cmpSlotsMapping).length) {
|
|
4590
4601
|
markComponentAsDirty(vm);
|
|
4591
4602
|
return;
|
|
4592
4603
|
}
|
|
@@ -4594,15 +4605,15 @@ function allocateInSlot(vm, children) {
|
|
|
4594
4605
|
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
4595
4606
|
const key = oldKeys[i];
|
|
4596
4607
|
|
|
4597
|
-
if (isUndefined$1(
|
|
4608
|
+
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4598
4609
|
markComponentAsDirty(vm);
|
|
4599
4610
|
return;
|
|
4600
4611
|
}
|
|
4601
4612
|
|
|
4602
|
-
const oldVNodes =
|
|
4603
|
-
const vnodes =
|
|
4613
|
+
const oldVNodes = oldSlotsMapping[key];
|
|
4614
|
+
const vnodes = cmpSlotsMapping[key];
|
|
4604
4615
|
|
|
4605
|
-
for (let j = 0, a =
|
|
4616
|
+
for (let j = 0, a = cmpSlotsMapping[key].length; j < a; j += 1) {
|
|
4606
4617
|
if (oldVNodes[j] !== vnodes[j]) {
|
|
4607
4618
|
markComponentAsDirty(vm);
|
|
4608
4619
|
return;
|
|
@@ -4802,6 +4813,18 @@ const SymbolIterator = Symbol.iterator;
|
|
|
4802
4813
|
function addVNodeToChildLWC(vnode) {
|
|
4803
4814
|
ArrayPush$1.call(getVMBeingRendered().velements, vnode);
|
|
4804
4815
|
}
|
|
4816
|
+
// [s]coped [s]lot [f]actory
|
|
4817
|
+
function ssf(slotName, factory) {
|
|
4818
|
+
return {
|
|
4819
|
+
type: 6 /* VNodeType.ScopedSlotFragment */,
|
|
4820
|
+
factory,
|
|
4821
|
+
owner: getVMBeingRendered(),
|
|
4822
|
+
elm: undefined,
|
|
4823
|
+
sel: undefined,
|
|
4824
|
+
key: undefined,
|
|
4825
|
+
slotName,
|
|
4826
|
+
};
|
|
4827
|
+
}
|
|
4805
4828
|
// [st]atic node
|
|
4806
4829
|
function st(fragment, key) {
|
|
4807
4830
|
return {
|
|
@@ -4885,9 +4908,31 @@ function s(slotName, data, children, slotset) {
|
|
|
4885
4908
|
assert.isTrue(isArray$1(children), `h() 3rd argument children must be an array.`);
|
|
4886
4909
|
}
|
|
4887
4910
|
if (!isUndefined$1(slotset) &&
|
|
4888
|
-
!isUndefined$1(slotset
|
|
4889
|
-
slotset[slotName]
|
|
4890
|
-
|
|
4911
|
+
!isUndefined$1(slotset.slotAssignments) &&
|
|
4912
|
+
!isUndefined$1(slotset.slotAssignments[slotName]) &&
|
|
4913
|
+
slotset.slotAssignments[slotName].length !== 0) {
|
|
4914
|
+
children = slotset.slotAssignments[slotName].reduce((acc, vnode) => {
|
|
4915
|
+
// If the passed slot content is factory, evaluate it and use the produced vnodes
|
|
4916
|
+
if (vnode && isVScopedSlotFragment(vnode)) {
|
|
4917
|
+
const vmBeingRenderedInception = getVMBeingRendered();
|
|
4918
|
+
let children = [];
|
|
4919
|
+
// Evaluate in the scope of the slot content's owner
|
|
4920
|
+
// if a slotset is provided, there will always be an owner. The only case where owner is
|
|
4921
|
+
// undefined is for root components, but root components cannot accept slotted content
|
|
4922
|
+
setVMBeingRendered(slotset.owner);
|
|
4923
|
+
try {
|
|
4924
|
+
children = vnode.factory(data.slotData);
|
|
4925
|
+
}
|
|
4926
|
+
finally {
|
|
4927
|
+
setVMBeingRendered(vmBeingRenderedInception);
|
|
4928
|
+
}
|
|
4929
|
+
return ArrayConcat$1.call(acc, children);
|
|
4930
|
+
}
|
|
4931
|
+
else {
|
|
4932
|
+
// If the slot content is a static list of child nodes provided by the parent, nothing to do
|
|
4933
|
+
return ArrayConcat$1.call(acc, vnode);
|
|
4934
|
+
}
|
|
4935
|
+
}, []);
|
|
4891
4936
|
}
|
|
4892
4937
|
const vmBeingRendered = getVMBeingRendered();
|
|
4893
4938
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
@@ -5207,6 +5252,7 @@ const api = freeze({
|
|
|
5207
5252
|
gid,
|
|
5208
5253
|
fid,
|
|
5209
5254
|
shc,
|
|
5255
|
+
ssf,
|
|
5210
5256
|
});
|
|
5211
5257
|
|
|
5212
5258
|
/*
|
|
@@ -5343,9 +5389,9 @@ function validateSlots(vm, html) {
|
|
|
5343
5389
|
}
|
|
5344
5390
|
const { cmpSlots } = vm;
|
|
5345
5391
|
const { slots = EmptyArray } = html;
|
|
5346
|
-
for (const slotName in cmpSlots) {
|
|
5392
|
+
for (const slotName in cmpSlots.slotAssignments) {
|
|
5347
5393
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
5348
|
-
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}.`);
|
|
5394
|
+
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}.`);
|
|
5349
5395
|
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
5350
5396
|
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
5351
5397
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
@@ -5842,7 +5888,9 @@ function createVM(elm, ctor, renderer, options) {
|
|
|
5842
5888
|
velements: EmptyArray,
|
|
5843
5889
|
cmpProps: create(null),
|
|
5844
5890
|
cmpFields: create(null),
|
|
5845
|
-
cmpSlots:
|
|
5891
|
+
cmpSlots: {
|
|
5892
|
+
slotAssignments: create(null)
|
|
5893
|
+
},
|
|
5846
5894
|
oar: create(null),
|
|
5847
5895
|
cmpTemplate: null,
|
|
5848
5896
|
hydrated: Boolean(hydrated),
|
|
@@ -7251,7 +7299,7 @@ function getComponentConstructor(elm) {
|
|
|
7251
7299
|
}
|
|
7252
7300
|
return ctor;
|
|
7253
7301
|
}
|
|
7254
|
-
/* version: 2.
|
|
7302
|
+
/* version: 2.27.0 */
|
|
7255
7303
|
|
|
7256
7304
|
/*
|
|
7257
7305
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8075,7 +8123,7 @@ function rendererFactory(baseRenderer) {
|
|
|
8075
8123
|
function isNull(obj) {
|
|
8076
8124
|
return obj === null;
|
|
8077
8125
|
}
|
|
8078
|
-
/** version: 2.
|
|
8126
|
+
/** version: 2.27.0 */
|
|
8079
8127
|
|
|
8080
8128
|
/*
|
|
8081
8129
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8654,6 +8702,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8654
8702
|
});
|
|
8655
8703
|
freeze(LightningElement);
|
|
8656
8704
|
seal(LightningElement.prototype);
|
|
8657
|
-
/* version: 2.
|
|
8705
|
+
/* version: 2.27.0 */
|
|
8658
8706
|
|
|
8659
8707
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
@@ -46,7 +46,7 @@ var LWC = (function (exports) {
|
|
|
46
46
|
*/
|
|
47
47
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
48
48
|
const { isArray: isArray$1 } = Array;
|
|
49
|
-
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;
|
|
49
|
+
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;
|
|
50
50
|
const { fromCharCode: StringFromCharCode } = String;
|
|
51
51
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
52
52
|
function isUndefined$1(obj) {
|
|
@@ -302,9 +302,9 @@ var LWC = (function (exports) {
|
|
|
302
302
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
303
303
|
*/
|
|
304
304
|
// Increment whenever the LWC template compiler changes
|
|
305
|
-
const LWC_VERSION = "2.
|
|
305
|
+
const LWC_VERSION = "2.27.0";
|
|
306
306
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
307
|
-
/** version: 2.
|
|
307
|
+
/** version: 2.27.0 */
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
310
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -386,7 +386,7 @@ var LWC = (function (exports) {
|
|
|
386
386
|
patch$1(propName);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
/** version: 2.
|
|
389
|
+
/** version: 2.27.0 */
|
|
390
390
|
|
|
391
391
|
/**
|
|
392
392
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -466,7 +466,7 @@ var LWC = (function (exports) {
|
|
|
466
466
|
setFeatureFlag(name, value);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
/** version: 2.
|
|
469
|
+
/** version: 2.27.0 */
|
|
470
470
|
|
|
471
471
|
/*
|
|
472
472
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3689,6 +3689,9 @@ var LWC = (function (exports) {
|
|
|
3689
3689
|
function isVCustomElement(vnode) {
|
|
3690
3690
|
return vnode.type === 3 /* VNodeType.CustomElement */;
|
|
3691
3691
|
}
|
|
3692
|
+
function isVScopedSlotFragment(vnode) {
|
|
3693
|
+
return vnode.type === 6 /* VNodeType.ScopedSlotFragment */;
|
|
3694
|
+
}
|
|
3692
3695
|
|
|
3693
3696
|
/*
|
|
3694
3697
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4523,7 +4526,7 @@ var LWC = (function (exports) {
|
|
|
4523
4526
|
/* RenderMode.Light */
|
|
4524
4527
|
) {
|
|
4525
4528
|
// slow path
|
|
4526
|
-
allocateInSlot(vm, children); // save the allocated children in case this vnode is reused.
|
|
4529
|
+
allocateInSlot(vm, children, vnode.owner); // save the allocated children in case this vnode is reused.
|
|
4527
4530
|
|
|
4528
4531
|
vnode.aChildren = children; // every child vnode is now allocated, and the host should receive none directly, it receives them via the shadow!
|
|
4529
4532
|
|
|
@@ -4559,13 +4562,19 @@ var LWC = (function (exports) {
|
|
|
4559
4562
|
return vm;
|
|
4560
4563
|
}
|
|
4561
4564
|
|
|
4562
|
-
function allocateInSlot(vm, children) {
|
|
4563
|
-
var _a;
|
|
4565
|
+
function allocateInSlot(vm, children, owner) {
|
|
4566
|
+
var _a, _b;
|
|
4564
4567
|
|
|
4565
4568
|
const {
|
|
4566
|
-
cmpSlots:
|
|
4569
|
+
cmpSlots: {
|
|
4570
|
+
slotAssignments: oldSlotsMapping
|
|
4571
|
+
}
|
|
4567
4572
|
} = vm;
|
|
4568
|
-
const
|
|
4573
|
+
const cmpSlotsMapping = create(null);
|
|
4574
|
+
vm.cmpSlots = {
|
|
4575
|
+
owner,
|
|
4576
|
+
slotAssignments: cmpSlotsMapping
|
|
4577
|
+
};
|
|
4569
4578
|
|
|
4570
4579
|
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
4571
4580
|
const vnode = children[i];
|
|
@@ -4577,19 +4586,21 @@ var LWC = (function (exports) {
|
|
|
4577
4586
|
let slotName = '';
|
|
4578
4587
|
|
|
4579
4588
|
if (isVBaseElement(vnode)) {
|
|
4580
|
-
slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot)
|
|
4589
|
+
slotName = (_b = (_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) !== null && _b !== void 0 ? _b : '';
|
|
4590
|
+
} else if (isVScopedSlotFragment(vnode)) {
|
|
4591
|
+
slotName = vnode.slotName;
|
|
4581
4592
|
}
|
|
4582
4593
|
|
|
4583
|
-
const vnodes =
|
|
4594
|
+
const vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
|
|
4584
4595
|
ArrayPush$1.call(vnodes, vnode);
|
|
4585
4596
|
}
|
|
4586
4597
|
|
|
4587
4598
|
if (isFalse(vm.isDirty)) {
|
|
4588
4599
|
// We need to determine if the old allocation is really different from the new one
|
|
4589
4600
|
// and mark the vm as dirty
|
|
4590
|
-
const oldKeys = keys(
|
|
4601
|
+
const oldKeys = keys(oldSlotsMapping);
|
|
4591
4602
|
|
|
4592
|
-
if (oldKeys.length !== keys(
|
|
4603
|
+
if (oldKeys.length !== keys(cmpSlotsMapping).length) {
|
|
4593
4604
|
markComponentAsDirty(vm);
|
|
4594
4605
|
return;
|
|
4595
4606
|
}
|
|
@@ -4597,15 +4608,15 @@ var LWC = (function (exports) {
|
|
|
4597
4608
|
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
4598
4609
|
const key = oldKeys[i];
|
|
4599
4610
|
|
|
4600
|
-
if (isUndefined$1(
|
|
4611
|
+
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4601
4612
|
markComponentAsDirty(vm);
|
|
4602
4613
|
return;
|
|
4603
4614
|
}
|
|
4604
4615
|
|
|
4605
|
-
const oldVNodes =
|
|
4606
|
-
const vnodes =
|
|
4616
|
+
const oldVNodes = oldSlotsMapping[key];
|
|
4617
|
+
const vnodes = cmpSlotsMapping[key];
|
|
4607
4618
|
|
|
4608
|
-
for (let j = 0, a =
|
|
4619
|
+
for (let j = 0, a = cmpSlotsMapping[key].length; j < a; j += 1) {
|
|
4609
4620
|
if (oldVNodes[j] !== vnodes[j]) {
|
|
4610
4621
|
markComponentAsDirty(vm);
|
|
4611
4622
|
return;
|
|
@@ -4805,6 +4816,18 @@ var LWC = (function (exports) {
|
|
|
4805
4816
|
function addVNodeToChildLWC(vnode) {
|
|
4806
4817
|
ArrayPush$1.call(getVMBeingRendered().velements, vnode);
|
|
4807
4818
|
}
|
|
4819
|
+
// [s]coped [s]lot [f]actory
|
|
4820
|
+
function ssf(slotName, factory) {
|
|
4821
|
+
return {
|
|
4822
|
+
type: 6 /* VNodeType.ScopedSlotFragment */,
|
|
4823
|
+
factory,
|
|
4824
|
+
owner: getVMBeingRendered(),
|
|
4825
|
+
elm: undefined,
|
|
4826
|
+
sel: undefined,
|
|
4827
|
+
key: undefined,
|
|
4828
|
+
slotName,
|
|
4829
|
+
};
|
|
4830
|
+
}
|
|
4808
4831
|
// [st]atic node
|
|
4809
4832
|
function st(fragment, key) {
|
|
4810
4833
|
return {
|
|
@@ -4888,9 +4911,31 @@ var LWC = (function (exports) {
|
|
|
4888
4911
|
assert.isTrue(isArray$1(children), `h() 3rd argument children must be an array.`);
|
|
4889
4912
|
}
|
|
4890
4913
|
if (!isUndefined$1(slotset) &&
|
|
4891
|
-
!isUndefined$1(slotset
|
|
4892
|
-
slotset[slotName]
|
|
4893
|
-
|
|
4914
|
+
!isUndefined$1(slotset.slotAssignments) &&
|
|
4915
|
+
!isUndefined$1(slotset.slotAssignments[slotName]) &&
|
|
4916
|
+
slotset.slotAssignments[slotName].length !== 0) {
|
|
4917
|
+
children = slotset.slotAssignments[slotName].reduce((acc, vnode) => {
|
|
4918
|
+
// If the passed slot content is factory, evaluate it and use the produced vnodes
|
|
4919
|
+
if (vnode && isVScopedSlotFragment(vnode)) {
|
|
4920
|
+
const vmBeingRenderedInception = getVMBeingRendered();
|
|
4921
|
+
let children = [];
|
|
4922
|
+
// Evaluate in the scope of the slot content's owner
|
|
4923
|
+
// if a slotset is provided, there will always be an owner. The only case where owner is
|
|
4924
|
+
// undefined is for root components, but root components cannot accept slotted content
|
|
4925
|
+
setVMBeingRendered(slotset.owner);
|
|
4926
|
+
try {
|
|
4927
|
+
children = vnode.factory(data.slotData);
|
|
4928
|
+
}
|
|
4929
|
+
finally {
|
|
4930
|
+
setVMBeingRendered(vmBeingRenderedInception);
|
|
4931
|
+
}
|
|
4932
|
+
return ArrayConcat$1.call(acc, children);
|
|
4933
|
+
}
|
|
4934
|
+
else {
|
|
4935
|
+
// If the slot content is a static list of child nodes provided by the parent, nothing to do
|
|
4936
|
+
return ArrayConcat$1.call(acc, vnode);
|
|
4937
|
+
}
|
|
4938
|
+
}, []);
|
|
4894
4939
|
}
|
|
4895
4940
|
const vmBeingRendered = getVMBeingRendered();
|
|
4896
4941
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
@@ -5210,6 +5255,7 @@ var LWC = (function (exports) {
|
|
|
5210
5255
|
gid,
|
|
5211
5256
|
fid,
|
|
5212
5257
|
shc,
|
|
5258
|
+
ssf,
|
|
5213
5259
|
});
|
|
5214
5260
|
|
|
5215
5261
|
/*
|
|
@@ -5346,9 +5392,9 @@ var LWC = (function (exports) {
|
|
|
5346
5392
|
}
|
|
5347
5393
|
const { cmpSlots } = vm;
|
|
5348
5394
|
const { slots = EmptyArray } = html;
|
|
5349
|
-
for (const slotName in cmpSlots) {
|
|
5395
|
+
for (const slotName in cmpSlots.slotAssignments) {
|
|
5350
5396
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
5351
|
-
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}.`);
|
|
5397
|
+
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}.`);
|
|
5352
5398
|
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
5353
5399
|
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
5354
5400
|
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
@@ -5845,7 +5891,9 @@ var LWC = (function (exports) {
|
|
|
5845
5891
|
velements: EmptyArray,
|
|
5846
5892
|
cmpProps: create(null),
|
|
5847
5893
|
cmpFields: create(null),
|
|
5848
|
-
cmpSlots:
|
|
5894
|
+
cmpSlots: {
|
|
5895
|
+
slotAssignments: create(null)
|
|
5896
|
+
},
|
|
5849
5897
|
oar: create(null),
|
|
5850
5898
|
cmpTemplate: null,
|
|
5851
5899
|
hydrated: Boolean(hydrated),
|
|
@@ -7254,7 +7302,7 @@ var LWC = (function (exports) {
|
|
|
7254
7302
|
}
|
|
7255
7303
|
return ctor;
|
|
7256
7304
|
}
|
|
7257
|
-
/* version: 2.
|
|
7305
|
+
/* version: 2.27.0 */
|
|
7258
7306
|
|
|
7259
7307
|
/*
|
|
7260
7308
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8078,7 +8126,7 @@ var LWC = (function (exports) {
|
|
|
8078
8126
|
function isNull(obj) {
|
|
8079
8127
|
return obj === null;
|
|
8080
8128
|
}
|
|
8081
|
-
/** version: 2.
|
|
8129
|
+
/** version: 2.27.0 */
|
|
8082
8130
|
|
|
8083
8131
|
/*
|
|
8084
8132
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8657,7 +8705,7 @@ var LWC = (function (exports) {
|
|
|
8657
8705
|
});
|
|
8658
8706
|
freeze(LightningElement);
|
|
8659
8707
|
seal(LightningElement.prototype);
|
|
8660
|
-
/* version: 2.
|
|
8708
|
+
/* version: 2.27.0 */
|
|
8661
8709
|
|
|
8662
8710
|
exports.LightningElement = LightningElement;
|
|
8663
8711
|
exports.__unstable__ProfilerControl = profilerControl;
|