lwc 2.12.0 → 2.13.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.
Files changed (43) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +88 -95
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +88 -95
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +76 -83
  5. package/dist/engine-dom/iife/es5/engine-dom.js +5761 -7323
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +4567 -5868
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +88 -95
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +76 -83
  11. package/dist/engine-dom/umd/es5/engine-dom.js +5761 -7323
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +4567 -5868
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +88 -95
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +88 -95
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +693 -693
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +693 -693
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +13 -10
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +681 -681
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3725 -4699
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +1 -10
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3600 -4543
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +693 -693
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +13 -10
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +681 -681
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3725 -4699
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +1 -10
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3600 -4543
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service.min.js +1 -1
  33. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service.js +258 -243
  35. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  36. package/dist/wire-service/iife/es5/wire-service_debug.js +258 -243
  37. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
  39. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  40. package/dist/wire-service/umd/es5/wire-service.js +258 -243
  41. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  42. package/dist/wire-service/umd/es5/wire-service_debug.js +258 -243
  43. package/package.json +7 -7
@@ -4,286 +4,301 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WireService = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- 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); }
8
-
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
-
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
-
19
- 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; } }
20
-
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
-
23
- 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, descriptor.key, descriptor); } }
24
-
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
-
27
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28
-
7
+ function _assertThisInitialized(self) {
8
+ if (self === void 0) {
9
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10
+ }
11
+ return self;
12
+ }
13
+ function _classCallCheck(instance, Constructor) {
14
+ if (!(instance instanceof Constructor)) {
15
+ throw new TypeError("Cannot call a class as a function");
16
+ }
17
+ }
18
+ function _defineProperties(target, props) {
19
+ for(var i = 0; i < props.length; i++){
20
+ var descriptor = props[i];
21
+ descriptor.enumerable = descriptor.enumerable || false;
22
+ descriptor.configurable = true;
23
+ if ("value" in descriptor) descriptor.writable = true;
24
+ Object.defineProperty(target, descriptor.key, descriptor);
25
+ }
26
+ }
27
+ function _createClass(Constructor, protoProps, staticProps) {
28
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29
+ if (staticProps) _defineProperties(Constructor, staticProps);
30
+ return Constructor;
31
+ }
32
+ function _getPrototypeOf(o) {
33
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
34
+ return o.__proto__ || Object.getPrototypeOf(o);
35
+ };
36
+ return _getPrototypeOf(o);
37
+ }
38
+ function _inherits(subClass, superClass) {
39
+ if (typeof superClass !== "function" && superClass !== null) {
40
+ throw new TypeError("Super expression must either be null or a function");
41
+ }
42
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
43
+ constructor: {
44
+ value: subClass,
45
+ writable: true,
46
+ configurable: true
47
+ }
48
+ });
49
+ if (superClass) _setPrototypeOf(subClass, superClass);
50
+ }
51
+ function _instanceof(left, right) {
52
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
53
+ return !!right[Symbol.hasInstance](left);
54
+ } else {
55
+ return left instanceof right;
56
+ }
57
+ }
58
+ function _possibleConstructorReturn(self, call) {
59
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
60
+ return call;
61
+ }
62
+ return _assertThisInitialized(self);
63
+ }
64
+ function _setPrototypeOf(o, p) {
65
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
66
+ o.__proto__ = p;
67
+ return o;
68
+ };
69
+ return _setPrototypeOf(o, p);
70
+ }
71
+ var _typeof = function(obj) {
72
+ "@swc/helpers - typeof";
73
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
74
+ };
75
+ function _isNativeReflectConstruct() {
76
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
77
+ if (Reflect.construct.sham) return false;
78
+ if (typeof Proxy === "function") return true;
79
+ try {
80
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
81
+ return true;
82
+ } catch (e) {
83
+ return false;
84
+ }
85
+ }
86
+ function _createSuper(Derived) {
87
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
88
+ return function _createSuperInternal() {
89
+ var Super = _getPrototypeOf(Derived), result;
90
+ if (hasNativeReflectConstruct) {
91
+ var NewTarget = _getPrototypeOf(this).constructor;
92
+ result = Reflect.construct(Super, arguments, NewTarget);
93
+ } else {
94
+ result = Super.apply(this, arguments);
95
+ }
96
+ return _possibleConstructorReturn(this, result);
97
+ };
98
+ }
29
99
  /**
30
100
  * Copyright (C) 2018 salesforce.com, inc.
31
- */
32
-
33
- /**
101
+ */ /**
34
102
  * Copyright (C) 2018 salesforce.com, inc.
35
- */
36
- function isUndefined(obj) {
37
- return obj === undefined;
103
+ */ function isUndefined(obj) {
104
+ return obj === undefined;
38
105
  }
39
- /** version: 2.12.0 */
40
-
41
- /*
106
+ /** version: 2.13.1 */ /*
42
107
  * Copyright (c) 2018, salesforce.com, inc.
43
108
  * All rights reserved.
44
109
  * SPDX-License-Identifier: MIT
45
110
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
46
- */
47
-
48
-
49
- var ValueChangedEventType = 'ValueChangedEvent';
111
+ */ var ValueChangedEventType = "ValueChangedEvent";
50
112
  /**
51
113
  * Event fired by wire adapters to emit a new value.
52
- */
53
-
54
- var ValueChangedEvent = /*#__PURE__*/_createClass(function ValueChangedEvent(value) {
55
- _classCallCheck(this, ValueChangedEvent);
56
-
57
- this.type = ValueChangedEventType;
58
- this.value = value;
59
- });
114
+ */ var ValueChangedEvent = function ValueChangedEvent(value) {
115
+ _classCallCheck(this, ValueChangedEvent);
116
+ this.type = ValueChangedEventType;
117
+ this.value = value;
118
+ };
60
119
  /*
61
120
  * Copyright (c) 2018, salesforce.com, inc.
62
121
  * All rights reserved.
63
122
  * SPDX-License-Identifier: MIT
64
123
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
65
- */
66
-
67
-
68
- var freeze = Object.freeze,
69
- defineProperty = Object.defineProperty,
70
- isExtensible = Object.isExtensible; // This value needs to be in sync with wiring.ts from @lwc/engine-core
71
-
72
- var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
73
- var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
124
+ */ var freeze = Object.freeze, defineProperty = Object.defineProperty, isExtensible = Object.isExtensible;
125
+ // This value needs to be in sync with wiring.ts from @lwc/engine-core
126
+ var DeprecatedWiredElementHost = "$$DeprecatedWiredElementHostKey$$";
127
+ var DeprecatedWiredParamsMeta = "$$DeprecatedWiredParamsMetaKey$$";
74
128
  /**
75
129
  * Registers a wire adapter factory for Lightning Platform.
76
130
  * @deprecated
77
- */
78
-
79
- function register(adapterId, adapterEventTargetCallback) {
80
- if (adapterId == null || !isExtensible(adapterId)) {
81
- throw new TypeError('adapter id must be extensible');
82
- }
83
-
84
- if (typeof adapterEventTargetCallback !== 'function') {
85
- throw new TypeError('adapter factory must be a callable');
86
- }
87
-
88
- if ('adapter' in adapterId) {
89
- throw new TypeError('adapter id is already associated to an adapter factory');
90
- }
91
-
92
- var AdapterClass = /*#__PURE__*/function (_LegacyWireAdapterBri) {
93
- _inherits(AdapterClass, _LegacyWireAdapterBri);
94
-
95
- var _super = _createSuper(AdapterClass);
96
-
97
- function AdapterClass(dataCallback) {
98
- var _this;
99
-
100
- _classCallCheck(this, AdapterClass);
101
-
102
- _this = _super.call(this, dataCallback);
103
- adapterEventTargetCallback(_this.eventTarget);
104
- return _this;
131
+ */ function register(adapterId, adapterEventTargetCallback) {
132
+ if (adapterId == null || !isExtensible(adapterId)) {
133
+ throw new TypeError("adapter id must be extensible");
105
134
  }
106
-
107
- return _createClass(AdapterClass);
108
- }(LegacyWireAdapterBridge);
109
-
110
- freeze(AdapterClass);
111
- freeze(AdapterClass.prototype);
112
- defineProperty(adapterId, 'adapter', {
113
- writable: false,
114
- configurable: false,
115
- value: AdapterClass
116
- });
135
+ if (typeof adapterEventTargetCallback !== "function") {
136
+ throw new TypeError("adapter factory must be a callable");
137
+ }
138
+ if ("adapter" in adapterId) {
139
+ throw new TypeError("adapter id is already associated to an adapter factory");
140
+ }
141
+ var AdapterClass = /*#__PURE__*/ function(LegacyWireAdapterBridge1) {
142
+ _inherits(_class, LegacyWireAdapterBridge1);
143
+ var _super = _createSuper(_class);
144
+ function _class(dataCallback) {
145
+ _classCallCheck(this, _class);
146
+ var _this;
147
+ _this = _super.call(this, dataCallback);
148
+ adapterEventTargetCallback(_this.eventTarget);
149
+ return _this;
150
+ }
151
+ return _class;
152
+ }(LegacyWireAdapterBridge);
153
+ freeze(AdapterClass);
154
+ freeze(AdapterClass.prototype);
155
+ defineProperty(adapterId, "adapter", {
156
+ writable: false,
157
+ configurable: false,
158
+ value: AdapterClass
159
+ });
117
160
  }
118
161
  /**
119
162
  * Registers the wire service. noop
120
163
  * @deprecated
121
- */
122
-
123
-
124
- function registerWireService() {}
125
-
126
- var _Array$prototype = Array.prototype,
127
- forEach = _Array$prototype.forEach,
128
- ArraySplice = _Array$prototype.splice,
129
- ArrayIndexOf = _Array$prototype.indexOf; // wire event target life cycle connectedCallback hook event type
130
-
131
- var CONNECT = 'connect'; // wire event target life cycle disconnectedCallback hook event type
132
-
133
- var DISCONNECT = 'disconnect'; // wire event target life cycle config changed hook event type
134
-
135
- var CONFIG = 'config';
136
-
164
+ */ function registerWireService() {}
165
+ var _prototype = Array.prototype, forEach = _prototype.forEach, ArraySplice = _prototype.splice, ArrayIndexOf = _prototype.indexOf;
166
+ // wire event target life cycle connectedCallback hook event type
167
+ var CONNECT = "connect";
168
+ // wire event target life cycle disconnectedCallback hook event type
169
+ var DISCONNECT = "disconnect";
170
+ // wire event target life cycle config changed hook event type
171
+ var CONFIG = "config";
137
172
  function removeListener(listeners, toRemove) {
138
- var idx = ArrayIndexOf.call(listeners, toRemove);
139
-
140
- if (idx > -1) {
141
- ArraySplice.call(listeners, idx, 1);
142
- }
173
+ var idx = ArrayIndexOf.call(listeners, toRemove);
174
+ if (idx > -1) {
175
+ ArraySplice.call(listeners, idx, 1);
176
+ }
143
177
  }
144
-
145
178
  function isEmptyConfig(config) {
146
- return Object.keys(config).length === 0;
179
+ return Object.keys(config).length === 0;
147
180
  }
148
-
149
181
  function isValidConfig(config, params) {
150
- // The config is valid if there is no params, or if exist a param for which config[param] !== undefined.
151
- return params.length === 0 || params.some(function (param) {
152
- return !isUndefined(config[param]);
153
- });
182
+ // The config is valid if there is no params, or if exist a param for which config[param] !== undefined.
183
+ return params.length === 0 || params.some(function(param) {
184
+ return !isUndefined(config[param]);
185
+ });
154
186
  }
155
-
156
187
  function isDifferentConfig(newConfig, oldConfig, params) {
157
- return params.some(function (param) {
158
- return newConfig[param] !== oldConfig[param];
159
- });
188
+ return params.some(function(param) {
189
+ return newConfig[param] !== oldConfig[param];
190
+ });
160
191
  }
161
-
162
- var LegacyWireAdapterBridge = /*#__PURE__*/function () {
163
- function LegacyWireAdapterBridge(callback) {
164
- var _this2 = this;
165
-
166
- _classCallCheck(this, LegacyWireAdapterBridge);
167
-
168
- this.connecting = [];
169
- this.disconnecting = [];
170
- this.configuring = [];
171
- this.isFirstUpdate = true;
172
- this.callback = callback;
173
- this.wiredElementHost = callback[DeprecatedWiredElementHost];
174
- this.dynamicParamsNames = callback[DeprecatedWiredParamsMeta];
175
- this.eventTarget = {
176
- addEventListener: function addEventListener(type, listener) {
177
- switch (type) {
178
- case CONNECT:
179
- {
180
- _this2.connecting.push(listener);
181
-
182
- break;
183
- }
184
-
185
- case DISCONNECT:
186
- {
187
- _this2.disconnecting.push(listener);
188
-
189
- break;
192
+ var LegacyWireAdapterBridge = /*#__PURE__*/ function() {
193
+ function LegacyWireAdapterBridge(callback) {
194
+ var _this = this;
195
+ _classCallCheck(this, LegacyWireAdapterBridge);
196
+ this.connecting = [];
197
+ this.disconnecting = [];
198
+ this.configuring = [];
199
+ this.isFirstUpdate = true;
200
+ this.callback = callback;
201
+ this.wiredElementHost = callback[DeprecatedWiredElementHost];
202
+ this.dynamicParamsNames = callback[DeprecatedWiredParamsMeta];
203
+ this.eventTarget = {
204
+ addEventListener: function(type, listener) {
205
+ switch(type){
206
+ case CONNECT:
207
+ {
208
+ _this.connecting.push(listener);
209
+ break;
210
+ }
211
+ case DISCONNECT:
212
+ {
213
+ _this.disconnecting.push(listener);
214
+ break;
215
+ }
216
+ case CONFIG:
217
+ {
218
+ _this.configuring.push(listener);
219
+ if (_this.currentConfig !== undefined) {
220
+ listener.call(undefined, _this.currentConfig);
221
+ }
222
+ break;
223
+ }
224
+ default:
225
+ throw new Error("Invalid event type ".concat(type, "."));
226
+ }
227
+ },
228
+ removeEventListener: function(type, listener) {
229
+ switch(type){
230
+ case CONNECT:
231
+ {
232
+ removeListener(_this.connecting, listener);
233
+ break;
234
+ }
235
+ case DISCONNECT:
236
+ {
237
+ removeListener(_this.disconnecting, listener);
238
+ break;
239
+ }
240
+ case CONFIG:
241
+ {
242
+ removeListener(_this.configuring, listener);
243
+ break;
244
+ }
245
+ default:
246
+ throw new Error("Invalid event type ".concat(type, "."));
247
+ }
248
+ },
249
+ dispatchEvent: function(evt) {
250
+ if (_instanceof(evt, ValueChangedEvent)) {
251
+ var value = evt.value;
252
+ _this.callback(value);
253
+ } else if (evt.type === "wirecontextevent") {
254
+ // TODO [#1357]: remove this branch
255
+ return _this.wiredElementHost.dispatchEvent(evt);
256
+ } else {
257
+ throw new Error("Invalid event type ".concat(evt.type, "."));
258
+ }
259
+ return false; // canceling signal since we don't want this to propagate
190
260
  }
191
-
192
- case CONFIG:
193
- {
194
- _this2.configuring.push(listener);
195
-
196
- if (_this2.currentConfig !== undefined) {
197
- listener.call(undefined, _this2.currentConfig);
198
- }
199
-
200
- break;
201
- }
202
-
203
- default:
204
- throw new Error("Invalid event type ".concat(type, "."));
205
- }
206
- },
207
- removeEventListener: function removeEventListener(type, listener) {
208
- switch (type) {
209
- case CONNECT:
210
- {
211
- removeListener(_this2.connecting, listener);
212
- break;
261
+ };
262
+ }
263
+ _createClass(LegacyWireAdapterBridge, [
264
+ {
265
+ key: "update",
266
+ value: function update(config) {
267
+ if (this.isFirstUpdate) {
268
+ // this is a special case for legacy wire adapters: when all the config params are undefined,
269
+ // the config on the wire adapter should not be called until one of them changes.
270
+ this.isFirstUpdate = false;
271
+ if (!isEmptyConfig(config) && !isValidConfig(config, this.dynamicParamsNames)) {
272
+ return;
273
+ }
274
+ }
275
+ if (isUndefined(this.currentConfig) || isDifferentConfig(config, this.currentConfig, this.dynamicParamsNames)) {
276
+ this.currentConfig = config;
277
+ forEach.call(this.configuring, function(listener) {
278
+ listener.call(undefined, config);
279
+ });
280
+ }
213
281
  }
214
-
215
- case DISCONNECT:
216
- {
217
- removeListener(_this2.disconnecting, listener);
218
- break;
282
+ },
283
+ {
284
+ key: "connect",
285
+ value: function connect() {
286
+ forEach.call(this.connecting, function(listener) {
287
+ return listener.call(undefined);
288
+ });
219
289
  }
220
-
221
- case CONFIG:
222
- {
223
- removeListener(_this2.configuring, listener);
224
- break;
290
+ },
291
+ {
292
+ key: "disconnect",
293
+ value: function disconnect() {
294
+ forEach.call(this.disconnecting, function(listener) {
295
+ return listener.call(undefined);
296
+ });
225
297
  }
226
-
227
- default:
228
- throw new Error("Invalid event type ".concat(type, "."));
229
298
  }
230
- },
231
- dispatchEvent: function dispatchEvent(evt) {
232
- if (evt instanceof ValueChangedEvent) {
233
- var value = evt.value;
234
-
235
- _this2.callback(value);
236
- } else if (evt.type === 'wirecontextevent') {
237
- // TODO [#1357]: remove this branch
238
- return _this2.wiredElementHost.dispatchEvent(evt);
239
- } else {
240
- throw new Error("Invalid event type ".concat(evt.type, "."));
241
- }
242
-
243
- return false; // canceling signal since we don't want this to propagate
244
- }
245
- };
246
- }
247
-
248
- _createClass(LegacyWireAdapterBridge, [{
249
- key: "update",
250
- value: function update(config) {
251
- if (this.isFirstUpdate) {
252
- // this is a special case for legacy wire adapters: when all the config params are undefined,
253
- // the config on the wire adapter should not be called until one of them changes.
254
- this.isFirstUpdate = false;
255
-
256
- if (!isEmptyConfig(config) && !isValidConfig(config, this.dynamicParamsNames)) {
257
- return;
258
- }
259
- }
260
-
261
- if (isUndefined(this.currentConfig) || isDifferentConfig(config, this.currentConfig, this.dynamicParamsNames)) {
262
- this.currentConfig = config;
263
- forEach.call(this.configuring, function (listener) {
264
- listener.call(undefined, config);
265
- });
266
- }
267
- }
268
- }, {
269
- key: "connect",
270
- value: function connect() {
271
- forEach.call(this.connecting, function (listener) {
272
- return listener.call(undefined);
273
- });
274
- }
275
- }, {
276
- key: "disconnect",
277
- value: function disconnect() {
278
- forEach.call(this.disconnecting, function (listener) {
279
- return listener.call(undefined);
280
- });
281
- }
282
- }]);
283
-
284
- return LegacyWireAdapterBridge;
299
+ ]);
300
+ return LegacyWireAdapterBridge;
285
301
  }();
286
- /** version: 2.12.0 */
287
302
 
288
303
  exports.ValueChangedEvent = ValueChangedEvent;
289
304
  exports.register = register;
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WireService={})}(this,(function(e){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}function r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=i(e);if(t){var c=i(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e){return void 0===e}var s=a((function e(t){u(this,e),this.type="ValueChangedEvent",this.value=t})),l=Object.freeze,p=Object.defineProperty,d=Object.isExtensible;var y=Array.prototype,h=y.forEach,v=y.splice,b=y.indexOf,g="connect",m="disconnect",w="config";function E(e,t){var n=b.call(e,t);n>-1&&v.call(e,n,1)}var O=function(){function e(t){var n=this;u(this,e),this.connecting=[],this.disconnecting=[],this.configuring=[],this.isFirstUpdate=!0,this.callback=t,this.wiredElementHost=t.$$DeprecatedWiredElementHostKey$$,this.dynamicParamsNames=t.$$DeprecatedWiredParamsMetaKey$$,this.eventTarget={addEventListener:function(e,t){switch(e){case g:n.connecting.push(t);break;case m:n.disconnecting.push(t);break;case w:n.configuring.push(t),void 0!==n.currentConfig&&t.call(void 0,n.currentConfig);break;default:throw new Error("Invalid event type ".concat(e,"."))}},removeEventListener:function(e,t){switch(e){case g:E(n.connecting,t);break;case m:E(n.disconnecting,t);break;case w:E(n.configuring,t);break;default:throw new Error("Invalid event type ".concat(e,"."))}},dispatchEvent:function(e){if(!(e instanceof s)){if("wirecontextevent"===e.type)return n.wiredElementHost.dispatchEvent(e);throw new Error("Invalid event type ".concat(e.type,"."))}var t=e.value;return n.callback(t),!1}}}return a(e,[{key:"update",value:function(e){var t,n;(!this.isFirstUpdate||(this.isFirstUpdate=!1,function(e){return 0===Object.keys(e).length}(e)||function(e,t){return 0===t.length||t.some((function(t){return!f(e[t])}))}(e,this.dynamicParamsNames)))&&((f(this.currentConfig)||(t=e,n=this.currentConfig,this.dynamicParamsNames.some((function(e){return t[e]!==n[e]}))))&&(this.currentConfig=e,h.call(this.configuring,(function(t){t.call(void 0,e)}))))}},{key:"connect",value:function(){h.call(this.connecting,(function(e){return e.call(void 0)}))}},{key:"disconnect",value:function(){h.call(this.disconnecting,(function(e){return e.call(void 0)}))}}]),e}();e.ValueChangedEvent=s,e.register=function(e,t){if(null==e||!d(e))throw new TypeError("adapter id must be extensible");if("function"!=typeof t)throw new TypeError("adapter factory must be a callable");if("adapter"in e)throw new TypeError("adapter id is already associated to an adapter factory");var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}(i,e);var o=r(i);function i(e){var n;return u(this,i),n=o.call(this,e),t(n.eventTarget),n}return a(i)}(O);l(o),l(o.prototype),p(e,"adapter",{writable:!1,configurable:!1,value:o})},e.registerWireService=function(){},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(b,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((b="undefined"!=typeof globalThis?globalThis:b||self).WireService={})}(this,function(a){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(d,c){for(var b=0;b<c.length;b++){var a=c[b];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}function f(a){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(a)}function g(a,b){return(g=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}function h(a){return void 0===a}var c=function a(b){d(this,a),this.type="ValueChangedEvent",this.value=b},i=Object.freeze,j=Object.defineProperty,k=Object.isExtensible,b=Array.prototype,l=b.forEach,m=b.splice,n=b.indexOf,o="connect",p="disconnect",q="config";function r(a,c){var b=n.call(a,c);b> -1&&m.call(a,b,1)}var s=function(){var a,b,f;function g(a){var b=this;d(this,g),this.connecting=[],this.disconnecting=[],this.configuring=[],this.isFirstUpdate=!0,this.callback=a,this.wiredElementHost=a.$$DeprecatedWiredElementHostKey$$,this.dynamicParamsNames=a.$$DeprecatedWiredParamsMetaKey$$,this.eventTarget={addEventListener:function(c,a){switch(c){case o:b.connecting.push(a);break;case p:b.disconnecting.push(a);break;case q:b.configuring.push(a),void 0!==b.currentConfig&&a.call(void 0,b.currentConfig);break;default:throw new Error("Invalid event type ".concat(c,"."))}},removeEventListener:function(c,a){switch(c){case o:r(b.connecting,a);break;case p:r(b.disconnecting,a);break;case q:r(b.configuring,a);break;default:throw new Error("Invalid event type ".concat(c,"."))}},dispatchEvent:function(a){var e,d;if(e=a,null!=(d=c)&&"undefined"!=typeof Symbol&&d[Symbol.hasInstance]?!!d[Symbol.hasInstance](e):e instanceof d){var f=a.value;b.callback(f)}else if("wirecontextevent"===a.type)return b.wiredElementHost.dispatchEvent(a);else throw new Error("Invalid event type ".concat(a.type,"."));return!1}}}return a=g,b=[{key:"update",value:function(a){var b,d,c,e,f;(!this.isFirstUpdate||(this.isFirstUpdate=!1,b=a,0===Object.keys(b).length||(d=a,0===(c=this.dynamicParamsNames).length||c.some(function(a){return!h(d[a])}))))&&(h(this.currentConfig)||(e=a,f=this.currentConfig,(0,this.dynamicParamsNames).some(function(a){return e[a]!==f[a]})))&&(this.currentConfig=a,l.call(this.configuring,function(b){b.call(void 0,a)}))}},{key:"connect",value:function(){l.call(this.connecting,function(a){return a.call(void 0)})}},{key:"disconnect",value:function(){l.call(this.disconnecting,function(a){return a.call(void 0)})}}],e(a.prototype,b),f&&e(a,f),g}();a.ValueChangedEvent=c,a.register=function(a,c){if(null==a||!k(a))throw new TypeError("adapter id must be extensible");if("function"!=typeof c)throw new TypeError("adapter factory must be a callable");if("adapter"in a)throw new TypeError("adapter id is already associated to an adapter factory");var b=function(a){!function(b,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),a&&g(b,a)}(h,a);var b,e,i=(b=h,e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}(),function(){var c,g,a,d,h=f(b);if(e){var i=f(this).constructor;d=Reflect.construct(h,arguments,i)}else d=h.apply(this,arguments);return g=this,(a=d)&&("object"==((c=a)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)||"function"==typeof a)?a:function(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}(g)});function h(b){var a;return d(this,h),c((a=i.call(this,b)).eventTarget),a}return h}(s);i(b),i(b.prototype),j(a,"adapter",{writable:!1,configurable:!1,value:b})},a.registerWireService=function(){},Object.defineProperty(a,"__esModule",{value:!0})})