@steroidsjs/core 3.0.0-beta.93 → 3.0.0-beta.95
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/components/ClientStorageComponent.d.ts +12 -18
- package/components/ClientStorageComponent.js +0 -16
- package/components/HtmlComponent.d.ts +26 -2
- package/components/HttpComponent.d.ts +98 -16
- package/components/HttpComponent.js +0 -9
- package/components/JwtHttpComponent.d.ts +20 -5
- package/components/JwtHttpComponent.js +4 -0
- package/components/LocaleComponent.d.ts +12 -12
- package/components/LocaleComponent.js +0 -2
- package/components/MetaComponent.d.ts +30 -93
- package/components/MetricsComponent.d.ts +20 -1
- package/components/MetricsComponent.js +4 -0
- package/components/ResourceComponent.d.ts +9 -15
- package/components/SocialComponent.d.ts +16 -1
- package/components/StoreComponent.d.ts +44 -1
- package/components/UiComponent.d.ts +8 -16
- package/components/WebSocketComponent.d.ts +66 -7
- package/components/WebSocketComponent.js +4 -0
- package/docs-autogen-result.json +13221 -10520
- package/en.json +81 -4
- package/hooks/useApplication.d.ts +22 -6
- package/package.json +1 -1
- package/providers/ComponentsProvider.d.ts +10 -5
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +16 -4
- package/ui/content/CalendarSystem/CalendarSystem.js +10 -15
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.d.ts +12 -0
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +85 -0
- package/ui/content/CalendarSystem/utils/utils.d.ts +3 -1
- package/ui/content/CalendarSystem/utils/utils.js +6 -1
- package/ui/form/Field/Field.js +2 -1
|
@@ -8,11 +8,54 @@ interface IStoreComponentConfig {
|
|
|
8
8
|
initialState: any;
|
|
9
9
|
history: any;
|
|
10
10
|
}
|
|
11
|
+
export interface IStoreComponent {
|
|
12
|
+
/**
|
|
13
|
+
* Редьюсеры
|
|
14
|
+
*/
|
|
15
|
+
reducers: any;
|
|
16
|
+
/**
|
|
17
|
+
* Хранилище
|
|
18
|
+
*/
|
|
19
|
+
store: any;
|
|
20
|
+
/**
|
|
21
|
+
* Инициализация
|
|
22
|
+
*/
|
|
23
|
+
init(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Инициализация хранилища
|
|
26
|
+
*/
|
|
27
|
+
initStore(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Конфигурация
|
|
30
|
+
*/
|
|
31
|
+
configurate(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Метод для dispatch
|
|
34
|
+
*/
|
|
35
|
+
dispatch(action: any): void;
|
|
36
|
+
/**
|
|
37
|
+
* Получение состояние
|
|
38
|
+
*/
|
|
39
|
+
getState(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Подписка
|
|
42
|
+
*/
|
|
43
|
+
subscribe(handler: any): void;
|
|
44
|
+
/**
|
|
45
|
+
* Добавление редьюсеров
|
|
46
|
+
*/
|
|
47
|
+
addReducers(asyncReducers: any): void;
|
|
48
|
+
/**
|
|
49
|
+
* Метод, который вызывается при ошибке
|
|
50
|
+
*/
|
|
51
|
+
errorHandler(error: any, action: any): void;
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}
|
|
11
54
|
/**
|
|
12
55
|
* Store Component
|
|
13
56
|
* Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router
|
|
14
57
|
*/
|
|
15
|
-
export default class StoreComponent {
|
|
58
|
+
export default class StoreComponent implements IStoreComponent {
|
|
16
59
|
_asyncReducers: any;
|
|
17
60
|
_components: any;
|
|
18
61
|
reducers: any;
|
|
@@ -24,14 +24,6 @@ export interface IUiApplicationComponent {
|
|
|
24
24
|
* Компоненты форматтеры для использования в приложении.
|
|
25
25
|
*/
|
|
26
26
|
formatters: any;
|
|
27
|
-
/**
|
|
28
|
-
* Зарегистрированные компоненты полей формы.
|
|
29
|
-
*/
|
|
30
|
-
_registeredFields: any;
|
|
31
|
-
/**
|
|
32
|
-
* Элемент портала.
|
|
33
|
-
*/
|
|
34
|
-
_portalElement: HTMLElement | null;
|
|
35
27
|
/**
|
|
36
28
|
* Добавляет компоненты представлений.
|
|
37
29
|
* @param {any} components - Компоненты представлений.
|
|
@@ -135,22 +127,22 @@ export interface IUiApplicationComponent {
|
|
|
135
127
|
*/
|
|
136
128
|
export default class UiComponent implements IUiApplicationComponent {
|
|
137
129
|
components: IComponents;
|
|
138
|
-
_components
|
|
139
|
-
_models
|
|
130
|
+
private _components;
|
|
131
|
+
private _models;
|
|
140
132
|
icons: {
|
|
141
133
|
[name: string]: string | number | ReactNode;
|
|
142
134
|
} | any;
|
|
143
135
|
fields: any;
|
|
144
136
|
formatters: any;
|
|
145
|
-
_registeredFields
|
|
146
|
-
_portalElement
|
|
137
|
+
private _registeredFields;
|
|
138
|
+
private _portalElement;
|
|
147
139
|
constructor(components: any);
|
|
148
140
|
addViews(components: any): void;
|
|
149
141
|
renderView(Component: any, props: any, forceNode?: boolean): any;
|
|
150
142
|
getView(path: any): any;
|
|
151
143
|
addFields(components: any): void;
|
|
152
144
|
getField(path: any): any;
|
|
153
|
-
getFieldProps(path:
|
|
145
|
+
getFieldProps(path: string, model?: string, attribute?: string): any;
|
|
154
146
|
addFormatters(components: any): void;
|
|
155
147
|
getFormatter(path: any): any;
|
|
156
148
|
getFormatterProps(path: any): any;
|
|
@@ -159,9 +151,9 @@ export default class UiComponent implements IUiApplicationComponent {
|
|
|
159
151
|
addModels(models: any): void;
|
|
160
152
|
registerField(formId: any, attribute: any, type: any): void;
|
|
161
153
|
getRegisteredFields(formId: any): any;
|
|
162
|
-
_add
|
|
163
|
-
_getComponent
|
|
164
|
-
_getPropsConfig
|
|
154
|
+
private _add;
|
|
155
|
+
private _getComponent;
|
|
156
|
+
private _getPropsConfig;
|
|
165
157
|
setPortalElement(element: any): void;
|
|
166
158
|
getPortalElement(): HTMLDivElement;
|
|
167
159
|
}
|
|
@@ -4,9 +4,67 @@
|
|
|
4
4
|
* ответов и токен авторизации
|
|
5
5
|
*/
|
|
6
6
|
import { IComponents } from '../providers/ComponentsProvider';
|
|
7
|
-
|
|
7
|
+
type TStream = string | [string, string | number[]];
|
|
8
|
+
type TStreams = string[] | [string, string | number[]][];
|
|
9
|
+
export interface IWebSocketComponentConfig {
|
|
10
|
+
/**
|
|
11
|
+
* url для websocket
|
|
12
|
+
*/
|
|
13
|
+
wsUrl?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Массив streams
|
|
16
|
+
*/
|
|
17
|
+
streams?: TStreams;
|
|
18
|
+
/**
|
|
19
|
+
* Хендлер для авторизации
|
|
20
|
+
*/
|
|
21
|
+
authHandler?: (components: IComponents) => Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Функция, которая вызывается на открытие соединения
|
|
24
|
+
*/
|
|
25
|
+
onOpen?: (event: any, components: IComponents) => any;
|
|
26
|
+
/**
|
|
27
|
+
* Функция, которая вызывается на закрытие соединения
|
|
28
|
+
*/
|
|
29
|
+
onClose?: (event: any, components: IComponents) => any;
|
|
30
|
+
/**
|
|
31
|
+
* Функция, которая вызывается на отправку сообщения
|
|
32
|
+
*/
|
|
33
|
+
onMessage?: (data: Record<string, unknown>, components: IComponents) => any;
|
|
34
|
+
}
|
|
35
|
+
export interface IWebSocketComponent extends IWebSocketComponentConfig {
|
|
36
|
+
/**
|
|
37
|
+
* Открытие websocket соединения
|
|
38
|
+
*/
|
|
39
|
+
open(closePrevious?: boolean): void;
|
|
40
|
+
/**
|
|
41
|
+
* Закрытие websocket соединения
|
|
42
|
+
*/
|
|
43
|
+
close(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Подписка на stream
|
|
46
|
+
*/
|
|
47
|
+
subscribeStream(stream: TStream, id: string | number): void;
|
|
48
|
+
/**
|
|
49
|
+
* Подписка на streams
|
|
50
|
+
*/
|
|
51
|
+
subscribe(streams: TStreams): void;
|
|
52
|
+
/**
|
|
53
|
+
* Отписка от stream
|
|
54
|
+
*/
|
|
55
|
+
unsubscribeStream(stream: TStream, id: string | number): void;
|
|
56
|
+
/**
|
|
57
|
+
* Отписка от streams
|
|
58
|
+
*/
|
|
59
|
+
unsubscribe(streams: TStreams): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* WebSocket Component
|
|
63
|
+
* Компонент для создания websocket взаимодействия
|
|
64
|
+
*/
|
|
65
|
+
export default class WebSocketComponent implements IWebSocketComponent {
|
|
8
66
|
wsUrl: string;
|
|
9
|
-
streams:
|
|
67
|
+
streams: TStreams;
|
|
10
68
|
authHandler: (components: IComponents) => Promise<string>;
|
|
11
69
|
onOpen: (event: any, components: IComponents) => any;
|
|
12
70
|
onClose: (event: any, components: IComponents) => any;
|
|
@@ -23,9 +81,10 @@ export default class WebSocketComponent {
|
|
|
23
81
|
subscribe(streams: any): void;
|
|
24
82
|
unsubscribeStream(stream: any, id: any): void;
|
|
25
83
|
unsubscribe(streams: any): void;
|
|
26
|
-
_connect
|
|
27
|
-
_reConnect
|
|
28
|
-
_onOpen
|
|
29
|
-
_onMessage
|
|
30
|
-
_onClose
|
|
84
|
+
private _connect;
|
|
85
|
+
private _reConnect;
|
|
86
|
+
private _onOpen;
|
|
87
|
+
private _onMessage;
|
|
88
|
+
private _onClose;
|
|
31
89
|
}
|
|
90
|
+
export {};
|
|
@@ -37,6 +37,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
39
|
var getStreamName = function (stream) { return Array.isArray(stream) ? stream[0] : stream; };
|
|
40
|
+
/**
|
|
41
|
+
* WebSocket Component
|
|
42
|
+
* Компонент для создания websocket взаимодействия
|
|
43
|
+
*/
|
|
40
44
|
var WebSocketComponent = /** @class */ (function () {
|
|
41
45
|
function WebSocketComponent(components, config) {
|
|
42
46
|
this.wsUrl = config.wsUrl || null;
|