applin-rails 0.1.0 → 0.2.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: 71496dc04565f772229aed6620f06fc3811dde1c27e79cbbaf633ab29ae0b68e
4
- data.tar.gz: 2ad83dab974f051d2a9f4e2786c2443a16440a3bb755925acb7bdb15a6dd8608
3
+ metadata.gz: 1f4baaac83d2c5def4823290b5ef402575bb7eb1ee52bc80bb7c8f1ffaea4b4e
4
+ data.tar.gz: 16620a1a0ace304554362ac721b083c1487eab83cb6bde26b7ff68b382804376
5
5
  SHA512:
6
- metadata.gz: ac763ea0188317507869791364a8fe36db1afe2608fc0518b51f308443e711f58cdc3e28d5965109dee438a83d69dace4cb0a331f639becf6b08c47689079dea
7
- data.tar.gz: 502953b3f347a3b5f31d2085c321ecfddfb0263ec7bbe8f279f70448b6095e250189790b164b59635d7a7c488c574f3e90295a424acbb0e42095aea53ef31477
6
+ metadata.gz: 741179d035939f3936c966302d2902c54d402afd09664daad8c2de9298bb875c7d20bb2d3d455766c4e75480f5a4d432b7f9df117a1c7f038f2468f8bed30284
7
+ data.tar.gz: f9c61d68b0e09010f4c82ae6100bc321f8cac684c695b56c460c08444b13b1e3ac976c86d050b35191e4d90bd2d5589c0f3552e4103862ad62f236452e402039
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Applin
4
4
  module Rails
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
data/lib/applin/rails.rb CHANGED
@@ -12,6 +12,9 @@ end
12
12
 
13
13
  module Applin
14
14
  module Rails
15
+ ALIGN_CENTER = "center"
16
+ ALIGN_END = "end"
17
+ ALIGN_START = "start"
15
18
  ALLOW_ALL = "all"
16
19
  ALLOW_ASCII = "ascii"
17
20
  ALLOW_EMAIL = "email"
@@ -37,18 +40,19 @@ module Applin
37
40
  { typ: :button, text: text, actions: actions }
38
41
  end
39
42
 
40
- def checkbox(text:, var_name:, actions: nil, initial_bool: nil)
43
+ def checkbox(text:, var_name:, actions: nil, initial_bool: nil, rpc: nil)
41
44
  {
42
45
  typ: :checkbox,
43
46
  actions: actions,
44
47
  initial_bool: initial_bool,
48
+ rpc: rpc,
45
49
  text: text,
46
50
  var_name: var_name,
47
51
  }.reject { |_k, v| v.nil? }
48
52
  end
49
53
 
50
- def column(widgets:, alignment: nil, spacing: nil)
51
- { typ: :column, alignment: alignment, spacing: spacing, widgets: widgets }.reject { |_k, v| v.nil? }
54
+ def column(widgets:, align: nil, spacing: nil)
55
+ { typ: :column, align: align, spacing: spacing, widgets: widgets }.reject { |_k, v| v.nil? }
52
56
  end
53
57
 
54
58
  def empty
@@ -63,8 +67,8 @@ module Applin
63
67
  { typ: :form, widgets: widgets }
64
68
  end
65
69
 
66
- def form_button(text:, actions:, alignment: nil)
67
- { typ: :form_button, alignment: alignment, text: text, actions: actions }.reject { |_k, v| v.nil? }
70
+ def form_button(text:, actions:, align: nil)
71
+ { typ: :form_button, align: align, text: text, actions: actions }.reject { |_k, v| v.nil? }
68
72
  end
69
73
 
70
74
  def form_section(widgets:, title: nil)
@@ -96,6 +100,14 @@ module Applin
96
100
  }.reject { |_k, v| v.nil? }
97
101
  end
98
102
 
103
+ def ok_modal_button(is_default: true)
104
+ modal_button(text: "OK", is_default: is_default, actions: [pop])
105
+ end
106
+
107
+ def cancel_modal_button(is_default: false)
108
+ modal_button(text: "Cancel", is_default: is_default, actions: [pop])
109
+ end
110
+
99
111
  def nav_button(text:, actions:, badge_text: nil, photo_url: nil, sub_text: nil)
100
112
  {
101
113
  typ: :nav_button,
@@ -148,7 +160,7 @@ module Applin
148
160
  poll_seconds: poll_seconds,
149
161
  text: text,
150
162
  title: title,
151
- modal_buttons: modal_buttons
163
+ widgets: modal_buttons
152
164
  }.reject { |_k, v| v.nil? }
153
165
  end
154
166
 
@@ -159,13 +171,13 @@ module Applin
159
171
  poll_seconds: poll_seconds,
160
172
  text: text,
161
173
  title: title,
162
- modal_buttons: modal_buttons
174
+ widgets: modal_buttons
163
175
  }.reject { |_k, v| v.nil? }
164
176
  end
165
177
 
166
178
  def nav_page(title:, start: nil, end_: nil, stream: nil, poll_seconds: nil, &widget_block)
167
179
  {
168
- typ: :plain_page,
180
+ typ: :nav_page,
169
181
  start: start,
170
182
  end: end_,
171
183
  title: title,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: applin-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Leonhard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create mobile apps using only backend code. Applin™ is a Server-Driven
14
14
  UI (SDUI) system.