refine-rails 2.11.4 → 2.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/refine-stimulus.esm.js +1 -1
- data/app/assets/javascripts/refine-stimulus.esm.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.js +1 -1
- data/app/assets/javascripts/refine-stimulus.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.modern.js +1 -1
- data/app/assets/javascripts/refine-stimulus.modern.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.umd.js +1 -1
- data/app/assets/javascripts/refine-stimulus.umd.js.map +1 -1
- data/app/assets/stylesheets/index.css +41 -10
- data/app/assets/stylesheets/index.tailwind.css +41 -10
- data/app/controllers/refine/inline/criteria_controller.rb +16 -3
- data/app/javascript/controllers/index.js +3 -0
- data/app/javascript/controllers/refine/modal-controller.js +41 -0
- data/app/models/refine/filters/blueprint_editor.rb +8 -0
- data/app/views/refine/inline/criteria/index_advanced.html.erb +29 -0
- data/app/views/refine/inline/filters/_add_first_condition_button.html.erb +10 -5
- data/app/views/refine/inline/filters/_and_button.html.erb +8 -3
- data/app/views/refine/inline/filters/_criterion.html.erb +1 -1
- data/app/views/refine/inline/filters/_group.html.erb +3 -1
- data/app/views/refine/inline/filters/_modal.html.erb +28 -0
- data/app/views/refine/inline/filters/_modal_or_popup.html.erb +35 -0
- data/app/views/refine/inline/filters/_or_button.html.erb +9 -3
- data/app/views/refine/inline/filters/_or_separator.html.erb +16 -0
- data/app/views/refine/inline/filters/_show.html.erb +11 -13
- data/config/routes.rb +2 -0
- data/lib/refine/rails/version.rb +1 -1
- metadata +7 -2
@@ -12,7 +12,7 @@
|
|
12
12
|
<%= link_to edit_refine_inline_criterion_path(criterion.position, criterion.to_params), class:"refine--condition-pill-button", data: {controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit refine--popup#show"} do %>
|
13
13
|
<div class="refine--condition-pill-name"><%= criterion.condition_display %></div>
|
14
14
|
<div class="refine--condition-value-clause"><%= criterion.clause_display %></div>
|
15
|
-
<div class="refine--condition-value-self" title="<%= criterion.human_readable_value %>">
|
15
|
+
<div class="refine--condition-value-self" title="<%= criterion.human_readable_value %>" data-controller="tooltip" data-tooltip-content-value="<%= criterion.human_readable_value %>">
|
16
16
|
<%= criterion.human_readable_value %>
|
17
17
|
</div>
|
18
18
|
<% end %>
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<% render_stack ||= false %>
|
2
|
+
<% use_modal ||= false %>
|
3
|
+
<% fill_modal ||= false %>
|
2
4
|
|
3
5
|
<% if render_stack %>
|
4
6
|
<div class="refine--or-group">
|
@@ -6,7 +8,7 @@
|
|
6
8
|
<% group.each.with_index do |criterion, i| %>
|
7
9
|
<%= render "refine/inline/filters/criterion", criterion: criterion, placement: i, size: group.length %>
|
8
10
|
<% end %>
|
9
|
-
<%= render "refine/inline/filters/and_button", position: group.last.position + 1, show_label: (group_count < 2 && condition_count < 2) %>
|
11
|
+
<%= render "refine/inline/filters/and_button", position: group.last.position + 1, show_label: (group_count < 2 && condition_count < 2), use_modal: use_modal, fill_modal: fill_modal %>
|
10
12
|
<% if render_stack %>
|
11
13
|
</div>
|
12
14
|
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%#
|
2
|
+
Generic partial for placing a button that will load popup content in a modal via Shoelace.
|
3
|
+
Required params:
|
4
|
+
- frame_id (the DOM ID of the turbo frame)
|
5
|
+
|
6
|
+
Optional class:
|
7
|
+
- src (the URL to load popup content from)
|
8
|
+
- container_class (class attribute of the wrapper div. Defaults to "refine--inline-popup-container")
|
9
|
+
- frame_class (class attribute of the turbo frame. Defaults to "refine--inline-popup")
|
10
|
+
|
11
|
+
somewhere in your yield be sure to include a `data-action="click->refine--popup#show"` to trigger the the popup
|
12
|
+
|
13
|
+
Popup can be hidden with `data-action="click->refine--popup#hide"`
|
14
|
+
%>
|
15
|
+
|
16
|
+
<%
|
17
|
+
src ||= ""
|
18
|
+
container_class ||= "sl-dialog refine--inline-modal-container"
|
19
|
+
frame_class ||= "refine--inline-modal"
|
20
|
+
is_open ||= false
|
21
|
+
|
22
|
+
%>
|
23
|
+
|
24
|
+
<%= tag.div data: {controller: "refine--modal", refine__modal_src_value: src, refine__modal_is_open_value: is_open } do %>
|
25
|
+
<%= yield %>
|
26
|
+
|
27
|
+
<%= turbo_frame_tag frame_id, class: frame_class, data: {refine__modal_target: "frame"} %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%
|
2
|
+
src ||= ""
|
3
|
+
container_class = container_class
|
4
|
+
frame_class = frame_class
|
5
|
+
is_open ||= false
|
6
|
+
use_modal ||= false
|
7
|
+
fill_modal ||= false
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% if use_modal %>
|
11
|
+
<%= render "refine/inline/filters/modal",
|
12
|
+
frame_id: frame_id,
|
13
|
+
container_class: container_class,
|
14
|
+
frame_class: frame_class,
|
15
|
+
is_open: is_open,
|
16
|
+
fill_modal: fill_modal,
|
17
|
+
src: src do
|
18
|
+
%>
|
19
|
+
<%= capture do %>
|
20
|
+
<%= yield %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% else %>
|
24
|
+
<%= render "refine/inline/filters/popup",
|
25
|
+
frame_id: frame_id,
|
26
|
+
container_class: container_class,
|
27
|
+
frame_class: frame_class,
|
28
|
+
is_open: is_open,
|
29
|
+
src: src do
|
30
|
+
%>
|
31
|
+
<%= capture do %>
|
32
|
+
<%= yield %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
@@ -6,6 +6,9 @@
|
|
6
6
|
conjunction: "or",
|
7
7
|
position: position
|
8
8
|
)
|
9
|
+
use_modal ||= false
|
10
|
+
fill_modal ||= false
|
11
|
+
src = use_modal ? index_advanced_refine_inline_criteria_path(criterion.to_params.merge(fill_modal: fill_modal)) : refine_inline_criteria_path(criterion.to_params)
|
9
12
|
%>
|
10
13
|
|
11
14
|
<% if @refine_filter.criteria_limit_reached? %>
|
@@ -15,12 +18,15 @@
|
|
15
18
|
</button>
|
16
19
|
</div>
|
17
20
|
<% else %>
|
18
|
-
|
21
|
+
|
22
|
+
<%= render "refine/inline/filters/modal_or_popup",
|
19
23
|
frame_id: dom_id(criterion),
|
20
|
-
|
24
|
+
use_modal: use_modal,
|
25
|
+
fill_modal: fill_modal,
|
26
|
+
src: src do
|
21
27
|
%>
|
22
28
|
<div class="refine--add-group-wrapper">
|
23
|
-
<button class="refine--add-group-button" type="button" data-action="click->refine--popup#show">
|
29
|
+
<button class="refine--add-group-button" type="button" data-action="click->refine--popup#show click->refine--modal#open">
|
24
30
|
<span class="refine--add-group-button-label"><%= t(".group") %></span>
|
25
31
|
</button>
|
26
32
|
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% group_position ||= 0 %>
|
2
|
+
|
3
|
+
<% unless group_position == 0 %>
|
4
|
+
<% if render_stack %>
|
5
|
+
<div class="refine--group-join-stack">
|
6
|
+
<% end %>
|
7
|
+
<div class="refine--group-join">
|
8
|
+
<%= t("refine.inline.filters.or") %>
|
9
|
+
<%= link_to merge_groups_refine_inline_criteria_path(group.first.to_params), class: "refine--remove-group", data: {turbo_method: :post, controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} do %>
|
10
|
+
<span class="material-icons-outlined refine--icon-sm">clear</span>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
<% if render_stack %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
@@ -3,6 +3,10 @@
|
|
3
3
|
|
4
4
|
root_data = (defined?(data) && data) || {}
|
5
5
|
|
6
|
+
use_modal = defined?(use_modal) ? use_modal : false
|
7
|
+
fill_modal = defined?(fill_modal) ? fill_modal : false
|
8
|
+
|
9
|
+
hide_save = defined?(hide_save) ? hide_save : true
|
6
10
|
render_stack = defined?(render_stack) ? render_stack : false
|
7
11
|
main_row_class = class_names "refine--filter-row" => true,
|
8
12
|
"refine--has-many-groups" => groups.many?
|
@@ -11,22 +15,14 @@
|
|
11
15
|
<%= tag.div class: "refine--filter-wrapper", id: "refine-inline-filter-#{@refine_client_id}", data: root_data do %>
|
12
16
|
<%= tag.div class: main_row_class do %>
|
13
17
|
<% if @refine_filter.blueprint.empty? %>
|
14
|
-
<%= render "refine/inline/filters/add_first_condition_button", position: 0, btn_class: "refine--add-first-condition-btn" %>
|
18
|
+
<%= render "refine/inline/filters/add_first_condition_button", position: 0, btn_class: "refine--add-first-condition-btn", use_modal: use_modal, fill_modal: fill_modal %>
|
15
19
|
<% else %>
|
16
20
|
<div class="refine--groups-wrapper">
|
17
21
|
<% groups.each.with_index do |group, i| %>
|
18
|
-
|
19
|
-
|
20
|
-
<div class="refine--group-join-stack">
|
21
|
-
<% end %>
|
22
|
-
<div class="refine--group-join"><%= t("refine.inline.filters.or") %></div>
|
23
|
-
<% if render_stack %>
|
24
|
-
</div>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
27
|
-
<%= render "refine/inline/filters/group", group: group, group_count: groups.count, condition_count: group.count, render_stack: render_stack %>
|
22
|
+
<%= render "refine/inline/filters/or_separator", group: group, group_position: i, render_stack: render_stack %>
|
23
|
+
<%= render "refine/inline/filters/group", group: group, group_count: groups.count, condition_count: group.count, render_stack: render_stack, use_modal: use_modal, fill_modal: fill_modal %>
|
28
24
|
<% if i == groups.length - 1 %>
|
29
|
-
<%= render "refine/inline/filters/or_button", position: @refine_filter.blueprint.length %>
|
25
|
+
<%= render "refine/inline/filters/or_button", position: @refine_filter.blueprint.length, use_modal: use_modal, fill_modal: fill_modal %>
|
30
26
|
<% end %>
|
31
27
|
<% end %>
|
32
28
|
|
@@ -35,7 +31,9 @@
|
|
35
31
|
<% if @refine_filter.blueprint&.any? %>
|
36
32
|
<div class="refine--filter-control-group">
|
37
33
|
<%= render "refine/inline/filters/clear_button" %>
|
38
|
-
|
34
|
+
<% unless hide_save %>
|
35
|
+
<%= render "refine/inline/filters/save_button" %>
|
36
|
+
<% end %>
|
39
37
|
</div>
|
40
38
|
<% end %>
|
41
39
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -9,6 +9,8 @@ Rails.application.routes.draw do
|
|
9
9
|
end
|
10
10
|
namespace :inline do
|
11
11
|
resources :criteria, except: [:show] do
|
12
|
+
get "index_advanced", on: :collection
|
13
|
+
post "merge_groups", on: :collection
|
12
14
|
post "clear", on: :collection
|
13
15
|
end
|
14
16
|
resources :stored_filters, only: [:index, :new, :create] do
|
data/lib/refine/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colleen Schnettler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- app/javascript/controllers/refine/filter-pills-controller.js
|
62
62
|
- app/javascript/controllers/refine/form-controller.js
|
63
63
|
- app/javascript/controllers/refine/inline-conditions-controller.js
|
64
|
+
- app/javascript/controllers/refine/modal-controller.js
|
64
65
|
- app/javascript/controllers/refine/popup-controller.js
|
65
66
|
- app/javascript/controllers/refine/search-filter-controller.js
|
66
67
|
- app/javascript/controllers/refine/server-refresh-controller.js
|
@@ -142,13 +143,17 @@ files:
|
|
142
143
|
- app/views/refine/inline/criteria/create.turbo_stream.erb
|
143
144
|
- app/views/refine/inline/criteria/edit.turbo_stream.erb
|
144
145
|
- app/views/refine/inline/criteria/index.html.erb
|
146
|
+
- app/views/refine/inline/criteria/index_advanced.html.erb
|
145
147
|
- app/views/refine/inline/criteria/new.turbo_stream.erb
|
146
148
|
- app/views/refine/inline/filters/_add_first_condition_button.html.erb
|
147
149
|
- app/views/refine/inline/filters/_and_button.html.erb
|
148
150
|
- app/views/refine/inline/filters/_clear_button.html.erb
|
149
151
|
- app/views/refine/inline/filters/_criterion.html.erb
|
150
152
|
- app/views/refine/inline/filters/_group.html.erb
|
153
|
+
- app/views/refine/inline/filters/_modal.html.erb
|
154
|
+
- app/views/refine/inline/filters/_modal_or_popup.html.erb
|
151
155
|
- app/views/refine/inline/filters/_or_button.html.erb
|
156
|
+
- app/views/refine/inline/filters/_or_separator.html.erb
|
152
157
|
- app/views/refine/inline/filters/_popup.html.erb
|
153
158
|
- app/views/refine/inline/filters/_save_button.html.erb
|
154
159
|
- app/views/refine/inline/filters/_show.html.erb
|