lesli_view 0.1.0
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 +7 -0
- data/Rakefile +8 -0
- data/lib/lesli_view/element/button.html.erb +12 -0
- data/lib/lesli_view/element/button.rb +72 -0
- data/lib/lesli_view/element/form.html.erb +10 -0
- data/lib/lesli_view/element/form.rb +51 -0
- data/lib/lesli_view/element/header.html.erb +16 -0
- data/lib/lesli_view/element/header.rb +46 -0
- data/lib/lesli_view/element/table.full.rb +43 -0
- data/lib/lesli_view/element/table.html.erb +39 -0
- data/lib/lesli_view/element/table.html.full.erb +101 -0
- data/lib/lesli_view/element/table.rb +77 -0
- data/lib/lesli_view/element/toolbar.html.erb +25 -0
- data/lib/lesli_view/element/toolbar.rb +47 -0
- data/lib/lesli_view/engine.rb +44 -0
- data/lib/lesli_view/layout/container.html.erb +5 -0
- data/lib/lesli_view/layout/container.rb +47 -0
- data/lib/lesli_view/lesli_view.scss +3 -0
- data/lib/lesli_view/version.rb +5 -0
- data/lib/lesli_view.rb +25 -0
- data/license +674 -0
- data/readme.md +95 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 19c9e421da50c64fc6a723625b31a04840e5480a9334ce506d453f70fe722e6f
|
4
|
+
data.tar.gz: e93732acb2d29e185d74e34b0e6e280598b63fdbd54928f18529d33bccbffed3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 51d1dd1d6c660d63047174e2f1898c1972b995f8391b06a929d9abe341dbea183cb69118df8ce5f255282ec33aef993f18cb6db1c9dc8b2203f338a44ffd5c0c
|
7
|
+
data.tar.gz: 8274a450b83534a9add823c205d2aa295522bfda1d08b88fd024915cb6e00973d19eb2a861d26c478ae861a83073dc77efb24f04cf85b99bcae2bad74fce6a35
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<button class="<%= button_classes %>" data-action="click->button#click">
|
2
|
+
<% if icon %>
|
3
|
+
<span class="icon <%= 'is-small' if small %>">
|
4
|
+
<span class="material-icons"><%= icon %></span>
|
5
|
+
</span>
|
6
|
+
<% end %>
|
7
|
+
<% unless icon_only?(content.present?) %>
|
8
|
+
<span>
|
9
|
+
<%= content %>
|
10
|
+
</span>
|
11
|
+
<% end %>
|
12
|
+
</button>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Element
|
37
|
+
class Button < ViewComponent::Base
|
38
|
+
attr_reader :icon, :loading, :solid, :info, :success, :warning, :danger, :small
|
39
|
+
|
40
|
+
def initialize(icon: nil, loading: false, solid: false, info: false, success: false, warning: false, danger: false, small: false)
|
41
|
+
@icon = icon
|
42
|
+
@loading = loading
|
43
|
+
@solid = solid
|
44
|
+
@info = info
|
45
|
+
@success = success
|
46
|
+
@warning = warning
|
47
|
+
@danger = danger
|
48
|
+
@small = small
|
49
|
+
end
|
50
|
+
|
51
|
+
def button_classes
|
52
|
+
classes = ["button", button_variant]
|
53
|
+
classes << "is-light" << "is-outlined" unless solid
|
54
|
+
classes << "is-loading" if loading
|
55
|
+
classes << "is-small" if small
|
56
|
+
classes.join(" ")
|
57
|
+
end
|
58
|
+
|
59
|
+
def button_variant
|
60
|
+
return "is-warning" if warning
|
61
|
+
return "is-success" if success
|
62
|
+
return "is-danger" if danger
|
63
|
+
return "is-info" if info
|
64
|
+
"is-primary"
|
65
|
+
end
|
66
|
+
|
67
|
+
def icon_only?(content_present)
|
68
|
+
icon && !content_present
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Element
|
37
|
+
class Form < ViewComponent::Base
|
38
|
+
attr_reader :flat, :title, :editable
|
39
|
+
|
40
|
+
def initialize(flat: false, title: nil, editable: true)
|
41
|
+
@flat = flat
|
42
|
+
@title = title
|
43
|
+
@editable = editable
|
44
|
+
end
|
45
|
+
|
46
|
+
def form_with_tag_options
|
47
|
+
{ onsubmit: 'event.preventDefault(); submitForm();' }.map { |key, value| "#{key}=\"#{value}\"" }.join(' ').html_safe
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<section class="lesli-element-header is-flex">
|
2
|
+
<div class="lesli-element-header-title is-flex is-align-items-center">
|
3
|
+
<% if back %>
|
4
|
+
<button class="button is-info is-outlined mr-4" onclick="history.back()">
|
5
|
+
<span class="material-icons">arrow_back</span>
|
6
|
+
</button>
|
7
|
+
<% end %>
|
8
|
+
<% if title.present? %>
|
9
|
+
<h1 class="subtitle is-size-3"><%= title %></h1>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
<div class="lesli-element-header-items is-flex is-flex-grow-1 is-justify-content-end">
|
13
|
+
<%= content %>
|
14
|
+
</div>
|
15
|
+
</section>
|
16
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Element
|
37
|
+
class Header < ViewComponent::Base
|
38
|
+
attr_reader :title, :back
|
39
|
+
|
40
|
+
def initialize(title, back: nil)
|
41
|
+
@title = title
|
42
|
+
@back = back
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module LesliView
|
2
|
+
module Element
|
3
|
+
class Table < ViewComponent::Base
|
4
|
+
attr_reader :id, :class_name, :pagination, :loading, :headless, :columns, :records, :link
|
5
|
+
|
6
|
+
def initialize(id: nil, class_name: "is-striped", pagination: nil, loading: false, headless: false, columns:, records:, link: nil)
|
7
|
+
@id = id
|
8
|
+
@class_name = class_name
|
9
|
+
@pagination = pagination
|
10
|
+
@loading = loading
|
11
|
+
@headless = headless
|
12
|
+
@columns = columns
|
13
|
+
@records = records
|
14
|
+
@link = link
|
15
|
+
end
|
16
|
+
|
17
|
+
def table_header_class(column)
|
18
|
+
column[:field] == "id" || column[:align] == "center" ? "has-text-centered" : ""
|
19
|
+
end
|
20
|
+
|
21
|
+
def table_body_class(column)
|
22
|
+
column[:field] == "id" || column[:align] == "center" ? "has-text-centered" : ""
|
23
|
+
end
|
24
|
+
|
25
|
+
def current_sort_dir(column)
|
26
|
+
@current_sort_dir ||= {}
|
27
|
+
@current_sort_dir[column[:field]] || "asc"
|
28
|
+
end
|
29
|
+
|
30
|
+
def toggle_sort_dir(column)
|
31
|
+
current_sort_dir(column) == "asc" ? "desc" : "asc"
|
32
|
+
end
|
33
|
+
|
34
|
+
def render_head_slot(column)
|
35
|
+
content_for?(:"head_#{column[:field]}") ? content_for(:"head_#{column[:field]}") : column[:label]
|
36
|
+
end
|
37
|
+
|
38
|
+
def detail_active?(record)
|
39
|
+
record[:detail_active]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class="lesli-table-container">
|
2
|
+
<table id="<%= id %>" class="table is-fullwidth lesli-table mb-5 <%= class_name %>">
|
3
|
+
<% unless headless %>
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<% columns.each do |column| %>
|
7
|
+
<th
|
8
|
+
width="<%= column[:width] %>"
|
9
|
+
class="<%= table_header_class(column) %>"
|
10
|
+
data-action="click->table#sort"
|
11
|
+
data-field="<%= column[:field] %>">
|
12
|
+
<% if column[:sort] %>
|
13
|
+
<span class="icon-text">
|
14
|
+
<span><%= render_head_slot(column) %></span>
|
15
|
+
<span class="icon">
|
16
|
+
<span class="material-icons"><%= column[:field] == @current_sort ? (current_sort_dir(column) == "asc" ? "arrow_upward" : "arrow_downward") : "sort" %></span>
|
17
|
+
</span>
|
18
|
+
</span>
|
19
|
+
<% else %>
|
20
|
+
<%= render_head_slot(column) %>
|
21
|
+
<% end %>
|
22
|
+
</th>
|
23
|
+
<% end %>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
<% end %>
|
27
|
+
<tbody>
|
28
|
+
<% records.each_with_index do |record, i| %>
|
29
|
+
<tr>
|
30
|
+
<% columns.each do |column| %>
|
31
|
+
<td class="<%= table_body_class(column) %>" data-action="click->table#selectRow" data-id="<%= record[:id] %>">
|
32
|
+
<%= record[column[:field]] %>
|
33
|
+
</td>
|
34
|
+
<% end %>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<div class="lesli-table-container">
|
2
|
+
<table id="<%= id %>" class="table is-fullwidth lesli-table mb-5 <%= class_name %>">
|
3
|
+
<% unless headless %>
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<% if content_for?(:detail) %>
|
7
|
+
<th></th>
|
8
|
+
<% end %>
|
9
|
+
<% columns.each do |column| %>
|
10
|
+
<th
|
11
|
+
width="<%= column[:width] %>"
|
12
|
+
class="<%= table_header_class(column) %>"
|
13
|
+
data-action="click->table#sort"
|
14
|
+
data-field="<%= column[:field] %>">
|
15
|
+
<% if column[:sort] %>
|
16
|
+
<span class="icon-text">
|
17
|
+
<span><%= render_head_slot(column) %></span>
|
18
|
+
<span class="icon">
|
19
|
+
<span class="material-icons"><%= column[:field] == @current_sort ? (current_sort_dir(column) == "asc" ? "arrow_upward" : "arrow_downward") : "sort" %></span>
|
20
|
+
</span>
|
21
|
+
</span>
|
22
|
+
<% else %>
|
23
|
+
<%= render_head_slot(column) %>
|
24
|
+
<% end %>
|
25
|
+
</th>
|
26
|
+
<% end %>
|
27
|
+
<% if content_for?(:options) %>
|
28
|
+
<th></th>
|
29
|
+
<% end %>
|
30
|
+
<% if content_for?(:buttons) %>
|
31
|
+
<th></th>
|
32
|
+
<% end %>
|
33
|
+
</tr>
|
34
|
+
</thead>
|
35
|
+
<% end %>
|
36
|
+
<tbody>
|
37
|
+
<% records.each_with_index do |record, i| %>
|
38
|
+
<tr>
|
39
|
+
<% if content_for?(:detail) %>
|
40
|
+
<td class="detail-row px-2 has-text-centered">
|
41
|
+
<button class="button is-white px-2" data-action="click->table#toggleDetails" data-index="<%= i %>">
|
42
|
+
<span class="material-icons"><%= detail_active?(record) ? "expand_more" : "chevron_right" %></span>
|
43
|
+
</button>
|
44
|
+
</td>
|
45
|
+
<% end %>
|
46
|
+
<% columns.each do |column| %>
|
47
|
+
<td class="<%= table_body_class(column) %>" data-action="click->table#selectRow" data-id="<%= record[:id] %>">
|
48
|
+
<% if link && !content_for?(:"#{column[:field]}") %>
|
49
|
+
<%= link_to record[column[:field]], link.call(record), class: "link" %>
|
50
|
+
<% else %>
|
51
|
+
<%= render_slot(column[:field], column: column, record: record, value: record[column[:field]]) do %>
|
52
|
+
<%= record[column[:field]] %>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
</td>
|
56
|
+
<% end %>
|
57
|
+
<% if content_for?(:options) %>
|
58
|
+
<td class="options p-0">
|
59
|
+
<div class="dropdown is-right is-hoverable">
|
60
|
+
<div class="dropdown-trigger">
|
61
|
+
<button class="button has-text-info">
|
62
|
+
<span class="icon">
|
63
|
+
<span class="material-icons">more_vert</span>
|
64
|
+
</span>
|
65
|
+
</button>
|
66
|
+
</div>
|
67
|
+
<div class="dropdown-menu" role="menu">
|
68
|
+
<div class="dropdown-content">
|
69
|
+
<%= render_slot(:options, record: record, value: record[:id]) %>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
</td>
|
74
|
+
<% end %>
|
75
|
+
<% if content_for?(:buttons) %>
|
76
|
+
<td class="p-0">
|
77
|
+
<%= render_slot(:buttons, record: record, value: record[:id]) %>
|
78
|
+
</td>
|
79
|
+
<% end %>
|
80
|
+
</tr>
|
81
|
+
<% if detail_active?(record) && content_for?(:detail) %>
|
82
|
+
<tr>
|
83
|
+
<td colspan="<%= columns.size + (content_for?(:detail) ? 1 : 0) %>">
|
84
|
+
<%= render_slot(:detail, record: record) %>
|
85
|
+
</td>
|
86
|
+
</tr>
|
87
|
+
<% end %>
|
88
|
+
<% end %>
|
89
|
+
</tbody>
|
90
|
+
</table>
|
91
|
+
<%#
|
92
|
+
< % if loading % >
|
93
|
+
<lesli-loading></lesli-loading>
|
94
|
+
< % elsif records.empty? % >
|
95
|
+
<lesli-empty></lesli-empty>
|
96
|
+
< % end % >
|
97
|
+
< % if pagination % >
|
98
|
+
<lesli-pagination :pagination="< %= pagination % >" data-action="paginate->table#paginate"></lesli-pagination>
|
99
|
+
< % end % >
|
100
|
+
%>
|
101
|
+
</div>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Element
|
37
|
+
class Table < ViewComponent::Base
|
38
|
+
attr_reader :id, :class_name, :pagination, :loading, :headless, :columns, :records, :link
|
39
|
+
|
40
|
+
def initialize(id: nil, class_name: "is-striped", pagination: nil, loading: false, headless: false, columns:, records:, link: nil)
|
41
|
+
@id = id
|
42
|
+
@class_name = class_name
|
43
|
+
@pagination = pagination
|
44
|
+
@loading = loading
|
45
|
+
@headless = headless
|
46
|
+
@columns = columns
|
47
|
+
@records = records
|
48
|
+
@link = link
|
49
|
+
end
|
50
|
+
|
51
|
+
def table_header_class(column)
|
52
|
+
column[:field] == "id" || column[:align] == "center" ? "has-text-centered" : ""
|
53
|
+
end
|
54
|
+
|
55
|
+
def table_body_class(column)
|
56
|
+
column[:field] == "id" || column[:align] == "center" ? "has-text-centered" : ""
|
57
|
+
end
|
58
|
+
|
59
|
+
def current_sort_dir(column)
|
60
|
+
@current_sort_dir ||= {}
|
61
|
+
@current_sort_dir[column[:field]] || "asc"
|
62
|
+
end
|
63
|
+
|
64
|
+
def toggle_sort_dir(column)
|
65
|
+
current_sort_dir(column) == "asc" ? "desc" : "asc"
|
66
|
+
end
|
67
|
+
|
68
|
+
def render_head_slot(column)
|
69
|
+
content_for?(:"head_#{column[:field]}") ? content_for(:"head_#{column[:field]}") : column[:label]
|
70
|
+
end
|
71
|
+
|
72
|
+
def detail_active?(record)
|
73
|
+
record[:detail_active]
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<section class="lesli-toolbar mb-5">
|
2
|
+
<div class="field is-grouped">
|
3
|
+
<div class="control is-expanded has-icons-right has-icons-left">
|
4
|
+
<%= text_field_tag(:search, initial_value,
|
5
|
+
placeholder: search_placeholder,
|
6
|
+
class: "input is-shadowless",
|
7
|
+
data: { action: "input->toolbar#search" }
|
8
|
+
)%>
|
9
|
+
<span class="icon is-small is-left has-text-grey-light">
|
10
|
+
<span class="material-icons">
|
11
|
+
search
|
12
|
+
</span>
|
13
|
+
</span>
|
14
|
+
<span class="icon is-right">
|
15
|
+
<a class="delete" data-action="click->toolbar#clearSearch"></a>
|
16
|
+
</span>
|
17
|
+
</div>
|
18
|
+
<%= content %>
|
19
|
+
<% if pagination %>
|
20
|
+
<div class="select">
|
21
|
+
<%= select_tag :pagination, options_for_select([10, 20]), class: "select" %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
</section>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Element
|
37
|
+
class Toolbar < ViewComponent::Base
|
38
|
+
attr_reader :search_placeholder, :initial_value, :pagination
|
39
|
+
|
40
|
+
def initialize(search_placeholder = "Search...", initial_value: nil, pagination: true)
|
41
|
+
@search_placeholder = search_placeholder
|
42
|
+
@initial_value = initial_value
|
43
|
+
@pagination = pagination
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
module LesliView
|
34
|
+
class Engine < ::Rails::Engine
|
35
|
+
isolate_namespace LesliView
|
36
|
+
|
37
|
+
initializer "lesli_view" do |app|
|
38
|
+
|
39
|
+
# autoloading sass style sheet files
|
40
|
+
app.config.assets.precompile += %w[lesli_view/lesli_view.scss]
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Lesli
|
6
|
+
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
|
+
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
This program is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
21
|
+
|
22
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
23
|
+
|
24
|
+
Made with ♥ by LesliTech
|
25
|
+
Building a better future, one line of code at a time.
|
26
|
+
|
27
|
+
@contact hello@lesli.tech
|
28
|
+
@website https://www.lesli.tech
|
29
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
30
|
+
|
31
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
32
|
+
// ·
|
33
|
+
=end
|
34
|
+
|
35
|
+
module LesliView
|
36
|
+
module Layout
|
37
|
+
class Container < ViewComponent::Base
|
38
|
+
attr_reader :turbo_frame_id
|
39
|
+
attr_reader :dashboard
|
40
|
+
|
41
|
+
def initialize(turbo_frame_id, dashboard: false)
|
42
|
+
@turbo_frame_id = turbo_frame_id
|
43
|
+
@dashboard = dashboard
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|