|
|
@ -1,8 +1,8 @@
|
|
|
|
/* eslint-disable react/prop-types */
|
|
|
|
/* eslint-disable */
|
|
|
|
import React from 'react'
|
|
|
|
const Track = {
|
|
|
|
|
|
|
|
functional: true,
|
|
|
|
const Track = (props) => {
|
|
|
|
render (createElement, context) {
|
|
|
|
const { className, included, vertical, offset, length, style } = props
|
|
|
|
const { included, vertical, offset, length, style } = context.data
|
|
|
|
|
|
|
|
|
|
|
|
const positonStyle = vertical ? {
|
|
|
|
const positonStyle = vertical ? {
|
|
|
|
bottom: `${offset}%`,
|
|
|
|
bottom: `${offset}%`,
|
|
|
@ -12,11 +12,12 @@ const Track = (props) => {
|
|
|
|
width: `${length}%`,
|
|
|
|
width: `${length}%`,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const elStyle = {
|
|
|
|
context.data.style = {
|
|
|
|
...style,
|
|
|
|
...style,
|
|
|
|
...positonStyle,
|
|
|
|
...positonStyle,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return included ? <div className={className} style={elStyle} /> : null
|
|
|
|
return included ? createElement('div', context.data, context.children) : null
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default Track
|
|
|
|
export default Track
|
|
|
|