@@ -2,6 +2,7 @@ import React, { useState, useRef, useMemo } from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import classNames from 'classnames'
4
4
import CPagination from './CPagination'
5
+ import CElementCover from './CElementCover'
5
6
import style from './CDataTable.module.css'
6
7
import { CIcon } from '@coreui/icons-react'
7
8
import { cilArrowTop , cilBan } from '@coreui/icons'
@@ -21,7 +22,9 @@ const CDataTable = props => {
21
22
captionSlot,
22
23
underTableSlot,
23
24
theadTopSlot,
25
+ loadingSlot,
24
26
scopedSlots,
27
+ loading,
25
28
fields,
26
29
pagination,
27
30
activePage,
@@ -522,6 +525,15 @@ const CDataTable = props => {
522
525
{ footer && currentItems . length > 0 && < tfoot > { headerContent } </ tfoot > }
523
526
{ captionSlot }
524
527
</ table >
528
+ { loading &&
529
+ ( loadingSlot ||
530
+ < CElementCover
531
+ boundaries = { [
532
+ { sides : [ 'top' ] , query : 'td' } ,
533
+ { sides : [ 'bottom' ] , query : 'tbody' }
534
+ ] }
535
+ /> )
536
+ }
525
537
</ div >
526
538
527
539
{ underTableSlot }
@@ -552,6 +564,8 @@ CDataTable.propTypes = {
552
564
underTableSlot : PropTypes . node ,
553
565
scopedSlots : PropTypes . object ,
554
566
theadTopSlot : PropTypes . node ,
567
+ loadingSlot : PropTypes . node ,
568
+ loading : PropTypes . bool ,
555
569
fields : PropTypes . array ,
556
570
pagination : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) ,
557
571
activePage : PropTypes . number ,
0 commit comments