@tsed/react-formio 2.1.4 → 2.2.0
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/pagination/pagination.component.d.ts +2 -1
- package/dist/components/table/hooks/useCustomTable.hook.d.ts +2 -2
- package/dist/components/table/index.d.ts +3 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +9 -3
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
- package/src/components/pagination/pagination.component.spec.tsx +8 -0
- package/src/components/pagination/pagination.component.tsx +14 -2
- package/src/components/table/hooks/useCustomTable.hook.tsx +1 -12
- package/src/components/table/index.ts +3 -0
|
@@ -9,9 +9,10 @@ export interface PaginationProps {
|
|
|
9
9
|
canNextPage: boolean;
|
|
10
10
|
pageCount: number;
|
|
11
11
|
pageIndex: number;
|
|
12
|
-
pageOptions?:
|
|
12
|
+
pageOptions?: number[];
|
|
13
13
|
pageSize: number;
|
|
14
14
|
setPageSize: any;
|
|
15
|
+
totalLength?: number;
|
|
15
16
|
i18n?: (f: string) => string;
|
|
16
17
|
}
|
|
17
18
|
export declare function Pagination(props: PaginationProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { CellProps, FilterProps, Renderer,
|
|
2
|
+
import { CellProps, FilterProps, Renderer, TableOptions } from "react-table";
|
|
3
3
|
import { OnClickOperation, Operation, QueryOptions } from "../../../interfaces";
|
|
4
4
|
import { Pagination as DefaultPagination } from "../../pagination/pagination.component";
|
|
5
5
|
import { DefaultCellHeaderProps } from "../components/defaultCellHeader.component";
|
|
@@ -86,7 +86,7 @@ declare function DefaultLoader(): React.JSX.Element;
|
|
|
86
86
|
declare function DefaultEmptyData(): React.JSX.Element;
|
|
87
87
|
export declare function useCustomTable<Data extends object = {}>(props: PropsWithChildren<TableProps<Data>>): {
|
|
88
88
|
className: string;
|
|
89
|
-
tableInstance: TableInstance<Data>;
|
|
89
|
+
tableInstance: import("react-table").TableInstance<Data>;
|
|
90
90
|
CellHeader: any;
|
|
91
91
|
isLoading: boolean | undefined;
|
|
92
92
|
Loader: React.ComponentType<{}> | typeof DefaultLoader;
|
|
@@ -10,3 +10,6 @@ export * from "./filters/sliderColumnFilter.component";
|
|
|
10
10
|
export * from "./hooks/useCustomTable.hook";
|
|
11
11
|
export * from "./hooks/useOperations.hook";
|
|
12
12
|
export * from "./table.component";
|
|
13
|
+
export * from "./utils/getPageNumbers";
|
|
14
|
+
export * from "./utils/mapFormToColumns";
|
|
15
|
+
export * from "./utils/swapElements";
|
package/dist/index.js
CHANGED
|
@@ -327,6 +327,7 @@ function Pagination(props) {
|
|
|
327
327
|
pageOptions = props.pageOptions,
|
|
328
328
|
pageSize = props.pageSize,
|
|
329
329
|
setPageSize = props.setPageSize,
|
|
330
|
+
totalLength = props.totalLength,
|
|
330
331
|
_props$i18n = props.i18n,
|
|
331
332
|
i18n = _props$i18n === void 0 ? function (f) {
|
|
332
333
|
return f;
|
|
@@ -395,8 +396,13 @@ function Pagination(props) {
|
|
|
395
396
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
396
397
|
className: "ml-3"
|
|
397
398
|
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React__default["default"].createElement("li", {
|
|
398
|
-
className: "mb-3 flex items-center"
|
|
399
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React__default["default"].createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)
|
|
399
|
+
className: "mb-3 mr-3 flex items-center"
|
|
400
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React__default["default"].createElement("strong", null, pageIndex + 1, " of ", pageOptions.length), totalLength !== undefined && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
401
|
+
className: "ml-3"
|
|
402
|
+
}, i18n("Totals"), ": ", /*#__PURE__*/React__default["default"].createElement("strong", null, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items"))), totalLength !== undefined && /*#__PURE__*/React__default["default"].createElement("li", {
|
|
403
|
+
className: "mb-3 flex items-center",
|
|
404
|
+
"data-testid": "pagination-total-items"
|
|
405
|
+
}, i18n("Totals"), ": ", /*#__PURE__*/React__default["default"].createElement("strong", null, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items")));
|
|
400
406
|
}
|
|
401
407
|
|
|
402
408
|
function DefaultArrowSort(_ref) {
|
|
@@ -7739,9 +7745,11 @@ exports.FormSettings = FormSettings;
|
|
|
7739
7745
|
exports.FormsTable = FormsTable;
|
|
7740
7746
|
exports.InputTags = InputTags;
|
|
7741
7747
|
exports.InputText = InputText;
|
|
7748
|
+
exports.LEFT_PAGE = LEFT_PAGE;
|
|
7742
7749
|
exports.Loader = Loader;
|
|
7743
7750
|
exports.Modal = Modal;
|
|
7744
7751
|
exports.Pagination = Pagination;
|
|
7752
|
+
exports.RIGHT_PAGE = RIGHT_PAGE;
|
|
7745
7753
|
exports.ReactComponent = ReactComponent;
|
|
7746
7754
|
exports.RemoveModal = RemoveModal;
|
|
7747
7755
|
exports.Select = Select;
|
|
@@ -7753,9 +7761,12 @@ exports.Tabs = Tabs;
|
|
|
7753
7761
|
exports.callLast = callLast;
|
|
7754
7762
|
exports.defaultDisplayChoices = defaultDisplayChoices;
|
|
7755
7763
|
exports.getOperationCallback = getOperationCallback;
|
|
7764
|
+
exports.getPageNumbers = getPageNumbers;
|
|
7756
7765
|
exports.iconClass = iconClass;
|
|
7766
|
+
exports.mapFormToColumns = mapFormToColumns;
|
|
7757
7767
|
exports.mapPagination = mapPagination;
|
|
7758
7768
|
exports.stopPropagationWrapper = stopPropagationWrapper;
|
|
7769
|
+
exports.swapElements = swapElements;
|
|
7759
7770
|
exports.useCustomTable = useCustomTable;
|
|
7760
7771
|
exports.useForm = useForm;
|
|
7761
7772
|
exports.useFormEdit = useFormEdit;
|