zavadil-react-common 1.2.127 → 1.2.129

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.
@@ -28,6 +28,8 @@ export type AdvancedTableProps = {
28
28
  paging: PagingRequest;
29
29
  totalItems: number;
30
30
  hover?: boolean;
31
+ showPagingOnBottom?: boolean;
32
+ showPageSizeSelection?: boolean;
31
33
  striped?: boolean;
32
34
  bordered?: boolean;
33
35
  onPagingChanged: (p: PagingRequest) => any
@@ -35,6 +37,8 @@ export type AdvancedTableProps = {
35
37
 
36
38
  export function AdvancedTable({
37
39
  hover,
40
+ showPagingOnBottom,
41
+ showPageSizeSelection,
38
42
  striped,
39
43
  bordered,
40
44
  header,
@@ -121,37 +125,43 @@ export function AdvancedTable({
121
125
  </tbody>
122
126
  {
123
127
  totalItems > 0 && <tfoot>
124
- <tr>
125
- <td colSpan={header.length}>
126
- <div className="d-flex justify-content-between align-items-center gap-2">
127
- <div><Localize text='Page'/>: {paging.page + 1} / {totalPages}</div>
128
- {
129
- totalPages > 0 && <TablePagination paging={paging} totalItems={totalItems} onPagingChanged={onPagingChanged}/>
130
- }
131
- <div><Localize text='Total items'/>: {totalItems}</div>
132
- </div>
133
- </td>
134
- </tr>
135
- <tr>
136
- <td colSpan={header.length}>
137
- <div className="d-flex align-items-center gap-2 justify-content-end">
138
- <div className="text-nowrap"><Localize text='Page size'/>:</div>
139
- <div>
140
- <NumberSelect
141
- value={paging.size}
142
- options={sizes}
143
- onChange={
144
- (e) => {
145
- paging.size = e || 10
146
- onPagingChanged({...paging});
128
+ {
129
+ showPagingOnBottom &&
130
+ <tr>
131
+ <td colSpan={header.length}>
132
+ <div className="d-flex justify-content-between align-items-center gap-2">
133
+ <div><Localize text='Page'/>: {paging.page + 1} / {totalPages}</div>
134
+ {
135
+ totalPages > 0 && <TablePagination paging={paging} totalItems={totalItems} onPagingChanged={onPagingChanged}/>
136
+ }
137
+ <div><Localize text='Total items'/>: {totalItems}</div>
138
+ </div>
139
+ </td>
140
+ </tr>
141
+ }
142
+ {
143
+ showPageSizeSelection &&
144
+ <tr>
145
+ <td colSpan={header.length}>
146
+ <div className="d-flex align-items-center gap-2 justify-content-end">
147
+ <div className="text-nowrap"><Localize text='Page size'/>:</div>
148
+ <div>
149
+ <NumberSelect
150
+ value={paging.size}
151
+ options={sizes}
152
+ onChange={
153
+ (e) => {
154
+ paging.size = e || 10
155
+ onPagingChanged({...paging});
156
+ }
147
157
  }
148
- }
149
- showEmptyOption={false}
150
- />
158
+ showEmptyOption={false}
159
+ />
160
+ </div>
151
161
  </div>
152
- </div>
153
- </td>
154
- </tr>
162
+ </td>
163
+ </tr>
164
+ }
155
165
  </tfoot>
156
166
  }
157
167
  </Table>