theo-rails 0.5.3 → 0.5.5

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: 8e0ab52b01e897648f607bf041e5359c2806e2b3e5c99ffd235bedd6b8b72409
4
- data.tar.gz: 634201a3d407430d17ae551a1e424d997468a1cdf9653d74197d7be55453a73e
3
+ metadata.gz: c7ed14054dfd1c349618931ab514f01d2323f7bc9c98b094aac578f0f6d29114
4
+ data.tar.gz: 523ff6151f634c9fa2da871dcf03cfe0577d9421d13948a9e3720dc2eac23247
5
5
  SHA512:
6
- metadata.gz: 7083141582de9a0c31441f847b5d2058f2bff0622caa14972b65377c8767811525ddbde2b172f4dafeec784633a09913aee9b2bf85cad07d0362dcb42bb442e0
7
- data.tar.gz: 6416d6961d28ae4ae105fad90ca2a3fb1478c19036ecbcd7179bd9ef3b802ef4a0a496a0fa841e185ce978dd39b28e050fb0b2a3b4aeb851f045a7502f340747
6
+ metadata.gz: 8848faf95e959da0ea2ab2b4ae3317f5e57d24391e0dd3f08bb92226beba3f78ff74dca3a9252d3b16887bacb019d61711ad934a72147a2ad09d4b9bee83f5bb
7
+ data.tar.gz: fcb59430ede7b8b87dbe4d7e93122cd715a85b26cffa5357eaa1da8c23a76063c2e85587905832c2f76cc8b3bdbcc20226c000e4b35648a846906d62a5455da4
@@ -0,0 +1,4 @@
1
+ <%# locals: (form: nil, name:, **attributes) -%>
2
+ <% form ||= inject(:form) %>
3
+
4
+ <%= form.hidden_field name, **attributes %>
@@ -16,9 +16,9 @@ module Theo
16
16
  ATTRIBUTES = /(?<attrs>(?:\s+#{ATTRIBUTE.source})*)/
17
17
  ATTRIBUTES_INCLUDING_DYNAMIC = /(?<attrs>(?:\s+(?:#{ATTRIBUTE.source}|#{DYNAMIC_ATTRIBUTE.source}))*)/
18
18
  TAG_WITH_DYNAMIC_ATTRIBUTE = /(?:<(?<tagname>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s+#{DYNAMIC_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*\/?>)/m
19
- SPECIAL_ATTRIBUTES = %i[%path %as %yields %collection %if].freeze
19
+ SPECIAL_ATTRIBUTES = %i[t-path t-as t-yields t-collection t-if %path %as %yields %collection %if].freeze
20
20
  VOID_TAGS = %i[area base br col embed hr img input link meta source track wbr]
21
- IF_SPECIAL_ATTRIBUTE = /(?<special>\s%if\s*=\s*#{attribute_value('specvalue')})/
21
+ IF_SPECIAL_ATTRIBUTE = /(?<special>\s(?:t-if|%if)\s*=\s*#{attribute_value('specvalue')})/
22
22
  TAG_WITH_IF_SPECIAL_ATTRIBUTE = /(?:<(?<tag>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*>.*?<\/\k<tag>>)|(?:<(?<tag>\w+)#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*\/>)|(?:<(?<tag>#{VOID_TAGS.join('|')})#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*#{IF_SPECIAL_ATTRIBUTE.source}#{ATTRIBUTES_INCLUDING_DYNAMIC.source}\s*>)/m
23
23
  PARTIAL_TAG = /(?:(?<partial>[A-Z]\w+)|(?<partial>_[\w-]+))/
24
24
  PARTIAL = /(?:<#{PARTIAL_TAG.source}#{ATTRIBUTES.source}\s*>(?<content>.*?)<\/\k<partial>>)|(?:<#{PARTIAL_TAG.source}#{ATTRIBUTES.source}\s*\/>)/m
@@ -88,12 +88,12 @@ module Theo
88
88
 
89
89
  attributes = process_attributes(attributes)
90
90
 
91
- path = attributes.delete(:'%path')
91
+ path = attributes.delete(:'t-path') || attributes.delete(:'%path')
92
92
 
93
- collection = attributes.delete(:'%collection')
94
- as = attributes.delete(:'%as')
93
+ collection = attributes.delete(:'t-collection') || attributes.delete(:'%collection')
94
+ as = attributes.delete(:'t-as') || attributes.delete(:'%as')
95
95
 
96
- yields = attributes.delete(:'%yields')
96
+ yields = attributes.delete(:'t-yields') || attributes.delete(:'%yields')
97
97
  yields = " |#{yields}|" if yields
98
98
 
99
99
  locals = attributes.empty? ? '' : attributes.map { |k, v| "'#{k}': #{v}" }.join(', ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarek Lipski
@@ -60,6 +60,7 @@ files:
60
60
  - app/views/application/_check_box.html.erb
61
61
  - app/views/application/_email_field.html.erb
62
62
  - app/views/application/_form_with.html.erb
63
+ - app/views/application/_hidden_field.html.erb
63
64
  - app/views/application/_image.html.erb
64
65
  - app/views/application/_label.html.erb
65
66
  - app/views/application/_number_field.html.erb