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 +4 -4
- data/lib/applin/rails/version.rb +1 -1
- data/lib/applin/rails.rb +20 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f4baaac83d2c5def4823290b5ef402575bb7eb1ee52bc80bb7c8f1ffaea4b4e
|
4
|
+
data.tar.gz: 16620a1a0ace304554362ac721b083c1487eab83cb6bde26b7ff68b382804376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 741179d035939f3936c966302d2902c54d402afd09664daad8c2de9298bb875c7d20bb2d3d455766c4e75480f5a4d432b7f9df117a1c7f038f2468f8bed30284
|
7
|
+
data.tar.gz: f9c61d68b0e09010f4c82ae6100bc321f8cac684c695b56c460c08444b13b1e3ac976c86d050b35191e4d90bd2d5589c0f3552e4103862ad62f236452e402039
|
data/lib/applin/rails/version.rb
CHANGED
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:,
|
51
|
-
{ typ: :column,
|
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:,
|
67
|
-
{ typ: :form_button,
|
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
|
-
|
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
|
-
|
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: :
|
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.
|
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-
|
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.
|