@odynn/awayz-core 0.2.20 → 0.2.21

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.
@@ -0,0 +1,5 @@
1
+ var e = /* @__PURE__ */ ((r) => (r.TOP = "top", r.BOTTOM = "bottom", r.RIGHT = "right", r.LEFT = "left", r))(e || {}), A = /* @__PURE__ */ ((r) => (r.NA = "N/A", r.HIDDEN = "hidden", r.DISPLAYASZERO = "DisplayAsZero", r))(A || {});
2
+ export {
3
+ A as EInvalidAmountDisplayOption,
4
+ e as EToolTipPosition
5
+ };
@@ -1,5 +1,6 @@
1
- import { CashValue as a, EToolTipPosition as e } from "./CashValue/CashValue.js";
1
+ import { CashValue as e } from "./CashValue/CashValue.js";
2
+ import { EToolTipPosition as p } from "./CashValue/CashValueTypes.js";
2
3
  export {
3
- a as CashValue,
4
- e as EToolTipPosition
4
+ e as CashValue,
5
+ p as EToolTipPosition
5
6
  };
@@ -1,12 +1,16 @@
1
1
  import { QueryClient as e } from "@tanstack/react-query";
2
- const i = new e({
2
+ const r = new e({
3
3
  defaultOptions: {
4
4
  queries: {
5
- staleTime: 1e3 * 60 * 5
5
+ staleTime: 1e3 * 60 * 5,
6
6
  // 5 minutes
7
+ retry: 3
8
+ },
9
+ mutations: {
10
+ retry: 3
7
11
  }
8
12
  }
9
13
  });
10
14
  export {
11
- i as awayzClient
15
+ r as awayzClient
12
16
  };
@@ -1,4 +1,4 @@
1
- import { A as U, E as r, a as o, b as v } from "../../AccountService-DpJ2-tgy.js";
1
+ import { A as U, E as r, a as o, b as v } from "../../AccountService-C0p4I_Ww.js";
2
2
  import { useState as E, useCallback as R, useEffect as y } from "react";
3
3
  import { EAuthFlow as S } from "../../types/EAuthFlow.js";
4
4
  import { awayzClient as A } from "../../configs/awayzClient.js";
@@ -1,25 +1,25 @@
1
- import { b as o, a as s, d as i } from "../AccountService-DpJ2-tgy.js";
2
- import { useQuery as n } from "@tanstack/react-query";
1
+ import { b as s, a as i, d as n } from "../AccountService-C0p4I_Ww.js";
2
+ import { useQuery as u } from "@tanstack/react-query";
3
3
  import "react";
4
- var a = /* @__PURE__ */ ((e) => (e.HOTEL = "Hotel", e.FLIGHT = "Flight", e))(a || {});
5
- const d = () => {
6
- const { data: e } = n({
7
- queryKey: [o.SEARCH_LIMIT],
4
+ import { useAwayzContext as c } from "./useAwayzContext.js";
5
+ var o = /* @__PURE__ */ ((e) => (e.HOTEL = "Hotel", e.FLIGHT = "Flight", e))(o || {});
6
+ const f = () => {
7
+ const { isAuthenticated: e } = c(), { data: a } = u({
8
+ queryKey: [s.SEARCH_LIMIT],
8
9
  queryFn: async () => {
9
- const { data: t, ...r } = await s.getRequestLimit();
10
+ const { data: t, ...r } = await i.getRequestLimit();
10
11
  if (!r.success) {
11
12
  console.error({ reqLimitError: r });
12
13
  return;
13
14
  }
14
- return i(t);
15
+ return n(t);
15
16
  },
16
- staleTime: 3e5
17
- // 5 minutes
17
+ enabled: e
18
18
  });
19
- return e ? [a.FLIGHT, a.HOTEL].map(
20
- (t) => e.find((r) => r.searchType === t)
19
+ return a ? [o.FLIGHT, o.HOTEL].map(
20
+ (t) => a.find((r) => r.searchType === t)
21
21
  ) : [void 0, void 0];
22
22
  };
23
23
  export {
24
- d as useSearchLimit
24
+ f as useSearchLimit
25
25
  };
@@ -1,13 +1,9 @@
1
+ import { EToolTipPosition, EInvalidAmountDisplayOption } from './CashValueTypes';
1
2
  export interface ICashValueProps {
2
3
  amount: number | string;
3
4
  currency: string;
4
5
  position?: EToolTipPosition;
6
+ zeroDisplayOption?: EInvalidAmountDisplayOption;
5
7
  }
6
8
  export declare const CurrencyCallStaleTimeMs: number;
7
- export declare const CashValue: ({ amount, currency, position }: ICashValueProps) => import("react/jsx-runtime").JSX.Element | "Loading..." | null;
8
- export declare enum EToolTipPosition {
9
- TOP = "top",
10
- BOTTOM = "bottom",
11
- RIGHT = "right",
12
- LEFT = "left"
13
- }
9
+ export declare const CashValue: ({ amount, currency, position, zeroDisplayOption }: ICashValueProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Enum representing the possible positions for a tooltip.
3
+ *
4
+ * @enum {string}
5
+ * @property {string} TOP - Position the tooltip above the target element.
6
+ * @property {string} BOTTOM - Position the tooltip below the target element.
7
+ * @property {string} RIGHT - Position the tooltip to the right of the target element.
8
+ * @property {string} LEFT - Position the tooltip to the left of the target element.
9
+ */
10
+ export declare enum EToolTipPosition {
11
+ TOP = "top",
12
+ BOTTOM = "bottom",
13
+ RIGHT = "right",
14
+ LEFT = "left"
15
+ }
16
+ /**
17
+ * Enum representing the display options for invalid values in the CashValue component.
18
+ *
19
+ * @enum {string}
20
+ * @property {string} NA - Represents a "Not Applicable" state, displayed as 'N/A'.
21
+ * @property {string} HIDDEN - Hides the zero value from being displayed.
22
+ * @property {string} DISPLAYASZERO - Display the invalid value as zero.
23
+ */
24
+ export declare enum EInvalidAmountDisplayOption {
25
+ NA = "N/A",
26
+ HIDDEN = "hidden",
27
+ DISPLAYASZERO = "DisplayAsZero"
28
+ }
@@ -1 +1,2 @@
1
- export { CashValue, EToolTipPosition } from './CashValue/CashValue';
1
+ export { CashValue } from './CashValue/CashValue';
2
+ export { EToolTipPosition } from './CashValue/CashValueTypes';
package/dist/main.js CHANGED
@@ -2,20 +2,21 @@ import { AwayzProvider as e } from "./providers/AwayzProvider.js";
2
2
  import { useAwayzContext as a } from "./hooks/useAwayzContext.js";
3
3
  import { useSearchLimit as m } from "./hooks/useSearchLimit.js";
4
4
  import { EAuthFlow as x } from "./types/EAuthFlow.js";
5
- import { c as n, i as s } from "./AccountService-DpJ2-tgy.js";
5
+ import { c as n, i as s } from "./AccountService-C0p4I_Ww.js";
6
6
  import { awayzClient as l } from "./configs/awayzClient.js";
7
- import { CashValue as w, EToolTipPosition as y } from "./components/CashValue/CashValue.js";
8
- import { CurrencyService as h } from "./services/currency/CurrencyService.js";
9
- import { getBaseUrl as A } from "./configs/baseUrl.js";
7
+ import { CashValue as w } from "./components/CashValue/CashValue.js";
8
+ import { EToolTipPosition as C } from "./components/CashValue/CashValueTypes.js";
9
+ import { CurrencyService as z } from "./services/currency/CurrencyService.js";
10
+ import { getBaseUrl as v } from "./configs/baseUrl.js";
10
11
  export {
11
12
  e as AwayzProvider,
12
13
  w as CashValue,
13
- h as CurrencyService,
14
+ z as CurrencyService,
14
15
  x as EAuthFlow,
15
- y as EToolTipPosition,
16
+ C as EToolTipPosition,
16
17
  l as awayzClient,
17
18
  n as clientInstance,
18
- A as getBaseUrl,
19
+ v as getBaseUrl,
19
20
  s as instance,
20
21
  a as useAwayzContext,
21
22
  m as useSearchLimit
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useEffect as i } from "react";
3
3
  import { AwayzContext as m } from "../context/AwayzContext.js";
4
- import { E as e } from "../AccountService-DpJ2-tgy.js";
4
+ import { E as e } from "../AccountService-C0p4I_Ww.js";
5
5
  import { useAwayzAuth as s } from "../hooks/useAwayzAuth/useAwayzAuth.js";
6
6
  import { setBaseUrl as l } from "../configs/baseUrl.js";
7
7
  import { QueryClientProvider as u } from "@tanstack/react-query";
@@ -1,4 +1,4 @@
1
- import { a as p } from "../../AccountService-DpJ2-tgy.js";
1
+ import { a as p } from "../../AccountService-C0p4I_Ww.js";
2
2
  import "react";
3
3
  import "../../configs/endpoints.js";
4
4
  import "../../configs/awayzClient.js";
@@ -1,7 +1,7 @@
1
1
  import '../../assets/_styles.css';var i = Object.defineProperty;
2
2
  var y = (t, r, e) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
3
  var o = (t, r, e) => y(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { a as p, b as C, c as a } from "../../AccountService-DpJ2-tgy.js";
4
+ import { a as p, b as C, c as a } from "../../AccountService-C0p4I_Ww.js";
5
5
  import "react";
6
6
  import { ECurrencyEndpoints as s } from "../../configs/endpoints.js";
7
7
  import "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { c as p, i as a } from "../AccountService-DpJ2-tgy.js";
1
+ import { c as p, i as a } from "../AccountService-C0p4I_Ww.js";
2
2
  import "react";
3
3
  import "../configs/endpoints.js";
4
4
  import "../configs/baseUrl.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"