@etsoo/react 1.4.53 → 1.4.58
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/lib/app/ReactApp.d.ts +2 -1
- package/lib/app/ReactApp.js +3 -2
- package/lib/app/ServiceApp.js +3 -2
- package/lib/mu/MobileListItemRenderer.d.ts +2 -1
- package/lib/mu/MobileListItemRenderer.js +8 -3
- package/package.json +2 -2
- package/src/app/ReactApp.ts +3 -2
- package/src/app/ServiceApp.ts +4 -3
- package/src/mu/MobileListItemRenderer.tsx +11 -3
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -114,9 +114,10 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
114
114
|
};
|
|
115
115
|
/**
|
|
116
116
|
* Get money format props
|
|
117
|
+
* @param currency Currency, if undefined, default currency applied
|
|
117
118
|
* @returns Props
|
|
118
119
|
*/
|
|
119
|
-
getMoneyFormatProps(): {
|
|
120
|
+
getMoneyFormatProps(currency?: string): {
|
|
120
121
|
culture: string;
|
|
121
122
|
currency: string;
|
|
122
123
|
};
|
package/lib/app/ReactApp.js
CHANGED
|
@@ -150,10 +150,11 @@ export class ReactApp extends CoreApp {
|
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Get money format props
|
|
153
|
+
* @param currency Currency, if undefined, default currency applied
|
|
153
154
|
* @returns Props
|
|
154
155
|
*/
|
|
155
|
-
getMoneyFormatProps() {
|
|
156
|
-
return { culture: this.culture, currency: this.currency };
|
|
156
|
+
getMoneyFormatProps(currency) {
|
|
157
|
+
return { culture: this.culture, currency: currency !== null && currency !== void 0 ? currency : this.currency };
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* Fresh countdown UI
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -234,11 +234,12 @@ export class ServiceApp extends ReactApp {
|
|
|
234
234
|
// Service user login
|
|
235
235
|
this.servicePassphrase =
|
|
236
236
|
(_a = this.decrypt(serviceUser.serviceDeviceId, this.settings.serviceId.toString())) !== null && _a !== void 0 ? _a : '';
|
|
237
|
-
// Keep = true, means service could hold the refresh token for long access
|
|
238
|
-
super.userLogin(user, refreshToken, true);
|
|
239
237
|
// Service user
|
|
240
238
|
this.serviceUser = serviceUser;
|
|
241
239
|
// Service API token
|
|
242
240
|
this.serviceApi.authorize(this.settings.authScheme, serviceUser.token);
|
|
241
|
+
// Keep = true, means service could hold the refresh token for long access
|
|
242
|
+
// Trigger Context change and serviceUser is ready then
|
|
243
|
+
super.userLogin(user, refreshToken, true);
|
|
243
244
|
}
|
|
244
245
|
}
|
|
@@ -22,8 +22,9 @@ export function MobileListItemRenderer({ data, itemHeight, margins }, renderer)
|
|
|
22
22
|
// Loading
|
|
23
23
|
if (data == null)
|
|
24
24
|
return React.createElement(LinearProgress, null);
|
|
25
|
+
console.log('margins', margins);
|
|
25
26
|
// Elements
|
|
26
|
-
const [title, subheader, actions, children] = renderer(data);
|
|
27
|
+
const [title, subheader, actions, children, cardActions] = renderer(data);
|
|
27
28
|
return (React.createElement(Card, { sx: {
|
|
28
29
|
height: itemHeight,
|
|
29
30
|
...margins
|
|
@@ -61,6 +62,10 @@ export function MobileListItemRenderer({ data, itemHeight, margins }, renderer)
|
|
|
61
62
|
}
|
|
62
63
|
} })) : (actions), title: title, titleTypographyProps: { variant: 'body2' }, subheader: subheader, subheaderTypographyProps: { variant: 'caption' } }),
|
|
63
64
|
React.createElement(CardContent, { sx: {
|
|
64
|
-
paddingTop: 0
|
|
65
|
-
|
|
65
|
+
paddingTop: 0,
|
|
66
|
+
paddingBottom: cardActions == null
|
|
67
|
+
? Reflect.get(margins, 'marginBottom')
|
|
68
|
+
: 0
|
|
69
|
+
} }, children),
|
|
70
|
+
cardActions));
|
|
66
71
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.58",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
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.2.
|
|
53
|
+
"@etsoo/appscript": "^1.2.27",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.0",
|
|
55
55
|
"@etsoo/shared": "^1.1.6",
|
|
56
56
|
"@mui/icons-material": "^5.3.0",
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -292,10 +292,11 @@ export class ReactApp<
|
|
|
292
292
|
|
|
293
293
|
/**
|
|
294
294
|
* Get money format props
|
|
295
|
+
* @param currency Currency, if undefined, default currency applied
|
|
295
296
|
* @returns Props
|
|
296
297
|
*/
|
|
297
|
-
getMoneyFormatProps() {
|
|
298
|
-
return { culture: this.culture, currency: this.currency };
|
|
298
|
+
getMoneyFormatProps(currency?: string) {
|
|
299
|
+
return { culture: this.culture, currency: currency ?? this.currency };
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
/**
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -333,13 +333,14 @@ export class ServiceApp<
|
|
|
333
333
|
this.settings.serviceId.toString()
|
|
334
334
|
) ?? '';
|
|
335
335
|
|
|
336
|
-
// Keep = true, means service could hold the refresh token for long access
|
|
337
|
-
super.userLogin(user, refreshToken, true);
|
|
338
|
-
|
|
339
336
|
// Service user
|
|
340
337
|
this.serviceUser = serviceUser;
|
|
341
338
|
|
|
342
339
|
// Service API token
|
|
343
340
|
this.serviceApi.authorize(this.settings.authScheme, serviceUser.token);
|
|
341
|
+
|
|
342
|
+
// Keep = true, means service could hold the refresh token for long access
|
|
343
|
+
// Trigger Context change and serviceUser is ready then
|
|
344
|
+
super.userLogin(user, refreshToken, true);
|
|
344
345
|
}
|
|
345
346
|
}
|
|
@@ -29,14 +29,17 @@ export function MobileListItemRenderer<T>(
|
|
|
29
29
|
string,
|
|
30
30
|
string | undefined,
|
|
31
31
|
React.ReactNode | (ListItemReact | boolean)[],
|
|
32
|
-
React.ReactNode
|
|
32
|
+
React.ReactNode,
|
|
33
|
+
React.ReactNode?
|
|
33
34
|
]
|
|
34
35
|
) {
|
|
35
36
|
// Loading
|
|
36
37
|
if (data == null) return <LinearProgress />;
|
|
37
38
|
|
|
39
|
+
console.log('margins', margins);
|
|
40
|
+
|
|
38
41
|
// Elements
|
|
39
|
-
const [title, subheader, actions, children] = renderer(data);
|
|
42
|
+
const [title, subheader, actions, children, cardActions] = renderer(data);
|
|
40
43
|
|
|
41
44
|
return (
|
|
42
45
|
<Card
|
|
@@ -100,11 +103,16 @@ export function MobileListItemRenderer<T>(
|
|
|
100
103
|
/>
|
|
101
104
|
<CardContent
|
|
102
105
|
sx={{
|
|
103
|
-
paddingTop: 0
|
|
106
|
+
paddingTop: 0,
|
|
107
|
+
paddingBottom:
|
|
108
|
+
cardActions == null
|
|
109
|
+
? Reflect.get(margins, 'marginBottom')
|
|
110
|
+
: 0
|
|
104
111
|
}}
|
|
105
112
|
>
|
|
106
113
|
{children}
|
|
107
114
|
</CardContent>
|
|
115
|
+
{cardActions}
|
|
108
116
|
</Card>
|
|
109
117
|
);
|
|
110
118
|
}
|