@tsed/react-formio 2.2.0 → 2.2.1
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/dist/components/table/hooks/useCustomTable.hook.d.ts +5 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +5 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
- package/src/components/table/hooks/useCustomTable.hook.tsx +6 -0
- package/src/components/table/table.component.tsx +2 -0
|
@@ -18,6 +18,10 @@ export interface TableProps<Data extends object = any> extends TableOptions<Data
|
|
|
18
18
|
* Pagination steps list
|
|
19
19
|
*/
|
|
20
20
|
pageSizes?: number[];
|
|
21
|
+
/**
|
|
22
|
+
* Total length of the data
|
|
23
|
+
*/
|
|
24
|
+
totalLength?: number;
|
|
21
25
|
/**
|
|
22
26
|
*
|
|
23
27
|
*/
|
|
@@ -98,6 +102,7 @@ export declare function useCustomTable<Data extends object = {}>(props: PropsWit
|
|
|
98
102
|
pageIndex: number;
|
|
99
103
|
pageSize: number;
|
|
100
104
|
pageSizes: number[];
|
|
105
|
+
totalLength: number | undefined;
|
|
101
106
|
setPageSize: (pageSize: number) => void;
|
|
102
107
|
i18n: (f: string) => string;
|
|
103
108
|
children: React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -788,7 +788,7 @@ function useOperations(_ref) {
|
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
790
|
|
|
791
|
-
var _excluded$9 = ["children", "className", "columns", "data", "onChange", "onClick", "onDrag", "onDrop", "operations", "pageSizes", "filters", "filterId", "pageSize", "pageIndex", "sortBy", "isLoading", "disableFilters", "disablePagination", "ArrowSort", "ColumnFilter", "EmptyData", "Loader", "Pagination", "Row", "CellHeader", "CellOperations", "i18n"];
|
|
791
|
+
var _excluded$9 = ["children", "className", "columns", "data", "onChange", "onClick", "onDrag", "onDrop", "operations", "pageSizes", "filters", "filterId", "pageSize", "pageIndex", "totalLength", "sortBy", "isLoading", "disableFilters", "disablePagination", "ArrowSort", "ColumnFilter", "EmptyData", "Loader", "Pagination", "Row", "CellHeader", "CellOperations", "i18n"];
|
|
792
792
|
function getOperationCallback(operations, onClick) {
|
|
793
793
|
return function (data, action) {
|
|
794
794
|
var operation = operations.find(function (operation) {
|
|
@@ -832,6 +832,7 @@ function useCustomTable(props) {
|
|
|
832
832
|
controlledFilterId = props.filterId,
|
|
833
833
|
controlledPageSize = props.pageSize,
|
|
834
834
|
controlledPageIndex = props.pageIndex,
|
|
835
|
+
totalLength = props.totalLength,
|
|
835
836
|
controlledSortBy = props.sortBy,
|
|
836
837
|
isLoading = props.isLoading,
|
|
837
838
|
disableFilters = props.disableFilters,
|
|
@@ -933,6 +934,7 @@ function useCustomTable(props) {
|
|
|
933
934
|
pageIndex: pageIndex,
|
|
934
935
|
pageSize: pageSize,
|
|
935
936
|
pageSizes: pageSizes,
|
|
937
|
+
totalLength: totalLength,
|
|
936
938
|
setPageSize: setPageSize,
|
|
937
939
|
i18n: i18n,
|
|
938
940
|
children: children,
|
|
@@ -960,6 +962,7 @@ function Table(props) {
|
|
|
960
962
|
pageSize = _useCustomTable.pageSize,
|
|
961
963
|
pageSizes = _useCustomTable.pageSizes,
|
|
962
964
|
setPageSize = _useCustomTable.setPageSize,
|
|
965
|
+
totalLength = _useCustomTable.totalLength,
|
|
963
966
|
i18n = _useCustomTable.i18n,
|
|
964
967
|
enableDragNDrop = _useCustomTable.enableDragNDrop,
|
|
965
968
|
children = _useCustomTable.children,
|
|
@@ -1001,6 +1004,7 @@ function Table(props) {
|
|
|
1001
1004
|
})) : null), isLoading ? /*#__PURE__*/React__default["default"].createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React__default["default"].createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1002
1005
|
className: "overflow-hidden"
|
|
1003
1006
|
}, /*#__PURE__*/React__default["default"].createElement(Pagination, _extends({}, tableInstance, {
|
|
1007
|
+
totalLength: totalLength,
|
|
1004
1008
|
className: "text-sm",
|
|
1005
1009
|
pageIndex: pageIndex,
|
|
1006
1010
|
pageSize: pageSize,
|