+
{ children }
)
diff --git a/components/popper/style/index.js b/components/popper/style/index.js
new file mode 100644
index 000000000..63810a681
--- /dev/null
+++ b/components/popper/style/index.js
@@ -0,0 +1 @@
+import './index.scss'
diff --git a/components/popper/index.scss b/components/popper/style/index.scss
similarity index 53%
rename from components/popper/index.scss
rename to components/popper/style/index.scss
index 4afa49dcc..1db4d49b9 100644
--- a/components/popper/index.scss
+++ b/components/popper/style/index.scss
@@ -1,7 +1,7 @@
.hi-popper__container {
position: absolute;
- .hide {
- display: none;
+ &--hide {
+ display: none !important;
}
-}
\ No newline at end of file
+}
diff --git a/components/progress/BarProgress.js b/components/progress/BarProgress.js
new file mode 100644
index 000000000..0a6581763
--- /dev/null
+++ b/components/progress/BarProgress.js
@@ -0,0 +1,42 @@
+import React from 'react'
+export const BarProgress = (props) => {
+ function getWidth () {
+ if (!props.width || props.width <= 0) {
+ return props.size === 'big' ? 480 : 160
+ }
+ return props.width
+ }
+
+ function getHeight () {
+ const {size, height} = props
+ if (!height || height <= 0) {
+ return size === 'big' ? 8 : (size === 'middle' ? 6 : 2)
+ }
+ return height
+ }
+
+ let prefix = 'hi-progress'
+ const {percent: percentNum, text, status, withOutText = false, inside = false, tooltip = null} = props
+ const percent = percentNum > 0 ? percentNum : 0
+ return (
+
+
+
+ {(!withOutText && inside && getHeight() >= 14) &&
+ {text || `${percent}%`}
+
}
+ {tooltip}
+
+
+ {(!withOutText && !inside) &&
+ {text || `${percent}%`}
+
}
+
+ )
+}
diff --git a/components/progress/CircleProgress.js b/components/progress/CircleProgress.js
new file mode 100644
index 000000000..a1749b87e
--- /dev/null
+++ b/components/progress/CircleProgress.js
@@ -0,0 +1,35 @@
+import React from 'react'
+export const CircleProgress = (props) => {
+ let prefix = 'hi-progress'
+ const {percent: percentNum, text, status, radius: radiusThis, withOutText = false} = props
+ const percent = percentNum > 0 ? percentNum : 0
+ const radius = radiusThis > 0 ? radiusThis : 40
+ const totalRadiusWidth = radius + 10
+ const strokeDash = radius * 2 * Math.PI
+ return (
+
+
+ {!withOutText &&
+ {text || `${percent}%`}
+
}
+
+ )
+}
diff --git a/components/progress/DashboardProgress.js b/components/progress/DashboardProgress.js
new file mode 100644
index 000000000..3af42fd08
--- /dev/null
+++ b/components/progress/DashboardProgress.js
@@ -0,0 +1,51 @@
+import React from 'react'
+export const DashboardProgress = (props) => {
+ let prefix = 'hi-progress'
+ const {percent: percentNum, text, status, radius: radiusThis, withOutText = false} = props
+ const percent = percentNum > 0 ? percentNum : 0
+ const radius = radiusThis > 0 ? radiusThis : 40
+ const totalRadiusWidth = radius + 10
+ const strokeDash = radius * 2 * Math.PI
+ const openWidth = 70
+ const pathString = `M ${totalRadiusWidth},${totalRadiusWidth} m 0,${radius}
+ a ${radius},${radius} 0 1 1 0,-${2 * radius}
+ a ${radius},${radius} 0 1 1 0,${2 * radius}`
+ const trailPathStyle = {
+ strokeDasharray: `${strokeDash - openWidth}px ${strokeDash}px`,
+ strokeDashoffset: `-${openWidth / 2}px`,
+ transition: 'stroke-dashoffset 0.3s ease 0s, stroke 0.3s ease'
+ }
+ const strokePathStyle = {
+ strokeDasharray: `${(percent / 100) * (strokeDash - openWidth)}px ${strokeDash}px`,
+ strokeDashoffset: `-${openWidth / 2}px`,
+ transition: 'stroke-dashoffset 0.3s ease 0s, stroke 0.3s ease',
+ fill: '#fff'
+ }
+ return (
+
+
+ {!withOutText &&
+ {text || `${percent}%`}
+
}
+
+ )
+}
diff --git a/components/progress/index.js b/components/progress/index.js
new file mode 100644
index 000000000..9f45c77d5
--- /dev/null
+++ b/components/progress/index.js
@@ -0,0 +1,48 @@
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+import './style'
+import {BarProgress} from './BarProgress.js'
+import {CircleProgress} from './CircleProgress.js'
+import {DashboardProgress} from './DashboardProgress'
+
+class Progress extends Component {
+ static propTypes = {
+ type: PropTypes.string,
+ status: PropTypes.oneOf(['success', 'warn', 'error', 'primary']),
+ percent: PropTypes.number,
+ width: PropTypes.number,
+ height: PropTypes.number,
+ tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
+ text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
+ size: PropTypes.oneOf(['big', 'middle', 'small'])
+ }
+ static defaultProps = {
+ size: 'big',
+ percent: 0,
+ radius: 40,
+ status: 'primary'
+ }
+
+ getRenderType (type) {
+ switch (type) {
+ case 'circle':
+ return
+ case 'dashboard':
+ return
+ default:
+ return
+ }
+ }
+
+ render () {
+ let prefix = 'hi-progress'
+ const {className = '', type} = this.props
+
+ return (
+
+ {this.getRenderType(type)}
+
+ )
+ }
+}
+export default Progress
diff --git a/components/progress/style/index.js b/components/progress/style/index.js
new file mode 100644
index 000000000..63810a681
--- /dev/null
+++ b/components/progress/style/index.js
@@ -0,0 +1 @@
+import './index.scss'
diff --git a/components/progress/style/index.scss b/components/progress/style/index.scss
new file mode 100644
index 000000000..43d5fb279
--- /dev/null
+++ b/components/progress/style/index.scss
@@ -0,0 +1,133 @@
+$progress-bg: #f2f2f2;
+$progress-primary: #3b76dc;
+$progress-success: #1da653;
+$progress-warn: #eb5252;
+$progress-error: #e19d0c;
+$progress-text: #666;
+
+.hi-progress {
+
+ &__inner {
+ background-color: $progress-bg;
+ border-radius: 9px;
+ position: relative;
+ overflow: hidden;
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ &__bar {
+ height: 100%;
+ display: block;
+ position: relative;
+ background-color: $progress-primary;
+ transition: width 0.4s cubic-bezier(0.3, 0, 0.7, 1);
+ }
+
+ &__bar-success {
+ background-color: $progress-success;
+ }
+
+ &__bar--warn {
+ background-color: $progress-warn;
+ }
+
+ &__bar--error {
+ background-color: $progress-error;
+ }
+
+ &__text {
+ padding-left: 25px;
+ font-size: 14px;
+ color: $progress-text;
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ &__text--inside {
+ font-size: 14px;
+ color: #fff;
+ position: absolute;
+ right: 5px;
+ top: 50%;
+ transform: translatey(-50%);
+ line-height: 14px;
+ }
+
+ &__text--success {
+ color: $progress-success;
+ }
+
+ &__text--warn {
+ color: $progress-warn;
+ }
+
+ &__text--error {
+ color: $progress-error;
+ }
+
+ &__svg {
+ position: relative;
+
+ .hi-progress__text {
+ display: block;
+ position: absolute;
+ width: 100%;
+ text-align: center;
+ line-height: 1;
+ top: 50%;
+ transform: translatey(-50%);
+ left: 0;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ }
+
+ &__svgbackground {
+ fill: none;
+ stroke: #e9e9e7;
+ stroke-width: 6;
+ }
+
+ &__circle {
+ fill: none;
+ stroke: $progress-primary;
+ stroke-width: 6;
+ transform: rotate(-90deg);
+ transform-origin: 50% 50%;
+ transition: stroke-dashoffset 0.4s cubic-bezier(0.3, 0, 0.7, 1);
+ }
+
+ &__circle--success {
+ stroke: $progress-success;
+ }
+
+ &__circle--warn {
+ stroke: $progress-warn;
+ }
+
+ &__circle--error {
+ stroke: $progress-error;
+ }
+
+ &__dashboard {
+ fill: none;
+ stroke: $progress-primary;
+ stroke-width: 6;
+ transition: stroke-dasharray 0.4s cubic-bezier(0.3, 0, 0.7, 1);
+ }
+
+ &__dashboard--success {
+ stroke: $progress-success;
+ }
+
+ &__dashboard--warn {
+ stroke: $progress-warn;
+ }
+
+ &__dashboard--error {
+ stroke: $progress-error;
+ }
+}
diff --git a/components/radio/index.js b/components/radio/index.js
index 55ea91aba..0b46e51ee 100755
--- a/components/radio/index.js
+++ b/components/radio/index.js
@@ -2,6 +2,7 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Button from '../button/index'
+import './style/index'
const parse = (checked, list, disabled) => {
let _checked = -1
diff --git a/components/radio/style/index.scss b/components/radio/style/index.scss
index badc0d694..75fe9af66 100644
--- a/components/radio/style/index.scss
+++ b/components/radio/style/index.scss
@@ -1,117 +1,141 @@
.hi-radio {
- display: inline-block;
- height: 32px;
- line-height: 32px;
- .input-group {
- position: relative;
- font-size: 0;
- user-select: none;
- > span {
- font-size: 14px;
- }
- .radio-input {
- margin-right: 4px;
- }
- .hi-radio-origin-input {
- position: absolute;
- top: 0;
- left: 0;
- opacity: 0;
- }
- .hi-raido-simulation-input {
- width: 16px;
- height: 16px;
- border-radius: 50%;
- border: 1px solid #D8D8D8;
- display: inline-block;
- box-sizing: border-box;
- vertical-align: sub;
- position: relative;
- }
- &.checked {
- .hi-raido-simulation-input {
- &::before {
- content: "";
- display: inline-block;
- width: 16px;
- height: 16px;
- transform: scale(0.7);
- background: #4284F5;
- border-radius: 50%;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.5);
- }
- }
- button {
- color: #4284F5;
- background: rgba(66,132,245,0.10);
- border: 1px solid #A8C6FB;
- }
- }
- &.disabled {
- cursor: not-allowed;
- color: #D8D8D8;
- .hi-raido-simulation-input {
- &::before{
- background: #D8D8D8;
- }
- }
- }
- &.input-group-vertical {
- display: block;
- margin: 4px;
- }
- &.first-radio {
- .hi-btn {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- }
- }
- &.after-radio {
- margin-left: -1px;
- .hi-btn {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
- }
- &.middle-radio {
- .hi-btn {
- border-radius: 0;
- }
- }
- &.input-group-button-vertical {
- display: block;
- &.first-radio {
- .hi-btn {
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- }
- }
- &.after-radio {
- margin-top: -1px;
- margin-left: 0;
- .hi-btn {
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
- }
- &.middle-radio {
- .hi-btn {
- border-radius: 0;
- }
- }
- }
- button.hi-btn {
- position: relative;
- &:hover {
- z-index:1;
+ display: inline-block;
+ height: 32px;
+ line-height: 32px;
+
+ .input-group {
+ position: relative;
+ font-size: 0;
+ user-select: none;
+
+ >span {
+ font-size: 14px;
+ }
+
+ .radio-input {
+ margin-right: 4px;
+ }
+
+ .hi-radio-origin-input {
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0;
+ }
+
+ .hi-raido-simulation-input {
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ border: 1px solid #D8D8D8;
+ display: inline-block;
+ box-sizing: border-box;
+ vertical-align: sub;
+ position: relative;
+ }
+
+ &.checked {
+ .hi-raido-simulation-input {
+ &::before {
+ content: "";
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ transform: scale(0.7);
+ background: #4284F5;
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ }
}
- }
-
- }
- .label {
- padding: 0 16px 0 0;
- }
+
+ button {
+ color: #4284F5;
+ background: rgba(66, 132, 245, 0.10);
+ border: 1px solid #A8C6FB;
+ }
+
+ }
+
+ &.disabled {
+ cursor: not-allowed;
+ color: #D8D8D8;
+
+ .hi-raido-simulation-input {
+ &::before {
+ background: #D8D8D8;
+ }
+ }
+ }
+
+ &.input-group-vertical {
+ display: block;
+ margin: 4px;
+ }
+
+ &.first-radio {
+ .hi-btn {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ }
+
+ &.after-radio {
+ margin-left: -1px;
+
+ .hi-btn {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ }
+ }
+
+ &.middle-radio {
+ .hi-btn {
+ border-radius: 0;
+ }
+ }
+
+ &.input-group-button-vertical {
+ display: block;
+
+ &.first-radio {
+ .hi-btn {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ }
+
+ &.after-radio {
+ margin-top: -1px;
+ margin-left: 0;
+
+ .hi-btn {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ }
+ }
+
+ &.middle-radio {
+ .hi-btn {
+ border-radius: 0;
+ }
+ }
+ }
+
+ button.hi-btn {
+ position: relative;
+
+ &:hover {
+ z-index: 1;
+ }
+ }
+
+ }
+
+ .label {
+ padding: 0 16px 0 0;
+ }
+
}
diff --git a/components/select/Select.js b/components/select/Select.js
index 1efc4d736..f73a55bcf 100644
--- a/components/select/Select.js
+++ b/components/select/Select.js
@@ -2,11 +2,11 @@ import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import classNames from 'classnames'
import PropTypes from 'prop-types'
+import shallowEqual from 'shallowequal'
import Popper from '../popper'
import SelectInput from './SelectInput'
import SelectDropdown from './SelectDropdown'
import $$ from './tool.js'
-import './style/index.scss'
class Select extends Component {
timer = null
@@ -17,7 +17,10 @@ class Select extends Component {
list: PropTypes.array,
origin: PropTypes.object,
value: PropTypes.oneOfType([
- PropTypes.string
+ PropTypes.string,
+ PropTypes.array,
+ PropTypes.bool,
+ PropTypes.number
]),
autoload: PropTypes.bool,
searchable: PropTypes.bool,
@@ -28,6 +31,7 @@ class Select extends Component {
}
static defaultProps = {
+ list: [],
mode: 'single',
disabled: false,
value: '',
@@ -40,8 +44,8 @@ class Select extends Component {
let {
list
} = this.props
- const dropdownItems = list ? JSON.parse(JSON.stringify(list)) : []
- const selectedItems = this.resetSelectedItems()
+ const dropdownItems = list
+ const selectedItems = this.resetSelectedItems(this.props)
const searchable = this.getSearchable()
// const focusedIndex = this.resetFocusedIndex(false)
@@ -80,6 +84,23 @@ class Select extends Component {
window.removeEventListener('click', this.hideDropdown.bind(this))
}
+ componentWillReceiveProps (props) {
+ if (props.value !== this.props.value) {
+ const selectedItems = this.resetSelectedItems(props)
+
+ this.setState({
+ selectedItems
+ }, () => {
+ this.onChange()
+ })
+ }
+ if (!shallowEqual(props.list, this.props.list)) {
+ this.setState({
+ dropdownItems: props.list
+ })
+ }
+ }
+
getSearchable () {
let {
searchable
@@ -94,6 +115,19 @@ class Select extends Component {
return !!searchable
}
+ parseValue () {
+ let {
+ value
+ } = this.props
+ if (Array.isArray(value)) {
+ return value.slice()
+ } else if (typeof value === 'string') {
+ return value.split(',')
+ } else {
+ return [value]
+ }
+ }
+
isRemote () {
let {
origin
@@ -101,12 +135,11 @@ class Select extends Component {
return origin && !!origin.url
}
- resetSelectedItems () {
+ resetSelectedItems (props) {
const {
- list,
- value
- } = this.props
- const values = value.split(',')
+ list
+ } = props
+ const values = this.parseValue()
let selectedItems = []
list && list.map(item => {
@@ -118,8 +151,7 @@ class Select extends Component {
}
addOption (option) {
- const value = this.props.value
- const values = value.split(',')
+ const values = this.parseValue()
this.state.dropdownItems.push(option)
values.indexOf(option.id) > -1 && this.state.selectedItems.push(option)
@@ -207,12 +239,12 @@ class Select extends Component {
}
hideDropdown () {
- !this.noHideDropdown && this.setState({dropdownShow: false})
+ !this.noHideDropdown && this.state.dropdownShow === true && this.setState({dropdownShow: false})
this.noHideDropdown = false
}
showDropdown () {
- this.setState({dropdownShow: true})
+ this.state.dropdownShow === false && this.setState({dropdownShow: true})
this.selectInput.focus()
}
diff --git a/components/select/SelectDropdown.js b/components/select/SelectDropdown.js
index 213b0facc..bb80665bb 100644
--- a/components/select/SelectDropdown.js
+++ b/components/select/SelectDropdown.js
@@ -3,7 +3,6 @@
import React, { Component } from 'react'
import classNames from 'classnames'
import Checkbox from '../checkbox'
-import './style/select-dropdown.scss'
export default class SelectDropdown extends Component {
onClickOption (e, item, index) {
diff --git a/components/select/SelectInput.js b/components/select/SelectInput.js
index 33ea06b3b..768db6b21 100644
--- a/components/select/SelectInput.js
+++ b/components/select/SelectInput.js
@@ -3,7 +3,6 @@
import React, { Component } from 'react'
import classNames from 'classnames'
import { getTextWidth } from './common.js'
-import './style/select-input.scss'
export default class SelectInput extends Component {
constructor (props) {
diff --git a/components/select/index.js b/components/select/index.js
index d81789ec4..95ccff5e7 100644
--- a/components/select/index.js
+++ b/components/select/index.js
@@ -1,5 +1,7 @@
import Select from './Select'
import Option from './Option'
+import './style/index'
+
Select.Option = Option
export default Select
diff --git a/components/select/style/index.js b/components/select/style/index.js
new file mode 100644
index 000000000..2c3f03f81
--- /dev/null
+++ b/components/select/style/index.js
@@ -0,0 +1,5 @@
+import '../../style/icon/index.scss'
+import './index.scss'
+import './select-dropdown.scss'
+import './select-input.scss'
+
diff --git a/components/select/style/index.scss b/components/select/style/index.scss
index 470448d15..e87f1e09a 100644
--- a/components/select/style/index.scss
+++ b/components/select/style/index.scss
@@ -1,4 +1,3 @@
-@import '../../style/icon/index.scss';
$hoverColor:#ecf6fd;
$selectColor:#f7f7f7;
@@ -7,5 +6,4 @@ $selectColor:#f7f7f7;
opacity: .4;
cursor: not-allowed;
}
-
-}
\ No newline at end of file
+}
diff --git a/components/select/style/select-dropdown.scss b/components/select/style/select-dropdown.scss
index 0f7b1df11..2d619fcf6 100644
--- a/components/select/style/select-dropdown.scss
+++ b/components/select/style/select-dropdown.scss
@@ -11,21 +11,28 @@
border-radius: 2px;
box-sizing: border-box;
z-index: 1050;
+
&--items {
display: flex;
flex-direction: column;
overflow-y: auto;
max-height: 250px;
+ list-style: none;
+ margin: 0;
+ padding: 0;
// margin-right: -17px;
}
&--item{
+ flex: none;
display: block;
height: 36px;
line-height: 36px;
padding: 0 12px;
+ margin: 0;
font-weight: 400;
cursor: pointer;
+ list-style: none;
transition: all .3s ease;
&.hi-select__dropdown--item-default {
display: flex;
diff --git a/components/select/style/select-input.scss b/components/select/style/select-input.scss
index 126e8ff97..592bf4e85 100644
--- a/components/select/style/select-input.scss
+++ b/components/select/style/select-input.scss
@@ -110,6 +110,7 @@
line-height: 32px;
overflow: hidden;
transition: padding .2s cubic-bezier(.645,.045,.355,1);
+ text-align: left;
&__name {
display: inline-block;
white-space: nowrap;
@@ -159,6 +160,7 @@
vertical-align: middle;
background-color: #f2f2f2;
border-radius: 2px;
+ text-align: left;
&__name{
font-size: 13px;
display: inline-block;
diff --git a/components/stepper/index.js b/components/stepper/index.js
index 1a4e533c1..7297ff0ae 100644
--- a/components/stepper/index.js
+++ b/components/stepper/index.js
@@ -1,6 +1,7 @@
import React from 'react'
import Provider from '../context'
import classnames from 'classnames'
+import './style/index'
/**
* Props
* @prop id {string} id
diff --git a/components/stepper/style/index.scss b/components/stepper/style/index.scss
index caa90f7bb..0f96bcea5 100644
--- a/components/stepper/style/index.scss
+++ b/components/stepper/style/index.scss
@@ -6,25 +6,29 @@
height: 100%;
font-size: 14px;
z-index: 0;
+
&__list {
display: flex;
padding: 0 !important;
margin: 0 !important;
min-width: 400px;
+
li {
margin: 0 !important;
list-style: none;
}
+
span {
display: inline-block;
}
}
+
&__item {
position: relative;
- width: 104px;
flex: 1 1 auto;
z-index: 1;
display: flex;
+
&::after {
content: '';
position: absolute;
@@ -36,12 +40,14 @@
background-color: #ccc;
z-index: -1;
}
+
&:last-child {
- flex: 0 1 auto;
+ flex: 0 0 auto;
&::after {
display: none;
}
}
+
/*水平或垂直方向的 上下结构*/
&--up {
.hi-stepper {
@@ -50,18 +56,22 @@
text-align: center;
background-color: transparent;
flex-direction: column;
+
>span {
margin-bottom: 8px;
}
}
+
&__title {
padding: 0;
margin-bottom: 4px;
width: 100%;
}
+
&__icon {
padding: 0 22px;
}
+
&__text {
font-size: 12px;
color: #999;
@@ -70,6 +80,7 @@
}
}
}
+
&__num {
width: 24px;
height: 24px;
@@ -79,6 +90,7 @@
color: #fff;
background-color: #ccc;
}
+
&__title {
padding: 0 0 0 8px;
color: #999;
@@ -86,6 +98,7 @@
word-break: keep-all;
overflow: hidden;
}
+
&__icon {
display: inline-block;
background-color: #fff;
@@ -94,9 +107,11 @@
width: 24px;
height: 24px;
line-height: 24px;
+
.hi-icon {
font-size: 18px;
}
+
/*用于自定义图片大小*/
img {
width: 24px;
@@ -104,6 +119,7 @@
vertical-align: middle;
}
}
+
&__item-content {
display: flex;
flex: 0 1 auto;
@@ -114,6 +130,7 @@
box-sizing: border-box;
z-index: 1;
}
+
/*垂直方向*/
&--vertical {
.hi-stepper {
@@ -123,34 +140,40 @@
height: 100%;
min-width: auto;
}
+
&__item {
position: relative;
display: flex;
flex-direction: column;
- width:100%;
+ width: 100%;
+
&::after {
content: '';
position: absolute;
left: 12px;
width: 1px;
height: 100%;
- background-color: #D8D8D8;
+ background-color: #d8d8d8;
}
}
+
&__item-content {
padding: 0;
flex-wrap: wrap;
}
+
&__title {
- flex: 1 1 auto;
+ flex: 1 1;
text-align: left;
}
+
&__icon {
display: inline-block;
padding: 4px 0;
background-color: #fff;
z-index: 1;
}
+
&__text {
flex: 1 1 100%;
margin-left: 32px;
@@ -161,25 +184,26 @@
}
}
-@each $key,$value in $palette-primary {
+@each $key, $value in $palette-primary {
.theme__#{$key} {
- .hi-stepper {
- &__item {
- &--active {
- .hi-icon {
- color: map-get(get-palette($value), '50');
- }
- .hi-stepper__num {
- background-color: map-get(get-palette($value), '50');
- }
- .hi-stepper__title {
- color: map-get(get-palette($value), '50');
- }
+ .hi-stepper__item {
+ &--active {
+ .hi-icon {
+ color: map-get(get-palette($value), '50');
}
- &--done {
- &::after {
- background-color: map-get(get-palette($value), '50');
- }
+
+ .hi-stepper__num {
+ background-color: map-get(get-palette($value), '50');
+ }
+
+ .hi-stepper__title {
+ color: map-get(get-palette($value), '50');
+ }
+ }
+
+ &--done {
+ &::after {
+ background-color: map-get(get-palette($value), '50');
}
}
}
diff --git a/components/style/index.scss b/components/style/index.scss
index 890cfbacc..e1d2a0fbf 100644
--- a/components/style/index.scss
+++ b/components/style/index.scss
@@ -1,3 +1,3 @@
@import './theme/default.scss';
@import './theme/dark.scss';
-@import './icon/index.scss';
+
diff --git a/components/table/index.js b/components/table/index.js
index 89bb9489c..de34b17d8 100644
--- a/components/table/index.js
+++ b/components/table/index.js
@@ -8,11 +8,9 @@ import prifix from './prefix'
import Checkbox from '../checkbox'
import Pagination from '../pagination'
import Icon from '../icon'
-import './style'
-import '../checkbox/style'
-import '../pagination/style'
-import '../icon/style'
+
import {setKey, scrollTop, getStyle} from './tool'
+import './style/index'
export default class Table extends Component {
static propTypes = {
diff --git a/components/table/style/Table.scss b/components/table/style/Table.scss
index 0406d575f..3c2b55df5 100644
--- a/components/table/style/Table.scss
+++ b/components/table/style/Table.scss
@@ -98,9 +98,6 @@ $bgColor: #f7fafe;
border-spacing:0;
- .hi-checkbox .hi-checkbox-input{
-
- }
col{
display: table-column;
}
diff --git a/components/table/style/index.js b/components/table/style/index.js
index 63810a681..d5931dd5e 100644
--- a/components/table/style/index.js
+++ b/components/table/style/index.js
@@ -1 +1,2 @@
+import '../../style/icon/index.scss'
import './index.scss'
diff --git a/components/tabs/index.js b/components/tabs/index.js
index 70393873f..de45eae31 100755
--- a/components/tabs/index.js
+++ b/components/tabs/index.js
@@ -1,5 +1,6 @@
import Tabs from './Tabs'
import TabPane from './TabPane'
+import './style/index'
Tabs.Pane = TabPane
diff --git a/components/tooltip/index.js b/components/tooltip/index.js
index a7e399d1a..6d3748a23 100644
--- a/components/tooltip/index.js
+++ b/components/tooltip/index.js
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
+import './style/index'
class Tooltip extends Component {
static propTypes = {
diff --git a/components/tree/Tree.js b/components/tree/Tree.js
index 7251932dc..cb871f3ae 100644
--- a/components/tree/Tree.js
+++ b/components/tree/Tree.js
@@ -27,7 +27,8 @@ class Tree extends Component {
defaultExpandAll: PropTypes.bool,
checkable: PropTypes.bool,
draggable: PropTypes.bool,
- options: PropTypes.object
+ options: PropTypes.object,
+ onNodeClick: PropTypes.func
}
static defaultProps = {
prefixCls: 'hi-tree',
@@ -39,7 +40,8 @@ class Tree extends Component {
children: 'children'
},
openIcon: null,
- closeIcon: null
+ closeIcon: null,
+ onNodeClick: () => {}
}
componentWillMount () {
// init checkedTree
@@ -344,7 +346,7 @@ class Tree extends Component {
}
// 生成树节点内容 bar(icon + title)
renderNodeContent = (root) => {
- const { prefixCls, draggable, options, render, checkable } = this.props
+ const { prefixCls, draggable, options, render, checkable, onNodeClick } = this.props
return (
{
+ onNodeClick && onNodeClick(root)
root.onClick && root.onClick(root)
}}
>{root[options.title] || DEFAULT_TITLE}
)}
diff --git a/components/tree/index.js b/components/tree/index.js
index b8adc2949..16c1069d4 100644
--- a/components/tree/index.js
+++ b/components/tree/index.js
@@ -1,3 +1,4 @@
import Tree from './Tree'
+import './style/index'
export default Tree
diff --git a/components/tree/style/index.js b/components/tree/style/index.js
index 63810a681..d5931dd5e 100644
--- a/components/tree/style/index.js
+++ b/components/tree/style/index.js
@@ -1 +1,2 @@
+import '../../style/icon/index.scss'
import './index.scss'
diff --git a/components/upload/UploadAvatar.js b/components/upload/UploadAvatar.js
index f615c49a0..6ceb89b17 100644
--- a/components/upload/UploadAvatar.js
+++ b/components/upload/UploadAvatar.js
@@ -3,7 +3,6 @@ import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import AJAX from './tool'
import Modal from '../modal'
-import '../modal/style'
class UploadAvatar extends Component {
static propTypes = {
diff --git a/components/upload/index.js b/components/upload/index.js
index bf797aa63..4e4e29f5d 100644
--- a/components/upload/index.js
+++ b/components/upload/index.js
@@ -8,6 +8,7 @@ import UploadDrag from './UploadDrag'
import UploadPhoto from './UploadPhoto'
import UploadAvatar from './UploadAvatar'
import UploadPictureCard from './UploadPictureCard'
+import './style/index'
class Upload extends Component {
render () {
diff --git a/components/upload/style/index.js b/components/upload/style/index.js
index 63810a681..289782651 100644
--- a/components/upload/style/index.js
+++ b/components/upload/style/index.js
@@ -1 +1,2 @@
import './index.scss'
+import '../../style/icon/diyIcon.scss'
diff --git a/components/upload/style/index.scss b/components/upload/style/index.scss
index 729da1bfe..2e0a9b780 100644
--- a/components/upload/style/index.scss
+++ b/components/upload/style/index.scss
@@ -1,4 +1,3 @@
-@import '../../style/icon/diyIcon.scss';
span{
margin: 0;
diff --git a/docs/en-US/checkbox.md b/docs/en-US/checkbox.md
index 360c7d03b..b71c8b6bd 100644
--- a/docs/en-US/checkbox.md
+++ b/docs/en-US/checkbox.md
@@ -138,6 +138,6 @@ render() {
| name | Sub-option identification in all-select or multi-select mode(all-select: The 'name' value is consistent with the 'all' value multi-select: Peer name should be consistent) | string | - | |
### Events
-| 参数 | 说明 | 类型 | 说明 |
-| -------- | ----- | ---- | ---- |
-| onChange | triggers when the Checkbox changed | function | - |
+| Attribute | Description | Type
+| -------- | ----- | ---- |
+| onChange | triggers when the Checkbox changed | function
diff --git a/docs/en-US/collapse.md b/docs/en-US/collapse.md
new file mode 100755
index 000000000..05a56bd4b
--- /dev/null
+++ b/docs/en-US/collapse.md
@@ -0,0 +1,140 @@
+## Collapse
+
+### Default active
+
+:::demo
+
+```js
+ render(){
+ return(
+
{console.log('changed');}}
+ activeKey='2'
+ arrow="left"
+ >
+
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+
+
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+
+
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+
+
+ )
+ }
+
+```
+:::
+
+### Accordion
+:::demo
+
+```js
+ render(){
+ return(
+
{console.log('changed');}}
+ accordion={true}
+ arrow="right"
+ >
+
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+
+
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+
+
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+
+
+ )
+ }
+
+```
+:::
+
+### No footers
+:::demo
+
+```js
+ render(){
+ return(
+
{console.log('changed');}}
+ accordion={true}
+ type="simple"
+ arrow="right"
+ >
+
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+ Collapse Panel Content 1
+
+
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+ Collapse Panel Content 2
+
+
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+ Collapse Panel Content 3
+
+
+ )
+ }
+
+```
+:::
+
+### Collapse Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| accordion | Accordion mode | bool | true, false | false|
+| onChange | Callback | function | - | 无 |
+| activeKey | Default active | string, string[] | - | 无 |
+| type | Collapse type | string | default, simple | default |
+| arrow | Arrow position | string | left, right, none | left |
+
+
+### Collapse Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| key | key | string | - | index |
+| header | header | string
Node
React.Component | - | null |
+| disabled | disabled | bool | - | false |
diff --git a/docs/en-US/counter.md b/docs/en-US/counter.md
new file mode 100644
index 000000000..238bbd8d1
--- /dev/null
+++ b/docs/en-US/counter.md
@@ -0,0 +1,61 @@
+
+## Counter
+
+### Basic
+
+:::demo
+
+```js
+constructor() {
+ super()
+ this.state = {
+ disabled: false
+ }
+}
+render() {
+ return (
+
+ console.log('changed value:', val)}
+ />
+
+ {console.log('changed value:', e, val)}}
+ />
+
+ )
+}
+```
+:::
+
+
+### Counter Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| value | Default value | string / number | - |
+| step | Step value | number | - |
+| min | Min value | number | - |
+| max | Max value | number | - |
+| disabled | Whether to disable | boolean | - |
+| className | string | - | - |
+
+
+### Counter Events
+
+| Attribute | Description | Callback params |
+| -------- | ----- | ---- |
+| onChange | Triggered when clicking plus or minus | (event: Event, value: Original value) |
diff --git a/docs/en-US/date-picker.md b/docs/en-US/date-picker.md
new file mode 100644
index 000000000..1904b36f4
--- /dev/null
+++ b/docs/en-US/date-picker.md
@@ -0,0 +1,337 @@
+## Datepicker
+
+
+### Basic
+
+:::demo
+
+```js
+constructor() {
+ super()
+ this.state = {
+ date: new Date(),
+ }
+}
+render () {
+ return (
+
+ {
+ console.log('Default', DatePicker.format(d, 'yyyy-MM-dd E'))
+ }}
+ />
+ {this.setState({date: new Date()})}}>Reset
+
+ )
+}
+```
+:::
+
+
+### Disabled
+
+:::demo
+
+```js
+render () {
+ return (
+
+ )
+}
+```
+:::
+
+
+### Disabled (Disable Date)
+
+:::demo
+
+```js
+render () {
+ return (
+
{
+ console.log(d)
+ }}
+ />
+ )
+}
+```
+:::
+
+
+### Week
+
+:::demo
+
+
+```js
+render () {
+ return (
+ {
+ console.log(d)
+ }}
+ />
+ )
+}
+```
+:::
+
+
+### Year
+
+:::demo
+
+
+```js
+render () {
+ return (
+ {
+ console.log('Select Year', d)
+ }}
+ />
+ )
+}
+```
+:::
+
+
+### Month
+
+:::demo
+
+```js
+render () {
+ return (
+
+ )
+}
+```
+:::
+
+
+### Range
+
+:::demo
+
+```js
+constructor() {
+ super()
+ this.state = {
+ rangeDate: {start: new Date(), end: new Date()} // 或 rangeDate: new Date()
+ }
+}
+render () {
+ return (
+
+ {
+ console.log(d)
+ }}
+ />
+ {this.setState({rangeDate: ''})}}>Reset
+
+ )
+}
+```
+:::
+
+
+### Range (Disable Date)
+
+:::demo
+
+```js
+render () {
+ return (
+
+ )
+}
+```
+:::
+
+
+### Week Range
+
+:::demo
+
+```js
+render () {
+ return (
+ {
+ console.log(d)
+ }}
+ />
+ )
+}
+```
+:::
+
+
+### Date Range(shortcuts)
+
+:::demo
+
+```js
+render () {
+ return (
+ {console.log(d)}}
+ />
+ )
+}
+```
+:::
+
+
+### Date + Time
+
+:::demo
+
+```js
+render () {
+ return (
+ {console.log('sec', d)}}
+ />
+ )
+}
+```
+:::
+
+
+### Date + Time (Range Select)
+
+:::demo
+
+```js
+render () {
+ return (
+ {console.log('last', d)}}
+ />
+ )
+}
+```
+:::
+
+
+### Open in Modal
+
+:::demo
+
+```js
+constructor () {
+ super()
+ this.state = {
+ show: false,
+ date: new Date(),
+ rangeDate: {start: new Date(), end: new Date()}
+ }
+}
+cancelEvent () {
+ this.setState({
+ show: false
+ })
+ console.log("Customer Event")
+}
+render () {
+ return (
+
+
+ {
+ this.state.show && {console.log('customer')}}
+ onCancel={this.cancelEvent.bind(this)}
+ >
+ {
+ console.log(DatePicker.format(d, 'yyyy-MM E'))
+ }}
+ />
+ {
+ console.log(d)
+ }}
+ />
+
+ }
+
+ )
+}
+```
+:::
+
+
+### Datepicker Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| type | type | string | date:normal
daterange: date range
year: year
month: month
week: week
weekrange: week range | date |
+| value | Default date | Date/String/Object/Undefined | null | null |
+| minDate | minDate | date | null | null |
+| maxDate | maxDate | date | null | null |
+| disabled | disabled | boolean | true false | false |
+| showTime | showTime | boolean | true false | false |
+| shortcuts | shortcuts | array | 近一周, 近一月, 近三月, 近一年 | null |
+| weekOffset | weekOffset
| number | 0/1 | 0 |
+
+### Datepicker Events
+
+| Attribute | Description | Callback param |
+| -------- | ----- | ---- |
+| onChange | Callback | (date: Date) | Date | {start: Date,end: Date}
+
+### Datepicker API
+
+| Method | Description | Usage
+| -------- | ----- | ----
+| format | Format Date | DatePicker.format(date, format)
date: [Date] Date format: [String] Format String
+
+### format
+
+| Format | Description/(length) | Example | Result |
+| :--: | :------------------------------: | ------------------- | ------------------- |
+| y | year/(1~4) | yyyy |2018|
+| M | month/(1~2) | yyyy-MM |2018-06|
+| d | day/(1~2) | yyyy-dd |2018-29|
+| h | 12-hour/(1~2) | dd : hh |29:03|
+| H | 24-hour/(1~2) | dd : HH |29:15|
+| m | minute/(1~2) | dd hh-mm |29 15-30|
+| s | second/(1~2) | yyyy-MM-dd hh:mm:ss |2018-06-29 03:30:00|
+| S | millisecond/(1) | MM-dd: HH:mm:ss:S |06-29: 15:30:00|
+| E | week/(1~3) | yy-MM-dd EE |18-06-29 18|
+| q | quarter/(1~2) | yyyy-MM q |2018-06 2|
+
diff --git a/docs/en-US/dropdown.md b/docs/en-US/dropdown.md
index 0eff5b1db..4bb717c24 100644
--- a/docs/en-US/dropdown.md
+++ b/docs/en-US/dropdown.md
@@ -1,6 +1,6 @@
## Dropdown
-### 基础用法
+### Basic
:::demo
```js
@@ -8,25 +8,25 @@ constructor () {
super()
this.state = {
list: [{
- title: '电视'
+ title: 'TV'
},{
- title: '手机'
+ title: 'Phone'
},{
- title: '电脑'
+ title: 'Other'
}]
}
}
render() {
return (
- console.log(val)}>
+ console.log(val)}>
)
}
```
:::
-### 触发方式
+### Trigger mode
:::demo
@@ -35,22 +35,22 @@ constructor () {
super()
this.state = {
list: [{
- title: '小米手机',
+ title: 'Mi Phone',
onClick: () => {
console.log('one')
}
},{
- title: '小米电视',
+ title: 'Mi TV',
prefix: ,
disabled: true
},{
- title: '小米生态链相关产品',
+ title: 'Mi Ecological',
prefix: ,
suffix:
},{
title: '-'
},{
- title: '其它',
+ title: 'Other',
value: 'other'
}]
}
@@ -62,7 +62,7 @@ render() {
list={this.state.list}
trigger={['click', 'contextmenu']}
onClick={(val) => {console.log(val)}}
- title="左键或右键点击"
+ title="Left click or right click"
width={160}
>
@@ -72,10 +72,10 @@ render() {
```
:::
-### 按钮菜单
+### Button Menu
:::demo
-自定义前缀、后缀
+
```js
constructor () {
super()
@@ -84,7 +84,7 @@ constructor () {
title: 'one'
},{
title: 'two',
- prefix: // 此 prefix 将会被替换为外部的 prefix
+ prefix:
},{
title: 'three',
suffix:
@@ -96,7 +96,7 @@ render() {
console.log(val)}
@@ -108,10 +108,10 @@ render() {
```
:::
-### 拓展菜单
+### Extended menu
:::demo
-传入 type 为 group,组件会将 title 执行对应的点击响应,点击箭头打开菜单项
+Pass the type to group, the component will perform the corresponding click response for the title, click the arrow to open the menu item.
```js
constructor () {
super()
@@ -132,7 +132,7 @@ render() {
console.log(val)}
@@ -148,13 +148,13 @@ render() {
#### Attributes
-| 参数 | 说明 | 类型 | 可选值 |默认值 |
+| Attribute | Description | Type | Options |Default |
| -------- | ----- | ---- | ---- | ---- |
-| list | 数据项 | array | - | - |
-| title | 显示的文字内容
传入"-"时代表分隔符 | string/Component | - | - |
-| type | 下拉按钮类型 | string | button/group | text |
-| onClick | 点击回调函数 | func | - | - |
-| prefix | 前缀图标 | string/Component | - | - |
-| suffix | 后缀图标 | string/Component | - | - |
-| trigger | 触发方式 | string/array | click/contextmenu | click |
+| list | datas | array | - | - |
+| title | text content
"-" represents the separator | string/Component | - | - |
+| type | dropdown type | string | button/group | text |
+| onClick | callback | func | - | - |
+| prefix | prefix icon | string/Component | - | - |
+| suffix | suffix icon | string/Component | - | - |
+| trigger | trigger mode | string/array | click/contextmenu | click |
diff --git a/docs/en-US/form.md b/docs/en-US/form.md
index 2d32fea85..6c44c9ca6 100644
--- a/docs/en-US/form.md
+++ b/docs/en-US/form.md
@@ -233,7 +233,7 @@ render(){
### FormItem Attributes
-| 参数 | 说明 | 类型 | 可选值 | 默认值|
+| Attribute | Description | Type | Options | Default |
| --- | --- | --- | ---- | --- |
| prop | model field | string | - | - |
| label | label text | string | - | - |
diff --git a/docs/en-US/icon.md b/docs/en-US/icon.md
index 30fc671c5..2562b74db 100644
--- a/docs/en-US/icon.md
+++ b/docs/en-US/icon.md
@@ -75,7 +75,7 @@ render () {
### Attributes
-| 参数 | 说明 | 类型 | 可选值 |默认值 |
+| Attribute | Description | Type | Options |Default |
| -------- | ----- | ---- | ---- | ---- |
| name | Name | string | Reference icon collection | - |
| className | custome class | string | - | - |
diff --git a/docs/en-US/input.md b/docs/en-US/input.md
index bb63f993b..9cd802b96 100644
--- a/docs/en-US/input.md
+++ b/docs/en-US/input.md
@@ -241,23 +241,23 @@ render() {
### Attributes
-| 参数 | 说明 | 类型 | 可选值 | 默认值 |
+| Attribute | Description | Type | Options | Default |
| -------- | ----- | ---- | ---- | ---- |
-| type | 设置按钮类型 | string | text, textarea, id, tel, card, amount, email | text |
-| disabled | 输入框尾部文字 | boolean | true/false | false |
-| required | 输入框尾部文字 | string | true/false | false |
-| prefix | 输入框头部文字 | string | - | - |
-| suffix | 输入框尾部文字 | string | - | - |
+| type | Input type | string | text, textarea, id, tel, card, amount, email | text |
+| disabled | Whether to disable | boolean | true/false | false |
+| required | Required or not | string | true/false | false |
+| prefix | prefix | string | - | - |
+| suffix | suffix | string | - | - |
### Events
-| 参数 | 说明 | 回调参数 |
+| Attribute | Description | Callback params |
| -------- | ----- | ---- |
-| onFocus | 获得焦点时触发 | (event: Event, value: 原始值) |
-| onBlur | 失去焦点时触发 | (event: Event, value: 原始值) |
-| onKeyDown | 触发 keydown 事件 | (event: Event, value: 原始值) |
-| onKeyPress | 触发 keypress 事件 | (event: Event, value: 原始值) |
-| onInput | 触发 input 事件 | (event: Event, value: 原始值) |
-| onChange | 值改变时触发 | (event: Event, value: 原始值) |
-| onKeyUp | 触发 keyup 事件 | (event: Event, value: 原始值) |
+| onFocus | Trigger when getting focus | (event: Event, value: Original value) |
+| onBlur | Triggered when focus is lost | (event: Event, value: Original value) |
+| onKeyDown | Trigger when the keyboard is pressed | (event: Event, value: Original value) |
+| onKeyPress | Triggered when the keyboard is pressed and raised | (event: Event, value: Original value) |
+| onInput | Trigger on input | (event: Event, value: Original value) |
+| onChange | Triggered when the value changes | (event: Event, value: Original value) |
+| onKeyUp | Triggered when the keyboard is raised | (event: Event, value: Original value) |
diff --git a/docs/en-US/loading.md b/docs/en-US/loading.md
index 1e0b11218..88b056ccc 100644
--- a/docs/en-US/loading.md
+++ b/docs/en-US/loading.md
@@ -1,8 +1,7 @@
-## Loading 动效加载
+## Loading
-常用的动态加载提示组件
-### 基础用法
+### Basic
:::demo
@@ -17,7 +16,7 @@ render () {
```
:::
-### 局部控制
+### partial control
:::demo
```js
@@ -25,7 +24,7 @@ constructor () {
super()
this.state = {
showLoading: false,
- btnText: '开始加载,模拟3秒返回数据',
+ btnText: 'Start loading, simulate 3 seconds return data',
list: []
}
this.columns = [{
@@ -54,7 +53,6 @@ constructor () {
}];
}
mockTableData () {
- // 模拟数据接口
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve([{
@@ -84,14 +82,14 @@ clickEvent () {
this.setState({
showLoading: false,
list: res,
- btnText: '重新加载,模拟3秒返回数据'
+ btnText: 'Reload, simulate 3 seconds return data'
})
})
}
render () {
return
-
+
-
+
{this.state.open && }
}
@@ -133,9 +131,9 @@ render () {
### Attributes
-| 参数 | 说明 | 类型 | 可选值 |默认值 |
+| Attribute | Description | Type | Options | Default |
| -------- | ----- | ---- | ---- | ---- |
-| size | 组件大小 | string | large default small | default |
-| tip | 自定义的旋转动画下的文字 | string | - | |
-| full | 是否全屏 | bool | - | false |
-| show | 是否显示加载动画 | boolean | true false | false |
\ No newline at end of file
+| size | Size | string | large default small | default |
+| tip | Text | string | - | |
+| full | Whether full screen | bool | - | false |
+| show | Whether to display the loading animation | boolean | true false | false |
\ No newline at end of file
diff --git a/docs/en-US/menu.md b/docs/en-US/menu.md
index 45462753b..a25848cb9 100644
--- a/docs/en-US/menu.md
+++ b/docs/en-US/menu.md
@@ -1,21 +1,21 @@
## Menu
-### 水平排列
+### Horizontal
:::demo
-水平排列
+Horizontal
```js
constructor () {
super()
this.state = {
list: [{
- title: '菜单一'
+ title: 'Menu one'
}, {
- title: '菜单二',
+ title: 'Menu two',
}, {
- title: '菜单三'
+ title: 'Menu three'
}]
}
}
@@ -30,22 +30,22 @@
```
:::
-### 竖直排列
+### Vertical
:::demo
-竖直排列
+Vertical
```js
constructor () {
super()
this.state = {
list: [{
- title: '菜单一'
+ title: 'Menu one'
}, {
- title: '菜单二'
+ title: 'Menu two',
}, {
- title: '菜单三'
+ title: 'Menu three'
}]
}
}
@@ -76,17 +76,20 @@
### Attributes
-| 参数 | 说明 | 类型 | 可选值 | 默认值 |
+| Attribute | Description | Type | Options | Default |
| -------- | ----- | ---- | ---- | ---- |
-| active | 是否激活 | boolean | true / false | false |
-| defaultActive | 默认激活(当 active 存在时,此项无效 | boolean | true / false | false |
-| text | 文本 | string | - | - |
-| value | 文本对应的值,可为空 | - | - |
-| mode | 菜单排列模式 | string | horizontal / vertical | vertical |
+| active | is active | boolean | true / false | false |
+| defaultActive | default active(This item is invalid when active is present | boolean | true / false | false |
+| text | text | string | - | - |
+| value | value | - | - |
+| mode |
+6/5000
+Càidān páiliè móshì
+Menu arrangement mode | string | horizontal / vertical | vertical |
### Events
-| 参数 | 说明 | 回调参数 |
+| Attribute | Description | Callback Params |
| -------- | ----- | ---- |
| onOpen | 打开某菜单事件 | - |
| onClose | 关闭某菜单事件 | - |
diff --git a/docs/en-US/notification.md b/docs/en-US/notification.md
index ae70f50f7..ea04aa518 100755
--- a/docs/en-US/notification.md
+++ b/docs/en-US/notification.md
@@ -1,6 +1,6 @@
## Notification
-### 基础
+### Basic
:::demo
@@ -8,17 +8,17 @@
render(){
return(
-
-
+
+
)
}
open(){
- handleNotificate({type: 'success',autoClose:true,title:'标题',message:'自动关闭通知框',onClose:()=>{console.log('关闭回调')}})
+ handleNotificate({type: 'success',autoClose:true,title:'Title',message:'Message',onClose:()=>{console.log('Callback')}})
}
open1(){
- handleNotificate({autoClose:false,title:'标题',message:'手动关闭通知框',onClose:()=>{console.log('关闭回调')}})
+ handleNotificate({autoClose:false,title:'标Title题',message:'Message',onClose:()=>{console.log('Callback')}})
}
```
@@ -26,10 +26,10 @@
### Attributes
-| 参数 | 说明 | 类型 | 可选值 | 默认值 |
+| Attribute | Description | Type | Options | Default |
| -------- | ----- | ---- | ---- | ---- |
-| type | 类型 | string | info/error/success/warning | info |
-| message | 提示内容 | string | - | 无 |
-| title | 提示标题 | string | - | 无 |
-| autoClose | 是否自动关闭 | bool | - | false |
-| onClose | 关闭回调 | func | - | 无 |
\ No newline at end of file
+| type | type | string | info/error/success/warning | info |
+| message | message | string | - | null |
+| title | title | string | - | null |
+| autoClose | autoClose | bool | - | false |
+| onClose | Callback | func | - | null |
\ No newline at end of file
diff --git a/docs/en-US/pagination.md b/docs/en-US/pagination.md
new file mode 100644
index 000000000..89601d863
--- /dev/null
+++ b/docs/en-US/pagination.md
@@ -0,0 +1,117 @@
+## Pagination
+
+Pagination
+
+### 基础分页
+
+:::demo
+
+```js
+constructor () {
+ super()
+
+ this.state = {
+ current: 1
+ }
+}
+render() {
+ return (
+
+
{console.log(page, prevPage, pageSize)}}
+ />
+
+
+ )
+}
+```
+:::
+
+### Control
+
+:::demo
+
+```js
+constructor () {
+ super()
+
+ this.state = {
+ current: 2
+ }
+}
+render() {
+ return (
+
+
+
{console.log(page, prevPage, pageSize)}}
+ />
+
+
+
+
+
+
+ )
+}
+```
+:::
+
+
+### Full
+
+:::demo
+
+```js
+constructor(props) {
+ super(props)
+ this.state = {
+ current: 4,
+ pageSize: 10
+ }
+}
+
+render() {
+ return (
+
+
{this.setState({current: val})}}
+ sizeChangeEvent={(val, current) => {
+ this.setState({pageSize: val})
+ }
+ }
+ onChange={(page, prevPage, pageSize) => {
+ console.log(page, prevPage, pageSize)
+ this.setState({
+ current: page,
+ })
+ }}
+ />
+
+ )
+}
+```
+:::
+
+### Pagination Attributes
+
+| Attribute | Description | Type | Options |Default |
+| -------- | ----- | ---- | ---- | ---- |
+| defaultCurrent | default current page number | number | - | 1 |
+| pageSize | page size | number | - | 10 |
+| total | total count | number | - | - |
+| pageLink | If this parameter is set, `#/page={page}` will be added in the url | boolean | - | - |
+| onChange | callback | function | - | - | - |
+| sizeChangeEvent | size change callback | function | - | - | - |
diff --git a/docs/en-US/panel.md b/docs/en-US/panel.md
new file mode 100755
index 000000000..f264a1bb2
--- /dev/null
+++ b/docs/en-US/panel.md
@@ -0,0 +1,60 @@
+## Panel
+
+### Footers
+
+:::demo
+
+```js
+ render(){
+ return(
+
+
+ Title
+
+ }
+ footer="Footers"
+ >
+ Panel content
+ Panel content
+ Panel content
+
+ )
+ }
+
+```
+:::
+
+
+### No Footers
+
+:::demo
+
+
+```js
+ render(){
+ return(
+
+ Panel content
+ Panel content
+ Panel content
+
+ )
+ }
+
+```
+:::
+
+
+### Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| icon | panel title icon | string | - | null |
+| title | panel title | string
Node
React.Component | - | null |
+| footer | panel footer | string
Node
React.Component | - | null |
+
diff --git a/docs/en-US/popover.md b/docs/en-US/popover.md
new file mode 100644
index 000000000..28998d5f8
--- /dev/null
+++ b/docs/en-US/popover.md
@@ -0,0 +1,45 @@
+## Popover
+
+
+### Basic
+
+:::demo
+
+
+```js
+render() {
+ const title = Popover Title
+ const content = (
+
+
Vivamus sagittis lacus vel augue laoreet rutrum faucibus.
+
+ )
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+```
+:::
+
+### Popover Attributes
+
+| Attribute | Description | Type | Options | Default |
+| ------- | ------- | ------- | ------- | ------- |
+| title | Title content | String | -- | -- |
+| content | Popover content | string, Node, React.Component | -- | -- |
+| placement | Popover position | string | top,right,bottom,left | top |
+| trigger | Popover trigger mode| string | click, focus, hover | click |
diff --git a/docs/en-US/quick-start.md b/docs/en-US/quick-start.md
index a59f02a76..ab35fe068 100644
--- a/docs/en-US/quick-start.md
+++ b/docs/en-US/quick-start.md
@@ -12,7 +12,7 @@ HIUI is committed to providing programmers with a more concise development exper
**We are still in procesing so HIUI have not put in npm, gitlab repository is required to be installed.**
```sh
-$ npm install hiui
+$ npm install @hi-ui/hiui --save
```
### 2.use component
diff --git a/docs/en-US/radio.md b/docs/en-US/radio.md
new file mode 100644
index 000000000..df1a5df91
--- /dev/null
+++ b/docs/en-US/radio.md
@@ -0,0 +1,143 @@
+## Radio
+
+### Basic
+
+:::demo
+
+
+```js
+constructor () {
+ super()
+ this.state = {
+ play : [{
+ name: 'Phone',
+ id: 101
+ }, {
+ name: 'TV',
+ id: 102
+ }],
+ people: [{
+ name: 'Jack',
+ id: 1,
+ checked: true
+ }, {
+ name: 'Rose',
+ id: 2
+ }, {
+ name: 'Jhon',
+ id: 3,
+ checked: true
+ }, {
+ name: 'Smith',
+ id: 4
+ }],
+ address: [{
+ id: 1001,
+ name: 'China'
+ }, {
+ id: 1002,
+ name: 'India'
+ }, {
+ id: 1003,
+ name: 'Italy'
+ }]
+ }
+}
+render() {
+ return (
+
+
Simple data (selected by default for data index setting)
+
{
+ console.log(data)
+ }}
+ />
+ Complex data structure (selected by default for data indexing)
+ {
+ console.log(data)
+ }}
+ checked={1}
+ disabled={1}
+ />
+ Complex data structure (selected by list item setting)
+ {
+ console.log(data)
+ }}
+ disabled={(item) => item.id === 1 || item.id === 3}
+ />
+ Complex data structure (determined by function)
+ {
+ console.log(data)
+ }}
+ checked={(item) => item.id === 1002}
+ />
+
+ )
+}
+```
+:::
+
+### Button Mode
+
+:::demo
+
+```js
+constructor () {
+ super()
+ this.state = {
+ disableNum : 2
+ }
+}
+render() {
+ return (
+
+
Vertical
+
+
+
Button Mode
+
console.log(data)}
+ />
+
+ Vertical Button Mode
+ console.log(data)}
+ layout='vertical'
+ />
+
+ )
+}
+```
+:::
+
+### Radio Attributes
+
+| Attribute | Description | Type | Options | Default |
+| -------- | ----- | ---- | ---- | ---- |
+| name | group name | string | - | Under normal circumstances, no need to pass, the component is generated by default. |
+| list | datas | array | - | - |
+| align | label align | string | left/right | right |
+| checked | When applied to a data item in the list, it is a Boolean value indicating whether the item is selected. When multiple items in the list contain this attribute, the last item will be the main one---
When it is applied to a component attribute as a number or a function is a number, it represents the index value of the selected item. When starting from 0, the function returns the current item and returns the Boolean value after comparison. Whether the item is selected | bool/number/func | - | -1 |
+| onChange | Callback | function | - | - |
+| disabled | Whether to disable | number/function | - | - |
+| mode | style | string | normal/button | normal |
+| layout | layout | string | horizontal/vertical | horizontal |
\ No newline at end of file
diff --git a/docs/en-US/select.md b/docs/en-US/select.md
index 94a0ed187..2d791ecbf 100644
--- a/docs/en-US/select.md
+++ b/docs/en-US/select.md
@@ -1,4 +1,4 @@
-## Select 下拉框
+## Select
### Single selection
@@ -12,11 +12,11 @@ constructor () {
super()
this.state = {
singleList: [
- { name:'手机', id:'2' },
- { name:'电视', id:'3', disabled: true },
- { name:'笔记本', id:'4', disabled: true },
- { name:'生活周边', id:'5' },
- { name:'办公', id:'6' },
+ { name:'Phone', id:'2' },
+ { name:'TV', id:'3', disabled: true },
+ { name:'Laptop', id:'4', disabled: true },
+ { name:'Daily necessities', id:'5' },
+ { name:'Office', id:'6' },
],
tmp: [
{name: 'json', id: '1'},
@@ -31,11 +31,11 @@ render () {