lwc 2.29.0 → 2.30.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 (37) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +319 -683
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +319 -683
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +201 -624
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1138 -2843
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +892 -2428
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +319 -683
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +201 -624
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1138 -2843
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +892 -2428
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +204 -584
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +204 -584
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +99 -323
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +99 -323
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +98 -316
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +483 -1220
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +470 -1187
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +99 -323
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +98 -316
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +483 -1220
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +470 -1187
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service.min.js +1 -1
  29. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service.js +13 -68
  31. package/dist/wire-service/iife/es5/wire-service_debug.js +13 -68
  32. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  33. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
  34. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es5/wire-service.js +13 -68
  36. package/dist/wire-service/umd/es5/wire-service_debug.js +13 -68
  37. package/package.json +7 -7
@@ -7,7 +7,7 @@
7
7
  function isUndefined(obj) {
8
8
  return obj === undefined;
9
9
  }
10
- /** version: 2.29.0 */
10
+ /** version: 2.30.0 */
11
11
 
12
12
  /*
13
13
  * Copyright (c) 2018, salesforce.com, inc.
@@ -181,6 +181,6 @@ class LegacyWireAdapterBridge {
181
181
  forEach.call(this.disconnecting, (listener) => listener.call(undefined));
182
182
  }
183
183
  }
184
- /** version: 2.29.0 */
184
+ /** version: 2.30.0 */
185
185
 
186
186
  export { ValueChangedEvent, register, registerWireService };
@@ -10,7 +10,7 @@ var WireService = (function (exports) {
10
10
  function isUndefined(obj) {
11
11
  return obj === undefined;
12
12
  }
13
- /** version: 2.29.0 */
13
+ /** version: 2.30.0 */
14
14
 
15
15
  /*
16
16
  * Copyright (c) 2018, salesforce.com, inc.
@@ -184,7 +184,7 @@ var WireService = (function (exports) {
184
184
  forEach.call(this.disconnecting, (listener) => listener.call(undefined));
185
185
  }
186
186
  }
187
- /** version: 2.29.0 */
187
+ /** version: 2.30.0 */
188
188
 
189
189
  exports.ValueChangedEvent = ValueChangedEvent;
190
190
  exports.register = register;
@@ -1 +1 @@
1
- var WireService=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:l,indexOf:d}=Array.prototype,h="connect",u="disconnect",f="config";function p(e,t){const n=d.call(e,t);n>-1&&l.call(e,n,1)}return e.ValueChangedEvent=n,e.register=function(e,l){if(null==e||!s(e))throw new TypeError("adapter id must be extensible");if("function"!=typeof l)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 d=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),l(this.eventTarget)}};i(d),i(d.prototype),r(e,"adapter",{writable:!1,configurable:!1,value:d})},e.registerWireService=function(){},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var WireService=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;const{forEach:c,splice:a,indexOf:o}=Array.prototype,l="connect",d="disconnect",h="config";function u(e,t){const n=o.call(e,t);n>-1&&a.call(e,n,1)}class f{constructor(e){this.connecting=[],this.disconnecting=[],this.configuring=[],this.isFirstUpdate=!0,this.callback=e,this.wiredElementHost=e.$$DeprecatedWiredElementHostKey$$,this.dynamicParamsNames=e.$$DeprecatedWiredParamsMetaKey$$,this.eventTarget={addEventListener:(e,t)=>{switch(e){case l:this.connecting.push(t);break;case d:this.disconnecting.push(t);break;case h: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 l:u(this.connecting,t);break;case d:u(this.disconnecting,t);break;case h:u(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,c.call(this.configuring,(t=>{t.call(void 0,e)}))))}connect(){c.call(this.connecting,(e=>e.call(void 0)))}disconnect(){c.call(this.disconnecting,(e=>e.call(void 0)))}}return e.ValueChangedEvent=n,e.register=function(e,t){if(null==e||!s(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");const n=class extends f{constructor(e){super(e),t(this.eventTarget)}};i(n),i(n.prototype),r(e,"adapter",{writable:!1,configurable:!1,value:n})},e.registerWireService=function(){},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
@@ -10,7 +10,7 @@ var WireService = (function (exports) {
10
10
  function isUndefined(obj) {
11
11
  return obj === undefined;
12
12
  }
13
- /** version: 2.29.0 */
13
+ /** version: 2.30.0 */
14
14
 
15
15
  /*
16
16
  * Copyright (c) 2018, salesforce.com, inc.
@@ -184,7 +184,7 @@ var WireService = (function (exports) {
184
184
  forEach.call(this.disconnecting, (listener) => listener.call(undefined));
185
185
  }
186
186
  }
187
- /** version: 2.29.0 */
187
+ /** version: 2.30.0 */
188
188
 
189
189
  exports.ValueChangedEvent = ValueChangedEvent;
190
190
  exports.register = register;
@@ -2,38 +2,26 @@ var WireService = (function (exports) {
2
2
  'use strict';
3
3
 
4
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
5
  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
6
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
-
10
7
  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
8
  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
9
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15
-
16
10
  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
11
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19
-
20
12
  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
13
  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
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
15
  /**
27
16
  * Copyright (C) 2018 salesforce.com, inc.
28
17
  */
29
-
30
18
  /**
31
19
  * Copyright (C) 2018 salesforce.com, inc.
32
20
  */
33
21
  function isUndefined(obj) {
34
22
  return obj === undefined;
35
23
  }
36
- /** version: 2.29.0 */
24
+ /** version: 2.30.0 */
37
25
 
38
26
  /*
39
27
  * Copyright (c) 2018, salesforce.com, inc.
@@ -41,16 +29,12 @@ var WireService = (function (exports) {
41
29
  * SPDX-License-Identifier: MIT
42
30
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
43
31
  */
44
-
45
-
46
32
  var ValueChangedEventType = 'ValueChangedEvent';
47
33
  /**
48
34
  * Event fired by wire adapters to emit a new value.
49
35
  */
50
-
51
36
  var ValueChangedEvent = /*#__PURE__*/_createClass(function ValueChangedEvent(value) {
52
37
  _classCallCheck(this, ValueChangedEvent);
53
-
54
38
  this.type = ValueChangedEventType;
55
39
  this.value = value;
56
40
  });
@@ -60,50 +44,38 @@ var WireService = (function (exports) {
60
44
  * SPDX-License-Identifier: MIT
61
45
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
62
46
  */
63
-
64
-
65
47
  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
-
48
+ defineProperty = Object.defineProperty,
49
+ isExtensible = Object.isExtensible;
50
+ // This value needs to be in sync with wiring.ts from @lwc/engine-core
69
51
  var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
70
52
  var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
71
53
  /**
72
54
  * Registers a wire adapter factory for Lightning Platform.
73
55
  * @deprecated
74
56
  */
75
-
76
57
  function register(adapterId, adapterEventTargetCallback) {
77
58
  if (adapterId == null || !isExtensible(adapterId)) {
78
59
  throw new TypeError('adapter id must be extensible');
79
60
  }
80
-
81
61
  if (typeof adapterEventTargetCallback !== 'function') {
82
62
  throw new TypeError('adapter factory must be a callable');
83
63
  }
84
-
85
64
  if ('adapter' in adapterId) {
86
65
  throw new TypeError('adapter id is already associated to an adapter factory');
87
66
  }
88
-
89
67
  var AdapterClass = /*#__PURE__*/function (_LegacyWireAdapterBri) {
90
68
  _inherits(AdapterClass, _LegacyWireAdapterBri);
91
-
92
69
  var _super = _createSuper(AdapterClass);
93
-
94
70
  function AdapterClass(dataCallback) {
95
71
  var _this;
96
-
97
72
  _classCallCheck(this, AdapterClass);
98
-
99
73
  _this = _super.call(this, dataCallback);
100
74
  adapterEventTargetCallback(_this.eventTarget);
101
75
  return _this;
102
76
  }
103
-
104
77
  return _createClass(AdapterClass);
105
78
  }(LegacyWireAdapterBridge);
106
-
107
79
  freeze(AdapterClass);
108
80
  freeze(AdapterClass.prototype);
109
81
  defineProperty(adapterId, 'adapter', {
@@ -116,52 +88,41 @@ var WireService = (function (exports) {
116
88
  * Registers the wire service. noop
117
89
  * @deprecated
118
90
  */
119
-
120
-
121
91
  function registerWireService() {}
122
-
123
92
  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
-
93
+ forEach = _Array$prototype.forEach,
94
+ ArraySplice = _Array$prototype.splice,
95
+ ArrayIndexOf = _Array$prototype.indexOf;
96
+ // wire event target life cycle connectedCallback hook event type
97
+ var CONNECT = 'connect';
98
+ // wire event target life cycle disconnectedCallback hook event type
99
+ var DISCONNECT = 'disconnect';
100
+ // wire event target life cycle config changed hook event type
132
101
  var CONFIG = 'config';
133
-
134
102
  function removeListener(listeners, toRemove) {
135
103
  var idx = ArrayIndexOf.call(listeners, toRemove);
136
-
137
104
  if (idx > -1) {
138
105
  ArraySplice.call(listeners, idx, 1);
139
106
  }
140
107
  }
141
-
142
108
  function isEmptyConfig(config) {
143
109
  return Object.keys(config).length === 0;
144
110
  }
145
-
146
111
  function isValidConfig(config, params) {
147
112
  // The config is valid if there is no params, or if exist a param for which config[param] !== undefined.
148
113
  return params.length === 0 || params.some(function (param) {
149
114
  return !isUndefined(config[param]);
150
115
  });
151
116
  }
152
-
153
117
  function isDifferentConfig(newConfig, oldConfig, params) {
154
118
  return params.some(function (param) {
155
119
  return newConfig[param] !== oldConfig[param];
156
120
  });
157
121
  }
158
-
159
122
  var LegacyWireAdapterBridge = /*#__PURE__*/function () {
160
123
  function LegacyWireAdapterBridge(callback) {
161
124
  var _this2 = this;
162
-
163
125
  _classCallCheck(this, LegacyWireAdapterBridge);
164
-
165
126
  this.connecting = [];
166
127
  this.disconnecting = [];
167
128
  this.configuring = [];
@@ -175,28 +136,21 @@ var WireService = (function (exports) {
175
136
  case CONNECT:
176
137
  {
177
138
  _this2.connecting.push(listener);
178
-
179
139
  break;
180
140
  }
181
-
182
141
  case DISCONNECT:
183
142
  {
184
143
  _this2.disconnecting.push(listener);
185
-
186
144
  break;
187
145
  }
188
-
189
146
  case CONFIG:
190
147
  {
191
148
  _this2.configuring.push(listener);
192
-
193
149
  if (_this2.currentConfig !== undefined) {
194
150
  listener.call(undefined, _this2.currentConfig);
195
151
  }
196
-
197
152
  break;
198
153
  }
199
-
200
154
  default:
201
155
  throw new Error("Invalid event type ".concat(type, "."));
202
156
  }
@@ -208,19 +162,16 @@ var WireService = (function (exports) {
208
162
  removeListener(_this2.connecting, listener);
209
163
  break;
210
164
  }
211
-
212
165
  case DISCONNECT:
213
166
  {
214
167
  removeListener(_this2.disconnecting, listener);
215
168
  break;
216
169
  }
217
-
218
170
  case CONFIG:
219
171
  {
220
172
  removeListener(_this2.configuring, listener);
221
173
  break;
222
174
  }
223
-
224
175
  default:
225
176
  throw new Error("Invalid event type ".concat(type, "."));
226
177
  }
@@ -228,7 +179,6 @@ var WireService = (function (exports) {
228
179
  dispatchEvent: function dispatchEvent(evt) {
229
180
  if (evt instanceof ValueChangedEvent) {
230
181
  var value = evt.value;
231
-
232
182
  _this2.callback(value);
233
183
  } else if (evt.type === 'wirecontextevent') {
234
184
  // TODO [#1357]: remove this branch
@@ -236,12 +186,10 @@ var WireService = (function (exports) {
236
186
  } else {
237
187
  throw new Error("Invalid event type ".concat(evt.type, "."));
238
188
  }
239
-
240
189
  return false; // canceling signal since we don't want this to propagate
241
190
  }
242
191
  };
243
192
  }
244
-
245
193
  _createClass(LegacyWireAdapterBridge, [{
246
194
  key: "update",
247
195
  value: function update(config) {
@@ -249,12 +197,10 @@ var WireService = (function (exports) {
249
197
  // this is a special case for legacy wire adapters: when all the config params are undefined,
250
198
  // the config on the wire adapter should not be called until one of them changes.
251
199
  this.isFirstUpdate = false;
252
-
253
200
  if (!isEmptyConfig(config) && !isValidConfig(config, this.dynamicParamsNames)) {
254
201
  return;
255
202
  }
256
203
  }
257
-
258
204
  if (isUndefined(this.currentConfig) || isDifferentConfig(config, this.currentConfig, this.dynamicParamsNames)) {
259
205
  this.currentConfig = config;
260
206
  forEach.call(this.configuring, function (listener) {
@@ -277,10 +223,9 @@ var WireService = (function (exports) {
277
223
  });
278
224
  }
279
225
  }]);
280
-
281
226
  return LegacyWireAdapterBridge;
282
227
  }();
283
- /** version: 2.29.0 */
228
+ /** version: 2.30.0 */
284
229
 
285
230
  exports.ValueChangedEvent = ValueChangedEvent;
286
231
  exports.register = register;
@@ -2,38 +2,26 @@ var WireService = (function (exports) {
2
2
  'use strict';
3
3
 
4
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
5
  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
6
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
-
10
7
  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
8
  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
9
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15
-
16
10
  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
11
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19
-
20
12
  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
13
  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
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
15
  /**
27
16
  * Copyright (C) 2018 salesforce.com, inc.
28
17
  */
29
-
30
18
  /**
31
19
  * Copyright (C) 2018 salesforce.com, inc.
32
20
  */
33
21
  function isUndefined(obj) {
34
22
  return obj === undefined;
35
23
  }
36
- /** version: 2.29.0 */
24
+ /** version: 2.30.0 */
37
25
 
38
26
  /*
39
27
  * Copyright (c) 2018, salesforce.com, inc.
@@ -41,16 +29,12 @@ var WireService = (function (exports) {
41
29
  * SPDX-License-Identifier: MIT
42
30
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
43
31
  */
44
-
45
-
46
32
  var ValueChangedEventType = 'ValueChangedEvent';
47
33
  /**
48
34
  * Event fired by wire adapters to emit a new value.
49
35
  */
50
-
51
36
  var ValueChangedEvent = /*#__PURE__*/_createClass(function ValueChangedEvent(value) {
52
37
  _classCallCheck(this, ValueChangedEvent);
53
-
54
38
  this.type = ValueChangedEventType;
55
39
  this.value = value;
56
40
  });
@@ -60,50 +44,38 @@ var WireService = (function (exports) {
60
44
  * SPDX-License-Identifier: MIT
61
45
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
62
46
  */
63
-
64
-
65
47
  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
-
48
+ defineProperty = Object.defineProperty,
49
+ isExtensible = Object.isExtensible;
50
+ // This value needs to be in sync with wiring.ts from @lwc/engine-core
69
51
  var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
70
52
  var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
71
53
  /**
72
54
  * Registers a wire adapter factory for Lightning Platform.
73
55
  * @deprecated
74
56
  */
75
-
76
57
  function register(adapterId, adapterEventTargetCallback) {
77
58
  if (adapterId == null || !isExtensible(adapterId)) {
78
59
  throw new TypeError('adapter id must be extensible');
79
60
  }
80
-
81
61
  if (typeof adapterEventTargetCallback !== 'function') {
82
62
  throw new TypeError('adapter factory must be a callable');
83
63
  }
84
-
85
64
  if ('adapter' in adapterId) {
86
65
  throw new TypeError('adapter id is already associated to an adapter factory');
87
66
  }
88
-
89
67
  var AdapterClass = /*#__PURE__*/function (_LegacyWireAdapterBri) {
90
68
  _inherits(AdapterClass, _LegacyWireAdapterBri);
91
-
92
69
  var _super = _createSuper(AdapterClass);
93
-
94
70
  function AdapterClass(dataCallback) {
95
71
  var _this;
96
-
97
72
  _classCallCheck(this, AdapterClass);
98
-
99
73
  _this = _super.call(this, dataCallback);
100
74
  adapterEventTargetCallback(_this.eventTarget);
101
75
  return _this;
102
76
  }
103
-
104
77
  return _createClass(AdapterClass);
105
78
  }(LegacyWireAdapterBridge);
106
-
107
79
  freeze(AdapterClass);
108
80
  freeze(AdapterClass.prototype);
109
81
  defineProperty(adapterId, 'adapter', {
@@ -116,52 +88,41 @@ var WireService = (function (exports) {
116
88
  * Registers the wire service. noop
117
89
  * @deprecated
118
90
  */
119
-
120
-
121
91
  function registerWireService() {}
122
-
123
92
  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
-
93
+ forEach = _Array$prototype.forEach,
94
+ ArraySplice = _Array$prototype.splice,
95
+ ArrayIndexOf = _Array$prototype.indexOf;
96
+ // wire event target life cycle connectedCallback hook event type
97
+ var CONNECT = 'connect';
98
+ // wire event target life cycle disconnectedCallback hook event type
99
+ var DISCONNECT = 'disconnect';
100
+ // wire event target life cycle config changed hook event type
132
101
  var CONFIG = 'config';
133
-
134
102
  function removeListener(listeners, toRemove) {
135
103
  var idx = ArrayIndexOf.call(listeners, toRemove);
136
-
137
104
  if (idx > -1) {
138
105
  ArraySplice.call(listeners, idx, 1);
139
106
  }
140
107
  }
141
-
142
108
  function isEmptyConfig(config) {
143
109
  return Object.keys(config).length === 0;
144
110
  }
145
-
146
111
  function isValidConfig(config, params) {
147
112
  // The config is valid if there is no params, or if exist a param for which config[param] !== undefined.
148
113
  return params.length === 0 || params.some(function (param) {
149
114
  return !isUndefined(config[param]);
150
115
  });
151
116
  }
152
-
153
117
  function isDifferentConfig(newConfig, oldConfig, params) {
154
118
  return params.some(function (param) {
155
119
  return newConfig[param] !== oldConfig[param];
156
120
  });
157
121
  }
158
-
159
122
  var LegacyWireAdapterBridge = /*#__PURE__*/function () {
160
123
  function LegacyWireAdapterBridge(callback) {
161
124
  var _this2 = this;
162
-
163
125
  _classCallCheck(this, LegacyWireAdapterBridge);
164
-
165
126
  this.connecting = [];
166
127
  this.disconnecting = [];
167
128
  this.configuring = [];
@@ -175,28 +136,21 @@ var WireService = (function (exports) {
175
136
  case CONNECT:
176
137
  {
177
138
  _this2.connecting.push(listener);
178
-
179
139
  break;
180
140
  }
181
-
182
141
  case DISCONNECT:
183
142
  {
184
143
  _this2.disconnecting.push(listener);
185
-
186
144
  break;
187
145
  }
188
-
189
146
  case CONFIG:
190
147
  {
191
148
  _this2.configuring.push(listener);
192
-
193
149
  if (_this2.currentConfig !== undefined) {
194
150
  listener.call(undefined, _this2.currentConfig);
195
151
  }
196
-
197
152
  break;
198
153
  }
199
-
200
154
  default:
201
155
  throw new Error("Invalid event type ".concat(type, "."));
202
156
  }
@@ -208,19 +162,16 @@ var WireService = (function (exports) {
208
162
  removeListener(_this2.connecting, listener);
209
163
  break;
210
164
  }
211
-
212
165
  case DISCONNECT:
213
166
  {
214
167
  removeListener(_this2.disconnecting, listener);
215
168
  break;
216
169
  }
217
-
218
170
  case CONFIG:
219
171
  {
220
172
  removeListener(_this2.configuring, listener);
221
173
  break;
222
174
  }
223
-
224
175
  default:
225
176
  throw new Error("Invalid event type ".concat(type, "."));
226
177
  }
@@ -228,7 +179,6 @@ var WireService = (function (exports) {
228
179
  dispatchEvent: function dispatchEvent(evt) {
229
180
  if (evt instanceof ValueChangedEvent) {
230
181
  var value = evt.value;
231
-
232
182
  _this2.callback(value);
233
183
  } else if (evt.type === 'wirecontextevent') {
234
184
  // TODO [#1357]: remove this branch
@@ -236,12 +186,10 @@ var WireService = (function (exports) {
236
186
  } else {
237
187
  throw new Error("Invalid event type ".concat(evt.type, "."));
238
188
  }
239
-
240
189
  return false; // canceling signal since we don't want this to propagate
241
190
  }
242
191
  };
243
192
  }
244
-
245
193
  _createClass(LegacyWireAdapterBridge, [{
246
194
  key: "update",
247
195
  value: function update(config) {
@@ -249,12 +197,10 @@ var WireService = (function (exports) {
249
197
  // this is a special case for legacy wire adapters: when all the config params are undefined,
250
198
  // the config on the wire adapter should not be called until one of them changes.
251
199
  this.isFirstUpdate = false;
252
-
253
200
  if (!isEmptyConfig(config) && !isValidConfig(config, this.dynamicParamsNames)) {
254
201
  return;
255
202
  }
256
203
  }
257
-
258
204
  if (isUndefined(this.currentConfig) || isDifferentConfig(config, this.currentConfig, this.dynamicParamsNames)) {
259
205
  this.currentConfig = config;
260
206
  forEach.call(this.configuring, function (listener) {
@@ -277,10 +223,9 @@ var WireService = (function (exports) {
277
223
  });
278
224
  }
279
225
  }]);
280
-
281
226
  return LegacyWireAdapterBridge;
282
227
  }();
283
- /** version: 2.29.0 */
228
+ /** version: 2.30.0 */
284
229
 
285
230
  exports.ValueChangedEvent = ValueChangedEvent;
286
231
  exports.register = register;
@@ -13,7 +13,7 @@
13
13
  function isUndefined(obj) {
14
14
  return obj === undefined;
15
15
  }
16
- /** version: 2.29.0 */
16
+ /** version: 2.30.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.29.0 */
190
+ /** version: 2.30.0 */
191
191
 
192
192
  exports.ValueChangedEvent = ValueChangedEvent;
193
193
  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 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})}));
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;const{forEach:c,splice:a,indexOf:o}=Array.prototype,d="connect",l="disconnect",h="config";function u(e,t){const n=o.call(e,t);n>-1&&a.call(e,n,1)}class f{constructor(e){this.connecting=[],this.disconnecting=[],this.configuring=[],this.isFirstUpdate=!0,this.callback=e,this.wiredElementHost=e.$$DeprecatedWiredElementHostKey$$,this.dynamicParamsNames=e.$$DeprecatedWiredParamsMetaKey$$,this.eventTarget={addEventListener:(e,t)=>{switch(e){case d:this.connecting.push(t);break;case l:this.disconnecting.push(t);break;case h: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 d:u(this.connecting,t);break;case l:u(this.disconnecting,t);break;case h:u(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,c.call(this.configuring,(t=>{t.call(void 0,e)}))))}connect(){c.call(this.connecting,(e=>e.call(void 0)))}disconnect(){c.call(this.disconnecting,(e=>e.call(void 0)))}}e.ValueChangedEvent=n,e.register=function(e,t){if(null==e||!s(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");const n=class extends f{constructor(e){super(e),t(this.eventTarget)}};i(n),i(n.prototype),r(e,"adapter",{writable:!1,configurable:!1,value:n})},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.29.0 */
16
+ /** version: 2.30.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.29.0 */
190
+ /** version: 2.30.0 */
191
191
 
192
192
  exports.ValueChangedEvent = ValueChangedEvent;
193
193
  exports.register = register;