lwc 2.12.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +88 -95
- package/dist/engine-dom/iife/es2017/engine-dom.js +88 -95
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +76 -83
- package/dist/engine-dom/iife/es5/engine-dom.js +5761 -7323
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +4567 -5868
- package/dist/engine-dom/umd/es2017/engine-dom.js +88 -95
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +76 -83
- package/dist/engine-dom/umd/es5/engine-dom.js +5761 -7323
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +4567 -5868
- package/dist/engine-server/commonjs/es2017/engine-server.js +88 -95
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +88 -95
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +693 -693
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +693 -693
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +13 -10
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +681 -681
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3725 -4699
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +1 -10
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3600 -4543
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +693 -693
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +13 -10
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +681 -681
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3725 -4699
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +1 -10
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3600 -4543
- 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 +258 -243
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +258 -243
- 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 +258 -243
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +258 -243
- package/package.json +7 -7
|
@@ -1,286 +1,301 @@
|
|
|
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
|
-
|
|
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(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
|
+
}
|
|
26
96
|
/**
|
|
27
97
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
98
|
+
*/ /**
|
|
31
99
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
return obj === undefined;
|
|
100
|
+
*/ function isUndefined(obj) {
|
|
101
|
+
return obj === undefined;
|
|
35
102
|
}
|
|
36
|
-
/** version: 2.
|
|
37
|
-
|
|
38
|
-
/*
|
|
103
|
+
/** version: 2.13.1 */ /*
|
|
39
104
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
40
105
|
* All rights reserved.
|
|
41
106
|
* SPDX-License-Identifier: MIT
|
|
42
107
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var ValueChangedEventType = 'ValueChangedEvent';
|
|
108
|
+
*/ var ValueChangedEventType = "ValueChangedEvent";
|
|
47
109
|
/**
|
|
48
110
|
* Event fired by wire adapters to emit a new value.
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.type = ValueChangedEventType;
|
|
55
|
-
this.value = value;
|
|
56
|
-
});
|
|
111
|
+
*/ var ValueChangedEvent = function ValueChangedEvent(value) {
|
|
112
|
+
_classCallCheck(this, ValueChangedEvent);
|
|
113
|
+
this.type = ValueChangedEventType;
|
|
114
|
+
this.value = value;
|
|
115
|
+
};
|
|
57
116
|
/*
|
|
58
117
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
59
118
|
* All rights reserved.
|
|
60
119
|
* SPDX-License-Identifier: MIT
|
|
61
120
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var
|
|
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$$';
|
|
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$$";
|
|
71
125
|
/**
|
|
72
126
|
* Registers a wire adapter factory for Lightning Platform.
|
|
73
127
|
* @deprecated
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
|
|
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;
|
|
128
|
+
*/ function register(adapterId, adapterEventTargetCallback) {
|
|
129
|
+
if (adapterId == null || !isExtensible(adapterId)) {
|
|
130
|
+
throw new TypeError("adapter id must be extensible");
|
|
102
131
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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");
|
|
137
|
+
}
|
|
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
|
+
});
|
|
114
157
|
}
|
|
115
158
|
/**
|
|
116
159
|
* Registers the wire service. noop
|
|
117
160
|
* @deprecated
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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";
|
|
134
169
|
function removeListener(listeners, toRemove) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
170
|
+
var idx = ArrayIndexOf.call(listeners, toRemove);
|
|
171
|
+
if (idx > -1) {
|
|
172
|
+
ArraySplice.call(listeners, idx, 1);
|
|
173
|
+
}
|
|
140
174
|
}
|
|
141
|
-
|
|
142
175
|
function isEmptyConfig(config) {
|
|
143
|
-
|
|
176
|
+
return Object.keys(config).length === 0;
|
|
144
177
|
}
|
|
145
|
-
|
|
146
178
|
function isValidConfig(config, params) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
+
});
|
|
151
183
|
}
|
|
152
|
-
|
|
153
184
|
function isDifferentConfig(newConfig, oldConfig, params) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
185
|
+
return params.some(function(param) {
|
|
186
|
+
return newConfig[param] !== oldConfig[param];
|
|
187
|
+
});
|
|
157
188
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|
187
257
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
removeListener(_this2.connecting, listener);
|
|
209
|
-
break;
|
|
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
|
+
}
|
|
210
278
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
key: "connect",
|
|
282
|
+
value: function connect() {
|
|
283
|
+
forEach.call(this.connecting, function(listener) {
|
|
284
|
+
return listener.call(undefined);
|
|
285
|
+
});
|
|
216
286
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
key: "disconnect",
|
|
290
|
+
value: function disconnect() {
|
|
291
|
+
forEach.call(this.disconnecting, function(listener) {
|
|
292
|
+
return listener.call(undefined);
|
|
293
|
+
});
|
|
222
294
|
}
|
|
223
|
-
|
|
224
|
-
default:
|
|
225
|
-
throw new Error("Invalid event type ".concat(type, "."));
|
|
226
295
|
}
|
|
227
|
-
|
|
228
|
-
|
|
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;
|
|
296
|
+
]);
|
|
297
|
+
return LegacyWireAdapterBridge;
|
|
282
298
|
}();
|
|
283
|
-
/** version: 2.12.0 */
|
|
284
299
|
|
|
285
300
|
exports.ValueChangedEvent = ValueChangedEvent;
|
|
286
301
|
exports.register = register;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
function isUndefined(obj) {
|
|
14
14
|
return obj === undefined;
|
|
15
15
|
}
|
|
16
|
-
/** version: 2.
|
|
16
|
+
/** version: 2.13.1 */
|
|
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.
|
|
190
|
+
/** version: 2.13.1 */
|
|
191
191
|
|
|
192
192
|
exports.ValueChangedEvent = ValueChangedEvent;
|
|
193
193
|
exports.register = register;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
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}}const{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){const 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){const 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;(!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");const 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})})
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
function isUndefined(obj) {
|
|
14
14
|
return obj === undefined;
|
|
15
15
|
}
|
|
16
|
-
/** version: 2.
|
|
16
|
+
/** version: 2.13.1 */
|
|
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.
|
|
190
|
+
/** version: 2.13.1 */
|
|
191
191
|
|
|
192
192
|
exports.ValueChangedEvent = ValueChangedEvent;
|
|
193
193
|
exports.register = register;
|