1.0.0-beta.2 • Published 5 years ago

command-ui-components v1.0.0-beta.2

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

Command-UI-Components consists a bunch of UI tools for visualisation on large screens. It is my personal UI component package. Due to limited testing, it is not recommended for producton use at this very early stage, however comments and discussions are welcomed.

Installation

Command-UI-Components is available as an npm package.

npm install --save command-ui-components

API Documentation

1. CircularProgress

Config Options

NameTypeDefaultDescription
typeString || NumbersolidAccept string solid or an array of numbers representing dashed lines. i.e. 20, 2
sizeNumber0Size of the conatiner
fromNumber0Progress value starts from
toNumber1Progress value ends to
widthNumber2Arc line width
lineCapStringbuttOne of butt, round, square
colorString || ObjectblackProgress color, for gradient colors, pass in an object of colour stops and corresponding colour names. Minimum three colour stops for gradient. i.e. {0: 'red', 0.5: 'green', 1: 'blue'}
backgroundColorStringtransparentBackground colour
animateDurationNumber0Animate duration in milliseconds

2. OdometerBoard

Config Options

NameTypeDefaultDescription
classesObjectUseful to extend the style applied to components
dataArray{name: '行驶总里程(公里)',value: 485512,},...Name and value of every board
data.nameString行驶总里程(公里)Name of every board
data.valueNumber485512Value of every board

CSS API

You can override all the class names injected by Command-UI-Components thanks to the classes property. This property accepts the following keys:

  • root
  • container
  • name
  • value

3. ButtonGroup

NameTypeDefaultRequiredDescription
isMultipleBooleanfalseNSupport multiple select
buttonsArrayYAn array of buttons
buttons.nameStringYButton name
buttons.idStringNButton id. Equal to name if omitted. Locally unique
buttons.isActiveBooleanfalseNShould button selected
buttonAllObject{}NButton 'select all'. If configured to true, it opens multiple select feature, even though isMultiple is configured to false
buttonAll.nameStringYButton name
buttonAll.idStringNButton id. Equal to name if omitted. Locally unique
buttonAll.isActiveBooleanfalseNShould button selected
onClickFunctionNAccept two arguments: clicked button object and all selected button list

4. AppBar

NameTypeDefaultRequiredDescription
classesObjectNCss overwrite
classes.menuListstringNOverwrite MenuList styles
captionObjectYAppBar caption
positionStringrelativeNrelative: Document flow AppBar component. absolute: AppBar is absolute positioned
cityStringNCity name
navsArrayNNavigation buttons
navs.nameStringYNavigation button name
navs.idStringnavs.nameNNavigation button id, default equal to button name
navs.isActiveBooleanfalseNWhether button is highlighted
navs.navsArrayNSub navigation button list
onClickFunctionNGives a list of arguments. The last argument is the actual navigation button that has been clicked, the previous represents the parent navigation button and so on

5.Table

NameTypeDefaultRequiredDescription
classesObjectNUseful to extend the style applied to components
columnsArray[]YColumn value
columns.labelString/React domYDisplay
columns.propStringYCorrespond to key of data
dataArray[]YEvery cloumns.prop value
isPaginateBooleanfalseYtrue: Scroll table. false: Paginate table
rowsPerPageNumber5YRow number every page
selectRowIndexNumberNThe row of index. If you want to add click style or hover style, you can config this prop and also need to config onRowClick
onRowClickFunctionNAccept two arguments: clicked row data and clicked row index

6.Lessen

NameTypeDefaultRequiredDescription
classesObjectNUseful to extend the style applied to components
childrenNodeNThe content of the component
dataArrayYEvery lessen data
data.nameStringYTab name
data.idStringYUnique id
data.classesStringNCss api. Useful to override lessen style
data.isShowLessenBooleanNInitial lessen display
takeSpaceBooleantrueYWhether tabs take up space in dom
1.0.0-beta.2

5 years ago

1.0.0-alpha.1

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago