lwc 2.35.1 → 2.36.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 +258 -102
- package/dist/engine-dom/iife/es2017/engine-dom.js +258 -102
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +286 -58
- package/dist/engine-dom/iife/es5/engine-dom.js +365 -202
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +412 -131
- package/dist/engine-dom/umd/es2017/engine-dom.js +258 -102
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +286 -58
- package/dist/engine-dom/umd/es5/engine-dom.js +365 -202
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +412 -131
- package/dist/engine-server/commonjs/es2017/engine-server.js +126 -79
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +126 -79
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +9 -9
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +7 -7
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +9 -9
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +7 -7
- 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
|
@@ -18,16 +18,16 @@ var LWC = (function (exports) {
|
|
|
18
18
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
19
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
21
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
26
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
27
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
25
28
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
26
29
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
30
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
29
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
31
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
32
32
|
/* proxy-compat-disable */
|
|
33
33
|
/**
|
|
@@ -59,10 +59,10 @@ var LWC = (function (exports) {
|
|
|
59
59
|
}
|
|
60
60
|
var assert = /*#__PURE__*/Object.freeze({
|
|
61
61
|
__proto__: null,
|
|
62
|
+
fail: fail,
|
|
62
63
|
invariant: invariant,
|
|
63
|
-
isTrue: isTrue$1,
|
|
64
64
|
isFalse: isFalse$1,
|
|
65
|
-
|
|
65
|
+
isTrue: isTrue$1
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
/*
|
|
@@ -86,13 +86,18 @@ var LWC = (function (exports) {
|
|
|
86
86
|
setPrototypeOf = Object.setPrototypeOf;
|
|
87
87
|
var isArray$1 = Array.isArray;
|
|
88
88
|
var _Array$prototype = Array.prototype,
|
|
89
|
+
ArrayCopyWithin = _Array$prototype.copyWithin,
|
|
90
|
+
ArrayFill = _Array$prototype.fill,
|
|
89
91
|
ArrayFilter = _Array$prototype.filter,
|
|
90
92
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
91
93
|
ArrayJoin = _Array$prototype.join,
|
|
92
94
|
ArrayMap = _Array$prototype.map,
|
|
93
95
|
ArrayPop = _Array$prototype.pop,
|
|
94
96
|
ArrayPush$1 = _Array$prototype.push,
|
|
97
|
+
ArrayReverse = _Array$prototype.reverse,
|
|
98
|
+
ArrayShift = _Array$prototype.shift,
|
|
95
99
|
ArraySlice = _Array$prototype.slice,
|
|
100
|
+
ArraySort = _Array$prototype.sort,
|
|
96
101
|
ArraySplice = _Array$prototype.splice,
|
|
97
102
|
ArrayUnshift = _Array$prototype.unshift,
|
|
98
103
|
forEach = _Array$prototype.forEach;
|
|
@@ -310,7 +315,7 @@ var LWC = (function (exports) {
|
|
|
310
315
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
311
316
|
return propertyName;
|
|
312
317
|
}
|
|
313
|
-
/** version: 2.
|
|
318
|
+
/** version: 2.36.0 */
|
|
314
319
|
|
|
315
320
|
/**
|
|
316
321
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -382,7 +387,7 @@ var LWC = (function (exports) {
|
|
|
382
387
|
*/
|
|
383
388
|
function setFeatureFlagForTest(name, value) {
|
|
384
389
|
}
|
|
385
|
-
/** version: 2.
|
|
390
|
+
/** version: 2.36.0 */
|
|
386
391
|
|
|
387
392
|
/**
|
|
388
393
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -446,7 +451,7 @@ var LWC = (function (exports) {
|
|
|
446
451
|
}
|
|
447
452
|
}
|
|
448
453
|
}
|
|
449
|
-
/** version: 2.
|
|
454
|
+
/** version: 2.36.0 */
|
|
450
455
|
|
|
451
456
|
/*
|
|
452
457
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -466,7 +471,6 @@ var LWC = (function (exports) {
|
|
|
466
471
|
* SPDX-License-Identifier: MIT
|
|
467
472
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
468
473
|
*/
|
|
469
|
-
/** Callbacks to invoke when reporting is enabled **/
|
|
470
474
|
var onReportingEnabledCallbacks = [];
|
|
471
475
|
/** The currently assigned reporting dispatcher. */
|
|
472
476
|
var currentDispatcher$1 = noop;
|
|
@@ -486,23 +490,15 @@ var LWC = (function (exports) {
|
|
|
486
490
|
attachDispatcher: function attachDispatcher(dispatcher) {
|
|
487
491
|
enabled$1 = true;
|
|
488
492
|
currentDispatcher$1 = dispatcher;
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
498
|
-
// eslint-disable-next-line no-console
|
|
499
|
-
console.error('Could not invoke callback', err);
|
|
500
|
-
}
|
|
493
|
+
for (var _i3 = 0, _onReportingEnabledCa = onReportingEnabledCallbacks; _i3 < _onReportingEnabledCa.length; _i3++) {
|
|
494
|
+
var callback = _onReportingEnabledCa[_i3];
|
|
495
|
+
try {
|
|
496
|
+
callback();
|
|
497
|
+
} catch (err) {
|
|
498
|
+
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
499
|
+
// eslint-disable-next-line no-console
|
|
500
|
+
console.error('Could not invoke callback', err);
|
|
501
501
|
}
|
|
502
|
-
} catch (err) {
|
|
503
|
-
_iterator.e(err);
|
|
504
|
-
} finally {
|
|
505
|
-
_iterator.f();
|
|
506
502
|
}
|
|
507
503
|
onReportingEnabledCallbacks.length = 0; // clear the array
|
|
508
504
|
},
|
|
@@ -531,11 +527,11 @@ var LWC = (function (exports) {
|
|
|
531
527
|
/**
|
|
532
528
|
* Report to the current dispatcher, if there is one.
|
|
533
529
|
* @param reportingEventId
|
|
534
|
-
* @param
|
|
530
|
+
* @param payload - data to report
|
|
535
531
|
*/
|
|
536
|
-
function report(reportingEventId,
|
|
532
|
+
function report(reportingEventId, payload) {
|
|
537
533
|
if (enabled$1) {
|
|
538
|
-
currentDispatcher$1(reportingEventId,
|
|
534
|
+
currentDispatcher$1(reportingEventId, payload);
|
|
539
535
|
}
|
|
540
536
|
}
|
|
541
537
|
|
|
@@ -637,8 +633,8 @@ var LWC = (function (exports) {
|
|
|
637
633
|
if (!isUndefined$1(reactiveRecord)) {
|
|
638
634
|
var reactiveObservers = reactiveRecord[key];
|
|
639
635
|
if (!isUndefined$1(reactiveObservers)) {
|
|
640
|
-
for (var
|
|
641
|
-
var ro = reactiveObservers[
|
|
636
|
+
for (var _i4 = 0, len = reactiveObservers.length; _i4 < len; _i4 += 1) {
|
|
637
|
+
var ro = reactiveObservers[_i4];
|
|
642
638
|
ro.notify();
|
|
643
639
|
}
|
|
644
640
|
}
|
|
@@ -697,9 +693,9 @@ var LWC = (function (exports) {
|
|
|
697
693
|
var listeners = this.listeners;
|
|
698
694
|
var len = listeners.length;
|
|
699
695
|
if (len > 0) {
|
|
700
|
-
for (var
|
|
701
|
-
var set = listeners[
|
|
702
|
-
var pos = ArrayIndexOf.call(listeners[
|
|
696
|
+
for (var _i5 = 0; _i5 < len; _i5 += 1) {
|
|
697
|
+
var set = listeners[_i5];
|
|
698
|
+
var pos = ArrayIndexOf.call(listeners[_i5], this);
|
|
703
699
|
ArraySplice.call(set, pos, 1);
|
|
704
700
|
}
|
|
705
701
|
listeners.length = 0;
|
|
@@ -751,8 +747,8 @@ var LWC = (function (exports) {
|
|
|
751
747
|
function flushCallbackQueue() {
|
|
752
748
|
var callbacks = nextTickCallbackQueue;
|
|
753
749
|
nextTickCallbackQueue = []; // reset to a new queue
|
|
754
|
-
for (var
|
|
755
|
-
callbacks[
|
|
750
|
+
for (var _i6 = 0, len = callbacks.length; _i6 < len; _i6 += 1) {
|
|
751
|
+
callbacks[_i6]();
|
|
756
752
|
}
|
|
757
753
|
}
|
|
758
754
|
function addCallbackToNextTick(callback) {
|
|
@@ -774,11 +770,11 @@ var LWC = (function (exports) {
|
|
|
774
770
|
function parseStyleText(cssText) {
|
|
775
771
|
var styleMap = {};
|
|
776
772
|
var declarations = cssText.split(DECLARATION_DELIMITER);
|
|
777
|
-
var
|
|
778
|
-
|
|
773
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
774
|
+
_step;
|
|
779
775
|
try {
|
|
780
|
-
for (
|
|
781
|
-
var declaration =
|
|
776
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
777
|
+
var declaration = _step.value;
|
|
782
778
|
if (declaration) {
|
|
783
779
|
var _declaration$split = declaration.split(PROPERTY_DELIMITER),
|
|
784
780
|
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
@@ -790,20 +786,28 @@ var LWC = (function (exports) {
|
|
|
790
786
|
}
|
|
791
787
|
}
|
|
792
788
|
} catch (err) {
|
|
793
|
-
|
|
789
|
+
_iterator.e(err);
|
|
794
790
|
} finally {
|
|
795
|
-
|
|
791
|
+
_iterator.f();
|
|
796
792
|
}
|
|
797
793
|
return styleMap;
|
|
798
794
|
}
|
|
799
795
|
// Make a shallow copy of an object but omit the given key
|
|
800
796
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
801
797
|
var result = {};
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
798
|
+
var _iterator2 = _createForOfIteratorHelper(keys(object)),
|
|
799
|
+
_step2;
|
|
800
|
+
try {
|
|
801
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
802
|
+
var key = _step2.value;
|
|
803
|
+
if (key !== keyToOmit) {
|
|
804
|
+
result[key] = object[key];
|
|
805
|
+
}
|
|
806
806
|
}
|
|
807
|
+
} catch (err) {
|
|
808
|
+
_iterator2.e(err);
|
|
809
|
+
} finally {
|
|
810
|
+
_iterator2.f();
|
|
807
811
|
}
|
|
808
812
|
return result;
|
|
809
813
|
}
|
|
@@ -814,7 +818,7 @@ var LWC = (function (exports) {
|
|
|
814
818
|
try {
|
|
815
819
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
816
820
|
var stylesheet = _step3.value;
|
|
817
|
-
if (!
|
|
821
|
+
if (!isArray$1(stylesheet)) {
|
|
818
822
|
list.push(stylesheet);
|
|
819
823
|
} else {
|
|
820
824
|
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
@@ -2067,32 +2071,33 @@ var LWC = (function (exports) {
|
|
|
2067
2071
|
wire = vm.def.wire;
|
|
2068
2072
|
var wiredConnecting = context.wiredConnecting = [];
|
|
2069
2073
|
var wiredDisconnecting = context.wiredDisconnecting = [];
|
|
2070
|
-
|
|
2074
|
+
var _loop2 = function _loop2() {
|
|
2071
2075
|
var descriptor = wire[fieldNameOrMethod];
|
|
2072
2076
|
var wireDef = WireMetaMap.get(descriptor);
|
|
2073
2077
|
if (!isUndefined$1(wireDef)) {
|
|
2074
|
-
(
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
if (
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
return;
|
|
2086
|
-
}
|
|
2078
|
+
var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
|
|
2079
|
+
connector = _createConnector.connector,
|
|
2080
|
+
computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
|
|
2081
|
+
resetConfigWatcher = _createConnector.resetConfigWatcher;
|
|
2082
|
+
var hasDynamicParams = wireDef.dynamic.length > 0;
|
|
2083
|
+
ArrayPush$1.call(wiredConnecting, function () {
|
|
2084
|
+
connector.connect();
|
|
2085
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
2086
|
+
if (hasDynamicParams) {
|
|
2087
|
+
Promise.resolve().then(computeConfigAndUpdate);
|
|
2088
|
+
return;
|
|
2087
2089
|
}
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
})
|
|
2090
|
+
}
|
|
2091
|
+
computeConfigAndUpdate();
|
|
2092
|
+
});
|
|
2093
|
+
ArrayPush$1.call(wiredDisconnecting, function () {
|
|
2094
|
+
connector.disconnect();
|
|
2095
|
+
resetConfigWatcher();
|
|
2096
|
+
});
|
|
2095
2097
|
}
|
|
2098
|
+
};
|
|
2099
|
+
for (var fieldNameOrMethod in wire) {
|
|
2100
|
+
_loop2();
|
|
2096
2101
|
}
|
|
2097
2102
|
}
|
|
2098
2103
|
function connectWireAdapters(vm) {
|
|
@@ -3773,7 +3778,12 @@ var LWC = (function (exports) {
|
|
|
3773
3778
|
} else if (isVScopedSlotFragment(vnode)) {
|
|
3774
3779
|
slotName = vnode.slotName;
|
|
3775
3780
|
}
|
|
3776
|
-
|
|
3781
|
+
// Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
|
|
3782
|
+
// but elm.setAttribute('slot', Symbol(1)) is an error.
|
|
3783
|
+
// the following line also throws same error for symbols
|
|
3784
|
+
// Similar for Object.create(null)
|
|
3785
|
+
var normalizedSlotName = '' + slotName;
|
|
3786
|
+
var vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
|
|
3777
3787
|
ArrayPush$1.call(vnodes, vnode);
|
|
3778
3788
|
}
|
|
3779
3789
|
vm.cmpSlots = {
|
|
@@ -5195,7 +5205,7 @@ var LWC = (function (exports) {
|
|
|
5195
5205
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
5196
5206
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
5197
5207
|
}
|
|
5198
|
-
function reportViolation(source, target, attrName) {
|
|
5208
|
+
function reportViolation$1(source, target, attrName) {
|
|
5199
5209
|
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
5200
5210
|
// shadow for a violation to be detected.
|
|
5201
5211
|
var vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
@@ -5206,7 +5216,10 @@ var LWC = (function (exports) {
|
|
|
5206
5216
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
5207
5217
|
return;
|
|
5208
5218
|
}
|
|
5209
|
-
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */,
|
|
5219
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
5220
|
+
tagName: vm.tagName,
|
|
5221
|
+
attributeName: attrName
|
|
5222
|
+
});
|
|
5210
5223
|
}
|
|
5211
5224
|
function parseIdRefAttributeValue(attrValue) {
|
|
5212
5225
|
// split on whitespace and skip empty strings after splitting
|
|
@@ -5236,7 +5249,7 @@ var LWC = (function (exports) {
|
|
|
5236
5249
|
var sourceElement = sourceElements[_i33];
|
|
5237
5250
|
var sourceRoot = sourceElement.getRootNode();
|
|
5238
5251
|
if (sourceRoot !== root) {
|
|
5239
|
-
reportViolation(sourceElement, elm, idRefAttrName);
|
|
5252
|
+
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
5240
5253
|
break;
|
|
5241
5254
|
}
|
|
5242
5255
|
}
|
|
@@ -5259,7 +5272,7 @@ var LWC = (function (exports) {
|
|
|
5259
5272
|
var targetRoot = target.getRootNode();
|
|
5260
5273
|
if (targetRoot !== root) {
|
|
5261
5274
|
// target element's shadow root is not the same as ours
|
|
5262
|
-
reportViolation(elm, target, attrName);
|
|
5275
|
+
reportViolation$1(elm, target, attrName);
|
|
5263
5276
|
}
|
|
5264
5277
|
}
|
|
5265
5278
|
}
|
|
@@ -5273,7 +5286,7 @@ var LWC = (function (exports) {
|
|
|
5273
5286
|
var enabled = false;
|
|
5274
5287
|
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
5275
5288
|
// reporting is not enabled. It should also only run once
|
|
5276
|
-
function enableDetection() {
|
|
5289
|
+
function enableDetection$1() {
|
|
5277
5290
|
if (enabled) {
|
|
5278
5291
|
return; // don't double-apply the patches
|
|
5279
5292
|
}
|
|
@@ -5328,7 +5341,102 @@ var LWC = (function (exports) {
|
|
|
5328
5341
|
// Always run detection in dev mode, so we can at least print to the console
|
|
5329
5342
|
{
|
|
5330
5343
|
// In prod mode, only enable detection if reporting is enabled
|
|
5331
|
-
onReportingEnabled(enableDetection);
|
|
5344
|
+
onReportingEnabled(enableDetection$1);
|
|
5345
|
+
}
|
|
5346
|
+
}
|
|
5347
|
+
|
|
5348
|
+
/*
|
|
5349
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5350
|
+
* All rights reserved.
|
|
5351
|
+
* SPDX-License-Identifier: MIT
|
|
5352
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5353
|
+
*/
|
|
5354
|
+
//
|
|
5355
|
+
// The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
|
|
5356
|
+
// legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
|
|
5357
|
+
//
|
|
5358
|
+
// See the README for @lwc/aria-reflection
|
|
5359
|
+
var NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
|
|
5360
|
+
function isLightningElement(elm) {
|
|
5361
|
+
// The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
|
|
5362
|
+
// In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
|
|
5363
|
+
return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
|
|
5364
|
+
}
|
|
5365
|
+
function findVM(elm) {
|
|
5366
|
+
// If it's a shadow DOM component, then it has a host
|
|
5367
|
+
var _elm$getRootNode = elm.getRootNode(),
|
|
5368
|
+
host = _elm$getRootNode.host;
|
|
5369
|
+
var vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
|
|
5370
|
+
if (!isUndefined$1(vm)) {
|
|
5371
|
+
return vm;
|
|
5372
|
+
}
|
|
5373
|
+
// Else it might be a light DOM component. Walk up the tree trying to find the owner
|
|
5374
|
+
var parentElement = elm;
|
|
5375
|
+
while (!isNull(parentElement = parentElement.parentElement)) {
|
|
5376
|
+
if (isLightningElement(parentElement)) {
|
|
5377
|
+
var _vm = getAssociatedVMIfPresent(parentElement);
|
|
5378
|
+
if (!isUndefined$1(_vm)) {
|
|
5379
|
+
return _vm;
|
|
5380
|
+
}
|
|
5381
|
+
}
|
|
5382
|
+
}
|
|
5383
|
+
// If we return undefined, it's because the element was rendered wholly outside a LightningElement
|
|
5384
|
+
}
|
|
5385
|
+
|
|
5386
|
+
function checkAndReportViolation(elm, prop) {
|
|
5387
|
+
if (!isLightningElement(elm)) {
|
|
5388
|
+
var vm = findVM(elm);
|
|
5389
|
+
report(2 /* ReportingEventId.NonStandardAriaReflection */, {
|
|
5390
|
+
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
5391
|
+
propertyName: prop
|
|
5392
|
+
});
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
function enableDetection() {
|
|
5396
|
+
var _Element = Element,
|
|
5397
|
+
prototype = _Element.prototype;
|
|
5398
|
+
var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
5399
|
+
_step7;
|
|
5400
|
+
try {
|
|
5401
|
+
var _loop3 = function _loop3() {
|
|
5402
|
+
var prop = _step7.value;
|
|
5403
|
+
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
5404
|
+
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
5405
|
+
// This happens automatically because of the ordering of imports.
|
|
5406
|
+
if ("production" !== 'production') ;
|
|
5407
|
+
// @ts-ignore
|
|
5408
|
+
var _get4 = descriptor.get,
|
|
5409
|
+
_set4 = descriptor.set;
|
|
5410
|
+
defineProperty(prototype, prop, {
|
|
5411
|
+
get: function get() {
|
|
5412
|
+
checkAndReportViolation(this, prop);
|
|
5413
|
+
return _get4.call(this);
|
|
5414
|
+
},
|
|
5415
|
+
set: function set(val) {
|
|
5416
|
+
checkAndReportViolation(this, prop);
|
|
5417
|
+
return _set4.call(this, val);
|
|
5418
|
+
},
|
|
5419
|
+
configurable: true,
|
|
5420
|
+
enumerable: true
|
|
5421
|
+
});
|
|
5422
|
+
};
|
|
5423
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
5424
|
+
_loop3();
|
|
5425
|
+
}
|
|
5426
|
+
} catch (err) {
|
|
5427
|
+
_iterator7.e(err);
|
|
5428
|
+
} finally {
|
|
5429
|
+
_iterator7.f();
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5432
|
+
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
5433
|
+
{
|
|
5434
|
+
if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
5435
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
5436
|
+
{
|
|
5437
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
5438
|
+
onReportingEnabled(enableDetection);
|
|
5439
|
+
}
|
|
5332
5440
|
}
|
|
5333
5441
|
}
|
|
5334
5442
|
|
|
@@ -5753,6 +5861,121 @@ var LWC = (function (exports) {
|
|
|
5753
5861
|
hooksAreSet = true;
|
|
5754
5862
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5755
5863
|
}
|
|
5864
|
+
|
|
5865
|
+
/*
|
|
5866
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5867
|
+
* All rights reserved.
|
|
5868
|
+
* SPDX-License-Identifier: MIT
|
|
5869
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5870
|
+
*/
|
|
5871
|
+
// See @lwc/engine-core/src/framework/template.ts
|
|
5872
|
+
var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
5873
|
+
// Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
|
|
5874
|
+
var STYLESHEET_PROPS = [
|
|
5875
|
+
// SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
|
|
5876
|
+
'$scoped$'];
|
|
5877
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
5878
|
+
var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
5879
|
+
var mutationTrackingDisabled = false;
|
|
5880
|
+
function getOriginalArrayMethod(prop) {
|
|
5881
|
+
switch (prop) {
|
|
5882
|
+
case 'pop':
|
|
5883
|
+
return ArrayPop;
|
|
5884
|
+
case 'push':
|
|
5885
|
+
return ArrayPush$1;
|
|
5886
|
+
case 'shift':
|
|
5887
|
+
return ArrayShift;
|
|
5888
|
+
case 'unshift':
|
|
5889
|
+
return ArrayUnshift;
|
|
5890
|
+
case 'reverse':
|
|
5891
|
+
return ArrayReverse;
|
|
5892
|
+
case 'sort':
|
|
5893
|
+
return ArraySort;
|
|
5894
|
+
case 'fill':
|
|
5895
|
+
return ArrayFill;
|
|
5896
|
+
case 'splice':
|
|
5897
|
+
return ArraySplice;
|
|
5898
|
+
case 'copyWithin':
|
|
5899
|
+
return ArrayCopyWithin;
|
|
5900
|
+
}
|
|
5901
|
+
}
|
|
5902
|
+
function reportViolation(type, eventId, prop) {
|
|
5903
|
+
report(eventId, {
|
|
5904
|
+
propertyName: prop
|
|
5905
|
+
});
|
|
5906
|
+
}
|
|
5907
|
+
function reportTemplateViolation(prop) {
|
|
5908
|
+
reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
|
|
5909
|
+
}
|
|
5910
|
+
function reportStylesheetViolation(prop) {
|
|
5911
|
+
reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
|
|
5912
|
+
}
|
|
5913
|
+
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
5914
|
+
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
5915
|
+
function warnOnArrayMutation(stylesheets) {
|
|
5916
|
+
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
5917
|
+
// we can at least warn when they use the most common mutation methods.
|
|
5918
|
+
var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
5919
|
+
_step8;
|
|
5920
|
+
try {
|
|
5921
|
+
var _loop4 = function _loop4() {
|
|
5922
|
+
var prop = _step8.value;
|
|
5923
|
+
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
5924
|
+
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
5925
|
+
reportTemplateViolation('stylesheets');
|
|
5926
|
+
// @ts-ignore
|
|
5927
|
+
return originalArrayMethod.apply(this, arguments);
|
|
5928
|
+
};
|
|
5929
|
+
};
|
|
5930
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
5931
|
+
_loop4();
|
|
5932
|
+
}
|
|
5933
|
+
} catch (err) {
|
|
5934
|
+
_iterator8.e(err);
|
|
5935
|
+
} finally {
|
|
5936
|
+
_iterator8.f();
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
5940
|
+
// `stylesheet.$scoped$ = true`
|
|
5941
|
+
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
5942
|
+
var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
5943
|
+
_step9;
|
|
5944
|
+
try {
|
|
5945
|
+
var _loop5 = function _loop5() {
|
|
5946
|
+
var prop = _step9.value;
|
|
5947
|
+
var value = stylesheet[prop];
|
|
5948
|
+
defineProperty(stylesheet, prop, {
|
|
5949
|
+
enumerable: true,
|
|
5950
|
+
configurable: true,
|
|
5951
|
+
get: function get() {
|
|
5952
|
+
return value;
|
|
5953
|
+
},
|
|
5954
|
+
set: function set(newValue) {
|
|
5955
|
+
reportStylesheetViolation(prop);
|
|
5956
|
+
value = newValue;
|
|
5957
|
+
}
|
|
5958
|
+
});
|
|
5959
|
+
};
|
|
5960
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
5961
|
+
_loop5();
|
|
5962
|
+
}
|
|
5963
|
+
} catch (err) {
|
|
5964
|
+
_iterator9.e(err);
|
|
5965
|
+
} finally {
|
|
5966
|
+
_iterator9.f();
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
5970
|
+
function trackStylesheetsMutation(stylesheets) {
|
|
5971
|
+
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
5972
|
+
if (isArray$1(subStylesheets)) {
|
|
5973
|
+
warnOnArrayMutation(subStylesheets);
|
|
5974
|
+
} else {
|
|
5975
|
+
warnOnStylesheetFunctionMutation(subStylesheets);
|
|
5976
|
+
}
|
|
5977
|
+
});
|
|
5978
|
+
}
|
|
5756
5979
|
// Deeply freeze the entire array (of arrays) of stylesheet factory functions
|
|
5757
5980
|
function deepFreeze(stylesheets) {
|
|
5758
5981
|
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
@@ -5771,7 +5994,80 @@ var LWC = (function (exports) {
|
|
|
5771
5994
|
}
|
|
5772
5995
|
}
|
|
5773
5996
|
}
|
|
5997
|
+
function trackMutations(tmpl) {
|
|
5998
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
5999
|
+
trackStylesheetsMutation(tmpl.stylesheets);
|
|
6000
|
+
}
|
|
6001
|
+
var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
6002
|
+
_step10;
|
|
6003
|
+
try {
|
|
6004
|
+
var _loop6 = function _loop6() {
|
|
6005
|
+
var prop = _step10.value;
|
|
6006
|
+
var value = tmpl[prop];
|
|
6007
|
+
defineProperty(tmpl, prop, {
|
|
6008
|
+
enumerable: true,
|
|
6009
|
+
configurable: true,
|
|
6010
|
+
get: function get() {
|
|
6011
|
+
return value;
|
|
6012
|
+
},
|
|
6013
|
+
set: function set(newValue) {
|
|
6014
|
+
if (!mutationTrackingDisabled) {
|
|
6015
|
+
reportTemplateViolation(prop);
|
|
6016
|
+
}
|
|
6017
|
+
value = newValue;
|
|
6018
|
+
}
|
|
6019
|
+
});
|
|
6020
|
+
};
|
|
6021
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6022
|
+
_loop6();
|
|
6023
|
+
}
|
|
6024
|
+
} catch (err) {
|
|
6025
|
+
_iterator10.e(err);
|
|
6026
|
+
} finally {
|
|
6027
|
+
_iterator10.f();
|
|
6028
|
+
}
|
|
6029
|
+
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
6030
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6031
|
+
enumerable: true,
|
|
6032
|
+
configurable: true,
|
|
6033
|
+
get: originalDescriptor.get,
|
|
6034
|
+
set: function set(value) {
|
|
6035
|
+
reportTemplateViolation('stylesheetTokens');
|
|
6036
|
+
// Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
|
|
6037
|
+
mutationTrackingDisabled = true;
|
|
6038
|
+
originalDescriptor.set.call(this, value);
|
|
6039
|
+
mutationTrackingDisabled = false;
|
|
6040
|
+
}
|
|
6041
|
+
});
|
|
6042
|
+
}
|
|
6043
|
+
function addLegacyStylesheetTokensShim(tmpl) {
|
|
6044
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
6045
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
6046
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6047
|
+
enumerable: true,
|
|
6048
|
+
configurable: true,
|
|
6049
|
+
get: function get() {
|
|
6050
|
+
var stylesheetToken = this.stylesheetToken;
|
|
6051
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
6052
|
+
return stylesheetToken;
|
|
6053
|
+
}
|
|
6054
|
+
// Shim for the old `stylesheetTokens` property
|
|
6055
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
6056
|
+
return {
|
|
6057
|
+
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
6058
|
+
shadowAttribute: stylesheetToken
|
|
6059
|
+
};
|
|
6060
|
+
},
|
|
6061
|
+
set: function set(value) {
|
|
6062
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
6063
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
6064
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
6065
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
6066
|
+
}
|
|
6067
|
+
});
|
|
6068
|
+
}
|
|
5774
6069
|
function freezeTemplate(tmpl) {
|
|
6070
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
5775
6071
|
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
5776
6072
|
// Deep freeze the template
|
|
5777
6073
|
freeze(tmpl);
|
|
@@ -5779,31 +6075,16 @@ var LWC = (function (exports) {
|
|
|
5779
6075
|
deepFreeze(tmpl.stylesheets);
|
|
5780
6076
|
}
|
|
5781
6077
|
} else {
|
|
5782
|
-
//
|
|
5783
|
-
//
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
}
|
|
5793
|
-
// Shim for the old `stylesheetTokens` property
|
|
5794
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5795
|
-
return {
|
|
5796
|
-
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
5797
|
-
shadowAttribute: stylesheetToken
|
|
5798
|
-
};
|
|
5799
|
-
},
|
|
5800
|
-
set: function set(value) {
|
|
5801
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5802
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5803
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5804
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5805
|
-
}
|
|
5806
|
-
});
|
|
6078
|
+
// template is not frozen - shim, report, and warn
|
|
6079
|
+
// this shim should be applied in both dev and prod
|
|
6080
|
+
addLegacyStylesheetTokensShim(tmpl);
|
|
6081
|
+
// When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
|
|
6082
|
+
{
|
|
6083
|
+
// In prod mode, we only track mutations if reporting is enabled
|
|
6084
|
+
onReportingEnabled(function () {
|
|
6085
|
+
trackMutations(tmpl);
|
|
6086
|
+
});
|
|
6087
|
+
}
|
|
5807
6088
|
}
|
|
5808
6089
|
}
|
|
5809
6090
|
|
|
@@ -6017,7 +6298,7 @@ var LWC = (function (exports) {
|
|
|
6017
6298
|
var cachedConstructors = new Map();
|
|
6018
6299
|
var elementsUpgradedOutsideLWC = new WeakSet();
|
|
6019
6300
|
var elementBeingUpgradedByLWC = false;
|
|
6020
|
-
// Creates a constructor that is intended to be used as a
|
|
6301
|
+
// Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
|
|
6021
6302
|
// passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
|
|
6022
6303
|
// Another benefit is that only LWC can create components that actually do anything – if you do
|
|
6023
6304
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
@@ -6066,7 +6347,7 @@ var LWC = (function (exports) {
|
|
|
6066
6347
|
}
|
|
6067
6348
|
return UpgradableConstructor;
|
|
6068
6349
|
};
|
|
6069
|
-
var
|
|
6350
|
+
var createCustomElementUsingUpgradableConstructor = function createCustomElementUsingUpgradableConstructor(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
6070
6351
|
// use global custom elements registry
|
|
6071
6352
|
var UpgradableConstructor = cachedConstructors.get(tagName);
|
|
6072
6353
|
if (isUndefined$1(UpgradableConstructor)) {
|
|
@@ -6093,7 +6374,7 @@ var LWC = (function (exports) {
|
|
|
6093
6374
|
*/
|
|
6094
6375
|
/**
|
|
6095
6376
|
* Create a scoped registry, i.e. a function that can create custom elements whose tag names
|
|
6096
|
-
* do not conflict with
|
|
6377
|
+
* do not conflict with third-party custom elements having the same tag name.
|
|
6097
6378
|
*/
|
|
6098
6379
|
function createScopedRegistry() {
|
|
6099
6380
|
if (!hasCustomElements) {
|
|
@@ -6424,17 +6705,17 @@ var LWC = (function (exports) {
|
|
|
6424
6705
|
function flushPendingWhenDefinedCallbacks(tagName, ctor) {
|
|
6425
6706
|
var resolvers = pendingWhenDefinedCallbacks.get(tagName);
|
|
6426
6707
|
if (!isUndefined$1(resolvers)) {
|
|
6427
|
-
var
|
|
6428
|
-
|
|
6708
|
+
var _iterator11 = _createForOfIteratorHelper(resolvers),
|
|
6709
|
+
_step11;
|
|
6429
6710
|
try {
|
|
6430
|
-
for (
|
|
6431
|
-
var resolver =
|
|
6711
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6712
|
+
var resolver = _step11.value;
|
|
6432
6713
|
resolver(ctor);
|
|
6433
6714
|
}
|
|
6434
6715
|
} catch (err) {
|
|
6435
|
-
|
|
6716
|
+
_iterator11.e(err);
|
|
6436
6717
|
} finally {
|
|
6437
|
-
|
|
6718
|
+
_iterator11.f();
|
|
6438
6719
|
}
|
|
6439
6720
|
}
|
|
6440
6721
|
pendingWhenDefinedCallbacks.delete(tagName);
|
|
@@ -6484,11 +6765,11 @@ var LWC = (function (exports) {
|
|
|
6484
6765
|
var awaiting = awaitingUpgrade.get(tagName);
|
|
6485
6766
|
if (!isUndefined$1(awaiting)) {
|
|
6486
6767
|
awaitingUpgrade.delete(tagName);
|
|
6487
|
-
var
|
|
6488
|
-
|
|
6768
|
+
var _iterator12 = _createForOfIteratorHelper(awaiting),
|
|
6769
|
+
_step12;
|
|
6489
6770
|
try {
|
|
6490
|
-
for (
|
|
6491
|
-
var element =
|
|
6771
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6772
|
+
var element = _step12.value;
|
|
6492
6773
|
var registeredDefinition = pendingRegistryForElement.get(element);
|
|
6493
6774
|
// At this point, registeredDefinition should never be undefined because awaitingUpgrade
|
|
6494
6775
|
// is only populated when we haven't run internalUpgrade yet, and we only populate
|
|
@@ -6500,9 +6781,9 @@ var LWC = (function (exports) {
|
|
|
6500
6781
|
}
|
|
6501
6782
|
}
|
|
6502
6783
|
} catch (err) {
|
|
6503
|
-
|
|
6784
|
+
_iterator12.e(err);
|
|
6504
6785
|
} finally {
|
|
6505
|
-
|
|
6786
|
+
_iterator12.f();
|
|
6506
6787
|
}
|
|
6507
6788
|
}
|
|
6508
6789
|
// If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
|
|
@@ -6699,10 +6980,10 @@ var LWC = (function (exports) {
|
|
|
6699
6980
|
* We have three modes for creating custom elements:
|
|
6700
6981
|
*
|
|
6701
6982
|
* 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
|
|
6702
|
-
* 2. "
|
|
6703
|
-
*
|
|
6704
|
-
*
|
|
6705
|
-
* constructor, which allows us to have completely customized functionality for different components.
|
|
6983
|
+
* 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
|
|
6984
|
+
* via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
|
|
6985
|
+
* a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
|
|
6986
|
+
* constructor"), which allows us to have completely customized functionality for different components.
|
|
6706
6987
|
* 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
|
|
6707
6988
|
* elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
|
|
6708
6989
|
* between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
|
|
@@ -6713,8 +6994,8 @@ var LWC = (function (exports) {
|
|
|
6713
6994
|
if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
|
|
6714
6995
|
createCustomElement = createCustomElementScoped;
|
|
6715
6996
|
} else {
|
|
6716
|
-
// use global
|
|
6717
|
-
createCustomElement =
|
|
6997
|
+
// use the global registry, with an upgradable constructor for the defined custom element
|
|
6998
|
+
createCustomElement = createCustomElementUsingUpgradableConstructor;
|
|
6718
6999
|
}
|
|
6719
7000
|
} else {
|
|
6720
7001
|
// no registry available here
|
|
@@ -6768,10 +7049,10 @@ var LWC = (function (exports) {
|
|
|
6768
7049
|
}
|
|
6769
7050
|
var assert = /*#__PURE__*/Object.freeze({
|
|
6770
7051
|
__proto__: null,
|
|
7052
|
+
fail: fail,
|
|
6771
7053
|
invariant: invariant,
|
|
6772
|
-
isTrue: isTrue$1,
|
|
6773
7054
|
isFalse: isFalse$1,
|
|
6774
|
-
|
|
7055
|
+
isTrue: isTrue$1
|
|
6775
7056
|
});
|
|
6776
7057
|
function isUndefined(obj) {
|
|
6777
7058
|
return obj === undefined;
|
|
@@ -6779,7 +7060,7 @@ var LWC = (function (exports) {
|
|
|
6779
7060
|
function isNull(obj) {
|
|
6780
7061
|
return obj === null;
|
|
6781
7062
|
}
|
|
6782
|
-
/** version: 2.
|
|
7063
|
+
/** version: 2.36.0 */
|
|
6783
7064
|
|
|
6784
7065
|
/*
|
|
6785
7066
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6838,17 +7119,17 @@ var LWC = (function (exports) {
|
|
|
6838
7119
|
exports.createFragment = function (html) {
|
|
6839
7120
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6840
7121
|
if (!isUndefined(wrapperTags)) {
|
|
6841
|
-
var
|
|
6842
|
-
|
|
7122
|
+
var _iterator13 = _createForOfIteratorHelper(wrapperTags),
|
|
7123
|
+
_step13;
|
|
6843
7124
|
try {
|
|
6844
|
-
for (
|
|
6845
|
-
var wrapperTag =
|
|
7125
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
7126
|
+
var wrapperTag = _step13.value;
|
|
6846
7127
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6847
7128
|
}
|
|
6848
7129
|
} catch (err) {
|
|
6849
|
-
|
|
7130
|
+
_iterator13.e(err);
|
|
6850
7131
|
} finally {
|
|
6851
|
-
|
|
7132
|
+
_iterator13.f();
|
|
6852
7133
|
}
|
|
6853
7134
|
}
|
|
6854
7135
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -7338,7 +7619,7 @@ var LWC = (function (exports) {
|
|
|
7338
7619
|
});
|
|
7339
7620
|
freeze(LightningElement);
|
|
7340
7621
|
seal(LightningElement.prototype);
|
|
7341
|
-
/* version: 2.
|
|
7622
|
+
/* version: 2.36.0 */
|
|
7342
7623
|
|
|
7343
7624
|
exports.LightningElement = LightningElement;
|
|
7344
7625
|
exports.__unstable__ProfilerControl = profilerControl;
|