Skip to content

Commit

Permalink
Merge 4812aa2 into 6130412
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly committed Jul 9, 2019
2 parents 6130412 + 4812aa2 commit ad5cefc
Show file tree
Hide file tree
Showing 89 changed files with 17,095 additions and 12,568 deletions.
Binary file removed .DS_Store
Binary file not shown.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: node_js
sudo: false

addons:
chrome: stable

node_js:
- "8"

Expand All @@ -11,11 +14,10 @@ cache:
directories:
- node_modules

# Make chrome browser available for testing
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
dist: xenial

services:
- xvfb

install:
- npm install -g yarn
Expand Down
15 changes: 11 additions & 4 deletions libs/component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
// 思路参考自Element React
import * as Nerv from 'nervjs'
import classnames from 'classnames'
import * as Nerv from 'nervjs'
import { CSSProperties } from 'react'

export default class Component<props, state> extends Nerv.Component<props, state> {
export default class Component<P, S> extends Nerv.Component<P & {
className?: string
style?: CSSProperties
}, S> {
constructor (...args) {
super(args[0], args[1])
}
classnames (...args): string {
return classnames(...args)
}
className (...args) {
const { className } = this.props
return this.classnames.apply(this, args.concat(className))
}
style (args): object {
style (args: object) {
const { style } = this.props
return {...args, ...style}
return {...args, ...(style as object)}
}
}
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "at-ui-nerv",
"version": "0.4.4-0",
"version": "0.4.36",
"description": "AT-UI for Nerv",
"main": "dist/at.nerv.js",
"scripts": {
Expand Down Expand Up @@ -48,6 +48,7 @@
"files": [
"dist/*",
"src",
"libs",
"typings"
],
"repository": {
Expand All @@ -64,14 +65,15 @@
},
"homepage": "https://github.com/NervJS/at-ui-nerv#readme",
"dependencies": {
"at-ui-style": "^1.5.0",
"classnames": "^2.2.5",
"copy-to-clipboard": "^3.0.8",
"popper.js": "^1.14.3",
"react-transition-group": "~2.3.1"
"@types/dom-inputevent": "1.0.4",
"at-ui-style": "1.5.0",
"classnames": "2.2.5",
"copy-to-clipboard": "3.0.8",
"popper.js": "1.14.3",
"react-transition-group": "2.3.1"
},
"peerDependencies": {
"nervjs": "^1.2.8"
"nervjs": "^1.4.3"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.38",
Expand All @@ -81,6 +83,7 @@
"@mapbox/jsxtreme-markdown-loader": "^0.7.0",
"@types/classnames": "^2.2.3",
"@types/jasmine": "^2.6.0",
"@types/react-dom": "^16.8.4",
"@types/react-transition-group": "^2.0.6",
"@types/sinon": "^2.3.3",
"@types/webpack-env": "^1.13.5",
Expand Down Expand Up @@ -132,8 +135,8 @@
"lerna": "^2.11.0",
"lint-staged": "^6.0.0",
"markdown-it-react-loader": "0.0.9",
"nerv-test-utils": "^1.2.5-beta.3",
"nervjs": "1.3.12",
"nerv-test-utils": "^1.4.3",
"nervjs": "^1.4.3",
"node-sass": "^4.9.1",
"ora": "^2.1.0",
"postcss": "^6.0.16",
Expand All @@ -147,7 +150,7 @@
"ts-loader": "^3.2.0",
"tslint": "^5.9.1",
"tslint-react": "^3.4.0",
"typescript": "^2.6.2",
"typescript": "3.5.2",
"url-loader": "^0.6.2",
"validate-commit-msg": "^2.14.0",
"webpack": "^3.12.0",
Expand Down
4 changes: 2 additions & 2 deletions site/components/headerS/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface HeaderProps {
}

class HeaderS extends Nerv.Component<HeaderProps, any> {
constructor (...args) {
super(...args)
constructor (props, context) {
super(props, context)
this.state = {
toggle: true
}
Expand Down
7 changes: 1 addition & 6 deletions site/view/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,26 @@
// render() {
// return (
// <div style={{ margin: '160px' }}>
// {}
// <Popover
// style={{ marginLeft: '200px', color: 'red' }}
// placement="top"
// title="Title"
// content="Top Placement"
// >
// {}
// <Button size="small">{}点击</Button>
// <Button size="small">点击</Button>
// </Popover>
// <Popover
// content="Top Placement"
// placement="left"
// title="Title"
// trigger="click"
// >
// {}
// 一段文字
// </Popover>
// <Popover content="Top Placement" title="Title" trigger="hover">
// {}
// 一段文字
// </Popover>
// <Popover content="Top Placement" title="Title" trigger="focus">
// {}
// 一段文字
// </Popover>
// <Popover trigger="hover" content="Top Placement">
Expand Down
24 changes: 10 additions & 14 deletions site/view/Steps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ class StepExample extends Nerv.Component<any, any> {
render () {
return (
<div style={{ width: '100%' }}>
<Steps current={this.state.current} style='margin-top:100px;'>
{}
<Steps current={this.state.current} style={{ marginTop: '100px' }}>
<Step
style='color:red;'
style={{
color: 'red'
}}
title='Step1'
description='This is a description.'
/>
Expand All @@ -55,43 +56,36 @@ class StepExample extends Nerv.Component<any, any> {
<Step title='Step4' />
</Steps>
<Steps current={this.state.current} status='error'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current} status='finish'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current} status='process'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current} status='wait'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current} size='small'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current} size='small' direction='vertical'>
{}
<Step title='Step1' description='This is a description.' />
<Step title='Step2' description='This is a description.' />
<Step title='Step3' />
</Steps>
<Steps current={this.state.current}>
{}
<Step
title='Step1'
description='This is a description.'
Expand All @@ -107,17 +101,19 @@ class StepExample extends Nerv.Component<any, any> {
<Button
onClick={this.minusHandler}
type='primary'
style='margin-top: 12px;'
style={{
marginTop: '12px'
}}
>
{}
Prev
</Button>
<Button
onClick={this.addHandler}
type='primary'
style='margin-top: 12px;'
style={{
marginTop: '12px'
}}
>
{}
Next
</Button>
</div>
Expand Down

0 comments on commit ad5cefc

Please sign in to comment.