-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathTab.jsx.js
More file actions
74 lines (69 loc) · 2.15 KB
/
Copy pathTab.jsx.js
File metadata and controls
74 lines (69 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* 标签导航
* @author Brian Li
* @email lbxxlht@163.com
* @version 0.0.2.2
*/
define(function (require) {
var React = require('react');
var InputWidget = require('./mixins/InputWidget');
var NormalRenderer = require('./components/tab/NormalRenderer.jsx');
var cTools = require('./core/componentTools');
var factory = require('./factories/tabFactory.jsx');
return React.createClass({
/**
* @properties
*
* @param {Import|Properties} src\core\componentTools.js skin className style disabled
* @param {Array.<ListItemObject>} datasource 标签导航数据源
* @param {ReactClass} renderer 标签渲染器
* @param {Import|Properties} src\mixins\InputWidget.js
* value onChange name validations customErrorTemplates valueTemplate
*/
/**
* @structure Import src\List.jsx.js ListItemObject
*/
/**
* @fire Import src\mixins\InputWidget.js XXX onChange
*/
// @override
contextTypes: {
appSkin: React.PropTypes.string
},
// @override
mixins: [InputWidget],
// @override
getDefaultProps: function () {
return {
// base
skin: '',
className: '',
style: {},
disabled: false,
// self
datasource: [],
renderer: NormalRenderer,
// mixin
valueTemplate: ''
};
},
// @override
getInitialState: function () {
return {};
},
onClick: function (e) {
if (this.props.disabled || e.target.value === this.___getValue___()) return;
var value = e.target.value;
e = {target: this.refs.container};
e.target.value = value;
this.___dispatchChange___(e);
},
render: function () {
return (
<div {...cTools.containerBaseProps('tab', this)}>
{factory.produceTabs(this)}
</div>
);
}
});
});