0.1.1-beta • Published 4 years ago

react-tri-button v0.1.1-beta

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-tri-button

npm version

Component with triple state

Demo

준비중...

Install

$ npm install react-tri-button --save

or 

$ yarn install react-tri-button

Scripts

build

npm run build

Components

  • Pending Button
  • WIP Tri Button
  • WIP Tri Checkbox

Pending Button

If you fetching whne you clicked button, clicked button is going to unclickable and come back finishing fetching.

Props

  • timeout
  • fetchingText
  • successText
  • failText
  • fetchMode
  • logging
propsdescriptiontypeisRequired / default
timeoutfetching 과정중, timeout에서 지정한 시간이 지난 후에도 fetching이 되지 않은경우 fetching을 종료하고, 실패로 처리한다.number (milisecond)false / 0
fetchingTextfetch 중에 있을때 표시되는 textstringfalse / ''
successTextfetch가 성공했을때 표시되는 textstringfalse / ''
failTextfetch가 성공했을때 표시되는 textstringfalse / ''
fetchModefetch를 순차적으로 할지, 비동기로 할지 결정enum ('sequence', 'inconsecutive')false / 'sequence'
logginglogging 한다.booleanfalse / false

Event

  • onStateChanged
  • onFetching
  • onError
  • onSuccess
  • onFail
  • onProcess

Tri-Button

Tri-Checkbox

Tri-Checkbox has 3-state. unchecked, checked and intermediate.

Props

  • checked
  • indeterminate
  • checkingText
  • uncheckingText
  • intermediatingText
  • propagation
  • (WIP) checkedIcon
propsdescriptiontypeisRequired / default
checked체크박스 체크여부booleanfalse / false
indeterminate제 3의 상태boolean''
checkingTextstring''
uncheckingTextstring''
intermediatingTextenum ('sequence', 'inconsecutive')false / 'sequence'
propagation상위나 하위의 체크박으로 인해 자신이 전파를 받는지 여부booleanfalse / true
checkedIconbooleanfalse / false

Event

  • onChange

Form

Event

  • onSubmit

Usage

import React from 'react'
import {PendingButton} from 'react-tri-button'

class App extends React.Component {

  render () {
    return (
      <PendingButton onFetching={this.onFetchingList} onError={this.onError} onSuccess={this.onSuccess}>
        Pending Button
      </PendingButton>
    )
  }
}

License

react-tri-button is MIT licensed.