form_props 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +8 -6
- data/lib/form_props/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cff106aa823f714feedeca5bcb60009c1e699fd3e5caf04213aff7b5453bebf1
|
|
4
|
+
data.tar.gz: dec35c8f4b7eaf8233b1dc5ba018b08d2d71275a9e5251e82c18c68190e8b10f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bfdfa243ba6534c73b837472bd1e9718b19ca0c99ecc7cc177389a6d4474c4042a634f5ac2a0f68e32484b6895e024b433266d7c670cda6199dfa0a82929154
|
|
7
|
+
data.tar.gz: 5afc0d65c6d09a6bbfde9c31dc9fc489499cfa69f489cd45626ebf4342da1bd1e8524ec4fab46af87d6778cef9fd445a2b45585d7462143298a113fc13efcb94
|
data/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Form Props
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
FormProps is a Rails form builder that outputs HTML attributes instead of tags.
|
|
6
|
+
Now you can enjoy the conviences of Rails helpers in other view libraries like
|
|
5
7
|
React, and React Native.
|
|
6
8
|
|
|
7
9
|
By separting attributes from tags, FormProps can offer greater flexbility than normal
|
|
@@ -68,7 +70,7 @@ would output
|
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
72
|
inputs: {
|
|
71
|
-
name:
|
|
73
|
+
title: {name: "post[title]", id: "post_title", type: "text", defaultValue: "hello"},
|
|
72
74
|
submit: {type: "submit", value: "Update a Post"}
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -84,8 +86,8 @@ export default ({props, inputs, extras}) => {
|
|
|
84
86
|
<form {...props}>
|
|
85
87
|
{Object.values(extras).map((hiddenProps) => (<input {...hiddenProps} type="hidden"/>))}
|
|
86
88
|
|
|
87
|
-
<input {...inputs.
|
|
88
|
-
<label for={inputs.
|
|
89
|
+
<input {...inputs.title} type="text"/>
|
|
90
|
+
<label for={inputs.title.id}>Your Name</label>
|
|
89
91
|
|
|
90
92
|
<input {...inputs.submit} type="submit"/>
|
|
91
93
|
</form>
|
|
@@ -190,7 +192,7 @@ By default, the `controlled` option is `false`.
|
|
|
190
192
|
|
|
191
193
|
###
|
|
192
194
|
|
|
193
|
-
`props` Attributes that you can splat
|
|
195
|
+
`props` Attributes that you can splat directly into your `<form>` element.
|
|
194
196
|
|
|
195
197
|
|
|
196
198
|
`extras` contain hidden input attributes that are created by form_props
|
data/lib/form_props/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: form_props
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Johny Ho
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 7.0.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: props_template
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|