Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/react-chayns-selectlist/README.md
  • Loading branch information
michael-braun committed Jan 4, 2018
2 parents 21cf8a0 + c91964a commit 2d89f7c
Show file tree
Hide file tree
Showing 201 changed files with 13,437 additions and 3,299 deletions.
36 changes: 36 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"jquery": false,
"es6": true
},
"globals": {
"chayns": true,
"__DEV__": true,
"__QA__": true,
"__LIVE__": true
},
"parser": "babel-eslint",
"rules": {
"max-len": "off",
"linebreak-style": "off",
"indent": "off",
"strict": 0,
"comma-dangle": "off",
"import/no-extraneous-dependencies": "off",
"react/jsx-tag-spacing": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/no-danger": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"no-underscore-dangle": "off",
"jsx-a11y/href-no-hash": "off",
"array-callback-return": "off",
"arrow-body-style": "off",
"keyword-spacing": "off",
"jsx-a11y/label-has-for": "off",
"react/forbid-prop-types": [2, { "forbid": ["any"] }]
},
"extends": "airbnb"
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![npm](https://img.shields.io/npm/v/tobit-chayns_components.svg)](https://github.com/TobitSoftware/chayns-components/)
[![npm](https://img.shields.io/npm/v/chayns-components.svg)](https://github.com/TobitSoftware/chayns-components/)
[![license](https://img.shields.io/github/license/TobitSoftware/chayns-components.svg)](https://github.com/TobitSoftware/chayns-components/)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/TobitSoftware/chayns-components.svg)](https://github.com/TobitSoftware/chayns-components/)
[![hghfgh](https://img.shields.io/github/issues-pr-closed-raw/TobitSoftware/chayns-components.svg)](https://github.com/TobitSoftware/chayns-components/)
Expand All @@ -8,7 +8,7 @@

The ChaynsComponents can be installed directly from npm by using the following package:

npm install -S tobit-chayns_components@latest
npm install -S chayns-components@latest


## Chayns Components
Expand All @@ -31,6 +31,7 @@ The following components are part of this package:
| [react-chayns-selectbutton](/src/react-chayns-selectbutton/) | SelectButton Component | [Readme](/src/react-chayns-selectbutton/README.md) |
| [react-chayns-selectlist](/src/react-chayns-selectlist/) | SelectList Component | [Readme](/src/react-chayns-selectlist/README.md) |
| [react-chayns-emoji_input](/src/react-chayns-emoji_input/) | EmojiInput Component | [Readme](/src/react-chayns-emoji_input/README.md) |
| [react-chayns-amountcontrol](/src/react-chayns-amountcontrol/) | AmountControl Component | [Readme](/src/react-chayns-amountcontrol/README.md) |

## Additional Components

Expand Down
18 changes: 0 additions & 18 deletions copyPackageJson.js

This file was deleted.

18 changes: 18 additions & 0 deletions examples/ExampleContainer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';

const ExampleContainer = ({ headline, children, ...props }) => {
return (
<div className="content__card dark" {...props} style={{ margin: '20px 0' }}>
<h1>{headline}</h1>
{children}
</div>
);
};

ExampleContainer.propTypes = {
headline: PropTypes.string.isRequired,
children: PropTypes.node.isRequired
};

export default ExampleContainer;
11 changes: 0 additions & 11 deletions examples/Examples.jsx

This file was deleted.

4 changes: 4 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<body>
<div class="tapp">
<div id="react-chayns-accordion"></div>
<div id="react-chayns-amountcontrol"></div>
<div id="react-chayns-animations"></div>
<div id="react-chayns-button"></div>
<div id="react-chayns-checkbox"></div>
Expand All @@ -24,9 +25,12 @@
<div id="react-chayns-modeswitch"></div>
<div id="react-chayns-personfinder"></div>
<div id="react-chayns-radiobutton"></div>
<div id="react-chayns-scrollview"></div>
<div id="react-chayns-selectbutton"></div>
<div id="react-chayns-selectlist"></div>
<div id="react-chayns-setupwizard"></div>
<div id="react-chayns-sharingbar"></div>
<div id="react-chayns-smallwaitcursor"></div>
<div id="react-chayns-swiper"></div>
<div id="react-chayns-textarea"></div>
<div id="react-chayns-textstring"></div>
Expand Down
6 changes: 5 additions & 1 deletion examples/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './react-chayns-accordion/index';
import './react-chayns-amountcontrol/index';
import './react-chayns-animations/index';
import './react-chayns-button/index';
import './react-chayns-calendar/index';
Expand All @@ -10,10 +11,13 @@ import './react-chayns-input/index';
import './react-chayns-modeswitch/index';
import './react-chayns-personfinder/index';
import './react-chayns-radiobutton/index';
import './react-chayns-scrollview/index';
import './react-chayns-selectbutton/index';
import './react-chayns-selectlist/index';
import './react-chayns-setupwizard/index';
import './react-chayns-sharingbar/index';
import './react-chayns-smallwaitcursor/index';
import './react-chayns-swiper/index';
import './react-chayns-textarea/index';
import './react-chayns-textstring/index';
import './react-weather/index';
import './react-weather/index';
32 changes: 23 additions & 9 deletions examples/react-chayns-accordion/Example.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
import React from 'react';

import Accordion from "../../src/react-chayns-accordion/component/Accordion";
import { Accordion } from '../../src/index';
import ExampleContainer from '../ExampleContainer';

export default class Example extends React.Component {
constructor() {
super();
state = {
open: true
};

componentDidMount() {
window.setTimeout(() => {
this.setState({
open: false
});
}, 5000);
}

render() {
return(
<div>
<Accordion head="Test" badge="2">
<ExampleContainer headline="Accordion">
<Accordion head="Test" badge="2" open={this.state.open}>
<Accordion
head={<span style={{color: '#FF0000'}} className="accordion--trigger">
head={<span style={{ color: '#FF0000' }} className="accordion--trigger">
Test
</span>}
isWrapped
open
>

<div className="accordion__content">
Expand All @@ -27,13 +37,17 @@ export default class Example extends React.Component {
Hello World 2
</div>
</Accordion>
<Accordion head="Test" badge={<i className="fa fa-warning" />} isWrapped>
<Accordion head="Test" badge={<i className="fa fa-warning" />} badgeStyle={{ backgroundColor: 'red' }} isWrapped>
<div className="accordion__content">
Hello World 2
</div>
</Accordion>
</Accordion>
</div>

<Accordion head="Autogrow" autogrow>
<div style={{ height: '20000px', background: 'linear-gradient(0deg, red, yellow)' }} />
</Accordion>
</ExampleContainer>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/react-chayns-accordion/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDom from 'react-dom';

import Example from './Example.jsx';
import Example from './Example';

window.chayns.ready.then(() => {
ReactDom.render(
Expand Down
145 changes: 145 additions & 0 deletions examples/react-chayns-amountcontrol/Example.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import React from 'react';

import { AmountControl } from '../../src/index';
import '../../src/react-chayns-amountcontrol/shop.scss';
import ExampleContainer from '../ExampleContainer';
import Accordion from '../../src/react-chayns-accordion/component/Accordion';

export default class Example extends React.Component {
constructor() {
super();

this.state = {
amount: 1
};
}

onChange = (value) => {
this.setState({
amount: value
});
};

render() {
const { amount } = this.state;

return(
<ExampleContainer
headline="AmountControl Example"
data-equalize="group-1"
>
<AmountControl
autoInput
disabled={false}
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="0,15"
shopStyle
/>

<br />

<AmountControl
disabled={false}
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="mtl. 15,95 €"
/>

<br />

<AmountControl
disabled
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="test-article"
/>

<br />

<Accordion head={
<AmountControl
disabled={false}
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="0,15"
/>}
>
Test
</Accordion>

<br />

<AmountControl
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="mtl. 15,95 €"
disableInput
/>

<br />


<div style={{ display: 'flex', justifyContent: 'space-evenly' }}>
<AmountControl
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="mtl. 15,95 €"
disableRemove
/>

<AmountControl
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="mtl. 15,95 €"
disableAdd
/>

<AmountControl
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="mtl. 15,95 €"
disableAdd
disableRemove
/>
</div>

<AmountControl
amount={amount}
onChange={this.onChange}
buttonFormatHandler={({ amount: a }) => `${a} h`}
disableInput
/>

<br />

<AmountControl
amount={amount}
onChange={this.onChange}
buttonText="(Amount > 0) => Input"
showInput={amount > 0}
/>

<div style={{ textAlign: 'right' }}>
<AmountControl
autoInput
disabled={false}
amount={amount}
onChange={this.onChange}
equalize="group-1"
buttonText="0,15"
shopStyle
/>
</div>
</ExampleContainer>
);
}
}
11 changes: 11 additions & 0 deletions examples/react-chayns-amountcontrol/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDom from 'react-dom';

import Example from './Example';

window.chayns.ready.then(() => {
ReactDom.render(
<Example />,
document.querySelector('#react-chayns-amountcontrol')
);
});
Loading

0 comments on commit 2d89f7c

Please sign in to comment.