fmui-base 2.1.13 → 2.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/ScrollList/BottomTip.js +60 -0
- package/lib/ScrollList/EmptyContent.js +38 -0
- package/lib/ScrollList/Item.js +213 -0
- package/lib/ScrollList/ScrollList.js +498 -0
- package/lib/ScrollList/ScrollList.styl +232 -0
- package/lib/ScrollList/TagList.js +96 -0
- package/lib/ScrollList/index.js +16 -0
- package/lib/ScrollList/style.js +7 -0
- package/lib/db/variables.js +16 -16
- package/lib/process_list/processList.js +3 -2
- package/lib/selectMember/select.js +34 -26
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _class, _temp;
|
|
10
|
+
|
|
11
|
+
var _react = require('react');
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _propTypes = require('prop-types');
|
|
16
|
+
|
|
17
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
+
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
24
|
+
|
|
25
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
26
|
+
|
|
27
|
+
var BottomTip = (_temp = _class = function (_React$Component) {
|
|
28
|
+
_inherits(BottomTip, _React$Component);
|
|
29
|
+
|
|
30
|
+
function BottomTip() {
|
|
31
|
+
_classCallCheck(this, BottomTip);
|
|
32
|
+
|
|
33
|
+
return _possibleConstructorReturn(this, (BottomTip.__proto__ || Object.getPrototypeOf(BottomTip)).apply(this, arguments));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_createClass(BottomTip, [{
|
|
37
|
+
key: 'render',
|
|
38
|
+
value: function render() {
|
|
39
|
+
return _react2.default.createElement(
|
|
40
|
+
'div',
|
|
41
|
+
{ className: 'bottom-tip' },
|
|
42
|
+
this.props.icon,
|
|
43
|
+
_react2.default.createElement(
|
|
44
|
+
'div',
|
|
45
|
+
{ className: 'text' },
|
|
46
|
+
this.props.text
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}]);
|
|
51
|
+
|
|
52
|
+
return BottomTip;
|
|
53
|
+
}(_react2.default.Component), _class.displayName = 'BottomTip', _class.defaultProps = {
|
|
54
|
+
text: '',
|
|
55
|
+
icon: null
|
|
56
|
+
}, _class.propTypes = {
|
|
57
|
+
icon: _propTypes2.default.element,
|
|
58
|
+
text: _propTypes2.default.string
|
|
59
|
+
}, _temp);
|
|
60
|
+
exports.default = BottomTip;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _react = require('react');
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _propTypes = require('prop-types');
|
|
12
|
+
|
|
13
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
var EmptyContent = function EmptyContent(props) {
|
|
18
|
+
return _react2.default.createElement(
|
|
19
|
+
'div',
|
|
20
|
+
{ key: 'empty-content', className: 'empty-content' },
|
|
21
|
+
props.image ? _react2.default.createElement('div', { className: 'icon', style: { backgroundImage: 'url(' + props.image + ')' } }) : null,
|
|
22
|
+
props.text ? _react2.default.createElement(
|
|
23
|
+
'div',
|
|
24
|
+
{ className: 'text' },
|
|
25
|
+
props.text
|
|
26
|
+
) : null
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
EmptyContent.defaultProps = {
|
|
30
|
+
image: undefined,
|
|
31
|
+
text: undefined
|
|
32
|
+
};
|
|
33
|
+
EmptyContent.propTypes = {
|
|
34
|
+
image: _propTypes2.default.string,
|
|
35
|
+
text: _propTypes2.default.string
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.default = EmptyContent;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _class, _temp;
|
|
10
|
+
|
|
11
|
+
var _react = require('react');
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _classnames3 = require('classnames');
|
|
16
|
+
|
|
17
|
+
var _classnames4 = _interopRequireDefault(_classnames3);
|
|
18
|
+
|
|
19
|
+
var _propTypes = require('prop-types');
|
|
20
|
+
|
|
21
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
22
|
+
|
|
23
|
+
var _Badge = require('saltui/lib/Badge');
|
|
24
|
+
|
|
25
|
+
var _Badge2 = _interopRequireDefault(_Badge);
|
|
26
|
+
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
|
|
29
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
+
|
|
31
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
32
|
+
|
|
33
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
34
|
+
|
|
35
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
36
|
+
|
|
37
|
+
var Item = (_temp = _class = function (_React$Component) {
|
|
38
|
+
_inherits(Item, _React$Component);
|
|
39
|
+
|
|
40
|
+
function Item() {
|
|
41
|
+
_classCallCheck(this, Item);
|
|
42
|
+
|
|
43
|
+
return _possibleConstructorReturn(this, (Item.__proto__ || Object.getPrototypeOf(Item)).apply(this, arguments));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_createClass(Item, [{
|
|
47
|
+
key: 'renderImg',
|
|
48
|
+
value: function renderImg() {
|
|
49
|
+
var _props = this.props,
|
|
50
|
+
img = _props.img,
|
|
51
|
+
prefixCls = _props.prefixCls;
|
|
52
|
+
|
|
53
|
+
if (typeof img === 'string') {
|
|
54
|
+
return _react2.default.createElement('img', { alt: '', className: prefixCls + '-img', src: img });
|
|
55
|
+
}
|
|
56
|
+
return img;
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: 'renderAvatar',
|
|
60
|
+
value: function renderAvatar() {
|
|
61
|
+
var _props2 = this.props,
|
|
62
|
+
avatar = _props2.avatar,
|
|
63
|
+
prefixCls = _props2.prefixCls;
|
|
64
|
+
|
|
65
|
+
if (typeof avatar === 'string') {
|
|
66
|
+
return _react2.default.createElement('img', { alt: '', className: prefixCls + '-avatar', src: avatar });
|
|
67
|
+
}
|
|
68
|
+
return avatar;
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: 'renderTitle',
|
|
72
|
+
value: function renderTitle() {
|
|
73
|
+
var _props3 = this.props,
|
|
74
|
+
title = _props3.title,
|
|
75
|
+
prefixCls = _props3.prefixCls,
|
|
76
|
+
badgePosition = _props3.badgePosition;
|
|
77
|
+
|
|
78
|
+
if (!title) return null;
|
|
79
|
+
return _react2.default.createElement(
|
|
80
|
+
'div',
|
|
81
|
+
{ className: (0, _classnames4.default)(prefixCls + '-title', _defineProperty({}, badgePosition, true))
|
|
82
|
+
},
|
|
83
|
+
title,
|
|
84
|
+
badgePosition === 'indicator' ? null : this.renderBadge()
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: 'renderBadge',
|
|
89
|
+
value: function renderBadge() {
|
|
90
|
+
var _props4 = this.props,
|
|
91
|
+
badge = _props4.badge,
|
|
92
|
+
prefixCls = _props4.prefixCls;
|
|
93
|
+
|
|
94
|
+
var className = prefixCls + '-badge';
|
|
95
|
+
if (typeof badge === 'string') {
|
|
96
|
+
return _react2.default.createElement(_Badge2.default, { text: badge, className: className });
|
|
97
|
+
} else if (typeof badge === 'number') {
|
|
98
|
+
return _react2.default.createElement(_Badge2.default, { count: badge, className: className });
|
|
99
|
+
} else if (typeof badge === 'boolean') {
|
|
100
|
+
return _react2.default.createElement(_Badge2.default, { dot: true, className: className });
|
|
101
|
+
}
|
|
102
|
+
return badge;
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: 'renderDes',
|
|
106
|
+
value: function renderDes() {
|
|
107
|
+
var _props5 = this.props,
|
|
108
|
+
description = _props5.description,
|
|
109
|
+
prefixCls = _props5.prefixCls,
|
|
110
|
+
desMaxLine = _props5.desMaxLine;
|
|
111
|
+
|
|
112
|
+
if (description) {
|
|
113
|
+
return _react2.default.createElement(
|
|
114
|
+
'div',
|
|
115
|
+
{ className: prefixCls + '-des' },
|
|
116
|
+
_react2.default.createElement(
|
|
117
|
+
'div',
|
|
118
|
+
{
|
|
119
|
+
className: prefixCls + '-des-inner',
|
|
120
|
+
style: {
|
|
121
|
+
WebkitLineClamp: desMaxLine
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
description
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: 'renderExtra',
|
|
132
|
+
value: function renderExtra() {
|
|
133
|
+
var _props6 = this.props,
|
|
134
|
+
extra = _props6.extra,
|
|
135
|
+
prefixCls = _props6.prefixCls;
|
|
136
|
+
|
|
137
|
+
if (extra) {
|
|
138
|
+
return _react2.default.createElement(
|
|
139
|
+
'div',
|
|
140
|
+
{ className: prefixCls + '-extra' },
|
|
141
|
+
_react2.default.createElement(
|
|
142
|
+
'div',
|
|
143
|
+
{ className: prefixCls + '-extra-inner' },
|
|
144
|
+
extra
|
|
145
|
+
)
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: 'render',
|
|
152
|
+
value: function render() {
|
|
153
|
+
var _classnames2,
|
|
154
|
+
_this2 = this;
|
|
155
|
+
|
|
156
|
+
var _props7 = this.props,
|
|
157
|
+
prefixCls = _props7.prefixCls,
|
|
158
|
+
className = _props7.className,
|
|
159
|
+
borderType = _props7.borderType,
|
|
160
|
+
badgePosition = _props7.badgePosition,
|
|
161
|
+
_onClick = _props7.onClick;
|
|
162
|
+
|
|
163
|
+
return _react2.default.createElement(
|
|
164
|
+
'div',
|
|
165
|
+
{
|
|
166
|
+
className: (0, _classnames4.default)((_classnames2 = {}, _defineProperty(_classnames2, prefixCls, true), _defineProperty(_classnames2, className, !!className), _defineProperty(_classnames2, borderType, !!borderType), _classnames2)),
|
|
167
|
+
onClick: function onClick() {
|
|
168
|
+
_onClick(_this2.props);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
this.renderImg(),
|
|
172
|
+
this.renderAvatar(),
|
|
173
|
+
_react2.default.createElement(
|
|
174
|
+
'div',
|
|
175
|
+
{ className: prefixCls + '-content' },
|
|
176
|
+
this.renderTitle(),
|
|
177
|
+
this.renderDes()
|
|
178
|
+
),
|
|
179
|
+
badgePosition === 'indicator' ? this.renderBadge() : null,
|
|
180
|
+
this.renderExtra()
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}]);
|
|
184
|
+
|
|
185
|
+
return Item;
|
|
186
|
+
}(_react2.default.Component), _class.propTypes = {
|
|
187
|
+
prefixCls: _propTypes2.default.string,
|
|
188
|
+
className: _propTypes2.default.string,
|
|
189
|
+
img: _propTypes2.default.string,
|
|
190
|
+
avatar: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
191
|
+
title: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
192
|
+
description: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
193
|
+
badge: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element, _propTypes2.default.number, _propTypes2.default.bool]),
|
|
194
|
+
badgePosition: _propTypes2.default.string,
|
|
195
|
+
desMaxLine: _propTypes2.default.number,
|
|
196
|
+
extra: _propTypes2.default.any,
|
|
197
|
+
borderType: _propTypes2.default.string,
|
|
198
|
+
onClick: _propTypes2.default.func
|
|
199
|
+
}, _class.defaultProps = {
|
|
200
|
+
prefixCls: 't-scroll-list-item',
|
|
201
|
+
desMaxLine: 2,
|
|
202
|
+
className: undefined,
|
|
203
|
+
img: undefined,
|
|
204
|
+
avatar: undefined,
|
|
205
|
+
title: undefined,
|
|
206
|
+
description: undefined,
|
|
207
|
+
badge: undefined,
|
|
208
|
+
badgePosition: 'followTitle', // indicator/followTitle/titleRight
|
|
209
|
+
extra: undefined,
|
|
210
|
+
borderType: '',
|
|
211
|
+
onClick: function onClick() {}
|
|
212
|
+
}, _temp);
|
|
213
|
+
exports.default = Item;
|