201 | {this.forms.create && (
202 |
{
209 | this.setState({
210 | createModalVisible: visible,
211 | });
212 | }}
213 | />
214 | )}
215 |
216 | {caption && {caption}}
217 |
218 | {showQueryBuilder && (
219 |
225 | )}
226 |
227 |
228 |
234 | {
241 | this.setState({
242 | deleteItem: item,
243 | deleteModalVisible: true,
244 | });
245 | }}
246 | onUpdateClick={(item) => {
247 | this.setState({
248 | updateItem: item,
249 | updateModalVisible: true,
250 | });
251 | }}
252 | />
253 |
254 |
255 | {!!pagination && totalOfItems > 0 && (
256 |
261 | )}
262 |
263 | {this.forms.update && (
264 | {
270 | this.setState({
271 | updateModalVisible: visible,
272 | });
273 | }}
274 | />
275 | )}
276 |
277 | {this.forms.delete && (
278 | {
285 | this.setState({
286 | deleteModalVisible: visible,
287 | });
288 | }}
289 | />
290 | )}
291 |
292 | );
293 | }
294 | }
295 |
296 | // $FlowFixMe
297 | CRUDTable.defaultProps = {
298 | onChange: NO_OP,
299 | actionsLabel: 'Actions',
300 | showQueryBuilder: false,
301 | items: [],
302 | caption: null,
303 | fetchItems: null,
304 | };
305 |
306 | export const Fields = (): React$Element