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
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
22
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
23
|
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."); }
|
|
24
|
-
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)
|
|
24
|
+
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; } }
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
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; } } }; }
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
26
29
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
30
|
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); } }
|
|
28
31
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
32
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
30
33
|
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); }
|
|
31
|
-
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; } } }; }
|
|
32
|
-
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); }
|
|
33
|
-
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; }
|
|
34
34
|
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); }
|
|
35
35
|
/* proxy-compat-disable */
|
|
36
36
|
/**
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
}
|
|
63
63
|
var assert = /*#__PURE__*/Object.freeze({
|
|
64
64
|
__proto__: null,
|
|
65
|
+
fail: fail,
|
|
65
66
|
invariant: invariant,
|
|
66
|
-
isTrue: isTrue$1,
|
|
67
67
|
isFalse: isFalse$1,
|
|
68
|
-
|
|
68
|
+
isTrue: isTrue$1
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
/*
|
|
@@ -330,9 +330,9 @@
|
|
|
330
330
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
331
331
|
*/
|
|
332
332
|
// Increment whenever the LWC template compiler changes
|
|
333
|
-
var LWC_VERSION = "2.
|
|
333
|
+
var LWC_VERSION = "2.36.0";
|
|
334
334
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
335
|
-
/** version: 2.
|
|
335
|
+
/** version: 2.36.0 */
|
|
336
336
|
|
|
337
337
|
/**
|
|
338
338
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
setFeatureFlag(name, value);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
/** version: 2.
|
|
416
|
+
/** version: 2.36.0 */
|
|
417
417
|
|
|
418
418
|
/**
|
|
419
419
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
/** version: 2.
|
|
480
|
+
/** version: 2.36.0 */
|
|
481
481
|
|
|
482
482
|
/*
|
|
483
483
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -543,7 +543,6 @@
|
|
|
543
543
|
* SPDX-License-Identifier: MIT
|
|
544
544
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
545
545
|
*/
|
|
546
|
-
/** Callbacks to invoke when reporting is enabled **/
|
|
547
546
|
var onReportingEnabledCallbacks = [];
|
|
548
547
|
/** The currently assigned reporting dispatcher. */
|
|
549
548
|
var currentDispatcher$1 = noop;
|
|
@@ -563,23 +562,15 @@
|
|
|
563
562
|
attachDispatcher: function attachDispatcher(dispatcher) {
|
|
564
563
|
enabled$1 = true;
|
|
565
564
|
currentDispatcher$1 = dispatcher;
|
|
566
|
-
var
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
575
|
-
// eslint-disable-next-line no-console
|
|
576
|
-
console.error('Could not invoke callback', err);
|
|
577
|
-
}
|
|
565
|
+
for (var _i3 = 0, _onReportingEnabledCa = onReportingEnabledCallbacks; _i3 < _onReportingEnabledCa.length; _i3++) {
|
|
566
|
+
var callback = _onReportingEnabledCa[_i3];
|
|
567
|
+
try {
|
|
568
|
+
callback();
|
|
569
|
+
} catch (err) {
|
|
570
|
+
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
571
|
+
// eslint-disable-next-line no-console
|
|
572
|
+
console.error('Could not invoke callback', err);
|
|
578
573
|
}
|
|
579
|
-
} catch (err) {
|
|
580
|
-
_iterator.e(err);
|
|
581
|
-
} finally {
|
|
582
|
-
_iterator.f();
|
|
583
574
|
}
|
|
584
575
|
onReportingEnabledCallbacks.length = 0; // clear the array
|
|
585
576
|
},
|
|
@@ -608,11 +599,11 @@
|
|
|
608
599
|
/**
|
|
609
600
|
* Report to the current dispatcher, if there is one.
|
|
610
601
|
* @param reportingEventId
|
|
611
|
-
* @param
|
|
602
|
+
* @param payload - data to report
|
|
612
603
|
*/
|
|
613
|
-
function report(reportingEventId,
|
|
604
|
+
function report(reportingEventId, payload) {
|
|
614
605
|
if (enabled$1) {
|
|
615
|
-
currentDispatcher$1(reportingEventId,
|
|
606
|
+
currentDispatcher$1(reportingEventId, payload);
|
|
616
607
|
}
|
|
617
608
|
}
|
|
618
609
|
|
|
@@ -733,8 +724,8 @@
|
|
|
733
724
|
if (!isUndefined$1(reactiveRecord)) {
|
|
734
725
|
var reactiveObservers = reactiveRecord[key];
|
|
735
726
|
if (!isUndefined$1(reactiveObservers)) {
|
|
736
|
-
for (var
|
|
737
|
-
var ro = reactiveObservers[
|
|
727
|
+
for (var _i4 = 0, len = reactiveObservers.length; _i4 < len; _i4 += 1) {
|
|
728
|
+
var ro = reactiveObservers[_i4];
|
|
738
729
|
ro.notify();
|
|
739
730
|
}
|
|
740
731
|
}
|
|
@@ -793,9 +784,9 @@
|
|
|
793
784
|
var listeners = this.listeners;
|
|
794
785
|
var len = listeners.length;
|
|
795
786
|
if (len > 0) {
|
|
796
|
-
for (var
|
|
797
|
-
var set = listeners[
|
|
798
|
-
var pos = ArrayIndexOf.call(listeners[
|
|
787
|
+
for (var _i5 = 0; _i5 < len; _i5 += 1) {
|
|
788
|
+
var set = listeners[_i5];
|
|
789
|
+
var pos = ArrayIndexOf.call(listeners[_i5], this);
|
|
799
790
|
ArraySplice.call(set, pos, 1);
|
|
800
791
|
}
|
|
801
792
|
listeners.length = 0;
|
|
@@ -852,8 +843,8 @@
|
|
|
852
843
|
}
|
|
853
844
|
var callbacks = nextTickCallbackQueue;
|
|
854
845
|
nextTickCallbackQueue = []; // reset to a new queue
|
|
855
|
-
for (var
|
|
856
|
-
callbacks[
|
|
846
|
+
for (var _i6 = 0, len = callbacks.length; _i6 < len; _i6 += 1) {
|
|
847
|
+
callbacks[_i6]();
|
|
857
848
|
}
|
|
858
849
|
}
|
|
859
850
|
function addCallbackToNextTick(callback) {
|
|
@@ -880,11 +871,11 @@
|
|
|
880
871
|
function parseStyleText(cssText) {
|
|
881
872
|
var styleMap = {};
|
|
882
873
|
var declarations = cssText.split(DECLARATION_DELIMITER);
|
|
883
|
-
var
|
|
884
|
-
|
|
874
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
875
|
+
_step;
|
|
885
876
|
try {
|
|
886
|
-
for (
|
|
887
|
-
var declaration =
|
|
877
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
878
|
+
var declaration = _step.value;
|
|
888
879
|
if (declaration) {
|
|
889
880
|
var _declaration$split = declaration.split(PROPERTY_DELIMITER),
|
|
890
881
|
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
@@ -896,20 +887,28 @@
|
|
|
896
887
|
}
|
|
897
888
|
}
|
|
898
889
|
} catch (err) {
|
|
899
|
-
|
|
890
|
+
_iterator.e(err);
|
|
900
891
|
} finally {
|
|
901
|
-
|
|
892
|
+
_iterator.f();
|
|
902
893
|
}
|
|
903
894
|
return styleMap;
|
|
904
895
|
}
|
|
905
896
|
// Make a shallow copy of an object but omit the given key
|
|
906
897
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
907
898
|
var result = {};
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
899
|
+
var _iterator2 = _createForOfIteratorHelper(keys(object)),
|
|
900
|
+
_step2;
|
|
901
|
+
try {
|
|
902
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
903
|
+
var key = _step2.value;
|
|
904
|
+
if (key !== keyToOmit) {
|
|
905
|
+
result[key] = object[key];
|
|
906
|
+
}
|
|
912
907
|
}
|
|
908
|
+
} catch (err) {
|
|
909
|
+
_iterator2.e(err);
|
|
910
|
+
} finally {
|
|
911
|
+
_iterator2.f();
|
|
913
912
|
}
|
|
914
913
|
return result;
|
|
915
914
|
}
|
|
@@ -920,7 +919,7 @@
|
|
|
920
919
|
try {
|
|
921
920
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
922
921
|
var stylesheet = _step3.value;
|
|
923
|
-
if (!
|
|
922
|
+
if (!isArray$1(stylesheet)) {
|
|
924
923
|
list.push(stylesheet);
|
|
925
924
|
} else {
|
|
926
925
|
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
@@ -2795,35 +2794,36 @@
|
|
|
2795
2794
|
}
|
|
2796
2795
|
var wiredConnecting = context.wiredConnecting = [];
|
|
2797
2796
|
var wiredDisconnecting = context.wiredDisconnecting = [];
|
|
2798
|
-
|
|
2797
|
+
var _loop2 = function _loop2() {
|
|
2799
2798
|
var descriptor = wire[fieldNameOrMethod];
|
|
2800
2799
|
var wireDef = WireMetaMap.get(descriptor);
|
|
2801
2800
|
if (process.env.NODE_ENV !== 'production') {
|
|
2802
2801
|
assert.invariant(wireDef, "Internal Error: invalid wire definition found.");
|
|
2803
2802
|
}
|
|
2804
2803
|
if (!isUndefined$1(wireDef)) {
|
|
2805
|
-
(
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
if (
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
return;
|
|
2817
|
-
}
|
|
2804
|
+
var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
|
|
2805
|
+
connector = _createConnector.connector,
|
|
2806
|
+
computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
|
|
2807
|
+
resetConfigWatcher = _createConnector.resetConfigWatcher;
|
|
2808
|
+
var hasDynamicParams = wireDef.dynamic.length > 0;
|
|
2809
|
+
ArrayPush$1.call(wiredConnecting, function () {
|
|
2810
|
+
connector.connect();
|
|
2811
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
2812
|
+
if (hasDynamicParams) {
|
|
2813
|
+
Promise.resolve().then(computeConfigAndUpdate);
|
|
2814
|
+
return;
|
|
2818
2815
|
}
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
})
|
|
2816
|
+
}
|
|
2817
|
+
computeConfigAndUpdate();
|
|
2818
|
+
});
|
|
2819
|
+
ArrayPush$1.call(wiredDisconnecting, function () {
|
|
2820
|
+
connector.disconnect();
|
|
2821
|
+
resetConfigWatcher();
|
|
2822
|
+
});
|
|
2826
2823
|
}
|
|
2824
|
+
};
|
|
2825
|
+
for (var fieldNameOrMethod in wire) {
|
|
2826
|
+
_loop2();
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
2829
|
function connectWireAdapters(vm) {
|
|
@@ -3244,6 +3244,10 @@
|
|
|
3244
3244
|
// stylesheets and templates do not have user-meaningful names, but components do
|
|
3245
3245
|
var friendlyName = type === 'component' ? "".concat(type, " ").concat(func.name) : type;
|
|
3246
3246
|
logError("LWC WARNING: current engine is v".concat(LWC_VERSION, ", but ").concat(friendlyName, " was compiled with v").concat(version, ".\nPlease update your compiled code or LWC engine so that the versions match.\nNo further warnings will appear."));
|
|
3247
|
+
report(1 /* ReportingEventId.CompilerRuntimeVersionMismatch */, {
|
|
3248
|
+
compilerVersion: version,
|
|
3249
|
+
runtimeVersion: LWC_VERSION
|
|
3250
|
+
});
|
|
3247
3251
|
}
|
|
3248
3252
|
}
|
|
3249
3253
|
}
|
|
@@ -4920,7 +4924,12 @@
|
|
|
4920
4924
|
} else if (isVScopedSlotFragment(vnode)) {
|
|
4921
4925
|
slotName = vnode.slotName;
|
|
4922
4926
|
}
|
|
4923
|
-
|
|
4927
|
+
// Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
|
|
4928
|
+
// but elm.setAttribute('slot', Symbol(1)) is an error.
|
|
4929
|
+
// the following line also throws same error for symbols
|
|
4930
|
+
// Similar for Object.create(null)
|
|
4931
|
+
var normalizedSlotName = '' + slotName;
|
|
4932
|
+
var vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
|
|
4924
4933
|
ArrayPush$1.call(vnodes, vnode);
|
|
4925
4934
|
}
|
|
4926
4935
|
vm.cmpSlots = {
|
|
@@ -5984,6 +5993,8 @@
|
|
|
5984
5993
|
var tmpl = _ref4.tmpl;
|
|
5985
5994
|
if (isFunction$1(Ctor)) {
|
|
5986
5995
|
if (process.env.NODE_ENV !== 'production') {
|
|
5996
|
+
// There is no point in running this in production, because the version mismatch check relies
|
|
5997
|
+
// on code comments which are stripped out in production by minifiers
|
|
5987
5998
|
checkVersionMismatch(Ctor, 'component');
|
|
5988
5999
|
}
|
|
5989
6000
|
signedTemplateMap.set(Ctor, tmpl);
|
|
@@ -6247,6 +6258,7 @@
|
|
|
6247
6258
|
// Validate and flatten any stylesheets defined as `static stylesheets`
|
|
6248
6259
|
function computeStylesheets(vm, ctor) {
|
|
6249
6260
|
if (lwcRuntimeFlags.ENABLE_PROGRAMMATIC_STYLESHEETS) {
|
|
6261
|
+
warnOnStylesheetsMutation(ctor);
|
|
6250
6262
|
var stylesheets = ctor.stylesheets;
|
|
6251
6263
|
if (!isUndefined$1(stylesheets)) {
|
|
6252
6264
|
var valid = validateComponentStylesheets(vm, stylesheets);
|
|
@@ -6259,6 +6271,22 @@
|
|
|
6259
6271
|
}
|
|
6260
6272
|
return null;
|
|
6261
6273
|
}
|
|
6274
|
+
function warnOnStylesheetsMutation(ctor) {
|
|
6275
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6276
|
+
var stylesheets = ctor.stylesheets;
|
|
6277
|
+
defineProperty(ctor, 'stylesheets', {
|
|
6278
|
+
enumerable: true,
|
|
6279
|
+
configurable: true,
|
|
6280
|
+
get: function get() {
|
|
6281
|
+
return stylesheets;
|
|
6282
|
+
},
|
|
6283
|
+
set: function set(newValue) {
|
|
6284
|
+
logWarnOnce("Dynamically setting the \"stylesheets\" static property on ".concat(ctor.name, " ") + 'will not affect the stylesheets injected.');
|
|
6285
|
+
stylesheets = newValue;
|
|
6286
|
+
}
|
|
6287
|
+
});
|
|
6288
|
+
}
|
|
6289
|
+
}
|
|
6262
6290
|
function computeShadowMode(vm, renderer) {
|
|
6263
6291
|
var def = vm.def;
|
|
6264
6292
|
var isSyntheticShadowDefined = renderer.isSyntheticShadowDefined,
|
|
@@ -6610,7 +6638,7 @@
|
|
|
6610
6638
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
6611
6639
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
6612
6640
|
}
|
|
6613
|
-
function reportViolation(source, target, attrName) {
|
|
6641
|
+
function reportViolation$1(source, target, attrName) {
|
|
6614
6642
|
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
6615
6643
|
// shadow for a violation to be detected.
|
|
6616
6644
|
var vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
@@ -6621,7 +6649,10 @@
|
|
|
6621
6649
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
6622
6650
|
return;
|
|
6623
6651
|
}
|
|
6624
|
-
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */,
|
|
6652
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
6653
|
+
tagName: vm.tagName,
|
|
6654
|
+
attributeName: attrName
|
|
6655
|
+
});
|
|
6625
6656
|
if (process.env.NODE_ENV !== 'production') {
|
|
6626
6657
|
// Avoid excessively logging to the console in the case of duplicates.
|
|
6627
6658
|
logWarnOnce("Element <".concat(source.tagName.toLowerCase(), "> uses attribute \"").concat(attrName, "\" to reference element ") + "<".concat(target.tagName.toLowerCase(), ">, which is not in the same shadow root. This will break in native shadow DOM. ") + "For details, see: https://lwc.dev/guide/accessibility#link-ids-and-aria-attributes-from-different-templates", vm);
|
|
@@ -6655,7 +6686,7 @@
|
|
|
6655
6686
|
var sourceElement = sourceElements[_i33];
|
|
6656
6687
|
var sourceRoot = sourceElement.getRootNode();
|
|
6657
6688
|
if (sourceRoot !== root) {
|
|
6658
|
-
reportViolation(sourceElement, elm, idRefAttrName);
|
|
6689
|
+
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
6659
6690
|
break;
|
|
6660
6691
|
}
|
|
6661
6692
|
}
|
|
@@ -6678,7 +6709,7 @@
|
|
|
6678
6709
|
var targetRoot = target.getRootNode();
|
|
6679
6710
|
if (targetRoot !== root) {
|
|
6680
6711
|
// target element's shadow root is not the same as ours
|
|
6681
|
-
reportViolation(elm, target, attrName);
|
|
6712
|
+
reportViolation$1(elm, target, attrName);
|
|
6682
6713
|
}
|
|
6683
6714
|
}
|
|
6684
6715
|
}
|
|
@@ -6692,7 +6723,7 @@
|
|
|
6692
6723
|
var enabled = false;
|
|
6693
6724
|
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
6694
6725
|
// reporting is not enabled. It should also only run once
|
|
6695
|
-
function enableDetection() {
|
|
6726
|
+
function enableDetection$1() {
|
|
6696
6727
|
if (enabled) {
|
|
6697
6728
|
return; // don't double-apply the patches
|
|
6698
6729
|
}
|
|
@@ -6746,10 +6777,116 @@
|
|
|
6746
6777
|
if (supportsCssEscape() && isSyntheticShadowLoaded()) {
|
|
6747
6778
|
// Always run detection in dev mode, so we can at least print to the console
|
|
6748
6779
|
if (process.env.NODE_ENV !== 'production') {
|
|
6749
|
-
enableDetection();
|
|
6780
|
+
enableDetection$1();
|
|
6750
6781
|
} else {
|
|
6751
6782
|
// In prod mode, only enable detection if reporting is enabled
|
|
6752
|
-
onReportingEnabled(enableDetection);
|
|
6783
|
+
onReportingEnabled(enableDetection$1);
|
|
6784
|
+
}
|
|
6785
|
+
}
|
|
6786
|
+
|
|
6787
|
+
/*
|
|
6788
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
6789
|
+
* All rights reserved.
|
|
6790
|
+
* SPDX-License-Identifier: MIT
|
|
6791
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6792
|
+
*/
|
|
6793
|
+
//
|
|
6794
|
+
// The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
|
|
6795
|
+
// legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
|
|
6796
|
+
//
|
|
6797
|
+
// See the README for @lwc/aria-reflection
|
|
6798
|
+
var NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
|
|
6799
|
+
function isLightningElement(elm) {
|
|
6800
|
+
// The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
|
|
6801
|
+
// In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
|
|
6802
|
+
return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
|
|
6803
|
+
}
|
|
6804
|
+
function findVM(elm) {
|
|
6805
|
+
// If it's a shadow DOM component, then it has a host
|
|
6806
|
+
var _elm$getRootNode = elm.getRootNode(),
|
|
6807
|
+
host = _elm$getRootNode.host;
|
|
6808
|
+
var vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
|
|
6809
|
+
if (!isUndefined$1(vm)) {
|
|
6810
|
+
return vm;
|
|
6811
|
+
}
|
|
6812
|
+
// Else it might be a light DOM component. Walk up the tree trying to find the owner
|
|
6813
|
+
var parentElement = elm;
|
|
6814
|
+
while (!isNull(parentElement = parentElement.parentElement)) {
|
|
6815
|
+
if (isLightningElement(parentElement)) {
|
|
6816
|
+
var _vm = getAssociatedVMIfPresent(parentElement);
|
|
6817
|
+
if (!isUndefined$1(_vm)) {
|
|
6818
|
+
return _vm;
|
|
6819
|
+
}
|
|
6820
|
+
}
|
|
6821
|
+
}
|
|
6822
|
+
// If we return undefined, it's because the element was rendered wholly outside a LightningElement
|
|
6823
|
+
}
|
|
6824
|
+
|
|
6825
|
+
function checkAndReportViolation(elm, prop) {
|
|
6826
|
+
if (!isLightningElement(elm)) {
|
|
6827
|
+
var vm = findVM(elm);
|
|
6828
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6829
|
+
logWarnOnce("Element <".concat(elm.tagName.toLowerCase(), "> ") + (isUndefined$1(vm) ? '' : "owned by <".concat(vm.elm.tagName.toLowerCase(), "> ")) + "uses non-standard property \"".concat(prop, "\". This will be removed in a future version of LWC. ") + "See https://lwc.dev/guide/accessibility#deprecated-aria-reflected-properties");
|
|
6830
|
+
}
|
|
6831
|
+
report(2 /* ReportingEventId.NonStandardAriaReflection */, {
|
|
6832
|
+
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
6833
|
+
propertyName: prop
|
|
6834
|
+
});
|
|
6835
|
+
}
|
|
6836
|
+
}
|
|
6837
|
+
function enableDetection() {
|
|
6838
|
+
var _Element = Element,
|
|
6839
|
+
prototype = _Element.prototype;
|
|
6840
|
+
var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
6841
|
+
_step7;
|
|
6842
|
+
try {
|
|
6843
|
+
var _loop3 = function _loop3() {
|
|
6844
|
+
var prop = _step7.value;
|
|
6845
|
+
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
6846
|
+
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
6847
|
+
// This happens automatically because of the ordering of imports.
|
|
6848
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6849
|
+
/* istanbul ignore if */
|
|
6850
|
+
if (isUndefined$1(descriptor) || isUndefined$1(descriptor.get) || isUndefined$1(descriptor.set)) {
|
|
6851
|
+
// should never happen
|
|
6852
|
+
throw new Error('detect-non-standard-aria.ts loaded before @lwc/aria-reflection');
|
|
6853
|
+
}
|
|
6854
|
+
}
|
|
6855
|
+
// @ts-ignore
|
|
6856
|
+
var _get4 = descriptor.get,
|
|
6857
|
+
_set4 = descriptor.set;
|
|
6858
|
+
defineProperty(prototype, prop, {
|
|
6859
|
+
get: function get() {
|
|
6860
|
+
checkAndReportViolation(this, prop);
|
|
6861
|
+
return _get4.call(this);
|
|
6862
|
+
},
|
|
6863
|
+
set: function set(val) {
|
|
6864
|
+
checkAndReportViolation(this, prop);
|
|
6865
|
+
return _set4.call(this, val);
|
|
6866
|
+
},
|
|
6867
|
+
configurable: true,
|
|
6868
|
+
enumerable: true
|
|
6869
|
+
});
|
|
6870
|
+
};
|
|
6871
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
6872
|
+
_loop3();
|
|
6873
|
+
}
|
|
6874
|
+
} catch (err) {
|
|
6875
|
+
_iterator7.e(err);
|
|
6876
|
+
} finally {
|
|
6877
|
+
_iterator7.f();
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
6881
|
+
{
|
|
6882
|
+
if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
6883
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
6884
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6885
|
+
enableDetection();
|
|
6886
|
+
} else {
|
|
6887
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
6888
|
+
onReportingEnabled(enableDetection);
|
|
6889
|
+
}
|
|
6753
6890
|
}
|
|
6754
6891
|
}
|
|
6755
6892
|
|
|
@@ -7252,12 +7389,13 @@
|
|
|
7252
7389
|
*/
|
|
7253
7390
|
// See @lwc/engine-core/src/framework/template.ts
|
|
7254
7391
|
var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
7255
|
-
// Via https://www.npmjs.com/package/object-observer
|
|
7256
|
-
var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
7257
7392
|
// Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
|
|
7258
|
-
var
|
|
7393
|
+
var STYLESHEET_PROPS = [
|
|
7259
7394
|
// SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
|
|
7260
7395
|
'$scoped$'];
|
|
7396
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
7397
|
+
var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
7398
|
+
var mutationTrackingDisabled = false;
|
|
7261
7399
|
function getOriginalArrayMethod(prop) {
|
|
7262
7400
|
switch (prop) {
|
|
7263
7401
|
case 'pop':
|
|
@@ -7280,42 +7418,54 @@
|
|
|
7280
7418
|
return ArrayCopyWithin;
|
|
7281
7419
|
}
|
|
7282
7420
|
}
|
|
7283
|
-
|
|
7421
|
+
function reportViolation(type, eventId, prop) {
|
|
7422
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7423
|
+
logWarnOnce("Mutating the \"".concat(prop, "\" property on a ").concat(type, " ") + "is deprecated and will be removed in a future version of LWC. " + "See: https://lwc.dev/guide/css#deprecated-template-mutation");
|
|
7424
|
+
}
|
|
7425
|
+
report(eventId, {
|
|
7426
|
+
propertyName: prop
|
|
7427
|
+
});
|
|
7428
|
+
}
|
|
7429
|
+
function reportTemplateViolation(prop) {
|
|
7430
|
+
reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
|
|
7431
|
+
}
|
|
7432
|
+
function reportStylesheetViolation(prop) {
|
|
7433
|
+
reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
|
|
7434
|
+
}
|
|
7284
7435
|
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
7285
7436
|
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
7286
7437
|
function warnOnArrayMutation(stylesheets) {
|
|
7287
7438
|
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
7288
7439
|
// we can at least warn when they use the most common mutation methods.
|
|
7289
|
-
var
|
|
7290
|
-
|
|
7440
|
+
var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
7441
|
+
_step8;
|
|
7291
7442
|
try {
|
|
7292
|
-
var
|
|
7293
|
-
var prop =
|
|
7443
|
+
var _loop4 = function _loop4() {
|
|
7444
|
+
var prop = _step8.value;
|
|
7294
7445
|
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
7295
7446
|
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
7296
|
-
|
|
7447
|
+
reportTemplateViolation('stylesheets');
|
|
7297
7448
|
// @ts-ignore
|
|
7298
7449
|
return originalArrayMethod.apply(this, arguments);
|
|
7299
7450
|
};
|
|
7300
7451
|
};
|
|
7301
|
-
for (
|
|
7302
|
-
|
|
7452
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
7453
|
+
_loop4();
|
|
7303
7454
|
}
|
|
7304
7455
|
} catch (err) {
|
|
7305
|
-
|
|
7456
|
+
_iterator8.e(err);
|
|
7306
7457
|
} finally {
|
|
7307
|
-
|
|
7458
|
+
_iterator8.f();
|
|
7308
7459
|
}
|
|
7309
7460
|
}
|
|
7310
7461
|
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
7311
7462
|
// `stylesheet.$scoped$ = true`
|
|
7312
7463
|
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
_step8;
|
|
7464
|
+
var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
7465
|
+
_step9;
|
|
7316
7466
|
try {
|
|
7317
|
-
var
|
|
7318
|
-
var prop =
|
|
7467
|
+
var _loop5 = function _loop5() {
|
|
7468
|
+
var prop = _step9.value;
|
|
7319
7469
|
var value = stylesheet[prop];
|
|
7320
7470
|
defineProperty(stylesheet, prop, {
|
|
7321
7471
|
enumerable: true,
|
|
@@ -7324,22 +7474,22 @@
|
|
|
7324
7474
|
return value;
|
|
7325
7475
|
},
|
|
7326
7476
|
set: function set(newValue) {
|
|
7327
|
-
|
|
7477
|
+
reportStylesheetViolation(prop);
|
|
7328
7478
|
value = newValue;
|
|
7329
7479
|
}
|
|
7330
7480
|
});
|
|
7331
7481
|
};
|
|
7332
|
-
for (
|
|
7333
|
-
|
|
7482
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
7483
|
+
_loop5();
|
|
7334
7484
|
}
|
|
7335
7485
|
} catch (err) {
|
|
7336
|
-
|
|
7486
|
+
_iterator9.e(err);
|
|
7337
7487
|
} finally {
|
|
7338
|
-
|
|
7488
|
+
_iterator9.f();
|
|
7339
7489
|
}
|
|
7340
7490
|
}
|
|
7341
7491
|
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
7342
|
-
function
|
|
7492
|
+
function trackStylesheetsMutation(stylesheets) {
|
|
7343
7493
|
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
7344
7494
|
if (isArray$1(subStylesheets)) {
|
|
7345
7495
|
warnOnArrayMutation(subStylesheets);
|
|
@@ -7366,7 +7516,80 @@
|
|
|
7366
7516
|
}
|
|
7367
7517
|
}
|
|
7368
7518
|
}
|
|
7519
|
+
function trackMutations(tmpl) {
|
|
7520
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
7521
|
+
trackStylesheetsMutation(tmpl.stylesheets);
|
|
7522
|
+
}
|
|
7523
|
+
var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
7524
|
+
_step10;
|
|
7525
|
+
try {
|
|
7526
|
+
var _loop6 = function _loop6() {
|
|
7527
|
+
var prop = _step10.value;
|
|
7528
|
+
var value = tmpl[prop];
|
|
7529
|
+
defineProperty(tmpl, prop, {
|
|
7530
|
+
enumerable: true,
|
|
7531
|
+
configurable: true,
|
|
7532
|
+
get: function get() {
|
|
7533
|
+
return value;
|
|
7534
|
+
},
|
|
7535
|
+
set: function set(newValue) {
|
|
7536
|
+
if (!mutationTrackingDisabled) {
|
|
7537
|
+
reportTemplateViolation(prop);
|
|
7538
|
+
}
|
|
7539
|
+
value = newValue;
|
|
7540
|
+
}
|
|
7541
|
+
});
|
|
7542
|
+
};
|
|
7543
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
7544
|
+
_loop6();
|
|
7545
|
+
}
|
|
7546
|
+
} catch (err) {
|
|
7547
|
+
_iterator10.e(err);
|
|
7548
|
+
} finally {
|
|
7549
|
+
_iterator10.f();
|
|
7550
|
+
}
|
|
7551
|
+
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
7552
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
7553
|
+
enumerable: true,
|
|
7554
|
+
configurable: true,
|
|
7555
|
+
get: originalDescriptor.get,
|
|
7556
|
+
set: function set(value) {
|
|
7557
|
+
reportTemplateViolation('stylesheetTokens');
|
|
7558
|
+
// Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
|
|
7559
|
+
mutationTrackingDisabled = true;
|
|
7560
|
+
originalDescriptor.set.call(this, value);
|
|
7561
|
+
mutationTrackingDisabled = false;
|
|
7562
|
+
}
|
|
7563
|
+
});
|
|
7564
|
+
}
|
|
7565
|
+
function addLegacyStylesheetTokensShim(tmpl) {
|
|
7566
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
7567
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
7568
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
7569
|
+
enumerable: true,
|
|
7570
|
+
configurable: true,
|
|
7571
|
+
get: function get() {
|
|
7572
|
+
var stylesheetToken = this.stylesheetToken;
|
|
7573
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
7574
|
+
return stylesheetToken;
|
|
7575
|
+
}
|
|
7576
|
+
// Shim for the old `stylesheetTokens` property
|
|
7577
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
7578
|
+
return {
|
|
7579
|
+
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
7580
|
+
shadowAttribute: stylesheetToken
|
|
7581
|
+
};
|
|
7582
|
+
},
|
|
7583
|
+
set: function set(value) {
|
|
7584
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
7585
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
7586
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
7587
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
7588
|
+
}
|
|
7589
|
+
});
|
|
7590
|
+
}
|
|
7369
7591
|
function freezeTemplate(tmpl) {
|
|
7592
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
7370
7593
|
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
7371
7594
|
// Deep freeze the template
|
|
7372
7595
|
freeze(tmpl);
|
|
@@ -7374,76 +7597,16 @@
|
|
|
7374
7597
|
deepFreeze(tmpl.stylesheets);
|
|
7375
7598
|
}
|
|
7376
7599
|
} else {
|
|
7377
|
-
//
|
|
7378
|
-
//
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
enumerable: true,
|
|
7382
|
-
configurable: true,
|
|
7383
|
-
get: function get() {
|
|
7384
|
-
var stylesheetToken = this.stylesheetToken;
|
|
7385
|
-
if (isUndefined$1(stylesheetToken)) {
|
|
7386
|
-
return stylesheetToken;
|
|
7387
|
-
}
|
|
7388
|
-
// Shim for the old `stylesheetTokens` property
|
|
7389
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
7390
|
-
return {
|
|
7391
|
-
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
7392
|
-
shadowAttribute: stylesheetToken
|
|
7393
|
-
};
|
|
7394
|
-
},
|
|
7395
|
-
set: function set(value) {
|
|
7396
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
7397
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
7398
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
7399
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
7400
|
-
}
|
|
7401
|
-
});
|
|
7402
|
-
// When ENABLE_FROZEN_TEMPLATE is false, warn in dev mode whenever someone is mutating the template
|
|
7600
|
+
// template is not frozen - shim, report, and warn
|
|
7601
|
+
// this shim should be applied in both dev and prod
|
|
7602
|
+
addLegacyStylesheetTokensShim(tmpl);
|
|
7603
|
+
// When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
|
|
7403
7604
|
if (process.env.NODE_ENV !== 'production') {
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
try {
|
|
7410
|
-
var _loop4 = function _loop4() {
|
|
7411
|
-
var prop = _step9.value;
|
|
7412
|
-
var value = tmpl[prop];
|
|
7413
|
-
defineProperty(tmpl, prop, {
|
|
7414
|
-
enumerable: true,
|
|
7415
|
-
configurable: true,
|
|
7416
|
-
get: function get() {
|
|
7417
|
-
return value;
|
|
7418
|
-
},
|
|
7419
|
-
set: function set(newValue) {
|
|
7420
|
-
if (!mutationWarningsSilenced) {
|
|
7421
|
-
logError("Dynamically setting the \"".concat(prop, "\" property on a template function ") + "is deprecated and may be removed in a future version of LWC.");
|
|
7422
|
-
}
|
|
7423
|
-
value = newValue;
|
|
7424
|
-
}
|
|
7425
|
-
});
|
|
7426
|
-
};
|
|
7427
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
7428
|
-
_loop4();
|
|
7429
|
-
}
|
|
7430
|
-
} catch (err) {
|
|
7431
|
-
_iterator9.e(err);
|
|
7432
|
-
} finally {
|
|
7433
|
-
_iterator9.f();
|
|
7434
|
-
}
|
|
7435
|
-
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
7436
|
-
defineProperty(tmpl, 'stylesheetTokens', {
|
|
7437
|
-
enumerable: true,
|
|
7438
|
-
configurable: true,
|
|
7439
|
-
get: originalDescriptor.get,
|
|
7440
|
-
set: function set(value) {
|
|
7441
|
-
logError("Dynamically setting the \"stylesheetTokens\" property on a template function " + "is deprecated and may be removed in a future version of LWC.");
|
|
7442
|
-
// Avoid logging twice (for both stylesheetToken and stylesheetTokens)
|
|
7443
|
-
mutationWarningsSilenced = true;
|
|
7444
|
-
originalDescriptor.set.call(this, value);
|
|
7445
|
-
mutationWarningsSilenced = false;
|
|
7446
|
-
}
|
|
7605
|
+
trackMutations(tmpl);
|
|
7606
|
+
} else {
|
|
7607
|
+
// In prod mode, we only track mutations if reporting is enabled
|
|
7608
|
+
onReportingEnabled(function () {
|
|
7609
|
+
trackMutations(tmpl);
|
|
7447
7610
|
});
|
|
7448
7611
|
}
|
|
7449
7612
|
}
|
|
@@ -7471,7 +7634,7 @@
|
|
|
7471
7634
|
}
|
|
7472
7635
|
return ctor;
|
|
7473
7636
|
}
|
|
7474
|
-
/* version: 2.
|
|
7637
|
+
/* version: 2.36.0 */
|
|
7475
7638
|
|
|
7476
7639
|
/*
|
|
7477
7640
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7747,7 +7910,7 @@
|
|
|
7747
7910
|
var cachedConstructors = new Map();
|
|
7748
7911
|
var elementsUpgradedOutsideLWC = new WeakSet();
|
|
7749
7912
|
var elementBeingUpgradedByLWC = false;
|
|
7750
|
-
// Creates a constructor that is intended to be used as a
|
|
7913
|
+
// Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
|
|
7751
7914
|
// passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
|
|
7752
7915
|
// Another benefit is that only LWC can create components that actually do anything – if you do
|
|
7753
7916
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
@@ -7796,7 +7959,7 @@
|
|
|
7796
7959
|
}
|
|
7797
7960
|
return UpgradableConstructor;
|
|
7798
7961
|
};
|
|
7799
|
-
var
|
|
7962
|
+
var createCustomElementUsingUpgradableConstructor = function createCustomElementUsingUpgradableConstructor(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
7800
7963
|
// use global custom elements registry
|
|
7801
7964
|
var UpgradableConstructor = cachedConstructors.get(tagName);
|
|
7802
7965
|
if (isUndefined$1(UpgradableConstructor)) {
|
|
@@ -7823,7 +7986,7 @@
|
|
|
7823
7986
|
*/
|
|
7824
7987
|
/**
|
|
7825
7988
|
* Create a scoped registry, i.e. a function that can create custom elements whose tag names
|
|
7826
|
-
* do not conflict with
|
|
7989
|
+
* do not conflict with third-party custom elements having the same tag name.
|
|
7827
7990
|
*/
|
|
7828
7991
|
function createScopedRegistry() {
|
|
7829
7992
|
if (!hasCustomElements) {
|
|
@@ -8154,17 +8317,17 @@
|
|
|
8154
8317
|
function flushPendingWhenDefinedCallbacks(tagName, ctor) {
|
|
8155
8318
|
var resolvers = pendingWhenDefinedCallbacks.get(tagName);
|
|
8156
8319
|
if (!isUndefined$1(resolvers)) {
|
|
8157
|
-
var
|
|
8158
|
-
|
|
8320
|
+
var _iterator11 = _createForOfIteratorHelper(resolvers),
|
|
8321
|
+
_step11;
|
|
8159
8322
|
try {
|
|
8160
|
-
for (
|
|
8161
|
-
var resolver =
|
|
8323
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
8324
|
+
var resolver = _step11.value;
|
|
8162
8325
|
resolver(ctor);
|
|
8163
8326
|
}
|
|
8164
8327
|
} catch (err) {
|
|
8165
|
-
|
|
8328
|
+
_iterator11.e(err);
|
|
8166
8329
|
} finally {
|
|
8167
|
-
|
|
8330
|
+
_iterator11.f();
|
|
8168
8331
|
}
|
|
8169
8332
|
}
|
|
8170
8333
|
pendingWhenDefinedCallbacks.delete(tagName);
|
|
@@ -8214,11 +8377,11 @@
|
|
|
8214
8377
|
var awaiting = awaitingUpgrade.get(tagName);
|
|
8215
8378
|
if (!isUndefined$1(awaiting)) {
|
|
8216
8379
|
awaitingUpgrade.delete(tagName);
|
|
8217
|
-
var
|
|
8218
|
-
|
|
8380
|
+
var _iterator12 = _createForOfIteratorHelper(awaiting),
|
|
8381
|
+
_step12;
|
|
8219
8382
|
try {
|
|
8220
|
-
for (
|
|
8221
|
-
var element =
|
|
8383
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
8384
|
+
var element = _step12.value;
|
|
8222
8385
|
var registeredDefinition = pendingRegistryForElement.get(element);
|
|
8223
8386
|
// At this point, registeredDefinition should never be undefined because awaitingUpgrade
|
|
8224
8387
|
// is only populated when we haven't run internalUpgrade yet, and we only populate
|
|
@@ -8230,9 +8393,9 @@
|
|
|
8230
8393
|
}
|
|
8231
8394
|
}
|
|
8232
8395
|
} catch (err) {
|
|
8233
|
-
|
|
8396
|
+
_iterator12.e(err);
|
|
8234
8397
|
} finally {
|
|
8235
|
-
|
|
8398
|
+
_iterator12.f();
|
|
8236
8399
|
}
|
|
8237
8400
|
}
|
|
8238
8401
|
// If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
|
|
@@ -8429,10 +8592,10 @@
|
|
|
8429
8592
|
* We have three modes for creating custom elements:
|
|
8430
8593
|
*
|
|
8431
8594
|
* 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
|
|
8432
|
-
* 2. "
|
|
8433
|
-
*
|
|
8434
|
-
*
|
|
8435
|
-
* constructor, which allows us to have completely customized functionality for different components.
|
|
8595
|
+
* 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
|
|
8596
|
+
* via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
|
|
8597
|
+
* a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
|
|
8598
|
+
* constructor"), which allows us to have completely customized functionality for different components.
|
|
8436
8599
|
* 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
|
|
8437
8600
|
* elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
|
|
8438
8601
|
* between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
|
|
@@ -8443,8 +8606,8 @@
|
|
|
8443
8606
|
if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
|
|
8444
8607
|
createCustomElement = createCustomElementScoped;
|
|
8445
8608
|
} else {
|
|
8446
|
-
// use global
|
|
8447
|
-
createCustomElement =
|
|
8609
|
+
// use the global registry, with an upgradable constructor for the defined custom element
|
|
8610
|
+
createCustomElement = createCustomElementUsingUpgradableConstructor;
|
|
8448
8611
|
}
|
|
8449
8612
|
} else {
|
|
8450
8613
|
// no registry available here
|
|
@@ -8498,10 +8661,10 @@
|
|
|
8498
8661
|
}
|
|
8499
8662
|
var assert = /*#__PURE__*/Object.freeze({
|
|
8500
8663
|
__proto__: null,
|
|
8664
|
+
fail: fail,
|
|
8501
8665
|
invariant: invariant,
|
|
8502
|
-
isTrue: isTrue$1,
|
|
8503
8666
|
isFalse: isFalse$1,
|
|
8504
|
-
|
|
8667
|
+
isTrue: isTrue$1
|
|
8505
8668
|
});
|
|
8506
8669
|
function isUndefined(obj) {
|
|
8507
8670
|
return obj === undefined;
|
|
@@ -8509,7 +8672,7 @@
|
|
|
8509
8672
|
function isNull(obj) {
|
|
8510
8673
|
return obj === null;
|
|
8511
8674
|
}
|
|
8512
|
-
/** version: 2.
|
|
8675
|
+
/** version: 2.36.0 */
|
|
8513
8676
|
|
|
8514
8677
|
/*
|
|
8515
8678
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8568,17 +8731,17 @@
|
|
|
8568
8731
|
exports.createFragment = function (html) {
|
|
8569
8732
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8570
8733
|
if (!isUndefined(wrapperTags)) {
|
|
8571
|
-
var
|
|
8572
|
-
|
|
8734
|
+
var _iterator13 = _createForOfIteratorHelper(wrapperTags),
|
|
8735
|
+
_step13;
|
|
8573
8736
|
try {
|
|
8574
|
-
for (
|
|
8575
|
-
var wrapperTag =
|
|
8737
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
8738
|
+
var wrapperTag = _step13.value;
|
|
8576
8739
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8577
8740
|
}
|
|
8578
8741
|
} catch (err) {
|
|
8579
|
-
|
|
8742
|
+
_iterator13.e(err);
|
|
8580
8743
|
} finally {
|
|
8581
|
-
|
|
8744
|
+
_iterator13.f();
|
|
8582
8745
|
}
|
|
8583
8746
|
}
|
|
8584
8747
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -9075,7 +9238,7 @@
|
|
|
9075
9238
|
});
|
|
9076
9239
|
freeze(LightningElement);
|
|
9077
9240
|
seal(LightningElement.prototype);
|
|
9078
|
-
/* version: 2.
|
|
9241
|
+
/* version: 2.36.0 */
|
|
9079
9242
|
|
|
9080
9243
|
exports.LightningElement = LightningElement;
|
|
9081
9244
|
exports.__unstable__ProfilerControl = profilerControl;
|