app_rail-steps 0.2.16 → 0.3.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: d500e8081e8600e20549d14ebcbf13e4fa4d1fc838b909d07c727eb0c29e388a
4
- data.tar.gz: a7b9bc43c513fdb60505bf3da67d124e715fef139d1ecaa0ae82f132cf1e31fb
3
+ metadata.gz: cce94a73948469515a4b2a78253ea954eb1232dedc78bbc5dd8e216685f382cf
4
+ data.tar.gz: 711aeb3b88532e65962bffa56d4d2d5cb5d11227d2cef8e013c8aed6c427c24d
5
5
  SHA512:
6
- metadata.gz: 7ca1c468461b68616e91e52d934cb2b2a4eec8a907f9e2d4a2064cb26c59029ff01ad0616f6bb468219878a9fc53151f2a260fa025b00174b693f83c0b087cc8
7
- data.tar.gz: 07b91e1f0595504db72e615ef0976d79de63dcf5c4fa7e9f6b4e995b891934443fa7866dd8405f725caa83fda173ef13769a096a9ddb2daa7ea5af623fd38f08
6
+ metadata.gz: 3a6cf7398cb8155c48740b7c75118d0808d260b4934f21377672147a0a50b41b8340d27650f9f19aea88a754ebb9300ff66a647c56cce606437b5ceda6b9349c
7
+ data.tar.gz: 5b808f734cf36ba747b6a58aebd848bb1d7ce7915add23176158e749fb563af4bb95955ad41f030bebc566af2c4d1c18aac28f0ba0399efa246390085cdbcf8f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.15)
4
+ app_rail-steps (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -6,12 +6,16 @@ module AppRail
6
6
  module Stack
7
7
  CONTENT_MODE_OPTIONS = %i[scale_aspect_fill scale_aspect_fit].freeze
8
8
  IMAGE_STYLE_OPTIONS = %i[full_width profile].freeze
9
+ TEXT_STYLE_OPTIONS = %i[left large_center].freeze
9
10
  BUTTON_STYLES = %i[primary outline danger].freeze
10
11
  ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
11
12
 
12
- def ar_core_stack_text(text:, label: nil, sf_symbol_name: nil, material_icon_name: nil)
13
+ def ar_core_stack_text(text:, text_style: :left, label: nil, sf_symbol_name: nil, material_icon_name: nil)
14
+ validate_text_style!(text_style)
15
+
13
16
  {
14
17
  type: :text,
18
+ textStyle: camelcase_converter(text_style.to_s, first_letter: :lower),
15
19
  label: label,
16
20
  text: text.to_s,
17
21
  sfSymbolName: sf_symbol_name,
@@ -58,7 +62,7 @@ module AppRail
58
62
  materialIconName: material_icon_name }.compact
59
63
  end
60
64
 
61
- def ar_core_stack_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward, confirm_title: "Delete?", confirm_text: "Are you sure?", sf_symbol_name: :trash, material_icon_name: :delete)
65
+ def ar_core_stack_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward, confirm_title: "Delete", confirm_text: "Are you sure?", sf_symbol_name: :trash, material_icon_name: :delete)
62
66
  ar_core_stack_validate_on_success!(on_success)
63
67
  ar_core_stack_validate_button_style!(style)
64
68
 
@@ -122,6 +126,10 @@ module AppRail
122
126
  raise "Unknown image_style" unless IMAGE_STYLE_OPTIONS.include?(image_style)
123
127
  end
124
128
 
129
+ def validate_text_style!(text_style)
130
+ raise "Unknown text_style" unless TEXT_STYLE_OPTIONS.include?(text_style)
131
+ end
132
+
125
133
  def ar_core_stack_validate_on_success!(on_success)
126
134
  raise "Unknown on_success action" unless ON_SUCCESS_OPTIONS.include?(on_success)
127
135
  end
@@ -5,6 +5,7 @@ require_relative "core/stack"
5
5
  require_relative "core_forms/form"
6
6
  require_relative "core_forms/question"
7
7
  require_relative "maps/map"
8
+ require_relative "maps/confirm_location"
8
9
  require_relative "grid/grid"
9
10
  require_relative "charts/dashboard"
10
11
  require_relative "background_location/region"
@@ -17,6 +18,7 @@ module AppRail
17
18
  include Steps::CoreForms::Form
18
19
  include Steps::CoreForms::Question
19
20
  include Steps::Maps::Map
21
+ include Steps::Maps::ConfirmLocation
20
22
  include Steps::Grid::Grid
21
23
  include Steps::Charts::Dashboard
22
24
  include Steps::BackgroundLocation::Region
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppRail
4
+ module Steps
5
+ module Maps
6
+ module ConfirmLocation
7
+ def ar_maps_confirm_location(latitude:, longitude:, text:, detail_text: nil)
8
+ {
9
+ text: text,
10
+ latitude: latitude.to_f,
11
+ longitude: longitude.to_f,
12
+ detailText: detail_text
13
+ }.compact
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.16"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_rail-steps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-05 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -35,6 +35,7 @@ files:
35
35
  - lib/app_rail/steps/core_forms/question.rb
36
36
  - lib/app_rail/steps/displayable.rb
37
37
  - lib/app_rail/steps/grid/grid.rb
38
+ - lib/app_rail/steps/maps/confirm_location.rb
38
39
  - lib/app_rail/steps/maps/map.rb
39
40
  - lib/app_rail/steps/version.rb
40
41
  homepage: https://github.com/FutureWorkshops/app_rail-steps