@steroidsjs/core 3.0.44 → 3.0.45
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/docs-autogen-result.json +46 -4
- package/en.json +2 -0
- package/hooks/useTree.d.ts +5 -0
- package/hooks/useTree.js +3 -2
- package/package.json +1 -1
- package/ui/form/FieldList/FieldList.js +1 -1
- package/ui/list/Pagination/Pagination.d.ts +6 -1
- package/ui/list/TreeTable/TreeTable.d.ts +1 -0
- package/ui/list/TreeTable/TreeTable.js +2 -1
package/docs-autogen-result.json
CHANGED
|
@@ -4671,6 +4671,14 @@
|
|
|
4671
4671
|
"type": "number",
|
|
4672
4672
|
"example": null
|
|
4673
4673
|
},
|
|
4674
|
+
{
|
|
4675
|
+
"name": "isSinglePageItems",
|
|
4676
|
+
"decorators": [],
|
|
4677
|
+
"description": "Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц",
|
|
4678
|
+
"required": false,
|
|
4679
|
+
"type": "boolean",
|
|
4680
|
+
"example": "true"
|
|
4681
|
+
},
|
|
4674
4682
|
{
|
|
4675
4683
|
"name": "items",
|
|
4676
4684
|
"decorators": [],
|
|
@@ -36467,10 +36475,10 @@
|
|
|
36467
36475
|
{
|
|
36468
36476
|
"name": "list",
|
|
36469
36477
|
"decorators": [],
|
|
36470
|
-
"description": "Список, для которого используется
|
|
36478
|
+
"description": "Список, для которого используется пагинация, пример {items: [...], total: number},",
|
|
36471
36479
|
"required": false,
|
|
36472
36480
|
"type": "any",
|
|
36473
|
-
"example":
|
|
36481
|
+
"example": "{{\n total: 100,\n page: 2,\n pageSize: 10,\n }}",
|
|
36474
36482
|
"defaultValue": null
|
|
36475
36483
|
},
|
|
36476
36484
|
{
|
|
@@ -36635,10 +36643,10 @@
|
|
|
36635
36643
|
{
|
|
36636
36644
|
"name": "list",
|
|
36637
36645
|
"decorators": [],
|
|
36638
|
-
"description": "Список, для которого используется
|
|
36646
|
+
"description": "Список, для которого используется пагинация, пример {items: [...], total: number},",
|
|
36639
36647
|
"required": false,
|
|
36640
36648
|
"type": "any",
|
|
36641
|
-
"example":
|
|
36649
|
+
"example": "{{\n total: 100,\n page: 2,\n pageSize: 10,\n }}"
|
|
36642
36650
|
},
|
|
36643
36651
|
{
|
|
36644
36652
|
"name": "loadMore",
|
|
@@ -37999,6 +38007,15 @@
|
|
|
37999
38007
|
"example": null,
|
|
38000
38008
|
"defaultValue": null
|
|
38001
38009
|
},
|
|
38010
|
+
{
|
|
38011
|
+
"name": "isSinglePageItems",
|
|
38012
|
+
"decorators": [],
|
|
38013
|
+
"description": "",
|
|
38014
|
+
"required": false,
|
|
38015
|
+
"type": "boolean",
|
|
38016
|
+
"example": null,
|
|
38017
|
+
"defaultValue": null
|
|
38018
|
+
},
|
|
38002
38019
|
{
|
|
38003
38020
|
"name": "items",
|
|
38004
38021
|
"decorators": [],
|
|
@@ -40130,6 +40147,14 @@
|
|
|
40130
40147
|
"type": "string",
|
|
40131
40148
|
"example": "'exampleTree'"
|
|
40132
40149
|
},
|
|
40150
|
+
{
|
|
40151
|
+
"name": "isSinglePageItems",
|
|
40152
|
+
"decorators": [],
|
|
40153
|
+
"description": "Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц",
|
|
40154
|
+
"required": false,
|
|
40155
|
+
"type": "boolean",
|
|
40156
|
+
"example": "true"
|
|
40157
|
+
},
|
|
40133
40158
|
{
|
|
40134
40159
|
"name": "item",
|
|
40135
40160
|
"decorators": [],
|
|
@@ -40379,6 +40404,15 @@
|
|
|
40379
40404
|
"example": "'exampleTree'",
|
|
40380
40405
|
"defaultValue": null
|
|
40381
40406
|
},
|
|
40407
|
+
{
|
|
40408
|
+
"name": "isSinglePageItems",
|
|
40409
|
+
"decorators": [],
|
|
40410
|
+
"description": "Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц",
|
|
40411
|
+
"required": false,
|
|
40412
|
+
"type": "boolean",
|
|
40413
|
+
"example": "true",
|
|
40414
|
+
"defaultValue": null
|
|
40415
|
+
},
|
|
40382
40416
|
{
|
|
40383
40417
|
"name": "items",
|
|
40384
40418
|
"decorators": [],
|
|
@@ -40599,6 +40633,14 @@
|
|
|
40599
40633
|
"type": "string",
|
|
40600
40634
|
"example": "'exampleTree'"
|
|
40601
40635
|
},
|
|
40636
|
+
{
|
|
40637
|
+
"name": "isSinglePageItems",
|
|
40638
|
+
"decorators": [],
|
|
40639
|
+
"description": "Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц",
|
|
40640
|
+
"required": false,
|
|
40641
|
+
"type": "boolean",
|
|
40642
|
+
"example": "true"
|
|
40643
|
+
},
|
|
40602
40644
|
{
|
|
40603
40645
|
"name": "items",
|
|
40604
40646
|
"decorators": [],
|
package/en.json
CHANGED
|
@@ -989,6 +989,7 @@
|
|
|
989
989
|
"Идентификатор (ключ) для сохранения в LocalStorage коллекции.": "",
|
|
990
990
|
"Скрывать открытые вложенные узлы, если скрыли родительский узел": "",
|
|
991
991
|
"Текущая страница, используется для корректного отображения пагинации": "",
|
|
992
|
+
"Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц": "",
|
|
992
993
|
"Количество элементов на странице, используется для корректного отображения пагинации": "",
|
|
993
994
|
"Параметры роутинга": "",
|
|
994
995
|
"Сохранение в localStorage уровней вложенности.": "",
|
|
@@ -1023,6 +1024,7 @@
|
|
|
1023
1024
|
"Подключить бесконечный скролл": "",
|
|
1024
1025
|
"Аттрибут (название) в форме для поля с флагом, определяющим есть ли следующая страница": "",
|
|
1025
1026
|
"Аттрибут (название) в форме для поля с номером текущей страницы": "",
|
|
1027
|
+
"Список, для которого используется пагинация, пример {items: [...], total: number},": "",
|
|
1026
1028
|
"CSS-класс для элемента навигации.": "",
|
|
1027
1029
|
"Тип данных для параметров маршрута.": "",
|
|
1028
1030
|
"Обертка над Redux Store со встроенными middleware (thunk, multi, promise..) и react-router.": ""
|
package/hooks/useTree.d.ts
CHANGED
|
@@ -116,5 +116,10 @@ export interface ITreeConfig {
|
|
|
116
116
|
* @example 'exampleTree'
|
|
117
117
|
*/
|
|
118
118
|
clientStorageId?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Если флаг true, то данные в items переданы только для одной страницы, если false, то данные в items переданы сразу для всех страниц
|
|
121
|
+
* @example true
|
|
122
|
+
*/
|
|
123
|
+
isSinglePageItems?: boolean;
|
|
119
124
|
}
|
|
120
125
|
export default function useTree(config: ITreeConfig): ITreeOutput;
|
package/hooks/useTree.js
CHANGED
|
@@ -32,6 +32,7 @@ var DOT_SEPARATOR = '.';
|
|
|
32
32
|
var EMPTY_PARENT_ID = '';
|
|
33
33
|
var FIRST_LEVEL_PARENT_ID = '0';
|
|
34
34
|
var CLIENT_STORAGE_KEY = '_tree';
|
|
35
|
+
var DEFAULT_START_INDEX = 0;
|
|
35
36
|
var defaultProps = {
|
|
36
37
|
itemsKey: 'items',
|
|
37
38
|
autoOpenLevels: 0
|
|
@@ -200,7 +201,7 @@ function useTree(config) {
|
|
|
200
201
|
return [];
|
|
201
202
|
}
|
|
202
203
|
if (config.currentPage && config.itemsOnPage && currentLevel === INITIAL_CURRENT_LEVEL) {
|
|
203
|
-
var startIndex = (config.currentPage - 1) * config.itemsOnPage;
|
|
204
|
+
var startIndex = config.isSinglePageItems ? DEFAULT_START_INDEX : (config.currentPage - 1) * config.itemsOnPage;
|
|
204
205
|
sourceItems = sourceItems.slice(startIndex, startIndex + config.itemsOnPage);
|
|
205
206
|
}
|
|
206
207
|
return (sourceItems || []).reduce(function (treeItems, item, index) {
|
|
@@ -220,7 +221,7 @@ function useTree(config) {
|
|
|
220
221
|
};
|
|
221
222
|
return getItems(items);
|
|
222
223
|
// eslint-disable-next-line max-len
|
|
223
|
-
}, [activeRouteIds, config.alwaysOpened, config.currentPage, config.itemsOnPage, config.level, expandedItems, items, onExpand, primaryKey, routerParams, selectedUniqueId]);
|
|
224
|
+
}, [activeRouteIds, config.alwaysOpened, config.currentPage, config.itemsOnPage, config.level, expandedItems, items, onExpand, primaryKey, routerParams, selectedUniqueId, config.isSinglePageItems]);
|
|
224
225
|
return {
|
|
225
226
|
treeItems: resultTreeItems,
|
|
226
227
|
onItemFocus: onItemFocus
|
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@ function FieldList(props) {
|
|
|
135
135
|
onAdd: onAdd
|
|
136
136
|
}); }, [items, onAdd, props.className, props.disabled, props.required, props.showAdd, props.showRemove, props.size, props.tableClassName]);
|
|
137
137
|
var viewProps = (0, react_1.useMemo)(function () { return (__assign(__assign(__assign({}, commonProps), props.viewProps), { forwardedRef: nodeRef, hasAlternatingColors: props.hasAlternatingColors, style: props.style, children: props.children })); }, [commonProps, props.children, props.hasAlternatingColors, props.style, props.viewProps]);
|
|
138
|
-
var itemViewProps = (0, react_1.useMemo)(function () { return (__assign(__assign(__assign({}, commonProps), props.itemViewProps), {
|
|
138
|
+
var itemViewProps = (0, react_1.useMemo)(function () { return (__assign(__assign(__assign(__assign({}, commonProps), { onRemove: onRemove }), props.itemViewProps), { removeIcon: props.removeIcon })); }, [commonProps, onRemove, props.itemViewProps, props.removeIcon]);
|
|
139
139
|
var FieldListView = props.view || components.ui.getView('form.FieldListView');
|
|
140
140
|
var FieldListItemView = props.itemView || components.ui.getView('form.FieldListItemView');
|
|
141
141
|
return (react_1["default"].createElement(Form_1.FormContext.Provider, { value: contextValue },
|
|
@@ -63,7 +63,12 @@ export interface IPaginationProps {
|
|
|
63
63
|
*/
|
|
64
64
|
dark?: boolean;
|
|
65
65
|
/**
|
|
66
|
-
* Список, для которого используется
|
|
66
|
+
* Список, для которого используется пагинация, пример {items: [...], total: number},
|
|
67
|
+
* @example {{
|
|
68
|
+
* total: 100,
|
|
69
|
+
* page: 2,
|
|
70
|
+
* pageSize: 10,
|
|
71
|
+
* }}
|
|
67
72
|
*/
|
|
68
73
|
list?: any;
|
|
69
74
|
/**
|
|
@@ -27,6 +27,7 @@ export interface ITreeTableProps extends Omit<IGridProps, 'items'>, Pick<ITreePr
|
|
|
27
27
|
* ]
|
|
28
28
|
*/
|
|
29
29
|
items?: ITreeItem[];
|
|
30
|
+
isSinglePageItems?: boolean;
|
|
30
31
|
customIcon?: string | React.ReactElement;
|
|
31
32
|
}
|
|
32
33
|
export declare const addTreeColumnFieldsToFirstColumn: (columns: IGridColumn[], levelPadding: string | number, customIcon?: string | React.ReactElement) => IGridColumn[];
|
|
@@ -76,7 +76,8 @@ function TreeTable(props) {
|
|
|
76
76
|
itemsOnPage: list === null || list === void 0 ? void 0 : list.pageSize,
|
|
77
77
|
collapseChildItems: props.collapseChildItems,
|
|
78
78
|
saveInClientStorage: props.saveInClientStorage,
|
|
79
|
-
clientStorageId: props.listId
|
|
79
|
+
clientStorageId: props.listId,
|
|
80
|
+
isSinglePageItems: props.isSinglePageItems
|
|
80
81
|
}).treeItems;
|
|
81
82
|
return (React.createElement(Grid_1["default"], __assign({}, props, { columns: columns, items: treeItems, itemsIndexing: false })));
|
|
82
83
|
}
|