@firedesktop/react-base 1.51.0 → 1.53.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firedesktop/react-base",
3
- "version": "1.51.0",
3
+ "version": "1.53.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.",
@@ -8,20 +8,20 @@
8
8
  "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
9
  "dependencies": {
10
10
  "@syncfusion/ej2-popups": "20.1.58",
11
- "@syncfusion/ej2-react-notifications": "20.1.55"
11
+ "@syncfusion/ej2-react-notifications": "20.1.61"
12
12
  },
13
13
  "devDependencies": {
14
- "@babel/cli": "7.17.10",
15
- "@babel/core": "7.18.2",
16
- "@babel/plugin-proposal-class-properties": "7.17.12",
17
- "@babel/plugin-transform-arrow-functions": "7.17.12",
18
- "@babel/preset-typescript": "7.17.12",
14
+ "@babel/cli": "7.18.6",
15
+ "@babel/core": "7.18.6",
16
+ "@babel/plugin-proposal-class-properties": "7.18.6",
17
+ "@babel/plugin-transform-arrow-functions": "7.18.6",
18
+ "@babel/preset-typescript": "7.18.6",
19
19
  "@testing-library/jest-dom": "5.16.4",
20
20
  "@testing-library/react": "13.3.0",
21
- "@testing-library/user-event": "14.2.0",
22
- "@types/jest": "28.1.1",
23
- "@types/node": "17.0.41",
24
- "@types/react": "18.0.12",
21
+ "@testing-library/user-event": "14.2.1",
22
+ "@types/jest": "28.1.3",
23
+ "@types/node": "18.0.0",
24
+ "@types/react": "18.0.14",
25
25
  "@types/react-dom": "18.0.5",
26
26
  "@types/react-redux": "7.1.24",
27
27
  "babel-plugin-minify-builtins": "0.5.0",
@@ -29,11 +29,11 @@
29
29
  "bootstrap": "4.6.0",
30
30
  "copyfiles": "2.4.1",
31
31
  "lodash": "4.17.21",
32
- "react": "18.1.0",
33
- "react-dom": "18.1.0",
32
+ "react": "18.2.0",
33
+ "react-dom": "18.2.0",
34
34
  "react-redux": "8.0.2",
35
35
  "react-scripts": "5.0.1",
36
- "typescript": "4.7.3",
36
+ "typescript": "4.7.4",
37
37
  "web-vitals": "2.1.4"
38
38
  },
39
39
  "peerDependencies": {
@@ -2,7 +2,12 @@ function ConfigurationManager() {
2
2
 
3
3
  async function loadConfiguration(fullPath: string) {
4
4
  try {
5
- const res = await fetch(fullPath, { headers: { 'Content-Type': 'application/json; charset=utf-8' } });
5
+ const res = await fetch(fullPath, {
6
+ headers: {
7
+ 'Content-Type': 'application/json; charset=utf-8',
8
+ 'pragma': 'no-cache'
9
+ }
10
+ });
6
11
  return await res.json();
7
12
  }
8
13
  catch (err) {
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();
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
@@ -1,15 +0,0 @@
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;
package/src/setupTests.ts DELETED
@@ -1,5 +0,0 @@
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';