@etsoo/react 1.3.75 → 1.3.79

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.
@@ -85,8 +85,9 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
85
85
  * Constructor
86
86
  * @param settings Settings
87
87
  * @param name Application name
88
+ * @param globalFields Global fields
88
89
  */
89
- constructor(settings: S, name: string);
90
+ constructor(settings: S, name: string, globalFields: string[]);
90
91
  /**
91
92
  * Change culture
92
93
  * @param culture New culture definition
@@ -1,4 +1,5 @@
1
1
  import { CoreApp, createClient } from '@etsoo/appscript';
2
+ import { DomUtils, WindowStorage } from '@etsoo/shared';
2
3
  import React from 'react';
3
4
  import { NotifierMU } from '../mu/NotifierMU';
4
5
  import { ProgressCount } from '../mu/ProgressCount';
@@ -53,9 +54,21 @@ export class ReactApp extends CoreApp {
53
54
  * Constructor
54
55
  * @param settings Settings
55
56
  * @param name Application name
57
+ * @param globalFields Global fields
56
58
  */
57
- constructor(settings, name) {
58
- super(settings, ReactApp.createApi(settings), ReactApp.createNotifier(), name);
59
+ constructor(settings, name, globalFields) {
60
+ super(settings, ReactApp.createApi(settings), ReactApp.createNotifier(), new WindowStorage([
61
+ ...globalFields,
62
+ DomUtils.CountryField,
63
+ DomUtils.CultureField,
64
+ CoreApp.deviceIdField,
65
+ CoreApp.headerTokenField,
66
+ CoreApp.serversideDeviceIdField
67
+ ], (field, data, index) => {
68
+ if (index > 0 && field === CoreApp.headerTokenField)
69
+ return null;
70
+ return data;
71
+ }), name);
59
72
  /**
60
73
  * User state
61
74
  */
@@ -30,8 +30,9 @@ export declare class ServiceApp<P extends IServicePageData = IServicePageData, U
30
30
  * Constructor
31
31
  * @param settings Settings
32
32
  * @param name Application name
33
+ * @param globalFields Global fields
33
34
  */
34
- constructor(settings: S, name: string);
35
+ constructor(settings: S, name: string, globalFields: string[]);
35
36
  /**
36
37
  * Go to the login page
37
38
  */
@@ -13,9 +13,10 @@ export class ServiceApp extends ReactApp {
13
13
  * Constructor
14
14
  * @param settings Settings
15
15
  * @param name Application name
16
+ * @param globalFields Global fields
16
17
  */
17
- constructor(settings, name) {
18
- super(settings, name);
18
+ constructor(settings, name, globalFields) {
19
+ super(settings, name, globalFields);
19
20
  /**
20
21
  * Service passphrase
21
22
  */
@@ -51,7 +52,7 @@ export class ServiceApp extends ReactApp {
51
52
  '&serviceDeviceId=' +
52
53
  encodeURIComponent(this.deviceId) +
53
54
  '&' +
54
- DomUtils.Culture +
55
+ DomUtils.CultureField +
55
56
  '=' +
56
57
  this.culture;
57
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.75",
3
+ "version": "1.3.79",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,16 +50,16 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.1.89",
53
+ "@etsoo/appscript": "^1.1.96",
54
54
  "@etsoo/notificationbase": "^1.0.95",
55
- "@etsoo/shared": "^1.0.82",
55
+ "@etsoo/shared": "^1.0.88",
56
56
  "@mui/icons-material": "^5.2.5",
57
57
  "@mui/material": "^5.2.5",
58
58
  "@reach/router": "^1.3.4",
59
59
  "@types/pica": "^5.1.3",
60
60
  "@types/pulltorefreshjs": "^0.1.5",
61
- "@types/reach__router": "^1.3.9",
62
- "@types/react": "^17.0.37",
61
+ "@types/reach__router": "^1.3.10",
62
+ "@types/react": "^17.0.38",
63
63
  "@types/react-avatar-editor": "^10.3.6",
64
64
  "@types/react-dom": "^17.0.11",
65
65
  "@types/react-input-mask": "^3.0.1",
@@ -86,7 +86,7 @@
86
86
  "eslint": "^8.5.0",
87
87
  "eslint-config-airbnb-base": "^15.0.0",
88
88
  "eslint-plugin-import": "^2.25.3",
89
- "eslint-plugin-react": "^7.27.1",
89
+ "eslint-plugin-react": "^7.28.0",
90
90
  "jest": "^27.4.5",
91
91
  "react-test-renderer": "^17.0.2",
92
92
  "ts-jest": "^27.1.2",
@@ -7,7 +7,7 @@ import {
7
7
  IUserData
8
8
  } from '@etsoo/appscript';
9
9
  import { NotificationRenderProps } from '@etsoo/notificationbase';
10
- import { DataTypes } from '@etsoo/shared';
10
+ import { DataTypes, DomUtils, WindowStorage } from '@etsoo/shared';
11
11
  import React from 'react';
12
12
  import { NotifierMU } from '../mu/NotifierMU';
13
13
  import { ProgressCount } from '../mu/ProgressCount';
@@ -182,12 +182,30 @@ export class ReactApp<
182
182
  * Constructor
183
183
  * @param settings Settings
184
184
  * @param name Application name
185
+ * @param globalFields Global fields
185
186
  */
186
- constructor(settings: S, name: string) {
187
+ constructor(settings: S, name: string, globalFields: string[]) {
187
188
  super(
188
189
  settings,
189
190
  ReactApp.createApi(settings),
190
191
  ReactApp.createNotifier(),
192
+ new WindowStorage(
193
+ [
194
+ ...globalFields,
195
+
196
+ DomUtils.CountryField,
197
+ DomUtils.CultureField,
198
+
199
+ CoreApp.deviceIdField,
200
+ CoreApp.headerTokenField,
201
+ CoreApp.serversideDeviceIdField
202
+ ],
203
+ (field, data, index) => {
204
+ if (index > 0 && field === CoreApp.headerTokenField)
205
+ return null;
206
+ return data;
207
+ }
208
+ ),
191
209
  name
192
210
  );
193
211
  this.cultureState = new CultureState(settings.currentCulture);
@@ -50,9 +50,10 @@ export class ServiceApp<
50
50
  * Constructor
51
51
  * @param settings Settings
52
52
  * @param name Application name
53
+ * @param globalFields Global fields
53
54
  */
54
- constructor(settings: S, name: string) {
55
- super(settings, name);
55
+ constructor(settings: S, name: string, globalFields: string[]) {
56
+ super(settings, name, globalFields);
56
57
 
57
58
  // Check
58
59
  if (settings.serviceId == null || settings.serviceEndpoint == null) {
@@ -79,7 +80,7 @@ export class ServiceApp<
79
80
  '&serviceDeviceId=' +
80
81
  encodeURIComponent(this.deviceId) +
81
82
  '&' +
82
- DomUtils.Culture +
83
+ DomUtils.CultureField +
83
84
  '=' +
84
85
  this.culture;
85
86
  }