anchor_view_components 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/app/components/anchor/dialog_component.rb +5 -2
- data/app/components/anchor/toast_component.html.erb +1 -0
- data/app/components/anchor/toast_component.rb +3 -2
- data/lib/anchor/view_components/version.rb +1 -1
- data/previews/anchor/dialog_component_preview.rb +1 -3
- data/previews/anchor/panel_component_preview.rb +1 -3
- data/previews/anchor/toast_component_preview.rb +1 -1
- metadata +4 -5
- data/previews/anchor/table_preview/default.html.erb +0 -35
- /data/previews/anchor/{dialog_preview → dialog_component_preview}/with_footer.html.erb +0 -0
- /data/previews/anchor/{banner_preview → panel_component_preview}/with_banner.html.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a181d9966610368ba74dc2781bf444cb041d1fa7ab38ad3a94094b837fea50
|
4
|
+
data.tar.gz: 144449de045c7eefd7c06bba12f5f33b3653205702835814282f858bc36adeee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3771740e12d52815af489ad7d0bc77cd854f0822e69b2834c8dcdd66718ef27fbe1a9703eb77c87765481e6442d6f85bdf27ecd2e9feab37ff6c75c1ff4f221d
|
7
|
+
data.tar.gz: 06a7f89f5219816dc2bf76b206957ced377a68f0e562066c62dceede09f5cb3b3408534f8e030601aca036c5f7d93e1c331bf89b4bdb1b7609ee0d6c11f1c843
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.3 - 2023-08-09
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
- Change `ToastComponent` to allow passing the `role` attribute.
|
8
|
+
|
9
|
+
## 0.5.2 - 2023-08-08
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Change `DialogComponent` to allow passing attributes to underlined trigger button.
|
14
|
+
|
3
15
|
## 0.5.1 - 2023-08-07
|
4
16
|
|
5
17
|
### Changed
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Anchor
|
2
2
|
class DialogComponent < Component
|
3
|
-
renders_one :show_button, -> do
|
4
|
-
ButtonComponent.new(
|
3
|
+
renders_one :show_button, ->(**kwargs) do
|
4
|
+
ButtonComponent.new(
|
5
|
+
data: { action: "dialog#showModal" },
|
6
|
+
**kwargs
|
7
|
+
)
|
5
8
|
end
|
6
9
|
renders_one :body
|
7
10
|
renders_one :footer
|
@@ -14,10 +14,11 @@ module Anchor
|
|
14
14
|
}.freeze
|
15
15
|
VARIANT_OPTIONS = VARIANT_MAPPINGS.keys
|
16
16
|
|
17
|
-
def initialize(variant: VARIANT_DEFAULT)
|
17
|
+
def initialize(variant: VARIANT_DEFAULT, role: nil)
|
18
18
|
@variant = VARIANT_MAPPINGS[
|
19
19
|
fetch_or_fallback(VARIANT_OPTIONS, variant, VARIANT_DEFAULT)
|
20
20
|
]
|
21
|
+
@role = role
|
21
22
|
@id = self.class.generate_id
|
22
23
|
|
23
24
|
super
|
@@ -25,7 +26,7 @@ module Anchor
|
|
25
26
|
|
26
27
|
private
|
27
28
|
|
28
|
-
attr_reader :variant, :id
|
29
|
+
attr_reader :variant, :role, :id
|
29
30
|
|
30
31
|
def render?
|
31
32
|
content.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anchor_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Buoy Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inline_svg
|
@@ -136,18 +136,17 @@ files:
|
|
136
136
|
- previews/anchor/action_menu_component_preview.rb
|
137
137
|
- previews/anchor/badge_component_preview.rb
|
138
138
|
- previews/anchor/banner_component_preview.rb
|
139
|
-
- previews/anchor/banner_preview/with_banner.html.erb
|
140
139
|
- previews/anchor/breadcrumbs_component_preview.rb
|
141
140
|
- previews/anchor/button_component_preview.rb
|
142
141
|
- previews/anchor/dialog_component_preview.rb
|
143
|
-
- previews/anchor/
|
142
|
+
- previews/anchor/dialog_component_preview/with_footer.html.erb
|
144
143
|
- previews/anchor/icon_component_preview.rb
|
145
144
|
- previews/anchor/loading_indicator_component_preview.rb
|
146
145
|
- previews/anchor/panel_component_preview.rb
|
146
|
+
- previews/anchor/panel_component_preview/with_banner.html.erb
|
147
147
|
- previews/anchor/side_nav_component_preview.rb
|
148
148
|
- previews/anchor/side_nav_component_preview/default.html.erb
|
149
149
|
- previews/anchor/tab_bar_component_preview.rb
|
150
|
-
- previews/anchor/table_preview/default.html.erb
|
151
150
|
- previews/anchor/text_component_preview.rb
|
152
151
|
- previews/anchor/toast_component_preview.rb
|
153
152
|
homepage: https://github.com/BuoySoftware/anchor_view_components
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<%= render Anchor::TableComponent.new(data:) do |table| %>
|
2
|
-
<% table.with_column(header: "Donor ID", data_key: :id) do %>
|
3
|
-
<%#= row[:id] %>
|
4
|
-
<%# foo %>
|
5
|
-
<% end %>
|
6
|
-
|
7
|
-
<%# table.with_column("Price", numeric: true) do |row| %>
|
8
|
-
<%#= row[:price] %>
|
9
|
-
<%# end %>
|
10
|
-
|
11
|
-
<% table.with_column(header: "Donor Name") do %>
|
12
|
-
:donor_name
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<% table.with_column(header: "Donor Phone Number") do %>
|
16
|
-
:donor_phone_number
|
17
|
-
<% end %>
|
18
|
-
|
19
|
-
<% table.with_column(header: "Actions") do %>
|
20
|
-
<%= render Anchor::ActionMenuComponent.new do |menu| %>
|
21
|
-
<% menu.with_show_button do |button| %>
|
22
|
-
<% button.with_ending_icon(icon: "nav-arrow-down") %>
|
23
|
-
Actions
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
<% menu.with_item do %>
|
27
|
-
<%= link_to("Edit", "#") %>
|
28
|
-
<% end %>
|
29
|
-
|
30
|
-
<% menu.with_item do %>
|
31
|
-
<%= link_to("Delete", "#") %>
|
32
|
-
<% end %>
|
33
|
-
<% end %>
|
34
|
-
<% end %>
|
35
|
-
<% end %>
|
File without changes
|
File without changes
|