@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/hooks/useLayout.js
CHANGED
|
@@ -5,23 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
var _a;
|
|
6
6
|
exports.__esModule = true;
|
|
7
7
|
exports.runInitAction = exports.HTTP_STATUS_CODES = exports.STATUS_OK = exports.STATUS_ACCESS_DENIED = exports.STATUS_HTTP_ERROR = exports.STATUS_RENDER_ERROR = exports.STATUS_NOT_FOUND = exports.STATUS_LOADING = void 0;
|
|
8
|
-
var
|
|
8
|
+
var intersection_1 = __importDefault(require("lodash-es/intersection"));
|
|
9
9
|
var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
|
|
10
10
|
var isObject_1 = __importDefault(require("lodash-es/isObject"));
|
|
11
|
-
var upperFirst_1 = __importDefault(require("lodash-es/upperFirst"));
|
|
12
11
|
var merge_1 = __importDefault(require("lodash-es/merge"));
|
|
13
|
-
var
|
|
12
|
+
var upperFirst_1 = __importDefault(require("lodash-es/upperFirst"));
|
|
13
|
+
var react_1 = require("react");
|
|
14
14
|
var react_use_1 = require("react-use");
|
|
15
|
-
var Router_1 = require("../ui/nav/Router/Router");
|
|
16
|
-
var useSsr_1 = __importDefault(require("./useSsr"));
|
|
17
15
|
var useComponents_1 = __importDefault(require("./useComponents"));
|
|
18
|
-
var router_1 = require("../reducers/router");
|
|
19
|
-
var auth_1 = require("../reducers/auth");
|
|
20
|
-
var useSelector_1 = __importDefault(require("./useSelector"));
|
|
21
|
-
var auth_2 = require("../actions/auth");
|
|
22
16
|
var useDispatch_1 = __importDefault(require("./useDispatch"));
|
|
17
|
+
var useSelector_1 = __importDefault(require("./useSelector"));
|
|
18
|
+
var useSsr_1 = __importDefault(require("./useSsr"));
|
|
19
|
+
var auth_1 = require("../actions/auth");
|
|
23
20
|
var fields_1 = require("../actions/fields");
|
|
24
|
-
var
|
|
21
|
+
var router_1 = require("../actions/router");
|
|
22
|
+
var auth_2 = require("../reducers/auth");
|
|
23
|
+
var router_2 = require("../reducers/router");
|
|
24
|
+
var Router_1 = require("../ui/nav/Router/Router");
|
|
25
25
|
exports.STATUS_LOADING = 'loading';
|
|
26
26
|
exports.STATUS_NOT_FOUND = 'not_found';
|
|
27
27
|
exports.STATUS_RENDER_ERROR = 'render_error';
|
|
@@ -72,24 +72,25 @@ var runInitAction = function (initAction, components, dispatch) { return (initAc
|
|
|
72
72
|
}
|
|
73
73
|
dispatch([
|
|
74
74
|
// Meta models & enums
|
|
75
|
+
// TODO skip models
|
|
75
76
|
Boolean(resultMeta) && (0, fields_1.setMeta)(resultMeta),
|
|
76
77
|
// User auth
|
|
77
|
-
(0,
|
|
78
|
+
(0, auth_1.setData)(result),
|
|
78
79
|
// User auth
|
|
79
|
-
(0,
|
|
80
|
+
(0, auth_1.setUser)(resultUser),
|
|
80
81
|
].filter(Boolean));
|
|
81
82
|
})); };
|
|
82
83
|
exports.runInitAction = runInitAction;
|
|
83
84
|
function useLayout(initAction) {
|
|
84
85
|
if (initAction === void 0) { initAction = null; }
|
|
85
86
|
var _a = (0, useSelector_1["default"])(function (state) {
|
|
86
|
-
var routesMap = (0,
|
|
87
|
+
var routesMap = (0, router_2.getRoutesMap)(state);
|
|
87
88
|
return {
|
|
88
|
-
route: (0,
|
|
89
|
-
user: (0,
|
|
90
|
-
data: (0,
|
|
91
|
-
isInitialized: (0,
|
|
92
|
-
initializeCounter: (0,
|
|
89
|
+
route: (0, router_2.getRoute)(state),
|
|
90
|
+
user: (0, auth_2.getUser)(state),
|
|
91
|
+
data: (0, auth_2.getData)(state),
|
|
92
|
+
isInitialized: (0, auth_2.isInitialized)(state),
|
|
93
|
+
initializeCounter: (0, auth_2.getInitializeCounter)(state),
|
|
93
94
|
redirectPageId: state.auth.redirectPageId,
|
|
94
95
|
loginRouteId: routesMap && Object.keys(routesMap).find(function (name) { return routesMap[name].role === Router_1.ROUTER_ROLE_LOGIN; })
|
|
95
96
|
};
|
|
@@ -100,10 +101,10 @@ function useLayout(initAction) {
|
|
|
100
101
|
(0, react_use_1.useMount)(function () {
|
|
101
102
|
// Callback for load initial page data (return promise)
|
|
102
103
|
if ((0, isFunction_1["default"])(initAction)) {
|
|
103
|
-
dispatch((0,
|
|
104
|
+
dispatch((0, auth_1.init)(true));
|
|
104
105
|
}
|
|
105
106
|
else {
|
|
106
|
-
dispatch((0,
|
|
107
|
+
dispatch((0, auth_1.setUser)(null));
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
var initializeCounterPrev = (0, react_use_1.usePrevious)(initializeCounter);
|
|
@@ -115,7 +116,7 @@ function useLayout(initAction) {
|
|
|
115
116
|
(0, exports.runInitAction)(initAction, components, dispatch)
|
|
116
117
|
.then(function () {
|
|
117
118
|
if (redirectPageId) {
|
|
118
|
-
dispatch((0,
|
|
119
|
+
dispatch((0, router_1.goToRoute)(redirectPageId));
|
|
119
120
|
}
|
|
120
121
|
})["catch"](function (e) {
|
|
121
122
|
setError(e);
|
|
@@ -136,11 +137,12 @@ function useLayout(initAction) {
|
|
|
136
137
|
var pageRoles = (route === null || route === void 0 ? void 0 : route.roles) || [];
|
|
137
138
|
var userRoles = [].concat((user === null || user === void 0 ? void 0 : user.role) || []).concat((user === null || user === void 0 ? void 0 : user.roles) || []);
|
|
138
139
|
if (userRoles.length === 0) {
|
|
139
|
-
|
|
140
|
+
// Guest
|
|
141
|
+
userRoles.push(null);
|
|
140
142
|
}
|
|
141
143
|
if ((0, intersection_1["default"])(pageRoles, userRoles).length === 0) {
|
|
142
144
|
if (loginRouteId && route.id !== loginRouteId) {
|
|
143
|
-
dispatch((0,
|
|
145
|
+
dispatch((0, router_1.goToRoute)(loginRouteId));
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
148
|
status = exports.STATUS_ACCESS_DENIED;
|
package/hooks/useList.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IInfiniteScrollProps } from '@steroidsjs/core/ui/list/InfiniteScroll/InfiniteScroll';
|
|
2
|
-
import { IAddressBarConfig } from '../hooks/useAddressBar';
|
|
3
2
|
import { IList } from '../actions/list';
|
|
3
|
+
import { Model } from '../components/MetaComponent';
|
|
4
|
+
import { IAddressBarConfig } from '../hooks/useAddressBar';
|
|
5
|
+
import { IFormProps } from '../ui/form/Form/Form';
|
|
6
|
+
import { IEmptyProps } from '../ui/list/Empty/Empty';
|
|
4
7
|
import { ILayoutNamesProps } from '../ui/list/LayoutNames/LayoutNames';
|
|
5
8
|
import { IPaginationProps } from '../ui/list/Pagination/Pagination';
|
|
6
9
|
import { IPaginationSizeProps } from '../ui/list/PaginationSize/PaginationSize';
|
|
7
|
-
import { IEmptyProps } from '../ui/list/Empty/Empty';
|
|
8
|
-
import { IFormProps } from '../ui/form/Form/Form';
|
|
9
|
-
import { Model } from '../components/MetaComponent';
|
|
10
10
|
export type ListControlPosition = 'top' | 'bottom' | 'both' | string;
|
|
11
11
|
export interface ISortConfig {
|
|
12
12
|
/**
|
package/hooks/useList.js
CHANGED
|
@@ -39,26 +39,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
exports.__esModule = true;
|
|
40
40
|
exports.createInitialValues = exports.getDefaultSearchModel = exports.normalizeSortProps = exports.defaultConfig = void 0;
|
|
41
41
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
42
|
-
var
|
|
42
|
+
var InfiniteScroll_1 = require("@steroidsjs/core/ui/list/InfiniteScroll/InfiniteScroll");
|
|
43
43
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
44
|
-
var union_1 = __importDefault(require("lodash-es/union"));
|
|
45
44
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
45
|
+
var union_1 = __importDefault(require("lodash-es/union"));
|
|
46
|
+
var react_1 = __importStar(require("react"));
|
|
46
47
|
var react_use_1 = require("react-use");
|
|
47
|
-
var InfiniteScroll_1 = require("@steroidsjs/core/ui/list/InfiniteScroll/InfiniteScroll");
|
|
48
48
|
var useSelector_1 = __importDefault(require("./useSelector"));
|
|
49
|
-
var
|
|
50
|
-
var
|
|
49
|
+
var form_1 = require("../actions/form");
|
|
50
|
+
var list_1 = require("../actions/list");
|
|
51
51
|
var useAddressBar_1 = __importDefault(require("../hooks/useAddressBar"));
|
|
52
|
-
var list_2 = require("../actions/list");
|
|
53
52
|
var useDispatch_1 = __importDefault(require("../hooks/useDispatch"));
|
|
54
|
-
var
|
|
53
|
+
var useInitial_1 = __importDefault(require("../hooks/useInitial"));
|
|
54
|
+
var useModel_1 = __importDefault(require("../hooks/useModel"));
|
|
55
55
|
var form_2 = require("../reducers/form");
|
|
56
|
+
var list_2 = require("../reducers/list");
|
|
57
|
+
var layout_1 = require("../ui/layout");
|
|
58
|
+
var Empty_1 = require("../ui/list/Empty/Empty");
|
|
56
59
|
var LayoutNames_1 = require("../ui/list/LayoutNames/LayoutNames");
|
|
57
|
-
var useInitial_1 = __importDefault(require("../hooks/useInitial"));
|
|
58
60
|
var Pagination_1 = require("../ui/list/Pagination/Pagination");
|
|
59
61
|
var PaginationSize_1 = require("../ui/list/PaginationSize/PaginationSize");
|
|
60
|
-
var Empty_1 = require("../ui/list/Empty/Empty");
|
|
61
|
-
var layout_1 = require("../ui/layout");
|
|
62
62
|
exports.defaultConfig = {
|
|
63
63
|
actionMethod: 'get',
|
|
64
64
|
primaryKey: 'id',
|
|
@@ -69,12 +69,15 @@ exports.defaultConfig = {
|
|
|
69
69
|
defaultValue: null
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
var normalizeSortProps = function (props) { return (__assign(__assign(__assign({}, exports.defaultConfig.sort), { enable: !!props }), (typeof props === 'boolean' ? {
|
|
72
|
+
var normalizeSortProps = function (props) { return (__assign(__assign(__assign({}, exports.defaultConfig.sort), { enable: !!props }), (typeof props === 'boolean' ? {
|
|
73
|
+
enable: props
|
|
74
|
+
} : props))); };
|
|
73
75
|
exports.normalizeSortProps = normalizeSortProps;
|
|
74
76
|
var getDefaultSearchModel = function (_a) {
|
|
75
77
|
var paginationProps = _a.paginationProps, paginationSizeProps = _a.paginationSizeProps, sort = _a.sort, layoutNamesProps = _a.layoutNamesProps;
|
|
76
78
|
return ({
|
|
77
79
|
attributes: [
|
|
80
|
+
// default attributes
|
|
78
81
|
paginationProps.enable && {
|
|
79
82
|
type: 'number',
|
|
80
83
|
attribute: paginationProps.attribute,
|
|
@@ -86,6 +89,7 @@ var getDefaultSearchModel = function (_a) {
|
|
|
86
89
|
defaultValue: paginationSizeProps.defaultValue
|
|
87
90
|
},
|
|
88
91
|
sort.enable && {
|
|
92
|
+
// TODO Need list of strings
|
|
89
93
|
type: 'string',
|
|
90
94
|
jsType: 'string[]',
|
|
91
95
|
attribute: sort.attribute,
|
|
@@ -116,7 +120,7 @@ var FIRST_PAGE = 1;
|
|
|
116
120
|
function useList(config) {
|
|
117
121
|
var _a, _b;
|
|
118
122
|
// Get list from redux state
|
|
119
|
-
var list = (0, useSelector_1["default"])(function (state) { return (0,
|
|
123
|
+
var list = (0, useSelector_1["default"])(function (state) { return (0, list_2.getList)(state, config.listId); });
|
|
120
124
|
// Normalize sort config
|
|
121
125
|
var sort = (0, exports.normalizeSortProps)(config.sort);
|
|
122
126
|
// Loading
|
|
@@ -171,7 +175,9 @@ function useList(config) {
|
|
|
171
175
|
var model = (0, useModel_1["default"])(config.model);
|
|
172
176
|
var searchModel = (0, useModel_1["default"])(config.searchModel || ((_a = config.searchForm) === null || _a === void 0 ? void 0 : _a.model), defaultSearchModel);
|
|
173
177
|
// Address bar synchronization
|
|
174
|
-
var _c = (0, useAddressBar_1["default"])(__assign({ enable: !!config.addressBar, model: searchModel }, (typeof config.addressBar === 'boolean' ? {
|
|
178
|
+
var _c = (0, useAddressBar_1["default"])(__assign({ enable: !!config.addressBar, model: searchModel }, (typeof config.addressBar === 'boolean' ? {
|
|
179
|
+
enable: config.addressBar
|
|
180
|
+
} : config.addressBar))), initialQuery = _c.initialQuery, updateQuery = _c.updateQuery;
|
|
175
181
|
// Outside search form
|
|
176
182
|
var searchFormFields = (_b = config.searchForm) === null || _b === void 0 ? void 0 : _b.fields;
|
|
177
183
|
var SearchForm = require('../ui/list/SearchForm')["default"];
|
|
@@ -210,7 +216,7 @@ function useList(config) {
|
|
|
210
216
|
var _a;
|
|
211
217
|
if (!list) {
|
|
212
218
|
var toDispatch = [
|
|
213
|
-
(0,
|
|
219
|
+
(0, list_1.listInit)(config.listId, {
|
|
214
220
|
listId: config.listId,
|
|
215
221
|
action: config.action || config.action === '' ? config.action : null,
|
|
216
222
|
actionMethod: config.actionMethod || exports.defaultConfig.actionMethod,
|
|
@@ -234,10 +240,10 @@ function useList(config) {
|
|
|
234
240
|
}),
|
|
235
241
|
];
|
|
236
242
|
if (config.initialItems || config.items) {
|
|
237
|
-
toDispatch.push((0,
|
|
243
|
+
toDispatch.push((0, list_1.listSetItems)(config.listId, config.initialItems || config.items));
|
|
238
244
|
}
|
|
239
245
|
if (!config.initialItems) {
|
|
240
|
-
toDispatch.push((0,
|
|
246
|
+
toDispatch.push((0, list_1.listLazyFetch)(config.listId));
|
|
241
247
|
}
|
|
242
248
|
dispatch(toDispatch);
|
|
243
249
|
}
|
|
@@ -260,7 +266,7 @@ function useList(config) {
|
|
|
260
266
|
updateQuery(formValues);
|
|
261
267
|
// Send request
|
|
262
268
|
if (config.autoFetchOnFormChanges !== false) {
|
|
263
|
-
dispatch((0,
|
|
269
|
+
dispatch((0, list_1.listLazyFetch)(config.listId));
|
|
264
270
|
}
|
|
265
271
|
}
|
|
266
272
|
}, [config.autoFetchOnFormChanges, config.listId, dispatch, formId, formValues,
|
|
@@ -278,7 +284,7 @@ function useList(config) {
|
|
|
278
284
|
// Check change items
|
|
279
285
|
(0, react_use_1.useUpdateEffect)(function () {
|
|
280
286
|
dispatch([
|
|
281
|
-
(0,
|
|
287
|
+
(0, list_1.listSetItems)(config.listId, config.items),
|
|
282
288
|
]);
|
|
283
289
|
}, [dispatch, config.items, config.listId]);
|
|
284
290
|
// Check change action
|
|
@@ -286,8 +292,8 @@ function useList(config) {
|
|
|
286
292
|
(0, react_use_1.useUpdateEffect)(function () {
|
|
287
293
|
if (prevAction && !(0, isEqual_1["default"])(config.action, prevAction)) {
|
|
288
294
|
dispatch([
|
|
289
|
-
(0,
|
|
290
|
-
(0,
|
|
295
|
+
(0, list_1.listChangeAction)(config.listId, config.action),
|
|
296
|
+
(0, list_1.listLazyFetch)(config.listId),
|
|
291
297
|
]);
|
|
292
298
|
}
|
|
293
299
|
}, [dispatch, config.listId, config.action, prevAction]);
|
|
@@ -298,14 +304,14 @@ function useList(config) {
|
|
|
298
304
|
: exports.defaultConfig.autoDestroy;
|
|
299
305
|
if (autoDestroy) {
|
|
300
306
|
dispatch([
|
|
301
|
-
(0,
|
|
307
|
+
(0, list_1.listDestroy)(config.listId),
|
|
302
308
|
(0, form_1.formDestroy)(config.listId),
|
|
303
309
|
]);
|
|
304
310
|
}
|
|
305
311
|
});
|
|
306
312
|
var onFetch = (0, react_1.useCallback)(function (params) {
|
|
307
313
|
if (params === void 0) { params = {}; }
|
|
308
|
-
dispatch((0,
|
|
314
|
+
dispatch((0, list_1.listFetch)(config.listId, params));
|
|
309
315
|
}, [config.listId, dispatch]);
|
|
310
316
|
var onSort = (0, react_1.useCallback)(function (value) {
|
|
311
317
|
dispatch((0, form_1.formChange)(formId, sort.attribute, value));
|
package/hooks/useListField.js
CHANGED
|
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
exports.__esModule = true;
|
|
40
|
-
var react_1 = __importStar(require("react"));
|
|
41
40
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
42
41
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
42
|
+
var react_1 = __importStar(require("react"));
|
|
43
43
|
var react_use_1 = require("react-use");
|
|
44
44
|
function useListField(props) {
|
|
45
45
|
var components = (0, hooks_1.useComponents)();
|
|
@@ -6,9 +6,9 @@ exports.__esModule = true;
|
|
|
6
6
|
/* eslint-disable consistent-return */
|
|
7
7
|
/* eslint-disable no-return-assign */
|
|
8
8
|
/* eslint-disable no-unused-expressions */
|
|
9
|
-
var react_1 = require("react");
|
|
10
9
|
var debounce_1 = __importDefault(require("lodash-es/debounce"));
|
|
11
10
|
var isNull_1 = __importDefault(require("lodash-es/isNull"));
|
|
11
|
+
var react_1 = require("react");
|
|
12
12
|
var DEFAULT_DEBOUNCE_DELAY_MS = 300;
|
|
13
13
|
function useSaveCursorPosition(config) {
|
|
14
14
|
var _a, _b, _c;
|
package/hooks/useTree.d.ts
CHANGED
package/hooks/useTree.js
CHANGED
|
@@ -14,15 +14,15 @@ 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 react_1 = require("react");
|
|
18
|
-
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
19
|
-
var omit_1 = __importDefault(require("lodash-es/omit"));
|
|
20
|
-
var join_1 = __importDefault(require("lodash-es/join"));
|
|
21
|
-
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
22
17
|
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
18
|
+
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
23
19
|
var isNil_1 = __importDefault(require("lodash-es/isNil"));
|
|
20
|
+
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
21
|
+
var join_1 = __importDefault(require("lodash-es/join"));
|
|
24
22
|
var keys_1 = __importDefault(require("lodash-es/keys"));
|
|
23
|
+
var omit_1 = __importDefault(require("lodash-es/omit"));
|
|
25
24
|
var pickBy_1 = __importDefault(require("lodash-es/pickBy"));
|
|
25
|
+
var react_1 = require("react");
|
|
26
26
|
var react_use_1 = require("react-use");
|
|
27
27
|
var useComponents_1 = __importDefault(require("./useComponents"));
|
|
28
28
|
var useSelector_1 = __importDefault(require("./useSelector"));
|
|
@@ -124,7 +124,8 @@ function useTree(config) {
|
|
|
124
124
|
// Выполняет поиск текущего роута в дереве: раскрывает дерево до элемента, делает элемент активным
|
|
125
125
|
var onItemFocus = (0, react_1.useCallback)(function () {
|
|
126
126
|
var currentRouteAsTreeItem = findChildById(items, selectedItemId, primaryKey);
|
|
127
|
-
|
|
127
|
+
// Get all parent levels of item
|
|
128
|
+
var currentRouteUniqueIdParts = currentRouteAsTreeItem.uniqueId.split(DOT_SEPARATOR);
|
|
128
129
|
var itemsToExpand = {};
|
|
129
130
|
var itemToExpandKey;
|
|
130
131
|
currentRouteUniqueIdParts.forEach(function (item, index) {
|
package/hooks/useUniqueId.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
var react_1 = require("react");
|
|
7
6
|
var uniqueId_1 = __importDefault(require("lodash-es/uniqueId"));
|
|
7
|
+
var react_1 = require("react");
|
|
8
8
|
function useUniqueId(prefix) {
|
|
9
9
|
var idRef = (0, react_1.useRef)('');
|
|
10
10
|
if (!idRef.current) {
|
package/index.d.ts
CHANGED
|
@@ -37,6 +37,55 @@ declare type ColorName =
|
|
|
37
37
|
| 'basic'
|
|
38
38
|
| string;
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Название цвета для Alert и Notification
|
|
42
|
+
*/
|
|
43
|
+
declare type AlertColorName =
|
|
44
|
+
| 'success'
|
|
45
|
+
| 'info'
|
|
46
|
+
| 'warning'
|
|
47
|
+
| 'error'
|
|
48
|
+
| 'default'
|
|
49
|
+
| string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Название цвета для Button
|
|
53
|
+
*/
|
|
54
|
+
declare type ButtonColorName =
|
|
55
|
+
| 'basic'
|
|
56
|
+
| 'primary'
|
|
57
|
+
| 'secondary'
|
|
58
|
+
| 'success'
|
|
59
|
+
| 'danger'
|
|
60
|
+
| 'warning'
|
|
61
|
+
| 'info'
|
|
62
|
+
| string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Название цвета для Badge
|
|
66
|
+
*/
|
|
67
|
+
declare type BadgeColorName =
|
|
68
|
+
| 'primary'
|
|
69
|
+
| 'secondary'
|
|
70
|
+
| 'success'
|
|
71
|
+
| 'danger'
|
|
72
|
+
| 'warning'
|
|
73
|
+
| 'info'
|
|
74
|
+
| string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Название цвета для Text, Title
|
|
78
|
+
*/
|
|
79
|
+
declare type TypographyColorName =
|
|
80
|
+
| 'primary'
|
|
81
|
+
| 'secondary'
|
|
82
|
+
| 'success'
|
|
83
|
+
| 'danger'
|
|
84
|
+
| 'warning'
|
|
85
|
+
| 'info'
|
|
86
|
+
| 'text-color'
|
|
87
|
+
| string;
|
|
88
|
+
|
|
40
89
|
/**
|
|
41
90
|
* Уникальный ключ. ID, UUID или другое
|
|
42
91
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.96",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
6
6
|
"repository": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"load-js": "^3.0.3",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"lodash-es": "^4.17.21",
|
|
44
|
-
"path-to-regexp": "
|
|
45
|
-
"qs": "^6.
|
|
44
|
+
"path-to-regexp": "1.9.0",
|
|
45
|
+
"qs": "^6.15.0",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-click-outside": "^3.0.1",
|
|
48
48
|
"react-day-picker": "^8.7.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@babel/preset-env": "^7.13.15",
|
|
65
65
|
"@babel/preset-react": "^7.13.13",
|
|
66
66
|
"@babel/preset-typescript": "^7.13.0",
|
|
67
|
-
"@steroidsjs/eslint-config": "^
|
|
67
|
+
"@steroidsjs/eslint-config": "^3.0.5",
|
|
68
68
|
"@testing-library/dom": "^8.20.0",
|
|
69
69
|
"@testing-library/jest-dom": "^5.16.5",
|
|
70
70
|
"@testing-library/react": "^13.4.0",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { IClientStorageComponent } from '../components/ClientStorageComponent';
|
|
4
4
|
import { IHtmlComponent } from '../components/HtmlComponent';
|
|
5
|
-
import {
|
|
5
|
+
import { IHttpComponent } from '../components/HttpComponent';
|
|
6
|
+
import { ILocaleComponent } from '../components/LocaleComponent';
|
|
6
7
|
import { IMetaComponent } from '../components/MetaComponent';
|
|
8
|
+
import { IResourceComponent } from '../components/ResourceComponent';
|
|
7
9
|
import { IStoreComponent } from '../components/StoreComponent';
|
|
8
|
-
import { IClientStorageComponent } from '../components/ClientStorageComponent';
|
|
9
|
-
import { ILocaleComponent } from '../components/LocaleComponent';
|
|
10
10
|
import { IUiApplicationComponent } from '../components/UiComponent';
|
|
11
|
-
import {
|
|
11
|
+
import { IWebSocketComponent } from '../components/WebSocketComponent';
|
|
12
12
|
declare global {
|
|
13
13
|
interface Window {
|
|
14
14
|
SteroidsComponents: IComponents;
|
package/providers/SsrProvider.js
CHANGED
|
@@ -25,13 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
exports.SsrProviderContext = void 0;
|
|
27
27
|
var React = __importStar(require("react"));
|
|
28
|
+
var react_1 = require("react");
|
|
28
29
|
exports.SsrProviderContext = React.createContext(null);
|
|
29
30
|
function SsrProvider(props) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
var value = (0, react_1.useMemo)(function () { return ({
|
|
32
|
+
history: props.history,
|
|
33
|
+
staticContext: props.staticContext,
|
|
34
|
+
preloadedData: props.preloadedData
|
|
35
|
+
}); }, [props.history, props.preloadedData, props.staticContext]);
|
|
36
|
+
return (React.createElement(exports.SsrProviderContext.Provider, { value: value }, props.children));
|
|
36
37
|
}
|
|
37
38
|
exports["default"] = SsrProvider;
|
package/providers/index.d.ts
CHANGED
package/providers/index.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.ComponentsProvider = exports.ScreenProvider = exports.SsrProvider = void 0;
|
|
7
|
-
var ScreenProvider_1 = __importDefault(require("./ScreenProvider"));
|
|
8
|
-
exports.ScreenProvider = ScreenProvider_1["default"];
|
|
9
7
|
var ComponentsProvider_1 = __importDefault(require("./ComponentsProvider"));
|
|
10
8
|
exports.ComponentsProvider = ComponentsProvider_1["default"];
|
|
9
|
+
var ScreenProvider_1 = __importDefault(require("./ScreenProvider"));
|
|
10
|
+
exports.ScreenProvider = ScreenProvider_1["default"];
|
|
11
11
|
var SsrProvider_1 = __importDefault(require("./SsrProvider"));
|
|
12
12
|
exports.SsrProvider = SsrProvider_1["default"];
|
package/reducers/auth.js
CHANGED
package/reducers/fields.js
CHANGED
|
@@ -15,8 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
17
|
exports.getDataProviderItems = exports.getModel = exports.getEnumLabels = exports.isMetaFetched = exports.normalizeName = void 0;
|
|
18
|
-
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
19
18
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
19
|
+
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
20
20
|
var fields_1 = require("../actions/fields");
|
|
21
21
|
var initialState = {
|
|
22
22
|
props: {},
|
|
@@ -25,6 +25,7 @@ var initialState = {
|
|
|
25
25
|
};
|
|
26
26
|
var normalizeName = function (name) { return name.replace(/\\/g, '.').replace(/^\./, ''); };
|
|
27
27
|
exports.normalizeName = normalizeName;
|
|
28
|
+
// eslint-disable-next-line default-param-last
|
|
28
29
|
exports["default"] = (function (state, action) {
|
|
29
30
|
var _a;
|
|
30
31
|
if (state === void 0) { state = initialState; }
|
package/reducers/form.js
CHANGED
|
@@ -15,12 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
17
|
exports.getFormValues = exports.formSelector = exports.reducerItem = void 0;
|
|
18
|
+
var dot_prop_immutable_1 = require("dot-prop-immutable");
|
|
19
|
+
var cloneDeep_1 = __importDefault(require("lodash-es/cloneDeep"));
|
|
18
20
|
var get_1 = __importDefault(require("lodash-es/get"));
|
|
21
|
+
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
19
22
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
20
|
-
var cloneDeep_1 = __importDefault(require("lodash-es/cloneDeep"));
|
|
21
23
|
var isObject_1 = __importDefault(require("lodash-es/isObject"));
|
|
22
|
-
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
23
|
-
var dot_prop_immutable_1 = require("dot-prop-immutable");
|
|
24
24
|
var form_1 = require("../actions/form");
|
|
25
25
|
/**
|
|
26
26
|
* Редьюрес для одной формы. Используется как для Redux, так и для React Reducer
|
|
@@ -76,6 +76,7 @@ function reducerItem(state, action) {
|
|
|
76
76
|
}
|
|
77
77
|
exports.reducerItem = reducerItem;
|
|
78
78
|
var initialState = {};
|
|
79
|
+
// eslint-disable-next-line default-param-last
|
|
79
80
|
exports["default"] = (function (state, action) {
|
|
80
81
|
if (state === void 0) { state = initialState; }
|
|
81
82
|
if (action.formId) {
|
package/reducers/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import auth from './auth';
|
|
|
2
2
|
import fields from './fields';
|
|
3
3
|
import form from './form';
|
|
4
4
|
import list from './list';
|
|
5
|
-
import notifications from './notifications';
|
|
6
5
|
import modal from './modal';
|
|
6
|
+
import notifications from './notifications';
|
|
7
7
|
import router from './router';
|
|
8
8
|
export { form, auth, fields, list, notifications, modal, router, };
|
|
9
9
|
declare const _default: (asyncReducers: any) => import("redux").Reducer<import("redux").CombinedState<{
|
package/reducers/index.js
CHANGED
|
@@ -24,10 +24,10 @@ var form_1 = __importDefault(require("./form"));
|
|
|
24
24
|
exports.form = form_1["default"];
|
|
25
25
|
var list_1 = __importDefault(require("./list"));
|
|
26
26
|
exports.list = list_1["default"];
|
|
27
|
-
var notifications_1 = __importDefault(require("./notifications"));
|
|
28
|
-
exports.notifications = notifications_1["default"];
|
|
29
27
|
var modal_1 = __importDefault(require("./modal"));
|
|
30
28
|
exports.modal = modal_1["default"];
|
|
29
|
+
var notifications_1 = __importDefault(require("./notifications"));
|
|
30
|
+
exports.notifications = notifications_1["default"];
|
|
31
31
|
var router_1 = __importDefault(require("./router"));
|
|
32
32
|
exports.router = router_1["default"];
|
|
33
33
|
exports["default"] = (function (asyncReducers) { return (0, redux_1.combineReducers)(__assign(__assign({ form: form_1["default"], auth: auth_1["default"], fields: fields_1["default"], list: list_1["default"], notifications: notifications_1["default"], modal: modal_1["default"] }, asyncReducers), { router: function (state, action) { return (0, router_1["default"])(asyncReducers.router ? asyncReducers.router(state, action) : {}, action); } })); });
|
package/reducers/list.js
CHANGED
|
@@ -25,10 +25,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
var _a;
|
|
26
26
|
exports.__esModule = true;
|
|
27
27
|
exports.getCheckedIds = exports.isSelectedAll = exports.isSelected = exports.getSelectedIds = exports.getListItems = exports.getIds = exports.getList = exports.isListInitialized = void 0;
|
|
28
|
-
var get_1 = __importDefault(require("lodash-es/get"));
|
|
29
|
-
var isMatch_1 = __importDefault(require("lodash-es/isMatch"));
|
|
30
28
|
var every_1 = __importDefault(require("lodash-es/every"));
|
|
31
29
|
var extend_1 = __importDefault(require("lodash-es/extend"));
|
|
30
|
+
var get_1 = __importDefault(require("lodash-es/get"));
|
|
31
|
+
var isMatch_1 = __importDefault(require("lodash-es/isMatch"));
|
|
32
32
|
var list_1 = require("../actions/list");
|
|
33
33
|
var initialState = {
|
|
34
34
|
lists: {},
|
|
@@ -145,6 +145,7 @@ var reducerMap = (_a = {},
|
|
|
145
145
|
return (__assign(__assign({}, state), { lists: __assign(__assign({}, state.lists), (_a = {}, _a[action.listId] = __assign(__assign({}, state.lists[action.listId]), { action: action.action }), _a)) }));
|
|
146
146
|
},
|
|
147
147
|
_a);
|
|
148
|
+
// eslint-disable-next-line default-param-last
|
|
148
149
|
exports["default"] = (function (state, action) {
|
|
149
150
|
if (state === void 0) { state = initialState; }
|
|
150
151
|
return reducerMap[action.type]
|
package/reducers/modal.js
CHANGED
|
@@ -24,13 +24,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
exports.getOpened = exports.MODAL_DEFAULT_GROUP = void 0;
|
|
27
|
-
var get_1 = __importDefault(require("lodash-es/get"));
|
|
28
27
|
var dot_prop_immutable_1 = require("dot-prop-immutable");
|
|
28
|
+
var get_1 = __importDefault(require("lodash-es/get"));
|
|
29
29
|
var modal_1 = require("../actions/modal");
|
|
30
30
|
exports.MODAL_DEFAULT_GROUP = 'modal';
|
|
31
31
|
var initialState = {
|
|
32
32
|
opened: {}
|
|
33
33
|
};
|
|
34
|
+
// eslint-disable-next-line default-param-last
|
|
34
35
|
exports["default"] = (function (state, action) {
|
|
35
36
|
if (state === void 0) { state = initialState; }
|
|
36
37
|
switch (action.type) {
|
|
@@ -17,6 +17,7 @@ var initialState = {
|
|
|
17
17
|
items: [],
|
|
18
18
|
position: ''
|
|
19
19
|
};
|
|
20
|
+
// eslint-disable-next-line default-param-last
|
|
20
21
|
exports["default"] = (function (state, action) {
|
|
21
22
|
if (state === void 0) { state = initialState; }
|
|
22
23
|
switch (action.type) {
|
|
@@ -26,7 +27,7 @@ exports["default"] = (function (state, action) {
|
|
|
26
27
|
.concat([
|
|
27
28
|
{
|
|
28
29
|
id: action.id,
|
|
29
|
-
|
|
30
|
+
type: action.notificationType || 'info',
|
|
30
31
|
message: action.message,
|
|
31
32
|
isClosing: false,
|
|
32
33
|
position: action.position
|