app_rail-steps 0.2.2 → 0.2.3

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: 1e76006e6ef3b5fafdaa50fc32aaeaab212bf70dfee24cfb6f905cdef1be3039
4
- data.tar.gz: c2e413b573460f167e06e83f4882c56d0001fbef9e8cac3b3751cd89477586ac
3
+ metadata.gz: 42519d84340141281c5aafa11a20c515f5be53567ebb6f53df920c6ac6870170
4
+ data.tar.gz: b665ddd40d4d904d676af85f7cee1cce6ed8e8e1a42e68420cfb7d80a04551e2
5
5
  SHA512:
6
- metadata.gz: 00c80403094689ce0fa611e24e12b870f484297387c048a6ca28a525dff8cc27118991c955589a9deb4c84cddfaab774a74ccf8b992d7637ae4b13ffa4d042ea
7
- data.tar.gz: 5b91a19cf979b9caf5dcd0ad1c43d816ef1a75b29617dd04c3b4770575b4ffe8c804b146d0741314749c84536ba5b6780953f48a3b968d864d8d13f0d5a69f91
6
+ metadata.gz: 1bf6eef1061548b2226b1d5b3f6428165f7443338101cdd5350b0fdc106d7e0a685c0598fe83d1075acbf59c33ba59a8d13ce1a95403de7c74cc2d461dd6ac00
7
+ data.tar.gz: ecb72f5f9271a9c97d661637898ef16edd4bb1eec847100188bc50553081bb821f7b286edd564a64c41d7db1cc4082764d4f7f4700b9a75a19313e03dd0e4b60
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.2)
4
+ app_rail-steps (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppRail
4
+ module Steps
5
+ module CoreForms
6
+ module Form
7
+ def ar_core_forms_form_section(label:, id:)
8
+ raise "Missing label" if label.nil?
9
+ raise "Missing id" if id.nil?
10
+
11
+ { item_type: :section, id: id, label: label }
12
+ end
13
+
14
+ def ar_core_forms_form_multiple_selection(label:, multiple_selection_options:, id:, selection_type: :single, optional: false, show_other_option: false)
15
+ raise "Missing label" if label.nil?
16
+ raise "Missing id" if id.nil?
17
+ raise "Missing multiple selection options" if multiple_selection_options.nil?
18
+
19
+ { item_type: :multiple_selection, id: id, label: label,
20
+ multiple_selection_options: multiple_selection_options, selection_type: selection_type, optional: optional, show_other_option: show_other_option }
21
+ end
22
+
23
+ def ar_core_forms_form_multiple_selection_options(text:, hint: nil, is_pre_selected: false)
24
+ raise "Missing text" if text.nil?
25
+
26
+ { text: text, hint: hint, isPreSelected: is_pre_selected }
27
+ end
28
+
29
+ def ar_core_forms_form_number(label:, id:, placeholder: nil, optional: false, symbol_position: :leading, default_text_answer: nil, hint: nil)
30
+ raise "Missing label" if label.nil?
31
+ raise "Missing id" if id.nil?
32
+
33
+ { item_type: :number, number_type: :number, id: id, label: label,
34
+ placeholder: placeholder, optional: optional, symbol_position: symbol_position, default_text_answer: default_text_answer, hint: hint }
35
+ end
36
+
37
+ def ar_core_forms_form_text(label:, id:, placeholder: nil, optional: false, multiline: false, default_text_answer: nil, hint: nil)
38
+ raise "Missing label" if label.nil?
39
+ raise "Missing id" if id.nil?
40
+
41
+ { item_type: :text, id: id, label: label, placeholder: placeholder,
42
+ optional: optional, multiline: multiline, default_text_answer: default_text_answer, hint: hint }
43
+ end
44
+
45
+ def ar_core_forms_form_date(label:, id:, optional: false, default_text_answer: nil)
46
+ raise "Missing label" if label.nil?
47
+ raise "Missing id" if id.nil?
48
+
49
+ { item_type: :date, date_type: :calendar, id: id, label: label, optional: optional,
50
+ default_text_answer: default_text_answer }
51
+ end
52
+
53
+ def ar_core_forms_form_time(label:, id:, optional: false, default_text_answer: nil)
54
+ raise "Missing label" if label.nil?
55
+ raise "Missing id" if id.nil?
56
+
57
+ { item_type: :time, id: id, label: label, optional: optional,
58
+ default_text_answer: default_text_answer }
59
+ end
60
+
61
+ def ar_core_forms_form_email(label:, id:, placeholder: nil, optional: false, default_text_answer: nil)
62
+ raise "Missing label" if label.nil?
63
+ raise "Missing id" if id.nil?
64
+
65
+ { item_type: :email, id: id, label: label, placeholder: placeholder,
66
+ optional: optional, default_text_answer: default_text_answer }
67
+ end
68
+
69
+ def ar_core_forms_form_password(label:, id:, placeholder: nil, optional: false, default_text_answer: nil, hint: nil)
70
+ raise "Missing label" if label.nil?
71
+ raise "Missing id" if id.nil?
72
+
73
+ { item_type: :secure, id: id, label: label, placeholder: placeholder,
74
+ optional: optional, default_text_answer: default_text_answer, hint: hint }
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "core/list"
4
+ require_relative "core_forms/form"
4
5
  require_relative "maps/map"
5
6
 
6
7
  module AppRail
7
8
  module Steps
8
9
  module Displayable
9
10
  include Steps::Core::List
11
+ include Steps::CoreForms::Form
10
12
  include Steps::Maps::Map
11
13
 
12
14
  BUTTON_STYLES = %i[primary outline danger textOnly].freeze
@@ -5,7 +5,8 @@ module AppRail
5
5
  module Maps
6
6
  module Map
7
7
  def ar_maps_map_item(text:, latitude:, longitude:, id: self.id, detail_text: nil)
8
- { id: id.to_s, text: text, latitude: latitude.to_f, longitude: longitude.to_f, detailText: detail_text }.compact
8
+ { id: id.to_s, text: text, latitude: latitude.to_f, longitude: longitude.to_f,
9
+ detailText: detail_text }.compact
9
10
  end
10
11
  end
11
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_rail-steps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
@@ -28,6 +28,7 @@ files:
28
28
  - app_rail-steps.gemspec
29
29
  - lib/app_rail/steps.rb
30
30
  - lib/app_rail/steps/core/list.rb
31
+ - lib/app_rail/steps/core_forms/form.rb
31
32
  - lib/app_rail/steps/displayable.rb
32
33
  - lib/app_rail/steps/maps/map.rb
33
34
  - lib/app_rail/steps/version.rb