Current section
48 Versions
Jump to
Current section
48 Versions
Compare versions
11
files changed
+52
additions
-8
deletions
| @@ -1,5 +1,12 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## 0.7.1 |
| 4 | + |
| 5 | + ### Changes |
| 6 | + |
| 7 | + - Added dialog attr `is_show_on_mount`. |
| 8 | + - Downgraded dependency @primer/css to 21.0.7 due to regressions. |
| 9 | + |
| 3 10 | ## 0.7.0 |
| 4 11 | |
| 5 12 | Updated dependencies: |
| @@ -1,7 +1,7 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/ArthurClemens/primer_live">>}]}. |
| 3 3 | {<<"name">>,<<"primer_live">>}. |
| 4 | - {<<"version">>,<<"0.7.0">>}. |
| 4 | + {<<"version">>,<<"0.7.1">>}. |
| 5 5 | {<<"description">>, |
| 6 6 | <<"An implementation of GitHub's Primer Design System for Phoenix LiveView.">>}. |
| 7 7 | {<<"app">>,<<"primer_live">>}. |
unknownlib/component.ex
File is too large to be displayed (100 KB limit).
| @@ -820,6 +820,36 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 820 820 | touch_layer_attrs: ["data-touch": ""] |
| 821 821 | } |
| 822 822 | |
| 823 | + With is_show_on_mount: |
| 824 | + iex> PrimerLive.Helpers.AttributeHelpers.prompt_attrs( |
| 825 | + ...> %{ |
| 826 | + ...> rest: %{ |
| 827 | + ...> id: "some-id" |
| 828 | + ...> }, |
| 829 | + ...> prompt_options: nil, |
| 830 | + ...> is_fast: false, |
| 831 | + ...> is_dark_backdrop: false, |
| 832 | + ...> is_medium_backdrop: false, |
| 833 | + ...> is_light_backdrop: false, |
| 834 | + ...> is_show_on_mount: true |
| 835 | + ...> }, |
| 836 | + ...> %{ |
| 837 | + ...> form: nil, |
| 838 | + ...> field: nil, |
| 839 | + ...> toggle_slot: nil, |
| 840 | + ...> toggle_class: "btn", |
| 841 | + ...> menu_class: "", |
| 842 | + ...> is_menu: false |
| 843 | + ...> }) |
| 844 | + %{ |
| 845 | + backdrop_attrs: [], |
| 846 | + checkbox_attrs: [{:"aria-hidden", "true"}, {:checked, true}, {:hidden_input, false}, {:id, "some-id-toggle"}, {:onchange, "window.Prompt && Prompt.change(this)"}], |
| 847 | + focus_wrap_id: "focus-wrap-some-id", |
| 848 | + menu_attrs: [class: "", "data-prompt": "", id: "some-id", "phx-hook": "Prompt"], |
| 849 | + toggle_attrs: [{:"aria-haspopup", "true"}, {:class, "btn"}, {:for, "some-id-toggle"}], |
| 850 | + touch_layer_attrs: ["data-touch": ""] |
| 851 | + } |
| 852 | + |
| 823 853 | phx_click_touch: |
| 824 854 | iex> PrimerLive.Helpers.AttributeHelpers.prompt_attrs( |
| 825 855 | ...> %{ |
| @@ -1002,7 +1032,8 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 1002 1032 | ")" |
| 1003 1033 | ] |
| 1004 1034 | |> Enum.join("") |
| 1005 | - ] |
| 1035 | + ], |
| 1036 | + if(assigns[:is_show_on_mount], do: [checked: true], else: nil) |
| 1006 1037 | ]) |
| 1007 1038 | |
| 1008 1039 | menu_id = id || "menu-" <> toggle_id |
| @@ -23,6 +23,12 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 23 23 | end |
| 24 24 | end |
| 25 25 | |
| 26 | + defmacro slot_phx do |
| 27 | + quote do |
| 28 | + attr(:"phx-click", :string) |
| 29 | + end |
| 30 | + end |
| 31 | + |
| 26 32 | defmacro input_id do |
| 27 33 | quote do |
| 28 34 | attr(:input_id, :string, |
Loading more files…