lwc 2.13.1 → 2.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +376 -170
- package/dist/engine-dom/iife/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/iife/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-dom/umd/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/umd/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-server/commonjs/es2017/engine-server.js +190 -72
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +190 -73
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4424 -3481
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +4424 -3481
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +243 -258
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +243 -258
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +243 -258
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +243 -258
- package/package.json +7 -7
|
@@ -1,301 +1,286 @@
|
|
|
1
1
|
var WireService = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
27
|
-
return Constructor;
|
|
28
|
-
}
|
|
29
|
-
function _getPrototypeOf(o) {
|
|
30
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
31
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
32
|
-
};
|
|
33
|
-
return _getPrototypeOf(o);
|
|
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(o, p) {
|
|
62
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
63
|
-
o.__proto__ = p;
|
|
64
|
-
return o;
|
|
65
|
-
};
|
|
66
|
-
return _setPrototypeOf(o, p);
|
|
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
|
-
*/
|
|
101
|
-
|
|
32
|
+
*/
|
|
33
|
+
function isUndefined(obj) {
|
|
34
|
+
return obj === undefined;
|
|
102
35
|
}
|
|
103
|
-
/** version: 2.13.
|
|
36
|
+
/** version: 2.13.4 */
|
|
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
|
-
*/
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var ValueChangedEventType = 'ValueChangedEvent';
|
|
109
47
|
/**
|
|
110
48
|
* Event fired by wire adapters to emit a new value.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var
|
|
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
|
-
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
143
|
+
return Object.keys(config).length === 0;
|
|
177
144
|
}
|
|
145
|
+
|
|
178
146
|
function isValidConfig(config, params) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
154
|
+
return params.some(function (param) {
|
|
155
|
+
return newConfig[param] !== oldConfig[param];
|
|
156
|
+
});
|
|
188
157
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
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.13.4 */
|
|
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.
|
|
16
|
+
/** version: 2.13.4 */
|
|
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.
|
|
190
|
+
/** version: 2.13.4 */
|
|
191
191
|
|
|
192
192
|
exports.ValueChangedEvent = ValueChangedEvent;
|
|
193
193
|
exports.register = register;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
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.
|
|
16
|
+
/** version: 2.13.4 */
|
|
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.
|
|
190
|
+
/** version: 2.13.4 */
|
|
191
191
|
|
|
192
192
|
exports.ValueChangedEvent = ValueChangedEvent;
|
|
193
193
|
exports.register = register;
|