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
package/dist/index10.js
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { I as Input, o as omit } from './input.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { C as ConfigConsumer, c as classNames } from './config-provider.js';
|
|
4
|
+
import { I as Icon } from './icon.js';
|
|
5
|
+
import { B as Button } from './index7.js';
|
|
6
|
+
import { T as TextArea } from './TextArea.js';
|
|
7
|
+
|
|
8
|
+
function _defineProperty$2(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; }
|
|
9
|
+
|
|
10
|
+
var Group = function Group(props) {
|
|
11
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {
|
|
12
|
+
var _classNames;
|
|
13
|
+
|
|
14
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
15
|
+
var customizePrefixCls = props.prefixCls,
|
|
16
|
+
_props$className = props.className,
|
|
17
|
+
className = _props$className === void 0 ? '' : _props$className;
|
|
18
|
+
var prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
19
|
+
var cls = classNames(prefixCls, (_classNames = {}, _defineProperty$2(_classNames, "".concat(prefixCls, "-lg"), props.size === 'large'), _defineProperty$2(_classNames, "".concat(prefixCls, "-sm"), props.size === 'small'), _defineProperty$2(_classNames, "".concat(prefixCls, "-compact"), props.compact), _classNames), className);
|
|
20
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
21
|
+
className: cls,
|
|
22
|
+
style: props.style,
|
|
23
|
+
onMouseEnter: props.onMouseEnter,
|
|
24
|
+
onMouseLeave: props.onMouseLeave,
|
|
25
|
+
onFocus: props.onFocus,
|
|
26
|
+
onBlur: props.onBlur
|
|
27
|
+
}, props.children);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var isMobile = {exports: {}};
|
|
32
|
+
|
|
33
|
+
var hasRequiredIsMobile;
|
|
34
|
+
|
|
35
|
+
function requireIsMobile () {
|
|
36
|
+
if (hasRequiredIsMobile) return isMobile.exports;
|
|
37
|
+
hasRequiredIsMobile = 1;
|
|
38
|
+
|
|
39
|
+
isMobile.exports = isMobile$1;
|
|
40
|
+
isMobile.exports.isMobile = isMobile$1;
|
|
41
|
+
isMobile.exports.default = isMobile$1;
|
|
42
|
+
|
|
43
|
+
var mobileRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i;
|
|
44
|
+
|
|
45
|
+
var tabletRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;
|
|
46
|
+
|
|
47
|
+
function isMobile$1 (opts) {
|
|
48
|
+
if (!opts) opts = {};
|
|
49
|
+
var ua = opts.ua;
|
|
50
|
+
if (!ua && typeof navigator !== 'undefined') ua = navigator.userAgent;
|
|
51
|
+
if (ua && ua.headers && typeof ua.headers['user-agent'] === 'string') {
|
|
52
|
+
ua = ua.headers['user-agent'];
|
|
53
|
+
}
|
|
54
|
+
if (typeof ua !== 'string') return false
|
|
55
|
+
|
|
56
|
+
var result = opts.tablet ? tabletRE.test(ua) : mobileRE.test(ua);
|
|
57
|
+
|
|
58
|
+
if (
|
|
59
|
+
!result &&
|
|
60
|
+
opts.tablet &&
|
|
61
|
+
opts.featureDetect &&
|
|
62
|
+
navigator &&
|
|
63
|
+
navigator.maxTouchPoints > 1 &&
|
|
64
|
+
ua.indexOf('Macintosh') !== -1 &&
|
|
65
|
+
ua.indexOf('Safari') !== -1
|
|
66
|
+
) {
|
|
67
|
+
result = true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return result
|
|
71
|
+
}
|
|
72
|
+
return isMobile.exports;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var isMobileExports = requireIsMobile();
|
|
76
|
+
|
|
77
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
78
|
+
|
|
79
|
+
function _defineProperty$1(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; }
|
|
80
|
+
|
|
81
|
+
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
82
|
+
|
|
83
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
84
|
+
|
|
85
|
+
function _defineProperties$1(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); } }
|
|
86
|
+
|
|
87
|
+
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); return Constructor; }
|
|
88
|
+
|
|
89
|
+
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
|
|
90
|
+
|
|
91
|
+
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
|
|
92
|
+
|
|
93
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$1(this, result); }; }
|
|
94
|
+
|
|
95
|
+
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
|
|
96
|
+
|
|
97
|
+
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
98
|
+
|
|
99
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
100
|
+
|
|
101
|
+
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
|
|
102
|
+
|
|
103
|
+
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
104
|
+
var t = {};
|
|
105
|
+
|
|
106
|
+
for (var p in s) {
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
111
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
112
|
+
}
|
|
113
|
+
return t;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var Search = /*#__PURE__*/function (_React$Component) {
|
|
117
|
+
_inherits$1(Search, _React$Component);
|
|
118
|
+
|
|
119
|
+
var _super = _createSuper$1(Search);
|
|
120
|
+
|
|
121
|
+
function Search() {
|
|
122
|
+
var _this;
|
|
123
|
+
|
|
124
|
+
_classCallCheck$1(this, Search);
|
|
125
|
+
|
|
126
|
+
_this = _super.apply(this, arguments);
|
|
127
|
+
|
|
128
|
+
_this.saveInput = function (node) {
|
|
129
|
+
_this.input = node;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
_this.onChange = function (e) {
|
|
133
|
+
var _this$props = _this.props,
|
|
134
|
+
onChange = _this$props.onChange,
|
|
135
|
+
onSearch = _this$props.onSearch;
|
|
136
|
+
|
|
137
|
+
if (e && e.target && e.type === 'click' && onSearch) {
|
|
138
|
+
onSearch(e.target.value, e);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (onChange) {
|
|
142
|
+
onChange(e);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
_this.onSearch = function (e) {
|
|
147
|
+
var _this$props2 = _this.props,
|
|
148
|
+
onSearch = _this$props2.onSearch,
|
|
149
|
+
loading = _this$props2.loading,
|
|
150
|
+
disabled = _this$props2.disabled;
|
|
151
|
+
|
|
152
|
+
if (loading || disabled) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (onSearch) {
|
|
157
|
+
onSearch(_this.input.input.value, e);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (!isMobileExports.isMobile({
|
|
161
|
+
tablet: true
|
|
162
|
+
})) {
|
|
163
|
+
_this.input.focus();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
_this.renderLoading = function (prefixCls) {
|
|
168
|
+
var _this$props3 = _this.props,
|
|
169
|
+
enterButton = _this$props3.enterButton,
|
|
170
|
+
size = _this$props3.size;
|
|
171
|
+
|
|
172
|
+
if (enterButton) {
|
|
173
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
174
|
+
className: "".concat(prefixCls, "-button"),
|
|
175
|
+
type: "primary",
|
|
176
|
+
size: size,
|
|
177
|
+
key: "enterButton"
|
|
178
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
179
|
+
type: "loading"
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
184
|
+
className: "".concat(prefixCls, "-icon"),
|
|
185
|
+
type: "loading",
|
|
186
|
+
key: "loadingIcon"
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
_this.renderSuffix = function (prefixCls) {
|
|
191
|
+
var _this$props4 = _this.props,
|
|
192
|
+
suffix = _this$props4.suffix,
|
|
193
|
+
enterButton = _this$props4.enterButton,
|
|
194
|
+
loading = _this$props4.loading;
|
|
195
|
+
|
|
196
|
+
if (loading && !enterButton) {
|
|
197
|
+
return [suffix, _this.renderLoading(prefixCls)];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (enterButton) return suffix;
|
|
201
|
+
var icon = /*#__PURE__*/React.createElement(Icon, {
|
|
202
|
+
className: "".concat(prefixCls, "-icon"),
|
|
203
|
+
type: "search",
|
|
204
|
+
key: "searchIcon",
|
|
205
|
+
onClick: _this.onSearch
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
if (suffix) {
|
|
209
|
+
return [/*#__PURE__*/React.isValidElement(suffix) ? /*#__PURE__*/React.cloneElement(suffix, {
|
|
210
|
+
key: 'suffix'
|
|
211
|
+
}) : null, icon];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return icon;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
_this.renderAddonAfter = function (prefixCls) {
|
|
218
|
+
var _this$props5 = _this.props,
|
|
219
|
+
enterButton = _this$props5.enterButton,
|
|
220
|
+
size = _this$props5.size,
|
|
221
|
+
disabled = _this$props5.disabled,
|
|
222
|
+
addonAfter = _this$props5.addonAfter,
|
|
223
|
+
loading = _this$props5.loading;
|
|
224
|
+
var btnClassName = "".concat(prefixCls, "-button");
|
|
225
|
+
|
|
226
|
+
if (loading && enterButton) {
|
|
227
|
+
return [_this.renderLoading(prefixCls), addonAfter];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (!enterButton) return addonAfter;
|
|
231
|
+
var button;
|
|
232
|
+
var enterButtonAsElement = enterButton;
|
|
233
|
+
var isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
234
|
+
|
|
235
|
+
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
236
|
+
button = /*#__PURE__*/React.cloneElement(enterButtonAsElement, _extends$1({
|
|
237
|
+
onClick: _this.onSearch,
|
|
238
|
+
key: 'enterButton'
|
|
239
|
+
}, isAntdButton ? {
|
|
240
|
+
className: btnClassName,
|
|
241
|
+
size: size
|
|
242
|
+
} : {}));
|
|
243
|
+
} else {
|
|
244
|
+
button = /*#__PURE__*/React.createElement(Button, {
|
|
245
|
+
className: btnClassName,
|
|
246
|
+
type: "primary",
|
|
247
|
+
size: size,
|
|
248
|
+
disabled: disabled,
|
|
249
|
+
key: "enterButton",
|
|
250
|
+
onClick: _this.onSearch
|
|
251
|
+
}, enterButton === true ? /*#__PURE__*/React.createElement(Icon, {
|
|
252
|
+
type: "search"
|
|
253
|
+
}) : enterButton);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (addonAfter) {
|
|
257
|
+
return [button, /*#__PURE__*/React.isValidElement(addonAfter) ? /*#__PURE__*/React.cloneElement(addonAfter, {
|
|
258
|
+
key: 'addonAfter'
|
|
259
|
+
}) : null];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return button;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
_this.renderSearch = function (_ref) {
|
|
266
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
267
|
+
|
|
268
|
+
var _a = _this.props,
|
|
269
|
+
customizePrefixCls = _a.prefixCls,
|
|
270
|
+
customizeInputPrefixCls = _a.inputPrefixCls,
|
|
271
|
+
size = _a.size,
|
|
272
|
+
enterButton = _a.enterButton,
|
|
273
|
+
className = _a.className,
|
|
274
|
+
restProps = __rest$1(_a, ["prefixCls", "inputPrefixCls", "size", "enterButton", "className"]);
|
|
275
|
+
|
|
276
|
+
delete restProps.onSearch;
|
|
277
|
+
delete restProps.loading;
|
|
278
|
+
var prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
279
|
+
var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
280
|
+
var inputClassName;
|
|
281
|
+
|
|
282
|
+
if (enterButton) {
|
|
283
|
+
var _classNames;
|
|
284
|
+
|
|
285
|
+
inputClassName = classNames(prefixCls, className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-enter-button"), !!enterButton), _defineProperty$1(_classNames, "".concat(prefixCls, "-").concat(size), !!size), _classNames));
|
|
286
|
+
} else {
|
|
287
|
+
inputClassName = classNames(prefixCls, className);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return /*#__PURE__*/React.createElement(Input, _extends$1({
|
|
291
|
+
onPressEnter: _this.onSearch
|
|
292
|
+
}, restProps, {
|
|
293
|
+
size: size,
|
|
294
|
+
prefixCls: inputPrefixCls,
|
|
295
|
+
addonAfter: _this.renderAddonAfter(prefixCls),
|
|
296
|
+
suffix: _this.renderSuffix(prefixCls),
|
|
297
|
+
onChange: _this.onChange,
|
|
298
|
+
ref: _this.saveInput,
|
|
299
|
+
className: inputClassName
|
|
300
|
+
}));
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
return _this;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
_createClass$1(Search, [{
|
|
307
|
+
key: "focus",
|
|
308
|
+
value: function focus() {
|
|
309
|
+
this.input.focus();
|
|
310
|
+
}
|
|
311
|
+
}, {
|
|
312
|
+
key: "blur",
|
|
313
|
+
value: function blur() {
|
|
314
|
+
this.input.blur();
|
|
315
|
+
}
|
|
316
|
+
}, {
|
|
317
|
+
key: "render",
|
|
318
|
+
value: function render() {
|
|
319
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderSearch);
|
|
320
|
+
}
|
|
321
|
+
}]);
|
|
322
|
+
|
|
323
|
+
return Search;
|
|
324
|
+
}(React.Component);
|
|
325
|
+
Search.defaultProps = {
|
|
326
|
+
enterButton: false
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
330
|
+
|
|
331
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
332
|
+
|
|
333
|
+
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; }
|
|
334
|
+
|
|
335
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
336
|
+
|
|
337
|
+
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); } }
|
|
338
|
+
|
|
339
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); return Constructor; }
|
|
340
|
+
|
|
341
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
342
|
+
|
|
343
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
344
|
+
|
|
345
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
346
|
+
|
|
347
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
348
|
+
|
|
349
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
350
|
+
|
|
351
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
352
|
+
|
|
353
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
354
|
+
|
|
355
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
356
|
+
var t = {};
|
|
357
|
+
|
|
358
|
+
for (var p in s) {
|
|
359
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
363
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
364
|
+
}
|
|
365
|
+
return t;
|
|
366
|
+
};
|
|
367
|
+
var ActionMap = {
|
|
368
|
+
click: 'onClick',
|
|
369
|
+
hover: 'onMouseOver'
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
var Password = /*#__PURE__*/function (_React$Component) {
|
|
373
|
+
_inherits(Password, _React$Component);
|
|
374
|
+
|
|
375
|
+
var _super = _createSuper(Password);
|
|
376
|
+
|
|
377
|
+
function Password() {
|
|
378
|
+
var _this;
|
|
379
|
+
|
|
380
|
+
_classCallCheck(this, Password);
|
|
381
|
+
|
|
382
|
+
_this = _super.apply(this, arguments);
|
|
383
|
+
_this.state = {
|
|
384
|
+
visible: false
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
_this.onVisibleChange = function () {
|
|
388
|
+
var disabled = _this.props.disabled;
|
|
389
|
+
|
|
390
|
+
if (disabled) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
_this.setState(function (_ref) {
|
|
395
|
+
var visible = _ref.visible;
|
|
396
|
+
return {
|
|
397
|
+
visible: !visible
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
_this.saveInput = function (instance) {
|
|
403
|
+
if (instance && instance.input) {
|
|
404
|
+
_this.input = instance.input;
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
return _this;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
_createClass(Password, [{
|
|
412
|
+
key: "getIcon",
|
|
413
|
+
value: function getIcon() {
|
|
414
|
+
var _iconProps;
|
|
415
|
+
|
|
416
|
+
var _this$props = this.props,
|
|
417
|
+
prefixCls = _this$props.prefixCls,
|
|
418
|
+
action = _this$props.action;
|
|
419
|
+
var iconTrigger = ActionMap[action] || '';
|
|
420
|
+
var iconProps = (_iconProps = {}, _defineProperty(_iconProps, iconTrigger, this.onVisibleChange), _defineProperty(_iconProps, "className", "".concat(prefixCls, "-icon")), _defineProperty(_iconProps, "type", this.state.visible ? 'eye' : 'eye-invisible'), _defineProperty(_iconProps, "key", 'passwordIcon'), _defineProperty(_iconProps, "onMouseDown", function onMouseDown(e) {
|
|
421
|
+
// Prevent focused state lost
|
|
422
|
+
// https://github.com/ant-design/ant-design/issues/15173
|
|
423
|
+
e.preventDefault();
|
|
424
|
+
}), _iconProps);
|
|
425
|
+
return /*#__PURE__*/React.createElement(Icon, iconProps);
|
|
426
|
+
}
|
|
427
|
+
}, {
|
|
428
|
+
key: "focus",
|
|
429
|
+
value: function focus() {
|
|
430
|
+
this.input.focus();
|
|
431
|
+
}
|
|
432
|
+
}, {
|
|
433
|
+
key: "blur",
|
|
434
|
+
value: function blur() {
|
|
435
|
+
this.input.blur();
|
|
436
|
+
}
|
|
437
|
+
}, {
|
|
438
|
+
key: "select",
|
|
439
|
+
value: function select() {
|
|
440
|
+
this.input.select();
|
|
441
|
+
}
|
|
442
|
+
}, {
|
|
443
|
+
key: "render",
|
|
444
|
+
value: function render() {
|
|
445
|
+
var _a = this.props,
|
|
446
|
+
className = _a.className,
|
|
447
|
+
prefixCls = _a.prefixCls,
|
|
448
|
+
inputPrefixCls = _a.inputPrefixCls,
|
|
449
|
+
size = _a.size,
|
|
450
|
+
visibilityToggle = _a.visibilityToggle,
|
|
451
|
+
restProps = __rest(_a, ["className", "prefixCls", "inputPrefixCls", "size", "visibilityToggle"]);
|
|
452
|
+
|
|
453
|
+
var suffixIcon = visibilityToggle && this.getIcon();
|
|
454
|
+
var inputClassName = classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-").concat(size), !!size));
|
|
455
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, omit(restProps, ['suffix']), {
|
|
456
|
+
type: this.state.visible ? 'text' : 'password',
|
|
457
|
+
size: size,
|
|
458
|
+
className: inputClassName,
|
|
459
|
+
prefixCls: inputPrefixCls,
|
|
460
|
+
suffix: suffixIcon,
|
|
461
|
+
ref: this.saveInput
|
|
462
|
+
}));
|
|
463
|
+
}
|
|
464
|
+
}]);
|
|
465
|
+
|
|
466
|
+
return Password;
|
|
467
|
+
}(React.Component);
|
|
468
|
+
Password.defaultProps = {
|
|
469
|
+
inputPrefixCls: 'ant-input',
|
|
470
|
+
prefixCls: 'ant-input-password',
|
|
471
|
+
action: 'click',
|
|
472
|
+
visibilityToggle: true
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
Input.Group = Group;
|
|
476
|
+
Input.Search = Search;
|
|
477
|
+
Input.TextArea = TextArea;
|
|
478
|
+
Input.Password = Password;
|