@tracktor/shared-module 2.8.0 → 2.9.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/CHANGELOG.md +2 -2
- package/README.md +24 -20
- package/dist/hooks/useAdapter.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +210 -208
- package/dist/main.umd.cjs +7 -7
- package/dist/utils/adapter/worksiteNameAdapter.d.ts +6 -0
- package/package.json +1 -1
- package/dist/utils/adapter/filePathAdapter.d.ts +0 -13
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -45,31 +45,35 @@ export default App;
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
## Components
|
|
48
|
-
| Module
|
|
49
|
-
|
|
50
|
-
| RequireAuth
|
|
51
|
-
| GTMSendPageView
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
48
|
+
| Module | Type | Description | Dependencies |
|
|
49
|
+
|------------------------|-----------------|-----------------------------------------------------|------------------------------------------------------------|
|
|
50
|
+
| RequireAuth | React Component | Component for protected routing | Axios & react-router-dom |
|
|
51
|
+
| GTMSendPageView | React Component | Send page view event to Google Tag Manager | @tracktor/react-google-tag-manager & react-router-dom |
|
|
52
|
+
| InitializeAxiosConfig | React Component | Initialize Axios with custom default config options | Axios |
|
|
53
|
+
| InitializeI18nConfig | React Component | Initialize i18n with custom config options | i18next & react-i18next & i18next-browser-languagedetector |
|
|
54
|
+
| InitializeSentryConfig | React Component | Initialize Sentry | @sentry/react & react-router-dom |
|
|
55
|
+
| InitializeMapBoxConfig | React Component | Initialize MapBox | mapbox-gl |
|
|
56
|
+
| InitializeDaysJSConfig | React Component | Initialize DayJS | dayjs |
|
|
57
|
+
| PreloadErrorHandler | React Component | his component is used to handle preload error. | dayjs |
|
|
57
58
|
|
|
58
59
|
## Hooks
|
|
59
|
-
| Module | Description
|
|
60
|
-
|
|
61
|
-
| useAdapter | Hook with several adapter
|
|
62
|
-
| useAuth | Hook for authentification management
|
|
63
|
-
| useResponseError | This hook is used to print error messages from the API
|
|
64
|
-
| useInfiniteDataGrid |
|
|
60
|
+
| Module | Description | Dependencies |
|
|
61
|
+
|---------------------|----------------------------------------------------------------------------|--------------|
|
|
62
|
+
| useAdapter | Hook with several adapter | - |
|
|
63
|
+
| useAuth | Hook for authentification management | Axios |
|
|
64
|
+
| useResponseError | This hook is used to print error messages from the API | i18next |
|
|
65
|
+
| useInfiniteDataGrid | This hook is used to handle the infinite scroll of the DataGrid component. | - |
|
|
66
|
+
| useCurrentLanguage | This get the current language of app | - |
|
|
67
|
+
| useFilters | Hook to handle filter | - |
|
|
65
68
|
|
|
66
69
|
## Config
|
|
67
70
|
| Module | Description |
|
|
68
71
|
|-----------------------|------------------------------------|
|
|
69
72
|
| getOrvalOperationName | Get config for orval operationName |
|
|
70
73
|
|
|
71
|
-
## Utils
|
|
72
|
-
| Module
|
|
73
|
-
|
|
74
|
-
| dateAdapter
|
|
75
|
-
| distanceAdapter
|
|
74
|
+
## Utils function
|
|
75
|
+
| Module | Description |
|
|
76
|
+
|---------------------|----------------------|
|
|
77
|
+
| dateAdapter | Adapt given date |
|
|
78
|
+
| distanceAdapter | Adapt given distance |
|
|
79
|
+
| worksiteNameAdapter | Adapt worksite name |
|
|
@@ -13,5 +13,6 @@ export declare const useAdapter: (params?: useAdapterParams) => {
|
|
|
13
13
|
dateAdapter: (date: string | number | Date | null | undefined, format?: string) => string;
|
|
14
14
|
distanceAdapter: (distance?: string | number | null | undefined, metric?: string) => string;
|
|
15
15
|
filePathAdapter: (path?: string | null, size?: number | "full") => string;
|
|
16
|
+
worksiteNameAdapter: (name: unknown) => string;
|
|
16
17
|
};
|
|
17
18
|
export default useAdapter;
|
package/dist/main.d.ts
CHANGED
|
@@ -36,3 +36,4 @@ export { default as getOrvalConfig } from './config/orval';
|
|
|
36
36
|
export * from './config/orval';
|
|
37
37
|
export { default as dateAdapter } from './utils/adapter/dateAdapter';
|
|
38
38
|
export { default as distanceAdapter } from './utils/adapter/distanceAdapter';
|
|
39
|
+
export { default as worksiteNameAdapter } from './utils/adapter/worksiteNameAdapter';
|