1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | 'use strict'
|
7 |
|
8 | import React, {PropTypes as types} from 'react'
|
9 | import classnames from 'classnames'
|
10 | import {ApPureMixin} from 'apeman-react-mixin-pure'
|
11 | import {ApLabel} from 'apeman-react-label'
|
12 |
|
13 |
|
14 | const ApFieldLabel = React.createClass({
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | propTypes: {
|
21 | htmlFor: types.string
|
22 | },
|
23 |
|
24 | mixins: [
|
25 | ApPureMixin
|
26 | ],
|
27 |
|
28 | statics: {},
|
29 |
|
30 | getInitialState () {
|
31 | return {}
|
32 | },
|
33 |
|
34 | getDefaultProps () {
|
35 | return {
|
36 | htmlFor: null
|
37 | }
|
38 | },
|
39 |
|
40 | render () {
|
41 | const s = this
|
42 | let { props } = s
|
43 |
|
44 | return (
|
45 | <ApLabel { ...props }
|
46 | className={ classnames('ap-field-label', props.className) }
|
47 | htmlFor={ props.htmlFor }>
|
48 | <span className="ap-field-label-inner">
|
49 | { props.children }
|
50 | </span>
|
51 | </ApLabel>
|
52 | )
|
53 | }
|
54 |
|
55 | })
|
56 |
|
57 | export default ApFieldLabel
|