| @@ -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 */ |
| @@ -98,9 +106,29 @@ | ||
| 98 | 106 | |
| 99 | 107 | /** @var bool */ |
| 100 | 108 | public $stickyHeader; |
| 101 | 109 | |
| 110 | + /** @var bool */ | |
| 111 | + public $stickyFirstCol; | |
| 112 | + | |
| 102 | 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 | + /** | |
| 103 | 131 | * @param mixed $row |
| 104 | 132 | * @param mixed $col |
| 105 | 133 | * @param mixed $rowSpan |
| 106 | 134 | * @param mixed $colSpan |
| @@ -113,8 +141,12 @@ | ||
| 113 | 141 | * @param string|null $width |
| 114 | 142 | * @param string|null $height |
| 115 | 143 | * @param bool $stickyHeader |
| 116 | 144 | * @param string|null $className |
| 145 | + * @param bool $isEmpty | |
| 146 | + * @param string $innerBorderType | |
| 147 | + * @param int $totalRows | |
| 148 | + * @param int $totalCols | |
| 117 | 149 | * @return self |
| 118 | 150 | */ |
| 119 | 151 | public static function create( |
| 120 | 152 | $row, |
| @@ -129,9 +161,15 @@ | ||
| 129 | 161 | $sortableType = null, |
| 130 | 162 | $width = null, |
| 131 | 163 | $height = null, |
| 132 | 164 | $stickyHeader = false, |
| 133 | - $className = null | |
| 165 | + $stickyFirstCol = false, | |
| 166 | + $className = null, | |
| 167 | + $cellAttrs = [], | |
| 168 | + $isEmpty = false, | |
| 169 | + $innerBorderType = '', | |
| 170 | + $totalRows = 0, | |
| 171 | + $totalCols = 0 | |
| 134 | 172 | ) { |
| 135 | 173 | $instance = new self(); |
| 136 | 174 | |
| 137 | 175 | $instance->hasCellCoords = is_numeric($row) && is_numeric($col); |
| @@ -194,8 +232,9 @@ | ||
| 194 | 232 | $instance->backgroundColor = getStringOrNull($globalCellStyles['backgroundColor']) ?? ''; |
| 195 | 233 | |
| 196 | 234 | $instance->elements = is_array($elements) ? $elements : []; |
| 197 | 235 | $instance->cellStyleOverride = getArrayOrNull($cellStyleOverride); |
| 236 | + $instance->cellAttrs = is_array($cellAttrs) ? $cellAttrs : []; | |
| 198 | 237 | |
| 199 | 238 | $instance->ribbon = getArrayOrNull($ribbon); |
| 200 | 239 | |
| 201 | 240 | $sortableType = getStringOrNull($sortableType); |
| @@ -207,8 +246,15 @@ | ||
| 207 | 246 | |
| 208 | 247 | $instance->width = getStringOrNull($width); |
| 209 | 248 | $instance->height = getStringOrNull($height); |
| 210 | 249 | $instance->stickyHeader = (bool) $stickyHeader; |
| 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); | |
| 211 | 257 | $instance->className = trim((string) (getStringOrNull($className) ?? '')); |
| 212 | 258 | |
| 213 | 259 | return $instance; |
| 214 | 260 | } |