Skip to content

Releases: woylie/flop_phoenix

0.22.2

19 Oct 21:27
7da3392
Compare
Choose a tag to compare

[0.22.2] - 2023-10-19

Fixed

  • Numbered pagination links were not wrapped in li elements.

0.22.1

28 Sep 08:27
12e6c15
Compare
Choose a tag to compare

Changed

  • Allow to use t:Phoenix.HTML.safe/0 as a label attribute in table headers.

0.22.0

26 Sep 01:00
1e2e576
Compare
Choose a tag to compare

Added

  • Added directions attribute to the col 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 and th_wrapper_attrs attributes to the col slot
    of the table component.
  • Added thead_th_attrs attribute to the action slot of the table component.

Changed

  • Renamed attrs mattribute on the col and action slots of the table
    component to tbody_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

26 Sep 00:12
df23478
Compare
Choose a tag to compare

Changed

  • Support phoenix_liveview ~> 0.20.

0.21.1

05 Aug 05:28
5757fbd
Compare
Choose a tag to compare

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, the attrs option
    did not properly override the attributes set with the :tbody_td_attrs
    option.

0.21.0

17 Jul 06:41
fa1f525
Compare
Choose a tag to compare

Changed

  • Depend on flop ~> 0.22.0.

0.20.0

09 Jul 10:51
8b45ff9
Compare
Choose a tag to compare

Added

  • Added an on_paginate attribute to the pagination and cursor_pagination
    components. This attribute takes a Phoenix.LiveView.JS command as a value.
    The attribute can be combined with the path 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 the table 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 and hide 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 of on_pagination and on_sort.

0.19.1

30 Jun 10:18
8ba1eec
Compare
Choose a tag to compare

Changed

  • The table component only renders an ascending/descending order indicator in the column header for the first order field, instead rendering one in the column headers for all ordered fields.
  • Support Flop 0.22.

0.19.0

29 May 23:16
68bff16
Compare
Choose a tag to compare

Changed

  • Necessary updates for phoenix_live_view ~> 0.19.0.
  • Requires phoenix_live_view ~> 0.19.0.
  • Remove previously deprecated Flop.Phoenix.pop_filter/2. Use
    Flop.Filter.pop/3 instead.

0.18.2

07 May 21:51
74d21b0
Compare
Choose a tag to compare

Changed

  • Added hidden attribute to hidden inputs rendered by filter_fields
    component in order to solve CSS spacing issues.