@steroidsjs/core 3.0.93 → 3.0.96
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/actions/auth.js +1 -0
- package/actions/list.js +12 -10
- package/actions/notifications.d.ts +1 -1
- package/actions/notifications.js +5 -3
- package/components/ClientStorageComponent.js +1 -1
- package/components/HttpComponent.js +3 -3
- package/components/JwtHttpComponent.js +2 -2
- package/components/LocaleComponent.js +4 -3
- package/components/MetricsComponent.js +1 -1
- package/components/ResourceComponent.d.ts +2 -0
- package/components/ResourceComponent.js +9 -3
- package/components/SocialComponent.js +3 -1
- package/components/StoreComponent.d.ts +33 -21
- package/components/StoreComponent.js +5 -10
- package/components/UiComponent.js +1 -1
- package/components/social/GitlabProvider.js +3 -1
- package/docs-autogen-result.json +83 -41
- package/en.json +7 -1
- package/hooks/index.d.ts +5 -5
- package/hooks/index.js +10 -10
- package/hooks/useAddressBar.js +13 -9
- package/hooks/useApplication.d.ts +9 -9
- package/hooks/useApplication.js +17 -15
- package/hooks/useDataProvider.js +13 -7
- package/hooks/useDataSelect.js +4 -4
- package/hooks/useFetch.d.ts +6 -7
- package/hooks/useFetch.js +2 -2
- package/hooks/useFile.js +12 -7
- package/hooks/useLayout.js +25 -23
- package/hooks/useList.d.ts +4 -4
- package/hooks/useList.js +28 -22
- package/hooks/useListField.js +1 -1
- package/hooks/useSaveCursorPosition.js +1 -1
- package/hooks/useTree.d.ts +1 -1
- package/hooks/useTree.js +7 -6
- package/hooks/useUniqueId.js +1 -1
- package/index.d.ts +49 -0
- package/package.json +4 -4
- package/providers/ComponentsProvider.d.ts +5 -5
- package/providers/SsrProvider.js +7 -6
- package/providers/index.d.ts +1 -1
- package/providers/index.js +2 -2
- package/reducers/auth.js +1 -0
- package/reducers/fields.js +2 -1
- package/reducers/form.js +4 -3
- package/reducers/index.d.ts +1 -1
- package/reducers/index.js +2 -2
- package/reducers/list.js +3 -2
- package/reducers/modal.js +2 -1
- package/reducers/notifications.js +2 -1
- package/reducers/router.js +13 -7
- package/ui/content/Accordion/index.d.ts +1 -1
- package/ui/content/Accordion/index.js +2 -2
- package/ui/content/Alert/Alert.d.ts +1 -1
- package/ui/content/Badge/Badge.d.ts +1 -1
- package/ui/content/Calendar/Calendar.js +2 -2
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +2 -2
- package/ui/content/CalendarSystem/CalendarSystem.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarControls.js +5 -3
- package/ui/content/CalendarSystem/hooks/useCalendarSystem.js +11 -11
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.d.ts +1 -1
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +6 -4
- package/ui/content/CalendarSystem/hooks/useDisplayDate.js +1 -1
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +1 -1
- package/ui/content/CalendarSystem/utils/utils.js +6 -4
- package/ui/content/Card/Card.d.ts +1 -1
- package/ui/content/Chat/Chat.d.ts +1 -1
- package/ui/content/Chat/Chat.js +1 -1
- package/ui/content/Chat/hooks/useChat.js +5 -5
- package/ui/content/Chat/utils/addNewMessageIntoGroupedMessages.js +1 -1
- package/ui/content/Chat/utils/calculateMessageTimeAgo.js +6 -2
- package/ui/content/Chat/utils/getMessagesGroupedByDate.d.ts +1 -1
- package/ui/content/Chat/utils/getMessagesGroupedByDate.js +1 -1
- package/ui/content/Chat/utils/index.d.ts +1 -1
- package/ui/content/Chat/utils/index.js +3 -3
- package/ui/content/CopyToClipboard/CopyToClipboard.js +1 -1
- package/ui/content/Dashboard/Dashboard.js +1 -1
- package/ui/content/Detail/Detail.js +5 -3
- package/ui/content/DropDown/DropDown.js +1 -1
- package/ui/content/Kanban/Kanban.d.ts +3 -3
- package/ui/content/Kanban/Kanban.js +4 -4
- package/ui/content/Kanban/enums/KanbanPrioritiesEnum.d.ts +1 -1
- package/ui/content/Kanban/enums/KanbanPrioritiesEnum.js +6 -2
- package/ui/content/Kanban/enums/index.d.ts +1 -1
- package/ui/content/Kanban/enums/index.js +2 -2
- package/ui/content/Kanban/hooks/useKanban.js +2 -2
- package/ui/content/Kanban/reducers/kanban.js +1 -0
- package/ui/content/Slider/Slider.d.ts +1 -1
- package/ui/content/Slider/Slider.js +0 -1
- package/ui/content/index.d.ts +7 -7
- package/ui/content/index.js +15 -15
- package/ui/crud/Crud/Crud.js +4 -4
- package/ui/crud/Crud/CrudContent.d.ts +2 -2
- package/ui/crud/Crud/CrudContent.js +11 -5
- package/ui/crud/Crud/CrudModal.js +1 -1
- package/ui/crud/Crud/utils.js +5 -3
- package/ui/crud/index.d.ts +1 -1
- package/ui/form/AutoCompleteField/AutoCompleteField.js +2 -2
- package/ui/form/BlankField/BlankField.js +1 -1
- package/ui/form/Button/Button.d.ts +2 -2
- package/ui/form/Button/Button.js +4 -2
- package/ui/form/Button/index.js +1 -0
- package/ui/form/CheckboxField/CheckboxField.js +5 -3
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +1 -1
- package/ui/form/CheckboxListField/CheckboxListField.js +1 -1
- package/ui/form/CheckboxTreeField/CheckboxTreeField.d.ts +3 -3
- package/ui/form/CheckboxTreeField/CheckboxTreeField.js +3 -3
- package/ui/form/DateField/DateField.d.ts +2 -2
- package/ui/form/DateField/DateField.js +7 -7
- package/ui/form/DateField/useDateInputState.js +1 -1
- package/ui/form/DateField/useDateRange.js +3 -3
- package/ui/form/DateField/useDateTime.js +1 -1
- package/ui/form/DateRangeField/DateRangeField.d.ts +2 -2
- package/ui/form/DateRangeField/DateRangeField.js +15 -13
- package/ui/form/DateTimeField/DateTimeField.d.ts +1 -1
- package/ui/form/DateTimeField/DateTimeField.js +9 -9
- package/ui/form/DateTimeField/utils.js +12 -3
- package/ui/form/DateTimeRangeField/DateTimeRangeField.d.ts +1 -1
- package/ui/form/DateTimeRangeField/DateTimeRangeField.js +15 -13
- package/ui/form/DropDownField/DropDownField.d.ts +3 -3
- package/ui/form/DropDownField/DropDownField.js +5 -5
- package/ui/form/EmailField/EmailField.d.ts +1 -1
- package/ui/form/EmailField/EmailField.js +2 -2
- package/ui/form/Field/Field.js +3 -3
- package/ui/form/Field/fieldWrapper.js +6 -6
- package/ui/form/FieldLayout/FieldLayout.js +1 -1
- package/ui/form/FieldList/FieldList.js +15 -11
- package/ui/form/FieldSet/FieldSet.js +5 -3
- package/ui/form/FileField/FileField.d.ts +1 -1
- package/ui/form/FileField/FileField.js +2 -2
- package/ui/form/Form/Form.d.ts +2 -2
- package/ui/form/Form/Form.js +28 -25
- package/ui/form/HtmlField/HtmlField.js +2 -2
- package/ui/form/ImageField/ImageField.d.ts +2 -2
- package/ui/form/ImageField/ImageField.js +4 -4
- package/ui/form/InputField/InputField.d.ts +2 -2
- package/ui/form/InputField/InputField.js +11 -11
- package/ui/form/NavField/NavField.d.ts +2 -2
- package/ui/form/NavField/NavField.js +3 -3
- package/ui/form/NumberField/NumberField.d.ts +2 -2
- package/ui/form/NumberField/NumberField.js +5 -4
- package/ui/form/NumberField/hooks/useInputTypeNumber.js +2 -2
- package/ui/form/PasswordField/PasswordField.d.ts +1 -1
- package/ui/form/PasswordField/PasswordField.js +3 -1
- package/ui/form/RateField/RateField.js +2 -2
- package/ui/form/SliderField/SliderField.d.ts +1 -1
- package/ui/form/SliderField/SliderField.js +2 -2
- package/ui/form/TextField/TextField.js +1 -1
- package/ui/form/TimeField/TimeField.js +8 -8
- package/ui/form/TimeField/utils.js +9 -2
- package/ui/form/TimeRangeField/TimeRangeField.js +11 -11
- package/ui/form/WizardForm/WizardForm.d.ts +1 -1
- package/ui/form/WizardForm/WizardForm.js +4 -4
- package/ui/form/WizardForm/utils.d.ts +1 -1
- package/ui/form/WizardForm/utils.js +3 -3
- package/ui/form/index.d.ts +2 -2
- package/ui/form/index.js +4 -4
- package/ui/form/validate.js +5 -5
- package/ui/format/EnumFormatter/EnumFormatter.js +3 -1
- package/ui/format/Format/Format.js +1 -1
- package/ui/layout/Header/Header.d.ts +3 -3
- package/ui/layout/Loader/Loader.d.ts +1 -1
- package/ui/layout/Notifications/Notifications.d.ts +1 -1
- package/ui/layout/Notifications/Notifications.js +3 -3
- package/ui/layout/ProgressBar/ProgressBar.js +1 -1
- package/ui/layout/Sidebar/Sidebar.d.ts +1 -1
- package/ui/layout/Tooltip/Tooltip.js +1 -1
- package/ui/layout/index.d.ts +1 -1
- package/ui/layout/index.js +2 -2
- package/ui/list/CheckboxColumn/CheckboxColumn.js +1 -1
- package/ui/list/Empty/Empty.js +6 -2
- package/ui/list/Grid/Grid.d.ts +1 -1
- package/ui/list/Grid/Grid.js +6 -4
- package/ui/list/InfiniteScroll/InfiniteScroll.js +5 -3
- package/ui/list/LayoutNames/LayoutNames.d.ts +2 -2
- package/ui/list/LayoutNames/LayoutNames.js +5 -3
- package/ui/list/Pagination/Pagination.js +4 -2
- package/ui/list/PaginationSize/PaginationSize.d.ts +1 -1
- package/ui/list/PaginationSize/PaginationSize.js +5 -3
- package/ui/list/SearchForm/SearchForm.js +1 -1
- package/ui/list/Steps/Steps.js +1 -1
- package/ui/list/TreeTable/TreeTable.d.ts +1 -1
- package/ui/list/TreeTable/TreeTable.js +9 -7
- package/ui/modal/ModalPortal/ModalPortal.js +2 -2
- package/ui/modal/TwoFactorModal/TwoFactorModal.js +3 -1
- package/ui/nav/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/ui/nav/Controls/Controls.d.ts +1 -1
- package/ui/nav/Nav/Nav.js +2 -2
- package/ui/nav/Router/Router.js +15 -10
- package/ui/nav/Router/helpers.js +1 -1
- package/ui/nav/index.d.ts +3 -3
- package/ui/nav/index.js +6 -6
- package/ui/typography/Text/Text.d.ts +1 -1
- package/ui/typography/Title/Title.d.ts +1 -1
- package/utils/calculateComponentAbsolutePosition.js +9 -3
- package/utils/calendar.js +2 -1
- package/utils/data.js +27 -17
- package/utils/form.js +10 -8
package/docs-autogen-result.json
CHANGED
|
@@ -1641,12 +1641,20 @@
|
|
|
1641
1641
|
"defaultProps": null,
|
|
1642
1642
|
"extends": [],
|
|
1643
1643
|
"properties": [
|
|
1644
|
+
{
|
|
1645
|
+
"name": "dispatch",
|
|
1646
|
+
"decorators": [],
|
|
1647
|
+
"description": "Метод для dispatch",
|
|
1648
|
+
"required": true,
|
|
1649
|
+
"type": "Dispatch",
|
|
1650
|
+
"example": null
|
|
1651
|
+
},
|
|
1644
1652
|
{
|
|
1645
1653
|
"name": "reducers",
|
|
1646
1654
|
"decorators": [],
|
|
1647
1655
|
"description": "Редьюсеры",
|
|
1648
1656
|
"required": true,
|
|
1649
|
-
"type": "
|
|
1657
|
+
"type": "CreateRootReducer",
|
|
1650
1658
|
"example": null
|
|
1651
1659
|
},
|
|
1652
1660
|
{
|
|
@@ -1654,7 +1662,7 @@
|
|
|
1654
1662
|
"decorators": [],
|
|
1655
1663
|
"description": "Хранилище",
|
|
1656
1664
|
"required": true,
|
|
1657
|
-
"type": "
|
|
1665
|
+
"type": "Store",
|
|
1658
1666
|
"example": null
|
|
1659
1667
|
}
|
|
1660
1668
|
],
|
|
@@ -1686,24 +1694,6 @@
|
|
|
1686
1694
|
"example": null,
|
|
1687
1695
|
"parameters": []
|
|
1688
1696
|
},
|
|
1689
|
-
{
|
|
1690
|
-
"name": "dispatch",
|
|
1691
|
-
"decorators": [],
|
|
1692
|
-
"description": "Метод для dispatch",
|
|
1693
|
-
"required": false,
|
|
1694
|
-
"type": "void",
|
|
1695
|
-
"example": null,
|
|
1696
|
-
"parameters": [
|
|
1697
|
-
{
|
|
1698
|
-
"name": "action",
|
|
1699
|
-
"decorators": [],
|
|
1700
|
-
"description": "Экшен для изменения состояния.\n",
|
|
1701
|
-
"required": true,
|
|
1702
|
-
"type": "any",
|
|
1703
|
-
"example": null
|
|
1704
|
-
}
|
|
1705
|
-
]
|
|
1706
|
-
},
|
|
1707
1697
|
{
|
|
1708
1698
|
"name": "errorHandler",
|
|
1709
1699
|
"decorators": [],
|
|
@@ -1735,7 +1725,7 @@
|
|
|
1735
1725
|
"decorators": [],
|
|
1736
1726
|
"description": "Получение состояния",
|
|
1737
1727
|
"required": false,
|
|
1738
|
-
"type": "
|
|
1728
|
+
"type": "Record",
|
|
1739
1729
|
"example": null,
|
|
1740
1730
|
"parameters": []
|
|
1741
1731
|
},
|
|
@@ -1746,7 +1736,16 @@
|
|
|
1746
1736
|
"required": false,
|
|
1747
1737
|
"type": "void",
|
|
1748
1738
|
"example": null,
|
|
1749
|
-
"parameters": [
|
|
1739
|
+
"parameters": [
|
|
1740
|
+
{
|
|
1741
|
+
"name": "config",
|
|
1742
|
+
"decorators": [],
|
|
1743
|
+
"description": "",
|
|
1744
|
+
"required": true,
|
|
1745
|
+
"type": "IStoreComponentConfig",
|
|
1746
|
+
"example": null
|
|
1747
|
+
}
|
|
1748
|
+
]
|
|
1750
1749
|
},
|
|
1751
1750
|
{
|
|
1752
1751
|
"name": "initStore",
|
|
@@ -1755,14 +1754,23 @@
|
|
|
1755
1754
|
"required": false,
|
|
1756
1755
|
"type": "void",
|
|
1757
1756
|
"example": null,
|
|
1758
|
-
"parameters": [
|
|
1757
|
+
"parameters": [
|
|
1758
|
+
{
|
|
1759
|
+
"name": "config",
|
|
1760
|
+
"decorators": [],
|
|
1761
|
+
"description": "",
|
|
1762
|
+
"required": true,
|
|
1763
|
+
"type": "IStoreComponentConfig",
|
|
1764
|
+
"example": null
|
|
1765
|
+
}
|
|
1766
|
+
]
|
|
1759
1767
|
},
|
|
1760
1768
|
{
|
|
1761
1769
|
"name": "subscribe",
|
|
1762
1770
|
"decorators": [],
|
|
1763
1771
|
"description": "Подписка",
|
|
1764
1772
|
"required": false,
|
|
1765
|
-
"type": "
|
|
1773
|
+
"type": "Unsubscribe",
|
|
1766
1774
|
"example": null,
|
|
1767
1775
|
"parameters": [
|
|
1768
1776
|
{
|
|
@@ -1770,7 +1778,7 @@
|
|
|
1770
1778
|
"decorators": [],
|
|
1771
1779
|
"description": "Обработчик изменения состояния.\n",
|
|
1772
1780
|
"required": true,
|
|
1773
|
-
"type": "
|
|
1781
|
+
"type": "{}",
|
|
1774
1782
|
"example": null
|
|
1775
1783
|
}
|
|
1776
1784
|
]
|
|
@@ -3647,7 +3655,7 @@
|
|
|
3647
3655
|
"decorators": [],
|
|
3648
3656
|
"description": "",
|
|
3649
3657
|
"required": false,
|
|
3650
|
-
"type": "T | {
|
|
3658
|
+
"type": "T | {error: string, errors: Record, message: string, statusCode: number}",
|
|
3651
3659
|
"example": null
|
|
3652
3660
|
},
|
|
3653
3661
|
{
|
|
@@ -29902,7 +29910,7 @@
|
|
|
29902
29910
|
{
|
|
29903
29911
|
"name": "marks",
|
|
29904
29912
|
"decorators": [],
|
|
29905
|
-
"description": "Метки на ползунке. В объекте
|
|
29913
|
+
"description": "Метки на ползунке. В объекте {key: 'value'} key определяет положение, а value определяет, что будет отображаться.\nЕсли вы хотите задать стиль определенной точки метки, значением должен быть объект,\nсодержащий свойства style и label.",
|
|
29906
29914
|
"required": false,
|
|
29907
29915
|
"type": "Record",
|
|
29908
29916
|
"example": "{\n min: 20,\n 40: 40,\n max: 100\n}",
|
|
@@ -30200,7 +30208,7 @@
|
|
|
30200
30208
|
{
|
|
30201
30209
|
"name": "marks",
|
|
30202
30210
|
"decorators": [],
|
|
30203
|
-
"description": "Метки на ползунке. В объекте
|
|
30211
|
+
"description": "Метки на ползунке. В объекте {key: 'value'} key определяет положение, а value определяет, что будет отображаться.\nЕсли вы хотите задать стиль определенной точки метки, значением должен быть объект,\nсодержащий свойства style и label.",
|
|
30204
30212
|
"required": false,
|
|
30205
30213
|
"type": "Record",
|
|
30206
30214
|
"example": "{\n min: 20,\n 40: 40,\n max: 100\n}"
|
|
@@ -33254,14 +33262,6 @@
|
|
|
33254
33262
|
"type": "boolean",
|
|
33255
33263
|
"example": null
|
|
33256
33264
|
},
|
|
33257
|
-
{
|
|
33258
|
-
"name": "level",
|
|
33259
|
-
"decorators": [],
|
|
33260
|
-
"description": "Цвет всплывающего уведомления",
|
|
33261
|
-
"required": false,
|
|
33262
|
-
"type": "string",
|
|
33263
|
-
"example": "warning"
|
|
33264
|
-
},
|
|
33265
33265
|
{
|
|
33266
33266
|
"name": "message",
|
|
33267
33267
|
"decorators": [],
|
|
@@ -33277,6 +33277,14 @@
|
|
|
33277
33277
|
"required": true,
|
|
33278
33278
|
"type": "string",
|
|
33279
33279
|
"example": null
|
|
33280
|
+
},
|
|
33281
|
+
{
|
|
33282
|
+
"name": "type",
|
|
33283
|
+
"decorators": [],
|
|
33284
|
+
"description": "Цвет всплывающего уведомления",
|
|
33285
|
+
"required": false,
|
|
33286
|
+
"type": "string",
|
|
33287
|
+
"example": "warning"
|
|
33280
33288
|
}
|
|
33281
33289
|
],
|
|
33282
33290
|
"methods": [
|
|
@@ -41871,6 +41879,30 @@
|
|
|
41871
41879
|
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
41872
41880
|
"example": null
|
|
41873
41881
|
},
|
|
41882
|
+
"AlertColorName": {
|
|
41883
|
+
"name": "AlertColorName",
|
|
41884
|
+
"decorators": [],
|
|
41885
|
+
"description": "Название цвета для Alert и Notification",
|
|
41886
|
+
"required": true,
|
|
41887
|
+
"type": "\"success\" | \"info\" | \"warning\" | \"error\" | \"default\" | string",
|
|
41888
|
+
"example": null
|
|
41889
|
+
},
|
|
41890
|
+
"BadgeColorName": {
|
|
41891
|
+
"name": "BadgeColorName",
|
|
41892
|
+
"decorators": [],
|
|
41893
|
+
"description": "Название цвета для Badge",
|
|
41894
|
+
"required": true,
|
|
41895
|
+
"type": "\"primary\" | \"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\" | string",
|
|
41896
|
+
"example": null
|
|
41897
|
+
},
|
|
41898
|
+
"ButtonColorName": {
|
|
41899
|
+
"name": "ButtonColorName",
|
|
41900
|
+
"decorators": [],
|
|
41901
|
+
"description": "Название цвета для Button",
|
|
41902
|
+
"required": true,
|
|
41903
|
+
"type": "\"basic\" | \"primary\" | \"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\" | string",
|
|
41904
|
+
"example": null
|
|
41905
|
+
},
|
|
41874
41906
|
"ColorName": {
|
|
41875
41907
|
"name": "ColorName",
|
|
41876
41908
|
"decorators": [],
|
|
@@ -41967,6 +41999,14 @@
|
|
|
41967
41999
|
"type": "\"small\" | \"middle\" | \"large\" | string",
|
|
41968
42000
|
"example": null
|
|
41969
42001
|
},
|
|
42002
|
+
"TypographyColorName": {
|
|
42003
|
+
"name": "TypographyColorName",
|
|
42004
|
+
"decorators": [],
|
|
42005
|
+
"description": "Название цвета для Text, Title",
|
|
42006
|
+
"required": true,
|
|
42007
|
+
"type": "\"primary\" | \"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\" | \"text-color\" | string",
|
|
42008
|
+
"example": null
|
|
42009
|
+
},
|
|
41970
42010
|
"TNotificationsState": {
|
|
41971
42011
|
"name": "TNotificationsState",
|
|
41972
42012
|
"decorators": [],
|
|
@@ -43476,7 +43516,9 @@
|
|
|
43476
43516
|
"moduleName": "components/ResourceComponent",
|
|
43477
43517
|
"title": "Resource Component",
|
|
43478
43518
|
"description": "Компонент для подгрузки внешних API: Google Maps, Yandex Maps, Twitter, ...",
|
|
43479
|
-
"tags": {
|
|
43519
|
+
"tags": {
|
|
43520
|
+
"deprecated": ""
|
|
43521
|
+
},
|
|
43480
43522
|
"properties": [
|
|
43481
43523
|
{
|
|
43482
43524
|
"name": "RESOURCE_GEETEST_API",
|
|
@@ -43709,7 +43751,7 @@
|
|
|
43709
43751
|
"decorators": [],
|
|
43710
43752
|
"description": "Редьюсеры",
|
|
43711
43753
|
"required": true,
|
|
43712
|
-
"type": "
|
|
43754
|
+
"type": "CreateRootReducer",
|
|
43713
43755
|
"example": null
|
|
43714
43756
|
},
|
|
43715
43757
|
{
|
|
@@ -43717,7 +43759,7 @@
|
|
|
43717
43759
|
"decorators": [],
|
|
43718
43760
|
"description": "Хранилище",
|
|
43719
43761
|
"required": true,
|
|
43720
|
-
"type": "
|
|
43762
|
+
"type": "Store",
|
|
43721
43763
|
"example": null
|
|
43722
43764
|
}
|
|
43723
43765
|
],
|
|
@@ -43735,7 +43777,7 @@
|
|
|
43735
43777
|
"decorators": [],
|
|
43736
43778
|
"description": "",
|
|
43737
43779
|
"required": true,
|
|
43738
|
-
"type": "
|
|
43780
|
+
"type": "AsyncReducersMap",
|
|
43739
43781
|
"example": null
|
|
43740
43782
|
}
|
|
43741
43783
|
]
|
|
@@ -43843,7 +43885,7 @@
|
|
|
43843
43885
|
"decorators": [],
|
|
43844
43886
|
"description": "Подписка",
|
|
43845
43887
|
"required": false,
|
|
43846
|
-
"type": "
|
|
43888
|
+
"type": "Unsubscribe",
|
|
43847
43889
|
"example": null,
|
|
43848
43890
|
"parameters": [
|
|
43849
43891
|
{
|
package/en.json
CHANGED
|
@@ -1054,6 +1054,12 @@
|
|
|
1054
1054
|
"Задержка в мс": "Delay in ms",
|
|
1055
1055
|
"Дополнительное содержание сообщения": "Additional message content",
|
|
1056
1056
|
"Задержка применения введённого значения": "Delay in applying the entered value",
|
|
1057
|
+
"Применяется для SSR. Если fetch критический — SSR вернет страницу со статус кодом ошибки.": "Used for SSR. If the fetch is critical, SSR will return the page with an error status code.",
|
|
1058
|
+
"Дополнительное содержание сообщения.": "Additional message content.",
|
|
1059
|
+
"Метки на ползунке. В объекте {key: 'value'} key определяет положение, а value определяет, что будет отображаться.\nЕсли вы хотите задать стиль определенной точки метки, значением должен быть объект,\nсодержащий свойства style и label.": "Labels on the slider. In the object {key: 'value'}, the key determines the position, and the value determines what will be displayed.\nIf you want to set a style for a specific label point, the value must be an object\ncontaining the style and label properties.",
|
|
1057
1060
|
"Применяется для ssr. Если fetch критический — ssr вернет страницу со статус кодом ошибки.": "",
|
|
1058
|
-
"
|
|
1061
|
+
"Название цвета для Alert и Notification": "",
|
|
1062
|
+
"Название цвета для Badge": "",
|
|
1063
|
+
"Название цвета для Button": "",
|
|
1064
|
+
"Название цвета для Text, Title": ""
|
|
1059
1065
|
}
|
package/hooks/index.d.ts
CHANGED
|
@@ -12,17 +12,17 @@ import useForm from './useForm';
|
|
|
12
12
|
import useInitial from './useInitial';
|
|
13
13
|
import useLayout from './useLayout';
|
|
14
14
|
import useList from './useList';
|
|
15
|
+
import useListField from './useListField';
|
|
15
16
|
import useModel from './useModel';
|
|
17
|
+
import useSaveCursorPosition from './useSaveCursorPosition';
|
|
16
18
|
import useScreen from './useScreen';
|
|
17
19
|
import useSelector from './useSelector';
|
|
18
20
|
import useSsr from './useSsr';
|
|
19
|
-
import useUniqueId from './useUniqueId';
|
|
20
21
|
import useTheme from './useTheme';
|
|
21
22
|
import useTree from './useTree';
|
|
23
|
+
import useUniqueId from './useUniqueId';
|
|
24
|
+
import useCalendarControls from '../ui/content/CalendarSystem/hooks/useCalendarControls';
|
|
25
|
+
import useDisplayDate from '../ui/content/CalendarSystem/hooks/useDisplayDate';
|
|
22
26
|
import useMonthGrid from '../ui/content/CalendarSystem/hooks/useMonthGrid';
|
|
23
27
|
import useWeekGrid from '../ui/content/CalendarSystem/hooks/useWeekGrid';
|
|
24
|
-
import useDisplayDate from '../ui/content/CalendarSystem/hooks/useDisplayDate';
|
|
25
|
-
import useCalendarControls from '../ui/content/CalendarSystem/hooks/useCalendarControls';
|
|
26
|
-
import useSaveCursorPosition from './useSaveCursorPosition';
|
|
27
|
-
import useListField from './useListField';
|
|
28
28
|
export { useAbsolutePositioning, useAddressBar, useApplication, useBem, useComponents, useDataProvider, useDataSelect, useDispatch, useFetch, useFile, useForm, useInitial, useLayout, useList, useModel, useScreen, useSelector, useSsr, useUniqueId, useTheme, useTree, useMonthGrid, useWeekGrid, useDisplayDate, useCalendarControls, useSaveCursorPosition, useListField, };
|
package/hooks/index.js
CHANGED
|
@@ -32,29 +32,29 @@ var useLayout_1 = __importDefault(require("./useLayout"));
|
|
|
32
32
|
exports.useLayout = useLayout_1["default"];
|
|
33
33
|
var useList_1 = __importDefault(require("./useList"));
|
|
34
34
|
exports.useList = useList_1["default"];
|
|
35
|
+
var useListField_1 = __importDefault(require("./useListField"));
|
|
36
|
+
exports.useListField = useListField_1["default"];
|
|
35
37
|
var useModel_1 = __importDefault(require("./useModel"));
|
|
36
38
|
exports.useModel = useModel_1["default"];
|
|
39
|
+
var useSaveCursorPosition_1 = __importDefault(require("./useSaveCursorPosition"));
|
|
40
|
+
exports.useSaveCursorPosition = useSaveCursorPosition_1["default"];
|
|
37
41
|
var useScreen_1 = __importDefault(require("./useScreen"));
|
|
38
42
|
exports.useScreen = useScreen_1["default"];
|
|
39
43
|
var useSelector_1 = __importDefault(require("./useSelector"));
|
|
40
44
|
exports.useSelector = useSelector_1["default"];
|
|
41
45
|
var useSsr_1 = __importDefault(require("./useSsr"));
|
|
42
46
|
exports.useSsr = useSsr_1["default"];
|
|
43
|
-
var useUniqueId_1 = __importDefault(require("./useUniqueId"));
|
|
44
|
-
exports.useUniqueId = useUniqueId_1["default"];
|
|
45
47
|
var useTheme_1 = __importDefault(require("./useTheme"));
|
|
46
48
|
exports.useTheme = useTheme_1["default"];
|
|
47
49
|
var useTree_1 = __importDefault(require("./useTree"));
|
|
48
50
|
exports.useTree = useTree_1["default"];
|
|
51
|
+
var useUniqueId_1 = __importDefault(require("./useUniqueId"));
|
|
52
|
+
exports.useUniqueId = useUniqueId_1["default"];
|
|
53
|
+
var useCalendarControls_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useCalendarControls"));
|
|
54
|
+
exports.useCalendarControls = useCalendarControls_1["default"];
|
|
55
|
+
var useDisplayDate_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useDisplayDate"));
|
|
56
|
+
exports.useDisplayDate = useDisplayDate_1["default"];
|
|
49
57
|
var useMonthGrid_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useMonthGrid"));
|
|
50
58
|
exports.useMonthGrid = useMonthGrid_1["default"];
|
|
51
59
|
var useWeekGrid_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useWeekGrid"));
|
|
52
60
|
exports.useWeekGrid = useWeekGrid_1["default"];
|
|
53
|
-
var useDisplayDate_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useDisplayDate"));
|
|
54
|
-
exports.useDisplayDate = useDisplayDate_1["default"];
|
|
55
|
-
var useCalendarControls_1 = __importDefault(require("../ui/content/CalendarSystem/hooks/useCalendarControls"));
|
|
56
|
-
exports.useCalendarControls = useCalendarControls_1["default"];
|
|
57
|
-
var useSaveCursorPosition_1 = __importDefault(require("./useSaveCursorPosition"));
|
|
58
|
-
exports.useSaveCursorPosition = useSaveCursorPosition_1["default"];
|
|
59
|
-
var useListField_1 = __importDefault(require("./useListField"));
|
|
60
|
-
exports.useListField = useListField_1["default"];
|
package/hooks/useAddressBar.js
CHANGED
|
@@ -27,16 +27,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
exports.__esModule = true;
|
|
29
29
|
exports.queryReplace = exports.queryRestore = exports.defaultToStringConverter = exports.defaultFromStringConverter = void 0;
|
|
30
|
-
var get_1 = __importDefault(require("lodash-es/get"));
|
|
31
|
-
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
32
|
-
var queryString = __importStar(require("qs"));
|
|
33
30
|
var connected_react_router_1 = require("connected-react-router");
|
|
34
|
-
var
|
|
31
|
+
var get_1 = __importDefault(require("lodash-es/get"));
|
|
35
32
|
var has_1 = __importDefault(require("lodash-es/has"));
|
|
33
|
+
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
36
34
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
35
|
+
var toInteger_1 = __importDefault(require("lodash-es/toInteger"));
|
|
36
|
+
var queryString = __importStar(require("qs"));
|
|
37
37
|
var react_1 = require("react");
|
|
38
|
-
var useSelector_1 = __importDefault(require("../hooks/useSelector"));
|
|
39
38
|
var useDispatch_1 = __importDefault(require("../hooks/useDispatch"));
|
|
39
|
+
var useSelector_1 = __importDefault(require("../hooks/useSelector"));
|
|
40
40
|
var ARRAY_VALUE_SEPARATOR = '_';
|
|
41
41
|
var defaultFromStringConverter = function (value, type, item) {
|
|
42
42
|
type = type || '';
|
|
@@ -53,8 +53,8 @@ var defaultFromStringConverter = function (value, type, item) {
|
|
|
53
53
|
return value || String(value) === '0' ? (0, toInteger_1["default"])(value) : null;
|
|
54
54
|
case 'boolean':
|
|
55
55
|
return ['1', 't', 'y'].includes(String(value).substr(0, 1)) || null;
|
|
56
|
-
default:
|
|
57
56
|
case 'string':
|
|
57
|
+
default:
|
|
58
58
|
return value ? String(value) : null;
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -71,9 +71,9 @@ var defaultToStringConverter = function (value, type, item) {
|
|
|
71
71
|
switch (type) {
|
|
72
72
|
case 'boolean':
|
|
73
73
|
return value ? '1' : null;
|
|
74
|
-
default:
|
|
75
74
|
case 'string':
|
|
76
75
|
case 'number':
|
|
76
|
+
default:
|
|
77
77
|
return value ? String(value) : null;
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -85,7 +85,9 @@ var queryRestore = function (model, location, useHash) {
|
|
|
85
85
|
var attributes = (model === null || model === void 0 ? void 0 : model.attributes) || Object.keys(values);
|
|
86
86
|
attributes.forEach(function (item) {
|
|
87
87
|
if (typeof item === 'string') {
|
|
88
|
-
item = {
|
|
88
|
+
item = {
|
|
89
|
+
attribute: item
|
|
90
|
+
};
|
|
89
91
|
}
|
|
90
92
|
var defaultValue = (0, has_1["default"])(item, 'defaultValue') ? item.defaultValue : null;
|
|
91
93
|
var converter = item.fromStringConverter || exports.defaultFromStringConverter;
|
|
@@ -102,7 +104,9 @@ var queryReplace = function (model, location, values, useHash) {
|
|
|
102
104
|
var attributes = (model === null || model === void 0 ? void 0 : model.attributes) || Object.keys(values);
|
|
103
105
|
attributes.forEach(function (item) {
|
|
104
106
|
if (typeof item === 'string') {
|
|
105
|
-
item = {
|
|
107
|
+
item = {
|
|
108
|
+
attribute: item
|
|
109
|
+
};
|
|
106
110
|
}
|
|
107
111
|
var defaultValue = (0, has_1["default"])(item, 'defaultValue') ? item.defaultValue : null;
|
|
108
112
|
if ((values === null || values === void 0 ? void 0 : values[item.attribute]) !== defaultValue) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import ClientStorageComponent, { IClientStorageComponentConfig } from '../components/ClientStorageComponent';
|
|
3
|
+
import HtmlComponent from '../components/HtmlComponent';
|
|
2
4
|
import { IHttpComponentConfig } from '../components/HttpComponent';
|
|
3
|
-
import { IWebSocketComponentConfig } from '../components/WebSocketComponent';
|
|
4
|
-
import { ILocaleComponentConfig } from '../components/LocaleComponent';
|
|
5
5
|
import { IJwtHttpComponentConfig } from '../components/JwtHttpComponent';
|
|
6
|
+
import { ILocaleComponentConfig } from '../components/LocaleComponent';
|
|
7
|
+
import MetaComponent from '../components/MetaComponent';
|
|
8
|
+
import MetricsComponent from '../components/MetricsComponent';
|
|
6
9
|
import { IResourceComponentConfig } from '../components/ResourceComponent';
|
|
7
|
-
import { IThemeProviderProps } from '../providers/ThemeProvider';
|
|
8
|
-
import ClientStorageComponent, { IClientStorageComponentConfig } from '../components/ClientStorageComponent';
|
|
9
|
-
import HtmlComponent from '../components/HtmlComponent';
|
|
10
10
|
import StoreComponent from '../components/StoreComponent';
|
|
11
11
|
import UiComponent from '../components/UiComponent';
|
|
12
|
-
import
|
|
12
|
+
import { IWebSocketComponentConfig } from '../components/WebSocketComponent';
|
|
13
|
+
import { IFetchConfig } from '../hooks/useFetch';
|
|
13
14
|
import { IComponents } from '../providers/ComponentsProvider';
|
|
14
|
-
import { IRouteItem, IRouterProps } from '../ui/nav/Router/Router';
|
|
15
|
-
import MetricsComponent from '../components/MetricsComponent';
|
|
16
15
|
import { IScreenProviderProps } from '../providers/ScreenProvider';
|
|
17
|
-
import {
|
|
16
|
+
import { IThemeProviderProps } from '../providers/ThemeProvider';
|
|
17
|
+
import { IRouteItem, IRouterProps } from '../ui/nav/Router/Router';
|
|
18
18
|
export interface IComponentConfig {
|
|
19
19
|
className?: Record<string, any>;
|
|
20
20
|
[key: string]: any;
|
package/hooks/useApplication.js
CHANGED
|
@@ -49,28 +49,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
49
49
|
};
|
|
50
50
|
exports.__esModule = true;
|
|
51
51
|
exports.defaultComponents = void 0;
|
|
52
|
-
var React = __importStar(require("react"));
|
|
53
|
-
var react_redux_1 = require("react-redux");
|
|
54
|
-
var merge_1 = __importDefault(require("lodash-es/merge"));
|
|
55
|
-
var react_1 = require("react");
|
|
56
|
-
var relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
57
|
-
var localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
|
|
58
|
-
var localeData_1 = __importDefault(require("dayjs/plugin/localeData"));
|
|
59
|
-
var customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
60
52
|
var dayjs_1 = __importDefault(require("dayjs"));
|
|
61
|
-
var
|
|
53
|
+
var customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
62
54
|
var isToday_1 = __importDefault(require("dayjs/plugin/isToday"));
|
|
63
|
-
var
|
|
55
|
+
var localeData_1 = __importDefault(require("dayjs/plugin/localeData"));
|
|
56
|
+
var localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
|
|
57
|
+
var relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
58
|
+
var utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
59
|
+
var merge_1 = __importDefault(require("lodash-es/merge"));
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var react_1 = require("react");
|
|
62
|
+
var react_redux_1 = require("react-redux");
|
|
63
|
+
var useComponents_1 = __importDefault(require("./useComponents"));
|
|
64
64
|
var ClientStorageComponent_1 = __importDefault(require("../components/ClientStorageComponent"));
|
|
65
65
|
var HtmlComponent_1 = __importDefault(require("../components/HtmlComponent"));
|
|
66
|
+
var MetaComponent_1 = __importDefault(require("../components/MetaComponent"));
|
|
67
|
+
var MetricsComponent_1 = __importDefault(require("../components/MetricsComponent"));
|
|
66
68
|
var StoreComponent_1 = __importDefault(require("../components/StoreComponent"));
|
|
67
69
|
var UiComponent_1 = __importDefault(require("../components/UiComponent"));
|
|
68
|
-
var MetaComponent_1 = __importDefault(require("../components/MetaComponent"));
|
|
69
70
|
var ComponentsProvider_1 = __importDefault(require("../providers/ComponentsProvider"));
|
|
70
|
-
var Router_1 = __importDefault(require("../ui/nav/Router/Router"));
|
|
71
|
-
var MetricsComponent_1 = __importDefault(require("../components/MetricsComponent"));
|
|
72
71
|
var ScreenProvider_1 = __importDefault(require("../providers/ScreenProvider"));
|
|
73
|
-
var
|
|
72
|
+
var ThemeProvider_1 = __importDefault(require("../providers/ThemeProvider"));
|
|
73
|
+
var Router_1 = __importDefault(require("../ui/nav/Router/Router"));
|
|
74
74
|
exports.defaultComponents = {
|
|
75
75
|
clientStorage: {
|
|
76
76
|
className: ClientStorageComponent_1["default"]
|
|
@@ -118,7 +118,9 @@ function useApplication(config) {
|
|
|
118
118
|
var componentsConfig_1 = (0, merge_1["default"])({}, exports.defaultComponents, config.components);
|
|
119
119
|
Object.keys(componentsConfig_1).forEach(function (name) {
|
|
120
120
|
if (typeof componentsConfig_1[name] === 'function') {
|
|
121
|
-
componentsConfig_1[name] = {
|
|
121
|
+
componentsConfig_1[name] = {
|
|
122
|
+
className: componentsConfig_1[name]
|
|
123
|
+
};
|
|
122
124
|
}
|
|
123
125
|
var _a = componentsConfig_1[name], className = _a.className, componentConfig = __rest(_a, ["className"]);
|
|
124
126
|
// Append reducers to store
|
package/hooks/useDataProvider.js
CHANGED
|
@@ -59,18 +59,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
61
|
exports.__esModule = true;
|
|
62
|
-
var react_redux_1 = require("react-redux");
|
|
63
|
-
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
64
|
-
var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
|
|
65
62
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
63
|
+
var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
|
|
64
|
+
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
66
65
|
var uniqBy_1 = __importDefault(require("lodash-es/uniqBy"));
|
|
67
66
|
var react_1 = require("react");
|
|
67
|
+
var react_redux_1 = require("react-redux");
|
|
68
68
|
var react_use_1 = require("react-use");
|
|
69
69
|
var fields_1 = require("../actions/fields");
|
|
70
|
-
var data_1 = require("../utils/data");
|
|
71
|
-
var index_1 = require("./index");
|
|
72
70
|
var fields_2 = require("../reducers/fields");
|
|
71
|
+
var data_1 = require("../utils/data");
|
|
73
72
|
var text_1 = require("../utils/text");
|
|
73
|
+
var index_1 = require("./index");
|
|
74
74
|
var defaultProps = {
|
|
75
75
|
autoComplete: {
|
|
76
76
|
enable: false,
|
|
@@ -117,7 +117,9 @@ function useDataProvider(config) {
|
|
|
117
117
|
}
|
|
118
118
|
}, [prevInitialItems, initialItems]);
|
|
119
119
|
// Normalize autoComplete
|
|
120
|
-
var autoComplete = (0, react_1.useMemo)(function () { return (__assign(__assign({}, defaultProps.autoComplete), (typeof config.autoComplete === 'boolean') ? {
|
|
120
|
+
var autoComplete = (0, react_1.useMemo)(function () { return (__assign(__assign({}, defaultProps.autoComplete), (typeof config.autoComplete === 'boolean') ? {
|
|
121
|
+
enable: config.autoComplete
|
|
122
|
+
} : config.autoComplete)); }, [config.autoComplete]);
|
|
121
123
|
var dataProvider = (0, react_1.useMemo)(function () { return (__assign({ action: '', actionMethod: 'get', params: null, onSearch: null }, config.dataProvider)); }, [config.dataProvider]);
|
|
122
124
|
// Fetch data
|
|
123
125
|
var delayTimerRef = (0, react_1.useRef)(null);
|
|
@@ -135,7 +137,11 @@ function useDataProvider(config) {
|
|
|
135
137
|
searchHandler = dataProvider.onSearch || (function (method, params) { return components.http
|
|
136
138
|
.send(dataProvider.actionMethod, method, params)
|
|
137
139
|
.then(function (response) { return response.data; }); });
|
|
138
|
-
result = searchHandler(dataProvider.action, __assign(__assign(__assign({ query: config.query }, (isAuto ? {
|
|
140
|
+
result = searchHandler(dataProvider.action, __assign(__assign(__assign({ query: config.query }, (isAuto ? {
|
|
141
|
+
ids: config.initialSelectedIds
|
|
142
|
+
} : null)), (((_a = config.initialSelectedIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? {
|
|
143
|
+
withIds: config.initialSelectedIds
|
|
144
|
+
} : null)), config.dataProvider.params));
|
|
139
145
|
if (!(result && (0, isFunction_1["default"])(result.then))) return [3 /*break*/, 2];
|
|
140
146
|
setIsLoading(true);
|
|
141
147
|
return [4 /*yield*/, result];
|
package/hooks/useDataSelect.js
CHANGED
|
@@ -13,12 +13,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
exports.__esModule = true;
|
|
15
15
|
exports.getFlattenedItems = void 0;
|
|
16
|
-
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
17
|
-
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
18
|
-
var isArray_1 = __importDefault(require("lodash-es/isArray"));
|
|
19
|
-
var isNil_1 = __importDefault(require("lodash-es/isNil"));
|
|
20
16
|
var difference_1 = __importDefault(require("lodash-es/difference"));
|
|
21
17
|
var intersection_1 = __importDefault(require("lodash-es/intersection"));
|
|
18
|
+
var isArray_1 = __importDefault(require("lodash-es/isArray"));
|
|
19
|
+
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
20
|
+
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
21
|
+
var isNil_1 = __importDefault(require("lodash-es/isNil"));
|
|
22
22
|
var pullAll_1 = __importDefault(require("lodash-es/pullAll"));
|
|
23
23
|
var react_1 = require("react");
|
|
24
24
|
var react_use_1 = require("react-use");
|
package/hooks/useFetch.d.ts
CHANGED
|
@@ -19,13 +19,12 @@ 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?: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} | T;
|
|
22
|
+
data?: T | undefined | null | {
|
|
23
|
+
statusCode: number;
|
|
24
|
+
error?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
errors?: Record<string, unknown>;
|
|
27
|
+
};
|
|
29
28
|
isLoading: boolean;
|
|
30
29
|
fetch: (newParams?: Record<string, unknown>) => void;
|
|
31
30
|
axiosError: AxiosError | null;
|
package/hooks/useFetch.js
CHANGED
|
@@ -51,10 +51,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
exports.__esModule = true;
|
|
53
53
|
exports.fetchData = exports.defaultFetchHandler = exports.getConfigId = exports.normalizeConfig = void 0;
|
|
54
|
+
var axios_1 = __importDefault(require("axios"));
|
|
55
|
+
var trim_1 = __importDefault(require("lodash-es/trim"));
|
|
54
56
|
var react_1 = require("react");
|
|
55
57
|
var react_use_1 = require("react-use");
|
|
56
|
-
var trim_1 = __importDefault(require("lodash-es/trim"));
|
|
57
|
-
var axios_1 = __importDefault(require("axios"));
|
|
58
58
|
var index_1 = require("./index");
|
|
59
59
|
var normalizeConfig = function (config) { return (config
|
|
60
60
|
? __assign({ id: null, url: '', method: 'get', params: {}, options: null, onFetch: null }, config) : null); };
|
package/hooks/useFile.js
CHANGED
|
@@ -15,15 +15,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
17
|
exports.generateBackendUrl = exports.imagesMimeTypes = void 0;
|
|
18
|
-
var
|
|
19
|
-
var react_use_1 = require("react-use");
|
|
18
|
+
var buildURL_1 = __importDefault(require("axios/lib/helpers/buildURL"));
|
|
20
19
|
var fileup_core_1 = __importDefault(require("fileup-core"));
|
|
21
20
|
var File_1 = __importDefault(require("fileup-core/lib/models/File"));
|
|
22
21
|
var QueueCollection_1 = __importDefault(require("fileup-core/lib/models/QueueCollection"));
|
|
22
|
+
var difference_1 = __importDefault(require("lodash-es/difference"));
|
|
23
23
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
24
24
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var react_1 = require("react");
|
|
26
|
+
var react_use_1 = require("react-use");
|
|
27
27
|
var useInitial_1 = __importDefault(require("./useInitial"));
|
|
28
28
|
var index_1 = require("./index");
|
|
29
29
|
exports.imagesMimeTypes = [
|
|
@@ -55,10 +55,13 @@ function generateAcceptString(props) {
|
|
|
55
55
|
}
|
|
56
56
|
function useFile(props) {
|
|
57
57
|
var http = (0, index_1.useComponents)().http;
|
|
58
|
-
|
|
58
|
+
// TODO Run promise..
|
|
59
|
+
http.getAccessToken();
|
|
59
60
|
var uploader = (0, useInitial_1["default"])(function () {
|
|
60
61
|
var _a;
|
|
61
|
-
return new fileup_core_1["default"](__assign(__assign({ backendUrl: generateBackendUrl(props), uploaderConfig: __assign(__assign({}, props.uploaderConfig), { headers: __assign(__assign({}, (_a = props.uploaderConfig) === null || _a === void 0 ? void 0 : _a.headers), {
|
|
62
|
+
return new fileup_core_1["default"](__assign(__assign({ backendUrl: generateBackendUrl(props), uploaderConfig: __assign(__assign({}, props.uploaderConfig), { headers: __assign(__assign({}, (_a = props.uploaderConfig) === null || _a === void 0 ? void 0 : _a.headers), {
|
|
63
|
+
// TODO how to get access token wuthout promise?
|
|
64
|
+
Authorization: 'Bearer ' + http._accessToken }) }) }, props.uploader), { dropArea: (props === null || props === void 0 ? void 0 : props.hasDropArea)
|
|
62
65
|
? {
|
|
63
66
|
className: props.uploader.dropArea.className,
|
|
64
67
|
container: props.dropRef.current,
|
|
@@ -93,7 +96,9 @@ function useFile(props) {
|
|
|
93
96
|
.map(function (item) {
|
|
94
97
|
var path = item.title || item.label || item.uid || item.id;
|
|
95
98
|
var resultHttpMessage = __assign(__assign({}, item), { id: item.id || item.uid, images: item.thumbnailUrl
|
|
96
|
-
? [{
|
|
99
|
+
? [{
|
|
100
|
+
url: item.thumbnailUrl
|
|
101
|
+
}]
|
|
97
102
|
: null });
|
|
98
103
|
var file = uploader.queue.getByUid(item.uid);
|
|
99
104
|
if (file) {
|