f_components 0.2.1 → 0.5.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27c8e0b1d7838f17aa6039ebac0be8174ec0318e55df6364f7f8fc1f43fe1dd
|
4
|
+
data.tar.gz: 6e4b33989e61277d68f1d76b96439d70ea08bb51215ccd8fa2116d8c4572981a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05cf93ca574a4879fdd18ccea361c00a7963a186f30c484a29ed2cb79542a8270f2f8b167eab3036596eaf8f072638ffdbc72aa1de082924fb70218aeec0a8e
|
7
|
+
data.tar.gz: 6b8bf2d6916fd16b7ea6f6606d0403a0bc31fa45800bfc6fce446021232db93ee06ffe305af6902cec0e6c68b6fdd2c721113b1bb2f95f971874f69a1923cbef
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<div data-controller="f-table-component">
|
2
2
|
<%=
|
3
|
-
|
3
|
+
render(FComponents::Table::Desktop::Component.(
|
4
4
|
columns: columns,
|
5
5
|
rows: rows,
|
6
6
|
actions: @actions,
|
7
7
|
check_boxes: @check_boxes,
|
8
8
|
**@options
|
9
|
-
)
|
9
|
+
))
|
10
10
|
%>
|
11
11
|
|
12
12
|
<%=
|
13
|
-
|
13
|
+
render(FComponents::Table::Mobile::Component.(
|
14
14
|
columns: columns,
|
15
15
|
rows: rows,
|
16
16
|
main_column: @main_column,
|
@@ -18,6 +18,6 @@
|
|
18
18
|
check_boxes: @check_boxes,
|
19
19
|
resources: @resources,
|
20
20
|
**@options
|
21
|
-
)
|
21
|
+
))
|
22
22
|
%>
|
23
23
|
</div>
|
@@ -2,28 +2,58 @@
|
|
2
2
|
|
3
3
|
module FComponents
|
4
4
|
module IconsHelper
|
5
|
-
|
5
|
+
VALID_STYLES = {
|
6
|
+
solid: 'fa-solid',
|
7
|
+
regular: 'fa-regular',
|
8
|
+
light: 'fa-light',
|
9
|
+
thin: 'fa-thin',
|
10
|
+
duotone: 'fa-duotone',
|
11
|
+
brands: 'fa-brands'
|
12
|
+
}.freeze
|
13
|
+
|
14
|
+
# Public: Creates a Font Awesome icon tag
|
15
|
+
#
|
6
16
|
# Examples:
|
7
17
|
#
|
8
|
-
#
|
9
|
-
#
|
18
|
+
# fa_icon('home')
|
19
|
+
# #=> <i class="fa-solid fa-home"></i>
|
20
|
+
#
|
21
|
+
# fa_icon('user', style: :regular)
|
22
|
+
# #=> <i class="fa-regular fa-user"></i>
|
23
|
+
#
|
24
|
+
# fa_icon('github', style: :brands)
|
25
|
+
# #=> <i class="fa-brands fa-github"></i>
|
10
26
|
#
|
11
|
-
#
|
12
|
-
# <i class="
|
27
|
+
# fa_icon('eye', class: 'strong space-x-2', text: 'my text')
|
28
|
+
# #=> <i class="fa-solid fa-eye strong space-x-2"></i> my text
|
13
29
|
#
|
14
|
-
#
|
15
|
-
#
|
30
|
+
# Parameters:
|
31
|
+
# @param name [String] The icon name (e.g., 'home', 'user')
|
32
|
+
# @param options [Hash] Additional options
|
33
|
+
# - :style [Symbol] The icon style (:solid, :regular, :brands, etc.)
|
34
|
+
# - :class [String] Additional CSS classes
|
35
|
+
# - :text [String] Text to display after the icon
|
16
36
|
#
|
17
|
-
#
|
18
|
-
#
|
37
|
+
# Returns:
|
38
|
+
# @return [String] Safe HTML for rendering
|
19
39
|
def fa_icon(name, options = {})
|
20
|
-
|
21
|
-
|
40
|
+
style = options.delete(:style) { :solid }
|
41
|
+
style_class = VALID_STYLES[style] || VALID_STYLES[:solid]
|
42
|
+
|
43
|
+
icon_class = "fa-#{name}"
|
22
44
|
custom_classes = options[:class].presence
|
23
|
-
options[:class] = [
|
45
|
+
options[:class] = [style_class, icon_class, custom_classes].compact.join(' ')
|
46
|
+
|
24
47
|
f_icon(options)
|
25
48
|
end
|
26
49
|
|
50
|
+
# Internal: Creates the <i> tag with the appropriate classes and adds text if necessary
|
51
|
+
#
|
52
|
+
# Parameters:
|
53
|
+
# @param options [Hash] Options for the <i> tag
|
54
|
+
#
|
55
|
+
# Returns:
|
56
|
+
# @return [String] Safe HTML for rendering
|
27
57
|
def f_icon(options)
|
28
58
|
text = options.delete(:text)
|
29
59
|
tag = content_tag(:i, nil, options)
|
data/lib/f_components/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: f_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fretadao tech
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webpacker
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.5.22
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Library of view_components
|