@steroidsjs/core 3.0.7 → 3.0.9

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.
@@ -2,22 +2,24 @@
2
2
  export interface IHtmlComponent {
3
3
  /**
4
4
  * Утилита для создания css-классов по БЭМ
5
+ * @param blockName Название блока.
5
6
  */
6
7
  bem(blockName: string): any;
7
8
  /**
8
9
  * Метод для соединения нескольких classNames
10
+ * @param names Массив названий классов.
9
11
  */
10
12
  classNames(...names: string[]): string;
11
13
  /**
12
14
  * Метод для добавления css-класса к элементу
13
- * @param node Элемент, к которому нужно добавить класс
14
- * @param className Название класса
15
+ * @param node Элемент, к которому нужно добавить класс.
16
+ * @param className Название класса.
15
17
  */
16
18
  addClass(node: React.ReactNode, className: string): void;
17
19
  /**
18
20
  * Метод для удаления css-класса у элемента
19
- * @param node Элемент, у которого нужно удалить класс
20
- * @param className Название класса
21
+ * @param node Элемент, у которого нужно удалить класс.
22
+ * @param className Название класса.
21
23
  */
22
24
  removeClass(node: React.ReactNode, className: string): void;
23
25
  closest(element: any, className: string): any;
@@ -30,7 +30,7 @@ export interface IHttpComponent extends IHttpComponentConfig {
30
30
  getAxiosConfig(): Promise<any>;
31
31
  /**
32
32
  * Изменение csrf токена
33
- * @param {string} value
33
+ * @param {string} value Значение csrf токена.
34
34
  */
35
35
  setCsrfToken(value: string): void;
36
36
  /**
@@ -39,7 +39,7 @@ export interface IHttpComponent extends IHttpComponentConfig {
39
39
  removeAccessToken(): void;
40
40
  /**
41
41
  * Изменение токена
42
- * @param {string} value
42
+ * @param {string} value Значение токена.
43
43
  */
44
44
  setAccessToken(value: string): any;
45
45
  /**
@@ -57,14 +57,14 @@ export interface IHttpComponent extends IHttpComponentConfig {
57
57
  onLogout(): void;
58
58
  /**
59
59
  * Метод, который можно вызвать при login
60
- * @param {{accessToken: string}} params
60
+ * @param {{accessToken: string}} params Параметры для авторизации (accessToken).
61
61
  */
62
62
  onLogin(params: {
63
63
  accessToken: string;
64
64
  }): void;
65
65
  /**
66
66
  * Получение url по методу
67
- * @param {string} method
67
+ * @param {string} method Метод.
68
68
  * @returns {string} url
69
69
  */
70
70
  getUrl(method: string): string;
@@ -75,22 +75,38 @@ export interface IHttpComponent extends IHttpComponentConfig {
75
75
  getAxiosInstance(): Promise<any>;
76
76
  /**
77
77
  * Вызов метода get
78
+ * @param url URL для HTTP-запроса.
79
+ * @param params Параметры для запроса.
80
+ * @param options Опции для HTTP-запроса, заголовки и т.д.
78
81
  */
79
82
  get(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
80
83
  /**
81
84
  * Вызов метода post
85
+ * @param url URL для HTTP-запроса.
86
+ * @param params Параметры для запроса.
87
+ * @param options Опции для HTTP-запроса, заголовки и т.д.
82
88
  */
83
89
  post(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
84
90
  /**
85
91
  * Вызов метода delete
92
+ * @param url URL для HTTP-запроса.
93
+ * @param params Параметры для запроса.
94
+ * @param options Опции для HTTP-запроса, заголовки и т.д.
86
95
  */
87
96
  delete(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
88
97
  /**
89
98
  * Вызов http-метода
99
+ * @param method Метод запроса (GET, POST и т.д.).
100
+ * @param url URL для HTTP-запроса.
101
+ * @param params Параметры для запроса.
102
+ * @param options Опции для HTTP-запроса, заголовки и т.д.
90
103
  */
91
104
  send(method: string, url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
92
105
  /**
93
106
  * Метод, который вызывается после запроса
107
+ * @param response Ответ, полученный после выполнения HTTP-запроса.
108
+ * @param config Конфиг запроса.
109
+ * @param options Опции для HTTP-запроса, заголовки и т.д.
94
110
  */
95
111
  afterRequest(response: any, config: Record<string, any>, options: IHttpRequestOptions): Promise<any>;
96
112
  [key: string]: any;
@@ -30,22 +30,22 @@ export interface ILocaleComponentConfig {
30
30
  export interface ILocaleComponent extends ILocaleComponentConfig {
31
31
  /**
32
32
  * Получение экземпляра `dayjs` с учетом временной зоны бекенда
33
- * @param date Дата
34
- * @param format Формат даты
33
+ * @param date Дата.
34
+ * @param format Формат даты.
35
35
  * @returns Экземпляр `dayjs`
36
36
  */
37
37
  dayjs(date?: string, format?: string): dayjs.Dayjs;
38
38
  /**
39
39
  * Алиас для метода `translate`
40
- * @param message Сообщение для перевода
41
- * @param params Параметры перевода
40
+ * @param message Сообщение для перевода.
41
+ * @param params Параметры перевода.
42
42
  * @returns Переведенное сообщение
43
43
  */
44
44
  t(message: string, params?: Record<string, any>): string;
45
45
  /**
46
46
  * Перевод сообщения
47
- * @param message Сообщение для перевода
48
- * @param params Параметры перевода
47
+ * @param message Сообщение для перевода.
48
+ * @param params Параметры перевода.
49
49
  * @returns Переведенное сообщение
50
50
  */
51
51
  translate(message: string, params?: Record<string, any>): string;
@@ -26,26 +26,35 @@ export interface ModelAttribute {
26
26
  export interface IMetaComponent {
27
27
  /**
28
28
  * Изменить модель
29
+ * @param name Имя модели.
30
+ * @param item Модель.
29
31
  */
30
32
  setModel(name: string, item: Model): void;
31
33
  /**
32
34
  * Получить модель
35
+ * @param name Имя модели.
33
36
  */
34
37
  getModel(name: string): Model;
35
38
  /**
36
39
  * Изменить тип
40
+ * @param name Имя типа.
41
+ * @param config Конфиг.
37
42
  */
38
43
  setType(name: string, config: Record<string, any>): void;
39
44
  /**
40
45
  * Получить тип
46
+ * @param name Имя типа.
41
47
  */
42
48
  getType(name: string): any;
43
49
  /**
44
50
  * Форматирование названия модели
51
+ * @param name Имя модели.
45
52
  */
46
53
  normalizeName(name: string): string;
47
54
  /**
48
55
  * Форматирование модели модели
56
+ * @param inputModel Модель.
57
+ * @param defaultModel Модель по-умолчанию.
49
58
  */
50
59
  normalizeModel(inputModel: Model, defaultModel: Model | any): Model;
51
60
  }
@@ -28,7 +28,7 @@ export interface IMetricsComponent {
28
28
  unlisten: VoidFunction;
29
29
  /**
30
30
  * Поменять счетчики
31
- * @param values Значения
31
+ * @param values Значения.
32
32
  */
33
33
  setCounters(values: any): void;
34
34
  }
@@ -5,7 +5,7 @@ export interface ISocialComponent {
5
5
  providers: any;
6
6
  /**
7
7
  * Старт
8
- * @param socialName Название social
8
+ * @param socialName Название social.
9
9
  */
10
10
  start(socialName: string): void;
11
11
  /**
@@ -31,29 +31,34 @@ export interface IStoreComponent {
31
31
  configurate(): void;
32
32
  /**
33
33
  * Метод для dispatch
34
+ * @param action Экшен для изменения состояния.
34
35
  */
35
36
  dispatch(action: any): void;
36
37
  /**
37
- * Получение состояние
38
+ * Получение состояния
38
39
  */
39
40
  getState(): void;
40
41
  /**
41
42
  * Подписка
43
+ * @param handler Обработчик изменения состояния.
42
44
  */
43
45
  subscribe(handler: any): void;
44
46
  /**
45
47
  * Добавление редьюсеров
48
+ * @param asyncReducers Коллекция редьюсеров.
46
49
  */
47
50
  addReducers(asyncReducers: any): void;
48
51
  /**
49
52
  * Метод, который вызывается при ошибке
53
+ * @param error Объект ошибки.
54
+ * @param action Callback функция вызываемая при ошибке.
50
55
  */
51
56
  errorHandler(error: any, action: any): void;
52
57
  [key: string]: any;
53
58
  }
54
59
  /**
55
60
  * Store Component
56
- * Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router
61
+ * Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router.
57
62
  */
58
63
  export default class StoreComponent implements IStoreComponent {
59
64
  _asyncReducers: any;
@@ -23,7 +23,7 @@ var merge_1 = __importDefault(require("lodash-es/merge"));
23
23
  var isPlainObject_1 = __importDefault(require("lodash-es/isPlainObject"));
24
24
  /**
25
25
  * Store Component
26
- * Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router
26
+ * Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router.
27
27
  */
28
28
  var StoreComponent = /** @class */ (function () {
29
29
  function StoreComponent(components, config, lazyInit) {
@@ -35,6 +35,7 @@ export interface IWebSocketComponentConfig {
35
35
  export interface IWebSocketComponent extends IWebSocketComponentConfig {
36
36
  /**
37
37
  * Открытие websocket соединения
38
+ * @param closePrevious Флаг для закрытия предыдущего соединения.
38
39
  */
39
40
  open(closePrevious?: boolean): void;
40
41
  /**
@@ -43,18 +44,24 @@ export interface IWebSocketComponent extends IWebSocketComponentConfig {
43
44
  close(): void;
44
45
  /**
45
46
  * Подписка на stream
47
+ * @param stream Поток, на который нужно подписаться.
48
+ * @param id Идентификатор потока.
46
49
  */
47
50
  subscribeStream(stream: TStream, id: string | number): void;
48
51
  /**
49
52
  * Подписка на streams
53
+ * @param streams Потоки, на которые нужно подписаться.
50
54
  */
51
55
  subscribe(streams: TStreams): void;
52
56
  /**
53
57
  * Отписка от stream
58
+ * @param stream Поток, от которого нужно подписаться.
59
+ * @param id Идентификатор потока.
54
60
  */
55
61
  unsubscribeStream(stream: TStream, id: string | number): void;
56
62
  /**
57
63
  * Отписка от streams
64
+ * @param streams Потоки, от которых нужно подписаться.
58
65
  */
59
66
  unsubscribe(streams: TStreams): void;
60
67
  }
@@ -437,7 +437,7 @@
437
437
  {
438
438
  "name": "node",
439
439
  "decorators": [],
440
- "description": "Элемент, к которому нужно добавить класс",
440
+ "description": "Элемент, к которому нужно добавить класс.",
441
441
  "required": true,
442
442
  "type": "ReactNode",
443
443
  "example": null
@@ -445,7 +445,7 @@
445
445
  {
446
446
  "name": "className",
447
447
  "decorators": [],
448
- "description": "Название класса\n",
448
+ "description": "Название класса.\n",
449
449
  "required": true,
450
450
  "type": "string",
451
451
  "example": null
@@ -463,7 +463,7 @@
463
463
  {
464
464
  "name": "blockName",
465
465
  "decorators": [],
466
- "description": "",
466
+ "description": "Название блока.\n",
467
467
  "required": true,
468
468
  "type": "string",
469
469
  "example": null
@@ -481,7 +481,7 @@
481
481
  {
482
482
  "name": "names",
483
483
  "decorators": [],
484
- "description": "",
484
+ "description": "Массив названий классов.\n",
485
485
  "required": true,
486
486
  "type": "string[]",
487
487
  "example": null
@@ -499,7 +499,7 @@
499
499
  {
500
500
  "name": "node",
501
501
  "decorators": [],
502
- "description": "Элемент, у которого нужно удалить класс",
502
+ "description": "Элемент, у которого нужно удалить класс.",
503
503
  "required": true,
504
504
  "type": "ReactNode",
505
505
  "example": null
@@ -507,7 +507,7 @@
507
507
  {
508
508
  "name": "className",
509
509
  "decorators": [],
510
- "description": "Название класса\n",
510
+ "description": "Название класса.\n",
511
511
  "required": true,
512
512
  "type": "string",
513
513
  "example": null
@@ -572,7 +572,7 @@
572
572
  {
573
573
  "name": "response",
574
574
  "decorators": [],
575
- "description": "",
575
+ "description": "Ответ, полученный после выполнения HTTP-запроса.",
576
576
  "required": true,
577
577
  "type": "any",
578
578
  "example": null
@@ -580,7 +580,7 @@
580
580
  {
581
581
  "name": "config",
582
582
  "decorators": [],
583
- "description": "",
583
+ "description": "Конфиг запроса.",
584
584
  "required": true,
585
585
  "type": "Record",
586
586
  "example": null
@@ -588,7 +588,7 @@
588
588
  {
589
589
  "name": "options",
590
590
  "decorators": [],
591
- "description": "",
591
+ "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
592
592
  "required": true,
593
593
  "type": "IHttpRequestOptions",
594
594
  "example": null
@@ -606,7 +606,7 @@
606
606
  {
607
607
  "name": "url",
608
608
  "decorators": [],
609
- "description": "",
609
+ "description": "URL для HTTP-запроса.",
610
610
  "required": true,
611
611
  "type": "string",
612
612
  "example": null
@@ -614,7 +614,7 @@
614
614
  {
615
615
  "name": "params",
616
616
  "decorators": [],
617
- "description": "",
617
+ "description": "Параметры для запроса.",
618
618
  "required": false,
619
619
  "type": "Record",
620
620
  "example": null
@@ -622,7 +622,7 @@
622
622
  {
623
623
  "name": "options",
624
624
  "decorators": [],
625
- "description": "",
625
+ "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
626
626
  "required": false,
627
627
  "type": "IHttpRequestOptions",
628
628
  "example": null
@@ -640,7 +640,7 @@
640
640
  {
641
641
  "name": "url",
642
642
  "decorators": [],
643
- "description": "",
643
+ "description": "URL для HTTP-запроса.",
644
644
  "required": true,
645
645
  "type": "string",
646
646
  "example": null
@@ -648,7 +648,7 @@
648
648
  {
649
649
  "name": "params",
650
650
  "decorators": [],
651
- "description": "",
651
+ "description": "Параметры для запроса.",
652
652
  "required": false,
653
653
  "type": "Record",
654
654
  "example": null
@@ -656,7 +656,7 @@
656
656
  {
657
657
  "name": "options",
658
658
  "decorators": [],
659
- "description": "",
659
+ "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
660
660
  "required": false,
661
661
  "type": "IHttpRequestOptions",
662
662
  "example": null
@@ -701,7 +701,7 @@
701
701
  {
702
702
  "name": "method",
703
703
  "decorators": [],
704
- "description": "",
704
+ "description": "Метод.",
705
705
  "required": true,
706
706
  "type": "string",
707
707
  "example": null
@@ -719,7 +719,7 @@
719
719
  {
720
720
  "name": "params",
721
721
  "decorators": [],
722
- "description": "\n",
722
+ "description": "Параметры для авторизации (accessToken).\n",
723
723
  "required": true,
724
724
  "type": "{accessToken: string}",
725
725
  "example": null
@@ -746,7 +746,7 @@
746
746
  {
747
747
  "name": "url",
748
748
  "decorators": [],
749
- "description": "",
749
+ "description": "URL для HTTP-запроса.",
750
750
  "required": true,
751
751
  "type": "string",
752
752
  "example": null
@@ -754,7 +754,7 @@
754
754
  {
755
755
  "name": "params",
756
756
  "decorators": [],
757
- "description": "",
757
+ "description": "Параметры для запроса.",
758
758
  "required": false,
759
759
  "type": "Record",
760
760
  "example": null
@@ -762,7 +762,7 @@
762
762
  {
763
763
  "name": "options",
764
764
  "decorators": [],
765
- "description": "",
765
+ "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
766
766
  "required": false,
767
767
  "type": "IHttpRequestOptions",
768
768
  "example": null
@@ -798,7 +798,7 @@
798
798
  {
799
799
  "name": "method",
800
800
  "decorators": [],
801
- "description": "",
801
+ "description": "Метод запроса (GET, POST и т.д.).",
802
802
  "required": true,
803
803
  "type": "string",
804
804
  "example": null
@@ -806,7 +806,7 @@
806
806
  {
807
807
  "name": "url",
808
808
  "decorators": [],
809
- "description": "",
809
+ "description": "URL для HTTP-запроса.",
810
810
  "required": true,
811
811
  "type": "string",
812
812
  "example": null
@@ -814,7 +814,7 @@
814
814
  {
815
815
  "name": "params",
816
816
  "decorators": [],
817
- "description": "",
817
+ "description": "Параметры для запроса.",
818
818
  "required": false,
819
819
  "type": "Record",
820
820
  "example": null
@@ -822,7 +822,7 @@
822
822
  {
823
823
  "name": "options",
824
824
  "decorators": [],
825
- "description": "",
825
+ "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
826
826
  "required": false,
827
827
  "type": "IHttpRequestOptions",
828
828
  "example": null
@@ -840,7 +840,7 @@
840
840
  {
841
841
  "name": "value",
842
842
  "decorators": [],
843
- "description": "\n",
843
+ "description": "Значение токена.\n",
844
844
  "required": true,
845
845
  "type": "string",
846
846
  "example": null
@@ -858,7 +858,7 @@
858
858
  {
859
859
  "name": "value",
860
860
  "decorators": [],
861
- "description": "\n",
861
+ "description": "Значение csrf токена.\n",
862
862
  "required": true,
863
863
  "type": "string",
864
864
  "example": null
@@ -1014,7 +1014,7 @@
1014
1014
  {
1015
1015
  "name": "date",
1016
1016
  "decorators": [],
1017
- "description": "Дата",
1017
+ "description": "Дата.",
1018
1018
  "required": false,
1019
1019
  "type": "string",
1020
1020
  "example": null
@@ -1022,7 +1022,7 @@
1022
1022
  {
1023
1023
  "name": "format",
1024
1024
  "decorators": [],
1025
- "description": "Формат даты",
1025
+ "description": "Формат даты.",
1026
1026
  "required": false,
1027
1027
  "type": "string",
1028
1028
  "example": null
@@ -1040,7 +1040,7 @@
1040
1040
  {
1041
1041
  "name": "message",
1042
1042
  "decorators": [],
1043
- "description": "Сообщение для перевода",
1043
+ "description": "Сообщение для перевода.",
1044
1044
  "required": true,
1045
1045
  "type": "string",
1046
1046
  "example": null
@@ -1048,7 +1048,7 @@
1048
1048
  {
1049
1049
  "name": "params",
1050
1050
  "decorators": [],
1051
- "description": "Параметры перевода",
1051
+ "description": "Параметры перевода.",
1052
1052
  "required": false,
1053
1053
  "type": "Record",
1054
1054
  "example": null
@@ -1066,7 +1066,7 @@
1066
1066
  {
1067
1067
  "name": "message",
1068
1068
  "decorators": [],
1069
- "description": "Сообщение для перевода",
1069
+ "description": "Сообщение для перевода.",
1070
1070
  "required": true,
1071
1071
  "type": "string",
1072
1072
  "example": null
@@ -1074,7 +1074,7 @@
1074
1074
  {
1075
1075
  "name": "params",
1076
1076
  "decorators": [],
1077
- "description": "Параметры перевода",
1077
+ "description": "Параметры перевода.",
1078
1078
  "required": false,
1079
1079
  "type": "Record",
1080
1080
  "example": null
@@ -1156,7 +1156,7 @@
1156
1156
  {
1157
1157
  "name": "name",
1158
1158
  "decorators": [],
1159
- "description": "",
1159
+ "description": "Имя модели.\n",
1160
1160
  "required": true,
1161
1161
  "type": "string",
1162
1162
  "example": null
@@ -1174,7 +1174,7 @@
1174
1174
  {
1175
1175
  "name": "name",
1176
1176
  "decorators": [],
1177
- "description": "",
1177
+ "description": "Имя типа.\n",
1178
1178
  "required": true,
1179
1179
  "type": "string",
1180
1180
  "example": null
@@ -1192,7 +1192,7 @@
1192
1192
  {
1193
1193
  "name": "inputModel",
1194
1194
  "decorators": [],
1195
- "description": "",
1195
+ "description": "Модель.",
1196
1196
  "required": true,
1197
1197
  "type": "Model",
1198
1198
  "example": null
@@ -1200,7 +1200,7 @@
1200
1200
  {
1201
1201
  "name": "defaultModel",
1202
1202
  "decorators": [],
1203
- "description": "",
1203
+ "description": "Модель по-умолчанию.\n",
1204
1204
  "required": true,
1205
1205
  "type": "any",
1206
1206
  "example": null
@@ -1218,7 +1218,7 @@
1218
1218
  {
1219
1219
  "name": "name",
1220
1220
  "decorators": [],
1221
- "description": "",
1221
+ "description": "Имя модели.\n",
1222
1222
  "required": true,
1223
1223
  "type": "string",
1224
1224
  "example": null
@@ -1236,7 +1236,7 @@
1236
1236
  {
1237
1237
  "name": "name",
1238
1238
  "decorators": [],
1239
- "description": "",
1239
+ "description": "Имя модели.",
1240
1240
  "required": true,
1241
1241
  "type": "string",
1242
1242
  "example": null
@@ -1244,7 +1244,7 @@
1244
1244
  {
1245
1245
  "name": "item",
1246
1246
  "decorators": [],
1247
- "description": "",
1247
+ "description": "Модель.\n",
1248
1248
  "required": true,
1249
1249
  "type": "Model",
1250
1250
  "example": null
@@ -1262,7 +1262,7 @@
1262
1262
  {
1263
1263
  "name": "name",
1264
1264
  "decorators": [],
1265
- "description": "",
1265
+ "description": "Имя типа.",
1266
1266
  "required": true,
1267
1267
  "type": "string",
1268
1268
  "example": null
@@ -1270,7 +1270,7 @@
1270
1270
  {
1271
1271
  "name": "config",
1272
1272
  "decorators": [],
1273
- "description": "",
1273
+ "description": "Конфиг.\n",
1274
1274
  "required": true,
1275
1275
  "type": "Record",
1276
1276
  "example": null
@@ -1339,7 +1339,7 @@
1339
1339
  {
1340
1340
  "name": "values",
1341
1341
  "decorators": [],
1342
- "description": "Значения\n",
1342
+ "description": "Значения.\n",
1343
1343
  "required": true,
1344
1344
  "type": "any",
1345
1345
  "example": null
@@ -1599,7 +1599,7 @@
1599
1599
  {
1600
1600
  "name": "socialName",
1601
1601
  "decorators": [],
1602
- "description": "Название social\n",
1602
+ "description": "Название social.\n",
1603
1603
  "required": true,
1604
1604
  "type": "string",
1605
1605
  "example": null
@@ -1646,7 +1646,7 @@
1646
1646
  {
1647
1647
  "name": "asyncReducers",
1648
1648
  "decorators": [],
1649
- "description": "",
1649
+ "description": "Коллекция редьюсеров.\n",
1650
1650
  "required": true,
1651
1651
  "type": "any",
1652
1652
  "example": null
@@ -1673,7 +1673,7 @@
1673
1673
  {
1674
1674
  "name": "action",
1675
1675
  "decorators": [],
1676
- "description": "",
1676
+ "description": "Экшен для изменения состояния.\n",
1677
1677
  "required": true,
1678
1678
  "type": "any",
1679
1679
  "example": null
@@ -1691,7 +1691,7 @@
1691
1691
  {
1692
1692
  "name": "error",
1693
1693
  "decorators": [],
1694
- "description": "",
1694
+ "description": "Объект ошибки.",
1695
1695
  "required": true,
1696
1696
  "type": "any",
1697
1697
  "example": null
@@ -1699,7 +1699,7 @@
1699
1699
  {
1700
1700
  "name": "action",
1701
1701
  "decorators": [],
1702
- "description": "",
1702
+ "description": "Callback функция вызываемая при ошибке.\n",
1703
1703
  "required": true,
1704
1704
  "type": "any",
1705
1705
  "example": null
@@ -1709,7 +1709,7 @@
1709
1709
  {
1710
1710
  "name": "getState",
1711
1711
  "decorators": [],
1712
- "description": "Получение состояние",
1712
+ "description": "Получение состояния",
1713
1713
  "required": false,
1714
1714
  "type": "void",
1715
1715
  "example": null,
@@ -1744,7 +1744,7 @@
1744
1744
  {
1745
1745
  "name": "handler",
1746
1746
  "decorators": [],
1747
- "description": "",
1747
+ "description": "Обработчик изменения состояния.\n",
1748
1748
  "required": true,
1749
1749
  "type": "any",
1750
1750
  "example": null
@@ -2270,7 +2270,7 @@
2270
2270
  {
2271
2271
  "name": "closePrevious",
2272
2272
  "decorators": [],
2273
- "description": "",
2273
+ "description": "Флаг для закрытия предыдущего соединения.\n",
2274
2274
  "required": false,
2275
2275
  "type": "boolean",
2276
2276
  "example": null
@@ -2288,7 +2288,7 @@
2288
2288
  {
2289
2289
  "name": "streams",
2290
2290
  "decorators": [],
2291
- "description": "",
2291
+ "description": "Потоки, на которые нужно подписаться.\n",
2292
2292
  "required": true,
2293
2293
  "type": "TStreams",
2294
2294
  "example": null
@@ -2306,7 +2306,7 @@
2306
2306
  {
2307
2307
  "name": "stream",
2308
2308
  "decorators": [],
2309
- "description": "",
2309
+ "description": "Поток, на который нужно подписаться.",
2310
2310
  "required": true,
2311
2311
  "type": "TStream",
2312
2312
  "example": null
@@ -2314,7 +2314,7 @@
2314
2314
  {
2315
2315
  "name": "id",
2316
2316
  "decorators": [],
2317
- "description": "",
2317
+ "description": "Идентификатор потока.\n",
2318
2318
  "required": true,
2319
2319
  "type": "string | number",
2320
2320
  "example": null
@@ -2332,7 +2332,7 @@
2332
2332
  {
2333
2333
  "name": "streams",
2334
2334
  "decorators": [],
2335
- "description": "",
2335
+ "description": "Потоки, от которых нужно подписаться.\n",
2336
2336
  "required": true,
2337
2337
  "type": "TStreams",
2338
2338
  "example": null
@@ -2350,7 +2350,7 @@
2350
2350
  {
2351
2351
  "name": "stream",
2352
2352
  "decorators": [],
2353
- "description": "",
2353
+ "description": "Поток, от которого нужно подписаться.",
2354
2354
  "required": true,
2355
2355
  "type": "TStream",
2356
2356
  "example": null
@@ -2358,7 +2358,7 @@
2358
2358
  {
2359
2359
  "name": "id",
2360
2360
  "decorators": [],
2361
- "description": "",
2361
+ "description": "Идентификатор потока.\n",
2362
2362
  "required": true,
2363
2363
  "type": "string | number",
2364
2364
  "example": null
@@ -4526,6 +4526,14 @@
4526
4526
  "type": "React.ReactNode | {}",
4527
4527
  "example": "MyCustomView"
4528
4528
  },
4529
+ {
4530
+ "name": "viewProps",
4531
+ "decorators": [],
4532
+ "description": "Дополнительный свойства для view части компонента",
4533
+ "required": false,
4534
+ "type": "Record",
4535
+ "example": null
4536
+ },
4529
4537
  {
4530
4538
  "name": "visible",
4531
4539
  "decorators": [],
@@ -4926,6 +4934,14 @@
4926
4934
  "type": "React.ReactNode | {}",
4927
4935
  "example": "MyCustomView"
4928
4936
  },
4937
+ {
4938
+ "name": "viewProps",
4939
+ "decorators": [],
4940
+ "description": "Дополнительный свойства для view части компонента",
4941
+ "required": false,
4942
+ "type": "Record",
4943
+ "example": null
4944
+ },
4929
4945
  {
4930
4946
  "name": "visible",
4931
4947
  "decorators": [],
@@ -14120,6 +14136,15 @@
14120
14136
  "type": "React.ReactNode | {}",
14121
14137
  "example": "MyCustomView",
14122
14138
  "defaultValue": null
14139
+ },
14140
+ {
14141
+ "name": "viewProps",
14142
+ "decorators": [],
14143
+ "description": "Дополнительный свойства для view части компонента",
14144
+ "required": false,
14145
+ "type": "Record",
14146
+ "example": null,
14147
+ "defaultValue": null
14123
14148
  }
14124
14149
  ],
14125
14150
  "methods": [
@@ -14385,6 +14410,14 @@
14385
14410
  "required": false,
14386
14411
  "type": "React.ReactNode | {}",
14387
14412
  "example": "MyCustomView"
14413
+ },
14414
+ {
14415
+ "name": "viewProps",
14416
+ "decorators": [],
14417
+ "description": "Дополнительный свойства для view части компонента",
14418
+ "required": false,
14419
+ "type": "Record",
14420
+ "example": null
14388
14421
  }
14389
14422
  ],
14390
14423
  "methods": []
@@ -32086,6 +32119,14 @@
32086
32119
  "type": "React.ReactNode | {}",
32087
32120
  "example": "MyCustomView"
32088
32121
  },
32122
+ {
32123
+ "name": "viewProps",
32124
+ "decorators": [],
32125
+ "description": "Дополнительный свойства для view части компонента",
32126
+ "required": false,
32127
+ "type": "Record",
32128
+ "example": null
32129
+ },
32089
32130
  {
32090
32131
  "name": "visible",
32091
32132
  "decorators": [],
@@ -33336,6 +33377,14 @@
33336
33377
  "type": "React.ReactNode | {}",
33337
33378
  "example": "MyCustomView"
33338
33379
  },
33380
+ {
33381
+ "name": "viewProps",
33382
+ "decorators": [],
33383
+ "description": "Дополнительный свойства для view части компонента",
33384
+ "required": false,
33385
+ "type": "Record",
33386
+ "example": null
33387
+ },
33339
33388
  {
33340
33389
  "name": "visible",
33341
33390
  "decorators": [],
@@ -37671,6 +37720,14 @@
37671
37720
  "type": "React.ReactNode | {}",
37672
37721
  "example": "MyCustomView"
37673
37722
  },
37723
+ {
37724
+ "name": "viewProps",
37725
+ "decorators": [],
37726
+ "description": "Дополнительный свойства для view части компонента",
37727
+ "required": false,
37728
+ "type": "Record",
37729
+ "example": null
37730
+ },
37674
37731
  {
37675
37732
  "name": "visible",
37676
37733
  "decorators": [],
@@ -38048,6 +38105,15 @@
38048
38105
  "type": "React.ReactNode | {}",
38049
38106
  "example": "MyCustomView",
38050
38107
  "defaultValue": null
38108
+ },
38109
+ {
38110
+ "name": "viewProps",
38111
+ "decorators": [],
38112
+ "description": "Дополнительный свойства для view части компонента",
38113
+ "required": false,
38114
+ "type": "Record",
38115
+ "example": null,
38116
+ "defaultValue": null
38051
38117
  }
38052
38118
  ],
38053
38119
  "methods": [
@@ -38338,6 +38404,14 @@
38338
38404
  "type": "React.ReactNode | {}",
38339
38405
  "example": "MyCustomView"
38340
38406
  },
38407
+ {
38408
+ "name": "viewProps",
38409
+ "decorators": [],
38410
+ "description": "Дополнительный свойства для view части компонента",
38411
+ "required": false,
38412
+ "type": "Record",
38413
+ "example": null
38414
+ },
38341
38415
  {
38342
38416
  "name": "visible",
38343
38417
  "decorators": [],
@@ -41552,7 +41626,7 @@
41552
41626
  "name": "default",
41553
41627
  "moduleName": "components/StoreComponent",
41554
41628
  "title": "Store Component",
41555
- "description": "Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router",
41629
+ "description": "Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router.",
41556
41630
  "tags": {},
41557
41631
  "properties": [
41558
41632
  {
@@ -41647,7 +41721,7 @@
41647
41721
  {
41648
41722
  "name": "getState",
41649
41723
  "decorators": [],
41650
- "description": "Получение состояние",
41724
+ "description": "Получение состояния",
41651
41725
  "required": false,
41652
41726
  "type": "any",
41653
41727
  "example": null,
package/en.json CHANGED
@@ -979,6 +979,7 @@
979
979
  "Скрыть иконку c лева от элемента": "",
980
980
  "\nКомпонент `Kanban` позволяет создать доску для управления задачами.\nКоличество столбцов задается с помощью пропа `columns`.\nЗадачи на доске можно создавать, редактировать и перемещать с визуальным отображением.\n\nДля работы этого компонента необходимо установить в проекте зависимости `react-beautiful-dnd`\nи передать в пропсы `droppableComponent`, `draggableComponent` и `dndContext`\nкомпоненты `Droppable`, `Draggable` и `DragDropContext` соответственно.\n\nДля корректной работы функционала создания задач,\nнеобходимо установить в проекте зависимости `@ckeditor/ckeditor5-react` и `@steroidsjs/ckeditor5`,\nзатем импортировать `CKEditor` из `@ckeditor/ckeditor5-react` и `ClassicEditor` из `@steroidsjs/ckeditor5/packages/ckeditor5-build-classic`.\nИмпортированные компоненты нужно передать в проп `createTaskEditorConfig`,\nв поле `htmlComponent` передать `CKEditor`, а в `editorConstructor` передать `ClassicEditor`.\n": "",
981
981
  "Компонент для создания HTML-разметки, использующий WYSIWYG редактор.\n\nДля использования WYSIWYG редактора, необходимо установить в проекте зависимости `@ckeditor/ckeditor5-react` и `@steroidsjs/ckeditor5`,\nзатем импортировать `CKEditor` из `@ckeditor/ckeditor5-react` и `ClassicEditor` из `@steroidsjs/ckeditor5/packages/ckeditor5-build-classic`.\nКомпонент `CKEditor` нужно передать в проп `htmlComponent`, а конструктор `ClassicEditor` в проп `editorConstructor`.\n\nПри передаче `HtmlField` с бэкенда, необходимо переопределить `view` компонента, указав локальный.\nВ локальном компоненте добавить вместо пропсов `htmlComponent` и `editorConstructor` импорты `CKEditor` и `ClassicEditor` соотвественно.\n": "",
982
+ "Дополнительный свойства для view части компонента": "",
982
983
  "Идентификатор (ключ) для сохранения в LocalStorage коллекции.": "",
983
984
  "Сохранение в localStorage уровней вложенности.": "",
984
985
  "Компоненты для подключения wysiwyg редактора": "",
@@ -989,5 +990,6 @@
989
990
  "Компонент редактора 'ckeditor5-react' из библиотеки @ckeditor\nПримечание: для использования встроенного отображения 'HtmlField', данный компонент должен быть передан": "",
990
991
  "Допустимое количество символов после разделителя": "",
991
992
  "CSS-класс для элемента навигации.": "",
992
- "Тип данных для параметров маршрута.": ""
993
+ "Тип данных для параметров маршрута.": "",
994
+ "Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router.": ""
993
995
  }
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  exports.__esModule = true;
15
15
  exports.getFlattenedItems = void 0;
16
16
  var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
17
+ var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
17
18
  var isArray_1 = __importDefault(require("lodash-es/isArray"));
18
19
  var isNil_1 = __importDefault(require("lodash-es/isNil"));
19
20
  var difference_1 = __importDefault(require("lodash-es/difference"));
@@ -80,6 +81,10 @@ function useDataSelect(config) {
80
81
  if (!config.multiple && ids.length > 1) {
81
82
  ids = [ids[0]];
82
83
  }
84
+ if ((0, isEmpty_1["default"])(ids)) {
85
+ setSelectedIdsInternal([]);
86
+ return;
87
+ }
83
88
  // If all elements of selectedIds are equal to ids, remove all elements
84
89
  if ((0, isEqual_1["default"])(selectedIds, ids)) {
85
90
  setSelectedIdsInternal([]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -149,6 +149,10 @@ export interface IButtonProps extends IUiComponent {
149
149
  * Цвет текста кнопки или ссылки
150
150
  */
151
151
  textColor?: string;
152
+ /**
153
+ * Дополнительный свойства для view части компонента
154
+ */
155
+ viewProps?: Record<string, any>;
152
156
  [key: string]: any;
153
157
  }
154
158
  export interface IButtonViewProps extends IButtonProps {
@@ -147,10 +147,11 @@ function Button(props) {
147
147
  onClick: !disabled ? onClick : undefined,
148
148
  children: props.label || props.children,
149
149
  className: props.className,
150
- style: props.style
150
+ style: props.style,
151
+ viewProps: props.viewProps
151
152
  }); }, [badge, context === null || context === void 0 ? void 0 : context.formId, disabled, isFailed, isLoading, onClick, props.block,
152
153
  props.children, props.className, props.color, props.hint, props.icon, props.label,
153
- props.link, props.outline, props.size, props.style, props.target, props.type, submitting, tag, url]);
154
+ props.link, props.outline, props.size, props.style, props.target, props.type, submitting, tag, url, props.viewProps]);
154
155
  return components.ui.renderView(props.view || 'form.ButtonView', viewProps);
155
156
  }
156
157
  Button.defaultProps = {
@@ -100,8 +100,8 @@ function InputField(props) {
100
100
  var onClear = React.useCallback(function () { return props.input.onChange(''); }, [props.input]);
101
101
  var inputProps = (0, react_1.useMemo)(function () {
102
102
  var _a;
103
- return (__assign({ type: props.type, name: props.input.name, value: (_a = props.input.value) !== null && _a !== void 0 ? _a : '', onInput: onChange, placeholder: props.placeholder, disabled: props.disabled }, props.inputProps));
104
- }, [onChange, props.disabled, props.input.name, props.input.value, props.inputProps, props.placeholder, props.type]);
103
+ return (__assign({ type: props.type, name: props.input.name, value: (_a = props.input.value) !== null && _a !== void 0 ? _a : '', onInput: onChange, placeholder: props.placeholder }, props.inputProps));
104
+ }, [onChange, props.input.name, props.input.value, props.inputProps, props.placeholder, props.type]);
105
105
  var viewProps = (0, react_1.useMemo)(function () { return ({
106
106
  inputRef: useInputFieldWarningByType_1.INPUT_TYPES_SUPPORTED_SELECTION.includes(props.type) ? inputRef : null,
107
107
  onClear: onClear,
@@ -123,7 +123,8 @@ function InputField(props) {
123
123
  placeholder: props.placeholder,
124
124
  required: props.required,
125
125
  id: props.id,
126
- viewProps: props.viewProps
126
+ viewProps: props.viewProps,
127
+ disabled: props.disabled
127
128
  }); }, [inputProps, inputRef, onClear, props]);
128
129
  // No render for hidden input
129
130
  if (props.type === 'hidden') {