@rnw-community/wdio 0.46.4 → 0.48.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 (59) hide show
  1. package/dist/cjs/component/component.d.ts +1 -0
  2. package/dist/cjs/component/component.d.ts.map +1 -1
  3. package/dist/cjs/component/component.js +9 -0
  4. package/dist/cjs/component/component.js.map +1 -1
  5. package/dist/cjs/rooted-component/get-extended-rooted-component/get-extended-rooted-component.d.ts +3 -2
  6. package/dist/cjs/rooted-component/get-extended-rooted-component/get-extended-rooted-component.d.ts.map +1 -1
  7. package/dist/cjs/rooted-component/get-extended-rooted-component/get-extended-rooted-component.js +12 -9
  8. package/dist/cjs/rooted-component/get-extended-rooted-component/get-extended-rooted-component.js.map +1 -1
  9. package/dist/cjs/rooted-component/get-rooted-component/get-rooted-component.d.ts +3 -3
  10. package/dist/cjs/rooted-component/get-rooted-component/get-rooted-component.d.ts.map +1 -1
  11. package/dist/cjs/rooted-component/get-rooted-component/get-rooted-component.js +8 -1
  12. package/dist/cjs/rooted-component/get-rooted-component/get-rooted-component.js.map +1 -1
  13. package/dist/cjs/rooted-component/rooted-component.d.ts +1 -1
  14. package/dist/cjs/rooted-component/rooted-component.d.ts.map +1 -1
  15. package/dist/cjs/rooted-component/rooted-component.js +3 -3
  16. package/dist/cjs/rooted-component/rooted-component.js.map +1 -1
  17. package/dist/cjs/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.d.ts +3 -2
  18. package/dist/cjs/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.d.ts.map +1 -1
  19. package/dist/cjs/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.js +12 -9
  20. package/dist/cjs/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.js.map +1 -1
  21. package/dist/cjs/rooted-component$/get-rooted-component$/get-rooted-component$.d.ts +3 -3
  22. package/dist/cjs/rooted-component$/get-rooted-component$/get-rooted-component$.d.ts.map +1 -1
  23. package/dist/cjs/rooted-component$/get-rooted-component$/get-rooted-component$.js +8 -1
  24. package/dist/cjs/rooted-component$/get-rooted-component$/get-rooted-component$.js.map +1 -1
  25. package/dist/cjs/tsconfig.build-cjs.tsbuildinfo +1 -1
  26. package/dist/cjs/type/component-input-arg.type.d.ts +1 -2
  27. package/dist/cjs/type/component-input-arg.type.d.ts.map +1 -1
  28. package/dist/cjs/type/rooted-component-with-selectors-ctor.type.d.ts +3 -1
  29. package/dist/cjs/type/rooted-component-with-selectors-ctor.type.d.ts.map +1 -1
  30. package/dist/esm/component/component.d.ts +1 -0
  31. package/dist/esm/component/component.d.ts.map +1 -1
  32. package/dist/esm/component/component.js +9 -0
  33. package/dist/esm/component/component.js.map +1 -1
  34. package/dist/esm/rooted-component/get-extended-rooted-component/get-extended-rooted-component.d.ts +3 -2
  35. package/dist/esm/rooted-component/get-extended-rooted-component/get-extended-rooted-component.d.ts.map +1 -1
  36. package/dist/esm/rooted-component/get-extended-rooted-component/get-extended-rooted-component.js +12 -9
  37. package/dist/esm/rooted-component/get-extended-rooted-component/get-extended-rooted-component.js.map +1 -1
  38. package/dist/esm/rooted-component/get-rooted-component/get-rooted-component.d.ts +3 -3
  39. package/dist/esm/rooted-component/get-rooted-component/get-rooted-component.d.ts.map +1 -1
  40. package/dist/esm/rooted-component/get-rooted-component/get-rooted-component.js +8 -1
  41. package/dist/esm/rooted-component/get-rooted-component/get-rooted-component.js.map +1 -1
  42. package/dist/esm/rooted-component/rooted-component.d.ts +1 -1
  43. package/dist/esm/rooted-component/rooted-component.d.ts.map +1 -1
  44. package/dist/esm/rooted-component/rooted-component.js +3 -3
  45. package/dist/esm/rooted-component/rooted-component.js.map +1 -1
  46. package/dist/esm/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.d.ts +3 -2
  47. package/dist/esm/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.d.ts.map +1 -1
  48. package/dist/esm/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.js +12 -9
  49. package/dist/esm/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.js.map +1 -1
  50. package/dist/esm/rooted-component$/get-rooted-component$/get-rooted-component$.d.ts +3 -3
  51. package/dist/esm/rooted-component$/get-rooted-component$/get-rooted-component$.d.ts.map +1 -1
  52. package/dist/esm/rooted-component$/get-rooted-component$/get-rooted-component$.js +8 -1
  53. package/dist/esm/rooted-component$/get-rooted-component$/get-rooted-component$.js.map +1 -1
  54. package/dist/esm/tsconfig.build-esm.tsbuildinfo +1 -1
  55. package/dist/esm/type/component-input-arg.type.d.ts +1 -2
  56. package/dist/esm/type/component-input-arg.type.d.ts.map +1 -1
  57. package/dist/esm/type/rooted-component-with-selectors-ctor.type.d.ts +3 -1
  58. package/dist/esm/type/rooted-component-with-selectors-ctor.type.d.ts.map +1 -1
  59. package/package.json +3 -3
@@ -11,6 +11,7 @@ export declare class Component<T = any> {
11
11
  getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
12
12
  getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
13
13
  getChildElByIdx(selector: string, idx: number): ChainablePromiseElement<WebdriverIO.Element>;
14
+ getComponentFromEls<E>(selector: string, componentFn: (el: WebdriverIO.Element) => Promise<E>, predicateFn: (component: E) => Promise<boolean>): Promise<E>;
14
15
  protected proxyGet(field: string, receiver: unknown, notFoundFn?: () => unknown): unknown;
15
16
  }
16
17
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/component.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGlF,qBAAa,SAAS,CAAC,CAAC,GAAG,GAAG;IAGd,SAAS,CAAC,MAAM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C,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAI9E,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAItF,mBAAmB,CAAC,CAAC,EACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,EACpD,WAAW,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAChD,OAAO,CAAC,CAAC,CAAC;IAYb,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO;CAoB5F"}
@@ -28,6 +28,15 @@ class Component {
28
28
  getChildElByIdx(selector, idx) {
29
29
  return this.config.elsIndexSelectorFn(selector, idx);
30
30
  }
31
+ async getComponentFromEls(selector, componentFn, predicateFn) {
32
+ for await (const el of await this.getChildEls(selector)) {
33
+ const component = await componentFn(el);
34
+ if (await predicateFn(component)) {
35
+ return component;
36
+ }
37
+ }
38
+ throw new Error(`Failed finding component from elements array "${selector}"`);
39
+ }
31
40
  proxyGet(field, receiver, notFoundFn) {
32
41
  if (Reflect.has(this, field)) {
33
42
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/component.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAElD,2EAAuE;AAMvE,8DAA8D;AAC9D,MAAa,SAAS;IAGlB,YAAsB,MAAgC,EAAY,SAAkB;QAA9D,WAAM,GAAN,MAAM,CAA0B;QAAY,cAAS,GAAT,SAAS,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EAAE,MAAM,EAAE,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;YACrD,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,EAAE,CAAC,CAAC;YAExC,IAAI,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE;gBAC9B,OAAO,SAAS,CAAC;aACpB;SACJ;QAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,QAAQ,GAAG,CAAC,CAAC;IAClF,CAAC;IAES,QAAQ,CAAC,KAAa,EAAE,QAAiB,EAAE,UAA0B;QAC3E,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YAC1B,+DAA+D;YAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;SAC7C;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAsB,CAAC;QAC5D,IAAI,IAAA,kBAAS,EAAC,QAAQ,CAAC,EAAE;YACrB,OAAO,IAAI,kCAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SAC9C;QAED,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACjD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,eAAe,CAAC,SAAS,EAAE;gBAC3E,+DAA+D;gBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;aACxD;SACJ;QAED,OAAO,UAAU,EAAE,EAAE,CAAC;IAC1B,CAAC;CACJ;AAhED,8BAgEC"}
@@ -1,5 +1,6 @@
1
1
  import { RootedComponent } from '../rooted-component';
2
- import type { RootedComponentWithSelectorsCtor } from '../../type';
2
+ import type { RootedComponentCtorWithDefaultRootSelector, RootedComponentCtorWithoutDefaultRootSelector } from '../../type/rooted-component-with-selectors-ctor.type';
3
3
  import type { ClassType } from '@rnw-community/shared';
4
- export declare const getExtendedRootedComponent: <T, P extends RootedComponent<any>>(selectors: T, ParentComponent: ClassType<P>) => RootedComponentWithSelectorsCtor<T, P>;
4
+ export declare function getExtendedRootedComponent<T, P extends RootedComponent>(selectors: T, ParentComponent: ClassType<P>): RootedComponentCtorWithoutDefaultRootSelector<T, P>;
5
+ export declare function getExtendedRootedComponent<T, P extends RootedComponent>(selectors: T, ParentComponent: ClassType<P>, rootSelector: T[keyof T]): RootedComponentCtorWithDefaultRootSelector<T, P>;
5
6
  //# sourceMappingURL=get-extended-rooted-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-extended-rooted-component.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component/get-extended-rooted-component/get-extended-rooted-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAqB,gCAAgC,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,4HAalC,CAAC"}
1
+ {"version":3,"file":"get-extended-rooted-component.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component/get-extended-rooted-component/get-extended-rooted-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EACR,0CAA0C,EAC1C,6CAA6C,EAChD,MAAM,sDAAsD,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,EACnE,SAAS,EAAE,CAAC,EACZ,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,GAC9B,6CAA6C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvD,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,EACnE,SAAS,EAAE,CAAC,EACZ,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,EAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACzB,0CAA0C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExtendedRootedComponent = void 0;
4
4
  const default_component_config_1 = require("../../config/default-component.config");
5
5
  const rooted_component_1 = require("../rooted-component");
6
- const getExtendedRootedComponent = (selectors, ParentComponent) =>
7
- // @ts-expect-error We use proxy for dynamic fields
8
- class extends rooted_component_1.RootedComponent {
9
- constructor(selectorOrElement) {
10
- super((0, default_component_config_1.defaultComponentConfig)(), selectors, selectorOrElement);
11
- if (ParentComponent !== rooted_component_1.RootedComponent) {
12
- this.addParentComponent(new ParentComponent(selectorOrElement));
6
+ // eslint-disable-next-line func-style
7
+ function getExtendedRootedComponent(selectors, ParentComponent, rootSelector
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ ) {
10
+ return class extends rooted_component_1.RootedComponent {
11
+ constructor(selectorOrElement = rootSelector) {
12
+ super((0, default_component_config_1.defaultComponentConfig)(), selectors, selectorOrElement);
13
+ if (ParentComponent !== rooted_component_1.RootedComponent) {
14
+ this.addParentComponent(new ParentComponent(selectorOrElement));
15
+ }
13
16
  }
14
- }
15
- };
17
+ };
18
+ }
16
19
  exports.getExtendedRootedComponent = getExtendedRootedComponent;
17
20
  //# sourceMappingURL=get-extended-rooted-component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-extended-rooted-component.js","sourceRoot":"","sources":["../../../../src/rooted-component/get-extended-rooted-component/get-extended-rooted-component.ts"],"names":[],"mappings":";;;AAAA,oFAA+E;AAC/E,0DAAsD;AAK/C,MAAM,0BAA0B,GAAG,CACtC,SAAY,EACZ,eAA6B,EACS,EAAE;AACxC,mDAAmD;AACnD,KAAM,SAAQ,kCAAe;IACzB,YAAY,iBAAoC;QAC5C,KAAK,CAAC,IAAA,iDAAsB,GAAE,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAE9D,IAAI,eAAe,KAAK,kCAAe,EAAE;YACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACnE;IACL,CAAC;CACJ,CAAC;AAbO,QAAA,0BAA0B,8BAajC"}
1
+ {"version":3,"file":"get-extended-rooted-component.js","sourceRoot":"","sources":["../../../../src/rooted-component/get-extended-rooted-component/get-extended-rooted-component.ts"],"names":[],"mappings":";;;AAAA,oFAA+E;AAC/E,0DAAsD;AAoBtD,sCAAsC;AACtC,SAAgB,0BAA0B,CACtC,SAAY,EACZ,eAA6B,EAC7B,YAAqB;AACrB,8DAA8D;;IAE9D,OAAO,KAAM,SAAQ,kCAAe;QAChC,YAAY,oBAAmD,YAAY;YACvE,KAAK,CAAC,IAAA,iDAAsB,GAAE,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;YAE9D,IAAI,eAAe,KAAK,kCAAe,EAAE;gBACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;aACnE;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAfD,gEAeC"}
@@ -1,4 +1,4 @@
1
- import { RootedComponent } from '../rooted-component';
2
- import type { RootedComponentWithSelectorsCtor } from '../../type';
3
- export declare const getRootedComponent: <T>(selectors: T) => RootedComponentWithSelectorsCtor<T, RootedComponent<T>>;
1
+ import type { RootedComponentCtorWithDefaultRootSelector, RootedComponentCtorWithoutDefaultRootSelector } from '../../type/rooted-component-with-selectors-ctor.type';
2
+ export declare function getRootedComponent<T>(selectors: T): RootedComponentCtorWithoutDefaultRootSelector<T>;
3
+ export declare function getRootedComponent<T>(selectors: T, rootSelector: T[keyof T]): RootedComponentCtorWithDefaultRootSelector<T>;
4
4
  //# sourceMappingURL=get-rooted-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-rooted-component.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,kBAAkB,8EAC2B,CAAC"}
1
+ {"version":3,"file":"get-rooted-component.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,0CAA0C,EAC1C,6CAA6C,EAChD,MAAM,sDAAsD,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,6CAA6C,CAAC,CAAC,CAAC,CAAC;AACtG,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,0CAA0C,CAAC,CAAC,CAAC,CAAC"}
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRootedComponent = void 0;
4
+ const shared_1 = require("@rnw-community/shared");
4
5
  const get_extended_rooted_component_1 = require("../get-extended-rooted-component/get-extended-rooted-component");
5
6
  const rooted_component_1 = require("../rooted-component");
6
- const getRootedComponent = (selectors) => (0, get_extended_rooted_component_1.getExtendedRootedComponent)(selectors, rooted_component_1.RootedComponent);
7
+ // eslint-disable-next-line func-style,@typescript-eslint/no-explicit-any
8
+ function getRootedComponent(selectors, rootSelector) {
9
+ if ((0, shared_1.isDefined)(rootSelector)) {
10
+ return (0, get_extended_rooted_component_1.getExtendedRootedComponent)(selectors, rooted_component_1.RootedComponent, rootSelector);
11
+ }
12
+ return (0, get_extended_rooted_component_1.getExtendedRootedComponent)(selectors, rooted_component_1.RootedComponent);
13
+ }
7
14
  exports.getRootedComponent = getRootedComponent;
8
15
  //# sourceMappingURL=get-rooted-component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-rooted-component.js","sourceRoot":"","sources":["../../../../src/rooted-component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":";;;AAAA,kHAA4G;AAC5G,0DAAsD;AAI/C,MAAM,kBAAkB,GAAG,CAAI,SAAY,EAAuC,EAAE,CACvF,IAAA,0DAA0B,EAAC,SAAS,EAAE,kCAAe,CAAC,CAAC;AAD9C,QAAA,kBAAkB,sBAC4B"}
1
+ {"version":3,"file":"get-rooted-component.js","sourceRoot":"","sources":["../../../../src/rooted-component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAElD,kHAA4G;AAC5G,0DAAsD;AAUtD,yEAAyE;AACzE,SAAgB,kBAAkB,CAAI,SAAY,EAAE,YAAyB;IACzE,IAAI,IAAA,kBAAS,EAAC,YAAY,CAAC,EAAE;QACzB,OAAO,IAAA,0DAA0B,EAAC,SAAS,EAAE,kCAAe,EAAE,YAAY,CAAC,CAAC;KAC/E;IAED,OAAO,IAAA,0DAA0B,EAAC,SAAS,EAAE,kCAAe,CAAC,CAAC;AAClE,CAAC;AAND,gDAMC"}
@@ -5,7 +5,7 @@ import type { Enum } from '@rnw-community/shared';
5
5
  import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
6
6
  export declare class RootedComponent<T = any> extends Component<T> {
7
7
  protected readonly parentElInput: ComponentInputArg;
8
- constructor(config: ComponentConfigInterface, selectors: Enum<T>, parentElInput: ComponentInputArg);
8
+ constructor(config: ComponentConfigInterface, selectors: Enum<T>, parentElInput: ComponentInputArg | undefined);
9
9
  get RootEl(): ChainablePromiseElement<WebdriverIO.Element>;
10
10
  getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
11
11
  getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
@@ -1 +1 @@
1
- {"version":3,"file":"rooted-component.d.ts","sourceRoot":"","sources":["../../../src/rooted-component/rooted-component.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGlF,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACY,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,iBAAiB;gBAAzG,MAAM,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAqB,aAAa,EAAE,iBAAiB;IA+BrH,IAAI,MAAM,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAMzD;IAEQ,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;CAG1F"}
1
+ {"version":3,"file":"rooted-component.d.ts","sourceRoot":"","sources":["../../../src/rooted-component/rooted-component.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGlF,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;gBAExC,MAAM,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,GAAG,SAAS;IAmC9G,IAAI,MAAM,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAMzD;IAEQ,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;CAG1F"}
@@ -12,8 +12,8 @@ class RootedComponent extends component_1.Component {
12
12
  if (!(0, shared_1.isString)(parentElInput) && 'els' in parentElInput) {
13
13
  throw new Error('Cannot create RootedComponent from SelectorElement, use .el()');
14
14
  }
15
- if (!(0, shared_1.isString)(parentElInput) && 'elementId' in parentElInput) {
16
- throw new Error('Cannot create RootedComponent from WebdriverIO.Element, use ChainablePromiseElement instead');
15
+ if (!(0, shared_1.isString)(parentElInput) && 'then' in parentElInput) {
16
+ throw new Error('Cannot create RootedComponent from ChainablePromiseElement, use string selector or WebdriverIO.Element');
17
17
  }
18
18
  super(config, selectors);
19
19
  this.parentElInput = parentElInput;
@@ -35,7 +35,7 @@ class RootedComponent extends component_1.Component {
35
35
  if ((0, shared_1.isNotEmptyString)(this.parentElInput)) {
36
36
  return this.config.elSelectorFn(this.parentElInput);
37
37
  }
38
- return this.parentElInput;
38
+ return $(this.parentElInput);
39
39
  }
40
40
  getChildEl(selector) {
41
41
  return this.config.elSelectorFn(selector, this.RootEl);
@@ -1 +1 @@
1
- {"version":3,"file":"rooted-component.js","sourceRoot":"","sources":["../../../src/rooted-component/rooted-component.ts"],"names":[],"mappings":";;;AAAA,kDAA8E;AAE9E,sDAAmD;AAMnD,8DAA8D;AAC9D,MAAa,eAAyB,SAAQ,qBAAY;IACtD,YAAY,MAAgC,EAAE,SAAkB,EAAqB,aAAgC;QACjH,IAA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,KAAK,CAAC,EAAE;wBAC/C,+DAA+D;wBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;qBACtD;oBAED,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAChD,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,IAAI,MAAM;QACN,IAAI,IAAA,yBAAgB,EAAC,IAAI,CAAC,aAAa,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACvD;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAEQ,UAAU,CAAC,QAAgB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAEQ,WAAW,CAAC,QAAgB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACJ;AArDD,0CAqDC"}
@@ -1,5 +1,6 @@
1
1
  import { RootedComponent } from '../../rooted-component/rooted-component';
2
- import type { RootedComponentWithSelectorsCtor } from '../../type';
2
+ import type { RootedComponentCtorWithDefaultRootSelector, RootedComponentCtorWithoutDefaultRootSelector } from '../../type/rooted-component-with-selectors-ctor.type';
3
3
  import type { ClassType } from '@rnw-community/shared';
4
- export declare const getExtendedRootedComponent$: <T, P extends RootedComponent<any>>(selectors: T, ParentComponent: ClassType<P>) => RootedComponentWithSelectorsCtor<T, P>;
4
+ export declare function getExtendedRootedComponent$<T, P extends RootedComponent>(selectors: T, ParentComponent: ClassType<P>): RootedComponentCtorWithoutDefaultRootSelector<T, P>;
5
+ export declare function getExtendedRootedComponent$<T, P extends RootedComponent>(selectors: T, ParentComponent: ClassType<P>, rootSelector: T[keyof T]): RootedComponentCtorWithDefaultRootSelector<T, P>;
5
6
  //# sourceMappingURL=get-extended-rooted-component$.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-extended-rooted-component$.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,KAAK,EAAqB,gCAAgC,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,4HAanC,CAAC"}
1
+ {"version":3,"file":"get-extended-rooted-component$.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,OAAO,KAAK,EACR,0CAA0C,EAC1C,6CAA6C,EAChD,MAAM,sDAAsD,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,EACpE,SAAS,EAAE,CAAC,EACZ,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,GAC9B,6CAA6C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvD,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,EACpE,SAAS,EAAE,CAAC,EACZ,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,EAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACzB,0CAA0C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExtendedRootedComponent$ = void 0;
4
4
  const default__component_config_1 = require("../../config/default$-component.config");
5
5
  const rooted_component_1 = require("../../rooted-component/rooted-component");
6
- const getExtendedRootedComponent$ = (selectors, ParentComponent) =>
7
- // @ts-expect-error We use proxy for dynamic fields
8
- class extends rooted_component_1.RootedComponent {
9
- constructor(selectorOrElement) {
10
- super((0, default__component_config_1.default$ComponentConfig)(), selectors, selectorOrElement);
11
- if (ParentComponent !== rooted_component_1.RootedComponent) {
12
- this.addParentComponent(new ParentComponent(selectorOrElement));
6
+ // eslint-disable-next-line func-style
7
+ function getExtendedRootedComponent$(selectors, ParentComponent, rootSelector
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ ) {
10
+ return class extends rooted_component_1.RootedComponent {
11
+ constructor(selectorOrElement = rootSelector) {
12
+ super((0, default__component_config_1.default$ComponentConfig)(), selectors, selectorOrElement);
13
+ if (ParentComponent !== rooted_component_1.RootedComponent) {
14
+ this.addParentComponent(new ParentComponent(selectorOrElement));
15
+ }
13
16
  }
14
- }
15
- };
17
+ };
18
+ }
16
19
  exports.getExtendedRootedComponent$ = getExtendedRootedComponent$;
17
20
  //# sourceMappingURL=get-extended-rooted-component$.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-extended-rooted-component$.js","sourceRoot":"","sources":["../../../../src/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.ts"],"names":[],"mappings":";;;AAAA,sFAAiF;AACjF,8EAA0E;AAKnE,MAAM,2BAA2B,GAAG,CACvC,SAAY,EACZ,eAA6B,EACS,EAAE;AACxC,mDAAmD;AACnD,KAAM,SAAQ,kCAAe;IACzB,YAAY,iBAAoC;QAC5C,KAAK,CAAC,IAAA,mDAAuB,GAAE,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAE/D,IAAI,eAAe,KAAK,kCAAe,EAAE;YACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACnE;IACL,CAAC;CACJ,CAAC;AAbO,QAAA,2BAA2B,+BAalC"}
1
+ {"version":3,"file":"get-extended-rooted-component$.js","sourceRoot":"","sources":["../../../../src/rooted-component$/get-extended-rooted-component$/get-extended-rooted-component$.ts"],"names":[],"mappings":";;;AAAA,sFAAiF;AACjF,8EAA0E;AAoB1E,sCAAsC;AACtC,SAAgB,2BAA2B,CACvC,SAAY,EACZ,eAA6B,EAC7B,YAAqB;AACrB,8DAA8D;;IAE9D,OAAO,KAAM,SAAQ,kCAAe;QAChC,YAAY,oBAAmD,YAAY;YACvE,KAAK,CAAC,IAAA,mDAAuB,GAAE,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;YAE/D,IAAI,eAAe,KAAK,kCAAe,EAAE;gBACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;aACnE;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAfD,kEAeC"}
@@ -1,4 +1,4 @@
1
- import { RootedComponent } from '../../rooted-component/rooted-component';
2
- import type { RootedComponentWithSelectorsCtor } from '../../type';
3
- export declare const getRootedComponent$: <T>(selectors: T) => RootedComponentWithSelectorsCtor<T, RootedComponent<T>>;
1
+ import type { RootedComponentCtorWithDefaultRootSelector, RootedComponentCtorWithoutDefaultRootSelector } from '../../type/rooted-component-with-selectors-ctor.type';
2
+ export declare function getRootedComponent$<T>(selectors: T): RootedComponentCtorWithoutDefaultRootSelector<T>;
3
+ export declare function getRootedComponent$<T>(selectors: T, rootSelector: T[keyof T]): RootedComponentCtorWithDefaultRootSelector<T>;
4
4
  //# sourceMappingURL=get-rooted-component$.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-rooted-component$.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component$/get-rooted-component$/get-rooted-component$.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,mBAAmB,8EAC2B,CAAC"}
1
+ {"version":3,"file":"get-rooted-component$.d.ts","sourceRoot":"","sources":["../../../../src/rooted-component$/get-rooted-component$/get-rooted-component$.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,0CAA0C,EAC1C,6CAA6C,EAChD,MAAM,sDAAsD,CAAC;AAE9D,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,6CAA6C,CAAC,CAAC,CAAC,CAAC;AACvG,wBAAgB,mBAAmB,CAAC,CAAC,EACjC,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACzB,0CAA0C,CAAC,CAAC,CAAC,CAAC"}
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRootedComponent$ = void 0;
4
+ const shared_1 = require("@rnw-community/shared");
4
5
  const rooted_component_1 = require("../../rooted-component/rooted-component");
5
6
  const get_extended_rooted_component_1 = require("../get-extended-rooted-component$/get-extended-rooted-component$");
6
- const getRootedComponent$ = (selectors) => (0, get_extended_rooted_component_1.getExtendedRootedComponent$)(selectors, rooted_component_1.RootedComponent);
7
+ // eslint-disable-next-line func-style,@typescript-eslint/no-explicit-any
8
+ function getRootedComponent$(selectors, rootSelector) {
9
+ if ((0, shared_1.isDefined)(rootSelector)) {
10
+ return (0, get_extended_rooted_component_1.getExtendedRootedComponent$)(selectors, rooted_component_1.RootedComponent, rootSelector);
11
+ }
12
+ return (0, get_extended_rooted_component_1.getExtendedRootedComponent$)(selectors, rooted_component_1.RootedComponent);
13
+ }
7
14
  exports.getRootedComponent$ = getRootedComponent$;
8
15
  //# sourceMappingURL=get-rooted-component$.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-rooted-component$.js","sourceRoot":"","sources":["../../../../src/rooted-component$/get-rooted-component$/get-rooted-component$.ts"],"names":[],"mappings":";;;AAAA,8EAA0E;AAC1E,oHAA+G;AAIxG,MAAM,mBAAmB,GAAG,CAAI,SAAY,EAAuC,EAAE,CACxF,IAAA,2DAA2B,EAAC,SAAS,EAAE,kCAAe,CAAC,CAAC;AAD/C,QAAA,mBAAmB,uBAC4B"}
1
+ {"version":3,"file":"get-rooted-component$.js","sourceRoot":"","sources":["../../../../src/rooted-component$/get-rooted-component$/get-rooted-component$.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAElD,8EAA0E;AAC1E,oHAA+G;AAa/G,yEAAyE;AACzE,SAAgB,mBAAmB,CAAI,SAAY,EAAE,YAAyB;IAC1E,IAAI,IAAA,kBAAS,EAAC,YAAY,CAAC,EAAE;QACzB,OAAO,IAAA,2DAA2B,EAAC,SAAS,EAAE,kCAAe,EAAE,YAAY,CAAC,CAAC;KAChF;IAED,OAAO,IAAA,2DAA2B,EAAC,SAAS,EAAE,kCAAe,CAAC,CAAC;AACnE,CAAC;AAND,kDAMC"}