@etsoo/react 1.6.74 → 1.6.75
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/components/DnDList.d.ts +1 -1
- package/lib/components/DynamicRouter.d.ts +1 -1
- package/lib/components/ScrollRestoration.d.ts +2 -2
- package/lib/components/ScrollerGrid.d.ts +1 -1
- package/lib/components/ScrollerList.d.ts +1 -1
- package/lib/states/CultureState.js +5 -1
- package/package.json +8 -8
- package/src/states/CultureState.ts +7 -1
|
@@ -71,4 +71,4 @@ export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
|
|
|
71
71
|
*/
|
|
72
72
|
export declare function DnDList<D extends {
|
|
73
73
|
id: UniqueIdentifier;
|
|
74
|
-
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): JSX.Element;
|
|
74
|
+
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): React.JSX.Element;
|
|
@@ -13,4 +13,4 @@ export type DynamicRouterProps = {
|
|
|
13
13
|
* @param props Props
|
|
14
14
|
* @returns Component
|
|
15
15
|
*/
|
|
16
|
-
export declare function DynamicRouter(props: React.PropsWithChildren<DynamicRouterProps>): JSX.Element;
|
|
16
|
+
export declare function DynamicRouter(props: React.PropsWithChildren<DynamicRouterProps>): React.JSX.Element;
|
|
@@ -114,4 +114,4 @@ export interface ScrollerGridForwardRef<T> extends GridMethodRef<T> {
|
|
|
114
114
|
* @param props Props
|
|
115
115
|
* @returns Component
|
|
116
116
|
*/
|
|
117
|
-
export declare const ScrollerGrid: <T extends object, D extends DataTypes.Keys<T, string | number> = IdDefaultType<T>>(props: ScrollerGridProps<T, D>) => JSX.Element;
|
|
117
|
+
export declare const ScrollerGrid: <T extends object, D extends DataTypes.Keys<T, string | number> = IdDefaultType<T>>(props: ScrollerGridProps<T, D>) => React.JSX.Element;
|
|
@@ -64,5 +64,5 @@ export interface ScrollerListForwardRef<T> extends GridMethodRef<T>, ScrollerLis
|
|
|
64
64
|
* @param props Props
|
|
65
65
|
* @returns Component
|
|
66
66
|
*/
|
|
67
|
-
export declare const ScrollerList: <T extends object, D extends DataTypes.Keys<T, string | number> = IdDefaultType<T>>(props: ScrollerListProps<T, D>) => JSX.Element;
|
|
67
|
+
export declare const ScrollerList: <T extends object, D extends DataTypes.Keys<T, string | number> = IdDefaultType<T>>(props: ScrollerListProps<T, D>) => React.JSX.Element;
|
|
68
68
|
export {};
|
|
@@ -6,7 +6,8 @@ const calls = {
|
|
|
6
6
|
* @param key Item key
|
|
7
7
|
*/
|
|
8
8
|
get(key) {
|
|
9
|
-
const
|
|
9
|
+
const resources = this.state.resources;
|
|
10
|
+
const value = typeof resources === 'object' ? resources[key] : undefined;
|
|
10
11
|
if (value == null)
|
|
11
12
|
return undefined;
|
|
12
13
|
return value;
|
|
@@ -24,6 +25,9 @@ export class CultureState {
|
|
|
24
25
|
constructor(item) {
|
|
25
26
|
// Default
|
|
26
27
|
const defaultItem = item !== null && item !== void 0 ? item : {};
|
|
28
|
+
// Load resources
|
|
29
|
+
if (item != null && typeof item.resources !== 'object')
|
|
30
|
+
item.resources().then((result) => (item.resources = result));
|
|
27
31
|
// Act
|
|
28
32
|
const { context, provider } = State.create((state, action) => {
|
|
29
33
|
// Language reducer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.75",
|
|
4
4
|
"description": "TypeScript ReactJs UI Independent Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@dnd-kit/core": "^6.0.8",
|
|
49
49
|
"@dnd-kit/sortable": "^7.0.2",
|
|
50
|
-
"@emotion/css": "^11.
|
|
51
|
-
"@emotion/react": "^11.
|
|
52
|
-
"@emotion/styled": "^11.
|
|
53
|
-
"@etsoo/appscript": "^1.
|
|
50
|
+
"@emotion/css": "^11.11.0",
|
|
51
|
+
"@emotion/react": "^11.11.0",
|
|
52
|
+
"@emotion/styled": "^11.11.0",
|
|
53
|
+
"@etsoo/appscript": "^1.4.0",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.24",
|
|
55
|
-
"@etsoo/shared": "^1.2.
|
|
56
|
-
"@types/react": "^18.2.
|
|
57
|
-
"@types/react-dom": "^18.2.
|
|
55
|
+
"@etsoo/shared": "^1.2.5",
|
|
56
|
+
"@types/react": "^18.2.6",
|
|
57
|
+
"@types/react-dom": "^18.2.4",
|
|
58
58
|
"@types/react-window": "^1.8.5",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
@@ -31,7 +31,9 @@ const calls = {
|
|
|
31
31
|
* @param key Item key
|
|
32
32
|
*/
|
|
33
33
|
get<T = string>(key: string) {
|
|
34
|
-
const
|
|
34
|
+
const resources = this.state.resources;
|
|
35
|
+
const value =
|
|
36
|
+
typeof resources === 'object' ? resources[key] : undefined;
|
|
35
37
|
if (value == null) return undefined;
|
|
36
38
|
return value as T;
|
|
37
39
|
}
|
|
@@ -60,6 +62,10 @@ export class CultureState {
|
|
|
60
62
|
// Default
|
|
61
63
|
const defaultItem = item ?? ({} as ICulture);
|
|
62
64
|
|
|
65
|
+
// Load resources
|
|
66
|
+
if (item != null && typeof item.resources !== 'object')
|
|
67
|
+
item.resources().then((result) => (item.resources = result));
|
|
68
|
+
|
|
63
69
|
// Act
|
|
64
70
|
const { context, provider } = State.create(
|
|
65
71
|
(state: ICulture, action: CultureAction) => {
|