@steroidsjs/core 3.0.0-beta.72 → 3.0.0-beta.74
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/package.json
CHANGED
|
@@ -31,8 +31,8 @@ export interface INumberFieldViewProps extends INumberFieldProps, IFieldWrapperO
|
|
|
31
31
|
value: number;
|
|
32
32
|
placeholder: string;
|
|
33
33
|
disabled: boolean;
|
|
34
|
-
min:
|
|
35
|
-
max:
|
|
34
|
+
min: number;
|
|
35
|
+
max: number;
|
|
36
36
|
step: string | number;
|
|
37
37
|
};
|
|
38
38
|
}
|
package/ui/nav/Router/Router.js
CHANGED
|
@@ -81,6 +81,7 @@ var renderComponent = function (route, activePath, routeProps) {
|
|
|
81
81
|
};
|
|
82
82
|
function Router(props) {
|
|
83
83
|
var components = (0, hooks_1.useComponents)();
|
|
84
|
+
var rememberedPrevRouterParamsRef = (0, react_1.useRef)({});
|
|
84
85
|
var _a = (0, hooks_1.useSelector)(function (state) {
|
|
85
86
|
var _a, _b, _c;
|
|
86
87
|
return ({
|
|
@@ -104,6 +105,7 @@ function Router(props) {
|
|
|
104
105
|
var prevRouteParams = (0, react_use_1.usePrevious)(routeParams);
|
|
105
106
|
(0, react_1.useEffect)(function () {
|
|
106
107
|
if (!(0, isEqual_1["default"])(prevRouteParams, routeParams)) {
|
|
108
|
+
rememberedPrevRouterParamsRef.current = prevRouteParams;
|
|
107
109
|
dispatch((0, router_1.initParams)(routeParams));
|
|
108
110
|
}
|
|
109
111
|
}, [dispatch, prevRouteParams, routeParams]);
|
|
@@ -145,14 +147,15 @@ function Router(props) {
|
|
|
145
147
|
var openedModalIds = (0, react_1.useMemo)(function () { return (openedModals || []).map(function (modal) { return modal.id; }); }, [openedModals]);
|
|
146
148
|
var prevOpenedModalIds = (0, react_use_1.usePrevious)(openedModalIds);
|
|
147
149
|
(0, react_1.useEffect)(function () {
|
|
148
|
-
if (prevOpenedModalIds !== openedModalIds
|
|
149
|
-
&& route
|
|
150
|
+
if (prevOpenedModalIds !== openedModalIds
|
|
151
|
+
&& route
|
|
152
|
+
&& !openedModalIds.includes(route.id)) {
|
|
150
153
|
var parentRouteId = activeRouteIds.find(function (activeRouteId) {
|
|
151
154
|
var activeRoute = routes.find(function (routeItem) { return routeItem.id === activeRouteId; });
|
|
152
155
|
return activeRoute && activeRoute.role !== exports.ROUTER_ROLE_MODAL;
|
|
153
156
|
});
|
|
154
157
|
if (parentRouteId) {
|
|
155
|
-
dispatch((0, router_1.goToRoute)(parentRouteId,
|
|
158
|
+
dispatch((0, router_1.goToRoute)(parentRouteId, rememberedPrevRouterParamsRef.current));
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
});
|
package/ui/nav/Tree/Tree.d.ts
CHANGED
|
@@ -71,6 +71,11 @@ export interface ITreeProps {
|
|
|
71
71
|
* @example true
|
|
72
72
|
*/
|
|
73
73
|
autoSave?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Используется для управления раскрытием всех элементов в дереве
|
|
76
|
+
* @example: true
|
|
77
|
+
*/
|
|
78
|
+
alwaysOpened?: boolean;
|
|
74
79
|
[key: string]: any;
|
|
75
80
|
}
|
|
76
81
|
export interface ITreeViewProps extends ITreeProps {
|
package/ui/nav/Tree/Tree.js
CHANGED
|
@@ -137,7 +137,7 @@ function Tree(props) {
|
|
|
137
137
|
}
|
|
138
138
|
(sourceItems || []).forEach(function (item, index) {
|
|
139
139
|
var uniqId = resolveId(item, index, parentId);
|
|
140
|
-
var isOpened = !!openedItems[uniqId];
|
|
140
|
+
var isOpened = props.alwaysOpened || !!openedItems[uniqId];
|
|
141
141
|
var hasItems = item[props.itemsKey] && item[props.itemsKey].length > 0;
|
|
142
142
|
if (props.level && (level === props.level - 1)) {
|
|
143
143
|
hasItems = false;
|
|
@@ -152,7 +152,7 @@ function Tree(props) {
|
|
|
152
152
|
return result;
|
|
153
153
|
};
|
|
154
154
|
return getItems(items);
|
|
155
|
-
}, [activeRouteIds, items, onItemClick, openedItems, props.itemsKey, props.level, routerParams, selectedUniqId]);
|
|
155
|
+
}, [activeRouteIds, items, onItemClick, openedItems, props.alwaysOpened, props.itemsKey, props.level, routerParams, selectedUniqId]);
|
|
156
156
|
return components.ui.renderView(props.view || 'nav.TreeView', __assign(__assign({}, props), { items: resultItems }));
|
|
157
157
|
}
|
|
158
158
|
Tree.defaultProps = {
|