Skip to content

Commit 40e3d2c

Browse files
committed
First commit
0 parents  commit 40e3d2c

16 files changed

+15578
-0
lines changed

.eslintrc.js

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
module.exports = {
2+
plugins: [
3+
'import',
4+
'react'
5+
],
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:react/recommended',
9+
'plugin:import/errors',
10+
'plugin:import/warnings'
11+
],
12+
env: {
13+
browser: true,
14+
commonjs: true,
15+
node: true,
16+
es6: true,
17+
},
18+
parser: 'babel-eslint',
19+
parserOptions: {
20+
ecmaVersion: '2018',
21+
sourceType: 'module',
22+
ecmaFeatures: {
23+
impliedStrict: true,
24+
jsx: true,
25+
},
26+
},
27+
rules: {
28+
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
29+
camelcase: ["error", { allow: ['^UNSAFE_'] }],
30+
'capitalized-comments': [
31+
'error',
32+
'always',
33+
{
34+
line: {
35+
ignorePattern: '.',
36+
ignoreConsecutiveComments: true,
37+
},
38+
block: {
39+
ignoreInlineComments: true,
40+
ignorePattern: 'ignored',
41+
},
42+
},
43+
],
44+
curly: ["error", "multi-line", "consistent"],
45+
indent: [
46+
'error',
47+
'tab',
48+
{
49+
SwitchCase: 1, // indent 'case' statements 1-tab
50+
MemberExpression: 'off' // eg: .then(...)
51+
}
52+
],
53+
'linebreak-style': ['error', 'unix'],
54+
'no-alert': 'error',
55+
'no-caller': 'error',
56+
'no-console': 0,
57+
'no-invalid-this': 'error',
58+
'no-param-reassign': 'error',
59+
'no-shadow': 'error',
60+
'no-use-before-define': ['error', { functions: false, classes: true }],
61+
'no-useless-return': 'error',
62+
'no-with': 'error',
63+
quotes: [
64+
'error',
65+
'single',
66+
{ allowTemplateLiterals: true, avoidEscape: true },
67+
],
68+
semi: ['error', 'never'],
69+
strict: ['error', 'global'],
70+
'vars-on-top': 'warn',
71+
},
72+
overrides: [
73+
{
74+
files: ['.eslintrc.js'],
75+
excludedFiles: [],
76+
rules: {
77+
'comma-dangle': ['error', 'never'],
78+
},
79+
},
80+
],
81+
}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/coverage
2+
/demo/dist
3+
/es
4+
/lib
5+
/node_modules
6+
/umd
7+
npm-debug.log*

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry="https://registry.npmjs.org/"

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sudo: false
2+
3+
language: node_js
4+
node_js:
5+
- 8
6+
7+
before_install:
8+
- npm install codecov.io coveralls
9+
10+
after_success:
11+
- cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
12+
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
13+
14+
branches:
15+
only:
16+
- master

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
# 0.1.0 (2019-01-01)
6+
7+
8+
### Bug Fixes
9+
10+
11+
### Features

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Prerequisites
2+
3+
[Node.js](http://nodejs.org/) >= 6 must be installed.
4+
5+
## Installation
6+
7+
- Running `npm install` in the component's root directory will install everything you need for development.
8+
9+
## Demo Development Server
10+
11+
- `npm start` will run a development server with the component's demo app at [http://localhost:3000](http://localhost:3000) with hot module reloading.
12+
13+
## Running Tests
14+
15+
- `npm test` will run the tests once.
16+
17+
- `npm run test:coverage` will run the tests and produce a coverage report in `coverage/`.
18+
19+
- `npm run test:watch` will run the tests on every change.
20+
21+
## Building
22+
23+
- `npm run build` will build the component for publishing to npm and also bundle the demo app.
24+
25+
- `npm run clean` will delete built resources.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Kevin Dalman
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# React Router Pause (Async)
2+
3+
[![npm package][npm-badge]][npm]
4+
[![gzip-size][gzip-size-badge]][gzip-size]
5+
[![install-size][install-size-badge]][install-size]
6+
[![build][build-badge]][build]
7+
[![coverage][coveralls-badge]][coveralls]
8+
[![license][license-badge]][license]
9+
[![donate][donate-badge]][donate]
10+
11+
---
12+
13+
- NPM: `npm install @allpro/react-router-pause`
14+
- Yarn: `yarn add @allpro/react-router-pause`
15+
- CDN: Exposed global is `ReactRouterPause`
16+
- Unpkg: `<script src="https://unpkg.com/@allpro/react-router-pause/umd/@allpro/react-router-pause.min.js"></script>`
17+
- JSDelivr: `<script src="https://cdn.jsdelivr.net/npm/@allpro/react-router-pause/umd/@allpro/react-router-pause.min.js"></script>`
18+
19+
---
20+
21+
22+
23+
24+
[gzip-size-badge]: http://img.badgesize.io/https://cdn.jsdelivr.net/npm/@allpro/react-router-pause/umd/@allpro/react-router-pause.min.js?compression=gzip
25+
[gzip-size]: http://img.badgesize.io/https://cdn.jsdelivr.net/npm/@allpro/react-router-pause/umd/@allpro/react-router-pause.min.js
26+
27+
[install-size-badge]: https://packagephobia.now.sh/badge?p=@allpro/react-router-pause
28+
[install-size]: https://packagephobia.now.sh/result?p=@allpro/react-router-pause
29+
30+
[npm-badge]: http://img.shields.io/npm/v/@allpro/react-router-pause.svg?style=flat-round
31+
[npm]: https://www.npmjs.com/package/@allpro/react-router-pause
32+
33+
[build-badge]: https://travis-ci.org/allpro/react-router-pause.svg?branch=master
34+
[build]: https://travis-ci.org/allpro/react-router-pause
35+
36+
[coveralls-badge]: https://coveralls.io/repos/github/allpro/react-router-pause/badge.svg?branch=master
37+
[coveralls]: https://coveralls.io/github/allpro/react-router-pause?branch=master
38+
39+
[license-badge]: https://badgen.now.sh/badge/license/MIT/blue
40+
[license]: https://github.com/allpro/form-manager/blob/master/LICENSE
41+
42+
[donate-badge]: https://img.shields.io/badge/Donate-PayPal-green.svg?style=flat-round
43+
[donate]: https://paypal.me/KevinDalman

commitlint.config.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// See: https://github.com/marionebl/commitlint/tree/master/@commitlint/config-conventional
2+
3+
module.exports = {
4+
extends: ['@commitlint/config-conventional'],
5+
rules: {
6+
'subject-case': [0, 'always'],
7+
'references-empty': [2, 'never'],
8+
'type-enum': [
9+
2,
10+
'always',
11+
[
12+
'build',
13+
'chore',
14+
'ci',
15+
'docs',
16+
'feat',
17+
'fix',
18+
'perf',
19+
'refactor',
20+
'revert',
21+
'style',
22+
'test',
23+
'wip'
24+
]
25+
]
26+
},
27+
parserPreset: {
28+
parserOpts: {
29+
issuePrefixes: ['ALLPRO-'],
30+
referenceActions: null
31+
}
32+
}
33+
};

demo/src/index.js

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import React, { Component, Fragment } from 'react'
2+
import { render } from 'react-dom'
3+
import PropTypes from 'prop-types'
4+
5+
import AppBar from '@material-ui/core/AppBar'
6+
import Tabs from '@material-ui/core/Tabs'
7+
import Tab from '@material-ui/core/Tab'
8+
import Typography from '@material-ui/core/Typography'
9+
10+
import LongFormClass from './LongForm'
11+
import LongFormHook from './LongForm/Hook'
12+
import LogFormData from './LogFormData'
13+
14+
const { array, element, oneOfType } = PropTypes
15+
16+
function TabContainer( props ) {
17+
return (
18+
<div style={{ padding: '0', border: '1px solid rgba(0,0,0,0.14)' }}>
19+
{props.children}
20+
</div>
21+
)
22+
}
23+
24+
TabContainer.propTypes = {
25+
children: oneOfType([ array, element ])
26+
}
27+
28+
29+
class FormManagerDemos extends Component {
30+
state = {
31+
currentTab: 0
32+
}
33+
34+
onChangeTab = ( event, currentTab ) => {
35+
this.setState({ currentTab }) // eslint-disable-line
36+
}
37+
38+
render() {
39+
const { currentTab } = this.state
40+
41+
return (
42+
<Fragment>
43+
<Typography variant="headline" style={{ margin: '10px' }}>
44+
Form Manager Examples
45+
</Typography>
46+
47+
<AppBar position="static" color="default">
48+
<Tabs
49+
value={currentTab}
50+
onChange={this.onChangeTab}
51+
indicatorColor="primary"
52+
textColor="primary"
53+
variant="scrollable"
54+
scrollButtons="auto"
55+
>
56+
<Tab label="Class Form" />
57+
<Tab label="Hooks Form" />
58+
<Tab label="Fields Test Output" />
59+
</Tabs>
60+
</AppBar>
61+
62+
{currentTab === 0 && (
63+
<TabContainer><LongFormClass /></TabContainer>
64+
)}
65+
{currentTab === 1 && (
66+
<TabContainer><LongFormHook /></TabContainer>
67+
)}
68+
{currentTab === 2 && (
69+
<TabContainer><LogFormData /></TabContainer>
70+
)}
71+
</Fragment>
72+
)
73+
}
74+
}
75+
76+
77+
render(<FormManagerDemos />, document.querySelector('#demo'))

nwb.config.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const puppeteer = require('puppeteer')
2+
process.env.CHROME_BIN = puppeteer.executablePath()
3+
4+
module.exports = {
5+
type: 'react-component',
6+
npm: {
7+
esModules: true,
8+
umd: {
9+
global: 'ReactRouterPause',
10+
externals: {
11+
react: 'React',
12+
},
13+
},
14+
},
15+
karma: {
16+
browsers: ['ChromeHeadless'],
17+
// transports: ['polling'],
18+
extra: {
19+
customLaunchers: {
20+
ChromeHeadless: {
21+
base: 'Chrome',
22+
flags: [
23+
'--headless',
24+
'--disable-gpu',
25+
'--no-sandbox',
26+
// If no remote debugging port, Chrome exits immediately
27+
'--remote-debugging-port=9222',
28+
],
29+
},
30+
},
31+
},
32+
},
33+
}

0 commit comments

Comments
 (0)