asbru 0.0.15 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebf12b69b01b62d6dcbc52649220873833aee8f9f9e5fa02d7ebfc568612b3ca
4
- data.tar.gz: dfb5e1c9e02f4943c2f6e8a187c00b105756b08e64e60531a35307907618b227
3
+ metadata.gz: 897e4fe226d2e7b2c55b2d5c5875fb2d47a309c8c43ae48e663813cdcccefeaa
4
+ data.tar.gz: ce7b413c378968e9a5d584e57f55a9041fd3df24e83e450b83d425618f6d6bb6
5
5
  SHA512:
6
- metadata.gz: 36e7a3e6eb29ed8978569190fc086cafd983ced9e3669c77f8e1b4b4d3e9470f9634441bea50f8112cf37b050d9cf3054e47210dcd4ddf41a7d5ff6d4fecace1
7
- data.tar.gz: 682f6f031a738b95d31083d27ba11669b8dfdb161697d71bd67c14c5497d132d6d32724f43039c2213a01f395edc6d2e5d4058299f459e888b4198dbf1726f87
6
+ metadata.gz: 15a6b0bbf90b41b144c684a304e8231a5e1cd4ecbbb3e5f6966e5f501fd1e0d0be7bdaddb1f4e9a155b166cb26a30aa4edfc2c9506cd879922e16d7a9be6c004
7
+ data.tar.gz: 82b2578da569e55d13d8d4289100796ec1bada653bcc428bfbee9eecc19f52757a7d6fb0037b1d3ec66cd11b0ad6c476ac4999cd5ed8c0fa099bf2ee6af7e79e
@@ -24,18 +24,34 @@ module Asbru
24
24
  def ivaldi_form_with(**options, &block)
25
25
  asbru_form(**options, &block)
26
26
  end
27
- end
27
+ end
28
28
 
29
29
  BASIC_FORM_FIELDS = [
30
- { submit: { text: 'Submit', type: 'submit' } },
31
30
  { date_field: { type: 'datepicker' } },
32
31
  { password_field: { type: 'password' } },
33
32
  { text_area: { type: 'textarea' } },
34
33
  { email_field: { type: 'email' } },
35
34
  { check_box: { type: 'checkbox' } },
36
35
  { file_field: { type: 'file' } },
37
- { text_field: {} },
38
- { telephone_field: { type: 'tel'}}
36
+ { text_field: { type: 'text' } },
37
+ { telephone_field: { type: 'tel' } },
38
+ { text_editor:
39
+ {
40
+ type: 'text-editor',
41
+ toolbar: {
42
+ options: ['inline', 'list', 'link', 'history'],
43
+ inline: {
44
+ options: ['bold', 'italic', 'superscript', 'subscript'],
45
+ },
46
+ list: {
47
+ options: ['ordered', 'unordered'],
48
+ },
49
+ link: {
50
+ options: ['link'],
51
+ },
52
+ }
53
+ }
54
+ }
39
55
  ].freeze
40
56
 
41
57
  def errors(name)
@@ -121,10 +137,29 @@ module Asbru
121
137
  end
122
138
  end
123
139
 
124
- # def submit(attribute = nil, options = {})
125
- # render_form_element attribute,
126
- # options.reverse_merge(text: 'Submit', type: 'submit')
127
- # end
140
+ def submit(attribute = nil,
141
+ text: 'Submit',
142
+ type: 'submit',
143
+ **options)
144
+ options[:text] = text
145
+ options[:type] = type
146
+ options[:customData] = {} if options[:customData].nil?
147
+
148
+ if options.dig(:customData, :'data-disable').nil?
149
+ Rails.application
150
+ .config.action_view
151
+ .automatically_disable_submit_tag
152
+ .tap do |disable|
153
+ if disable == false
154
+ options[:customData][:'data-disable'] = false
155
+ else
156
+ options[:customData][:'data-disable'] = true
157
+ end
158
+ end
159
+ end
160
+
161
+ render_form_element attribute, options
162
+ end
128
163
 
129
164
  # def date_field(attribute = nil, options = {})
130
165
  # render_form_element attribute,
@@ -285,11 +320,7 @@ module Asbru
285
320
  end
286
321
 
287
322
  def tag_name_for(method, multiple = false)
288
- name = ActionView::Helpers::Tags::TextField.new(object_name,
289
- method, {})
290
- .send(:tag_name)
291
- name += '[]' if multiple
292
- name
323
+ field_name(method, multiple: multiple)
293
324
  end
294
325
  end
295
- end
326
+ end
data/lib/asbru/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asbru
2
- VERSION = '0.0.15'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asbru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Stev-0
7
+ - Nick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2023-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
19
+ version: '7.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: '5.2'
26
+ version: '7.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: react-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-configurable
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0'
69
69
  description: Creating component based webpages with short hand syntax.
70
70
  email:
71
- - skemp@adflow.io
71
+ - nick.rockx@remarkgroup.com
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []