-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4750506
Showing
37 changed files
with
9,690 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { | ||
"node": "8" | ||
} | ||
} | ||
], | ||
"stage-2" | ||
], | ||
"plugins": ["transform-flow-strip-types"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
coverage | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "react-app", | ||
"rules": { | ||
"jsx-a11y/href-no-hash": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ignore] | ||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[options] | ||
esproposal.decorators=ignore | ||
unsafe.enable_getters_and_setters=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, gender identity and expression, level of | ||
experience, nationality, personal appearance, race, religion, or sexual identity | ||
and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, or to ban temporarily or permanently any | ||
contributor for other behaviors that they deem inappropriate, threatening, | ||
offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. The project | ||
team will review and investigate all complaints, and will respond in a way that | ||
it deems appropriate to the circumstances. The project team is obligated to | ||
maintain confidentiality with regard to the reporter of an incident. Further | ||
details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Contributing | ||
|
||
Thanks for your interest in contributing to 🏁 Final Form! Please take a moment | ||
to review this document **before submitting a pull request**. | ||
|
||
We are open to, and grateful for, any contributions made by the community. | ||
|
||
## Reporting issues and asking questions | ||
|
||
Before opening an issue, please search the | ||
[issue tracker](https://github.com/erikras/final-form/issues) to make sure your | ||
issue hasn’t already been reported. | ||
|
||
**We use the issue tracker to keep track of bugs and improvements** to 🏁 Final | ||
Form itself, its examples, and the documentation. We encourage you to open | ||
issues to discuss improvements, architecture, internal implementation, etc. If a | ||
topic has been discussed before, we will ask you to join the previous | ||
discussion. | ||
|
||
For support or usage questions, please search and ask on | ||
[StackOverflow with a `final-form` tag](https://stackoverflow.com/questions/tagged/final-form). | ||
We ask you to do this because StackOverflow has a much better job at keeping | ||
popular questions visible. Unfortunately good answers get lost and outdated on | ||
GitHub. | ||
|
||
**If you already asked at StackOverflow and still got no answers, post an issue | ||
with the question link, so we can either answer it or evolve into a bug/feature | ||
request.** | ||
|
||
## Sending a pull request | ||
|
||
**Please ask first before starting work on any significant new features.** | ||
|
||
It's never a fun experience to have your pull request declined after investing a | ||
lot of time and effort into a new feature. To avoid this from happening, we | ||
request that contributors create | ||
[an issue](https://github.com/erikras/final-form/issues) to first discuss any | ||
significant new features. | ||
|
||
Please try to keep your pull request focused in scope and avoid including | ||
unrelated commits. | ||
|
||
After you have submitted your pull request, we’ll try to get back to you as soon | ||
as possible. We may suggest some changes or improvements. | ||
|
||
Please format the code before submitting your pull request by running: | ||
|
||
``` | ||
npm run precommit | ||
``` | ||
|
||
## Coding standards | ||
|
||
Our code formatting rules are defined in | ||
[.eslintrc](https://github.com/erikras/final-form/blob/master/.eslintrc). You | ||
can check your code against these standards by running: | ||
|
||
```sh | ||
npm start lint | ||
``` | ||
|
||
To automatically fix any style violations in your code, you can run: | ||
|
||
```sh | ||
npm run precommit | ||
``` | ||
|
||
## Running tests | ||
|
||
You can run the test suite using the following commands: | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
Please ensure that the tests are passing when submitting a pull request. If | ||
you're adding new features to 🏁 Final Form, please include tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
👋 Hey, thanks for taking an interest in 🏁 Final Form! | ||
--> | ||
|
||
### Are you submitting a **bug report** or a **feature request**? | ||
|
||
<!-- For support request, please use Stack Overflow instead. This issue tracker is reserved for bugs and features. --> | ||
|
||
### What is the current behavior? | ||
|
||
<!-- If this is a bug, please include steps to reproduce and a minimal demo of the problem using Sandbox, Plunkr, WebpackBin or JSFiddle. --> | ||
|
||
### What is the expected behavior? | ||
|
||
### Sandbox Link | ||
|
||
<!-- Problems are much easier to understand and debug if they can be demonstrated in a minimal environment. --> | ||
|
||
### What's your environment? | ||
|
||
<!-- Include 🏁 Final Form version, OS/browser affected, Node version, etc. --> | ||
|
||
### Other information | ||
|
||
<!-- Include here any detailed explanation, stacktraces, related issues, links for Stack Overflow, Twitter, etc. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- | ||
👋 Hey, thanks for your interest in contributing to 🏁 Final Form! | ||
**Please ask first before starting work on any significant new features.** | ||
It's never a fun experience to have your pull request declined after investing a | ||
lot of time and effort into a new feature. To avoid this from happening, we | ||
request that contributors create an issue to first discuss any significant new | ||
features. | ||
Please try to keep your pull request focused in scope and avoid including | ||
unrelated commits. | ||
After you have submitted your pull request, we’ll try to get back to you as soon | ||
as possible. We may suggest some changes or improvements. | ||
Please format the code before submitting your pull request by running: | ||
``` | ||
npm run precommit | ||
``` | ||
https://github.com/erikras/final-form/blob/master/.github/CONTRIBUTING.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.vscode | ||
*.iml | ||
.nyc_output | ||
coverage | ||
flow-coverage | ||
node_modules | ||
dist | ||
lib | ||
es | ||
npm-debug.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
semi: false | ||
singleQuote: true | ||
trailingComma: none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '8' | ||
script: | ||
- npm start validate | ||
after_success: | ||
- npx codecov | ||
- npm install --global semantic-release | ||
# - semantic-release pre && npm publish && semantic-release post | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Erik Rasmussen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# 🏁 Final Form Arrays | ||
|
||
[](https://www.npmjs.com/package/final-form-arrays) | ||
[](https://www.npmjs.com/package/final-form-arrays) | ||
[](https://travis-ci.org/erikras/final-form-arrays) | ||
[](https://codecov.io/gh/erikras/final-form-arrays) | ||
[](https://github.com/prettier/prettier) | ||
|
||
Mutators for updating array fields in | ||
[🏁 Final Form](https://github.com/erikras/final-form). | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install --save final-form-arrays | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
yarn add final-form-arrays | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
import { createForm } from 'final-form' | ||
import arrayMutators from 'final-form-arrays' | ||
|
||
// Create Form | ||
const form = createForm({ | ||
mutators: { ...arrayMutators } | ||
onSubmit | ||
}) | ||
|
||
// push | ||
form.mutators.push('customers', { firstName: '', lastName: '' }) | ||
|
||
// pop | ||
const customer = form.mutators.pop('customers') | ||
``` | ||
|
||
## Table of Contents | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Mutators | ||
|
||
### `form.mutators.insert(name: string, index:number, value: any) => undefined` | ||
|
||
Inserts a value into the specified index of the array field. | ||
|
||
### `form.mutators.move(name: string, from: number, to: number) => undefined` | ||
|
||
Moves a value from one index to another index in the array field. | ||
|
||
### `form.mutators.pop(name: string) => any` | ||
|
||
Pops a value off the end of an array field. Returns the value. | ||
|
||
### `form.mutators.push(name: string, value: any) => void` | ||
|
||
Pushes a value onto the end of an array field. | ||
|
||
### `form.mutators.remove(name: string, index: number) => any` | ||
|
||
Removes a value from the specified index of the array field. Returns the removed | ||
value. | ||
|
||
### `form.mutators.shift(name: string) => any` | ||
|
||
Removes a value from the beginning of the array field. Returns the value. | ||
|
||
### `form.mutators.swap(name: string, indexA: number, indexB: number) => void` | ||
|
||
Swaps the position of two values in the array field. | ||
|
||
### `form.mutators.unshift(name: string, value: any) => void` | ||
|
||
Inserts a value onto the beginning of the array field. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.