form_props 0.0.1 → 0.0.2

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: 4679a4eb6f011a9769e059c9516dcdba626c5fc19082858c2da895ce564b7832
4
- data.tar.gz: ab7a23b584b3f0c82f4d73c06b9f10af13e758448ee9c14f606e50d9d7d4701c
3
+ metadata.gz: cff106aa823f714feedeca5bcb60009c1e699fd3e5caf04213aff7b5453bebf1
4
+ data.tar.gz: dec35c8f4b7eaf8233b1dc5ba018b08d2d71275a9e5251e82c18c68190e8b10f
5
5
  SHA512:
6
- metadata.gz: d9647979c20fec9abc688d4dcdfcc827627b057c7d6a0bc72359e067419358ab95baa656e9bf0445afb9e2467aa4846eae200616da1e5aedf4ed554b1253855c
7
- data.tar.gz: fdb9166102654f8e5e4df47ed2a979ce036422b581c8525b586a1d0590a0646c3de7247887785f39488187e0398a9a4645f09ca643a80ef8c800fb1ea19007a7
6
+ metadata.gz: 3bfdfa243ba6534c73b837472bd1e9718b19ca0c99ecc7cc177389a6d4474c4042a634f5ac2a0f68e32484b6895e024b433266d7c670cda6199dfa0a82929154
7
+ data.tar.gz: 5afc0d65c6d09a6bbfde9c31dc9fc489499cfa69f489cd45626ebf4342da1bd1e8524ec4fab46af87d6778cef9fd445a2b45585d7462143298a113fc13efcb94
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # Form Props
2
2
 
3
- FormProps is a Rails form builder that outputs input attributes (in JSON) instead of
4
- tags. Now you can enjoy the conviences of Rails helpers in other view libraries like
3
+ ![Build Status](https://github.com/github/docs/actions/workflows/build.yml/badge.svg?branch=main)
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: {type: "text", defaultValue: "hello"},
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.name} type="text"/>
88
- <label for={inputs.name.id}>Your Name</label>
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 direclty into your `<form>` element.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FormProps
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
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.1
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-06-30 00:00:00.000000000 Z
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: props_tempate
42
+ name: props_template
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="