@tracktor/shared-module 0.18.2 → 0.19.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 (31) hide show
  1. package/CHANGELOG.md +5 -2
  2. package/dist/{src/context → context}/InjectDependenciesProvider.d.ts +6 -1
  3. package/dist/hooks/useAdapter/index.d.ts +3 -0
  4. package/dist/hooks/useAdapter/useAdapter.d.ts +8 -0
  5. package/dist/{src/main.d.ts → main.d.ts} +2 -0
  6. package/dist/main.js +446 -454
  7. package/dist/main.umd.cjs +10 -10
  8. package/dist/utils/adapter/filePathAdapter.d.ts +10 -0
  9. package/dist/utils/adapter/index.d.ts +7 -0
  10. package/package.json +1 -1
  11. package/dist/src/utils/adapter/filePathAdapter.d.ts +0 -7
  12. package/dist/src/utils/adapter/index.d.ts +0 -4
  13. /package/dist/{src/components → components}/Inputs/MaskTextField.d.ts +0 -0
  14. /package/dist/{src/components → components}/Utils/AxiosConfig.d.ts +0 -0
  15. /package/dist/{src/components → components}/Utils/GTMSendPageView.d.ts +0 -0
  16. /package/dist/{src/components → components}/Utils/I18nConfig.d.ts +0 -0
  17. /package/dist/{src/components → components}/Utils/MapBoxConfig.d.ts +0 -0
  18. /package/dist/{src/components → components}/Utils/RequireAuth.d.ts +0 -0
  19. /package/dist/{src/components → components}/Utils/SentryConfig.d.ts +0 -0
  20. /package/dist/{src/config → config}/orval/index.d.ts +0 -0
  21. /package/dist/{src/config → config}/orval/mutator/axiosCustomInstance.d.ts +0 -0
  22. /package/dist/{src/config → config}/orval/orval.d.ts +0 -0
  23. /package/dist/{src/config → config}/orval/orval.test.d.ts +0 -0
  24. /package/dist/{src/context → context}/QueryClientConfigProvider.d.ts +0 -0
  25. /package/dist/{src/hooks → hooks}/useAuth/index.d.ts +0 -0
  26. /package/dist/{src/hooks → hooks}/useAuth/useAuth.d.ts +0 -0
  27. /package/dist/{src/hooks → hooks}/useInfiniteDataGrid/index.d.ts +0 -0
  28. /package/dist/{src/hooks → hooks}/useInfiniteDataGrid/useInfiniteDataGrid.d.ts +0 -0
  29. /package/dist/{src/hooks → hooks}/useResponseError/index.d.ts +0 -0
  30. /package/dist/{src/hooks → hooks}/useResponseError/useResponseError.d.ts +0 -0
  31. /package/dist/{src/hooks → hooks}/useResponseError/useResponseError.test.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v0.18.2
4
- - **[fix]** : export entry point
3
+ ## v0.19.0
4
+ - **[feat]** : `filePathAdapter` util improvement
5
+ - **[feat]** : add `useAdapter` hook
6
+ - **[feat]** : add `filePathAdapter` from `useAdapter` hook
7
+ - **[feat]** : add `distanceAdapter` from `useAdapter` hook
@@ -8,6 +8,10 @@ export interface InjectDependenciesContextProps {
8
8
  * Axios instance dependency
9
9
  */
10
10
  axios?: any;
11
+ /**
12
+ * API URL dependency for useAdapter hook
13
+ */
14
+ apiURL?: string;
11
15
  /**
12
16
  * Translate function dependency for useResponseError hook
13
17
  * @param key
@@ -61,7 +65,8 @@ export declare const InjectDependenciesContext: import("react").Context<InjectDe
61
65
  * @param Navigate
62
66
  * @param useLocation
63
67
  * @param useGoogleTagManager
68
+ * @param apiURL
64
69
  * @constructor
65
70
  */
66
- declare const InjectDependenciesProvider: ({ axios, children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, }: InjectDependenciesContextProps) => import("react/jsx-runtime").JSX.Element;
71
+ declare const InjectDependenciesProvider: ({ axios, children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, apiURL, }: InjectDependenciesContextProps) => import("react/jsx-runtime").JSX.Element;
67
72
  export default InjectDependenciesProvider;
@@ -0,0 +1,3 @@
1
+ import useAdapter from "./useAdapter";
2
+ export default useAdapter;
3
+ export * from "./useAdapter";
@@ -0,0 +1,8 @@
1
+ export declare const useAdapter: () => {
2
+ distanceAdapter: (distance?: string | number | null, metric?: string) => string;
3
+ filePathAdapter: (href?: string | null | {
4
+ pathname: string;
5
+ origin: string;
6
+ }, size?: number | "full") => string;
7
+ };
8
+ export default useAdapter;
@@ -22,6 +22,8 @@ export { default as useInfiniteDataGrid } from './hooks/useInfiniteDataGrid';
22
22
  export * from './hooks/useInfiniteDataGrid';
23
23
  export { default as useAuth } from './hooks/useAuth';
24
24
  export * from './hooks/useAuth';
25
+ export { default as useAdapter } from './hooks/useAdapter';
26
+ export * from './hooks/useAdapter';
25
27
  export { default as getOrvalConfig } from './config/orval';
26
28
  export * from './config/orval';
27
29
  export { default as filePathAdapter } from './utils/adapter/filePathAdapter';