@tsed/react-formio 2.2.0 → 2.2.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/react-formio",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Provide a react formio wrapper. Written in TypeScript.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -31,8 +31,8 @@
31
31
  "tooltip.js": ">=1.3.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@tsed/tailwind": "2.2.0",
35
- "@tsed/tailwind-formio": "2.2.0"
34
+ "@tsed/tailwind": "2.2.2",
35
+ "@tsed/tailwind-formio": "2.2.2"
36
36
  },
37
37
  "repository": "https://github.com/TypedProject/tsed-formio",
38
38
  "bugs": {
@@ -122,16 +122,11 @@ export function Pagination(props: PaginationProps) {
122
122
  <strong>
123
123
  {pageIndex + 1} of {pageOptions.length}
124
124
  </strong>
125
- {totalLength !== undefined && (
126
- <span className='ml-3'>
127
- {i18n("Totals")}: <strong>{new Intl.NumberFormat(undefined).format(totalLength)}</strong> {i18n("items")}
128
- </span>
129
- )}
130
125
  </li>
131
126
  )}
132
127
  {totalLength !== undefined && (
133
128
  <li className={"mb-3 flex items-center"} data-testid='pagination-total-items'>
134
- {i18n("Totals")}: <strong>{new Intl.NumberFormat(undefined).format(totalLength)}</strong> {i18n("items")}
129
+ {i18n("Total")}: <strong>{new Intl.NumberFormat(undefined).format(totalLength)}</strong> {i18n("items")}
135
130
  </li>
136
131
  )}
137
132
  </nav>
@@ -25,6 +25,10 @@ export interface TableProps<Data extends object = any> extends TableOptions<Data
25
25
  * Pagination steps list
26
26
  */
27
27
  pageSizes?: number[];
28
+ /**
29
+ * Total length of the data
30
+ */
31
+ totalLength?: number;
28
32
  /**
29
33
  *
30
34
  */
@@ -126,6 +130,7 @@ export function useCustomTable<Data extends object = {}>(props: PropsWithChildre
126
130
  filterId: controlledFilterId,
127
131
  pageSize: controlledPageSize,
128
132
  pageIndex: controlledPageIndex,
133
+ totalLength,
129
134
  sortBy: controlledSortBy,
130
135
  isLoading,
131
136
  disableFilters,
@@ -225,6 +230,7 @@ export function useCustomTable<Data extends object = {}>(props: PropsWithChildre
225
230
  pageIndex,
226
231
  pageSize,
227
232
  pageSizes,
233
+ totalLength,
228
234
  setPageSize,
229
235
  i18n,
230
236
  children,
@@ -20,6 +20,7 @@ export function Table<Data extends object = any>(props: PropsWithChildren<TableP
20
20
  pageSize,
21
21
  pageSizes,
22
22
  setPageSize,
23
+ totalLength,
23
24
  i18n,
24
25
  enableDragNDrop,
25
26
  children,
@@ -81,6 +82,7 @@ export function Table<Data extends object = any>(props: PropsWithChildren<TableP
81
82
  <div className={"overflow-hidden"}>
82
83
  <Pagination
83
84
  {...tableInstance}
85
+ totalLength={totalLength}
84
86
  className={"text-sm"}
85
87
  pageIndex={pageIndex}
86
88
  pageSize={pageSize}