@steroidsjs/core 3.0.0-beta.112 → 3.0.0-beta.114
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/router.js +19 -2
- package/docs-autogen-result.json +405 -130
- package/en.json +9 -1
- package/hooks/index.d.ts +3 -3
- package/hooks/index.js +5 -5
- package/hooks/useTree.d.ts +5 -0
- package/hooks/useTree.js +3 -2
- package/package.json +1 -1
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +27 -16
- package/ui/content/CalendarSystem/CalendarSystem.js +65 -76
- package/ui/content/CalendarSystem/hooks/useCalendarControls.d.ts +1 -2
- package/ui/content/CalendarSystem/hooks/useCalendarControls.js +14 -17
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +3 -3
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarType.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useCalendarType.js +22 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +49 -0
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.d.ts → useMonthGrid.d.ts} +4 -5
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.js → useMonthGrid.js} +20 -14
- package/ui/content/CalendarSystem/hooks/{useWeekCalendar.d.ts → useWeekGrid.d.ts} +6 -5
- package/ui/content/CalendarSystem/hooks/useWeekGrid.js +72 -0
- package/ui/content/CalendarSystem/utils/utils.d.ts +8 -0
- package/ui/content/CalendarSystem/utils/utils.js +27 -1
- package/ui/content/Chat/Chat.d.ts +39 -1
- package/ui/content/Chat/Chat.js +32 -12
- package/ui/content/Chat/hooks/useChat.d.ts +2 -2
- package/ui/content/Chat/hooks/useChat.js +23 -6
- package/ui/form/CheckboxTreeField/CheckboxTreeField.d.ts +2 -3
- package/ui/form/CheckboxTreeField/CheckboxTreeField.js +3 -4
- package/ui/form/FileField/FileField.js +5 -0
- package/ui/list/TreeTable/TreeTable.d.ts +5 -4
- package/ui/list/TreeTable/TreeTable.js +3 -3
- package/ui/nav/Router/Router.d.ts +6 -0
- package/ui/nav/Router/Router.js +4 -3
- package/ui/nav/Router/helpers.d.ts +2 -2
- package/ui/nav/Router/helpers.js +41 -7
- package/ui/nav/Tree/Tree.d.ts +14 -3
- package/ui/nav/Tree/Tree.js +5 -2
- package/ui/content/CalendarSystem/hooks/useWeekCalendar.js +0 -86
package/actions/router.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.goToParent = exports.goToRoute = exports.initParams = exports.initRoutes = exports.ROUTER_SET_DATA = exports.ROUTER_SET_PARAMS = exports.ROUTER_INIT_ROUTES = void 0;
|
|
4
4
|
var connected_react_router_1 = require("connected-react-router");
|
|
5
|
+
var path_to_regexp_1 = require("path-to-regexp");
|
|
5
6
|
exports.ROUTER_INIT_ROUTES = 'ROUTER_INIT_ROUTES';
|
|
6
7
|
exports.ROUTER_SET_PARAMS = 'ROUTER_SET_PARAMS';
|
|
7
8
|
exports.ROUTER_SET_DATA = 'ROUTER_SET_DATA';
|
|
@@ -15,6 +16,20 @@ var initParams = function (params) { return ({
|
|
|
15
16
|
params: params
|
|
16
17
|
}); };
|
|
17
18
|
exports.initParams = initParams;
|
|
19
|
+
// Include in the result only those parameters that are present as route parameters in the path
|
|
20
|
+
// For example, given the path '/users/:id' and the parameters { id: 1, page: 3, totalPages: 10 }, the function will return { id: 1 }.
|
|
21
|
+
var filterParamsForPath = function (path, params) {
|
|
22
|
+
if (!path) {
|
|
23
|
+
return params;
|
|
24
|
+
}
|
|
25
|
+
var parsedPath = (0, path_to_regexp_1.parse)(path);
|
|
26
|
+
return parsedPath.reduce(function (filteredParams, param) {
|
|
27
|
+
if (typeof param === 'object' && params[param.name]) {
|
|
28
|
+
filteredParams[param.name] = params[param.name];
|
|
29
|
+
}
|
|
30
|
+
return filteredParams;
|
|
31
|
+
}, {});
|
|
32
|
+
};
|
|
18
33
|
var goToRoute = function (routeId, params, isReplace) {
|
|
19
34
|
if (params === void 0) { params = null; }
|
|
20
35
|
if (isReplace === void 0) { isReplace = false; }
|
|
@@ -27,8 +42,10 @@ var goToRoute = function (routeId, params, isReplace) {
|
|
|
27
42
|
var getRouteProp = require('../reducers/router').getRouteProp;
|
|
28
43
|
var buildUrl = require('../reducers/router').buildUrl;
|
|
29
44
|
var path = getRouteProp(getState(), routeId, 'path');
|
|
30
|
-
var
|
|
31
|
-
|
|
45
|
+
var filteredParams = filterParamsForPath(path, params);
|
|
46
|
+
var routeUrl = buildUrl(path, filteredParams);
|
|
47
|
+
var reduxAction = isReplace ? (0, connected_react_router_1.replace)(routeUrl) : (0, connected_react_router_1.push)(routeUrl);
|
|
48
|
+
return dispatch(reduxAction);
|
|
32
49
|
};
|
|
33
50
|
};
|
|
34
51
|
exports.goToRoute = goToRoute;
|