phlexi-field 0.0.11 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f58c93fb276d8e7c9e4b18c1cfdf813b524aa9c1d7662fecdaf39da6a82bb370
4
- data.tar.gz: 1c29afbc8db1fdb4f0ed2f3e512b5b31085a18c224d4ac6b1d9b8fc8fd7ce892
3
+ metadata.gz: 5ba4c98ff7c81ff95503b3045f7564f86e91a529789a4408d51e100e764d91e8
4
+ data.tar.gz: 940a9ff9e19deb86247956307e8903f24f3ce54691646742fb36e5394fe39b53
5
5
  SHA512:
6
- metadata.gz: 15be8cf4c418210ae5a72080aa6900b76974ea1ebb73874801254dc9c1c9a0fa6ecb20c4b63f9521009a0607849ad4787ffa87a03f6bc67d8aca0b70e7a3d076
7
- data.tar.gz: bcb59898bebb0ff6a7972529df59156cd10f05eadb9b34d81985010f79497073e02e61a2e0da9b13368ba3d1e42fd19b6197480f3b4df3d74f2b61f72a859212
6
+ metadata.gz: 780d445e6b6e4501c89c6030c46a405858ff6dfc2de75c5d2cec398309152bdfdd65536f09fe736ac0dd31f284b86db3f8405e6943e414aa9566d2bef162d8c8
7
+ data.tar.gz: b5371cb3beb7e43475a68e704e53558191c469cc2f5f80156e0db8ce5be2cd435d012fd14c6b9f74683b7d60a5c9cb23d46ef532f0623fde1677ba3937239366
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Phlexi::Form is a flexible and powerful form builder for Ruby applications. It provides a more customizable and extensible way to create forms compared to traditional form helpers.
4
4
 
5
- [![Ruby](https://github.com/radioactive-labs/phlexi-field/actions/workflows/main.yml/badge.svg)](https://github.com/radioactive-labs/phlexi-field/actions/workflows/main.yml)
5
+ [![Ruby](https://github.com/radioactive-labs/phlexi-form/actions/workflows/main.yml/badge.svg)](https://github.com/radioactive-labs/phlexi-form/actions/workflows/main.yml)
6
6
 
7
7
  ## Features
8
8
 
@@ -20,7 +20,7 @@ Phlexi::Form is a flexible and powerful form builder for Ruby applications. It p
20
20
  Add this line to your application's Gemfile:
21
21
 
22
22
  ```ruby
23
- gem 'phlexi-field'
23
+ gem 'phlexi-form'
24
24
  ```
25
25
 
26
26
  And then execute:
@@ -32,7 +32,7 @@ $ bundle install
32
32
  Or install it yourself as:
33
33
 
34
34
  ```
35
- $ gem install phlexi-field
35
+ $ gem install phlexi-form
36
36
  ```
37
37
 
38
38
  ## Usage
@@ -139,7 +139,7 @@ You can create custom form components by inheriting from `Phlexi::Form::Componen
139
139
 
140
140
  ```ruby
141
141
  class CustomInput < Phlexi::Form::Components::Base
142
- def template
142
+ def view_template
143
143
  div(class: "custom-input") do
144
144
  input(**attributes)
145
145
  span(class: "custom-icon")
@@ -189,7 +189,7 @@ end
189
189
 
190
190
  ## Contributing
191
191
 
192
- Bug reports and pull requests are welcome on GitHub at https://github.com/radioactive-labs/phlexi-field.
192
+ Bug reports and pull requests are welcome on GitHub at https://github.com/radioactive-labs/phlexi-form.
193
193
 
194
194
  ## License
195
195
 
@@ -1,44 +1,40 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- phlexi-field (0.0.9)
4
+ phlexi-form (0.3.0.rc1)
5
5
  activesupport
6
- fiber-local
7
6
  phlex (~> 1.11)
8
7
  zeitwerk
9
8
 
10
9
  GEM
11
10
  remote: https://rubygems.org/
12
11
  specs:
13
- actionpack (7.2.2)
14
- actionview (= 7.2.2)
15
- activesupport (= 7.2.2)
12
+ actionpack (7.1.3.4)
13
+ actionview (= 7.1.3.4)
14
+ activesupport (= 7.1.3.4)
16
15
  nokogiri (>= 1.8.5)
17
16
  racc
18
- rack (>= 2.2.4, < 3.2)
17
+ rack (>= 2.2.4)
19
18
  rack-session (>= 1.0.1)
20
19
  rack-test (>= 0.6.3)
21
20
  rails-dom-testing (~> 2.2)
22
21
  rails-html-sanitizer (~> 1.6)
23
- useragent (~> 0.16)
24
- actionview (7.2.2)
25
- activesupport (= 7.2.2)
22
+ actionview (7.1.3.4)
23
+ activesupport (= 7.1.3.4)
26
24
  builder (~> 3.1)
27
25
  erubi (~> 1.11)
28
26
  rails-dom-testing (~> 2.2)
29
27
  rails-html-sanitizer (~> 1.6)
30
- activesupport (7.2.2)
28
+ activesupport (7.1.3.4)
31
29
  base64
32
- benchmark (>= 0.3)
33
30
  bigdecimal
34
- concurrent-ruby (~> 1.0, >= 1.3.1)
31
+ concurrent-ruby (~> 1.0, >= 1.0.2)
35
32
  connection_pool (>= 2.2.5)
36
33
  drb
37
34
  i18n (>= 1.6, < 2)
38
- logger (>= 1.4.2)
39
35
  minitest (>= 5.1)
40
- securerandom (>= 0.3)
41
- tzinfo (~> 2.0, >= 2.0.5)
36
+ mutex_m
37
+ tzinfo (~> 2.0)
42
38
  addressable (2.8.7)
43
39
  public_suffix (>= 2.0.2, < 7.0)
44
40
  ansi (1.5.0)
@@ -48,12 +44,11 @@ GEM
48
44
  thor (>= 0.14.0)
49
45
  ast (2.4.2)
50
46
  base64 (0.2.0)
51
- benchmark (0.3.0)
52
47
  bigdecimal (3.1.8)
53
48
  builder (3.3.0)
54
49
  bundle-audit (0.1.0)
55
50
  bundler-audit
56
- bundler-audit (0.9.2)
51
+ bundler-audit (0.9.1)
57
52
  bundler (>= 1.2.0, < 3)
58
53
  thor (~> 1.0)
59
54
  capybara (3.40.0)
@@ -69,56 +64,54 @@ GEM
69
64
  activesupport (>= 3.0.0)
70
65
  railties (>= 3.0.0)
71
66
  thor (>= 0.14.6)
72
- concurrent-ruby (1.3.4)
67
+ concurrent-ruby (1.3.3)
73
68
  connection_pool (2.4.1)
74
69
  crass (1.0.6)
75
70
  drb (2.2.1)
76
71
  erubi (1.13.0)
77
- fiber-local (1.1.0)
78
- fiber-storage
79
- fiber-storage (1.0.0)
80
- i18n (1.14.6)
72
+ i18n (1.14.5)
81
73
  concurrent-ruby (~> 1.0)
82
74
  io-console (0.7.2)
83
- irb (1.14.1)
75
+ irb (1.14.0)
84
76
  rdoc (>= 4.0.0)
85
77
  reline (>= 0.4.2)
86
- json (2.7.6)
78
+ json (2.7.2)
87
79
  language_server-protocol (3.17.0.3)
88
80
  lint_roller (1.1.0)
89
- logger (1.6.1)
90
- loofah (2.23.1)
81
+ loofah (2.22.0)
91
82
  crass (~> 1.0.2)
92
83
  nokogiri (>= 1.12.0)
93
84
  matrix (0.4.2)
94
85
  mini_mime (1.1.5)
95
- minitest (5.25.1)
86
+ minitest (5.24.1)
96
87
  minitest-reporters (1.7.1)
97
88
  ansi
98
89
  builder
99
90
  minitest (>= 5.0)
100
91
  ruby-progressbar
101
- nokogiri (1.16.7-arm64-darwin)
92
+ mutex_m (0.2.0)
93
+ nokogiri (1.16.7-x86_64-darwin)
102
94
  racc (~> 1.4)
103
- parallel (1.26.3)
104
- parser (3.3.6.0)
95
+ parallel (1.25.1)
96
+ parser (3.3.4.0)
105
97
  ast (~> 2.4.1)
106
98
  racc
107
99
  phlex (1.11.0)
108
100
  phlex-testing-capybara (0.1.0)
109
101
  capybara (~> 3.38)
110
102
  phlex (>= 0.5)
111
- psych (5.2.0)
103
+ psych (5.1.2)
112
104
  stringio
113
105
  public_suffix (6.0.1)
114
106
  racc (1.8.1)
115
- rack (3.1.8)
107
+ rack (3.1.7)
116
108
  rack-session (2.0.0)
117
109
  rack (>= 3.0.0)
118
110
  rack-test (2.1.0)
119
111
  rack (>= 1.3)
120
- rackup (2.2.0)
112
+ rackup (2.1.0)
121
113
  rack (>= 3)
114
+ webrick (~> 1.8)
122
115
  rails-dom-testing (2.2.0)
123
116
  activesupport (>= 5.0.0)
124
117
  minitest
@@ -126,10 +119,10 @@ GEM
126
119
  rails-html-sanitizer (1.6.0)
127
120
  loofah (~> 2.21)
128
121
  nokogiri (~> 1.14)
129
- railties (7.2.2)
130
- actionpack (= 7.2.2)
131
- activesupport (= 7.2.2)
132
- irb (~> 1.13)
122
+ railties (7.1.3.4)
123
+ actionpack (= 7.1.3.4)
124
+ activesupport (= 7.1.3.4)
125
+ irb
133
126
  rackup (>= 1.0.0)
134
127
  rake (>= 12.2)
135
128
  thor (~> 1.0, >= 1.2.2)
@@ -139,49 +132,52 @@ GEM
139
132
  rdoc (6.7.0)
140
133
  psych (>= 4.0.0)
141
134
  regexp_parser (2.9.2)
142
- reline (0.5.11)
135
+ reline (0.5.9)
143
136
  io-console (~> 0.5)
144
- rubocop (1.66.1)
137
+ rexml (3.3.2)
138
+ strscan
139
+ rubocop (1.64.1)
145
140
  json (~> 2.3)
146
141
  language_server-protocol (>= 3.17.0)
147
142
  parallel (~> 1.10)
148
143
  parser (>= 3.3.0.2)
149
144
  rainbow (>= 2.2.2, < 4.0)
150
- regexp_parser (>= 2.4, < 3.0)
151
- rubocop-ast (>= 1.32.2, < 2.0)
145
+ regexp_parser (>= 1.8, < 3.0)
146
+ rexml (>= 3.2.5, < 4.0)
147
+ rubocop-ast (>= 1.31.1, < 2.0)
152
148
  ruby-progressbar (~> 1.7)
153
149
  unicode-display_width (>= 2.4.0, < 3.0)
154
- rubocop-ast (1.34.0)
150
+ rubocop-ast (1.31.3)
155
151
  parser (>= 3.3.1.0)
156
- rubocop-performance (1.22.1)
152
+ rubocop-performance (1.21.1)
157
153
  rubocop (>= 1.48.1, < 2.0)
158
154
  rubocop-ast (>= 1.31.1, < 2.0)
159
155
  ruby-progressbar (1.13.0)
160
- securerandom (0.3.1)
161
- standard (1.41.1)
156
+ standard (1.39.2)
162
157
  language_server-protocol (~> 3.17.0.2)
163
158
  lint_roller (~> 1.0)
164
- rubocop (~> 1.66.0)
159
+ rubocop (~> 1.64.0)
165
160
  standard-custom (~> 1.0.0)
166
- standard-performance (~> 1.5)
161
+ standard-performance (~> 1.4)
167
162
  standard-custom (1.0.2)
168
163
  lint_roller (~> 1.0)
169
164
  rubocop (~> 1.50)
170
- standard-performance (1.5.0)
165
+ standard-performance (1.4.0)
171
166
  lint_roller (~> 1.1)
172
- rubocop-performance (~> 1.22.0)
173
- stringio (3.1.2)
174
- thor (1.3.2)
167
+ rubocop-performance (~> 1.21.0)
168
+ stringio (3.1.1)
169
+ strscan (3.1.0)
170
+ thor (1.3.1)
175
171
  tzinfo (2.0.6)
176
172
  concurrent-ruby (~> 1.0)
177
- unicode-display_width (2.6.0)
178
- useragent (0.16.10)
173
+ unicode-display_width (2.5.0)
174
+ webrick (1.8.1)
179
175
  xpath (3.2.0)
180
176
  nokogiri (~> 1.8)
181
- zeitwerk (2.7.1)
177
+ zeitwerk (2.6.17)
182
178
 
183
179
  PLATFORMS
184
- arm64-darwin
180
+ x86_64-darwin
185
181
 
186
182
  DEPENDENCIES
187
183
  appraisal
@@ -190,7 +186,7 @@ DEPENDENCIES
190
186
  minitest
191
187
  minitest-reporters
192
188
  phlex-testing-capybara
193
- phlexi-field!
189
+ phlexi-form!
194
190
  rake
195
191
  standard
196
192
 
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- phlexi-field (0.0.9)
4
+ phlexi-form (0.3.0.rc1)
5
5
  activesupport
6
- fiber-local
7
6
  phlex (~> 1.11)
8
7
  zeitwerk
9
8
 
@@ -97,7 +96,7 @@ GEM
97
96
  builder (3.3.0)
98
97
  bundle-audit (0.1.0)
99
98
  bundler-audit
100
- bundler-audit (0.9.2)
99
+ bundler-audit (0.9.1)
101
100
  bundler (>= 1.2.0, < 3)
102
101
  thor (~> 1.0)
103
102
  capybara (3.40.0)
@@ -113,27 +112,24 @@ GEM
113
112
  activesupport (>= 3.0.0)
114
113
  railties (>= 3.0.0)
115
114
  thor (>= 0.14.6)
116
- concurrent-ruby (1.3.4)
115
+ concurrent-ruby (1.3.3)
117
116
  connection_pool (2.4.1)
118
117
  crass (1.0.6)
119
118
  date (3.3.4)
120
119
  drb (2.2.1)
121
120
  erubi (1.13.0)
122
- fiber-local (1.1.0)
123
- fiber-storage
124
- fiber-storage (1.0.0)
125
121
  globalid (1.2.1)
126
122
  activesupport (>= 6.1)
127
- i18n (1.14.6)
123
+ i18n (1.14.5)
128
124
  concurrent-ruby (~> 1.0)
129
125
  io-console (0.7.2)
130
- irb (1.14.1)
126
+ irb (1.14.0)
131
127
  rdoc (>= 4.0.0)
132
128
  reline (>= 0.4.2)
133
- json (2.7.6)
129
+ json (2.7.2)
134
130
  language_server-protocol (3.17.0.3)
135
131
  lint_roller (1.1.0)
136
- loofah (2.23.1)
132
+ loofah (2.22.0)
137
133
  crass (~> 1.0.2)
138
134
  nokogiri (>= 1.12.0)
139
135
  mail (2.8.1)
@@ -144,14 +140,14 @@ GEM
144
140
  marcel (1.0.4)
145
141
  matrix (0.4.2)
146
142
  mini_mime (1.1.5)
147
- minitest (5.25.1)
143
+ minitest (5.24.1)
148
144
  minitest-reporters (1.7.1)
149
145
  ansi
150
146
  builder
151
147
  minitest (>= 5.0)
152
148
  ruby-progressbar
153
149
  mutex_m (0.2.0)
154
- net-imap (0.5.0)
150
+ net-imap (0.4.14)
155
151
  date
156
152
  net-protocol
157
153
  net-pop (0.1.2)
@@ -161,27 +157,28 @@ GEM
161
157
  net-smtp (0.5.0)
162
158
  net-protocol
163
159
  nio4r (2.7.3)
164
- nokogiri (1.16.7-arm64-darwin)
160
+ nokogiri (1.16.7-x86_64-darwin)
165
161
  racc (~> 1.4)
166
- parallel (1.26.3)
167
- parser (3.3.6.0)
162
+ parallel (1.25.1)
163
+ parser (3.3.4.0)
168
164
  ast (~> 2.4.1)
169
165
  racc
170
166
  phlex (1.11.0)
171
167
  phlex-testing-capybara (0.1.0)
172
168
  capybara (~> 3.38)
173
169
  phlex (>= 0.5)
174
- psych (5.2.0)
170
+ psych (5.1.2)
175
171
  stringio
176
172
  public_suffix (6.0.1)
177
173
  racc (1.8.1)
178
- rack (3.1.8)
174
+ rack (3.1.7)
179
175
  rack-session (2.0.0)
180
176
  rack (>= 3.0.0)
181
177
  rack-test (2.1.0)
182
178
  rack (>= 1.3)
183
- rackup (2.2.0)
179
+ rackup (2.1.0)
184
180
  rack (>= 3)
181
+ webrick (~> 1.8)
185
182
  rails (7.1.3.4)
186
183
  actioncable (= 7.1.3.4)
187
184
  actionmailbox (= 7.1.3.4)
@@ -216,52 +213,57 @@ GEM
216
213
  rdoc (6.7.0)
217
214
  psych (>= 4.0.0)
218
215
  regexp_parser (2.9.2)
219
- reline (0.5.11)
216
+ reline (0.5.9)
220
217
  io-console (~> 0.5)
221
- rubocop (1.66.1)
218
+ rexml (3.3.2)
219
+ strscan
220
+ rubocop (1.64.1)
222
221
  json (~> 2.3)
223
222
  language_server-protocol (>= 3.17.0)
224
223
  parallel (~> 1.10)
225
224
  parser (>= 3.3.0.2)
226
225
  rainbow (>= 2.2.2, < 4.0)
227
- regexp_parser (>= 2.4, < 3.0)
228
- rubocop-ast (>= 1.32.2, < 2.0)
226
+ regexp_parser (>= 1.8, < 3.0)
227
+ rexml (>= 3.2.5, < 4.0)
228
+ rubocop-ast (>= 1.31.1, < 2.0)
229
229
  ruby-progressbar (~> 1.7)
230
230
  unicode-display_width (>= 2.4.0, < 3.0)
231
- rubocop-ast (1.34.0)
231
+ rubocop-ast (1.31.3)
232
232
  parser (>= 3.3.1.0)
233
- rubocop-performance (1.22.1)
233
+ rubocop-performance (1.21.1)
234
234
  rubocop (>= 1.48.1, < 2.0)
235
235
  rubocop-ast (>= 1.31.1, < 2.0)
236
236
  ruby-progressbar (1.13.0)
237
- sqlite3 (1.7.3-arm64-darwin)
238
- standard (1.41.1)
237
+ sqlite3 (1.7.3-x86_64-darwin)
238
+ standard (1.39.2)
239
239
  language_server-protocol (~> 3.17.0.2)
240
240
  lint_roller (~> 1.0)
241
- rubocop (~> 1.66.0)
241
+ rubocop (~> 1.64.0)
242
242
  standard-custom (~> 1.0.0)
243
- standard-performance (~> 1.5)
243
+ standard-performance (~> 1.4)
244
244
  standard-custom (1.0.2)
245
245
  lint_roller (~> 1.0)
246
246
  rubocop (~> 1.50)
247
- standard-performance (1.5.0)
247
+ standard-performance (1.4.0)
248
248
  lint_roller (~> 1.1)
249
- rubocop-performance (~> 1.22.0)
250
- stringio (3.1.2)
251
- thor (1.3.2)
249
+ rubocop-performance (~> 1.21.0)
250
+ stringio (3.1.1)
251
+ strscan (3.1.0)
252
+ thor (1.3.1)
252
253
  timeout (0.4.1)
253
254
  tzinfo (2.0.6)
254
255
  concurrent-ruby (~> 1.0)
255
- unicode-display_width (2.6.0)
256
+ unicode-display_width (2.5.0)
257
+ webrick (1.8.1)
256
258
  websocket-driver (0.7.6)
257
259
  websocket-extensions (>= 0.1.0)
258
260
  websocket-extensions (0.1.5)
259
261
  xpath (3.2.0)
260
262
  nokogiri (~> 1.8)
261
- zeitwerk (2.7.1)
263
+ zeitwerk (2.6.17)
262
264
 
263
265
  PLATFORMS
264
- arm64-darwin
266
+ x86_64-darwin
265
267
 
266
268
  DEPENDENCIES
267
269
  appraisal
@@ -270,7 +272,7 @@ DEPENDENCIES
270
272
  minitest
271
273
  minitest-reporters
272
274
  phlex-testing-capybara
273
- phlexi-field!
275
+ phlexi-form!
274
276
  rails (~> 7.1.3, >= 7.1.3.4)
275
277
  rake
276
278
  sqlite3 (~> 1.4)
@@ -23,7 +23,9 @@ module Phlexi
23
23
  def build_component_class
24
24
  return if attributes[:class] == false
25
25
 
26
- attributes[:class] = tokens(component_name, attributes[:class])
26
+ base_class = component_name
27
+ existing_class = attributes[:class]
28
+ attributes[:class] = existing_class ? "#{base_class} #{existing_class}" : base_class
27
29
  end
28
30
 
29
31
  def component_name
@@ -25,11 +25,6 @@ module Phlexi
25
25
  end
26
26
 
27
27
  def infer_field_type
28
- if object.class.respond_to?(:rich_text_association_names) &&
29
- object.class.rich_text_association_names.include?(:"rich_text_#{key}")
30
- return :rich_text
31
- end
32
-
33
28
  # Check attachments first since they are implemented as associations
34
29
  return :attachment if attachment_reflection
35
30
 
@@ -103,7 +98,6 @@ module Phlexi
103
98
  /^email/ => :email,
104
99
  /^search/ => :search,
105
100
  /phone|tel(ephone)?/ => :phone,
106
- /^datetime/ => :datetime,
107
101
  /^time/ => :time,
108
102
  /^date/ => :date,
109
103
  /^number|_count$|_amount$/ => :number,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Field
5
- VERSION = "0.0.11"
5
+ VERSION = "0.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-30 00:00:00.000000000 Z
11
+ date: 2025-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement