@firedesktop/react-base 1.50.0 → 1.51.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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/App.test.tsx +9 -0
  3. package/src/App.tsx +170 -0
  4. package/src/TestLabelFunction.tsx +17 -0
  5. package/src/index.tsx +27 -0
  6. package/src/lib/components/AppIcon.tsx +784 -0
  7. package/src/lib/components/AppInput.tsx +66 -0
  8. package/src/lib/components/AppPagination.tsx +124 -0
  9. package/src/lib/components/Spin.tsx +31 -0
  10. package/src/lib/components/Toaster/Toaster.tsx +50 -0
  11. package/src/lib/components/Toaster/Types.ts +11 -0
  12. package/src/lib/components/index.ts +8 -0
  13. package/src/lib/index.ts +15 -0
  14. package/src/lib/styles/base.css +392 -0
  15. package/src/lib/styles/syncfusion_bootstrap4.css +10 -0
  16. package/src/lib/styles/toaster.css +50 -0
  17. package/src/lib/utils/CurrencyUtiles.ts +28 -0
  18. package/src/lib/utils/DateUtils.ts +135 -0
  19. package/src/lib/utils/FileUtil.ts +27 -0
  20. package/src/lib/utils/configuration/ConfigurationLoader.tsx +43 -0
  21. package/src/lib/utils/configuration/ConfigurationManager.ts +29 -0
  22. package/src/lib/utils/configuration/ConfigurationReturner.tsx +39 -0
  23. package/src/lib/utils/configuration/index.ts +9 -0
  24. package/src/lib/utils/fetch/Types.ts +11 -0
  25. package/src/lib/utils/fetch/fetchWrapper.ts +144 -0
  26. package/src/lib/utils/fetch/index.ts +4 -0
  27. package/src/lib/utils/index.ts +8 -0
  28. package/src/lib/utils/labels/LanguageLoader.tsx +67 -0
  29. package/src/lib/utils/labels/LanguageManager.ts +53 -0
  30. package/src/lib/utils/labels/LanguageReturner.tsx +41 -0
  31. package/src/lib/utils/labels/index.ts +9 -0
  32. package/src/react-app-env.d.ts +1 -0
  33. package/src/reportWebVitals.ts +15 -0
  34. package/src/setupTests.ts +5 -0
  35. package/.vscode/settings.json +0 -3
@@ -0,0 +1,41 @@
1
+ import React, { useEffect } from 'react';
2
+
3
+ import LanguageManager from './LanguageManager';
4
+
5
+ export type Labels_Type = {
6
+ language: string
7
+ }
8
+ export type languageLoaderParamsType = {
9
+ labels?: Labels_Type
10
+ language: string
11
+ onLanguageLoad: (language?: Labels_Type) => void
12
+ path: string
13
+ }
14
+
15
+ export default function LanguageReturner({ labels, language, onLanguageLoad, path }: languageLoaderParamsType) {
16
+ const { loadLabels } = LanguageManager();
17
+
18
+ const fullPath = `${path}/${language}.json`;
19
+
20
+ // Do it on change language
21
+ useEffect(() => {
22
+ async function justAsync() {
23
+ if (!labels || !labels.language || labels.language !== language) {
24
+ console.log(`Loading Language Labels for this Path: ${path} in this fullpath: ${fullPath}`);
25
+ await loadLabels(fullPath).then((response: any) => {
26
+ console.log(`Loaded Language Labels for this Path: ${path} in this fullpath: ${fullPath}`, response);
27
+ onLanguageLoad(response);
28
+ }).catch((err: any) => {
29
+ console.error(`Problem loading the Path: ${path} Language Labels in this fullpath: ${fullPath}`);
30
+ });
31
+ }
32
+ }
33
+ justAsync();
34
+ // eslint-disable-next-line react-hooks/exhaustive-deps
35
+ }, [language]);
36
+
37
+ return (
38
+ <React.Fragment>
39
+ </React.Fragment>
40
+ );
41
+ }
@@ -0,0 +1,9 @@
1
+ import LanguageLoader from './LanguageLoader';
2
+ import LanguageManager from './LanguageManager';
3
+ import LanguageReturner from './LanguageReturner';
4
+
5
+ export {
6
+ LanguageLoader,
7
+ LanguageManager,
8
+ LanguageReturner
9
+ };
@@ -0,0 +1 @@
1
+ /// <reference types="react-scripts" />
@@ -0,0 +1,15 @@
1
+ import { ReportHandler } from 'web-vitals';
2
+
3
+ const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
+ if (onPerfEntry && onPerfEntry instanceof Function) {
5
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
+ getCLS(onPerfEntry);
7
+ getFID(onPerfEntry);
8
+ getFCP(onPerfEntry);
9
+ getLCP(onPerfEntry);
10
+ getTTFB(onPerfEntry);
11
+ });
12
+ }
13
+ };
14
+
15
+ export default reportWebVitals;
@@ -0,0 +1,5 @@
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import '@testing-library/jest-dom';
@@ -1,3 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules\\typescript\\lib"
3
- }