PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / src / components / AdvancedCustomClassControl.tsx

AdvancedCustomClassControl.tsx in Tableberg – Simple Gutenberg Table Block 1.1.5, at src/components/AdvancedCustomClassControl.tsx

31 lines 936 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { InspectorControls } from "@wordpress/block-editor";
2 import { TextControl } from "@wordpress/components";
3 import { __ } from "@wordpress/i18n";
4
5 export function AdvancedCustomClassControl({
6 label,
7 value,
8 onChange,
9 }: {
10 label?: string;
11 value?: string;
12 onChange: (value: string | undefined) => void;
13 }) {
14 return (
15 <InspectorControls group="advanced">
16 <TextControl
17 __next40pxDefaultSize
18 autoComplete="off"
19 label={label || __("Additional CSS class(es)", "tableberg")}
20 value={value || ""}
21 onChange={nextValue => {
22 const trimmedValue = nextValue.trim();
23
24 onChange(trimmedValue !== "" ? trimmedValue : undefined);
25 }}
26 help={__("Separate multiple classes with spaces.", "tableberg")}
27 />
28 </InspectorControls>
29 );
30 }
31