Skip to content

Commit 7f2beaa

Browse files
authored
Merge pull request rappasoft#2175 from HussamAlhennawi/configuration-for-column-select-styling
Enable setting styles for column select as a configuration.
2 parents 6598b25 + edbaf69 commit 7f2beaa

File tree

6 files changed

+353
-194
lines changed

6 files changed

+353
-194
lines changed

docs/columns/column-selection.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,68 @@ class DataTableColumnsSelectedListener
222222
}
223223

224224
}
225-
```
225+
```
226+
227+
## Styling
228+
229+
### setColumnSelectButtonAttributes
230+
Allows for customisation of the appearance of the "Column Select" button
231+
232+
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.
233+
234+
#### default-colors
235+
Setting to false will disable the default colors for the Column Select button, the default colors are:
236+
237+
Bootstrap: None
238+
239+
Tailwind: `text-gray-700 bg-white border-gray-300 hover:bg-gray-50 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600`
240+
241+
#### default-styling
242+
Setting to false will disable the default styling for the Column Select button, the default styling is:
243+
244+
Bootstrap: `btn dropdown-toggle d-block w-100 d-md-inline`
245+
246+
Tailwind: `inline-flex justify-center px-4 py-2 w-full text-sm font-medium rounded-md border shadow-sm focus:ring focus:ring-opacity-50`
247+
248+
```php
249+
public function configure(): void
250+
{
251+
$this->setColumnSelectButtonAttributes([
252+
'class' => 'focus:border-rose-300 focus:ring-1 focus:ring-rose-300 focus-visible:outline-rose-300', // Add these classes to the column select button
253+
'default-colors' => false, // Do not output the default colors
254+
'default-styling' => true // Output the default styling
255+
]);
256+
}
257+
```
258+
259+
### setColumnSelectMenuOptionCheckboxAttributes
260+
Allows for customisation of the appearance of the "Column Select" menu option checkbox
261+
262+
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.
263+
264+
#### default-colors
265+
Setting to false will disable the default colors for the Column Select menu option checkbox, the default colors are:
266+
267+
Bootstrap: None
268+
269+
Tailwind: `text-indigo-600 border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600`
270+
#### default-styling
271+
272+
Setting to false will disable the default styling for the Column Select menu option checkbox, the default styling is:
273+
274+
Bootstrap 4: None
275+
276+
Bootstrap 5: `form-check-input`
277+
278+
Tailwind: `transition duration-150 ease-in-out rounded shadow-sm focus:ring focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-wait`
279+
280+
```php
281+
public function configure(): void
282+
{
283+
$this->setColumnSelectMenuOptionCheckboxAttributes([
284+
'class' => 'text-rose-300 focus:border-rose-300 focus:ring-rose-300', // Add these classes to the column select menu option checkbox
285+
'default-colors' => false, // Do not output the default colors
286+
'default-styling' => true // Output the default styling
287+
]);
288+
}
289+
```

0 commit comments

Comments
 (0)