antd3-esm 1.0.1
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/LICENSE +21 -0
- package/dist/Checkbox.js +164 -0
- package/dist/CommonMixin.js +816 -0
- package/dist/Divider.js +646 -0
- package/dist/Notification.js +279 -0
- package/dist/Pagination.js +1106 -0
- package/dist/PortalWrapper.js +347 -0
- package/dist/RowContext.js +5 -0
- package/dist/Sider.js +533 -0
- package/dist/TextArea.js +432 -0
- package/dist/_arrayMap.js +68 -0
- package/dist/_assignValue.js +95 -0
- package/dist/_copyArray.js +31 -0
- package/dist/_hasPath.js +53 -0
- package/dist/_overArg.js +437 -0
- package/dist/_stringToArray.js +136 -0
- package/dist/antd/es/affix.js +12 -0
- package/dist/antd/es/alert.js +5 -0
- package/dist/antd/es/anchor.js +466 -0
- package/dist/antd/es/auto-complete.js +5 -0
- package/dist/antd/es/avatar.js +5 -0
- package/dist/antd/es/back-top.js +5 -0
- package/dist/antd/es/badge.js +5 -0
- package/dist/antd/es/breadcrumb.js +18 -0
- package/dist/antd/es/button.js +12 -0
- package/dist/antd/es/calendar.js +953 -0
- package/dist/antd/es/card.js +5 -0
- package/dist/antd/es/carousel.js +5 -0
- package/dist/antd/es/cascader.js +1275 -0
- package/dist/antd/es/checkbox.js +11 -0
- package/dist/antd/es/col.js +4 -0
- package/dist/antd/es/collapse.js +688 -0
- package/dist/antd/es/comment.js +5 -0
- package/dist/antd/es/config-provider.js +2 -0
- package/dist/antd/es/date-picker.js +4322 -0
- package/dist/antd/es/descriptions.js +342 -0
- package/dist/antd/es/divider.js +53 -0
- package/dist/antd/es/drawer.js +1115 -0
- package/dist/antd/es/dropdown.js +14 -0
- package/dist/antd/es/empty.js +6 -0
- package/dist/antd/es/form.js +5008 -0
- package/dist/antd/es/grid.js +13 -0
- package/dist/antd/es/icon.js +6 -0
- package/dist/antd/es/input-number.js +5 -0
- package/dist/antd/es/input.js +16 -0
- package/dist/antd/es/layout.js +14 -0
- package/dist/antd/es/list.js +5 -0
- package/dist/antd/es/locale/ar_EG.js +102 -0
- package/dist/antd/es/locale/bg_BG.js +98 -0
- package/dist/antd/es/locale/ca_ES.js +96 -0
- package/dist/antd/es/locale/cs_CZ.js +96 -0
- package/dist/antd/es/locale/da_DK.js +98 -0
- package/dist/antd/es/locale/de_DE.js +98 -0
- package/dist/antd/es/locale/default.js +2 -0
- package/dist/antd/es/locale/el_GR.js +98 -0
- package/dist/antd/es/locale/en_GB.js +98 -0
- package/dist/antd/es/locale/en_US.js +2 -0
- package/dist/antd/es/locale/es_ES.js +114 -0
- package/dist/antd/es/locale/et_EE.js +98 -0
- package/dist/antd/es/locale/fa_IR.js +98 -0
- package/dist/antd/es/locale/fi_FI.js +99 -0
- package/dist/antd/es/locale/fr_BE.js +102 -0
- package/dist/antd/es/locale/fr_FR.js +102 -0
- package/dist/antd/es/locale/ga_IE.js +99 -0
- package/dist/antd/es/locale/he_IL.js +99 -0
- package/dist/antd/es/locale/hi_IN.js +107 -0
- package/dist/antd/es/locale/hr_HR.js +113 -0
- package/dist/antd/es/locale/hu_HU.js +99 -0
- package/dist/antd/es/locale/hy_AM.js +109 -0
- package/dist/antd/es/locale/id_ID.js +101 -0
- package/dist/antd/es/locale/is_IS.js +98 -0
- package/dist/antd/es/locale/it_IT.js +111 -0
- package/dist/antd/es/locale/ja_JP.js +96 -0
- package/dist/antd/es/locale/kn_IN.js +107 -0
- package/dist/antd/es/locale/ko_KR.js +98 -0
- package/dist/antd/es/locale/ku_IQ.js +98 -0
- package/dist/antd/es/locale/lv_LV.js +98 -0
- package/dist/antd/es/locale/mk_MK.js +113 -0
- package/dist/antd/es/locale/mn_MN.js +99 -0
- package/dist/antd/es/locale/ms_MY.js +118 -0
- package/dist/antd/es/locale/nb_NO.js +97 -0
- package/dist/antd/es/locale/ne_NP.js +44 -0
- package/dist/antd/es/locale/nl_BE.js +98 -0
- package/dist/antd/es/locale/nl_NL.js +117 -0
- package/dist/antd/es/locale/pl_PL.js +98 -0
- package/dist/antd/es/locale/pt_BR.js +104 -0
- package/dist/antd/es/locale/pt_PT.js +127 -0
- package/dist/antd/es/locale/ro_RO.js +118 -0
- package/dist/antd/es/locale/ru_RU.js +110 -0
- package/dist/antd/es/locale/sk_SK.js +118 -0
- package/dist/antd/es/locale/sl_SI.js +96 -0
- package/dist/antd/es/locale/sr_RS.js +97 -0
- package/dist/antd/es/locale/sv_SE.js +101 -0
- package/dist/antd/es/locale/ta_IN.js +119 -0
- package/dist/antd/es/locale/th_TH.js +117 -0
- package/dist/antd/es/locale/tr_TR.js +112 -0
- package/dist/antd/es/locale/uk_UA.js +97 -0
- package/dist/antd/es/locale/vi_VN.js +99 -0
- package/dist/antd/es/locale/zh_CN.js +104 -0
- package/dist/antd/es/locale/zh_TW.js +100 -0
- package/dist/antd/es/locale-provider.js +6 -0
- package/dist/antd/es/mention.js +23215 -0
- package/dist/antd/es/mentions.js +961 -0
- package/dist/antd/es/menu.js +5 -0
- package/dist/antd/es/message.js +161 -0
- package/dist/antd/es/modal.js +885 -0
- package/dist/antd/es/notification.js +216 -0
- package/dist/antd/es/page-header.js +350 -0
- package/dist/antd/es/pagination.js +15 -0
- package/dist/antd/es/popconfirm.js +215 -0
- package/dist/antd/es/popover.js +5 -0
- package/dist/antd/es/progress.js +10 -0
- package/dist/antd/es/radio.js +10 -0
- package/dist/antd/es/rate.js +5 -0
- package/dist/antd/es/result.js +828 -0
- package/dist/antd/es/row.js +9 -0
- package/dist/antd/es/select.js +5 -0
- package/dist/antd/es/skeleton.js +370 -0
- package/dist/antd/es/slider.js +5 -0
- package/dist/antd/es/spin.js +11 -0
- package/dist/antd/es/statistic.js +650 -0
- package/dist/antd/es/steps.js +5 -0
- package/dist/antd/es/style.js +5 -0
- package/dist/antd/es/switch.js +5 -0
- package/dist/antd/es/table.js +7057 -0
- package/dist/antd/es/tabs.js +5 -0
- package/dist/antd/es/tag.js +12 -0
- package/dist/antd/es/time-picker.js +10 -0
- package/dist/antd/es/timeline.js +206 -0
- package/dist/antd/es/tooltip.js +9 -0
- package/dist/antd/es/transfer.js +2508 -0
- package/dist/antd/es/tree-select.js +5 -0
- package/dist/antd/es/tree.js +10 -0
- package/dist/antd/es/typography.js +1246 -0
- package/dist/antd/es/upload.js +3418 -0
- package/dist/antd/es/version.js +7 -0
- package/dist/col.js +142 -0
- package/dist/config-provider.js +6949 -0
- package/dist/dropdown.js +442 -0
- package/dist/get.js +1043 -0
- package/dist/icon.js +6138 -0
- package/dist/identity.js +230 -0
- package/dist/index.js +462 -0
- package/dist/index10.js +478 -0
- package/dist/index11.js +232 -0
- package/dist/index12.js +2766 -0
- package/dist/index13.js +422 -0
- package/dist/index14.js +283 -0
- package/dist/index15.js +1755 -0
- package/dist/index2.js +374 -0
- package/dist/index3.js +407 -0
- package/dist/index4.js +522 -0
- package/dist/index5.js +601 -0
- package/dist/index6.js +601 -0
- package/dist/index7.js +364 -0
- package/dist/index8.js +436 -0
- package/dist/index9.js +130 -0
- package/dist/input.js +475 -0
- package/dist/isLength.js +402 -0
- package/dist/keys.js +292 -0
- package/dist/menu.js +8138 -0
- package/dist/progress.js +852 -0
- package/dist/raf.js +34 -0
- package/dist/responsiveObserve.js +444 -0
- package/dist/row.js +173 -0
- package/dist/scrollTo.js +66 -0
- package/dist/toInteger.js +123 -0
- package/dist/toString.js +84 -0
- package/dist/transButton.js +121 -0
- package/dist/tree.js +3017 -0
- package/dist/warning.js +55 -0
- package/dist/wave.js +230 -0
- package/dist/zh_CN.js +17 -0
- package/package.json +160 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { _ as _inherits, a as _classCallCheck, b as _possibleConstructorReturn, c as _createClass, d as _defineProperty, e as _extends, f as _objectWithoutProperties } from './icon.js';
|
|
2
|
+
import React__default, { Component } from 'react';
|
|
3
|
+
import { c as classNames, P as PropTypes } from './config-provider.js';
|
|
4
|
+
import ReactDOM__default from 'react-dom';
|
|
5
|
+
import { c as createChainedFunction, A as Animate } from './menu.js';
|
|
6
|
+
|
|
7
|
+
var Notice = function (_Component) {
|
|
8
|
+
_inherits(Notice, _Component);
|
|
9
|
+
|
|
10
|
+
function Notice() {
|
|
11
|
+
var _ref;
|
|
12
|
+
|
|
13
|
+
var _temp, _this, _ret;
|
|
14
|
+
|
|
15
|
+
_classCallCheck(this, Notice);
|
|
16
|
+
|
|
17
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
+
args[_key] = arguments[_key];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Notice.__proto__ || Object.getPrototypeOf(Notice)).call.apply(_ref, [this].concat(args))), _this), _this.close = function (e) {
|
|
22
|
+
if (e) {
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
}
|
|
25
|
+
_this.clearCloseTimer();
|
|
26
|
+
_this.props.onClose();
|
|
27
|
+
}, _this.startCloseTimer = function () {
|
|
28
|
+
if (_this.props.duration) {
|
|
29
|
+
_this.closeTimer = setTimeout(function () {
|
|
30
|
+
_this.close();
|
|
31
|
+
}, _this.props.duration * 1000);
|
|
32
|
+
}
|
|
33
|
+
}, _this.clearCloseTimer = function () {
|
|
34
|
+
if (_this.closeTimer) {
|
|
35
|
+
clearTimeout(_this.closeTimer);
|
|
36
|
+
_this.closeTimer = null;
|
|
37
|
+
}
|
|
38
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_createClass(Notice, [{
|
|
42
|
+
key: 'componentDidMount',
|
|
43
|
+
value: function componentDidMount() {
|
|
44
|
+
this.startCloseTimer();
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: 'componentDidUpdate',
|
|
48
|
+
value: function componentDidUpdate(prevProps) {
|
|
49
|
+
if (this.props.duration !== prevProps.duration || this.props.update) {
|
|
50
|
+
this.restartCloseTimer();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: 'componentWillUnmount',
|
|
55
|
+
value: function componentWillUnmount() {
|
|
56
|
+
this.clearCloseTimer();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: 'restartCloseTimer',
|
|
60
|
+
value: function restartCloseTimer() {
|
|
61
|
+
this.clearCloseTimer();
|
|
62
|
+
this.startCloseTimer();
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: 'render',
|
|
66
|
+
value: function render() {
|
|
67
|
+
var _className;
|
|
68
|
+
|
|
69
|
+
var props = this.props;
|
|
70
|
+
var componentClass = props.prefixCls + '-notice';
|
|
71
|
+
var className = (_className = {}, _defineProperty(_className, '' + componentClass, 1), _defineProperty(_className, componentClass + '-closable', props.closable), _defineProperty(_className, props.className, !!props.className), _className);
|
|
72
|
+
return React__default.createElement(
|
|
73
|
+
'div',
|
|
74
|
+
{
|
|
75
|
+
className: classNames(className),
|
|
76
|
+
style: props.style,
|
|
77
|
+
onMouseEnter: this.clearCloseTimer,
|
|
78
|
+
onMouseLeave: this.startCloseTimer,
|
|
79
|
+
onClick: props.onClick
|
|
80
|
+
},
|
|
81
|
+
React__default.createElement(
|
|
82
|
+
'div',
|
|
83
|
+
{ className: componentClass + '-content' },
|
|
84
|
+
props.children
|
|
85
|
+
),
|
|
86
|
+
props.closable ? React__default.createElement(
|
|
87
|
+
'a',
|
|
88
|
+
{ tabIndex: '0', onClick: this.close, className: componentClass + '-close' },
|
|
89
|
+
props.closeIcon || React__default.createElement('span', { className: componentClass + '-close-x' })
|
|
90
|
+
) : null
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}]);
|
|
94
|
+
|
|
95
|
+
return Notice;
|
|
96
|
+
}(Component);
|
|
97
|
+
|
|
98
|
+
Notice.propTypes = {
|
|
99
|
+
duration: PropTypes.number,
|
|
100
|
+
onClose: PropTypes.func,
|
|
101
|
+
children: PropTypes.any,
|
|
102
|
+
update: PropTypes.bool,
|
|
103
|
+
closeIcon: PropTypes.node
|
|
104
|
+
};
|
|
105
|
+
Notice.defaultProps = {
|
|
106
|
+
onEnd: function onEnd() {},
|
|
107
|
+
onClose: function onClose() {},
|
|
108
|
+
|
|
109
|
+
duration: 1.5,
|
|
110
|
+
style: {
|
|
111
|
+
right: '50%'
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var seed = 0;
|
|
116
|
+
var now = Date.now();
|
|
117
|
+
|
|
118
|
+
function getUuid() {
|
|
119
|
+
return 'rcNotification_' + now + '_' + seed++;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var Notification = function (_Component) {
|
|
123
|
+
_inherits(Notification, _Component);
|
|
124
|
+
|
|
125
|
+
function Notification() {
|
|
126
|
+
var _ref;
|
|
127
|
+
|
|
128
|
+
var _temp, _this, _ret;
|
|
129
|
+
|
|
130
|
+
_classCallCheck(this, Notification);
|
|
131
|
+
|
|
132
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
133
|
+
args[_key] = arguments[_key];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Notification.__proto__ || Object.getPrototypeOf(Notification)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
|
137
|
+
notices: []
|
|
138
|
+
}, _this.add = function (notice) {
|
|
139
|
+
var key = notice.key = notice.key || getUuid();
|
|
140
|
+
var maxCount = _this.props.maxCount;
|
|
141
|
+
|
|
142
|
+
_this.setState(function (previousState) {
|
|
143
|
+
var notices = previousState.notices;
|
|
144
|
+
var noticeIndex = notices.map(function (v) {
|
|
145
|
+
return v.key;
|
|
146
|
+
}).indexOf(key);
|
|
147
|
+
var updatedNotices = notices.concat();
|
|
148
|
+
if (noticeIndex !== -1) {
|
|
149
|
+
updatedNotices.splice(noticeIndex, 1, notice);
|
|
150
|
+
} else {
|
|
151
|
+
if (maxCount && notices.length >= maxCount) {
|
|
152
|
+
notice.updateKey = updatedNotices[0].updateKey || updatedNotices[0].key;
|
|
153
|
+
updatedNotices.shift();
|
|
154
|
+
}
|
|
155
|
+
updatedNotices.push(notice);
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
notices: updatedNotices
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
}, _this.remove = function (key) {
|
|
162
|
+
_this.setState(function (previousState) {
|
|
163
|
+
return {
|
|
164
|
+
notices: previousState.notices.filter(function (notice) {
|
|
165
|
+
return notice.key !== key;
|
|
166
|
+
})
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
_createClass(Notification, [{
|
|
173
|
+
key: 'getTransitionName',
|
|
174
|
+
value: function getTransitionName() {
|
|
175
|
+
var props = this.props;
|
|
176
|
+
var transitionName = props.transitionName;
|
|
177
|
+
if (!transitionName && props.animation) {
|
|
178
|
+
transitionName = props.prefixCls + '-' + props.animation;
|
|
179
|
+
}
|
|
180
|
+
return transitionName;
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: 'render',
|
|
184
|
+
value: function render() {
|
|
185
|
+
var _this2 = this,
|
|
186
|
+
_className;
|
|
187
|
+
|
|
188
|
+
var props = this.props;
|
|
189
|
+
var notices = this.state.notices;
|
|
190
|
+
|
|
191
|
+
var noticeNodes = notices.map(function (notice, index) {
|
|
192
|
+
var update = Boolean(index === notices.length - 1 && notice.updateKey);
|
|
193
|
+
var key = notice.updateKey ? notice.updateKey : notice.key;
|
|
194
|
+
var onClose = createChainedFunction(_this2.remove.bind(_this2, notice.key), notice.onClose);
|
|
195
|
+
return React__default.createElement(
|
|
196
|
+
Notice,
|
|
197
|
+
_extends({
|
|
198
|
+
prefixCls: props.prefixCls
|
|
199
|
+
}, notice, {
|
|
200
|
+
key: key,
|
|
201
|
+
update: update,
|
|
202
|
+
onClose: onClose,
|
|
203
|
+
onClick: notice.onClick,
|
|
204
|
+
closeIcon: props.closeIcon
|
|
205
|
+
}),
|
|
206
|
+
notice.content
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
var className = (_className = {}, _defineProperty(_className, props.prefixCls, 1), _defineProperty(_className, props.className, !!props.className), _className);
|
|
210
|
+
return React__default.createElement(
|
|
211
|
+
'div',
|
|
212
|
+
{ className: classNames(className), style: props.style },
|
|
213
|
+
React__default.createElement(
|
|
214
|
+
Animate,
|
|
215
|
+
{ transitionName: this.getTransitionName() },
|
|
216
|
+
noticeNodes
|
|
217
|
+
)
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}]);
|
|
221
|
+
|
|
222
|
+
return Notification;
|
|
223
|
+
}(Component);
|
|
224
|
+
|
|
225
|
+
Notification.propTypes = {
|
|
226
|
+
prefixCls: PropTypes.string,
|
|
227
|
+
transitionName: PropTypes.string,
|
|
228
|
+
animation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
229
|
+
style: PropTypes.object,
|
|
230
|
+
maxCount: PropTypes.number,
|
|
231
|
+
closeIcon: PropTypes.node
|
|
232
|
+
};
|
|
233
|
+
Notification.defaultProps = {
|
|
234
|
+
prefixCls: 'rc-notification',
|
|
235
|
+
animation: 'fade',
|
|
236
|
+
style: {
|
|
237
|
+
top: 65,
|
|
238
|
+
left: '50%'
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
Notification.newInstance = function newNotificationInstance(properties, callback) {
|
|
244
|
+
var _ref2 = properties || {},
|
|
245
|
+
getContainer = _ref2.getContainer,
|
|
246
|
+
props = _objectWithoutProperties(_ref2, ['getContainer']);
|
|
247
|
+
|
|
248
|
+
var div = document.createElement('div');
|
|
249
|
+
if (getContainer) {
|
|
250
|
+
var root = getContainer();
|
|
251
|
+
root.appendChild(div);
|
|
252
|
+
} else {
|
|
253
|
+
document.body.appendChild(div);
|
|
254
|
+
}
|
|
255
|
+
var called = false;
|
|
256
|
+
function ref(notification) {
|
|
257
|
+
if (called) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
called = true;
|
|
261
|
+
callback({
|
|
262
|
+
notice: function notice(noticeProps) {
|
|
263
|
+
notification.add(noticeProps);
|
|
264
|
+
},
|
|
265
|
+
removeNotice: function removeNotice(key) {
|
|
266
|
+
notification.remove(key);
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
component: notification,
|
|
270
|
+
destroy: function destroy() {
|
|
271
|
+
ReactDOM__default.unmountComponentAtNode(div);
|
|
272
|
+
div.parentNode.removeChild(div);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
ReactDOM__default.render(React__default.createElement(Notification, _extends({}, props, { ref: ref })), div);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export { Notification as N };
|