@firedesktop/react-base 1.48.0 → 1.50.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 (48) hide show
  1. package/package.json +10 -10
  2. package/.babelrc +0 -21
  3. package/.eslintcache +0 -1
  4. package/.eslintrc +0 -19
  5. package/debug.log +0 -1
  6. package/public/configuration/config.json +0 -6
  7. package/public/favicon.ico +0 -0
  8. package/public/index.html +0 -43
  9. package/public/labels/185/it-IT.json +0 -8
  10. package/public/labels/it-IT.json +0 -8
  11. package/public/logo192.png +0 -0
  12. package/public/logo512.png +0 -0
  13. package/public/manifest.json +0 -25
  14. package/public/robots.txt +0 -3
  15. package/src/App.test.tsx +0 -9
  16. package/src/App.tsx +0 -170
  17. package/src/TestLabelFunction.tsx +0 -17
  18. package/src/index.tsx +0 -27
  19. package/src/lib/components/AppIcon.tsx +0 -784
  20. package/src/lib/components/AppInput.tsx +0 -66
  21. package/src/lib/components/AppPagination.tsx +0 -124
  22. package/src/lib/components/Spin.tsx +0 -31
  23. package/src/lib/components/Toaster/Toaster.tsx +0 -50
  24. package/src/lib/components/Toaster/Types.ts +0 -11
  25. package/src/lib/components/index.ts +0 -8
  26. package/src/lib/index.ts +0 -15
  27. package/src/lib/styles/base.css +0 -392
  28. package/src/lib/styles/syncfusion_bootstrap4.css +0 -10
  29. package/src/lib/styles/toaster.css +0 -50
  30. package/src/lib/utils/CurrencyUtiles.ts +0 -28
  31. package/src/lib/utils/DateUtils.ts +0 -135
  32. package/src/lib/utils/FileUtil.ts +0 -27
  33. package/src/lib/utils/configuration/ConfigurationLoader.tsx +0 -43
  34. package/src/lib/utils/configuration/ConfigurationManager.ts +0 -29
  35. package/src/lib/utils/configuration/ConfigurationReturner.tsx +0 -39
  36. package/src/lib/utils/configuration/index.ts +0 -9
  37. package/src/lib/utils/fetch/Types.ts +0 -11
  38. package/src/lib/utils/fetch/fetchWrapper.ts +0 -144
  39. package/src/lib/utils/fetch/index.ts +0 -4
  40. package/src/lib/utils/index.ts +0 -8
  41. package/src/lib/utils/labels/LanguageLoader.tsx +0 -67
  42. package/src/lib/utils/labels/LanguageManager.ts +0 -53
  43. package/src/lib/utils/labels/LanguageReturner.tsx +0 -41
  44. package/src/lib/utils/labels/index.ts +0 -9
  45. package/src/react-app-env.d.ts +0 -1
  46. package/src/reportWebVitals.ts +0 -15
  47. package/src/setupTests.ts +0 -5
  48. package/tsconfig.json +0 -30
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "@firedesktop/react-base",
3
- "version": "1.48.0",
3
+ "version": "1.50.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
7
  "author": "alessandro.gambaro",
8
8
  "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
9
  "dependencies": {
10
- "@syncfusion/ej2-popups": "20.1.55",
10
+ "@syncfusion/ej2-popups": "20.1.58",
11
11
  "@syncfusion/ej2-react-notifications": "20.1.55"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@babel/cli": "7.17.10",
15
- "@babel/core": "7.17.12",
15
+ "@babel/core": "7.18.2",
16
16
  "@babel/plugin-proposal-class-properties": "7.17.12",
17
17
  "@babel/plugin-transform-arrow-functions": "7.17.12",
18
18
  "@babel/preset-typescript": "7.17.12",
19
19
  "@testing-library/jest-dom": "5.16.4",
20
- "@testing-library/react": "13.2.0",
20
+ "@testing-library/react": "13.3.0",
21
21
  "@testing-library/user-event": "14.2.0",
22
- "@types/jest": "27.5.1",
23
- "@types/node": "17.0.34",
24
- "@types/react": "18.0.9",
25
- "@types/react-dom": "18.0.4",
22
+ "@types/jest": "28.1.1",
23
+ "@types/node": "17.0.41",
24
+ "@types/react": "18.0.12",
25
+ "@types/react-dom": "18.0.5",
26
26
  "@types/react-redux": "7.1.24",
27
27
  "babel-plugin-minify-builtins": "0.5.0",
28
28
  "babel-preset-minify": "0.5.2",
@@ -31,9 +31,9 @@
31
31
  "lodash": "4.17.21",
32
32
  "react": "18.1.0",
33
33
  "react-dom": "18.1.0",
34
- "react-redux": "8.0.1",
34
+ "react-redux": "8.0.2",
35
35
  "react-scripts": "5.0.1",
36
- "typescript": "4.6.4",
36
+ "typescript": "4.7.3",
37
37
  "web-vitals": "2.1.4"
38
38
  },
39
39
  "peerDependencies": {
package/.babelrc DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "plugins": [
3
- "@babel/plugin-transform-arrow-functions",
4
- "@babel/proposal-object-rest-spread",
5
- "@babel/plugin-proposal-class-properties"
6
- ],
7
- "presets": [
8
- [
9
- "@babel/preset-env",
10
- {
11
- "targets": {
12
- "browsers": [
13
- "last 2 versions"
14
- ]
15
- }
16
- }
17
- ],
18
- "@babel/preset-react",
19
- "@babel/preset-typescript"
20
- ]
21
- }
package/.eslintcache DELETED
@@ -1 +0,0 @@
1
- [{"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\index.tsx":"1","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\reportWebVitals.ts":"2","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\App.tsx":"3","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\TestLabelFunction.tsx":"4","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\index.ts":"5","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\ConfigurationLoader.tsx":"6","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\LanguageLoader.tsx":"7","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\index.ts":"8","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\index.ts":"9","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\ConfigurationManager.ts":"10","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\LanguageManager.ts":"11","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Toaster\\Types.ts":"12","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Spin.tsx":"13","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppInput.tsx":"14","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppIcon.tsx":"15","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Toaster\\Toaster.tsx":"16","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\index.ts":"17","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\index.ts":"18","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\index.ts":"19","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\Types.ts":"20","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\fetchWrapper.ts":"21","C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppPagination.tsx":"22"},{"size":494,"mtime":1603824492688,"results":"23","hashOfConfig":"24"},{"size":442,"mtime":1605695276101,"results":"25","hashOfConfig":"24"},{"size":4966,"mtime":1610124289141,"results":"26","hashOfConfig":"24"},{"size":424,"mtime":1605695276095,"results":"27","hashOfConfig":"24"},{"size":291,"mtime":1605458851566,"results":"28","hashOfConfig":"24"},{"size":1534,"mtime":1605788323697,"results":"29","hashOfConfig":"24"},{"size":1650,"mtime":1605695276100,"results":"30","hashOfConfig":"24"},{"size":167,"mtime":1605458851574,"results":"31","hashOfConfig":"24"},{"size":315,"mtime":1607544774606,"results":"32","hashOfConfig":"24"},{"size":1221,"mtime":1605695276098,"results":"33","hashOfConfig":"24"},{"size":1852,"mtime":1606840214542,"results":"34","hashOfConfig":"24"},{"size":206,"mtime":1606840214535,"results":"35","hashOfConfig":"24"},{"size":848,"mtime":1605695276096,"results":"36","hashOfConfig":"24"},{"size":1387,"mtime":1610123730819,"results":"37","hashOfConfig":"24"},{"size":63332,"mtime":1610124087804,"results":"38","hashOfConfig":"24"},{"size":2228,"mtime":1606061544975,"results":"39","hashOfConfig":"24"},{"size":173,"mtime":1605458851570,"results":"40","hashOfConfig":"24"},{"size":143,"mtime":1605458851577,"results":"41","hashOfConfig":"24"},{"size":112,"mtime":1605695276099,"results":"42","hashOfConfig":"24"},{"size":248,"mtime":1606840214536,"results":"43","hashOfConfig":"24"},{"size":5806,"mtime":1606983244339,"results":"44","hashOfConfig":"24"},{"size":4769,"mtime":1608719725086,"results":"45","hashOfConfig":"24"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},"1g0oopp",{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\index.tsx",[],["91","92"],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\reportWebVitals.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\App.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\TestLabelFunction.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\ConfigurationLoader.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\LanguageLoader.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\ConfigurationManager.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\LanguageManager.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Toaster\\Types.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Spin.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppInput.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppIcon.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\Toaster\\Toaster.tsx",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\configuration\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\labels\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\index.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\Types.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\utils\\fetch\\fetchWrapper.ts",[],"C:\\Fd\\repo\\npm\\baseFEComponents\\@firedesktop\\react-base\\src\\lib\\components\\AppPagination.tsx",[],{"ruleId":"93","replacedBy":"94"},{"ruleId":"95","replacedBy":"96"},"no-native-reassign",["97"],"no-negated-in-lhs",["98"],"no-global-assign","no-unsafe-negation"]
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
- }
package/debug.log DELETED
@@ -1 +0,0 @@
1
- [1122/163547.632:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
@@ -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/src/App.test.tsx DELETED
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import App from './App';
4
-
5
- test('renders learn react link', () => {
6
- render(<App />);
7
- const linkElement = screen.getByText(/learn react/i);
8
- expect(linkElement).toBeInTheDocument();
9
- });
package/src/App.tsx DELETED
@@ -1,170 +0,0 @@
1
- import React, { useRef, useState } from 'react';
2
- import { Provider } from 'react-redux';
3
- import { createStore } from 'redux';
4
-
5
- import { Components, ConfigurationLoader, Utils, LanguageLoader, LanguageReturner } from './lib';
6
-
7
- import DateUtils from './lib/utils/DateUtils';
8
-
9
- import TestLabelFunction from './TestLabelFunction';
10
-
11
- import 'bootstrap/dist/css/bootstrap.css';
12
- import '@syncfusion/ej2-base/styles/bootstrap4.css';
13
- import '@syncfusion/ej2-buttons/styles/bootstrap4.css';
14
- import '@syncfusion/ej2-icons/styles/bootstrap4.css';
15
- import '@syncfusion/ej2-popups/styles/bootstrap4.css';
16
-
17
- import './lib/styles/base.css';
18
- import './lib/styles/syncfusion_bootstrap4.css';
19
-
20
- export const UPDATE_APP_STATE = 'UPDATE_APP_STATE';
21
- const appReducer = (state = {}, action: any) => {
22
- switch (action.type) {
23
- case UPDATE_APP_STATE: {
24
- const { name, value } = action.payload;
25
- const newState = { ...state, [name]: value };
26
- return newState;
27
- }
28
- default:
29
- return state;
30
- }
31
- };
32
-
33
- function App() {
34
- const [options, setOptions] = useState<{ value: string }[]>([]);
35
- const [spinning, setSpinning] = useState(false);
36
- const [activePage, setActivePage] = useState(1);
37
-
38
-
39
- function onGenericServerError(status: number) {
40
- alert(`Error, Status: ${status}`);
41
- }
42
-
43
- function status_401() {
44
- alert('Log Out 401');
45
- }
46
-
47
- function status_403() {
48
- alert('Log Out 403');
49
- }
50
-
51
- function iconClick(event: any) {
52
- alert('Icon click');
53
- }
54
-
55
- const textFetch = () => {
56
- if (_referenceRef.current) {
57
- console.log('dddddddddddddddd');
58
- }
59
-
60
- const labels = { errorGeneric: 'Errore generiro', errorServerNotAvailable: 'No serviziooo', errorSessionExpired: 'Sessione scadurta' } as Utils.Fetch.Types.ILabels;
61
-
62
- const runner = new Utils.Fetch.FetchWrapper(null, labels, status_401, status_403);
63
-
64
- // var req = new XMLHttpRequest();
65
- // req.open('POST', 'https://192.168.12.164:656/flowbot/Authentication/LoginWithForm', true);
66
- // req.setRequestHeader('Content-Type', 'application/json');
67
- // req.setRequestHeader('X-Token', '');
68
- // req.addEventListener('readystatechange', function (ev: Event) {
69
- // debugger;
70
- // console.log(ev);
71
- // // if (this.readyState === 4 && (this.status === 401 || this.status === 403)) {
72
- // // window.location.href = '#/logoff';
73
- // // }
74
- // }, false);
75
- // req.onreadystatechange = function () {
76
- // if (req.readyState === 4) {
77
- // if (req.status >= 200 && req.status < 400) {
78
- // debugger;
79
- // } else if (req.status === 400) {
80
- // debugger;
81
- // } else if (req.status === 401 || req.status === 403) {
82
- // debugger;
83
- // } else {
84
- // debugger;
85
- // }
86
- // }
87
- // };
88
- // req.send();
89
-
90
- setSpinning(true);
91
- // runner.post('https://192.168.12.164:656/flowbot/Authentication/LoginWithForm', undefined, undefined, { username: 'admin', password: 'a' })
92
- // .then((authentication: any) => {
93
- // console.log(authentication);
94
- // setSpinning(false);
95
-
96
- // }).catch((errorMessage: any) => {
97
- // console.log(errorMessage);
98
- // setSpinning(false);
99
- // });
100
- runner.get('https://my-json-server.typicode.com/typicode/demo/posts', null, null, onGenericServerError, null, false, false).then(response => {
101
- // @ts-ignore
102
- const values = response.map(x => {
103
- return { value: x.id, label: x.title };
104
- });
105
- setOptions(values);
106
- setSpinning(false);
107
- }).catch(errorMessage => {
108
- setSpinning(false);
109
- if (errorMessage)
110
- console.log(errorMessage);
111
- });
112
- };
113
-
114
- const updateAppState = (name: string, value: object) => {
115
- console.log(`updateState name: ${name}, configuration: ${value}`);
116
- return {
117
- type: UPDATE_APP_STATE,
118
- payload: {
119
- name,
120
- value,
121
- },
122
- };
123
- };
124
-
125
- const language185Loaded = (language: object) => {
126
- console.log('185: ->', language);
127
- };
128
-
129
- const onPageChange = (nextPage: number) => {
130
- setActivePage(nextPage);
131
- };
132
-
133
- // @ts-ignore
134
- const store = createStore(appReducer);
135
- const _referenceRef = useRef<any>();
136
- return (
137
-
138
- <Provider store={store}>
139
- <br />
140
- <Components.AppPagination activePage={activePage} itemsPerPage={7} onPageChange={onPageChange} totalItems={17} maxSize={5} />
141
- <Components.Spin spinning={spinning} />
142
- <Components.AppIcon name={'Pin'} className='dark-pink-svg' onClick={iconClick} />
143
- <TestLabelFunction />
144
- <ConfigurationLoader updateAppState={updateAppState} path={null} />
145
- <LanguageLoader updateAppState={updateAppState} language='it-IT' path={null} />
146
- <LanguageReturner onLanguageLoad={language185Loaded} language='it-IT' path='./labels/185' />
147
-
148
- <button onClick={textFetch}>Fetch Demo</button>
149
- {options ? options.map((x: any) => {
150
- return (<li key={x.value}>ID: {x.value} Post: {x.label}</li>);
151
- }) : ''}
152
-
153
- <br />
154
- <br />
155
- <br />
156
- <br />
157
- {DateUtils().dateToString_Italian(new Date(), '-', undefined)}
158
-
159
-
160
- <Components.AppInput appIcon={<Components.AppIcon name={'user'} className={'tertiary-svg'}
161
- iconClassName='login_form_svg' />}
162
- type='text'
163
- ref={_referenceRef}
164
- placeholder='username---'
165
- name='username' />
166
- </Provider >
167
- );
168
- }
169
-
170
- export default App;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { useSelector } from 'react-redux';
3
- import { Utils} from './lib';
4
- const { getLabel } = Utils.Labels.LanguageManager();
5
-
6
-
7
- function TestLabelFunction() {
8
- const { labels }: any = useSelector(state => state);
9
-
10
- return (
11
- <React.Fragment>
12
- {getLabel(labels, 'demo.label_01', 'Ola')}
13
- </React.Fragment>
14
- );
15
- }
16
-
17
- export default TestLabelFunction;
package/src/index.tsx DELETED
@@ -1,27 +0,0 @@
1
- import { registerLicense } from '@syncfusion/ej2-base';
2
- import { createRoot } from 'react-dom/client';
3
-
4
- import App from './App';
5
- import reportWebVitals from './reportWebVitals';
6
-
7
-
8
- // ****************************************************************************************************
9
- // Syncfusion Doc
10
- // https://ej2.syncfusion.com/react/documentation/licensing/license-key-registration/#reactjs
11
- //
12
- // ReactJs
13
- // https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html
14
- //
15
- // ****************************************************************************************************
16
- registerLicense('ORg4AjUWIQA/Gnt2VVhhQlFaclhJXGFWfVJpTGpQdk5xdV9DaVZUTWY/P1ZhSXxRdkFjXX5fcXFVT2BeWUE=');
17
-
18
- const container = document.getElementById('root');
19
- if (container) {
20
- const root = createRoot(container);
21
- root.render(<App />);
22
- }
23
-
24
- // If you want to start measuring performance in your app, pass a function
25
- // to log results (for example: reportWebVitals(console.log))
26
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
27
- reportWebVitals();