lwc 2.34.0 → 2.35.1
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 +939 -763
- package/dist/engine-dom/iife/es2017/engine-dom.js +939 -762
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +846 -684
- package/dist/engine-dom/iife/es5/engine-dom.js +1115 -922
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +801 -619
- package/dist/engine-dom/umd/es2017/engine-dom.js +939 -762
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +846 -684
- package/dist/engine-dom/umd/es5/engine-dom.js +1115 -922
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +801 -619
- package/dist/engine-server/commonjs/es2017/engine-server.js +1025 -1082
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +1025 -1082
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +21 -41
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +21 -41
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +20 -39
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +24 -38
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +23 -36
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +21 -41
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +20 -39
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +24 -38
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +23 -36
- 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
|
@@ -12,11 +12,6 @@ var LWC = (function (exports) {
|
|
|
12
12
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
function _getPrototypeOf2(o) { _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf2(o); }
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
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); } }
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
-
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); }
|
|
20
15
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
16
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
17
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -25,6 +20,11 @@ var LWC = (function (exports) {
|
|
|
25
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."); }
|
|
26
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; } }
|
|
27
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
+
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
|
+
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
+
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
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
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
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; }
|
|
@@ -100,6 +100,7 @@ var LWC = (function (exports) {
|
|
|
100
100
|
var _String$prototype = String.prototype,
|
|
101
101
|
StringCharCodeAt = _String$prototype.charCodeAt,
|
|
102
102
|
StringReplace = _String$prototype.replace,
|
|
103
|
+
StringSplit = _String$prototype.split,
|
|
103
104
|
StringSlice = _String$prototype.slice,
|
|
104
105
|
StringToLowerCase = _String$prototype.toLowerCase;
|
|
105
106
|
function isUndefined$1(obj) {
|
|
@@ -192,6 +193,9 @@ var LWC = (function (exports) {
|
|
|
192
193
|
}(),
|
|
193
194
|
AriaAttrNameToPropNameMap = _ref.AriaAttrNameToPropNameMap,
|
|
194
195
|
AriaPropNameToAttrNameMap = _ref.AriaPropNameToAttrNameMap;
|
|
196
|
+
// These attributes take either an ID or a list of IDs as values.
|
|
197
|
+
// This includes aria-* attributes as well as the special non-ARIA "for" attribute
|
|
198
|
+
var ID_REFERENCING_ATTRIBUTES_SET = new Set(['aria-activedescendant', 'aria-controls', 'aria-describedby', 'aria-details', 'aria-errormessage', 'aria-flowto', 'aria-labelledby', 'aria-owns', 'for']);
|
|
195
199
|
|
|
196
200
|
/*
|
|
197
201
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -199,39 +203,11 @@ var LWC = (function (exports) {
|
|
|
199
203
|
* SPDX-License-Identifier: MIT
|
|
200
204
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
201
205
|
*/
|
|
202
|
-
//
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
var _globalThis;
|
|
209
|
-
try {
|
|
210
|
-
// eslint-disable-next-line no-extend-native
|
|
211
|
-
Object.defineProperty(Object.prototype, '__magic__', {
|
|
212
|
-
get: function get() {
|
|
213
|
-
return this;
|
|
214
|
-
},
|
|
215
|
-
configurable: true
|
|
216
|
-
});
|
|
217
|
-
// __magic__ is undefined in Safari 10 and IE10 and older.
|
|
218
|
-
// @ts-ignore
|
|
219
|
-
// eslint-disable-next-line no-undef
|
|
220
|
-
_globalThis = __magic__;
|
|
221
|
-
// @ts-ignore
|
|
222
|
-
delete Object.prototype.__magic__;
|
|
223
|
-
} catch (ex) {
|
|
224
|
-
// In IE8, Object.defineProperty only works on DOM objects.
|
|
225
|
-
} finally {
|
|
226
|
-
// If the magic above fails for some reason we assume that we are in a legacy browser.
|
|
227
|
-
// Assume `window` exists in this case.
|
|
228
|
-
if (typeof _globalThis === 'undefined') {
|
|
229
|
-
// @ts-ignore
|
|
230
|
-
_globalThis = window;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return _globalThis;
|
|
234
|
-
}();
|
|
206
|
+
// See browser support for globalThis:
|
|
207
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
|
|
208
|
+
/* istanbul ignore next */
|
|
209
|
+
// @ts-ignore
|
|
210
|
+
var _globalThis = (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object' ? globalThis : window;
|
|
235
211
|
|
|
236
212
|
/*
|
|
237
213
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -245,6 +221,8 @@ var LWC = (function (exports) {
|
|
|
245
221
|
var KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
246
222
|
var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
247
223
|
var KEY__SCOPED_CSS = '$scoped$';
|
|
224
|
+
var KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';
|
|
225
|
+
var KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';
|
|
248
226
|
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
249
227
|
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
250
228
|
var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
@@ -332,7 +310,7 @@ var LWC = (function (exports) {
|
|
|
332
310
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
333
311
|
return propertyName;
|
|
334
312
|
}
|
|
335
|
-
/** version: 2.
|
|
313
|
+
/** version: 2.35.1 */
|
|
336
314
|
|
|
337
315
|
/**
|
|
338
316
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -384,6 +362,7 @@ var LWC = (function (exports) {
|
|
|
384
362
|
console.warn("Failed to set the value \"".concat(value, "\" for the runtime feature flag \"").concat(name, "\" because it is undefined. Available flags: ").concat(availableFlags, "."));
|
|
385
363
|
return;
|
|
386
364
|
}
|
|
365
|
+
// This may seem redundant, but `"production" === 'test-karma-lwc'` is replaced by Karma tests
|
|
387
366
|
{
|
|
388
367
|
// Disallow the same flag to be set more than once in production
|
|
389
368
|
var runtimeValue = lwcRuntimeFlags[name];
|
|
@@ -403,7 +382,7 @@ var LWC = (function (exports) {
|
|
|
403
382
|
*/
|
|
404
383
|
function setFeatureFlagForTest(name, value) {
|
|
405
384
|
}
|
|
406
|
-
/** version: 2.
|
|
385
|
+
/** version: 2.35.1 */
|
|
407
386
|
|
|
408
387
|
/**
|
|
409
388
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -467,7 +446,7 @@ var LWC = (function (exports) {
|
|
|
467
446
|
}
|
|
468
447
|
}
|
|
469
448
|
}
|
|
470
|
-
/** version: 2.
|
|
449
|
+
/** version: 2.35.1 */
|
|
471
450
|
|
|
472
451
|
/*
|
|
473
452
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -487,99 +466,153 @@ var LWC = (function (exports) {
|
|
|
487
466
|
* SPDX-License-Identifier: MIT
|
|
488
467
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
489
468
|
*/
|
|
490
|
-
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
var
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
469
|
+
/** Callbacks to invoke when reporting is enabled **/
|
|
470
|
+
var onReportingEnabledCallbacks = [];
|
|
471
|
+
/** The currently assigned reporting dispatcher. */
|
|
472
|
+
var currentDispatcher$1 = noop;
|
|
473
|
+
/**
|
|
474
|
+
* Whether reporting is enabled.
|
|
475
|
+
*
|
|
476
|
+
* Note that this may seem redundant, given you can just check if the currentDispatcher is undefined,
|
|
477
|
+
* but it turns out that Terser only strips out unused code if we use this explicit boolean.
|
|
478
|
+
*/
|
|
479
|
+
var enabled$1 = false;
|
|
480
|
+
var reportingControl = {
|
|
481
|
+
/**
|
|
482
|
+
* Attach a new reporting control (aka dispatcher).
|
|
483
|
+
*
|
|
484
|
+
* @param dispatcher - reporting control
|
|
485
|
+
*/
|
|
486
|
+
attachDispatcher: function attachDispatcher(dispatcher) {
|
|
487
|
+
enabled$1 = true;
|
|
488
|
+
currentDispatcher$1 = dispatcher;
|
|
489
|
+
var _iterator = _createForOfIteratorHelper(onReportingEnabledCallbacks),
|
|
490
|
+
_step;
|
|
491
|
+
try {
|
|
492
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
493
|
+
var callback = _step.value;
|
|
494
|
+
try {
|
|
495
|
+
callback();
|
|
496
|
+
} catch (err) {
|
|
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
|
+
}
|
|
501
|
+
}
|
|
502
|
+
} catch (err) {
|
|
503
|
+
_iterator.e(err);
|
|
504
|
+
} finally {
|
|
505
|
+
_iterator.f();
|
|
506
|
+
}
|
|
507
|
+
onReportingEnabledCallbacks.length = 0; // clear the array
|
|
508
|
+
},
|
|
509
|
+
/**
|
|
510
|
+
* Detach the current reporting control (aka dispatcher).
|
|
511
|
+
*/
|
|
512
|
+
detachDispatcher: function detachDispatcher() {
|
|
513
|
+
enabled$1 = false;
|
|
514
|
+
currentDispatcher$1 = noop;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* Call a callback when reporting is enabled, or immediately if reporting is already enabled.
|
|
519
|
+
* Will only ever be called once.
|
|
520
|
+
* @param callback
|
|
521
|
+
*/
|
|
522
|
+
function onReportingEnabled(callback) {
|
|
523
|
+
if (enabled$1) {
|
|
524
|
+
// call immediately
|
|
525
|
+
callback();
|
|
526
|
+
} else {
|
|
527
|
+
// call later
|
|
528
|
+
onReportingEnabledCallbacks.push(callback);
|
|
499
529
|
}
|
|
500
530
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
531
|
+
/**
|
|
532
|
+
* Report to the current dispatcher, if there is one.
|
|
533
|
+
* @param reportingEventId
|
|
534
|
+
* @param vm
|
|
535
|
+
*/
|
|
536
|
+
function report(reportingEventId, vm) {
|
|
537
|
+
if (enabled$1) {
|
|
538
|
+
currentDispatcher$1(reportingEventId, vm.tagName, vm.idx);
|
|
504
539
|
}
|
|
505
|
-
ArrayPush$1.call(nextTickCallbackQueue, callback);
|
|
506
540
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
541
|
+
|
|
542
|
+
/*
|
|
543
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
544
|
+
* All rights reserved.
|
|
545
|
+
* SPDX-License-Identifier: MIT
|
|
546
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
547
|
+
*/
|
|
548
|
+
function getComponentTag(vm) {
|
|
549
|
+
return "<".concat(StringToLowerCase.call(vm.tagName), ">");
|
|
550
|
+
}
|
|
551
|
+
// TODO [#1695]: Unify getComponentStack and getErrorComponentStack
|
|
552
|
+
function getComponentStack(vm) {
|
|
553
|
+
var stack = [];
|
|
554
|
+
var prefix = '';
|
|
555
|
+
while (!isNull(vm.owner)) {
|
|
556
|
+
ArrayPush$1.call(stack, prefix + getComponentTag(vm));
|
|
557
|
+
vm = vm.owner;
|
|
558
|
+
prefix += '\t';
|
|
510
559
|
}
|
|
511
|
-
return
|
|
560
|
+
return ArrayJoin.call(stack, '\n');
|
|
512
561
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
562
|
+
function getErrorComponentStack(vm) {
|
|
563
|
+
var wcStack = [];
|
|
564
|
+
var currentVm = vm;
|
|
565
|
+
while (!isNull(currentVm)) {
|
|
566
|
+
ArrayPush$1.call(wcStack, getComponentTag(currentVm));
|
|
567
|
+
currentVm = currentVm.owner;
|
|
568
|
+
}
|
|
569
|
+
return wcStack.reverse().join('\n\t');
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/*
|
|
573
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
574
|
+
* All rights reserved.
|
|
575
|
+
* SPDX-License-Identifier: MIT
|
|
576
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
577
|
+
*/
|
|
578
|
+
function addErrorComponentStack(vm, error) {
|
|
579
|
+
if (!isFrozen(error) && isUndefined$1(error.wcStack)) {
|
|
580
|
+
var wcStack = getErrorComponentStack(vm);
|
|
581
|
+
defineProperty(error, 'wcStack', {
|
|
582
|
+
get: function get() {
|
|
583
|
+
return wcStack;
|
|
533
584
|
}
|
|
534
|
-
}
|
|
535
|
-
} catch (err) {
|
|
536
|
-
_iterator.e(err);
|
|
537
|
-
} finally {
|
|
538
|
-
_iterator.f();
|
|
585
|
+
});
|
|
539
586
|
}
|
|
540
|
-
return styleMap;
|
|
541
587
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
588
|
+
|
|
589
|
+
/*
|
|
590
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
591
|
+
* All rights reserved.
|
|
592
|
+
* SPDX-License-Identifier: MIT
|
|
593
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
594
|
+
*/
|
|
595
|
+
var alreadyLoggedMessages = new Set();
|
|
596
|
+
function log(method, message, vm, once) {
|
|
597
|
+
var msg = "[LWC ".concat(method, "]: ").concat(message);
|
|
598
|
+
if (!isUndefined$1(vm)) {
|
|
599
|
+
msg = "".concat(msg, "\n").concat(getComponentStack(vm));
|
|
600
|
+
}
|
|
601
|
+
if (once) {
|
|
602
|
+
if (alreadyLoggedMessages.has(msg)) {
|
|
603
|
+
return;
|
|
549
604
|
}
|
|
605
|
+
alreadyLoggedMessages.add(msg);
|
|
550
606
|
}
|
|
551
|
-
return result;
|
|
552
|
-
}
|
|
553
|
-
function flattenStylesheets(stylesheets) {
|
|
554
|
-
var list = [];
|
|
555
|
-
var _iterator2 = _createForOfIteratorHelper(stylesheets),
|
|
556
|
-
_step2;
|
|
557
607
|
try {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
} else {
|
|
563
|
-
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
} catch (err) {
|
|
567
|
-
_iterator2.e(err);
|
|
568
|
-
} finally {
|
|
569
|
-
_iterator2.f();
|
|
608
|
+
throw new Error(msg);
|
|
609
|
+
} catch (e) {
|
|
610
|
+
/* eslint-disable-next-line no-console */
|
|
611
|
+
console[method](e);
|
|
570
612
|
}
|
|
571
|
-
return list;
|
|
572
613
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
// If this method is called, then vm.refVNodes is set as the template has refs.
|
|
576
|
-
// If not, then something went wrong and we threw an error above.
|
|
577
|
-
var refVNodes = vm.refVNodes;
|
|
578
|
-
// In cases of conflict (two elements with the same ref), prefer, the last one,
|
|
579
|
-
// in depth-first traversal order.
|
|
580
|
-
if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
|
|
581
|
-
refVNodes[ref] = vnode;
|
|
582
|
-
}
|
|
614
|
+
function logError(message, vm) {
|
|
615
|
+
log('error', message, vm, false);
|
|
583
616
|
}
|
|
584
617
|
|
|
585
618
|
/*
|
|
@@ -604,8 +637,8 @@ var LWC = (function (exports) {
|
|
|
604
637
|
if (!isUndefined$1(reactiveRecord)) {
|
|
605
638
|
var reactiveObservers = reactiveRecord[key];
|
|
606
639
|
if (!isUndefined$1(reactiveObservers)) {
|
|
607
|
-
for (var
|
|
608
|
-
var ro = reactiveObservers[
|
|
640
|
+
for (var _i3 = 0, len = reactiveObservers.length; _i3 < len; _i3 += 1) {
|
|
641
|
+
var ro = reactiveObservers[_i3];
|
|
609
642
|
ro.notify();
|
|
610
643
|
}
|
|
611
644
|
}
|
|
@@ -664,9 +697,9 @@ var LWC = (function (exports) {
|
|
|
664
697
|
var listeners = this.listeners;
|
|
665
698
|
var len = listeners.length;
|
|
666
699
|
if (len > 0) {
|
|
667
|
-
for (var
|
|
668
|
-
var set = listeners[
|
|
669
|
-
var pos = ArrayIndexOf.call(listeners[
|
|
700
|
+
for (var _i4 = 0; _i4 < len; _i4 += 1) {
|
|
701
|
+
var set = listeners[_i4];
|
|
702
|
+
var pos = ArrayIndexOf.call(listeners[_i4], this);
|
|
670
703
|
ArraySplice.call(set, pos, 1);
|
|
671
704
|
}
|
|
672
705
|
listeners.length = 0;
|
|
@@ -711,67 +744,107 @@ var LWC = (function (exports) {
|
|
|
711
744
|
* SPDX-License-Identifier: MIT
|
|
712
745
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
713
746
|
*/
|
|
714
|
-
|
|
715
|
-
|
|
747
|
+
var nextTickCallbackQueue = [];
|
|
748
|
+
var SPACE_CHAR = 32;
|
|
749
|
+
var EmptyObject = seal(create(null));
|
|
750
|
+
var EmptyArray = seal([]);
|
|
751
|
+
function flushCallbackQueue() {
|
|
752
|
+
var callbacks = nextTickCallbackQueue;
|
|
753
|
+
nextTickCallbackQueue = []; // reset to a new queue
|
|
754
|
+
for (var _i5 = 0, len = callbacks.length; _i5 < len; _i5 += 1) {
|
|
755
|
+
callbacks[_i5]();
|
|
756
|
+
}
|
|
716
757
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
var prefix = '';
|
|
721
|
-
while (!isNull(vm.owner)) {
|
|
722
|
-
ArrayPush$1.call(stack, prefix + getComponentTag(vm));
|
|
723
|
-
vm = vm.owner;
|
|
724
|
-
prefix += '\t';
|
|
758
|
+
function addCallbackToNextTick(callback) {
|
|
759
|
+
if (nextTickCallbackQueue.length === 0) {
|
|
760
|
+
Promise.resolve().then(flushCallbackQueue);
|
|
725
761
|
}
|
|
726
|
-
|
|
762
|
+
ArrayPush$1.call(nextTickCallbackQueue, callback);
|
|
727
763
|
}
|
|
728
|
-
function
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
while (!isNull(currentVm)) {
|
|
732
|
-
ArrayPush$1.call(wcStack, getComponentTag(currentVm));
|
|
733
|
-
currentVm = currentVm.owner;
|
|
764
|
+
function guid() {
|
|
765
|
+
function s4() {
|
|
766
|
+
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
734
767
|
}
|
|
735
|
-
return
|
|
768
|
+
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
736
769
|
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
770
|
+
// Borrowed from Vue template compiler.
|
|
771
|
+
// https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
|
|
772
|
+
var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
|
|
773
|
+
var PROPERTY_DELIMITER = /:(.+)/;
|
|
774
|
+
function parseStyleText(cssText) {
|
|
775
|
+
var styleMap = {};
|
|
776
|
+
var declarations = cssText.split(DECLARATION_DELIMITER);
|
|
777
|
+
var _iterator2 = _createForOfIteratorHelper(declarations),
|
|
778
|
+
_step2;
|
|
779
|
+
try {
|
|
780
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
781
|
+
var declaration = _step2.value;
|
|
782
|
+
if (declaration) {
|
|
783
|
+
var _declaration$split = declaration.split(PROPERTY_DELIMITER),
|
|
784
|
+
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
785
|
+
prop = _declaration$split2[0],
|
|
786
|
+
value = _declaration$split2[1];
|
|
787
|
+
if (prop !== undefined && value !== undefined) {
|
|
788
|
+
styleMap[prop.trim()] = value.trim();
|
|
789
|
+
}
|
|
750
790
|
}
|
|
751
|
-
}
|
|
791
|
+
}
|
|
792
|
+
} catch (err) {
|
|
793
|
+
_iterator2.e(err);
|
|
794
|
+
} finally {
|
|
795
|
+
_iterator2.f();
|
|
752
796
|
}
|
|
797
|
+
return styleMap;
|
|
753
798
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
var msg = "[LWC ".concat(method, "]: ").concat(message);
|
|
763
|
-
if (!isUndefined$1(vm)) {
|
|
764
|
-
msg = "".concat(msg, "\n").concat(getComponentStack(vm));
|
|
799
|
+
// Make a shallow copy of an object but omit the given key
|
|
800
|
+
function cloneAndOmitKey(object, keyToOmit) {
|
|
801
|
+
var result = {};
|
|
802
|
+
for (var _i6 = 0, _Object$keys = Object.keys(object); _i6 < _Object$keys.length; _i6++) {
|
|
803
|
+
var key = _Object$keys[_i6];
|
|
804
|
+
if (key !== keyToOmit) {
|
|
805
|
+
result[key] = object[key];
|
|
806
|
+
}
|
|
765
807
|
}
|
|
808
|
+
return result;
|
|
809
|
+
}
|
|
810
|
+
function flattenStylesheets(stylesheets) {
|
|
811
|
+
var list = [];
|
|
812
|
+
var _iterator3 = _createForOfIteratorHelper(stylesheets),
|
|
813
|
+
_step3;
|
|
766
814
|
try {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
815
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
816
|
+
var stylesheet = _step3.value;
|
|
817
|
+
if (!Array.isArray(stylesheet)) {
|
|
818
|
+
list.push(stylesheet);
|
|
819
|
+
} else {
|
|
820
|
+
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
} catch (err) {
|
|
824
|
+
_iterator3.e(err);
|
|
825
|
+
} finally {
|
|
826
|
+
_iterator3.f();
|
|
771
827
|
}
|
|
828
|
+
return list;
|
|
772
829
|
}
|
|
773
|
-
|
|
774
|
-
|
|
830
|
+
// Set a ref (lwc:ref) on a VM, from a template API
|
|
831
|
+
function setRefVNode(vm, ref, vnode) {
|
|
832
|
+
// If this method is called, then vm.refVNodes is set as the template has refs.
|
|
833
|
+
// If not, then something went wrong and we threw an error above.
|
|
834
|
+
var refVNodes = vm.refVNodes;
|
|
835
|
+
// In cases of conflict (two elements with the same ref), prefer, the last one,
|
|
836
|
+
// in depth-first traversal order.
|
|
837
|
+
if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
|
|
838
|
+
refVNodes[ref] = vnode;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
// Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
|
|
842
|
+
function assertNotProd() {
|
|
843
|
+
/* istanbul ignore if */
|
|
844
|
+
{
|
|
845
|
+
// this method should never leak to prod
|
|
846
|
+
throw new ReferenceError();
|
|
847
|
+
}
|
|
775
848
|
}
|
|
776
849
|
|
|
777
850
|
/*
|
|
@@ -807,101 +880,6 @@ var LWC = (function (exports) {
|
|
|
807
880
|
*/
|
|
808
881
|
// These properties get added to LWCElement.prototype publicProps automatically
|
|
809
882
|
var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
|
|
810
|
-
function offsetPropertyErrorMessage(name) {
|
|
811
|
-
return "Using the `".concat(name, "` property is an anti-pattern because it rounds the value to an integer. Instead, use the `getBoundingClientRect` method to obtain fractional values for the size of an element and its position relative to the viewport.");
|
|
812
|
-
}
|
|
813
|
-
// Global HTML Attributes & Properties
|
|
814
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
|
|
815
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
816
|
-
//
|
|
817
|
-
// If you update this list, check for test files that recapitulate the same list. Searching the codebase
|
|
818
|
-
// for e.g. "dropzone" should suffice.
|
|
819
|
-
assign(create(null), {
|
|
820
|
-
accessKey: {
|
|
821
|
-
attribute: 'accesskey'
|
|
822
|
-
},
|
|
823
|
-
accessKeyLabel: {
|
|
824
|
-
readOnly: true
|
|
825
|
-
},
|
|
826
|
-
className: {
|
|
827
|
-
attribute: 'class',
|
|
828
|
-
error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
|
|
829
|
-
},
|
|
830
|
-
contentEditable: {
|
|
831
|
-
attribute: 'contenteditable'
|
|
832
|
-
},
|
|
833
|
-
dataset: {
|
|
834
|
-
readOnly: true,
|
|
835
|
-
error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
|
|
836
|
-
},
|
|
837
|
-
dir: {
|
|
838
|
-
attribute: 'dir'
|
|
839
|
-
},
|
|
840
|
-
draggable: {
|
|
841
|
-
attribute: 'draggable'
|
|
842
|
-
},
|
|
843
|
-
dropzone: {
|
|
844
|
-
attribute: 'dropzone',
|
|
845
|
-
readOnly: true
|
|
846
|
-
},
|
|
847
|
-
hidden: {
|
|
848
|
-
attribute: 'hidden'
|
|
849
|
-
},
|
|
850
|
-
id: {
|
|
851
|
-
attribute: 'id'
|
|
852
|
-
},
|
|
853
|
-
inputMode: {
|
|
854
|
-
attribute: 'inputmode'
|
|
855
|
-
},
|
|
856
|
-
lang: {
|
|
857
|
-
attribute: 'lang'
|
|
858
|
-
},
|
|
859
|
-
slot: {
|
|
860
|
-
attribute: 'slot',
|
|
861
|
-
error: 'Using the `slot` property is an anti-pattern.'
|
|
862
|
-
},
|
|
863
|
-
spellcheck: {
|
|
864
|
-
attribute: 'spellcheck'
|
|
865
|
-
},
|
|
866
|
-
style: {
|
|
867
|
-
attribute: 'style'
|
|
868
|
-
},
|
|
869
|
-
tabIndex: {
|
|
870
|
-
attribute: 'tabindex'
|
|
871
|
-
},
|
|
872
|
-
title: {
|
|
873
|
-
attribute: 'title'
|
|
874
|
-
},
|
|
875
|
-
translate: {
|
|
876
|
-
attribute: 'translate'
|
|
877
|
-
},
|
|
878
|
-
// additional "global attributes" that are not present in the link above.
|
|
879
|
-
isContentEditable: {
|
|
880
|
-
readOnly: true
|
|
881
|
-
},
|
|
882
|
-
offsetHeight: {
|
|
883
|
-
readOnly: true,
|
|
884
|
-
error: offsetPropertyErrorMessage('offsetHeight')
|
|
885
|
-
},
|
|
886
|
-
offsetLeft: {
|
|
887
|
-
readOnly: true,
|
|
888
|
-
error: offsetPropertyErrorMessage('offsetLeft')
|
|
889
|
-
},
|
|
890
|
-
offsetParent: {
|
|
891
|
-
readOnly: true
|
|
892
|
-
},
|
|
893
|
-
offsetTop: {
|
|
894
|
-
readOnly: true,
|
|
895
|
-
error: offsetPropertyErrorMessage('offsetTop')
|
|
896
|
-
},
|
|
897
|
-
offsetWidth: {
|
|
898
|
-
readOnly: true,
|
|
899
|
-
error: offsetPropertyErrorMessage('offsetWidth')
|
|
900
|
-
},
|
|
901
|
-
role: {
|
|
902
|
-
attribute: 'role'
|
|
903
|
-
}
|
|
904
|
-
});
|
|
905
883
|
var controlledElement = null;
|
|
906
884
|
var controlledAttributeName;
|
|
907
885
|
function isAttributeLocked(elm, attrName) {
|
|
@@ -1565,7 +1543,6 @@ var LWC = (function (exports) {
|
|
|
1565
1543
|
}
|
|
1566
1544
|
};
|
|
1567
1545
|
}
|
|
1568
|
-
var EMPTY_REFS = freeze(create(null));
|
|
1569
1546
|
var refsCache = new WeakMap();
|
|
1570
1547
|
/**
|
|
1571
1548
|
* This class is the base class for any LWC element.
|
|
@@ -1732,22 +1709,15 @@ var LWC = (function (exports) {
|
|
|
1732
1709
|
// based on `this.refs.bar`.
|
|
1733
1710
|
return;
|
|
1734
1711
|
}
|
|
1735
|
-
var refVNodes = vm.refVNodes
|
|
1736
|
-
hasRefVNodes = vm.hasRefVNodes;
|
|
1712
|
+
var refVNodes = vm.refVNodes;
|
|
1737
1713
|
vm.cmpTemplate;
|
|
1738
1714
|
// For backwards compatibility with component written before template refs
|
|
1739
1715
|
// were introduced, we return undefined if the template has no refs defined
|
|
1740
1716
|
// anywhere. This fixes components that may want to add an expando called `refs`
|
|
1741
1717
|
// and are checking if it exists with `if (this.refs)` before adding it.
|
|
1742
|
-
// Note
|
|
1743
|
-
// because a template may have `lwc:ref` defined within a falsy `if:true` block.
|
|
1744
|
-
if (!hasRefVNodes) {
|
|
1745
|
-
return;
|
|
1746
|
-
}
|
|
1747
|
-
// For templates that are using `lwc:ref`, if there are no refs currently available
|
|
1748
|
-
// (e.g. refs inside of a falsy `if:true` block), we return an empty object.
|
|
1718
|
+
// Note we use a null refVNodes to indicate that the template has no refs defined.
|
|
1749
1719
|
if (isNull(refVNodes)) {
|
|
1750
|
-
return
|
|
1720
|
+
return;
|
|
1751
1721
|
}
|
|
1752
1722
|
// The refNodes can be cached based on the refVNodes, since the refVNodes
|
|
1753
1723
|
// are recreated from scratch every time the template is rendered.
|
|
@@ -1755,17 +1725,17 @@ var LWC = (function (exports) {
|
|
|
1755
1725
|
var refs = refsCache.get(refVNodes);
|
|
1756
1726
|
if (isUndefined$1(refs)) {
|
|
1757
1727
|
refs = create(null);
|
|
1758
|
-
var
|
|
1759
|
-
|
|
1728
|
+
var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
|
|
1729
|
+
_step4;
|
|
1760
1730
|
try {
|
|
1761
|
-
for (
|
|
1762
|
-
var key =
|
|
1731
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1732
|
+
var key = _step4.value;
|
|
1763
1733
|
refs[key] = refVNodes[key].elm;
|
|
1764
1734
|
}
|
|
1765
1735
|
} catch (err) {
|
|
1766
|
-
|
|
1736
|
+
_iterator4.e(err);
|
|
1767
1737
|
} finally {
|
|
1768
|
-
|
|
1738
|
+
_iterator4.f();
|
|
1769
1739
|
}
|
|
1770
1740
|
freeze(refs);
|
|
1771
1741
|
refsCache.set(refVNodes, refs);
|
|
@@ -1885,6 +1855,262 @@ var LWC = (function (exports) {
|
|
|
1885
1855
|
};
|
|
1886
1856
|
}
|
|
1887
1857
|
|
|
1858
|
+
/*
|
|
1859
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
1860
|
+
* All rights reserved.
|
|
1861
|
+
* SPDX-License-Identifier: MIT
|
|
1862
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1863
|
+
*/
|
|
1864
|
+
var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
|
|
1865
|
+
var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
|
|
1866
|
+
var WireMetaMap = new Map();
|
|
1867
|
+
var WireContextRegistrationEvent = /*#__PURE__*/function (_CustomEvent) {
|
|
1868
|
+
_inherits(WireContextRegistrationEvent, _CustomEvent);
|
|
1869
|
+
var _super3 = _createSuper(WireContextRegistrationEvent);
|
|
1870
|
+
function WireContextRegistrationEvent(adapterToken, _ref3) {
|
|
1871
|
+
var _this2;
|
|
1872
|
+
var setNewContext = _ref3.setNewContext,
|
|
1873
|
+
setDisconnectedCallback = _ref3.setDisconnectedCallback;
|
|
1874
|
+
_classCallCheck(this, WireContextRegistrationEvent);
|
|
1875
|
+
_this2 = _super3.call(this, adapterToken, {
|
|
1876
|
+
bubbles: true,
|
|
1877
|
+
composed: true
|
|
1878
|
+
});
|
|
1879
|
+
defineProperties(_assertThisInitialized(_this2), {
|
|
1880
|
+
setNewContext: {
|
|
1881
|
+
value: setNewContext
|
|
1882
|
+
},
|
|
1883
|
+
setDisconnectedCallback: {
|
|
1884
|
+
value: setDisconnectedCallback
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
return _this2;
|
|
1888
|
+
}
|
|
1889
|
+
return _createClass(WireContextRegistrationEvent);
|
|
1890
|
+
}( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
|
|
1891
|
+
function createFieldDataCallback(vm, name) {
|
|
1892
|
+
return function (value) {
|
|
1893
|
+
updateComponentValue(vm, name, value);
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
function createMethodDataCallback(vm, method) {
|
|
1897
|
+
return function (value) {
|
|
1898
|
+
// dispatching new value into the wired method
|
|
1899
|
+
runWithBoundaryProtection(vm, vm.owner, noop, function () {
|
|
1900
|
+
// job
|
|
1901
|
+
method.call(vm.component, value);
|
|
1902
|
+
}, noop);
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
|
|
1906
|
+
var hasPendingConfig = false;
|
|
1907
|
+
// creating the reactive observer for reactive params when needed
|
|
1908
|
+
var ro = createReactiveObserver(function () {
|
|
1909
|
+
if (hasPendingConfig === false) {
|
|
1910
|
+
hasPendingConfig = true;
|
|
1911
|
+
// collect new config in the micro-task
|
|
1912
|
+
Promise.resolve().then(function () {
|
|
1913
|
+
hasPendingConfig = false;
|
|
1914
|
+
// resetting current reactive params
|
|
1915
|
+
ro.reset();
|
|
1916
|
+
// dispatching a new config due to a change in the configuration
|
|
1917
|
+
computeConfigAndUpdate();
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
var computeConfigAndUpdate = function computeConfigAndUpdate() {
|
|
1922
|
+
var config;
|
|
1923
|
+
ro.observe(function () {
|
|
1924
|
+
return config = configCallback(component);
|
|
1925
|
+
});
|
|
1926
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
1927
|
+
// TODO: dev-mode validation of config based on the adapter.configSchema
|
|
1928
|
+
// @ts-ignore it is assigned in the observe() callback
|
|
1929
|
+
callbackWhenConfigIsReady(config);
|
|
1930
|
+
};
|
|
1931
|
+
return {
|
|
1932
|
+
computeConfigAndUpdate: computeConfigAndUpdate,
|
|
1933
|
+
ro: ro
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
1937
|
+
var adapter = wireDef.adapter;
|
|
1938
|
+
var adapterContextToken = getAdapterToken(adapter);
|
|
1939
|
+
if (isUndefined$1(adapterContextToken)) {
|
|
1940
|
+
return; // no provider found, nothing to be done
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
var elm = vm.elm,
|
|
1944
|
+
_vm$context = vm.context,
|
|
1945
|
+
wiredConnecting = _vm$context.wiredConnecting,
|
|
1946
|
+
wiredDisconnecting = _vm$context.wiredDisconnecting,
|
|
1947
|
+
dispatchEvent = vm.renderer.dispatchEvent;
|
|
1948
|
+
// waiting for the component to be connected to formally request the context via the token
|
|
1949
|
+
ArrayPush$1.call(wiredConnecting, function () {
|
|
1950
|
+
// This event is responsible for connecting the host element with another
|
|
1951
|
+
// element in the composed path that is providing contextual data. The provider
|
|
1952
|
+
// must be listening for a special dom event with the name corresponding to the value of
|
|
1953
|
+
// `adapterContextToken`, which will remain secret and internal to this file only to
|
|
1954
|
+
// guarantee that the linkage can be forged.
|
|
1955
|
+
var contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
|
|
1956
|
+
setNewContext: function setNewContext(newContext) {
|
|
1957
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
1958
|
+
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
1959
|
+
callbackWhenContextIsReady(newContext);
|
|
1960
|
+
},
|
|
1961
|
+
setDisconnectedCallback: function setDisconnectedCallback(disconnectCallback) {
|
|
1962
|
+
// adds this callback into the disconnect bucket so it gets disconnected from parent
|
|
1963
|
+
// the the element hosting the wire is disconnected
|
|
1964
|
+
ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
|
|
1965
|
+
}
|
|
1966
|
+
});
|
|
1967
|
+
dispatchEvent(elm, contextRegistrationEvent);
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
function createConnector(vm, name, wireDef) {
|
|
1971
|
+
var method = wireDef.method,
|
|
1972
|
+
adapter = wireDef.adapter,
|
|
1973
|
+
configCallback = wireDef.configCallback,
|
|
1974
|
+
dynamic = wireDef.dynamic;
|
|
1975
|
+
var debugInfo;
|
|
1976
|
+
var fieldOrMethodCallback = isUndefined$1(method) ? createFieldDataCallback(vm, name) : createMethodDataCallback(vm, method);
|
|
1977
|
+
var dataCallback = function dataCallback(value) {
|
|
1978
|
+
fieldOrMethodCallback(value);
|
|
1979
|
+
};
|
|
1980
|
+
var context;
|
|
1981
|
+
var connector;
|
|
1982
|
+
// Workaround to pass the component element associated to this wire adapter instance.
|
|
1983
|
+
defineProperty(dataCallback, DeprecatedWiredElementHost, {
|
|
1984
|
+
value: vm.elm
|
|
1985
|
+
});
|
|
1986
|
+
defineProperty(dataCallback, DeprecatedWiredParamsMeta, {
|
|
1987
|
+
value: dynamic
|
|
1988
|
+
});
|
|
1989
|
+
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
1990
|
+
// job
|
|
1991
|
+
connector = new adapter(dataCallback);
|
|
1992
|
+
}, noop);
|
|
1993
|
+
var updateConnectorConfig = function updateConnectorConfig(config) {
|
|
1994
|
+
// every time the config is recomputed due to tracking,
|
|
1995
|
+
// this callback will be invoked with the new computed config
|
|
1996
|
+
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
1997
|
+
// job
|
|
1998
|
+
if ("production" !== 'production') ;
|
|
1999
|
+
connector.update(config, context);
|
|
2000
|
+
}, noop);
|
|
2001
|
+
};
|
|
2002
|
+
// Computes the current wire config and calls the update method on the wire adapter.
|
|
2003
|
+
// If it has params, we will need to observe changes in the next tick.
|
|
2004
|
+
var _createConfigWatcher = createConfigWatcher(vm.component, configCallback, updateConnectorConfig),
|
|
2005
|
+
computeConfigAndUpdate = _createConfigWatcher.computeConfigAndUpdate,
|
|
2006
|
+
ro = _createConfigWatcher.ro;
|
|
2007
|
+
// if the adapter needs contextualization, we need to watch for new context and push it alongside the config
|
|
2008
|
+
if (!isUndefined$1(adapter.contextSchema)) {
|
|
2009
|
+
createContextWatcher(vm, wireDef, function (newContext) {
|
|
2010
|
+
// every time the context is pushed into this component,
|
|
2011
|
+
// this callback will be invoked with the new computed context
|
|
2012
|
+
if (context !== newContext) {
|
|
2013
|
+
context = newContext;
|
|
2014
|
+
// Note: when new context arrives, the config will be recomputed and pushed along side the new
|
|
2015
|
+
// context, this is to preserve the identity characteristics, config should not have identity
|
|
2016
|
+
// (ever), while context can have identity
|
|
2017
|
+
if (vm.state === 1 /* VMState.connected */) {
|
|
2018
|
+
computeConfigAndUpdate();
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
return {
|
|
2024
|
+
// @ts-ignore the boundary protection executes sync, connector is always defined
|
|
2025
|
+
connector: connector,
|
|
2026
|
+
computeConfigAndUpdate: computeConfigAndUpdate,
|
|
2027
|
+
resetConfigWatcher: function resetConfigWatcher() {
|
|
2028
|
+
return ro.reset();
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
var AdapterToTokenMap = new Map();
|
|
2033
|
+
function getAdapterToken(adapter) {
|
|
2034
|
+
return AdapterToTokenMap.get(adapter);
|
|
2035
|
+
}
|
|
2036
|
+
function setAdapterToken(adapter, token) {
|
|
2037
|
+
AdapterToTokenMap.set(adapter, token);
|
|
2038
|
+
}
|
|
2039
|
+
function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
|
|
2040
|
+
// support for callable adapters
|
|
2041
|
+
if (adapter.adapter) {
|
|
2042
|
+
adapter = adapter.adapter;
|
|
2043
|
+
}
|
|
2044
|
+
var method = descriptor.value;
|
|
2045
|
+
var def = {
|
|
2046
|
+
adapter: adapter,
|
|
2047
|
+
method: method,
|
|
2048
|
+
configCallback: configCallback,
|
|
2049
|
+
dynamic: dynamic
|
|
2050
|
+
};
|
|
2051
|
+
WireMetaMap.set(descriptor, def);
|
|
2052
|
+
}
|
|
2053
|
+
function storeWiredFieldMeta(descriptor, adapter, configCallback, dynamic) {
|
|
2054
|
+
// support for callable adapters
|
|
2055
|
+
if (adapter.adapter) {
|
|
2056
|
+
adapter = adapter.adapter;
|
|
2057
|
+
}
|
|
2058
|
+
var def = {
|
|
2059
|
+
adapter: adapter,
|
|
2060
|
+
configCallback: configCallback,
|
|
2061
|
+
dynamic: dynamic
|
|
2062
|
+
};
|
|
2063
|
+
WireMetaMap.set(descriptor, def);
|
|
2064
|
+
}
|
|
2065
|
+
function installWireAdapters(vm) {
|
|
2066
|
+
var context = vm.context,
|
|
2067
|
+
wire = vm.def.wire;
|
|
2068
|
+
var wiredConnecting = context.wiredConnecting = [];
|
|
2069
|
+
var wiredDisconnecting = context.wiredDisconnecting = [];
|
|
2070
|
+
for (var fieldNameOrMethod in wire) {
|
|
2071
|
+
var descriptor = wire[fieldNameOrMethod];
|
|
2072
|
+
var wireDef = WireMetaMap.get(descriptor);
|
|
2073
|
+
if (!isUndefined$1(wireDef)) {
|
|
2074
|
+
(function () {
|
|
2075
|
+
var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
|
|
2076
|
+
connector = _createConnector.connector,
|
|
2077
|
+
computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
|
|
2078
|
+
resetConfigWatcher = _createConnector.resetConfigWatcher;
|
|
2079
|
+
var hasDynamicParams = wireDef.dynamic.length > 0;
|
|
2080
|
+
ArrayPush$1.call(wiredConnecting, function () {
|
|
2081
|
+
connector.connect();
|
|
2082
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
2083
|
+
if (hasDynamicParams) {
|
|
2084
|
+
Promise.resolve().then(computeConfigAndUpdate);
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
computeConfigAndUpdate();
|
|
2089
|
+
});
|
|
2090
|
+
ArrayPush$1.call(wiredDisconnecting, function () {
|
|
2091
|
+
connector.disconnect();
|
|
2092
|
+
resetConfigWatcher();
|
|
2093
|
+
});
|
|
2094
|
+
})();
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
function connectWireAdapters(vm) {
|
|
2099
|
+
var wiredConnecting = vm.context.wiredConnecting;
|
|
2100
|
+
for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
|
|
2101
|
+
wiredConnecting[_i8]();
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
function disconnectWireAdapters(vm) {
|
|
2105
|
+
var wiredDisconnecting = vm.context.wiredDisconnecting;
|
|
2106
|
+
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
2107
|
+
// job
|
|
2108
|
+
for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
|
|
2109
|
+
wiredDisconnecting[_i9]();
|
|
2110
|
+
}
|
|
2111
|
+
}, noop);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
1888
2114
|
/*
|
|
1889
2115
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1890
2116
|
* All rights reserved.
|
|
@@ -2082,8 +2308,8 @@ var LWC = (function (exports) {
|
|
|
2082
2308
|
}
|
|
2083
2309
|
}
|
|
2084
2310
|
if (!isUndefined$1(fields)) {
|
|
2085
|
-
for (var
|
|
2086
|
-
var _fieldName2 = fields[
|
|
2311
|
+
for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
|
|
2312
|
+
var _fieldName2 = fields[_i10];
|
|
2087
2313
|
descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
|
|
2088
2314
|
// [W-9927596] Only mark a field as observed whenever it isn't a duplicated public nor
|
|
2089
2315
|
// tracked property. This is only here for backward compatibility purposes.
|
|
@@ -2234,10 +2460,10 @@ var LWC = (function (exports) {
|
|
|
2234
2460
|
if (isFunction$1(SuperClass)) {
|
|
2235
2461
|
HTMLBridgeElement = /*#__PURE__*/function (_SuperClass) {
|
|
2236
2462
|
_inherits(HTMLBridgeElement, _SuperClass);
|
|
2237
|
-
var
|
|
2463
|
+
var _super4 = _createSuper(HTMLBridgeElement);
|
|
2238
2464
|
function HTMLBridgeElement() {
|
|
2239
2465
|
_classCallCheck(this, HTMLBridgeElement);
|
|
2240
|
-
return
|
|
2466
|
+
return _super4.apply(this, arguments);
|
|
2241
2467
|
}
|
|
2242
2468
|
return _createClass(HTMLBridgeElement);
|
|
2243
2469
|
}(SuperClass);
|
|
@@ -2264,8 +2490,8 @@ var LWC = (function (exports) {
|
|
|
2264
2490
|
superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
|
|
2265
2491
|
var descriptors = create(null);
|
|
2266
2492
|
// expose getters and setters for each public props on the new Element Bridge
|
|
2267
|
-
for (var
|
|
2268
|
-
var _propName = props[
|
|
2493
|
+
for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
|
|
2494
|
+
var _propName = props[_i11];
|
|
2269
2495
|
attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
|
|
2270
2496
|
descriptors[_propName] = {
|
|
2271
2497
|
get: createGetter(_propName),
|
|
@@ -2275,8 +2501,8 @@ var LWC = (function (exports) {
|
|
|
2275
2501
|
};
|
|
2276
2502
|
}
|
|
2277
2503
|
// expose public methods as props on the new Element Bridge
|
|
2278
|
-
for (var
|
|
2279
|
-
var methodName = methods[
|
|
2504
|
+
for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
|
|
2505
|
+
var methodName = methods[_i12];
|
|
2280
2506
|
descriptors[methodName] = {
|
|
2281
2507
|
value: createMethodCaller(methodName),
|
|
2282
2508
|
writable: true,
|
|
@@ -2317,10 +2543,60 @@ var LWC = (function (exports) {
|
|
|
2317
2543
|
}
|
|
2318
2544
|
freeze(BaseBridgeElement);
|
|
2319
2545
|
seal(BaseBridgeElement.prototype);
|
|
2546
|
+
var swappedStyleMap = new WeakMap();
|
|
2547
|
+
var activeTemplates = new WeakMap();
|
|
2548
|
+
var activeComponents = new WeakMap();
|
|
2549
|
+
var activeStyles = new WeakMap();
|
|
2550
|
+
function getStyleOrSwappedStyle(style) {
|
|
2551
|
+
assertNotProd(); // this method should never leak to prod
|
|
2552
|
+
var visited = new Set();
|
|
2553
|
+
while (swappedStyleMap.has(style) && !visited.has(style)) {
|
|
2554
|
+
visited.add(style);
|
|
2555
|
+
style = swappedStyleMap.get(style);
|
|
2556
|
+
}
|
|
2557
|
+
return style;
|
|
2558
|
+
}
|
|
2320
2559
|
function setActiveVM(vm) {
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2560
|
+
assertNotProd(); // this method should never leak to prod
|
|
2561
|
+
// tracking active component
|
|
2562
|
+
var Ctor = vm.def.ctor;
|
|
2563
|
+
var componentVMs = activeComponents.get(Ctor);
|
|
2564
|
+
if (isUndefined$1(componentVMs)) {
|
|
2565
|
+
componentVMs = new Set();
|
|
2566
|
+
activeComponents.set(Ctor, componentVMs);
|
|
2567
|
+
}
|
|
2568
|
+
// this will allow us to keep track of the hot components
|
|
2569
|
+
componentVMs.add(vm);
|
|
2570
|
+
// tracking active template
|
|
2571
|
+
var tpl = vm.cmpTemplate;
|
|
2572
|
+
if (tpl) {
|
|
2573
|
+
var templateVMs = activeTemplates.get(tpl);
|
|
2574
|
+
if (isUndefined$1(templateVMs)) {
|
|
2575
|
+
templateVMs = new Set();
|
|
2576
|
+
activeTemplates.set(tpl, templateVMs);
|
|
2577
|
+
}
|
|
2578
|
+
// this will allow us to keep track of the templates that are
|
|
2579
|
+
// being used by a hot component
|
|
2580
|
+
templateVMs.add(vm);
|
|
2581
|
+
// tracking active styles associated to template
|
|
2582
|
+
var stylesheets = tpl.stylesheets;
|
|
2583
|
+
if (!isUndefined$1(stylesheets)) {
|
|
2584
|
+
flattenStylesheets(stylesheets).forEach(function (stylesheet) {
|
|
2585
|
+
// this is necessary because we don't hold the list of styles
|
|
2586
|
+
// in the vm, we only hold the selected (already swapped template)
|
|
2587
|
+
// but the styles attached to the template might not be the actual
|
|
2588
|
+
// active ones, but the swapped versions of those.
|
|
2589
|
+
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
2590
|
+
var stylesheetVMs = activeStyles.get(stylesheet);
|
|
2591
|
+
if (isUndefined$1(stylesheetVMs)) {
|
|
2592
|
+
stylesheetVMs = new Set();
|
|
2593
|
+
activeStyles.set(stylesheet, stylesheetVMs);
|
|
2594
|
+
}
|
|
2595
|
+
// this will allow us to keep track of the stylesheet that are
|
|
2596
|
+
// being used by a hot component
|
|
2597
|
+
stylesheetVMs.add(vm);
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2324
2600
|
}
|
|
2325
2601
|
}
|
|
2326
2602
|
function swapTemplate(oldTpl, newTpl) {
|
|
@@ -2594,8 +2870,8 @@ var LWC = (function (exports) {
|
|
|
2594
2870
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
2595
2871
|
var content = [];
|
|
2596
2872
|
var root;
|
|
2597
|
-
for (var
|
|
2598
|
-
var stylesheet = stylesheets[
|
|
2873
|
+
for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
|
|
2874
|
+
var stylesheet = stylesheets[_i13];
|
|
2599
2875
|
if (isArray$1(stylesheet)) {
|
|
2600
2876
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
2601
2877
|
} else {
|
|
@@ -2695,8 +2971,8 @@ var LWC = (function (exports) {
|
|
|
2695
2971
|
shadowMode = vm.shadowMode,
|
|
2696
2972
|
insertStylesheet = vm.renderer.insertStylesheet;
|
|
2697
2973
|
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
2698
|
-
for (var
|
|
2699
|
-
insertStylesheet(stylesheets[
|
|
2974
|
+
for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
|
|
2975
|
+
insertStylesheet(stylesheets[_i14]);
|
|
2700
2976
|
}
|
|
2701
2977
|
} else if (vm.hydrated) {
|
|
2702
2978
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
@@ -2709,8 +2985,8 @@ var LWC = (function (exports) {
|
|
|
2709
2985
|
var root = getNearestNativeShadowComponent(vm);
|
|
2710
2986
|
// null root means a global style
|
|
2711
2987
|
var target = isNull(root) ? undefined : root.shadowRoot;
|
|
2712
|
-
for (var
|
|
2713
|
-
insertStylesheet(stylesheets[
|
|
2988
|
+
for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
|
|
2989
|
+
insertStylesheet(stylesheets[_i15], target);
|
|
2714
2990
|
}
|
|
2715
2991
|
}
|
|
2716
2992
|
return null;
|
|
@@ -3012,8 +3288,8 @@ var LWC = (function (exports) {
|
|
|
3012
3288
|
return;
|
|
3013
3289
|
}
|
|
3014
3290
|
var setCSSStyleProperty = renderer.setCSSStyleProperty;
|
|
3015
|
-
for (var
|
|
3016
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[
|
|
3291
|
+
for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
|
|
3292
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
|
|
3017
3293
|
prop = _styleDecls$_i[0],
|
|
3018
3294
|
value = _styleDecls$_i[1],
|
|
3019
3295
|
important = _styleDecls$_i[2];
|
|
@@ -3436,8 +3712,8 @@ var LWC = (function (exports) {
|
|
|
3436
3712
|
// If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
|
|
3437
3713
|
var nodeStack = [];
|
|
3438
3714
|
var fragmentFound = false;
|
|
3439
|
-
for (var
|
|
3440
|
-
var child = children[
|
|
3715
|
+
for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
|
|
3716
|
+
var child = children[_i17];
|
|
3441
3717
|
ArrayPush$1.call(nodeStack, child);
|
|
3442
3718
|
fragmentFound = fragmentFound || !!(child && isVFragment(child));
|
|
3443
3719
|
}
|
|
@@ -3449,8 +3725,8 @@ var LWC = (function (exports) {
|
|
|
3449
3725
|
if (!isNull(currentNode) && isVFragment(currentNode)) {
|
|
3450
3726
|
var fChildren = currentNode.children;
|
|
3451
3727
|
// Ignore the start and end text node delimiters
|
|
3452
|
-
for (var
|
|
3453
|
-
ArrayPush$1.call(nodeStack, fChildren[
|
|
3728
|
+
for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
|
|
3729
|
+
ArrayPush$1.call(nodeStack, fChildren[_i18]);
|
|
3454
3730
|
}
|
|
3455
3731
|
} else {
|
|
3456
3732
|
ArrayPush$1.call(flattenedChildren, currentNode);
|
|
@@ -3486,8 +3762,8 @@ var LWC = (function (exports) {
|
|
|
3486
3762
|
var oldSlotsMapping = vm.cmpSlots.slotAssignments;
|
|
3487
3763
|
var cmpSlotsMapping = create(null);
|
|
3488
3764
|
// Collect all slots into cmpSlotsMapping
|
|
3489
|
-
for (var
|
|
3490
|
-
var vnode = children[
|
|
3765
|
+
for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
|
|
3766
|
+
var vnode = children[_i19];
|
|
3491
3767
|
if (isNull(vnode)) {
|
|
3492
3768
|
continue;
|
|
3493
3769
|
}
|
|
@@ -3512,8 +3788,8 @@ var LWC = (function (exports) {
|
|
|
3512
3788
|
markComponentAsDirty(vm);
|
|
3513
3789
|
return;
|
|
3514
3790
|
}
|
|
3515
|
-
for (var
|
|
3516
|
-
var key = oldKeys[
|
|
3791
|
+
for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
|
|
3792
|
+
var key = oldKeys[_i20];
|
|
3517
3793
|
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
3518
3794
|
markComponentAsDirty(vm);
|
|
3519
3795
|
return;
|
|
@@ -3636,11 +3912,11 @@ var LWC = (function (exports) {
|
|
|
3636
3912
|
if (oldStartIdx > oldEndIdx) {
|
|
3637
3913
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
3638
3914
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
3639
|
-
var
|
|
3915
|
+
var _i21 = newEndIdx;
|
|
3640
3916
|
var n;
|
|
3641
3917
|
do {
|
|
3642
|
-
n = newCh[++
|
|
3643
|
-
} while (!isVNode(n) &&
|
|
3918
|
+
n = newCh[++_i21];
|
|
3919
|
+
} while (!isVNode(n) && _i21 < newChEnd);
|
|
3644
3920
|
before = isVNode(n) ? n.elm : null;
|
|
3645
3921
|
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
3646
3922
|
} else {
|
|
@@ -3665,9 +3941,9 @@ var LWC = (function (exports) {
|
|
|
3665
3941
|
// if the old list is not empty, the new list MUST have the same
|
|
3666
3942
|
// amount of nodes, that's why we call this static children
|
|
3667
3943
|
var anchor = null;
|
|
3668
|
-
for (var
|
|
3669
|
-
var n1 = c1[
|
|
3670
|
-
var n2 = c2[
|
|
3944
|
+
for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
|
|
3945
|
+
var n1 = c1[_i22];
|
|
3946
|
+
var n2 = c2[_i22];
|
|
3671
3947
|
if (n2 !== n1) {
|
|
3672
3948
|
if (isVNode(n1)) {
|
|
3673
3949
|
if (isVNode(n2)) {
|
|
@@ -3764,8 +4040,8 @@ var LWC = (function (exports) {
|
|
|
3764
4040
|
if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
|
|
3765
4041
|
var newChildren = [];
|
|
3766
4042
|
var slotAssignments = slotset.slotAssignments[slotName];
|
|
3767
|
-
for (var
|
|
3768
|
-
var vnode = slotAssignments[
|
|
4043
|
+
for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
|
|
4044
|
+
var vnode = slotAssignments[_i23];
|
|
3769
4045
|
if (!isNull(vnode)) {
|
|
3770
4046
|
var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
|
|
3771
4047
|
// The only sniff test for a scoped <slot> element is the presence of `slotData`
|
|
@@ -4100,9 +4376,18 @@ var LWC = (function (exports) {
|
|
|
4100
4376
|
vmBeingRendered = vm;
|
|
4101
4377
|
}
|
|
4102
4378
|
function validateSlots(vm, html) {
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4379
|
+
assertNotProd(); // this method should never leak to prod
|
|
4380
|
+
var cmpSlots = vm.cmpSlots;
|
|
4381
|
+
var _html$slots = html.slots,
|
|
4382
|
+
slots = _html$slots === void 0 ? EmptyArray : _html$slots;
|
|
4383
|
+
for (var slotName in cmpSlots.slotAssignments) {
|
|
4384
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4385
|
+
assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), "Slots can only be set to an array, instead received ".concat(toString$1(cmpSlots.slotAssignments[slotName]), " for slot \"").concat(slotName, "\" in ").concat(vm, "."));
|
|
4386
|
+
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
4387
|
+
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
4388
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4389
|
+
logError("Ignoring unknown provided slot name \"".concat(slotName, "\" in ").concat(vm, ". Check for a typo on the slot attribute."), vm);
|
|
4390
|
+
}
|
|
4106
4391
|
}
|
|
4107
4392
|
}
|
|
4108
4393
|
function validateLightDomTemplate(template, vm) {
|
|
@@ -4144,23 +4429,23 @@ var LWC = (function (exports) {
|
|
|
4144
4429
|
var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
|
|
4145
4430
|
var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
|
|
4146
4431
|
var htmlFragment = '';
|
|
4147
|
-
for (var
|
|
4148
|
-
switch (keys[
|
|
4432
|
+
for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
|
|
4433
|
+
switch (keys[_i24]) {
|
|
4149
4434
|
case 0:
|
|
4150
4435
|
// styleToken in existing class attr
|
|
4151
|
-
htmlFragment += strings[
|
|
4436
|
+
htmlFragment += strings[_i24] + classToken;
|
|
4152
4437
|
break;
|
|
4153
4438
|
case 1:
|
|
4154
4439
|
// styleToken for added class attr
|
|
4155
|
-
htmlFragment += strings[
|
|
4440
|
+
htmlFragment += strings[_i24] + classAttrToken;
|
|
4156
4441
|
break;
|
|
4157
4442
|
case 2:
|
|
4158
4443
|
// styleToken as attr
|
|
4159
|
-
htmlFragment += strings[
|
|
4444
|
+
htmlFragment += strings[_i24] + attrToken;
|
|
4160
4445
|
break;
|
|
4161
4446
|
case 3:
|
|
4162
4447
|
// ${1}${2}
|
|
4163
|
-
htmlFragment += strings[
|
|
4448
|
+
htmlFragment += strings[_i24] + classAttrToken + attrToken;
|
|
4164
4449
|
break;
|
|
4165
4450
|
}
|
|
4166
4451
|
}
|
|
@@ -4226,9 +4511,7 @@ var LWC = (function (exports) {
|
|
|
4226
4511
|
}
|
|
4227
4512
|
if ("production" !== 'production') ;
|
|
4228
4513
|
// reset the refs; they will be set during the tmpl() instantiation
|
|
4229
|
-
|
|
4230
|
-
vm.hasRefVNodes = hasRefVNodes;
|
|
4231
|
-
vm.refVNodes = hasRefVNodes ? create(null) : null;
|
|
4514
|
+
vm.refVNodes = html.hasRefs ? create(null) : null;
|
|
4232
4515
|
// right before producing the vnodes, we clear up all internal references
|
|
4233
4516
|
// to custom elements from the template.
|
|
4234
4517
|
vm.velements = [];
|
|
@@ -4250,8 +4533,8 @@ var LWC = (function (exports) {
|
|
|
4250
4533
|
}
|
|
4251
4534
|
function computeHasScopedStylesInStylesheets(stylesheets) {
|
|
4252
4535
|
if (hasStyles(stylesheets)) {
|
|
4253
|
-
for (var
|
|
4254
|
-
if (isTrue(stylesheets[
|
|
4536
|
+
for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
|
|
4537
|
+
if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
|
|
4255
4538
|
return true;
|
|
4256
4539
|
}
|
|
4257
4540
|
}
|
|
@@ -4356,8 +4639,8 @@ var LWC = (function (exports) {
|
|
|
4356
4639
|
*/
|
|
4357
4640
|
function registerComponent(
|
|
4358
4641
|
// We typically expect a LightningElementConstructor, but technically you can call this with anything
|
|
4359
|
-
Ctor,
|
|
4360
|
-
var tmpl =
|
|
4642
|
+
Ctor, _ref4) {
|
|
4643
|
+
var tmpl = _ref4.tmpl;
|
|
4361
4644
|
if (isFunction$1(Ctor)) {
|
|
4362
4645
|
signedTemplateMap.set(Ctor, tmpl);
|
|
4363
4646
|
}
|
|
@@ -4390,7 +4673,7 @@ var LWC = (function (exports) {
|
|
|
4390
4673
|
var cmpEventListenerMap = new WeakMap();
|
|
4391
4674
|
function getWrappedComponentsListener(vm, listener) {
|
|
4392
4675
|
if (!isFunction$1(listener)) {
|
|
4393
|
-
throw new TypeError(); // avoiding problems with non-valid listeners
|
|
4676
|
+
throw new TypeError('Expected an EventListener but received ' + _typeof(listener)); // avoiding problems with non-valid listeners
|
|
4394
4677
|
}
|
|
4395
4678
|
|
|
4396
4679
|
var wrappedListener = cmpEventListenerMap.get(listener);
|
|
@@ -4417,8 +4700,8 @@ var LWC = (function (exports) {
|
|
|
4417
4700
|
* subject to change or being removed.
|
|
4418
4701
|
*/
|
|
4419
4702
|
function register(service) {
|
|
4420
|
-
for (var
|
|
4421
|
-
var hookName = hooks[
|
|
4703
|
+
for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
|
|
4704
|
+
var hookName = hooks[_i26];
|
|
4422
4705
|
if (hookName in service) {
|
|
4423
4706
|
var l = Services[hookName];
|
|
4424
4707
|
if (isUndefined$1(l)) {
|
|
@@ -4432,8 +4715,8 @@ var LWC = (function (exports) {
|
|
|
4432
4715
|
var component = vm.component,
|
|
4433
4716
|
def = vm.def,
|
|
4434
4717
|
context = vm.context;
|
|
4435
|
-
for (var
|
|
4436
|
-
cbs[
|
|
4718
|
+
for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
|
|
4719
|
+
cbs[_i27].call(undefined, component, {}, def, context);
|
|
4437
4720
|
}
|
|
4438
4721
|
}
|
|
4439
4722
|
|
|
@@ -4521,7 +4804,6 @@ var LWC = (function (exports) {
|
|
|
4521
4804
|
mode: mode,
|
|
4522
4805
|
owner: owner,
|
|
4523
4806
|
refVNodes: null,
|
|
4524
|
-
hasRefVNodes: false,
|
|
4525
4807
|
children: EmptyArray,
|
|
4526
4808
|
aChildren: EmptyArray,
|
|
4527
4809
|
velements: EmptyArray,
|
|
@@ -4571,8 +4853,8 @@ var LWC = (function (exports) {
|
|
|
4571
4853
|
var valid = true;
|
|
4572
4854
|
var validate = function validate(arrayOrStylesheet) {
|
|
4573
4855
|
if (isArray$1(arrayOrStylesheet)) {
|
|
4574
|
-
for (var
|
|
4575
|
-
validate(arrayOrStylesheet[
|
|
4856
|
+
for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
|
|
4857
|
+
validate(arrayOrStylesheet[_i28]);
|
|
4576
4858
|
}
|
|
4577
4859
|
} else if (!isFunction$1(arrayOrStylesheet)) {
|
|
4578
4860
|
// function assumed to be a stylesheet factory
|
|
@@ -4707,17 +4989,17 @@ var LWC = (function (exports) {
|
|
|
4707
4989
|
return a.idx - b.idx;
|
|
4708
4990
|
});
|
|
4709
4991
|
rehydrateQueue = []; // reset to a new queue
|
|
4710
|
-
for (var
|
|
4711
|
-
var vm = vms[
|
|
4992
|
+
for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
|
|
4993
|
+
var vm = vms[_i29];
|
|
4712
4994
|
try {
|
|
4713
4995
|
rehydrate(vm);
|
|
4714
4996
|
} catch (error) {
|
|
4715
|
-
if (
|
|
4997
|
+
if (_i29 + 1 < len) {
|
|
4716
4998
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
4717
4999
|
if (rehydrateQueue.length === 0) {
|
|
4718
5000
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
4719
5001
|
}
|
|
4720
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
5002
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
|
|
4721
5003
|
}
|
|
4722
5004
|
// we need to end the measure before throwing.
|
|
4723
5005
|
logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
|
|
@@ -4783,8 +5065,8 @@ var LWC = (function (exports) {
|
|
|
4783
5065
|
var vCustomElementCollection = vm.velements;
|
|
4784
5066
|
// Reporting disconnection for every child in inverse order since they are
|
|
4785
5067
|
// inserted in reserved order.
|
|
4786
|
-
for (var
|
|
4787
|
-
var elm = vCustomElementCollection[
|
|
5068
|
+
for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
|
|
5069
|
+
var elm = vCustomElementCollection[_i30].elm;
|
|
4788
5070
|
// There are two cases where the element could be undefined:
|
|
4789
5071
|
// * when there is an error during the construction phase, and an error
|
|
4790
5072
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
@@ -4815,8 +5097,8 @@ var LWC = (function (exports) {
|
|
|
4815
5097
|
* defined on its shadow.
|
|
4816
5098
|
*/
|
|
4817
5099
|
function recursivelyDisconnectChildren(vnodes) {
|
|
4818
|
-
for (var
|
|
4819
|
-
var vnode = vnodes[
|
|
5100
|
+
for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
|
|
5101
|
+
var vnode = vnodes[_i31];
|
|
4820
5102
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
4821
5103
|
switch (vnode.type) {
|
|
4822
5104
|
case 2 /* VNodeType.Element */:
|
|
@@ -4840,8 +5122,8 @@ var LWC = (function (exports) {
|
|
|
4840
5122
|
var children = vm.children,
|
|
4841
5123
|
renderRoot = vm.renderRoot,
|
|
4842
5124
|
remove = vm.renderer.remove;
|
|
4843
|
-
for (var
|
|
4844
|
-
var child = children[
|
|
5125
|
+
for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
|
|
5126
|
+
var child = children[_i32];
|
|
4845
5127
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
4846
5128
|
remove(child.elm, renderRoot);
|
|
4847
5129
|
}
|
|
@@ -4901,254 +5183,153 @@ var LWC = (function (exports) {
|
|
|
4901
5183
|
* SPDX-License-Identifier: MIT
|
|
4902
5184
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
4903
5185
|
*/
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
});
|
|
4927
|
-
return _this2;
|
|
5186
|
+
//
|
|
5187
|
+
// The goal of this code is to detect invalid cross-root ARIA references in synthetic shadow DOM.
|
|
5188
|
+
// These invalid references should be fixed before the offending components can be migrated to native shadow DOM.
|
|
5189
|
+
// When invalid usage is detected, we warn in dev mode and call the reporting API if enabled.
|
|
5190
|
+
// See: https://lwc.dev/guide/accessibility#link-ids-and-aria-attributes-from-different-templates
|
|
5191
|
+
//
|
|
5192
|
+
// Use the unpatched native getElementById/querySelectorAll rather than the synthetic one
|
|
5193
|
+
var getElementById = _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
|
|
5194
|
+
var querySelectorAll = _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
|
|
5195
|
+
function isSyntheticShadowRootInstance(rootNode) {
|
|
5196
|
+
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
5197
|
+
}
|
|
5198
|
+
function reportViolation(source, target, attrName) {
|
|
5199
|
+
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
5200
|
+
// shadow for a violation to be detected.
|
|
5201
|
+
var vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
5202
|
+
if (isUndefined$1(vm)) {
|
|
5203
|
+
vm = getAssociatedVMIfPresent(target.getRootNode().host);
|
|
5204
|
+
}
|
|
5205
|
+
if (isUndefined$1(vm)) {
|
|
5206
|
+
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
5207
|
+
return;
|
|
4928
5208
|
}
|
|
4929
|
-
|
|
4930
|
-
}( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
|
|
4931
|
-
function createFieldDataCallback(vm, name) {
|
|
4932
|
-
return function (value) {
|
|
4933
|
-
updateComponentValue(vm, name, value);
|
|
4934
|
-
};
|
|
4935
|
-
}
|
|
4936
|
-
function createMethodDataCallback(vm, method) {
|
|
4937
|
-
return function (value) {
|
|
4938
|
-
// dispatching new value into the wired method
|
|
4939
|
-
runWithBoundaryProtection(vm, vm.owner, noop, function () {
|
|
4940
|
-
// job
|
|
4941
|
-
method.call(vm.component, value);
|
|
4942
|
-
}, noop);
|
|
4943
|
-
};
|
|
5209
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, vm);
|
|
4944
5210
|
}
|
|
4945
|
-
function
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
var ro = createReactiveObserver(function () {
|
|
4949
|
-
if (hasPendingConfig === false) {
|
|
4950
|
-
hasPendingConfig = true;
|
|
4951
|
-
// collect new config in the micro-task
|
|
4952
|
-
Promise.resolve().then(function () {
|
|
4953
|
-
hasPendingConfig = false;
|
|
4954
|
-
// resetting current reactive params
|
|
4955
|
-
ro.reset();
|
|
4956
|
-
// dispatching a new config due to a change in the configuration
|
|
4957
|
-
computeConfigAndUpdate();
|
|
4958
|
-
});
|
|
4959
|
-
}
|
|
4960
|
-
});
|
|
4961
|
-
var computeConfigAndUpdate = function computeConfigAndUpdate() {
|
|
4962
|
-
var config;
|
|
4963
|
-
ro.observe(function () {
|
|
4964
|
-
return config = configCallback(component);
|
|
4965
|
-
});
|
|
4966
|
-
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
4967
|
-
// TODO: dev-mode validation of config based on the adapter.configSchema
|
|
4968
|
-
// @ts-ignore it is assigned in the observe() callback
|
|
4969
|
-
callbackWhenConfigIsReady(config);
|
|
4970
|
-
};
|
|
4971
|
-
return {
|
|
4972
|
-
computeConfigAndUpdate: computeConfigAndUpdate,
|
|
4973
|
-
ro: ro
|
|
4974
|
-
};
|
|
5211
|
+
function parseIdRefAttributeValue(attrValue) {
|
|
5212
|
+
// split on whitespace and skip empty strings after splitting
|
|
5213
|
+
return isString(attrValue) ? ArrayFilter.call(StringSplit.call(attrValue, /\s+/), Boolean) : [];
|
|
4975
5214
|
}
|
|
4976
|
-
function
|
|
4977
|
-
var
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
return; // no provider found, nothing to be done
|
|
5215
|
+
function detectSyntheticCrossRootAria(elm, attrName, attrValue) {
|
|
5216
|
+
var root = elm.getRootNode();
|
|
5217
|
+
if (!isSyntheticShadowRootInstance(root)) {
|
|
5218
|
+
return;
|
|
4981
5219
|
}
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5220
|
+
if (attrName === 'id') {
|
|
5221
|
+
// elm is the target, find the source
|
|
5222
|
+
if (!isString(attrValue) || attrValue.length === 0) {
|
|
5223
|
+
// if our id is null or empty, nobody can reference us
|
|
5224
|
+
return;
|
|
5225
|
+
}
|
|
5226
|
+
var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
|
|
5227
|
+
_step5;
|
|
5228
|
+
try {
|
|
5229
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
5230
|
+
var idRefAttrName = _step5.value;
|
|
5231
|
+
// Query all global elements with this attribute. The attribute selector syntax `~=` is for values
|
|
5232
|
+
// that reference multiple IDs, separated by whitespace.
|
|
5233
|
+
var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
|
|
5234
|
+
var sourceElements = querySelectorAll.call(document, query);
|
|
5235
|
+
for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
|
|
5236
|
+
var sourceElement = sourceElements[_i33];
|
|
5237
|
+
var sourceRoot = sourceElement.getRootNode();
|
|
5238
|
+
if (sourceRoot !== root) {
|
|
5239
|
+
reportViolation(sourceElement, elm, idRefAttrName);
|
|
5240
|
+
break;
|
|
5241
|
+
}
|
|
5242
|
+
}
|
|
5005
5243
|
}
|
|
5006
|
-
})
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
defineProperty(dataCallback, DeprecatedWiredParamsMeta, {
|
|
5027
|
-
value: dynamic
|
|
5028
|
-
});
|
|
5029
|
-
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
5030
|
-
// job
|
|
5031
|
-
connector = new adapter(dataCallback);
|
|
5032
|
-
}, noop);
|
|
5033
|
-
var updateConnectorConfig = function updateConnectorConfig(config) {
|
|
5034
|
-
// every time the config is recomputed due to tracking,
|
|
5035
|
-
// this callback will be invoked with the new computed config
|
|
5036
|
-
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
5037
|
-
// job
|
|
5038
|
-
if ("production" !== 'production') ;
|
|
5039
|
-
connector.update(config, context);
|
|
5040
|
-
}, noop);
|
|
5041
|
-
};
|
|
5042
|
-
// Computes the current wire config and calls the update method on the wire adapter.
|
|
5043
|
-
// If it has params, we will need to observe changes in the next tick.
|
|
5044
|
-
var _createConfigWatcher = createConfigWatcher(vm.component, configCallback, updateConnectorConfig),
|
|
5045
|
-
computeConfigAndUpdate = _createConfigWatcher.computeConfigAndUpdate,
|
|
5046
|
-
ro = _createConfigWatcher.ro;
|
|
5047
|
-
// if the adapter needs contextualization, we need to watch for new context and push it alongside the config
|
|
5048
|
-
if (!isUndefined$1(adapter.contextSchema)) {
|
|
5049
|
-
createContextWatcher(vm, wireDef, function (newContext) {
|
|
5050
|
-
// every time the context is pushed into this component,
|
|
5051
|
-
// this callback will be invoked with the new computed context
|
|
5052
|
-
if (context !== newContext) {
|
|
5053
|
-
context = newContext;
|
|
5054
|
-
// Note: when new context arrives, the config will be recomputed and pushed along side the new
|
|
5055
|
-
// context, this is to preserve the identity characteristics, config should not have identity
|
|
5056
|
-
// (ever), while context can have identity
|
|
5057
|
-
if (vm.state === 1 /* VMState.connected */) {
|
|
5058
|
-
computeConfigAndUpdate();
|
|
5244
|
+
} catch (err) {
|
|
5245
|
+
_iterator5.e(err);
|
|
5246
|
+
} finally {
|
|
5247
|
+
_iterator5.f();
|
|
5248
|
+
}
|
|
5249
|
+
} else {
|
|
5250
|
+
// elm is the source, find the target
|
|
5251
|
+
var ids = parseIdRefAttributeValue(attrValue);
|
|
5252
|
+
var _iterator6 = _createForOfIteratorHelper(ids),
|
|
5253
|
+
_step6;
|
|
5254
|
+
try {
|
|
5255
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
5256
|
+
var id = _step6.value;
|
|
5257
|
+
var target = getElementById.call(document, id);
|
|
5258
|
+
if (!isNull(target)) {
|
|
5259
|
+
var targetRoot = target.getRootNode();
|
|
5260
|
+
if (targetRoot !== root) {
|
|
5261
|
+
// target element's shadow root is not the same as ours
|
|
5262
|
+
reportViolation(elm, target, attrName);
|
|
5263
|
+
}
|
|
5059
5264
|
}
|
|
5060
5265
|
}
|
|
5061
|
-
})
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
connector: connector,
|
|
5066
|
-
computeConfigAndUpdate: computeConfigAndUpdate,
|
|
5067
|
-
resetConfigWatcher: function resetConfigWatcher() {
|
|
5068
|
-
return ro.reset();
|
|
5266
|
+
} catch (err) {
|
|
5267
|
+
_iterator6.e(err);
|
|
5268
|
+
} finally {
|
|
5269
|
+
_iterator6.f();
|
|
5069
5270
|
}
|
|
5070
|
-
};
|
|
5071
|
-
}
|
|
5072
|
-
var AdapterToTokenMap = new Map();
|
|
5073
|
-
function getAdapterToken(adapter) {
|
|
5074
|
-
return AdapterToTokenMap.get(adapter);
|
|
5075
|
-
}
|
|
5076
|
-
function setAdapterToken(adapter, token) {
|
|
5077
|
-
AdapterToTokenMap.set(adapter, token);
|
|
5078
|
-
}
|
|
5079
|
-
function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
|
|
5080
|
-
// support for callable adapters
|
|
5081
|
-
if (adapter.adapter) {
|
|
5082
|
-
adapter = adapter.adapter;
|
|
5083
5271
|
}
|
|
5084
|
-
var method = descriptor.value;
|
|
5085
|
-
var def = {
|
|
5086
|
-
adapter: adapter,
|
|
5087
|
-
method: method,
|
|
5088
|
-
configCallback: configCallback,
|
|
5089
|
-
dynamic: dynamic
|
|
5090
|
-
};
|
|
5091
|
-
WireMetaMap.set(descriptor, def);
|
|
5092
5272
|
}
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5273
|
+
var enabled = false;
|
|
5274
|
+
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
5275
|
+
// reporting is not enabled. It should also only run once
|
|
5276
|
+
function enableDetection() {
|
|
5277
|
+
if (enabled) {
|
|
5278
|
+
return; // don't double-apply the patches
|
|
5097
5279
|
}
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
});
|
|
5130
|
-
ArrayPush$1.call(wiredDisconnecting, function () {
|
|
5131
|
-
connector.disconnect();
|
|
5132
|
-
resetConfigWatcher();
|
|
5133
|
-
});
|
|
5134
|
-
})();
|
|
5280
|
+
|
|
5281
|
+
enabled = true;
|
|
5282
|
+
var _setAttribute = Element.prototype.setAttribute;
|
|
5283
|
+
// Detect calling `setAttribute` to set an idref or an id
|
|
5284
|
+
assign(Element.prototype, {
|
|
5285
|
+
setAttribute: function setAttribute(attrName, attrValue) {
|
|
5286
|
+
_setAttribute.call(this, attrName, attrValue);
|
|
5287
|
+
if (attrName === 'id' || ID_REFERENCING_ATTRIBUTES_SET.has(attrName)) {
|
|
5288
|
+
detectSyntheticCrossRootAria(this, attrName, attrValue);
|
|
5289
|
+
}
|
|
5290
|
+
}
|
|
5291
|
+
});
|
|
5292
|
+
// Detect `elm.id = 'foo'`
|
|
5293
|
+
var idDescriptor = getOwnPropertyDescriptor$1(Element.prototype, 'id');
|
|
5294
|
+
if (!isUndefined$1(idDescriptor)) {
|
|
5295
|
+
var _get3 = idDescriptor.get,
|
|
5296
|
+
_set3 = idDescriptor.set;
|
|
5297
|
+
// These should always be a getter and a setter, but if someone is monkeying with the global descriptor, ignore it
|
|
5298
|
+
if (isFunction$1(_get3) && isFunction$1(_set3)) {
|
|
5299
|
+
defineProperty(Element.prototype, 'id', {
|
|
5300
|
+
get: function get() {
|
|
5301
|
+
return _get3.call(this);
|
|
5302
|
+
},
|
|
5303
|
+
set: function set(value) {
|
|
5304
|
+
_set3.call(this, value);
|
|
5305
|
+
detectSyntheticCrossRootAria(this, 'id', value);
|
|
5306
|
+
},
|
|
5307
|
+
// On the default descriptor for 'id', enumerable and configurable are true
|
|
5308
|
+
enumerable: true,
|
|
5309
|
+
configurable: true
|
|
5310
|
+
});
|
|
5135
5311
|
}
|
|
5136
5312
|
}
|
|
5137
5313
|
}
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
}
|
|
5314
|
+
// Our detection logic relies on some modern browser features. We can just skip reporting the data
|
|
5315
|
+
// for unsupported browsers
|
|
5316
|
+
function supportsCssEscape() {
|
|
5317
|
+
return typeof CSS !== 'undefined' && isFunction$1(CSS.escape);
|
|
5143
5318
|
}
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5319
|
+
// If this page is not using synthetic shadow, then we don't need to install detection. Note
|
|
5320
|
+
// that we are assuming synthetic shadow is loaded before LWC.
|
|
5321
|
+
function isSyntheticShadowLoaded() {
|
|
5322
|
+
// We should probably be calling `renderer.isSyntheticShadowDefined`, but 1) we don't have access to the renderer,
|
|
5323
|
+
// and 2) this code needs to run in @lwc/engine-core, so it can access `logWarn()` and `report()`.
|
|
5324
|
+
return hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
5325
|
+
}
|
|
5326
|
+
// Detecting cross-root ARIA in synthetic shadow only makes sense for the browser
|
|
5327
|
+
if (supportsCssEscape() && isSyntheticShadowLoaded()) {
|
|
5328
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
5329
|
+
{
|
|
5330
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
5331
|
+
onReportingEnabled(enableDetection);
|
|
5332
|
+
}
|
|
5152
5333
|
}
|
|
5153
5334
|
|
|
5154
5335
|
/*
|
|
@@ -5356,8 +5537,8 @@ var LWC = (function (exports) {
|
|
|
5356
5537
|
var nextNode = node;
|
|
5357
5538
|
var anchor = null;
|
|
5358
5539
|
var renderer = owner.renderer;
|
|
5359
|
-
for (var
|
|
5360
|
-
var childVnode = children[
|
|
5540
|
+
for (var _i34 = 0; _i34 < children.length; _i34++) {
|
|
5541
|
+
var childVnode = children[_i34];
|
|
5361
5542
|
if (!isNull(childVnode)) {
|
|
5362
5543
|
if (nextNode) {
|
|
5363
5544
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
@@ -5418,8 +5599,8 @@ var LWC = (function (exports) {
|
|
|
5418
5599
|
var nodesAreCompatible = true;
|
|
5419
5600
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5420
5601
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5421
|
-
for (var
|
|
5422
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
5602
|
+
for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
|
|
5603
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
|
|
5423
5604
|
attrName = _Object$entries$_i[0],
|
|
5424
5605
|
attrValue = _Object$entries$_i[1];
|
|
5425
5606
|
vnode.owner;
|
|
@@ -5506,8 +5687,8 @@ var LWC = (function (exports) {
|
|
|
5506
5687
|
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
5507
5688
|
var expectedStyle = [];
|
|
5508
5689
|
// styleMap is used when style is set to static value.
|
|
5509
|
-
for (var
|
|
5510
|
-
var _styleDecls$_i2 = _slicedToArray(styleDecls[
|
|
5690
|
+
for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
|
|
5691
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
|
|
5511
5692
|
prop = _styleDecls$_i2[0],
|
|
5512
5693
|
value = _styleDecls$_i2[1],
|
|
5513
5694
|
important = _styleDecls$_i2[2];
|
|
@@ -5581,8 +5762,8 @@ var LWC = (function (exports) {
|
|
|
5581
5762
|
// Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
|
|
5582
5763
|
function traverseStylesheets(stylesheets, callback) {
|
|
5583
5764
|
callback(stylesheets);
|
|
5584
|
-
for (var
|
|
5585
|
-
var stylesheet = stylesheets[
|
|
5765
|
+
for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
|
|
5766
|
+
var stylesheet = stylesheets[_i37];
|
|
5586
5767
|
if (isArray$1(stylesheet)) {
|
|
5587
5768
|
traverseStylesheets(stylesheet, callback);
|
|
5588
5769
|
} else {
|
|
@@ -6243,17 +6424,17 @@ var LWC = (function (exports) {
|
|
|
6243
6424
|
function flushPendingWhenDefinedCallbacks(tagName, ctor) {
|
|
6244
6425
|
var resolvers = pendingWhenDefinedCallbacks.get(tagName);
|
|
6245
6426
|
if (!isUndefined$1(resolvers)) {
|
|
6246
|
-
var
|
|
6247
|
-
|
|
6427
|
+
var _iterator10 = _createForOfIteratorHelper(resolvers),
|
|
6428
|
+
_step10;
|
|
6248
6429
|
try {
|
|
6249
|
-
for (
|
|
6250
|
-
var resolver =
|
|
6430
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6431
|
+
var resolver = _step10.value;
|
|
6251
6432
|
resolver(ctor);
|
|
6252
6433
|
}
|
|
6253
6434
|
} catch (err) {
|
|
6254
|
-
|
|
6435
|
+
_iterator10.e(err);
|
|
6255
6436
|
} finally {
|
|
6256
|
-
|
|
6437
|
+
_iterator10.f();
|
|
6257
6438
|
}
|
|
6258
6439
|
}
|
|
6259
6440
|
pendingWhenDefinedCallbacks.delete(tagName);
|
|
@@ -6303,11 +6484,11 @@ var LWC = (function (exports) {
|
|
|
6303
6484
|
var awaiting = awaitingUpgrade.get(tagName);
|
|
6304
6485
|
if (!isUndefined$1(awaiting)) {
|
|
6305
6486
|
awaitingUpgrade.delete(tagName);
|
|
6306
|
-
var
|
|
6307
|
-
|
|
6487
|
+
var _iterator11 = _createForOfIteratorHelper(awaiting),
|
|
6488
|
+
_step11;
|
|
6308
6489
|
try {
|
|
6309
|
-
for (
|
|
6310
|
-
var element =
|
|
6490
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6491
|
+
var element = _step11.value;
|
|
6311
6492
|
var registeredDefinition = pendingRegistryForElement.get(element);
|
|
6312
6493
|
// At this point, registeredDefinition should never be undefined because awaitingUpgrade
|
|
6313
6494
|
// is only populated when we haven't run internalUpgrade yet, and we only populate
|
|
@@ -6319,9 +6500,9 @@ var LWC = (function (exports) {
|
|
|
6319
6500
|
}
|
|
6320
6501
|
}
|
|
6321
6502
|
} catch (err) {
|
|
6322
|
-
|
|
6503
|
+
_iterator11.e(err);
|
|
6323
6504
|
} finally {
|
|
6324
|
-
|
|
6505
|
+
_iterator11.f();
|
|
6325
6506
|
}
|
|
6326
6507
|
}
|
|
6327
6508
|
// If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
|
|
@@ -6598,7 +6779,7 @@ var LWC = (function (exports) {
|
|
|
6598
6779
|
function isNull(obj) {
|
|
6599
6780
|
return obj === null;
|
|
6600
6781
|
}
|
|
6601
|
-
/** version: 2.
|
|
6782
|
+
/** version: 2.35.1 */
|
|
6602
6783
|
|
|
6603
6784
|
/*
|
|
6604
6785
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6657,17 +6838,17 @@ var LWC = (function (exports) {
|
|
|
6657
6838
|
exports.createFragment = function (html) {
|
|
6658
6839
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6659
6840
|
if (!isUndefined(wrapperTags)) {
|
|
6660
|
-
var
|
|
6661
|
-
|
|
6841
|
+
var _iterator12 = _createForOfIteratorHelper(wrapperTags),
|
|
6842
|
+
_step12;
|
|
6662
6843
|
try {
|
|
6663
|
-
for (
|
|
6664
|
-
var wrapperTag =
|
|
6844
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6845
|
+
var wrapperTag = _step12.value;
|
|
6665
6846
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6666
6847
|
}
|
|
6667
6848
|
} catch (err) {
|
|
6668
|
-
|
|
6849
|
+
_iterator12.e(err);
|
|
6669
6850
|
} finally {
|
|
6670
|
-
|
|
6851
|
+
_iterator12.f();
|
|
6671
6852
|
}
|
|
6672
6853
|
}
|
|
6673
6854
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -6676,7 +6857,7 @@ var LWC = (function (exports) {
|
|
|
6676
6857
|
doc.body.innerHTML = html;
|
|
6677
6858
|
var content = doc.body;
|
|
6678
6859
|
if (!isUndefined(wrapperTags)) {
|
|
6679
|
-
for (var
|
|
6860
|
+
for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
|
|
6680
6861
|
content = content.firstChild;
|
|
6681
6862
|
}
|
|
6682
6863
|
}
|
|
@@ -6869,8 +7050,8 @@ var LWC = (function (exports) {
|
|
|
6869
7050
|
tagName: element.tagName.toLowerCase(),
|
|
6870
7051
|
hydrated: true
|
|
6871
7052
|
});
|
|
6872
|
-
for (var
|
|
6873
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
7053
|
+
for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
|
|
7054
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
|
|
6874
7055
|
key = _Object$entries2$_i[0],
|
|
6875
7056
|
value = _Object$entries2$_i[1];
|
|
6876
7057
|
element[key] = value;
|
|
@@ -7157,10 +7338,11 @@ var LWC = (function (exports) {
|
|
|
7157
7338
|
});
|
|
7158
7339
|
freeze(LightningElement);
|
|
7159
7340
|
seal(LightningElement.prototype);
|
|
7160
|
-
/* version: 2.
|
|
7341
|
+
/* version: 2.35.1 */
|
|
7161
7342
|
|
|
7162
7343
|
exports.LightningElement = LightningElement;
|
|
7163
7344
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
7345
|
+
exports.__unstable__ReportingControl = reportingControl;
|
|
7164
7346
|
exports.api = api$1;
|
|
7165
7347
|
exports.buildCustomElementConstructor = deprecatedBuildCustomElementConstructor;
|
|
7166
7348
|
exports.createContextProvider = createContextProvider;
|