@socotra/ec-react-utils 2.25.1-next.0 → 2.25.2-next.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.
package/dist/index.d.ts CHANGED
@@ -155,16 +155,18 @@ declare interface ElementFormData {
155
155
  }
156
156
 
157
157
  /**
158
- * The function `extractElementFromElement takes a `QuoteResponse`, `SegmentResponse` or `ElementResponse` object and an element locator string,
159
- * and returns the element with the matching locator from the quote or its nested elements.
160
- * @param {QuoteResponse} quote - The `quote` parameter is of type `QuoteResponse`, which is an object
158
+ * The function `extractElementByLocator` takes a `QuoteResponse`, `SegmentResponse` or `ElementResponse` object and an locator string,
159
+ * and returns the element with the matching locator from the response objector its nested elements.
160
+ * @param {QuoteResponse | SegmentResponse | ElementResponse} response - The `response` parameter is of type `QuoteResponse`, which is an object
161
161
  * containing information about a quote.
162
162
  * @param {string} elementLocator - The `elementLocator` parameter is a string that represents the
163
- * locator of the element you want to extract from the `quote` object.
163
+ * locator of the element you want to extract from the `response` object.
164
+ * @param {string} locatorType - The `locatorType` parameter is a string that represents the
165
+ * type of locator you want to use to extract the element from the `response` object.
164
166
  * @returns The function `extractElementByLocator` returns the element from the response object
165
167
  * that matches the provided `elementLocator`.
166
168
  */
167
- export declare const extractElementByLocator: <T extends ElementResponse>(response: QuoteResponse | SegmentResponse | ElementResponse, elementLocator: string) => T | null;
169
+ export declare const extractElementByLocator: <T extends ElementResponse>(response: QuoteResponse | SegmentResponse | ElementResponse, elementLocator: string, locatorType?: "locator" | "staticLocator") => T | null;
168
170
 
169
171
  /**
170
172
  * The function `extractElementFromElement takes a `QuoteResponse`, `SegmentResponse` or `ElementResponse` object and an element type string,
package/dist/index.es.js CHANGED
@@ -2594,12 +2594,12 @@ class qy {
2594
2594
  U.prototype.vm = {
2595
2595
  Script: qy
2596
2596
  };
2597
- const Bc = (e, t) => {
2598
- const n = U({
2597
+ const Bc = (e, t, n = "locator") => {
2598
+ const i = U({
2599
2599
  json: e,
2600
- path: ["$", `[?(@.locator=="${t}")]`]
2600
+ path: ["$", `[?(@.${n}=="${t}")]`]
2601
2601
  });
2602
- return n.length ? n[0] : null;
2602
+ return i.length ? i[0] : null;
2603
2603
  }, Dy = (e) => {
2604
2604
  let t;
2605
2605
  if (e.endsWith("Policy"))