ProMotion-form 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +88 -0
- data/lib/ProMotion/form/form.rb +127 -0
- data/lib/ProMotion/form/form_screen.rb +10 -0
- data/lib/ProMotion-form.rb +14 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fdb34e3528a33aab68173408ba3e7c2f5b2735db
|
4
|
+
data.tar.gz: 1f345f26ddb88c497cd0137e37d1f093b4c57894
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 00841a64207cb44d75860a80c5555ceef8eadb1a23391a33cc1a3e72dc1e091f308c06a1519da02e438d89f5fca67e59e413db95c256a74077b44af42e04d029
|
7
|
+
data.tar.gz: bc8a5cc57d688f114271720fc070045a70ae5e30230233442a71a6733906c88356dc824f575062a41162e6fb2189aebfbaa205f7ad31a77700ae6d3500d72660
|
data/README.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# ProMotion-form
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/ProMotion-form.svg)](http://badge.fury.io/rb/ProMotion-form) [![Build Status](https://travis-ci.org/clearsightstudio/ProMotion-form.svg)](https://travis-ci.org/clearsightstudio/ProMotion-form) [![Code Climate](https://codeclimate.com/github/clearsightstudio/ProMotion-form.png)](https://codeclimate.com/github/clearsightstudio/ProMotion-form)
|
4
|
+
|
5
|
+
ProMotion-form provides a PM::FormScreen for the
|
6
|
+
popular RubyMotion gem [ProMotion](https://github.com/clearsightstudio/ProMotion).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'ProMotion-form'
|
12
|
+
```
|
13
|
+
|
14
|
+
Then:
|
15
|
+
|
16
|
+
```sh-session
|
17
|
+
$ bundle
|
18
|
+
$ rake pod:install
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Easily create a form screen. Powered by the CocoaPod [FXForms](https://github.com/nicklockwood/FXForms).
|
24
|
+
|
25
|
+
*Has all the methods of PM::Screen*
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
class MyFormScreen < PM::FormScreen
|
29
|
+
title "My Form"
|
30
|
+
|
31
|
+
def form_data
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
### Why not Formotion?
|
39
|
+
|
40
|
+
We've used and like Formotion for some form-heavy apps, but it's a rather bulky gem. ProMotion-form works better with ProMotion and is a lot lighter.
|
41
|
+
|
42
|
+
---
|
43
|
+
|
44
|
+
### Methods
|
45
|
+
|
46
|
+
#### form_data
|
47
|
+
|
48
|
+
Method that is called to build the form.
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
def form_data
|
52
|
+
[]
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
All possible properties:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
{
|
60
|
+
label: "Name",
|
61
|
+
type: :string
|
62
|
+
}
|
63
|
+
```
|
64
|
+
|
65
|
+
#### update_form_data
|
66
|
+
|
67
|
+
Forces a reload of the form.
|
68
|
+
|
69
|
+
---
|
70
|
+
|
71
|
+
### Class Methods
|
72
|
+
|
73
|
+
None yet.
|
74
|
+
|
75
|
+
---
|
76
|
+
|
77
|
+
### Accessors
|
78
|
+
|
79
|
+
None yet.
|
80
|
+
|
81
|
+
## Contributing
|
82
|
+
|
83
|
+
1. Fork it
|
84
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
85
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
86
|
+
4. Make some specs pass
|
87
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
88
|
+
6. Create new Pull Request
|
@@ -0,0 +1,127 @@
|
|
1
|
+
module ProMotion
|
2
|
+
class Form
|
3
|
+
attr_accessor :form_data
|
4
|
+
|
5
|
+
def initialize(form_data)
|
6
|
+
@form_data = form_data
|
7
|
+
end
|
8
|
+
|
9
|
+
def fields
|
10
|
+
example_fields
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_fields
|
14
|
+
[
|
15
|
+
{
|
16
|
+
key: "email",
|
17
|
+
header: "Account"
|
18
|
+
},
|
19
|
+
"password",
|
20
|
+
"repeatPassword",
|
21
|
+
{
|
22
|
+
key: "name",
|
23
|
+
header: "Details",
|
24
|
+
"textField.autocapitalizationType" => UITextAutocapitalizationTypeWords
|
25
|
+
},
|
26
|
+
{
|
27
|
+
key: "gender",
|
28
|
+
options: [ "Male", "Female", "It's Complicated" ]
|
29
|
+
},
|
30
|
+
"dateOfBirth",
|
31
|
+
"profilePhoto",
|
32
|
+
"phone",
|
33
|
+
{
|
34
|
+
key: "country",
|
35
|
+
options: [ "us", "ca", "gb", "sa", "be"],
|
36
|
+
default: "us",
|
37
|
+
valueTransformer: ISO3166CountryValueTransformer.alloc.init
|
38
|
+
},
|
39
|
+
{
|
40
|
+
key: "language",
|
41
|
+
options: [ "English", "Spanish", "French", "Dutch" ],
|
42
|
+
default: "English",
|
43
|
+
cell: FXFormOptionPickerCell
|
44
|
+
},
|
45
|
+
{
|
46
|
+
key: "interests",
|
47
|
+
default: "Videogames",
|
48
|
+
options: [ "Videogames", "Animals", "Cooking" ]
|
49
|
+
},
|
50
|
+
{
|
51
|
+
key: "otherInterests",
|
52
|
+
type: :bitfield,
|
53
|
+
default: "InterestComputers",
|
54
|
+
options: [ "Computers", "Socializing", "Sports" ]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
key: "about",
|
58
|
+
type: :longtext,
|
59
|
+
placeholder: "Text..."
|
60
|
+
},
|
61
|
+
{
|
62
|
+
header: "Plan",
|
63
|
+
key: "plan",
|
64
|
+
title: "",
|
65
|
+
placeholder: "Free",
|
66
|
+
options: [ "Micro", "Normal", "Maxi" ],
|
67
|
+
cell: FXFormOptionSegmentsCell
|
68
|
+
},
|
69
|
+
{
|
70
|
+
key: "termsAndConditions",
|
71
|
+
header: "Legal"
|
72
|
+
},
|
73
|
+
"privacyPolicy",
|
74
|
+
{
|
75
|
+
key: "agreedToTerms",
|
76
|
+
title: "I Agree To These Terms",
|
77
|
+
type: :option
|
78
|
+
},
|
79
|
+
{
|
80
|
+
title: "Submit",
|
81
|
+
header: "",
|
82
|
+
action: "submitRegistrationForm:"
|
83
|
+
},
|
84
|
+
]
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# static NSString *const key = @"key";
|
91
|
+
# static NSString *const FXFormFieldType = @"type";
|
92
|
+
# static NSString *const FXFormFieldClass = @"class";
|
93
|
+
# static NSString *const cell = @"cell";
|
94
|
+
# static NSString *const title = @"title";
|
95
|
+
# static NSString *const placeholder = @"placeholder";
|
96
|
+
# static NSString *const default = @"default";
|
97
|
+
# static NSString *const options = @"options";
|
98
|
+
# static NSString *const FXFormFieldTemplate = @"template";
|
99
|
+
# static NSString *const valueTransformer = @"valueTransformer";
|
100
|
+
# static NSString *const action = @"action";
|
101
|
+
# static NSString *const FXFormFieldSegue = @"segue";
|
102
|
+
# static NSString *const header = @"header";
|
103
|
+
# static NSString *const FXFormFieldFooter = @"footer";
|
104
|
+
# static NSString *const FXFormFieldInline = @"inline";
|
105
|
+
# static NSString *const FXFormFieldSortable = @"sortable";
|
106
|
+
# static NSString *const FXFormFieldViewController = @"viewController";
|
107
|
+
|
108
|
+
# static NSString *const FXFormFieldTypeDefault = @"default";
|
109
|
+
# static NSString *const FXFormFieldTypeLabel = @"label";
|
110
|
+
# static NSString *const FXFormFieldTypeText = @"text";
|
111
|
+
# static NSString *const :longtext = @"longtext";
|
112
|
+
# static NSString *const FXFormFieldTypeURL = @"url";
|
113
|
+
# static NSString *const FXFormFieldTypeEmail = @"email";
|
114
|
+
# static NSString *const FXFormFieldTypePhone = @"phone";
|
115
|
+
# static NSString *const FXFormFieldTypePassword = @"password";
|
116
|
+
# static NSString *const FXFormFieldTypeNumber = @"number";
|
117
|
+
# static NSString *const FXFormFieldTypeInteger = @"integer";
|
118
|
+
# static NSString *const FXFormFieldTypeUnsigned = @"unsigned";
|
119
|
+
# static NSString *const FXFormFieldTypeFloat = @"float";
|
120
|
+
# static NSString *const :bitfield = @"bitfield";
|
121
|
+
# static NSString *const FXFormFieldTypeBoolean = @"boolean";
|
122
|
+
# static NSString *const :option = @"option";
|
123
|
+
# static NSString *const FXFormFieldTypeDate = @"date";
|
124
|
+
# static NSString *const FXFormFieldTypeTime = @"time";
|
125
|
+
# static NSString *const FXFormFieldTypeDateTime = @"datetime";
|
126
|
+
# static NSString *const FXFormFieldTypeImage = @"image";
|
127
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
unless defined?(Motion::Project::Config)
|
3
|
+
raise "ProMotion-form must be required within a RubyMotion project."
|
4
|
+
end
|
5
|
+
|
6
|
+
Motion::Project::App.setup do |app|
|
7
|
+
lib_dir_path = File.dirname(File.expand_path(__FILE__))
|
8
|
+
app.files << File.join(lib_dir_path, "ProMotion/form/form.rb")
|
9
|
+
app.files << File.join(lib_dir_path, "ProMotion/form/form_screen.rb")
|
10
|
+
|
11
|
+
app.pods do
|
12
|
+
pod "FXForms"
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ProMotion-form
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jamon Holmgren
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ProMotion
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: motion-stump
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: motion-redgreen
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Adds form screen support to ProMotion.
|
70
|
+
email:
|
71
|
+
- jamon@clearsightstudio.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- README.md
|
77
|
+
- lib/ProMotion-form.rb
|
78
|
+
- lib/ProMotion/form/form.rb
|
79
|
+
- lib/ProMotion/form/form_screen.rb
|
80
|
+
homepage: https://github.com/clearsightstudio/ProMotion-form
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata: {}
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 2.2.2
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: Adds PM::FormScreen support to ProMotion, similar to Formotion but lighter.
|
104
|
+
test_files: []
|
105
|
+
has_rdoc:
|