@firedesktop/react-base 1.49.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 (46) 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/.eslintrc +0 -19
  36. package/.vscode/settings.json +0 -3
  37. package/public/configuration/config.json +0 -6
  38. package/public/favicon.ico +0 -0
  39. package/public/index.html +0 -43
  40. package/public/labels/185/it-IT.json +0 -8
  41. package/public/labels/it-IT.json +0 -8
  42. package/public/logo192.png +0 -0
  43. package/public/logo512.png +0 -0
  44. package/public/manifest.json +0 -25
  45. package/public/robots.txt +0 -3
  46. package/tsconfig.json +0 -30
@@ -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';
package/.eslintrc DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "react-app",
3
- "rules": {
4
- "linebreak-style": [
5
- 0,
6
- "unix"
7
- ],
8
- "max-len": 0,
9
- "no-new-object": "error",
10
- "no-param-reassign": 0,
11
- "prefer-const": "error",
12
- "quotes": [
13
- "error",
14
- "single"
15
- ],
16
- "semi": "error",
17
- "spaced-comment": "error"
18
- }
19
- }
@@ -1,3 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules\\typescript\\lib"
3
- }
@@ -1,6 +0,0 @@
1
- {
2
- "loaded": true,
3
- "urls": {
4
- "authentication": "http://login.io"
5
- }
6
- }
Binary file
package/public/index.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
@@ -1,8 +0,0 @@
1
- {
2
- "language": "it-IT",
3
- "demo": {
4
- "label_01": "Demo Label 185 01",
5
- "label_02": "Demo Label 185 02"
6
- },
7
- "anotherContext": {}
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "language": "it-IT",
3
- "demo": {
4
- "label_01": "Demo Label 01",
5
- "label_02": "Demo Label 02"
6
- },
7
- "anotherContext": {}
8
- }
Binary file
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
package/tsconfig.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "noEmit": false,
10
- "isolatedModules": true,
11
- "allowSyntheticDefaultImports": true,
12
- "allowJs": true,
13
- "declaration": true,
14
- "esModuleInterop": true,
15
- "forceConsistentCasingInFileNames": true,
16
- "jsx": "react-jsx",
17
- "module": "esnext",
18
- "moduleResolution": "node",
19
- "noFallthroughCasesInSwitch": true,
20
- "outDir": "dist",
21
- "removeComments": true,
22
- "resolveJsonModule": true,
23
- "skipLibCheck": true,
24
- "sourceMap": true,
25
- "strict": false
26
- },
27
- "include": [
28
- "src/lib"
29
- ]
30
- }