@steroidsjs/core 3.0.96 → 3.1.3

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.
Files changed (160) hide show
  1. package/actions/list.d.ts +6 -0
  2. package/actions/list.js +8 -1
  3. package/components/HtmlComponent.d.ts +3 -3
  4. package/components/HttpComponent.d.ts +18 -15
  5. package/components/HttpComponent.js +40 -18
  6. package/components/LocaleComponent.js +5 -28
  7. package/components/UiComponent.d.ts +0 -1
  8. package/components/UiComponent.js +2 -25
  9. package/docs-autogen-result.json +85 -59
  10. package/hooks/useAbsolutePositioning.d.ts +2 -2
  11. package/hooks/useApplication.js +6 -29
  12. package/hooks/useFetch.d.ts +1 -6
  13. package/hooks/useFetch.js +18 -12
  14. package/hooks/useList.js +24 -32
  15. package/hooks/useListField.js +3 -25
  16. package/hooks/useTree.d.ts +3 -3
  17. package/package.json +1 -1
  18. package/providers/ComponentsProvider.d.ts +1 -2
  19. package/providers/ComponentsProvider.js +14 -25
  20. package/providers/ScreenProvider.d.ts +1 -2
  21. package/providers/ScreenProvider.js +13 -25
  22. package/providers/SsrProvider.d.ts +1 -2
  23. package/providers/SsrProvider.js +13 -25
  24. package/providers/ThemeProvider.d.ts +4 -4
  25. package/providers/ThemeProvider.js +18 -29
  26. package/reducers/list.d.ts +0 -1
  27. package/reducers/list.js +5 -4
  28. package/ui/content/Accordion/Accordion.d.ts +5 -5
  29. package/ui/content/Accordion/Accordion.js +5 -28
  30. package/ui/content/Alert/Alert.d.ts +2 -2
  31. package/ui/content/Avatar/Avatar.d.ts +2 -2
  32. package/ui/content/Avatar/AvatarGroup.d.ts +2 -2
  33. package/ui/content/Avatar/AvatarGroup.js +3 -25
  34. package/ui/content/CalendarSystem/CalendarSystem.d.ts +5 -5
  35. package/ui/content/CalendarSystem/CalendarSystem.js +2 -2
  36. package/ui/content/CalendarSystem/hooks/useCalendarControls.d.ts +3 -3
  37. package/ui/content/CalendarSystem/hooks/useCalendarControls.js +2 -25
  38. package/ui/content/CalendarSystem/hooks/useCalendarSystem.d.ts +3 -3
  39. package/ui/content/CalendarSystem/hooks/useCalendarSystem.js +8 -31
  40. package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.d.ts +0 -1
  41. package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +4 -4
  42. package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.d.ts +2 -2
  43. package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +6 -6
  44. package/ui/content/CalendarSystem/hooks/useCalendarType.js +3 -3
  45. package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +2 -2
  46. package/ui/content/CalendarSystem/hooks/useExpandClickAway.d.ts +3 -3
  47. package/ui/content/CalendarSystem/hooks/useExpandClickAway.js +3 -6
  48. package/ui/content/Card/Card.d.ts +3 -3
  49. package/ui/content/Chat/Chat.d.ts +3 -3
  50. package/ui/content/Chat/Chat.js +3 -25
  51. package/ui/content/CopyToClipboard/CopyToClipboard.d.ts +4 -4
  52. package/ui/content/Dashboard/Dashboard.d.ts +2 -2
  53. package/ui/content/Dashboard/Dashboard.js +4 -26
  54. package/ui/content/Detail/Detail.d.ts +3 -3
  55. package/ui/content/Detail/Detail.js +3 -26
  56. package/ui/content/Detail/DetailItem.d.ts +3 -3
  57. package/ui/content/DropDown/DropDown.d.ts +2 -2
  58. package/ui/content/DropDown/DropDown.js +5 -31
  59. package/ui/content/Kanban/Kanban.js +15 -26
  60. package/ui/content/Kanban/hooks/useKanban.js +7 -30
  61. package/ui/content/Menu/Menu.d.ts +3 -3
  62. package/ui/content/Slider/Slider.d.ts +2 -2
  63. package/ui/content/Slider/Slider.js +2 -5
  64. package/ui/crud/Crud/Crud.d.ts +4 -5
  65. package/ui/crud/Crud/Crud.js +2 -25
  66. package/ui/crud/Crud/CrudContent.js +8 -35
  67. package/ui/crud/Crud/CrudModal.js +2 -26
  68. package/ui/form/AutoCompleteField/AutoCompleteField.d.ts +2 -2
  69. package/ui/form/BlankField/BlankField.d.ts +3 -3
  70. package/ui/form/BlankField/BlankField.js +2 -25
  71. package/ui/form/Button/Button.d.ts +2 -2
  72. package/ui/form/Button/Button.js +2 -25
  73. package/ui/form/CheckboxField/CheckboxField.d.ts +2 -2
  74. package/ui/form/CheckboxField/CheckboxField.js +2 -25
  75. package/ui/form/CheckboxListField/CheckboxListField.d.ts +1 -1
  76. package/ui/form/CheckboxTreeField/CheckboxTreeField.js +3 -25
  77. package/ui/form/DateField/DateField.d.ts +2 -2
  78. package/ui/form/DateRangeField/DateRangeField.d.ts +3 -3
  79. package/ui/form/DateTimeField/DateTimeField.d.ts +2 -2
  80. package/ui/form/DropDownField/DropDownField.d.ts +3 -3
  81. package/ui/form/DropDownField/DropDownField.js +3 -26
  82. package/ui/form/EmailField/EmailField.js +3 -26
  83. package/ui/form/EmailField/hooks/useInputTypeEmail.d.ts +3 -3
  84. package/ui/form/EmailField/hooks/useInputTypeEmail.js +3 -6
  85. package/ui/form/Field/Field.d.ts +2 -2
  86. package/ui/form/Field/Field.js +3 -26
  87. package/ui/form/Field/fieldWrapper.js +2 -25
  88. package/ui/form/FieldLayout/FieldLayout.d.ts +3 -3
  89. package/ui/form/FieldLayout/FieldLayout.js +1 -25
  90. package/ui/form/FieldList/FieldList.d.ts +2 -2
  91. package/ui/form/FieldList/FieldList.js +17 -16
  92. package/ui/form/FieldSet/FieldSet.d.ts +2 -2
  93. package/ui/form/FieldSet/FieldSet.js +5 -30
  94. package/ui/form/FileField/FileField.js +5 -27
  95. package/ui/form/Form/Form.d.ts +7 -11
  96. package/ui/form/Form/Form.js +6 -32
  97. package/ui/form/ImageField/ImageField.js +2 -25
  98. package/ui/form/InputField/InputField.d.ts +5 -6
  99. package/ui/form/InputField/InputField.js +2 -26
  100. package/ui/form/MaskField/MaskField.js +2 -2
  101. package/ui/form/NavField/NavField.js +3 -25
  102. package/ui/form/NumberField/NumberField.d.ts +1 -1
  103. package/ui/form/NumberField/NumberField.js +2 -25
  104. package/ui/form/NumberField/hooks/useInputTypeNumber.d.ts +3 -3
  105. package/ui/form/NumberField/hooks/useInputTypeNumber.js +2 -5
  106. package/ui/form/RadioField/RadioField.js +2 -2
  107. package/ui/form/RadioListField/RadioListField.js +2 -2
  108. package/ui/form/SliderField/SliderField.d.ts +2 -2
  109. package/ui/form/SwitcherField/SwitcherField.js +2 -2
  110. package/ui/form/SwitcherListField/SwitcherListField.js +2 -2
  111. package/ui/form/TextField/TextField.d.ts +2 -2
  112. package/ui/form/WizardForm/WizardForm.d.ts +4 -4
  113. package/ui/form/WizardForm/WizardForm.js +3 -27
  114. package/ui/form/WizardForm/utils.d.ts +2 -2
  115. package/ui/format/BooleanFormatter/BooleanFormatter.d.ts +2 -2
  116. package/ui/layout/Header/Header.d.ts +3 -3
  117. package/ui/layout/Meta/Meta.js +6 -15
  118. package/ui/layout/Notifications/Notifications.d.ts +2 -2
  119. package/ui/layout/Notifications/Notifications.js +3 -25
  120. package/ui/layout/Portal.d.ts +3 -3
  121. package/ui/layout/ProgressBar/ProgressBar.d.ts +3 -3
  122. package/ui/layout/ProgressBar/ProgressBar.js +4 -26
  123. package/ui/layout/Sidebar/Sidebar.d.ts +3 -3
  124. package/ui/layout/Sidebar/Sidebar.js +2 -25
  125. package/ui/layout/Skeleton/Skeleton.d.ts +3 -3
  126. package/ui/layout/Tooltip/Tooltip.js +19 -34
  127. package/ui/layout/Tooltip/TooltipPortalInner.d.ts +3 -3
  128. package/ui/layout/Tooltip/TooltipPortalInner.js +2 -25
  129. package/ui/list/Empty/Empty.d.ts +3 -3
  130. package/ui/list/Empty/Empty.js +2 -25
  131. package/ui/list/FlexGrid/FlexGrid.d.ts +2 -2
  132. package/ui/list/Grid/Grid.d.ts +3 -3
  133. package/ui/list/Grid/Grid.js +5 -27
  134. package/ui/list/InfiniteScroll/InfiniteScroll.d.ts +2 -2
  135. package/ui/list/InfiniteScroll/InfiniteScroll.js +3 -25
  136. package/ui/list/LayoutNames/LayoutNames.d.ts +2 -2
  137. package/ui/list/LayoutNames/LayoutNames.js +2 -25
  138. package/ui/list/List/List.js +3 -26
  139. package/ui/list/Pagination/Pagination.d.ts +2 -2
  140. package/ui/list/Pagination/Pagination.js +4 -27
  141. package/ui/list/PaginationSize/PaginationSize.d.ts +2 -2
  142. package/ui/list/PaginationSize/PaginationSize.js +2 -25
  143. package/ui/list/SearchForm/SearchForm.d.ts +2 -2
  144. package/ui/list/SearchForm/SearchForm.js +3 -26
  145. package/ui/list/Steps/Steps.d.ts +4 -4
  146. package/ui/list/TreeTable/TreeTable.d.ts +3 -3
  147. package/ui/list/TreeTable/TreeTable.js +4 -27
  148. package/ui/modal/Modal/Modal.js +3 -25
  149. package/ui/modal/ModalPortal/ModalPortal.js +3 -25
  150. package/ui/modal/TwoFactorModal/TwoFactorModal.js +4 -5
  151. package/ui/nav/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  152. package/ui/nav/Link/Link.js +2 -25
  153. package/ui/nav/Nav/Nav.js +3 -25
  154. package/ui/nav/Router/Router.d.ts +3 -3
  155. package/ui/nav/Router/Router.js +9 -33
  156. package/ui/nav/Tree/Tree.d.ts +4 -4
  157. package/ui/typography/Text/Text.d.ts +2 -2
  158. package/ui/typography/Title/Title.d.ts +2 -2
  159. package/utils/createAxiosError.d.ts +9 -0
  160. package/utils/createAxiosError.js +39 -0
@@ -636,9 +636,9 @@
636
636
  "example": null
637
637
  },
638
638
  {
639
- "name": "params",
639
+ "name": "body",
640
640
  "decorators": [],
641
- "description": "Параметры для запроса.",
641
+ "description": "Тело для запроса.",
642
642
  "required": false,
643
643
  "type": "Record",
644
644
  "example": null
@@ -646,9 +646,9 @@
646
646
  {
647
647
  "name": "options",
648
648
  "decorators": [],
649
- "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
649
+ "description": "Опции для HTTP-запроса, заголовки, query-параметры и т.д.\n",
650
650
  "required": false,
651
- "type": "IHttpRequestOptions",
651
+ "type": "IHttpRequestOptionsWithQuery",
652
652
  "example": null
653
653
  }
654
654
  ]
@@ -680,9 +680,9 @@
680
680
  {
681
681
  "name": "options",
682
682
  "decorators": [],
683
- "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
683
+ "description": "Опции для HTTP-запроса, заголовки, query-параметры и т.д.\n",
684
684
  "required": false,
685
- "type": "IHttpRequestOptions",
685
+ "type": "IHttpRequestOptionsWithQuery",
686
686
  "example": null
687
687
  }
688
688
  ]
@@ -776,9 +776,9 @@
776
776
  "example": null
777
777
  },
778
778
  {
779
- "name": "params",
779
+ "name": "body",
780
780
  "decorators": [],
781
- "description": "Параметры для запроса.",
781
+ "description": "Тело запроса.",
782
782
  "required": false,
783
783
  "type": "Record",
784
784
  "example": null
@@ -786,9 +786,9 @@
786
786
  {
787
787
  "name": "options",
788
788
  "decorators": [],
789
- "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
789
+ "description": "Опции для HTTP-запроса, заголовки, query-параметры и т.д.\n",
790
790
  "required": false,
791
- "type": "IHttpRequestOptions",
791
+ "type": "IHttpRequestOptionsWithQuery",
792
792
  "example": null
793
793
  }
794
794
  ]
@@ -836,9 +836,9 @@
836
836
  "example": null
837
837
  },
838
838
  {
839
- "name": "params",
839
+ "name": "body",
840
840
  "decorators": [],
841
- "description": "Параметры для запроса.",
841
+ "description": "Тело запроса.",
842
842
  "required": false,
843
843
  "type": "Record",
844
844
  "example": null
@@ -846,9 +846,9 @@
846
846
  {
847
847
  "name": "options",
848
848
  "decorators": [],
849
- "description": "Опции для HTTP-запроса, заголовки и т.д.\n",
849
+ "description": "Опции для HTTP-запроса, заголовки, query-параметры и т.д.\n",
850
850
  "required": false,
851
- "type": "IHttpRequestOptions",
851
+ "type": "IHttpRequestOptionsWithQuery",
852
852
  "example": null
853
853
  }
854
854
  ]
@@ -3654,8 +3654,8 @@
3654
3654
  "name": "data",
3655
3655
  "decorators": [],
3656
3656
  "description": "",
3657
- "required": false,
3658
- "type": "T | {error: string, errors: Record, message: string, statusCode: number}",
3657
+ "required": true,
3658
+ "type": "T",
3659
3659
  "example": null
3660
3660
  },
3661
3661
  {
@@ -5665,7 +5665,7 @@
5665
5665
  "tags": {},
5666
5666
  "defaultProps": null,
5667
5667
  "extends": [
5668
- "React.PropsWithChildren<any>"
5668
+ "PropsWithChildren<any>"
5669
5669
  ],
5670
5670
  "properties": [
5671
5671
  {
@@ -16394,7 +16394,7 @@
16394
16394
  "decorators": [],
16395
16395
  "description": "Кастомная иконка, заменяющая иконку раскрытия по умолчанию",
16396
16396
  "required": false,
16397
- "type": "string | ReactElement",
16397
+ "type": "string | React.ReactElement",
16398
16398
  "example": null,
16399
16399
  "defaultValue": null
16400
16400
  },
@@ -16761,7 +16761,7 @@
16761
16761
  "decorators": [],
16762
16762
  "description": "Кастомная иконка, заменяющая иконку раскрытия по умолчанию",
16763
16763
  "required": false,
16764
- "type": "string | ReactElement",
16764
+ "type": "string | React.ReactElement",
16765
16765
  "example": null
16766
16766
  },
16767
16767
  {
@@ -23546,15 +23546,6 @@
23546
23546
  "example": "true",
23547
23547
  "defaultValue": null
23548
23548
  },
23549
- {
23550
- "name": "validator",
23551
- "decorators": [],
23552
- "description": "Колбэк для использования сторонних валидаторов, например yup",
23553
- "required": false,
23554
- "type": "any",
23555
- "example": null,
23556
- "defaultValue": null
23557
- },
23558
23549
  {
23559
23550
  "name": "validators",
23560
23551
  "decorators": [],
@@ -33043,7 +33034,7 @@
33043
33034
  "decorators": [],
33044
33035
  "description": "Свойства для логотипа.",
33045
33036
  "required": false,
33046
- "type": "{className: string, icon: string | ReactElement, linkProps: ILinkProps, title: string}",
33037
+ "type": "{className: string, icon: CustomIcon, linkProps: ILinkProps, title: string}",
33047
33038
  "example": null,
33048
33039
  "defaultValue": null
33049
33040
  },
@@ -33143,7 +33134,7 @@
33143
33134
  "decorators": [],
33144
33135
  "description": "Свойства для логотипа.",
33145
33136
  "required": false,
33146
- "type": "{className: string, icon: string | ReactElement, linkProps: ILinkProps, title: string}",
33137
+ "type": "{className: string, icon: CustomIcon, linkProps: ILinkProps, title: string}",
33147
33138
  "example": null
33148
33139
  },
33149
33140
  {
@@ -38088,15 +38079,6 @@
38088
38079
  "example": "true",
38089
38080
  "defaultValue": null
38090
38081
  },
38091
- {
38092
- "name": "validator",
38093
- "decorators": [],
38094
- "description": "Колбэк для использования сторонних валидаторов, например yup",
38095
- "required": false,
38096
- "type": "any",
38097
- "example": null,
38098
- "defaultValue": null
38099
- },
38100
38082
  {
38101
38083
  "name": "validators",
38102
38084
  "decorators": [],
@@ -38616,7 +38598,7 @@
38616
38598
  "decorators": [],
38617
38599
  "description": "Кастомная иконка для сворачивания элементов",
38618
38600
  "required": false,
38619
- "type": "string | ReactElement",
38601
+ "type": "string | React.ReactElement",
38620
38602
  "example": "'arrow'"
38621
38603
  },
38622
38604
  {
@@ -38834,7 +38816,7 @@
38834
38816
  "decorators": [],
38835
38817
  "description": "Кастомная иконка для сворачивания элементов",
38836
38818
  "required": false,
38837
- "type": "string | ReactElement",
38819
+ "type": "string | React.ReactElement",
38838
38820
  "example": "'arrow'",
38839
38821
  "defaultValue": null
38840
38822
  },
@@ -39217,7 +39199,7 @@
39217
39199
  "decorators": [],
39218
39200
  "description": "Кастомная иконка, заменяющая первый роут",
39219
39201
  "required": false,
39220
- "type": "string | ReactElement",
39202
+ "type": "string | React.ReactElement",
39221
39203
  "example": null,
39222
39204
  "defaultValue": null
39223
39205
  },
@@ -41020,7 +41002,7 @@
41020
41002
  "decorators": [],
41021
41003
  "description": "Кастомная иконка, заменяющая иконку раскрытия по умолчанию",
41022
41004
  "required": false,
41023
- "type": "string | ReactElement",
41005
+ "type": "string | React.ReactElement",
41024
41006
  "example": null
41025
41007
  },
41026
41008
  {
@@ -41273,7 +41255,7 @@
41273
41255
  "decorators": [],
41274
41256
  "description": "Кастомная иконка, заменяющая иконку раскрытия по умолчанию",
41275
41257
  "required": false,
41276
- "type": "string | ReactElement",
41258
+ "type": "string | React.ReactElement",
41277
41259
  "example": null,
41278
41260
  "defaultValue": null
41279
41261
  },
@@ -41506,7 +41488,7 @@
41506
41488
  "decorators": [],
41507
41489
  "description": "Кастомная иконка, заменяющая иконку раскрытия по умолчанию",
41508
41490
  "required": false,
41509
- "type": "string | ReactElement",
41491
+ "type": "string | React.ReactElement",
41510
41492
  "example": null
41511
41493
  },
41512
41494
  {
@@ -41845,6 +41827,50 @@
41845
41827
  }
41846
41828
  ],
41847
41829
  "methods": []
41830
+ },
41831
+ "IApiErrorPayload": {
41832
+ "name": "IApiErrorPayload",
41833
+ "moduleName": "utils/createAxiosError",
41834
+ "title": "",
41835
+ "description": "",
41836
+ "tags": {},
41837
+ "defaultProps": null,
41838
+ "extends": [],
41839
+ "properties": [
41840
+ {
41841
+ "name": "error",
41842
+ "decorators": [],
41843
+ "description": "",
41844
+ "required": false,
41845
+ "type": "string",
41846
+ "example": null
41847
+ },
41848
+ {
41849
+ "name": "errors",
41850
+ "decorators": [],
41851
+ "description": "",
41852
+ "required": false,
41853
+ "type": "Record",
41854
+ "example": null
41855
+ },
41856
+ {
41857
+ "name": "message",
41858
+ "decorators": [],
41859
+ "description": "",
41860
+ "required": false,
41861
+ "type": "string",
41862
+ "example": null
41863
+ },
41864
+ {
41865
+ "name": "statusCode",
41866
+ "decorators": [],
41867
+ "description": "",
41868
+ "required": true,
41869
+ "type": "number",
41870
+ "example": null
41871
+ }
41872
+ ],
41873
+ "methods": []
41848
41874
  }
41849
41875
  },
41850
41876
  "declarations": {
@@ -42594,7 +42620,7 @@
42594
42620
  "example": null
42595
42621
  },
42596
42622
  {
42597
- "name": "params",
42623
+ "name": "body",
42598
42624
  "decorators": [],
42599
42625
  "description": "",
42600
42626
  "required": true,
@@ -42606,7 +42632,7 @@
42606
42632
  "decorators": [],
42607
42633
  "description": "",
42608
42634
  "required": true,
42609
- "type": "IHttpRequestOptions",
42635
+ "type": "IHttpRequestOptionsWithQuery",
42610
42636
  "example": null
42611
42637
  }
42612
42638
  ]
@@ -42640,7 +42666,7 @@
42640
42666
  "decorators": [],
42641
42667
  "description": "",
42642
42668
  "required": true,
42643
- "type": "IHttpRequestOptions",
42669
+ "type": "IHttpRequestOptionsWithQuery",
42644
42670
  "example": null
42645
42671
  }
42646
42672
  ]
@@ -42734,7 +42760,7 @@
42734
42760
  "example": null
42735
42761
  },
42736
42762
  {
42737
- "name": "params",
42763
+ "name": "body",
42738
42764
  "decorators": [],
42739
42765
  "description": "",
42740
42766
  "required": true,
@@ -42746,7 +42772,7 @@
42746
42772
  "decorators": [],
42747
42773
  "description": "",
42748
42774
  "required": true,
42749
- "type": "IHttpRequestOptions",
42775
+ "type": "IHttpRequestOptionsWithQuery",
42750
42776
  "example": null
42751
42777
  }
42752
42778
  ]
@@ -42794,7 +42820,7 @@
42794
42820
  "example": null
42795
42821
  },
42796
42822
  {
42797
- "name": "params",
42823
+ "name": "body",
42798
42824
  "decorators": [],
42799
42825
  "description": "",
42800
42826
  "required": true,
@@ -42806,7 +42832,7 @@
42806
42832
  "decorators": [],
42807
42833
  "description": "",
42808
42834
  "required": true,
42809
- "type": "IHttpRequestOptions",
42835
+ "type": "IHttpRequestOptionsWithQuery",
42810
42836
  "example": null
42811
42837
  }
42812
42838
  ]
@@ -42957,7 +42983,7 @@
42957
42983
  "example": null
42958
42984
  },
42959
42985
  {
42960
- "name": "params",
42986
+ "name": "body",
42961
42987
  "decorators": [],
42962
42988
  "description": "",
42963
42989
  "required": true,
@@ -42969,7 +42995,7 @@
42969
42995
  "decorators": [],
42970
42996
  "description": "",
42971
42997
  "required": true,
42972
- "type": "IHttpRequestOptions",
42998
+ "type": "IHttpRequestOptionsWithQuery",
42973
42999
  "example": null
42974
43000
  }
42975
43001
  ]
@@ -43003,7 +43029,7 @@
43003
43029
  "decorators": [],
43004
43030
  "description": "",
43005
43031
  "required": true,
43006
- "type": "IHttpRequestOptions",
43032
+ "type": "IHttpRequestOptionsWithQuery",
43007
43033
  "example": null
43008
43034
  }
43009
43035
  ]
@@ -43097,7 +43123,7 @@
43097
43123
  "example": null
43098
43124
  },
43099
43125
  {
43100
- "name": "params",
43126
+ "name": "body",
43101
43127
  "decorators": [],
43102
43128
  "description": "",
43103
43129
  "required": true,
@@ -43109,7 +43135,7 @@
43109
43135
  "decorators": [],
43110
43136
  "description": "",
43111
43137
  "required": true,
43112
- "type": "IHttpRequestOptions",
43138
+ "type": "IHttpRequestOptionsWithQuery",
43113
43139
  "example": null
43114
43140
  }
43115
43141
  ]
@@ -43157,7 +43183,7 @@
43157
43183
  "example": null
43158
43184
  },
43159
43185
  {
43160
- "name": "params",
43186
+ "name": "body",
43161
43187
  "decorators": [],
43162
43188
  "description": "",
43163
43189
  "required": true,
@@ -43169,7 +43195,7 @@
43169
43195
  "decorators": [],
43170
43196
  "description": "",
43171
43197
  "required": true,
43172
- "type": "IHttpRequestOptions",
43198
+ "type": "IHttpRequestOptionsWithQuery",
43173
43199
  "example": null
43174
43200
  }
43175
43201
  ]
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export interface IComponentStylePosition {
3
3
  /**
4
4
  * Позиция компонента слева
@@ -59,7 +59,7 @@ export interface IAbsolutePositioningInputProps {
59
59
  /**
60
60
  * Дочерние элементы
61
61
  */
62
- children?: React.ReactNode;
62
+ children?: ReactNode;
63
63
  /**
64
64
  * Задержка перед размонтированием компонента, когда он должен быть скрыт.
65
65
  * В этот момент удобно применять различные анимации ухода.
@@ -10,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
13
  var __rest = (this && this.__rest) || function (s, e) {
37
14
  var t = {};
38
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -49,6 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
49
26
  };
50
27
  exports.__esModule = true;
51
28
  exports.defaultComponents = void 0;
29
+ var jsx_runtime_1 = require("react/jsx-runtime");
52
30
  var dayjs_1 = __importDefault(require("dayjs"));
53
31
  var customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
54
32
  var isToday_1 = __importDefault(require("dayjs/plugin/isToday"));
@@ -57,7 +35,6 @@ var localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"))
57
35
  var relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
58
36
  var utc_1 = __importDefault(require("dayjs/plugin/utc"));
59
37
  var merge_1 = __importDefault(require("lodash-es/merge"));
60
- var React = __importStar(require("react"));
61
38
  var react_1 = require("react");
62
39
  var react_redux_1 = require("react-redux");
63
40
  var useComponents_1 = __importDefault(require("./useComponents"));
@@ -147,18 +124,18 @@ function useApplication(config) {
147
124
  var content = children;
148
125
  // Wrap in routes
149
126
  if (config.routes) {
150
- content = (React.createElement(Router_1["default"], __assign({ routes: config.routes(), wrapperView: config.layoutView(), wrapperProps: config.layoutProps }, config.routerProps)));
127
+ content = ((0, jsx_runtime_1.jsx)(Router_1["default"], __assign({ routes: config.routes(), wrapperView: config.layoutView(), wrapperProps: config.layoutProps }, config.routerProps)));
151
128
  }
152
129
  if (config.screen) {
153
- content = (React.createElement(ScreenProvider_1["default"], __assign({}, config.screen), content));
130
+ content = ((0, jsx_runtime_1.jsx)(ScreenProvider_1["default"], __assign({}, config.screen, { children: content })));
154
131
  }
155
132
  if (config.theme) {
156
- content = (React.createElement(ThemeProvider_1["default"], __assign({}, config.theme), content));
133
+ content = ((0, jsx_runtime_1.jsx)(ThemeProvider_1["default"], __assign({}, config.theme, { children: content })));
157
134
  }
158
135
  if (!(useGlobal || process.env.IS_SSR)) {
159
- content = (React.createElement(ComponentsProvider_1["default"], { components: components }, content));
136
+ content = ((0, jsx_runtime_1.jsx)(ComponentsProvider_1["default"], __assign({ components: components }, { children: content })));
160
137
  }
161
- return (React.createElement(react_redux_1.Provider, { store: components.store.store }, content));
138
+ return ((0, jsx_runtime_1.jsx)(react_redux_1.Provider, __assign({ store: components.store.store }, { children: content })));
162
139
  }, [components, config, useGlobal]);
163
140
  return {
164
141
  renderApplication: renderApplication,
@@ -19,12 +19,7 @@ export interface IFetchConfig {
19
19
  onFetch?: (config: IFetchConfig, components: IComponents, addCancelToken: (token: any) => any) => any;
20
20
  }
21
21
  export interface IFetchResult<T> {
22
- data?: T | undefined | null | {
23
- statusCode: number;
24
- error?: string;
25
- message?: string;
26
- errors?: Record<string, unknown>;
27
- };
22
+ data: T | null;
28
23
  isLoading: boolean;
29
24
  fetch: (newParams?: Record<string, unknown>) => void;
30
25
  axiosError: AxiosError | null;
package/hooks/useFetch.js CHANGED
@@ -55,6 +55,7 @@ var axios_1 = __importDefault(require("axios"));
55
55
  var trim_1 = __importDefault(require("lodash-es/trim"));
56
56
  var react_1 = require("react");
57
57
  var react_use_1 = require("react-use");
58
+ var createAxiosError_1 = __importDefault(require("../utils/createAxiosError"));
58
59
  var index_1 = require("./index");
59
60
  var normalizeConfig = function (config) { return (config
60
61
  ? __assign({ id: null, url: '', method: 'get', params: {}, options: null, onFetch: null }, config) : null); };
@@ -120,9 +121,9 @@ function useFetch(rawConfig) {
120
121
  var fetch = (0, react_1.useCallback)(function (newConfig) {
121
122
  if (newConfig === void 0) { newConfig = null; }
122
123
  return __awaiter(_this, void 0, void 0, function () {
123
- var _a, error_1;
124
- return __generator(this, function (_b) {
125
- switch (_b.label) {
124
+ var responseData, error_1;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
126
127
  case 0:
127
128
  if (newConfig) {
128
129
  setConfig(__assign(__assign(__assign({}, config), newConfig), { params: __assign(__assign({}, config === null || config === void 0 ? void 0 : config.params), newConfig === null || newConfig === void 0 ? void 0 : newConfig.params) }));
@@ -131,23 +132,28 @@ function useFetch(rawConfig) {
131
132
  setData(null);
132
133
  if (!config) return [3 /*break*/, 5];
133
134
  setIsLoading(true);
134
- _b.label = 1;
135
+ _a.label = 1;
135
136
  case 1:
136
- _b.trys.push([1, 3, , 4]);
137
- _a = setData;
137
+ _a.trys.push([1, 3, 4, 5]);
138
138
  return [4 /*yield*/, (0, exports.fetchData)(config, components, addCancelToken)];
139
139
  case 2:
140
- _a.apply(void 0, [_b.sent()]);
141
- return [3 /*break*/, 4];
140
+ responseData = _a.sent();
141
+ if ((responseData === null || responseData === void 0 ? void 0 : responseData.statusCode) && responseData.statusCode >= 400) {
142
+ setAxiosError((0, createAxiosError_1["default"])(responseData, config));
143
+ }
144
+ else {
145
+ setData(responseData);
146
+ }
147
+ return [3 /*break*/, 5];
142
148
  case 3:
143
- error_1 = _b.sent();
144
- if (error_1.isAxiosError) {
149
+ error_1 = _a.sent();
150
+ if (error_1 === null || error_1 === void 0 ? void 0 : error_1.isAxiosError) {
145
151
  setAxiosError(error_1);
146
152
  }
147
- return [3 /*break*/, 4];
153
+ return [3 /*break*/, 5];
148
154
  case 4:
149
155
  setIsLoading(false);
150
- _b.label = 5;
156
+ return [7 /*endfinally*/];
151
157
  case 5: return [2 /*return*/];
152
158
  }
153
159
  });