@homecode/ui 4.26.1 → 4.26.4
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/dist/esm/src/components/Router/Redirect.js +1 -1
- package/dist/esm/src/services/i18n.js +3 -4
- package/dist/esm/types/src/components/Notifications/Notifications.d.ts +11 -1
- package/dist/esm/types/src/components/Notifications/store.d.ts +12 -1
- package/dist/esm/types/src/components/Router/Router.d.ts +16 -1
- package/dist/esm/types/src/components/Router/store.d.ts +30 -2
- package/package.json +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { nanoid } from 'nanoid';
|
|
4
|
-
import { useStore } from 'justorm/react';
|
|
5
|
-
import { createStore } from 'justorm';
|
|
4
|
+
import { createStore, useStore } from 'justorm/react';
|
|
6
5
|
import _i18n from 'roddeh-i18n';
|
|
7
6
|
import LS from '../tools/localStorage.js';
|
|
8
7
|
import { queryParams } from '../tools/queryParams.js';
|
|
@@ -55,14 +54,14 @@ function init(config) {
|
|
|
55
54
|
componentStore,
|
|
56
55
|
// hook (update when componentStore._updated changed)
|
|
57
56
|
withI18N: Component => props => {
|
|
58
|
-
useStore({ [storeName]:
|
|
57
|
+
useStore({ [storeName]: [] });
|
|
59
58
|
return jsx(Component, { ...props });
|
|
60
59
|
},
|
|
61
60
|
i18n: (key, props) => getTrans(key, props),
|
|
62
61
|
I18N: memo(function I18N({ id, children, props }) {
|
|
63
62
|
useStore({
|
|
64
63
|
i18n: ['lang'],
|
|
65
|
-
[storeName]:
|
|
64
|
+
[storeName]: [],
|
|
66
65
|
});
|
|
67
66
|
const key = id ?? children;
|
|
68
67
|
// @ts-ignore
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
store?: any;
|
|
3
3
|
};
|
|
4
|
-
export declare const NotificationsStore:
|
|
4
|
+
export declare const NotificationsStore: import("justorm/dist/esm/proxy").ProxyStore<{
|
|
5
|
+
items: string[];
|
|
6
|
+
autohide: string[];
|
|
7
|
+
data: {};
|
|
8
|
+
paused: boolean;
|
|
9
|
+
show(data: any): any;
|
|
10
|
+
pause(): void;
|
|
11
|
+
unpause(): void;
|
|
12
|
+
close(id: any): void;
|
|
13
|
+
remove(id: any): void;
|
|
14
|
+
}>;
|
|
5
15
|
export declare const Notifications: (props: Props) => JSX.Element;
|
|
6
16
|
export {};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
declare const STORE:
|
|
1
|
+
declare const STORE: import("justorm/dist/esm/proxy").ProxyStore<{
|
|
2
|
+
items: string[];
|
|
3
|
+
autohide: string[];
|
|
4
|
+
data: {};
|
|
5
|
+
paused: boolean;
|
|
6
|
+
show(data: any): any;
|
|
7
|
+
pause(): void;
|
|
8
|
+
unpause(): void;
|
|
9
|
+
close(id: any): void;
|
|
10
|
+
remove(id: any): void;
|
|
11
|
+
}>;
|
|
2
12
|
export default STORE;
|
|
13
|
+
export type NotificationsStore = typeof STORE;
|
|
@@ -7,6 +7,21 @@ export declare const Router: {
|
|
|
7
7
|
export * from './Route';
|
|
8
8
|
export * from './Redirect';
|
|
9
9
|
export * from './Link/Link';
|
|
10
|
-
export declare const RouterStore:
|
|
10
|
+
export declare const RouterStore: import("justorm/dist/esm/proxy").ProxyStore<{
|
|
11
|
+
path: string;
|
|
12
|
+
params: {};
|
|
13
|
+
query: Record<string, string>;
|
|
14
|
+
queryString: string;
|
|
15
|
+
on(cb: any): void;
|
|
16
|
+
un(cb: any): void;
|
|
17
|
+
go(path?: any, query?: string | Record<string, any>, params?: {
|
|
18
|
+
replace?: boolean;
|
|
19
|
+
}): void;
|
|
20
|
+
setParams(queryParams: Record<string, any>): void;
|
|
21
|
+
back(): void;
|
|
22
|
+
replaceState(href: string, params?: {
|
|
23
|
+
quiet?: boolean;
|
|
24
|
+
}): void;
|
|
25
|
+
}>;
|
|
11
26
|
export declare const RouterContext: import("react").Context<import("./context").ContextType>;
|
|
12
27
|
export type RouterStore = RouterStoreType;
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
type GoParams = {
|
|
2
|
+
replace?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type ReplaceStateParams = {
|
|
5
|
+
quiet?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const STORE: import("justorm/dist/esm/proxy").ProxyStore<{
|
|
8
|
+
path: string;
|
|
9
|
+
params: {};
|
|
10
|
+
query: Record<string, string>;
|
|
11
|
+
queryString: string;
|
|
12
|
+
on(cb: any): void;
|
|
13
|
+
un(cb: any): void;
|
|
14
|
+
go(path?: any, query?: Record<string, any> | string, params?: GoParams): void;
|
|
15
|
+
setParams(queryParams: Record<string, any>): void;
|
|
16
|
+
back(): void;
|
|
17
|
+
replaceState(href: string, params?: ReplaceStateParams): void;
|
|
18
|
+
}>;
|
|
2
19
|
export type RouterStore = typeof STORE;
|
|
3
|
-
declare const _default:
|
|
20
|
+
declare const _default: import("justorm/dist/esm/proxy").ProxyStore<{
|
|
21
|
+
path: string;
|
|
22
|
+
params: {};
|
|
23
|
+
query: Record<string, string>;
|
|
24
|
+
queryString: string;
|
|
25
|
+
on(cb: any): void;
|
|
26
|
+
un(cb: any): void;
|
|
27
|
+
go(path?: any, query?: string | Record<string, any>, params?: GoParams): void;
|
|
28
|
+
setParams(queryParams: Record<string, any>): void;
|
|
29
|
+
back(): void;
|
|
30
|
+
replaceState(href: string, params?: ReplaceStateParams): void;
|
|
31
|
+
}>;
|
|
4
32
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homecode/ui",
|
|
3
|
-
"version": "4.26.
|
|
3
|
+
"version": "4.26.4",
|
|
4
4
|
"description": "React UI components library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tests": "jest",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"fastest-validator": "^1.16.0",
|
|
57
57
|
"favicons": "^7.1.3",
|
|
58
58
|
"favicons-webpack-plugin": "^6.0.0",
|
|
59
|
-
"justorm": "3.0.
|
|
59
|
+
"justorm": "^3.0.2",
|
|
60
60
|
"lodash.omit": "^4.5.0",
|
|
61
61
|
"lodash.pick": "^4.4.0",
|
|
62
62
|
"moment": "^2.29.4",
|