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
← All changes | renderer/Cell/CellRenderContext.php +42 -1 1.1.01.1.5 View file →
@@ -86,8 +86,16 @@
86 86
87 87 /** @var array<string, mixed>|null */
88 88 public $ribbon;
89 89
90 + /**
91 + * Every attribute of the cell block, untouched, for renderers that read
92 + * attributes free does not know about (pro registers its own).
93 + *
94 + * @var array<string, mixed>
95 + */
96 + public $cellAttrs = [];
97 +
90 98 /** @var string|null */
91 99 public $sortableType;
92 100
93 101 /** @var string|null */
@@ -102,8 +110,25 @@
102 110 /** @var bool */
103 111 public $stickyFirstCol;
104 112
105 113 /**
114 + * Whether the cell is a pro "empty cell": renders as a bare, unstyled
115 + * cell on the frontend — no content, no background, no border.
116 + *
117 + * @var bool
118 + */
119 + public $isEmpty;
120 +
121 + /** @var string */
122 + public $innerBorderType;
123 +
124 + /** @var int */
125 + public $totalRows;
126 +
127 + /** @var int */
128 + public $totalCols;
129 +
130 + /**
106 131 * @param mixed $row
107 132 * @param mixed $col
108 133 * @param mixed $rowSpan
109 134 * @param mixed $colSpan
@@ -116,8 +141,12 @@
116 141 * @param string|null $width
117 142 * @param string|null $height
118 143 * @param bool $stickyHeader
119 144 * @param string|null $className
145 + * @param bool $isEmpty
146 + * @param string $innerBorderType
147 + * @param int $totalRows
148 + * @param int $totalCols
120 149 * @return self
121 150 */
122 151 public static function create(
123 152 $row,
@@ -133,9 +162,14 @@
133 162 $width = null,
134 163 $height = null,
135 164 $stickyHeader = false,
136 165 $stickyFirstCol = false,
137 - $className = null
166 + $className = null,
167 + $cellAttrs = [],
168 + $isEmpty = false,
169 + $innerBorderType = '',
170 + $totalRows = 0,
171 + $totalCols = 0
138 172 ) {
139 173 $instance = new self();
140 174
141 175 $instance->hasCellCoords = is_numeric($row) && is_numeric($col);
@@ -198,8 +232,9 @@
198 232 $instance->backgroundColor = getStringOrNull($globalCellStyles['backgroundColor']) ?? '';
199 233
200 234 $instance->elements = is_array($elements) ? $elements : [];
201 235 $instance->cellStyleOverride = getArrayOrNull($cellStyleOverride);
236 + $instance->cellAttrs = is_array($cellAttrs) ? $cellAttrs : [];
202 237
203 238 $instance->ribbon = getArrayOrNull($ribbon);
204 239
205 240 $sortableType = getStringOrNull($sortableType);
@@ -212,8 +247,14 @@
212 247 $instance->width = getStringOrNull($width);
213 248 $instance->height = getStringOrNull($height);
214 249 $instance->stickyHeader = (bool) $stickyHeader;
215 250 $instance->stickyFirstCol = (bool) $stickyFirstCol;
251 + $instance->isEmpty = (bool) $isEmpty;
252 + $instance->innerBorderType = in_array($innerBorderType, ['row', 'col'], true)
253 + ? $innerBorderType
254 + : '';
255 + $instance->totalRows = max(0, (int) $totalRows);
256 + $instance->totalCols = max(0, (int) $totalCols);
216 257 $instance->className = trim((string) (getStringOrNull($className) ?? ''));
217 258
218 259 return $instance;
219 260 }