@steroidsjs/core 2.1.0-beta.27 → 2.1.0-beta.28
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/components/SocialComponent.js +10 -8
- package/components/social/FacebookProvider.d.ts +1 -1
- package/components/social/FacebookProvider.js +5 -6
- package/components/social/GitlabProvider.d.ts +1 -1
- package/components/social/GitlabProvider.js +5 -5
- package/components/social/GoogleProvider.d.ts +1 -1
- package/components/social/GoogleProvider.js +2 -2
- package/components/social/SteamProvider.d.ts +1 -1
- package/components/social/SteamProvider.js +8 -9
- package/components/social/VkProvider.d.ts +1 -1
- package/components/social/VkProvider.js +8 -9
- package/hooks/useDataSelect.js +4 -2
- package/hooks/useFetch.js +3 -0
- package/hooks/useLayout.js +21 -12
- package/hooks/useList.d.ts +4 -0
- package/hooks/useList.js +1 -0
- package/package.json +1 -1
- package/ui/content/Detail/Detail.d.ts +1 -1
- package/ui/crud/Crud/Crud.js +4 -2
- package/ui/crud/Crud/CrudContent.d.ts +5 -1
- package/ui/crud/Crud/CrudContent.js +5 -5
- package/ui/crud/index.d.ts +1 -0
- package/ui/list/Grid/Grid.js +2 -1
- package/ui/list/List/List.js +2 -1
- package/ui/nav/Router/Router.d.ts +5 -0
- package/components/social/index.d.ts +0 -13
- package/components/social/index.js +0 -17
|
@@ -3,7 +3,7 @@ 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
|
|
6
|
+
var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
|
|
7
7
|
/**
|
|
8
8
|
* Social Component
|
|
9
9
|
* Провайдер для социальных сетей. Обеспечивает вызов окна соц сети для oauth авторизации
|
|
@@ -17,11 +17,15 @@ var SocialComponent = /** @class */ (function () {
|
|
|
17
17
|
SocialComponent.prototype.init = function () {
|
|
18
18
|
var _this = this;
|
|
19
19
|
Object.keys(this.providers).forEach(function (name) {
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
_this.providers[name] = new social_1["default"][name](_this._components);
|
|
23
|
-
Object.assign(_this.providers[name], config);
|
|
20
|
+
if (isFunction_1["default"](_this.providers[name])) {
|
|
21
|
+
_this.providers[name] = { className: _this.providers[name] };
|
|
24
22
|
}
|
|
23
|
+
var ProviderClass = _this.providers[name].className;
|
|
24
|
+
delete _this.providers[name].className;
|
|
25
|
+
if (!ProviderClass) {
|
|
26
|
+
throw new Error('Not found class for social provider: ' + name);
|
|
27
|
+
}
|
|
28
|
+
_this.providers[name] = new ProviderClass(_this._components, _this.providers[name]);
|
|
25
29
|
});
|
|
26
30
|
Object.keys(this.providers).forEach(function (name) {
|
|
27
31
|
_this._initializing[name] = _this.providers[name].init();
|
|
@@ -32,9 +36,7 @@ var SocialComponent = /** @class */ (function () {
|
|
|
32
36
|
if (!this._initializing[socialName]) {
|
|
33
37
|
return Promise.reject();
|
|
34
38
|
}
|
|
35
|
-
return this._initializing[socialName].then(function () {
|
|
36
|
-
return _this.providers[socialName].start();
|
|
37
|
-
});
|
|
39
|
+
return this._initializing[socialName].then(function () { return _this.providers[socialName].start(); });
|
|
38
40
|
};
|
|
39
41
|
return SocialComponent;
|
|
40
42
|
}());
|
|
@@ -37,13 +37,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
39
|
var FacebookProvider = /** @class */ (function () {
|
|
40
|
-
function FacebookProvider(components) {
|
|
40
|
+
function FacebookProvider(components, config) {
|
|
41
41
|
this._components = components;
|
|
42
|
-
this.clientId = '';
|
|
43
|
-
this.language =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this._components.locale.language.toUpperCase();
|
|
42
|
+
this.clientId = config.clientId || '';
|
|
43
|
+
this.language = this._components.locale.language
|
|
44
|
+
+ '_'
|
|
45
|
+
+ this._components.locale.language.toUpperCase();
|
|
47
46
|
}
|
|
48
47
|
FacebookProvider.prototype.init = function () {
|
|
49
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -37,10 +37,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
39
|
var GitlabProvider = /** @class */ (function () {
|
|
40
|
-
function GitlabProvider(components) {
|
|
40
|
+
function GitlabProvider(components, config) {
|
|
41
41
|
this._components = components;
|
|
42
|
-
this.url = '';
|
|
43
|
-
this.redirectUrl = this._components.http.getUrl('/api/v1/auth/social/proxy');
|
|
42
|
+
this.url = config.url || '';
|
|
43
|
+
this.redirectUrl = config.redirectUrl || this._components.http.getUrl('/api/v1/auth/social/proxy');
|
|
44
44
|
}
|
|
45
45
|
GitlabProvider.prototype.init = function () {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -78,9 +78,9 @@ var GitlabProvider = /** @class */ (function () {
|
|
|
78
78
|
.join(','));
|
|
79
79
|
popup.onbeforeunload = function () { return reject(); };
|
|
80
80
|
// This is a handler which is used by child window to pass auth result
|
|
81
|
-
// @ts-ignore
|
|
82
81
|
window.authCallback = function (link) {
|
|
83
|
-
// link: http://127.0.0.1:9424/api/v1/auth/social/proxy
|
|
82
|
+
// link: http://127.0.0.1:9424/api/v1/auth/social/proxy
|
|
83
|
+
// ?provider=gitlab_kozhindev#access_token=7b87e3de0...5518198d885d&token_type=Bearer
|
|
84
84
|
var token = (/access_token=(\w+)/.exec(link) || [])[1];
|
|
85
85
|
if (token) {
|
|
86
86
|
resolve({ token: token });
|
|
@@ -37,9 +37,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
39
|
var GoogleProvider = /** @class */ (function () {
|
|
40
|
-
function GoogleProvider(components) {
|
|
40
|
+
function GoogleProvider(components, config) {
|
|
41
41
|
this._components = components;
|
|
42
|
-
this.clientId =
|
|
42
|
+
this.clientId = config.clientId;
|
|
43
43
|
}
|
|
44
44
|
GoogleProvider.prototype.init = function () {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -57,9 +57,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
57
57
|
exports.__esModule = true;
|
|
58
58
|
var queryString = __importStar(require("qs"));
|
|
59
59
|
var Vk = /** @class */ (function () {
|
|
60
|
-
function Vk(components) {
|
|
60
|
+
function Vk(components, config) {
|
|
61
61
|
this._components = components;
|
|
62
|
-
this.clientId =
|
|
62
|
+
this.clientId = config.clientId;
|
|
63
63
|
}
|
|
64
64
|
Vk.prototype.init = function () {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -74,14 +74,14 @@ var Vk = /** @class */ (function () {
|
|
|
74
74
|
return __generator(this, function (_a) {
|
|
75
75
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
76
76
|
// Generate url
|
|
77
|
-
var url = 'https://steamcommunity.com/openid/login?'
|
|
78
|
-
queryString.stringify({
|
|
77
|
+
var url = 'https://steamcommunity.com/openid/login?'
|
|
78
|
+
+ queryString.stringify({
|
|
79
79
|
'openid.mode': 'checkid_setup',
|
|
80
80
|
'openid.ns': 'http://specs.openid.net/auth/2.0',
|
|
81
81
|
'openid.identity': 'http://specs.openid.net/auth/2.0/identifier_select',
|
|
82
82
|
'openid.claimed_id': 'http://specs.openid.net/auth/2.0/identifier_select',
|
|
83
83
|
'openid.return_to': _this._components.http.getUrl('/api/v1/auth/social/proxy'),
|
|
84
|
-
'openid.realm': location.origin
|
|
84
|
+
'openid.realm': window.location.origin
|
|
85
85
|
});
|
|
86
86
|
// Open popup auth window
|
|
87
87
|
var width = 900;
|
|
@@ -107,14 +107,13 @@ var Vk = /** @class */ (function () {
|
|
|
107
107
|
.join(','));
|
|
108
108
|
popup.onbeforeunload = function () { return reject(); };
|
|
109
109
|
// This is a handler which is used by child window to pass auth result
|
|
110
|
-
// @ts-ignore
|
|
111
110
|
window.authCallback = function (link) {
|
|
112
|
-
var
|
|
113
|
-
if (!
|
|
111
|
+
var query = queryString.parse(new URL(link).search);
|
|
112
|
+
if (!query['openid.mode']) {
|
|
114
113
|
reject();
|
|
115
114
|
}
|
|
116
115
|
else {
|
|
117
|
-
resolve(
|
|
116
|
+
resolve(query);
|
|
118
117
|
}
|
|
119
118
|
};
|
|
120
119
|
})];
|
|
@@ -57,10 +57,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
57
57
|
exports.__esModule = true;
|
|
58
58
|
var queryString = __importStar(require("qs"));
|
|
59
59
|
var VkProvider = /** @class */ (function () {
|
|
60
|
-
function VkProvider(components) {
|
|
60
|
+
function VkProvider(components, config) {
|
|
61
61
|
this._components = components;
|
|
62
|
-
this.clientId =
|
|
63
|
-
this.redirectUrl = this._components.http.getUrl('/api/v1/auth/social/proxy');
|
|
62
|
+
this.clientId = config.clientId;
|
|
63
|
+
this.redirectUrl = config.redirectUrl || this._components.http.getUrl('/api/v1/auth/social/proxy');
|
|
64
64
|
}
|
|
65
65
|
VkProvider.prototype.init = function () {
|
|
66
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -75,8 +75,8 @@ var VkProvider = /** @class */ (function () {
|
|
|
75
75
|
return __generator(this, function (_a) {
|
|
76
76
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
77
77
|
// Generate url
|
|
78
|
-
var url = 'https://oauth.vk.com/authorize/?'
|
|
79
|
-
queryString.stringify({
|
|
78
|
+
var url = 'https://oauth.vk.com/authorize/?'
|
|
79
|
+
+ queryString.stringify({
|
|
80
80
|
client_id: _this.clientId,
|
|
81
81
|
redirect_uri: _this.redirectUrl,
|
|
82
82
|
scope: 'offline,public_profile',
|
|
@@ -106,16 +106,15 @@ var VkProvider = /** @class */ (function () {
|
|
|
106
106
|
.join(','));
|
|
107
107
|
popup.onbeforeunload = function () { return reject(); };
|
|
108
108
|
// This is a handler which is used by child window to pass auth result
|
|
109
|
-
// @ts-ignore
|
|
110
109
|
window.authCallback = function (link) {
|
|
111
|
-
var
|
|
112
|
-
var error =
|
|
110
|
+
var query = new URL(link).searchParams;
|
|
111
|
+
var error = query.get('error');
|
|
113
112
|
if (error) {
|
|
114
113
|
reject(error);
|
|
115
114
|
}
|
|
116
115
|
else {
|
|
117
116
|
resolve({
|
|
118
|
-
token:
|
|
117
|
+
token: query.get('code')
|
|
119
118
|
});
|
|
120
119
|
}
|
|
121
120
|
};
|
package/hooks/useDataSelect.js
CHANGED
|
@@ -34,7 +34,9 @@ function useDataSelect(config) {
|
|
|
34
34
|
}, [config.items, config.selectFirst, config.selectedIds, primaryKey, config.inputValue]);
|
|
35
35
|
var initialSelectedItems = react_1.useMemo(function () { return config.items.length > 0
|
|
36
36
|
&& initialSelectedIds.length > 0
|
|
37
|
-
? initialSelectedIds
|
|
37
|
+
? initialSelectedIds
|
|
38
|
+
.map(function (selectedId) { return config.items.find(function (item) { return item.id === selectedId; }); })
|
|
39
|
+
.filter(Boolean)
|
|
38
40
|
: []; }, [initialSelectedIds, config.items]);
|
|
39
41
|
// State
|
|
40
42
|
var _a = react_1.useState(false), isOpened = _a[0], setIsOpened = _a[1];
|
|
@@ -81,7 +83,7 @@ function useDataSelect(config) {
|
|
|
81
83
|
var hasChanges = false;
|
|
82
84
|
selectedIds.forEach(function (selectedId) {
|
|
83
85
|
var finedItem = config.items.find(function (item) { return item[primaryKey] === selectedId; });
|
|
84
|
-
if (!finedItem) {
|
|
86
|
+
if (!finedItem && config.sourceItems) {
|
|
85
87
|
finedItem = config.sourceItems.find(function (item) { return item[primaryKey] === selectedId; });
|
|
86
88
|
}
|
|
87
89
|
var selectedItem = selectedItems.find(function (item) { return item[primaryKey] === selectedId; });
|
package/hooks/useFetch.js
CHANGED
|
@@ -60,6 +60,9 @@ var normalizeConfig = function (config) { return (config
|
|
|
60
60
|
? __assign({ id: null, url: '', method: 'get', params: {}, options: null, onFetch: null }, config) : null); };
|
|
61
61
|
exports.normalizeConfig = normalizeConfig;
|
|
62
62
|
var getConfigId = function (config) {
|
|
63
|
+
if (config === null) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
63
66
|
var result = trim_1["default"](config.id || config.url, '/');
|
|
64
67
|
if (!result) {
|
|
65
68
|
// eslint-disable-next-line no-console
|
package/hooks/useLayout.js
CHANGED
|
@@ -81,14 +81,18 @@ var runInitAction = function (initAction, components, dispatch) { return (initAc
|
|
|
81
81
|
exports.runInitAction = runInitAction;
|
|
82
82
|
function useLayout(initAction) {
|
|
83
83
|
if (initAction === void 0) { initAction = null; }
|
|
84
|
-
var _a = useSelector_1["default"](function (state) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
var _a = useSelector_1["default"](function (state) {
|
|
85
|
+
var routesMap = router_1.getRoutesMap(state);
|
|
86
|
+
return {
|
|
87
|
+
route: router_1.getRoute(state),
|
|
88
|
+
user: auth_1.getUser(state),
|
|
89
|
+
data: auth_1.getData(state),
|
|
90
|
+
isInitialized: auth_1.isInitialized(state),
|
|
91
|
+
initializeCounter: auth_1.getInitializeCounter(state),
|
|
92
|
+
redirectPageId: state.auth.redirectPageId,
|
|
93
|
+
loginRouteId: Object.keys(routesMap).find(function (name) { return routesMap[name].role === 'login'; })
|
|
94
|
+
};
|
|
95
|
+
}), route = _a.route, user = _a.user, data = _a.data, isInitialized = _a.isInitialized, initializeCounter = _a.initializeCounter, redirectPageId = _a.redirectPageId, loginRouteId = _a.loginRouteId;
|
|
92
96
|
var _b = react_1.useState(null), error = _b[0], setError = _b[1];
|
|
93
97
|
var dispatch = useDispatch_1["default"]();
|
|
94
98
|
var components = useComponents_1["default"]();
|
|
@@ -133,10 +137,15 @@ function useLayout(initAction) {
|
|
|
133
137
|
userRoles.push(null); // Guest
|
|
134
138
|
}
|
|
135
139
|
if (intersection_1["default"](pageRoles, userRoles).length === 0) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
if (loginRouteId && route.id !== loginRouteId) {
|
|
141
|
+
dispatch(router_2.goToRoute(loginRouteId));
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
status = exports.STATUS_ACCESS_DENIED;
|
|
145
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
146
|
+
// eslint-disable-next-line no-console
|
|
147
|
+
console.log('Access denied. Page roles: ', pageRoles, 'User roles:', userRoles.join(), 'Route:', route);
|
|
148
|
+
}
|
|
140
149
|
}
|
|
141
150
|
}
|
|
142
151
|
}
|
package/hooks/useList.d.ts
CHANGED
|
@@ -134,6 +134,10 @@ export interface IListConfig {
|
|
|
134
134
|
* и последующие запросы на бекенд для 2-й и следующих страниц
|
|
135
135
|
*/
|
|
136
136
|
initialItems?: Array<any>;
|
|
137
|
+
/**
|
|
138
|
+
* Количество элементов всего в списке (для отрисовки пагинации), заданное вручную
|
|
139
|
+
*/
|
|
140
|
+
initialTotal?: number;
|
|
137
141
|
}
|
|
138
142
|
export interface IListOutput {
|
|
139
143
|
list: IList;
|
package/hooks/useList.js
CHANGED
|
@@ -193,6 +193,7 @@ function useList(config) {
|
|
|
193
193
|
scope: config.scope,
|
|
194
194
|
items: null,
|
|
195
195
|
sourceItems: config.items || null,
|
|
196
|
+
total: config.initialTotal,
|
|
196
197
|
isRemote: !config.items,
|
|
197
198
|
primaryKey: config.primaryKey || exports.defaultConfig.primaryKey,
|
|
198
199
|
formId: formId,
|
package/package.json
CHANGED
|
@@ -74,7 +74,7 @@ export interface IDetailProps {
|
|
|
74
74
|
/**
|
|
75
75
|
* Дочерние компоненты
|
|
76
76
|
*/
|
|
77
|
-
children
|
|
77
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
78
78
|
[key: string]: any;
|
|
79
79
|
}
|
|
80
80
|
export interface IDetailItemOutputProps extends IDetailItemProps {
|
package/ui/crud/Crud/Crud.js
CHANGED
|
@@ -150,13 +150,15 @@ function Crud(props) {
|
|
|
150
150
|
model: props.model,
|
|
151
151
|
restUrl: props.restUrl,
|
|
152
152
|
restApi: props.restApi,
|
|
153
|
+
grid: props.grid,
|
|
154
|
+
form: props.form,
|
|
153
155
|
goToAction: goToAction,
|
|
154
156
|
items: items,
|
|
155
157
|
itemsToControls: itemsToControls,
|
|
156
158
|
record: record,
|
|
157
159
|
recordId: recordId
|
|
158
|
-
}); }, [crudId,
|
|
159
|
-
props.
|
|
160
|
+
}); }, [crudId, props.queryKey, props.primaryKey, props.model, props.restUrl, props.restApi, props.grid,
|
|
161
|
+
props.form, goToAction, items, itemsToControls, record, recordId]);
|
|
160
162
|
// Open modal on route change
|
|
161
163
|
react_1.useEffect(function () {
|
|
162
164
|
if (mode === MODE_MODAL && routeAction !== utils_1.CRUD_ACTION_INDEX) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IGridProps } from '@steroidsjs/core/ui/list/Grid/Grid';
|
|
3
|
+
import { IFormProps } from '@steroidsjs/core/ui/form/Form/Form';
|
|
2
4
|
import { ICrudItem } from './Crud';
|
|
3
5
|
import { IApiRest } from '../../../components/ApiComponent';
|
|
4
6
|
export interface ICrudContentProps {
|
|
@@ -14,5 +16,7 @@ export interface ICrudContentProps {
|
|
|
14
16
|
record?: Record<string, unknown>;
|
|
15
17
|
recordId?: PrimaryKey;
|
|
16
18
|
action?: string;
|
|
19
|
+
grid?: IGridProps | React.ReactNode;
|
|
20
|
+
form?: IFormProps | React.ReactNode;
|
|
17
21
|
}
|
|
18
22
|
export default function CrudContent(props: ICrudContentProps): JSX.Element;
|
|
@@ -68,23 +68,23 @@ function CrudContent(props) {
|
|
|
68
68
|
ItemComponent = Grid_1["default"];
|
|
69
69
|
}
|
|
70
70
|
return (React.createElement(ItemComponent // Grid
|
|
71
|
-
, { key: props.crudId, listId: props.crudId, action: props.restApi ? props.restApi.index : props.restUrl, scope: ['model', 'permission'], primaryKey: props.primaryKey, model: props.model,
|
|
71
|
+
, __assign({ key: props.crudId, listId: props.crudId, action: props.restApi ? props.restApi.index : props.restUrl, scope: ['model', 'permission'], primaryKey: props.primaryKey, model: props.model,
|
|
72
72
|
//searchModel={props.searchModel}
|
|
73
73
|
controls: controlsGetter, columns: [props.primaryKey], pagination: {
|
|
74
74
|
loadMore: false
|
|
75
|
-
} }));
|
|
75
|
+
} }, props.grid)));
|
|
76
76
|
case utils_1.CRUD_ACTION_CREATE:
|
|
77
77
|
case utils_1.CRUD_ACTION_UPDATE:
|
|
78
78
|
if (!ItemComponent) {
|
|
79
79
|
ItemComponent = Form_1["default"];
|
|
80
80
|
}
|
|
81
|
-
if (props.action === utils_1.CRUD_ACTION_UPDATE && !props.record) {
|
|
81
|
+
if (props.action === utils_1.CRUD_ACTION_UPDATE && (props.restUrl || props.restApi) && !props.record) {
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
return (React.createElement(ItemComponent // Form
|
|
85
|
-
, { key: formId, formId: formId, action: props.restApi
|
|
85
|
+
, __assign({ key: formId, formId: formId, action: props.restApi
|
|
86
86
|
? (props.recordId ? props.restApi.update : props.restApi.create)
|
|
87
|
-
: [props.restUrl, props.recordId].filter(Boolean).join('/'), model: props.model, autoFocus: true, submitLabel: props.recordId ? __('Сохранить') : __('Добавить'), layout: 'horizontal', onComplete: onFormComplete, initialValues: formInitialValues }));
|
|
87
|
+
: [props.restUrl, props.recordId].filter(Boolean).join('/'), model: props.model, autoFocus: true, submitLabel: props.recordId ? __('Сохранить') : __('Добавить'), layout: 'horizontal', onComplete: onFormComplete }, props.form, { initialValues: formInitialValues })));
|
|
88
88
|
default:
|
|
89
89
|
if (ItemComponent) {
|
|
90
90
|
return (React.createElement(ItemComponent, __assign({ key: props.crudId + '_' + props.action }, props, crudItem.componentProps)));
|
package/ui/crud/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const generateCrud: (routeId: string, props: ICrudGeneratorProps)
|
|
|
26
26
|
isNavVisible?: boolean;
|
|
27
27
|
models: string | string[];
|
|
28
28
|
enums: string | string[];
|
|
29
|
+
role?: string;
|
|
29
30
|
roles?: string[];
|
|
30
31
|
fetch?: import("../../hoc/fetch").IFetchHocConfigFunc;
|
|
31
32
|
items?: IRouteItem[] | {
|
package/ui/list/Grid/Grid.js
CHANGED
|
@@ -63,7 +63,8 @@ function Grid(props) {
|
|
|
63
63
|
model: props.model,
|
|
64
64
|
searchModel: props.searchModel,
|
|
65
65
|
items: props.items,
|
|
66
|
-
initialItems: props.initialItems
|
|
66
|
+
initialItems: props.initialItems,
|
|
67
|
+
initialTotal: props.initialTotal
|
|
67
68
|
}), list = _a.list, model = _a.model, searchModel = _a.searchModel, paginationPosition = _a.paginationPosition, paginationSizePosition = _a.paginationSizePosition, layoutNamesPosition = _a.layoutNamesPosition, renderList = _a.renderList, renderEmpty = _a.renderEmpty, renderPagination = _a.renderPagination, renderPaginationSize = _a.renderPaginationSize, renderLayoutNames = _a.renderLayoutNames, renderSearchForm = _a.renderSearchForm, onFetch = _a.onFetch, onSort = _a.onSort;
|
|
68
69
|
var renderLabel = react_1.useCallback(function (column) {
|
|
69
70
|
if (column.headerView) {
|
package/ui/list/List/List.js
CHANGED
|
@@ -58,7 +58,8 @@ function List(props) {
|
|
|
58
58
|
model: props.model,
|
|
59
59
|
searchModel: props.searchModel,
|
|
60
60
|
items: props.items,
|
|
61
|
-
initialItems: props.initialItems
|
|
61
|
+
initialItems: props.initialItems,
|
|
62
|
+
initialTotal: props.initialTotal
|
|
62
63
|
}), list = _a.list, paginationPosition = _a.paginationPosition, paginationSizePosition = _a.paginationSizePosition, layoutNamesPosition = _a.layoutNamesPosition, renderList = _a.renderList, renderEmpty = _a.renderEmpty, renderPagination = _a.renderPagination, renderPaginationSize = _a.renderPaginationSize, renderLayoutNames = _a.renderLayoutNames, renderSearchForm = _a.renderSearchForm;
|
|
63
64
|
var ItemView = props.itemView || components.ui.getView('list.ListItemView');
|
|
64
65
|
var content = ((list === null || list === void 0 ? void 0 : list.items) || []).map(function (item, index) { return (React.createElement(ItemView, __assign({}, props.itemProps, { key: item[props.primaryKey] || index, primaryKey: props.primaryKey, item: item, index: index, layoutSelected: list.layoutName }))); });
|
|
@@ -73,6 +73,11 @@ export interface IRouteItem {
|
|
|
73
73
|
* Название или список с названиями перечислений, полученных с бэкенда
|
|
74
74
|
*/
|
|
75
75
|
enums?: string | string[];
|
|
76
|
+
/**
|
|
77
|
+
* Назначение страницы, указывается, чтобы приложение автоматически могло найти страницу авторизации или 404-ю..
|
|
78
|
+
* @example 'login'
|
|
79
|
+
*/
|
|
80
|
+
role?: 'login' | '404' | string;
|
|
76
81
|
/**
|
|
77
82
|
* Список с ролями, который показывает, кому из пользователей будет доступен просмотр страницы
|
|
78
83
|
* @example ['user', 'admin']
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import facebook from './FacebookProvider';
|
|
2
|
-
import google from './GoogleProvider';
|
|
3
|
-
import steam from './SteamProvider';
|
|
4
|
-
import vk from './VkProvider';
|
|
5
|
-
import gitlab from './GitlabProvider';
|
|
6
|
-
declare const _default: {
|
|
7
|
-
facebook: typeof facebook;
|
|
8
|
-
google: typeof google;
|
|
9
|
-
steam: typeof steam;
|
|
10
|
-
vk: typeof vk;
|
|
11
|
-
gitlab: typeof gitlab;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
var FacebookProvider_1 = __importDefault(require("./FacebookProvider"));
|
|
7
|
-
var GoogleProvider_1 = __importDefault(require("./GoogleProvider"));
|
|
8
|
-
var SteamProvider_1 = __importDefault(require("./SteamProvider"));
|
|
9
|
-
var VkProvider_1 = __importDefault(require("./VkProvider"));
|
|
10
|
-
var GitlabProvider_1 = __importDefault(require("./GitlabProvider"));
|
|
11
|
-
exports["default"] = {
|
|
12
|
-
facebook: FacebookProvider_1["default"],
|
|
13
|
-
google: GoogleProvider_1["default"],
|
|
14
|
-
steam: SteamProvider_1["default"],
|
|
15
|
-
vk: VkProvider_1["default"],
|
|
16
|
-
gitlab: GitlabProvider_1["default"]
|
|
17
|
-
};
|