@steroidsjs/core 3.0.94 → 3.1.1
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/list.d.ts +6 -0
- package/actions/list.js +8 -1
- package/components/HtmlComponent.d.ts +3 -3
- package/components/HttpComponent.d.ts +18 -15
- package/components/HttpComponent.js +40 -18
- package/components/LocaleComponent.js +5 -28
- package/components/UiComponent.d.ts +0 -1
- package/components/UiComponent.js +2 -25
- package/docs-autogen-result.json +86 -60
- package/hooks/useAbsolutePositioning.d.ts +2 -2
- package/hooks/useApplication.js +6 -29
- package/hooks/useFetch.d.ts +3 -8
- package/hooks/useFetch.js +18 -12
- package/hooks/useList.js +24 -32
- package/hooks/useListField.js +3 -25
- package/hooks/useTree.d.ts +3 -3
- package/package.json +1 -1
- package/providers/ComponentsProvider.d.ts +1 -2
- package/providers/ComponentsProvider.js +14 -25
- package/providers/ScreenProvider.d.ts +1 -2
- package/providers/ScreenProvider.js +13 -25
- package/providers/SsrProvider.d.ts +1 -2
- package/providers/SsrProvider.js +13 -25
- package/providers/ThemeProvider.d.ts +4 -4
- package/providers/ThemeProvider.js +18 -29
- package/reducers/list.d.ts +0 -1
- package/reducers/list.js +5 -4
- package/ui/content/Accordion/Accordion.d.ts +5 -5
- package/ui/content/Accordion/Accordion.js +5 -28
- package/ui/content/Alert/Alert.d.ts +2 -2
- package/ui/content/Avatar/Avatar.d.ts +2 -2
- package/ui/content/Avatar/AvatarGroup.d.ts +2 -2
- package/ui/content/Avatar/AvatarGroup.js +3 -25
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +5 -5
- package/ui/content/CalendarSystem/CalendarSystem.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarControls.d.ts +3 -3
- package/ui/content/CalendarSystem/hooks/useCalendarControls.js +2 -25
- package/ui/content/CalendarSystem/hooks/useCalendarSystem.d.ts +3 -3
- package/ui/content/CalendarSystem/hooks/useCalendarSystem.js +8 -31
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.d.ts +0 -1
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +4 -4
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.d.ts +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +6 -6
- package/ui/content/CalendarSystem/hooks/useCalendarType.js +3 -3
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +2 -2
- package/ui/content/CalendarSystem/hooks/useExpandClickAway.d.ts +3 -3
- package/ui/content/CalendarSystem/hooks/useExpandClickAway.js +3 -6
- package/ui/content/Card/Card.d.ts +3 -3
- package/ui/content/Chat/Chat.d.ts +3 -3
- package/ui/content/Chat/Chat.js +3 -25
- package/ui/content/CopyToClipboard/CopyToClipboard.d.ts +4 -4
- package/ui/content/Dashboard/Dashboard.d.ts +2 -2
- package/ui/content/Dashboard/Dashboard.js +4 -26
- package/ui/content/Detail/Detail.d.ts +3 -3
- package/ui/content/Detail/Detail.js +3 -26
- package/ui/content/Detail/DetailItem.d.ts +3 -3
- package/ui/content/DropDown/DropDown.d.ts +2 -2
- package/ui/content/DropDown/DropDown.js +5 -31
- package/ui/content/Kanban/Kanban.js +15 -26
- package/ui/content/Kanban/hooks/useKanban.js +7 -30
- package/ui/content/Menu/Menu.d.ts +3 -3
- package/ui/content/Slider/Slider.d.ts +2 -2
- package/ui/content/Slider/Slider.js +2 -5
- package/ui/crud/Crud/Crud.d.ts +4 -5
- package/ui/crud/Crud/Crud.js +2 -25
- package/ui/crud/Crud/CrudContent.js +8 -35
- package/ui/crud/Crud/CrudModal.js +2 -26
- package/ui/form/AutoCompleteField/AutoCompleteField.d.ts +2 -2
- package/ui/form/BlankField/BlankField.d.ts +3 -3
- package/ui/form/BlankField/BlankField.js +2 -25
- package/ui/form/Button/Button.d.ts +2 -2
- package/ui/form/Button/Button.js +2 -25
- package/ui/form/CheckboxField/CheckboxField.d.ts +2 -2
- package/ui/form/CheckboxField/CheckboxField.js +2 -25
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +1 -1
- package/ui/form/CheckboxTreeField/CheckboxTreeField.js +3 -25
- package/ui/form/DateField/DateField.d.ts +2 -2
- package/ui/form/DateRangeField/DateRangeField.d.ts +3 -3
- package/ui/form/DateTimeField/DateTimeField.d.ts +2 -2
- package/ui/form/DropDownField/DropDownField.d.ts +3 -3
- package/ui/form/DropDownField/DropDownField.js +3 -26
- package/ui/form/EmailField/EmailField.js +3 -26
- package/ui/form/EmailField/hooks/useInputTypeEmail.d.ts +3 -3
- package/ui/form/EmailField/hooks/useInputTypeEmail.js +3 -6
- package/ui/form/Field/Field.d.ts +2 -2
- package/ui/form/Field/Field.js +3 -26
- package/ui/form/Field/fieldWrapper.js +2 -25
- package/ui/form/FieldLayout/FieldLayout.d.ts +3 -3
- package/ui/form/FieldLayout/FieldLayout.js +1 -25
- package/ui/form/FieldList/FieldList.d.ts +2 -2
- package/ui/form/FieldList/FieldList.js +17 -16
- package/ui/form/FieldSet/FieldSet.d.ts +2 -2
- package/ui/form/FieldSet/FieldSet.js +5 -30
- package/ui/form/FileField/FileField.js +5 -27
- package/ui/form/Form/Form.d.ts +7 -11
- package/ui/form/Form/Form.js +6 -32
- package/ui/form/ImageField/ImageField.js +2 -25
- package/ui/form/InputField/InputField.d.ts +5 -6
- package/ui/form/InputField/InputField.js +2 -26
- package/ui/form/MaskField/MaskField.js +2 -2
- package/ui/form/NavField/NavField.js +3 -25
- package/ui/form/NumberField/NumberField.d.ts +1 -1
- package/ui/form/NumberField/NumberField.js +2 -25
- package/ui/form/NumberField/hooks/useInputTypeNumber.d.ts +3 -3
- package/ui/form/NumberField/hooks/useInputTypeNumber.js +2 -5
- package/ui/form/RadioField/RadioField.js +2 -2
- package/ui/form/RadioListField/RadioListField.js +2 -2
- package/ui/form/SliderField/SliderField.d.ts +2 -2
- package/ui/form/SwitcherField/SwitcherField.js +2 -2
- package/ui/form/SwitcherListField/SwitcherListField.js +2 -2
- package/ui/form/TextField/TextField.d.ts +2 -2
- package/ui/form/WizardForm/WizardForm.d.ts +4 -4
- package/ui/form/WizardForm/WizardForm.js +3 -27
- package/ui/form/WizardForm/utils.d.ts +2 -2
- package/ui/format/BooleanFormatter/BooleanFormatter.d.ts +2 -2
- package/ui/layout/Header/Header.d.ts +3 -3
- package/ui/layout/Meta/Meta.js +6 -15
- package/ui/layout/Notifications/Notifications.d.ts +2 -2
- package/ui/layout/Notifications/Notifications.js +3 -25
- package/ui/layout/Portal.d.ts +3 -3
- package/ui/layout/ProgressBar/ProgressBar.d.ts +3 -3
- package/ui/layout/ProgressBar/ProgressBar.js +4 -26
- package/ui/layout/Sidebar/Sidebar.d.ts +3 -3
- package/ui/layout/Sidebar/Sidebar.js +2 -25
- package/ui/layout/Skeleton/Skeleton.d.ts +3 -3
- package/ui/layout/Tooltip/Tooltip.js +19 -34
- package/ui/layout/Tooltip/TooltipPortalInner.d.ts +3 -3
- package/ui/layout/Tooltip/TooltipPortalInner.js +2 -25
- package/ui/list/Empty/Empty.d.ts +3 -3
- package/ui/list/Empty/Empty.js +2 -25
- package/ui/list/FlexGrid/FlexGrid.d.ts +2 -2
- package/ui/list/Grid/Grid.d.ts +3 -3
- package/ui/list/Grid/Grid.js +5 -27
- package/ui/list/InfiniteScroll/InfiniteScroll.d.ts +2 -2
- package/ui/list/InfiniteScroll/InfiniteScroll.js +3 -25
- package/ui/list/LayoutNames/LayoutNames.d.ts +2 -2
- package/ui/list/LayoutNames/LayoutNames.js +2 -25
- package/ui/list/List/List.js +3 -26
- package/ui/list/Pagination/Pagination.d.ts +2 -2
- package/ui/list/Pagination/Pagination.js +4 -27
- package/ui/list/PaginationSize/PaginationSize.d.ts +2 -2
- package/ui/list/PaginationSize/PaginationSize.js +2 -25
- package/ui/list/SearchForm/SearchForm.d.ts +2 -2
- package/ui/list/SearchForm/SearchForm.js +3 -26
- package/ui/list/Steps/Steps.d.ts +4 -4
- package/ui/list/TreeTable/TreeTable.d.ts +3 -3
- package/ui/list/TreeTable/TreeTable.js +4 -27
- package/ui/modal/Modal/Modal.js +3 -25
- package/ui/modal/ModalPortal/ModalPortal.js +3 -25
- package/ui/modal/TwoFactorModal/TwoFactorModal.js +4 -5
- package/ui/nav/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/ui/nav/Link/Link.js +2 -25
- package/ui/nav/Nav/Nav.js +3 -25
- package/ui/nav/Router/Router.d.ts +3 -3
- package/ui/nav/Router/Router.js +14 -35
- package/ui/nav/Tree/Tree.d.ts +4 -4
- package/ui/typography/Text/Text.d.ts +2 -2
- package/ui/typography/Title/Title.d.ts +2 -2
- package/utils/createAxiosError.d.ts +9 -0
- package/utils/createAxiosError.js +39 -0
package/ui/modal/Modal/Modal.js
CHANGED
|
@@ -10,31 +10,9 @@ 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
|
exports.__esModule = true;
|
|
37
|
-
var
|
|
14
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
var react_1 = require("react");
|
|
38
16
|
var hooks_1 = require("../../../hooks");
|
|
39
17
|
function Modal(props) {
|
|
40
18
|
var components = (0, hooks_1.useComponents)();
|
|
@@ -59,7 +37,7 @@ function Modal(props) {
|
|
|
59
37
|
buttons: props.buttons,
|
|
60
38
|
viewProps: props.viewProps
|
|
61
39
|
}); }, [props.buttons, props.children, props.className, props.closeTimeoutMs, props.isClosing, props.onClose, props.shouldCloseOnEsc, props.shouldCloseOnOverlayClick, props.size, props.title, props.viewProps]);
|
|
62
|
-
return (
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(ModalView, __assign({}, viewProps, { children: (ContentComponent && ((0, jsx_runtime_1.jsx)(ContentComponent, __assign({}, props, props.componentProps)))) || (props.children) })));
|
|
63
41
|
}
|
|
64
42
|
Modal.defaultProps = {
|
|
65
43
|
size: 'md',
|
|
@@ -10,35 +10,13 @@ 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
exports.__esModule = true;
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
18
|
var orderBy_1 = __importDefault(require("lodash-es/orderBy"));
|
|
41
|
-
var react_1 =
|
|
19
|
+
var react_1 = require("react");
|
|
42
20
|
var modal_1 = require("../../../actions/modal");
|
|
43
21
|
var hooks_1 = require("../../../hooks");
|
|
44
22
|
var useDispatch_1 = __importDefault(require("../../../hooks/useDispatch"));
|
|
@@ -67,7 +45,7 @@ function ModalPortal(props) {
|
|
|
67
45
|
return (0, orderBy_1["default"])(opened, 'id').map(function (item, index) {
|
|
68
46
|
var ModalComponent = item.modal;
|
|
69
47
|
var modalProps = __assign(__assign({}, item.props), { index: index, group: group, isClosing: item.isClosing, onClose: function () { return onClose(item); }, closeTimeoutMs: item.props.closeTimeoutMs || props.animationDelayMc });
|
|
70
|
-
return (
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(ModalComponent, __assign({}, modalProps), item.id));
|
|
71
49
|
});
|
|
72
50
|
}
|
|
73
51
|
ModalPortal.defaultProps = {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
|
-
var
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var useComponents_1 = __importDefault(require("../../../hooks/useComponents"));
|
|
19
19
|
var useFetch_1 = __importDefault(require("../../../hooks/useFetch"));
|
|
20
20
|
var Modal_1 = __importDefault(require("../Modal"));
|
|
@@ -24,7 +24,7 @@ function TwoFactorModal(props) {
|
|
|
24
24
|
method: 'post',
|
|
25
25
|
url: "/api/v1/auth/2fa/".concat(props.providerName, "/send")
|
|
26
26
|
}).data;
|
|
27
|
-
if (!data
|
|
27
|
+
if (!data) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
var providerData = data.providerData;
|
|
@@ -48,11 +48,10 @@ function TwoFactorModal(props) {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
var TwoFactorModalView = props.view || components.ui.getView('modal.TwoFactorModalView');
|
|
51
|
-
return (
|
|
52
|
-
react_1["default"].createElement(TwoFactorModalView, __assign({}, props, { formProps: {
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(Modal_1["default"], __assign({}, props, { onClose: props.onClose }, { children: (0, jsx_runtime_1.jsx)(TwoFactorModalView, __assign({}, props, { formProps: {
|
|
53
52
|
formId: 'TwoFactorModal',
|
|
54
53
|
action: "/api/v1/auth/2fa/".concat(props.providerName, "/confirm"),
|
|
55
54
|
onComplete: function () { return props.onClose(); }
|
|
56
|
-
}, description: getDescription() }))));
|
|
55
|
+
}, description: getDescription() })) })));
|
|
57
56
|
}
|
|
58
57
|
exports["default"] = TwoFactorModal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { IRouteItem } from '../Router/Router';
|
|
3
3
|
/**
|
|
4
4
|
* Breadcrumbs
|
|
@@ -46,7 +46,7 @@ export interface IBreadcrumbsProps {
|
|
|
46
46
|
/**
|
|
47
47
|
* Кастомная иконка, заменяющая первый роут
|
|
48
48
|
*/
|
|
49
|
-
customIcon?:
|
|
49
|
+
customIcon?: CustomIcon;
|
|
50
50
|
/**
|
|
51
51
|
* Переопределение view React компонента для кастомизации отображения
|
|
52
52
|
* @example MyCustomView
|
package/ui/nav/Link/Link.js
CHANGED
|
@@ -10,36 +10,13 @@ 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
exports.__esModule = true;
|
|
40
|
-
var
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
18
|
var Button_1 = __importDefault(require("../../form/Button"));
|
|
42
19
|
function Link(props) {
|
|
43
|
-
return (
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(Button_1["default"], __assign({ tag: 'a', link: true, color: 'link' }, props, { formId: false })));
|
|
44
21
|
}
|
|
45
22
|
exports["default"] = Link;
|
package/ui/nav/Nav/Nav.js
CHANGED
|
@@ -10,39 +10,17 @@ 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
exports.__esModule = true;
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
18
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
41
19
|
var has_1 = __importDefault(require("lodash-es/has"));
|
|
42
20
|
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
43
21
|
var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
|
|
44
22
|
var isObject_1 = __importDefault(require("lodash-es/isObject"));
|
|
45
|
-
var react_1 =
|
|
23
|
+
var react_1 = require("react");
|
|
46
24
|
var hooks_1 = require("../../../hooks");
|
|
47
25
|
var router_1 = require("../../../reducers/router");
|
|
48
26
|
var defaultViewMap = {
|
|
@@ -74,7 +52,7 @@ function Nav(props) {
|
|
|
74
52
|
}
|
|
75
53
|
if ((0, isFunction_1["default"])(activeItem.content) || (0, isObject_1["default"])(activeItem.content)) {
|
|
76
54
|
var ContentComponent = activeItem.content;
|
|
77
|
-
return (
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(ContentComponent, __assign({}, activeItem, activeItem.contentProps)));
|
|
78
56
|
}
|
|
79
57
|
return activeItem.content;
|
|
80
58
|
}, [activeTab, props.items]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { IFetchConfig } from '../../../hooks/useFetch';
|
|
3
3
|
import { IListProps } from '../../list/List/List';
|
|
4
4
|
export declare const ROUTER_ROLE_LOGIN = "login";
|
|
@@ -112,7 +112,7 @@ export interface IRouteItem {
|
|
|
112
112
|
* Пользовательская иконка svg или название иконки
|
|
113
113
|
* @example 'circle'
|
|
114
114
|
*/
|
|
115
|
-
icon?:
|
|
115
|
+
icon?: ReactElement | string;
|
|
116
116
|
}
|
|
117
117
|
export interface IRouterProps {
|
|
118
118
|
/**
|
|
@@ -146,7 +146,7 @@ export interface IRouterProps {
|
|
|
146
146
|
* Контент, который отобразится под каждой страницей приложения
|
|
147
147
|
* @example SomeComponent
|
|
148
148
|
*/
|
|
149
|
-
children?:
|
|
149
|
+
children?: ReactNode;
|
|
150
150
|
/**
|
|
151
151
|
* Флаг, который позволяет использовать вложенные роуты c указанием вложенного пути
|
|
152
152
|
* @example true
|
package/ui/nav/Router/Router.js
CHANGED
|
@@ -10,38 +10,16 @@ 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
exports.__esModule = true;
|
|
40
17
|
exports.ROUTER_ROLE_404 = exports.ROUTER_ROLE_MODAL = exports.ROUTER_ROLE_LOGIN = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
19
|
var connected_react_router_1 = require("connected-react-router");
|
|
42
20
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
43
21
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
44
|
-
var react_1 =
|
|
22
|
+
var react_1 = require("react");
|
|
45
23
|
var react_router_1 = require("react-router");
|
|
46
24
|
var react_router_dom_1 = require("react-router-dom");
|
|
47
25
|
var react_use_1 = require("react-use");
|
|
@@ -73,14 +51,14 @@ var renderComponent = function (route, activePath, routeProps, alwaysAppendParen
|
|
|
73
51
|
? redirectPath
|
|
74
52
|
: (0, router_2.buildUrl)(redirectPath, (_b = routeProps === null || routeProps === void 0 ? void 0 : routeProps.match) === null || _b === void 0 ? void 0 : _b.params));
|
|
75
53
|
if (activePath !== toPath) {
|
|
76
|
-
return (
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(react_router_1.Redirect, __assign({}, routeProps, { to: toPath }, route.componentProps)));
|
|
77
55
|
}
|
|
78
56
|
}
|
|
79
57
|
if (!route.component) {
|
|
80
58
|
return null;
|
|
81
59
|
}
|
|
82
60
|
var Component = route.component;
|
|
83
|
-
return (
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(Component, __assign({}, routeProps, route.componentProps)));
|
|
84
62
|
};
|
|
85
63
|
function Router(props) {
|
|
86
64
|
var _a;
|
|
@@ -166,16 +144,19 @@ function Router(props) {
|
|
|
166
144
|
});
|
|
167
145
|
var renderItem = function (routeItem, routeProps) {
|
|
168
146
|
var children = null;
|
|
147
|
+
var hasExact = false;
|
|
169
148
|
activeRouteIds.find(function (activeRouteId) {
|
|
170
149
|
if (activeRouteId === routeItem.id) {
|
|
171
150
|
// Stop
|
|
172
151
|
return true;
|
|
173
152
|
}
|
|
174
153
|
var activeRoute = routes.find(function (r) { return r.id === activeRouteId; });
|
|
175
|
-
|
|
154
|
+
if (!hasExact && activeRoute.component && !activeRoute.redirectTo) {
|
|
155
|
+
children = renderComponent(activeRoute, activePath, __assign(__assign({}, routeProps), { children: children }), props.alwaysAppendParentRoutePath) || children;
|
|
156
|
+
}
|
|
176
157
|
// Stop, if route is exact
|
|
177
158
|
if (activeRoute.exact) {
|
|
178
|
-
|
|
159
|
+
hasExact = true;
|
|
179
160
|
}
|
|
180
161
|
return false;
|
|
181
162
|
});
|
|
@@ -191,11 +172,9 @@ function Router(props) {
|
|
|
191
172
|
};
|
|
192
173
|
var renderContent = function () {
|
|
193
174
|
var WrapperComponent = props.wrapperView;
|
|
194
|
-
var routeNodes = (
|
|
195
|
-
routes.map(function (routeItem, index) { return (react_1["default"].createElement(react_router_1.Route, __assign({ key: index, render: function (routeProps) { return renderItem(routeItem, routeProps); } }, routeItem, { component: null }))); }),
|
|
196
|
-
props.children));
|
|
175
|
+
var routeNodes = ((0, jsx_runtime_1.jsxs)(react_router_1.Switch, { children: [routes.map(function (routeItem, index) { return ((0, jsx_runtime_1.jsx)(react_router_1.Route, __assign({ render: function (routeProps) { return renderItem(routeItem, routeProps); } }, routeItem, { component: null }), index)); }), props.children] }));
|
|
197
176
|
if (WrapperComponent) {
|
|
198
|
-
return (
|
|
177
|
+
return ((0, jsx_runtime_1.jsx)(WrapperComponent, __assign({}, props.wrapperProps, { children: routeNodes })));
|
|
199
178
|
}
|
|
200
179
|
return routeNodes;
|
|
201
180
|
};
|
|
@@ -203,12 +182,12 @@ function Router(props) {
|
|
|
203
182
|
return null;
|
|
204
183
|
}
|
|
205
184
|
if (process.env.IS_SSR) {
|
|
206
|
-
return (
|
|
185
|
+
return ((0, jsx_runtime_1.jsx)(SsrProvider_1.SsrProviderContext.Consumer, { children: function (context) { return ((0, jsx_runtime_1.jsx)(react_router_1.StaticRouter, __assign({ location: components.store.history.location, context: context.staticContext }, { children: renderContent() }))); } }));
|
|
207
186
|
}
|
|
208
187
|
if (window.location.protocol === 'file:') {
|
|
209
|
-
return (
|
|
188
|
+
return ((0, jsx_runtime_1.jsx)(react_router_dom_1.HashRouter, { children: renderContent() }));
|
|
210
189
|
}
|
|
211
|
-
return (
|
|
190
|
+
return ((0, jsx_runtime_1.jsx)(connected_react_router_1.ConnectedRouter, __assign({ history: components.store.history }, { children: renderContent() })));
|
|
212
191
|
}
|
|
213
192
|
Router.defaultProps = {
|
|
214
193
|
autoScrollTop: true,
|
package/ui/nav/Tree/Tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement, MouseEvent } from 'react';
|
|
2
2
|
import { IPreparedTreeItem, ITreeConfig, ITreeItem } from '../../../hooks/useTree';
|
|
3
3
|
export interface ITreeViewProps extends ITreeProps {
|
|
4
4
|
items: IPreparedTreeItem[];
|
|
@@ -38,7 +38,7 @@ export interface ITreeProps extends Omit<ITreeConfig, 'currentPage' | 'itemsOnPa
|
|
|
38
38
|
* Обработчик на клик по узлу
|
|
39
39
|
* @param args
|
|
40
40
|
*/
|
|
41
|
-
onItemClick?: (event:
|
|
41
|
+
onItemClick?: (event: MouseEvent, item: ITreeItem) => any;
|
|
42
42
|
/**
|
|
43
43
|
* Отображать раскрытыми узлы из LocalStorage
|
|
44
44
|
* @example true
|
|
@@ -57,7 +57,7 @@ export interface ITreeProps extends Omit<ITreeConfig, 'currentPage' | 'itemsOnPa
|
|
|
57
57
|
/**
|
|
58
58
|
* Кастомная иконка, заменяющая иконку раскрытия по умолчанию
|
|
59
59
|
*/
|
|
60
|
-
customIcon?:
|
|
60
|
+
customIcon?: CustomIcon;
|
|
61
61
|
/**
|
|
62
62
|
* Флаг, определяющий раскрывать вложенные элементы по клику на весь элемент или только на иконку
|
|
63
63
|
* @example false
|
|
@@ -65,7 +65,7 @@ export interface ITreeProps extends Omit<ITreeConfig, 'currentPage' | 'itemsOnPa
|
|
|
65
65
|
hasIconExpandOnly?: boolean;
|
|
66
66
|
[key: string]: any;
|
|
67
67
|
}
|
|
68
|
-
declare function Tree(props: ITreeProps):
|
|
68
|
+
declare function Tree(props: ITreeProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
69
69
|
declare namespace Tree {
|
|
70
70
|
var defaultProps: {
|
|
71
71
|
itemsKey: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Text
|
|
4
4
|
*
|
|
@@ -8,7 +8,7 @@ export interface ITextProps extends IUiComponent {
|
|
|
8
8
|
/**
|
|
9
9
|
* Дочерние элементы
|
|
10
10
|
*/
|
|
11
|
-
children?:
|
|
11
|
+
children?: ReactNode;
|
|
12
12
|
/**
|
|
13
13
|
* Тип текста
|
|
14
14
|
* @example 'body'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Title
|
|
4
4
|
*
|
|
@@ -8,7 +8,7 @@ export interface ITitleProps extends IUiComponent {
|
|
|
8
8
|
/**
|
|
9
9
|
* Дочерние элементы
|
|
10
10
|
*/
|
|
11
|
-
children?:
|
|
11
|
+
children?: ReactNode;
|
|
12
12
|
/**
|
|
13
13
|
* Тип заголовка
|
|
14
14
|
* @example 'h1'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import { IFetchConfig } from '../hooks/useFetch';
|
|
3
|
+
export interface IApiErrorPayload {
|
|
4
|
+
statusCode: number;
|
|
5
|
+
error?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
errors?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export default function createAxiosError(apiErrorPayload: IApiErrorPayload, fetchConfig: IFetchConfig): AxiosError<IApiErrorPayload>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
function createAxiosError(apiErrorPayload, fetchConfig) {
|
|
4
|
+
var _a;
|
|
5
|
+
var message = apiErrorPayload.message
|
|
6
|
+
|| apiErrorPayload.error
|
|
7
|
+
|| 'Request failed';
|
|
8
|
+
var config = {
|
|
9
|
+
url: fetchConfig.url,
|
|
10
|
+
method: fetchConfig.method,
|
|
11
|
+
params: (_a = fetchConfig.params) !== null && _a !== void 0 ? _a : {}
|
|
12
|
+
};
|
|
13
|
+
var response = {
|
|
14
|
+
data: apiErrorPayload,
|
|
15
|
+
status: apiErrorPayload.statusCode,
|
|
16
|
+
statusText: message,
|
|
17
|
+
headers: {},
|
|
18
|
+
config: config
|
|
19
|
+
};
|
|
20
|
+
var error = new Error(message);
|
|
21
|
+
error.name = 'AxiosError';
|
|
22
|
+
error.config = config;
|
|
23
|
+
error.request = {};
|
|
24
|
+
error.response = response;
|
|
25
|
+
error.isAxiosError = true;
|
|
26
|
+
error.toJSON = function () {
|
|
27
|
+
var _a;
|
|
28
|
+
return ({
|
|
29
|
+
message: error.message,
|
|
30
|
+
name: error.name,
|
|
31
|
+
code: error.code,
|
|
32
|
+
config: error.config,
|
|
33
|
+
status: (_a = error.response) === null || _a === void 0 ? void 0 : _a.status,
|
|
34
|
+
stack: error.stack
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return error;
|
|
38
|
+
}
|
|
39
|
+
exports["default"] = createAxiosError;
|