Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zzy authored and zzy committed Aug 21, 2017
0 parents commit 0bc7297
Show file tree
Hide file tree
Showing 37 changed files with 1,997 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*.{js,css}]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*.iml
*.log
*.log.*
.idea
.ipr
.iws
*~
~*
*.diff
*.patch
*.bak
.DS_Store
Thumbs.db
.project
.*proj
.svn
*.swp
*.swo
*.pyc
*.pyo
node_modules
.cache
*.css
build
lib
es
coverage
*.js
*.jsx
*.map
!tests/index.js
!/index*.js
ios/
android/
xcuserdata
yarn.lock
_ts2js
27 changes: 27 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"extends": "stylelint-config-standard",
"rules": {
at-rule-empty-line-before: null,
at-rule-name-space-after: null,
at-rule-no-unknown: null,
comment-empty-line-before: null,
declaration-bang-space-before: null,
declaration-empty-line-before: null,
function-comma-newline-after: null,
function-name-case: null,
function-parentheses-newline-inside: null,
function-max-empty-lines: null,
function-whitespace-after: null,
indentation: null,
number-leading-zero: null,
number-no-trailing-zeros: null,
rule-empty-line-before: null,
selector-combinator-space-after: null,
selector-list-comma-newline-after: null,
selector-pseudo-element-colon-notation: null,
unit-no-unknown: null,
value-list-max-empty-lines: null,
unit-case: null,
color-hex-case: null,
}
}
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
language: node_js

sudo: false

notifications:
email:
- [email protected]

node_js:
- 6.9.1

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
phantomjs --version
script:
- |
if [ "$TEST_TYPE" = test ]; then
npm test
else
npm run $TEST_TYPE
fi
env:
matrix:
- TEST_TYPE=lint
- TEST_TYPE=test
- TEST_TYPE=coverage


matrix:
allow_failures:
- env: "TEST_TYPE=saucelabs"
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# History
----

## 0.0.1 / 2017-08-10

- TODO
140 changes: 140 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# rmc-calendar
---

React Mobile Calendar Component (web and react-native)


[![NPM version][npm-image]][npm-url]
![react-native](https://img.shields.io/badge/react--native-%3E%3D_0.30.0-green.svg)
![react](https://img.shields.io/badge/react-%3E%3D_15.2.0-green.svg)
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![gemnasium deps][gemnasium-image]][gemnasium-url]
[![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/rmc-calendar.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rmc-calendar
[travis-image]: https://img.shields.io/travis/react-component/m-calendar.svg?style=flat-square
[travis-url]: https://travis-ci.org/react-component/m-calendar
[coveralls-image]: https://img.shields.io/coveralls/react-component/m-calendar.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/m-calendar?branch=master
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/m-calendar.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/react-component/m-calendar
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/rmc-calendar.svg?style=flat-square
[download-url]: https://npmjs.org/package/rmc-calendar

## Screenshots

<!-- <img src="https://os.alipayobjects.com/rmsportal/fOaDvpIJukLYznc.png" width="288"/> -->


## Development

```
npm i
npm start
```

## Example

http://localhost:8000/examples/

online example: http://react-component.github.io/m-calendar/

## react-native

```
./node_modules/rc-tools run react-native-init
npm run watch-tsc
react-native start
react-native run-ios
```

## install

[![rmc-calendar](https://nodei.co/npm/rmc-calendar.png)](https://npmjs.org/package/rmc-calendar)


# 4.x beta docs

## Usage
```jsx
<MultiPicker
selectedValue={this.state.value}
onValueChange={this.onChange}
>
<Picker indicatorClassName="my-picker-indicator">
<Picker.Item className="my-picker-view-item" value="1">one</Picker.Item>
<Picker.Item className="my-picker-view-item" value="2">two</Picker.Item>
<Picker.Item className="my-picker-view-item" value="3">three</Picker.Item>
<Picker.Item className="my-picker-view-item" value="4">four</Picker.Item>
<Picker.Item className="my-picker-view-item" value="5">five</Picker.Item>
<Picker.Item className="my-picker-view-item" value="6">six</Picker.Item>
<Picker.Item className="my-picker-view-item" value="7">seven</Picker.Item>
<Picker.Item className="my-picker-view-item" value="8">eight</Picker.Item>
</Picker>
<Picker indicatorClassName="my-picker-indicator">
<Picker.Item className="my-picker-view-item" value="11">eleven</Picker.Item>
<Picker.Item className="my-picker-view-item" value="12">twelve</Picker.Item>
<Picker.Item className="my-picker-view-item" value="13">thirteen</Picker.Item>
<Picker.Item className="my-picker-view-item" value="14">fourteen</Picker.Item>
<Picker.Item className="my-picker-view-item" value="15">fifteen</Picker.Item>
<Picker.Item className="my-picker-view-item" value="16">sixteen</Picker.Item>
<Picker.Item className="my-picker-view-item" value="17">seventeen</Picker.Item>
<Picker.Item className="my-picker-view-item" value="18">eighteen</Picker.Item>
</Picker>
</MultiPicker>
```

## API

### MultiPicker props

| name | description | type | default |
|----------|----------------|----------|--------------|
|className(web) | additional css class of root dom node | String | |
|prefixCls(web) | prefix class | String | '' |
|defaultSelectedValue(web) | default selected values | string[]/number[] | |
|selectedValue | current selected values | string[]/number[] | |
|onValueChange | fire when picker change | Function(value) | |


### Picker props

| name | description | type | default |
|----------|----------------|----------|--------------|
|className(web) | additional css class of root dom node | String | |
|prefixCls(web) | prefix class | String | '' |
|defaultSelectedValue(web) | default selected values | string/number | |
|selectedValue | current selected values | string/number | |
|onValueChange | fire when picker change | Function(value) | |
|disabled | whether picker is disabled | bool | false
|indicatorClassName | className of indicator | String |
|indicatorStyle | style of indicator | object |

### Picker.Item props
| name | description | type | default |
|----------|----------------|----------|--------------|
|className(web) | additional css class of root dom node | String | |
|value | value of item | String | |

## Test Case

```
npm test
npm run chrome-test
```

## Coverage

```
npm run coverage
```

open coverage/ dir

## License

rmc-calendar is released under the MIT license.
65 changes: 65 additions & 0 deletions assets/common/Animation.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.@{prefixClass} {

.animate {
animation-duration: .3s;
animation-fill-mode: both;
}

@keyframes fadeIn {
0% {
opacity: 0;
}

to {
opacity: 1;
}
}

@keyframes fadeOut {
0% {
opacity: 1;
}

to {
opacity: 0;
}
}

.fade-enter {
animation-name: fadeIn;
}

.fade-leave {
animation-name: fadeOut;
}

@keyframes slideInDown {
0% {
transform: translateZ(0);
visibility: visible;
}

to {
transform: translate3d(0, 100%, 0);
}
}

@keyframes slideInUp {
0% {
transform: translate3d(0, 100%, 0);
visibility: visible;
}

to {
transform: translateZ(0);
}
}

.slide-enter {
animation-name: slideInUp;
}

.slide-leave {
animation-name: slideInDown;
}
}
55 changes: 55 additions & 0 deletions assets/common/Calendar.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.@{prefixClass}.calendar {
.mask {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
background: rgba(0, 0, 0, .5);
}

.content {
position: fixed;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
background: #fff;
}

.header {
margin: 5px;
display: flex;
flex-shrink: 0;
align-items: center;

.close {
padding: 0 8px;
}

.title {
text-align: center;
width: 100%;
}

.left {
position: absolute;
left: 5px;
top: 5px;
}

.right {
position: absolute;
right: 5px;
top: 5px;
}
}

.timePicker {
border-top: 1px #ccc solid;
}
}
Loading

0 comments on commit 0bc7297

Please sign in to comment.