PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.0.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.0.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
table-builder-block / src / table-builder / save.js

save.js in TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables 2.0.0, at src/table-builder/save.js

39 lines 873 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {
2 useBlockProps,
3 useInnerBlocksProps,
4 RichText,
5 } from '@wordpress/block-editor';
6
7 export default function save( { attributes } ) {
8 const { caption, headers, footers, hasHeader, hasFooter, isEmpty } =
9 attributes;
10 const blockProps = useBlockProps.save();
11 const innerBlocksProps = useInnerBlocksProps.save( {
12 className: 'gkit-table__body',
13 } );
14
15 return (
16 ! isEmpty && (
17 <figure { ...blockProps }>
18 <table className="gkit-table">
19 <thead className="gkit-table__header">
20 <tr>{ Headers }</tr>
21 </thead>
22 <tbody { ...innerBlocksProps } />
23 <tfoot className="gkit-table__footer">
24 <tr>{ Footers }</tr>
25 </tfoot>
26 </table>
27 { caption && (
28 <RichText.Content
29 identifier="caption"
30 tagName="figcaption"
31 className="gkit-table__caption"
32 value={ caption }
33 />
34 ) }
35 </figure>
36 )
37 );
38 }
39