lwc 2.13.2 → 2.14.0

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