@rnw-community/wdio 0.30.0 → 0.32.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/add-wdio-commands.js +9 -66
- package/dist/add-wdio-commands.js.map +1 -1
- package/dist/capability/is-android.capability.js +1 -1
- package/dist/capability/is-android.capability.js.map +1 -1
- package/dist/capability/is-browser.capability.js +1 -3
- package/dist/capability/is-browser.capability.js.map +1 -1
- package/dist/capability/is-ios.capability.js +3 -3
- package/dist/capability/is-ios.capability.js.map +1 -1
- package/dist/command/clear-input.command.js +7 -62
- package/dist/command/clear-input.command.js.map +1 -1
- package/dist/command/mobile/open-deep-link.command.js +21 -90
- package/dist/command/mobile/open-deep-link.command.js.map +1 -1
- package/dist/command/mobile/relative-click.command.js +7 -55
- package/dist/command/mobile/relative-click.command.js.map +1 -1
- package/dist/command/slow-input.command.js +12 -95
- package/dist/command/slow-input.command.js.map +1 -1
- package/dist/command/swipe.command.js +40 -113
- package/dist/command/swipe.command.js.map +1 -1
- package/dist/command/test-id-index.command.js +7 -53
- package/dist/command/test-id-index.command.js.map +1 -1
- package/dist/command/test-id.command.js +2 -46
- package/dist/command/test-id.command.js.map +1 -1
- package/dist/command/test-ids.command.js +2 -46
- package/dist/command/test-ids.command.js.map +1 -1
- package/dist/component/component/component.js +44 -234
- package/dist/component/component/component.js.map +1 -1
- package/dist/component/create-component/create-component.js +2 -4
- package/dist/component/create-component/create-component.js.map +1 -1
- package/dist/component/create-rooted-component/create-rooted-component.js +2 -2
- package/dist/component/create-rooted-component/create-rooted-component.js.map +1 -1
- package/dist/component/get-component/get-component.js +18 -36
- package/dist/component/get-component/get-component.js.map +1 -1
- package/dist/component/get-rooted-component/get-rooted-component.js +22 -41
- package/dist/component/get-rooted-component/get-rooted-component.js.map +1 -1
- package/dist/component/rooted-component/rooted-component.js +42 -212
- package/dist/component/rooted-component/rooted-component.js.map +1 -1
- package/dist/component/util/find-enum-root-selector.util.js +4 -4
- package/dist/component/util/find-enum-root-selector.util.js.map +1 -1
- package/dist/component/util/proxy-call.util.js +17 -62
- package/dist/component/util/proxy-call.util.js.map +1 -1
- package/dist/selector/android-testid.selector.js +1 -1
- package/dist/selector/android-testid.selector.js.map +1 -1
- package/dist/selector/ios-testid.selector.js +1 -1
- package/dist/selector/ios-testid.selector.js.map +1 -1
- package/dist/selector/mobile-testid.selector.js +4 -6
- package/dist/selector/mobile-testid.selector.js.map +1 -1
- package/dist/selector/test-id.selector.js +4 -6
- package/dist/selector/test-id.selector.js.map +1 -1
- package/dist/selector/web-testid.selector.js +2 -2
- package/dist/selector/web-testid.selector.js.map +1 -1
- package/dist/util/get-platform.util.js +1 -1
- package/dist/util/get-platform.util.js.map +1 -1
- package/dist/util/get-test-id/get-test-id.js +5 -8
- package/dist/util/get-test-id/get-test-id.js.map +1 -1
- package/dist/util/set-prop-test-id/set-prop-test-id.js +3 -18
- package/dist/util/set-prop-test-id/set-prop-test-id.js.map +1 -1
- package/dist/util/set-test-id/set-test-id.js +7 -12
- package/dist/util/set-test-id/set-test-id.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,243 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.Component = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
4
|
+
const command_1 = require("../../command");
|
|
5
|
+
class Component {
|
|
6
|
+
async clickChildEl(selector, ...args) {
|
|
7
|
+
await (await this.getChildEl(selector)).click(...args);
|
|
8
|
+
}
|
|
9
|
+
async clickByIdxChildEl(selector, idx, ...args) {
|
|
10
|
+
await (await this.getChildElByIdx(selector, idx)).click(...args);
|
|
11
|
+
}
|
|
12
|
+
async setValueChildEl(selector, ...args) {
|
|
13
|
+
await (await this.getChildEl(selector)).setValue(...args);
|
|
14
|
+
}
|
|
15
|
+
async isDisplayedChildEl(selector) {
|
|
16
|
+
return await (await this.getChildEl(selector)).isDisplayed();
|
|
17
|
+
}
|
|
18
|
+
async isExistingChildEl(selector) {
|
|
19
|
+
return await (await this.getChildEl(selector)).isExisting();
|
|
20
|
+
}
|
|
21
|
+
async getTextChildEl(selector) {
|
|
22
|
+
return await (await this.getChildEl(selector)).getText();
|
|
23
|
+
}
|
|
24
|
+
async waitForExistChildEl(selector, ...args) {
|
|
25
|
+
await (await this.getChildEl(selector)).waitForExist(...args);
|
|
26
|
+
}
|
|
27
|
+
async waitForDisplayedChildEl(selector, ...args) {
|
|
28
|
+
await (await this.getChildEl(selector)).waitForDisplayed(...args);
|
|
29
|
+
}
|
|
30
|
+
async waitForEnabledChildEl(selector, ...args) {
|
|
31
|
+
await (await this.getChildEl(selector)).waitForEnabled(...args);
|
|
32
|
+
}
|
|
33
|
+
async getLocationChildEl(selector) {
|
|
34
|
+
return await (await this.getChildEl(selector)).getLocation();
|
|
35
|
+
}
|
|
36
|
+
async getSizeChildEl(selector) {
|
|
37
|
+
return await (await this.getChildEl(selector)).getSize();
|
|
43
38
|
}
|
|
44
|
-
Component.prototype.clickChildEl = function (selector) {
|
|
45
|
-
var args = [];
|
|
46
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
47
|
-
args[_i - 1] = arguments[_i];
|
|
48
|
-
}
|
|
49
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
-
var _a;
|
|
51
|
-
return __generator(this, function (_b) {
|
|
52
|
-
switch (_b.label) {
|
|
53
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
54
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).click.apply(_a, args)];
|
|
55
|
-
case 2:
|
|
56
|
-
_b.sent();
|
|
57
|
-
return [2 /*return*/];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
Component.prototype.clickByIdxChildEl = function (selector, idx) {
|
|
63
|
-
var args = [];
|
|
64
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
65
|
-
args[_i - 2] = arguments[_i];
|
|
66
|
-
}
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var _a;
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
switch (_b.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, this.getChildElByIdx(selector, idx)];
|
|
72
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).click.apply(_a, args)];
|
|
73
|
-
case 2:
|
|
74
|
-
_b.sent();
|
|
75
|
-
return [2 /*return*/];
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
Component.prototype.setValueChildEl = function (selector) {
|
|
81
|
-
var args = [];
|
|
82
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
83
|
-
args[_i - 1] = arguments[_i];
|
|
84
|
-
}
|
|
85
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
-
var _a;
|
|
87
|
-
return __generator(this, function (_b) {
|
|
88
|
-
switch (_b.label) {
|
|
89
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
90
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).setValue.apply(_a, args)];
|
|
91
|
-
case 2:
|
|
92
|
-
_b.sent();
|
|
93
|
-
return [2 /*return*/];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
Component.prototype.isDisplayedChildEl = function (selector) {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
return __generator(this, function (_a) {
|
|
101
|
-
switch (_a.label) {
|
|
102
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
103
|
-
case 1: return [4 /*yield*/, (_a.sent()).isDisplayed()];
|
|
104
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
Component.prototype.isExistingChildEl = function (selector) {
|
|
110
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
-
return __generator(this, function (_a) {
|
|
112
|
-
switch (_a.label) {
|
|
113
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
114
|
-
case 1: return [4 /*yield*/, (_a.sent()).isExisting()];
|
|
115
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
Component.prototype.getTextChildEl = function (selector) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
return __generator(this, function (_a) {
|
|
123
|
-
switch (_a.label) {
|
|
124
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
125
|
-
case 1: return [4 /*yield*/, (_a.sent()).getText()];
|
|
126
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
Component.prototype.waitForExistChildEl = function (selector) {
|
|
132
|
-
var args = [];
|
|
133
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
134
|
-
args[_i - 1] = arguments[_i];
|
|
135
|
-
}
|
|
136
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
-
var _a;
|
|
138
|
-
return __generator(this, function (_b) {
|
|
139
|
-
switch (_b.label) {
|
|
140
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
141
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForExist.apply(_a, args)];
|
|
142
|
-
case 2:
|
|
143
|
-
_b.sent();
|
|
144
|
-
return [2 /*return*/];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
Component.prototype.waitForDisplayedChildEl = function (selector) {
|
|
150
|
-
var args = [];
|
|
151
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
152
|
-
args[_i - 1] = arguments[_i];
|
|
153
|
-
}
|
|
154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
-
var _a;
|
|
156
|
-
return __generator(this, function (_b) {
|
|
157
|
-
switch (_b.label) {
|
|
158
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
159
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForDisplayed.apply(_a, args)];
|
|
160
|
-
case 2:
|
|
161
|
-
_b.sent();
|
|
162
|
-
return [2 /*return*/];
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
Component.prototype.waitForEnabledChildEl = function (selector) {
|
|
168
|
-
var args = [];
|
|
169
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
170
|
-
args[_i - 1] = arguments[_i];
|
|
171
|
-
}
|
|
172
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
var _a;
|
|
174
|
-
return __generator(this, function (_b) {
|
|
175
|
-
switch (_b.label) {
|
|
176
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
177
|
-
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForEnabled.apply(_a, args)];
|
|
178
|
-
case 2:
|
|
179
|
-
_b.sent();
|
|
180
|
-
return [2 /*return*/];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
Component.prototype.getLocationChildEl = function (selector) {
|
|
186
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
187
|
-
return __generator(this, function (_a) {
|
|
188
|
-
switch (_a.label) {
|
|
189
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
190
|
-
case 1: return [4 /*yield*/, (_a.sent()).getLocation()];
|
|
191
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
Component.prototype.getSizeChildEl = function (selector) {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
switch (_a.label) {
|
|
200
|
-
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
201
|
-
case 1: return [4 /*yield*/, (_a.sent()).getSize()];
|
|
202
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
39
|
// eslint-disable-next-line class-methods-use-this
|
|
208
|
-
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
switch (_a.label) {
|
|
212
|
-
case 0: return [4 /*yield*/, (0, command_1.testID$)(selector)];
|
|
213
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
};
|
|
40
|
+
async getChildEl(selector) {
|
|
41
|
+
return await (0, command_1.testID$)(selector);
|
|
42
|
+
}
|
|
218
43
|
// eslint-disable-next-line class-methods-use-this
|
|
219
|
-
|
|
220
|
-
return
|
|
221
|
-
|
|
222
|
-
switch (_a.label) {
|
|
223
|
-
case 0: return [4 /*yield*/, (0, command_1.testID$$)(selector)];
|
|
224
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
};
|
|
44
|
+
async getChildEls(selector) {
|
|
45
|
+
return await (0, command_1.testID$$)(selector);
|
|
46
|
+
}
|
|
229
47
|
// eslint-disable-next-line class-methods-use-this
|
|
230
|
-
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
case 0: return [4 /*yield*/, (0, command_1.testID$$Index)(selector, idx)];
|
|
235
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
return Component;
|
|
241
|
-
}());
|
|
48
|
+
async getChildElByIdx(selector, idx) {
|
|
49
|
+
return await (0, command_1.testID$$Index)(selector, idx);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
242
52
|
exports.Component = Component;
|
|
243
53
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/component/component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/component/component.ts"],"names":[],"mappings":";;;AAAA,2CAAiE;AAMjE,MAAa,SAAS;IAClB,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,GAAG,IAAe;QACnD,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,GAAW,EAAE,GAAG,IAAe;QACrE,MAAM,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,GAAG,IAAkB;QACzD,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAgB;QACrC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,QAAgB;QACpC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,QAAgB;QACjC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,QAAgB,EAAE,GAAG,IAAsB;QACjE,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,QAAgB,EAAE,GAAG,IAA0B;QACzE,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,QAAgB,EAAE,GAAG,IAAwB;QACrE,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAgB;QACrC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,QAAgB;QACjC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7D,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,UAAU,CAAC,QAAgB;QAC7B,OAAO,MAAM,IAAA,iBAAO,EAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,OAAO,MAAM,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,GAAW;QAC/C,OAAO,MAAM,IAAA,uBAAa,EAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC9C,CAAC;CACJ;AA3DD,8BA2DC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createComponent = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return new ((0, get_component_1.getComponent)(selectors))();
|
|
7
|
-
};
|
|
4
|
+
const get_component_1 = require("../get-component/get-component");
|
|
5
|
+
const createComponent = (selectors) => new ((0, get_component_1.getComponent)(selectors))();
|
|
8
6
|
exports.createComponent = createComponent;
|
|
9
7
|
//# sourceMappingURL=create-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-component.js","sourceRoot":"","sources":["../../../src/component/create-component/create-component.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-component.js","sourceRoot":"","sources":["../../../src/component/create-component/create-component.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;AAKvD,MAAM,eAAe,GAAG,CAAmB,SAAkB,EAA6B,EAAE,CAC/F,IAAI,CAAC,IAAA,4BAAY,EAAI,SAAS,CAAC,CAAC,EAAE,CAAC;AAD1B,QAAA,eAAe,mBACW"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createRootedComponent = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const get_rooted_component_1 = require("../get-rooted-component/get-rooted-component");
|
|
5
|
+
const createRootedComponent = (selectors, selectorOrElement) => new ((0, get_rooted_component_1.getRootedComponent)(selectors))(selectorOrElement);
|
|
6
6
|
exports.createRootedComponent = createRootedComponent;
|
|
7
7
|
//# sourceMappingURL=create-rooted-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rooted-component.js","sourceRoot":"","sources":["../../../src/component/create-rooted-component/create-rooted-component.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-rooted-component.js","sourceRoot":"","sources":["../../../src/component/create-rooted-component/create-rooted-component.ts"],"names":[],"mappings":";;;AAAA,uFAAkF;AAK3E,MAAM,qBAAqB,GAAG,CACjC,SAAkB,EAClB,iBAAgD,EACjB,EAAE,CAAC,IAAI,CAAC,IAAA,yCAAkB,EAAI,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAHnF,QAAA,qBAAqB,yBAG8D"}
|
|
@@ -1,42 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.getComponent = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
return class_1;
|
|
39
|
-
}(component_1.Component));
|
|
4
|
+
const component_1 = require("../component/component");
|
|
5
|
+
const util_1 = require("../util");
|
|
6
|
+
const getComponent = (selectors) =>
|
|
7
|
+
// @ts-expect-error We use proxy for dynamic fields
|
|
8
|
+
class extends component_1.Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
// eslint-disable-next-line no-constructor-return
|
|
12
|
+
return new Proxy(this, {
|
|
13
|
+
get(client, field, receiver) {
|
|
14
|
+
if (field in client) {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
16
|
+
return Reflect.get(client, field, receiver);
|
|
17
|
+
}
|
|
18
|
+
return (0, util_1.proxyCall)(client, selectors, field);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
40
22
|
};
|
|
41
23
|
exports.getComponent = getComponent;
|
|
42
24
|
//# sourceMappingURL=get-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-component.js","sourceRoot":"","sources":["../../../src/component/get-component/get-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-component.js","sourceRoot":"","sources":["../../../src/component/get-component/get-component.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACnD,kCAAoC;AAS7B,MAAM,YAAY,GAAG,CAAmB,SAAkB,EAAiC,EAAE;AAChG,mDAAmD;AACnD,KAAM,SAAQ,qBAAS;IACnB;QACI,KAAK,EAAE,CAAC;QAER,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAQ,EAAE,QAAQ;gBAC1B,IAAI,KAAK,IAAI,MAAM,EAAE;oBACjB,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,OAAO,IAAA,gBAAS,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC/C,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ,CAAC;AAlBO,QAAA,YAAY,gBAkBnB"}
|
|
@@ -1,48 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.getRootedComponent = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!(0, shared_1.isDefined)(rootSelector)) {
|
|
30
|
-
throw new Error('Cannot create RootedComponent - Neither root selector nor root element is passed');
|
|
31
|
-
}
|
|
32
|
-
_this = _super.call(this, rootSelector) || this;
|
|
33
|
-
// eslint-disable-next-line no-constructor-return
|
|
34
|
-
return new Proxy(_this, {
|
|
35
|
-
get: function (client, field, receiver) {
|
|
36
|
-
if (field in client) {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
38
|
-
return Reflect.get(client, field, receiver);
|
|
39
|
-
}
|
|
40
|
-
return (0, util_1.proxyCall)(client, selectors, field);
|
|
41
|
-
},
|
|
42
|
-
});
|
|
4
|
+
const shared_1 = require("@rnw-community/shared");
|
|
5
|
+
const rooted_component_1 = require("../rooted-component/rooted-component");
|
|
6
|
+
const util_1 = require("../util");
|
|
7
|
+
const getRootedComponent = (selectors) =>
|
|
8
|
+
// @ts-expect-error We use proxy for dynamic fields
|
|
9
|
+
class extends rooted_component_1.RootedComponent {
|
|
10
|
+
constructor(selectorOrElement) {
|
|
11
|
+
const rootSelector = (0, shared_1.isDefined)(selectorOrElement) ? selectorOrElement : (0, util_1.findEnumRootSelector)(selectors);
|
|
12
|
+
if (!(0, shared_1.isDefined)(rootSelector)) {
|
|
13
|
+
throw new Error('Cannot create RootedComponent - Neither root selector nor root element is passed');
|
|
43
14
|
}
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
super(rootSelector);
|
|
16
|
+
// eslint-disable-next-line no-constructor-return
|
|
17
|
+
return new Proxy(this, {
|
|
18
|
+
get(client, field, receiver) {
|
|
19
|
+
if (field in client) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
21
|
+
return Reflect.get(client, field, receiver);
|
|
22
|
+
}
|
|
23
|
+
return (0, util_1.proxyCall)(client, selectors, field);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
46
27
|
};
|
|
47
28
|
exports.getRootedComponent = getRootedComponent;
|
|
48
29
|
//# sourceMappingURL=get-rooted-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-rooted-component.js","sourceRoot":"","sources":["../../../src/component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-rooted-component.js","sourceRoot":"","sources":["../../../src/component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAElD,2EAAuE;AACvE,kCAA0D;AASnD,MAAM,kBAAkB,GAAG,CAAmB,SAAkB,EAAuC,EAAE;AAC5G,mDAAmD;AACnD,KAAM,SAAQ,kCAAe;IACzB,YAAY,iBAAgD;QACxD,MAAM,YAAY,GAAG,IAAA,kBAAS,EAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAA,2BAAoB,EAAC,SAAS,CAAC,CAAC;QAExG,IAAI,CAAC,IAAA,kBAAS,EAAC,YAAY,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;SACvG;QAED,KAAK,CAAC,YAAY,CAAC,CAAC;QAEpB,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAQ,EAAE,QAAQ;gBAC1B,IAAI,KAAK,IAAI,MAAM,EAAE;oBACjB,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,OAAO,IAAA,gBAAS,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC/C,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ,CAAC;AAxBO,QAAA,kBAAkB,sBAwBzB"}
|