Releases: woylie/flop_phoenix
Releases · woylie/flop_phoenix
0.22.2
0.22.1
0.22.0
Added
- Added
directions
attribute to thecol
slot of the table component. This
allows you to override the default sort directions, e.g. to specify
nulls-first or nulls-last. - Added
thead_th_attrs
andth_wrapper_attrs
attributes to thecol
slot
of the table component. - Added
thead_th_attrs
attribute to theaction
slot of the table component.
Changed
- Renamed
attrs
mattribute on thecol
andaction
slots of the table
component totbody_td_attrs
in order to match the naming of the global
table options.
Upgrade guide
Rename the attrs
attribute to tbody_td_attrs
in both the col
slot and the
action
slot:
<Flop.Phoenix.table items={@pets} meta={@meta} path={~p"/pets"}>
- <:col :let={p} attrs={[class="my-class"]}><%= p.id %></:col>
- <:action :let={p} attrs={[class="my-class"]}>button</:col>
+ <:col :let={p} tbody_td_attrs={[class="my-class"]}><%= p.id %></:col>
+ <:action :let={p} tbody_td_attrs={[class="my-class"]}>button</:col>
</Flop.Phoenix.table>
0.21.2
0.21.1
Added
- Allow passing a function to the
attrs
option of table component's:action
slot. Before, this was only supported in the:col
slot.
Changed
- Improve some error messages and documentation examples.
Fixed
- In the
:col
and:action
slots of the table component, theattrs
option
did not properly override the attributes set with the:tbody_td_attrs
option.
0.21.0
0.20.0
Added
- Added an
on_paginate
attribute to thepagination
andcursor_pagination
components. This attribute takes aPhoenix.LiveView.JS
command as a value.
The attribute can be combined with thepath
attribute, in which case the URL
will be patched and the the given JS command is executed. - Similarly, an
on_sort
attribute was added to thetable
component. - Allow setting
tbody_tr_attrs
to a function that takes the current row item
as an argument and returns a list of attributes. - Allow setting the
attrs
attribute of the:col
slot of the table component
to a function that takes the current row item as an argument and returns a
list of attributes.
Changed
- The table ID falls back to
"sortable-table"
if no schema module is used. - The tbody ID was changed to
{id}-tbody
. - The table container ID is set to
{id}-container
now. - The table ID is set to
{id}
now.
Deprecated
- The
show
andhide
attributes of the:col
slot of the table component are
now deprecated in favor of the:if
attribute. - The
event
attribute of the pagination, cursor pagination and table
components has been deprecated in favor ofon_pagination
andon_sort
.