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.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Checkbox.js +164 -0
  3. package/dist/CommonMixin.js +816 -0
  4. package/dist/Divider.js +646 -0
  5. package/dist/Notification.js +279 -0
  6. package/dist/Pagination.js +1106 -0
  7. package/dist/PortalWrapper.js +347 -0
  8. package/dist/RowContext.js +5 -0
  9. package/dist/Sider.js +533 -0
  10. package/dist/TextArea.js +432 -0
  11. package/dist/_arrayMap.js +68 -0
  12. package/dist/_assignValue.js +95 -0
  13. package/dist/_copyArray.js +31 -0
  14. package/dist/_hasPath.js +53 -0
  15. package/dist/_overArg.js +437 -0
  16. package/dist/_stringToArray.js +136 -0
  17. package/dist/antd/es/affix.js +12 -0
  18. package/dist/antd/es/alert.js +5 -0
  19. package/dist/antd/es/anchor.js +466 -0
  20. package/dist/antd/es/auto-complete.js +5 -0
  21. package/dist/antd/es/avatar.js +5 -0
  22. package/dist/antd/es/back-top.js +5 -0
  23. package/dist/antd/es/badge.js +5 -0
  24. package/dist/antd/es/breadcrumb.js +18 -0
  25. package/dist/antd/es/button.js +12 -0
  26. package/dist/antd/es/calendar.js +953 -0
  27. package/dist/antd/es/card.js +5 -0
  28. package/dist/antd/es/carousel.js +5 -0
  29. package/dist/antd/es/cascader.js +1275 -0
  30. package/dist/antd/es/checkbox.js +11 -0
  31. package/dist/antd/es/col.js +4 -0
  32. package/dist/antd/es/collapse.js +688 -0
  33. package/dist/antd/es/comment.js +5 -0
  34. package/dist/antd/es/config-provider.js +2 -0
  35. package/dist/antd/es/date-picker.js +4322 -0
  36. package/dist/antd/es/descriptions.js +342 -0
  37. package/dist/antd/es/divider.js +53 -0
  38. package/dist/antd/es/drawer.js +1115 -0
  39. package/dist/antd/es/dropdown.js +14 -0
  40. package/dist/antd/es/empty.js +6 -0
  41. package/dist/antd/es/form.js +5008 -0
  42. package/dist/antd/es/grid.js +13 -0
  43. package/dist/antd/es/icon.js +6 -0
  44. package/dist/antd/es/input-number.js +5 -0
  45. package/dist/antd/es/input.js +16 -0
  46. package/dist/antd/es/layout.js +14 -0
  47. package/dist/antd/es/list.js +5 -0
  48. package/dist/antd/es/locale/ar_EG.js +102 -0
  49. package/dist/antd/es/locale/bg_BG.js +98 -0
  50. package/dist/antd/es/locale/ca_ES.js +96 -0
  51. package/dist/antd/es/locale/cs_CZ.js +96 -0
  52. package/dist/antd/es/locale/da_DK.js +98 -0
  53. package/dist/antd/es/locale/de_DE.js +98 -0
  54. package/dist/antd/es/locale/default.js +2 -0
  55. package/dist/antd/es/locale/el_GR.js +98 -0
  56. package/dist/antd/es/locale/en_GB.js +98 -0
  57. package/dist/antd/es/locale/en_US.js +2 -0
  58. package/dist/antd/es/locale/es_ES.js +114 -0
  59. package/dist/antd/es/locale/et_EE.js +98 -0
  60. package/dist/antd/es/locale/fa_IR.js +98 -0
  61. package/dist/antd/es/locale/fi_FI.js +99 -0
  62. package/dist/antd/es/locale/fr_BE.js +102 -0
  63. package/dist/antd/es/locale/fr_FR.js +102 -0
  64. package/dist/antd/es/locale/ga_IE.js +99 -0
  65. package/dist/antd/es/locale/he_IL.js +99 -0
  66. package/dist/antd/es/locale/hi_IN.js +107 -0
  67. package/dist/antd/es/locale/hr_HR.js +113 -0
  68. package/dist/antd/es/locale/hu_HU.js +99 -0
  69. package/dist/antd/es/locale/hy_AM.js +109 -0
  70. package/dist/antd/es/locale/id_ID.js +101 -0
  71. package/dist/antd/es/locale/is_IS.js +98 -0
  72. package/dist/antd/es/locale/it_IT.js +111 -0
  73. package/dist/antd/es/locale/ja_JP.js +96 -0
  74. package/dist/antd/es/locale/kn_IN.js +107 -0
  75. package/dist/antd/es/locale/ko_KR.js +98 -0
  76. package/dist/antd/es/locale/ku_IQ.js +98 -0
  77. package/dist/antd/es/locale/lv_LV.js +98 -0
  78. package/dist/antd/es/locale/mk_MK.js +113 -0
  79. package/dist/antd/es/locale/mn_MN.js +99 -0
  80. package/dist/antd/es/locale/ms_MY.js +118 -0
  81. package/dist/antd/es/locale/nb_NO.js +97 -0
  82. package/dist/antd/es/locale/ne_NP.js +44 -0
  83. package/dist/antd/es/locale/nl_BE.js +98 -0
  84. package/dist/antd/es/locale/nl_NL.js +117 -0
  85. package/dist/antd/es/locale/pl_PL.js +98 -0
  86. package/dist/antd/es/locale/pt_BR.js +104 -0
  87. package/dist/antd/es/locale/pt_PT.js +127 -0
  88. package/dist/antd/es/locale/ro_RO.js +118 -0
  89. package/dist/antd/es/locale/ru_RU.js +110 -0
  90. package/dist/antd/es/locale/sk_SK.js +118 -0
  91. package/dist/antd/es/locale/sl_SI.js +96 -0
  92. package/dist/antd/es/locale/sr_RS.js +97 -0
  93. package/dist/antd/es/locale/sv_SE.js +101 -0
  94. package/dist/antd/es/locale/ta_IN.js +119 -0
  95. package/dist/antd/es/locale/th_TH.js +117 -0
  96. package/dist/antd/es/locale/tr_TR.js +112 -0
  97. package/dist/antd/es/locale/uk_UA.js +97 -0
  98. package/dist/antd/es/locale/vi_VN.js +99 -0
  99. package/dist/antd/es/locale/zh_CN.js +104 -0
  100. package/dist/antd/es/locale/zh_TW.js +100 -0
  101. package/dist/antd/es/locale-provider.js +6 -0
  102. package/dist/antd/es/mention.js +23215 -0
  103. package/dist/antd/es/mentions.js +961 -0
  104. package/dist/antd/es/menu.js +5 -0
  105. package/dist/antd/es/message.js +161 -0
  106. package/dist/antd/es/modal.js +885 -0
  107. package/dist/antd/es/notification.js +216 -0
  108. package/dist/antd/es/page-header.js +350 -0
  109. package/dist/antd/es/pagination.js +15 -0
  110. package/dist/antd/es/popconfirm.js +215 -0
  111. package/dist/antd/es/popover.js +5 -0
  112. package/dist/antd/es/progress.js +10 -0
  113. package/dist/antd/es/radio.js +10 -0
  114. package/dist/antd/es/rate.js +5 -0
  115. package/dist/antd/es/result.js +828 -0
  116. package/dist/antd/es/row.js +9 -0
  117. package/dist/antd/es/select.js +5 -0
  118. package/dist/antd/es/skeleton.js +370 -0
  119. package/dist/antd/es/slider.js +5 -0
  120. package/dist/antd/es/spin.js +11 -0
  121. package/dist/antd/es/statistic.js +650 -0
  122. package/dist/antd/es/steps.js +5 -0
  123. package/dist/antd/es/style.js +5 -0
  124. package/dist/antd/es/switch.js +5 -0
  125. package/dist/antd/es/table.js +7057 -0
  126. package/dist/antd/es/tabs.js +5 -0
  127. package/dist/antd/es/tag.js +12 -0
  128. package/dist/antd/es/time-picker.js +10 -0
  129. package/dist/antd/es/timeline.js +206 -0
  130. package/dist/antd/es/tooltip.js +9 -0
  131. package/dist/antd/es/transfer.js +2508 -0
  132. package/dist/antd/es/tree-select.js +5 -0
  133. package/dist/antd/es/tree.js +10 -0
  134. package/dist/antd/es/typography.js +1246 -0
  135. package/dist/antd/es/upload.js +3418 -0
  136. package/dist/antd/es/version.js +7 -0
  137. package/dist/col.js +142 -0
  138. package/dist/config-provider.js +6949 -0
  139. package/dist/dropdown.js +442 -0
  140. package/dist/get.js +1043 -0
  141. package/dist/icon.js +6138 -0
  142. package/dist/identity.js +230 -0
  143. package/dist/index.js +462 -0
  144. package/dist/index10.js +478 -0
  145. package/dist/index11.js +232 -0
  146. package/dist/index12.js +2766 -0
  147. package/dist/index13.js +422 -0
  148. package/dist/index14.js +283 -0
  149. package/dist/index15.js +1755 -0
  150. package/dist/index2.js +374 -0
  151. package/dist/index3.js +407 -0
  152. package/dist/index4.js +522 -0
  153. package/dist/index5.js +601 -0
  154. package/dist/index6.js +601 -0
  155. package/dist/index7.js +364 -0
  156. package/dist/index8.js +436 -0
  157. package/dist/index9.js +130 -0
  158. package/dist/input.js +475 -0
  159. package/dist/isLength.js +402 -0
  160. package/dist/keys.js +292 -0
  161. package/dist/menu.js +8138 -0
  162. package/dist/progress.js +852 -0
  163. package/dist/raf.js +34 -0
  164. package/dist/responsiveObserve.js +444 -0
  165. package/dist/row.js +173 -0
  166. package/dist/scrollTo.js +66 -0
  167. package/dist/toInteger.js +123 -0
  168. package/dist/toString.js +84 -0
  169. package/dist/transButton.js +121 -0
  170. package/dist/tree.js +3017 -0
  171. package/dist/warning.js +55 -0
  172. package/dist/wave.js +230 -0
  173. package/dist/zh_CN.js +17 -0
  174. package/package.json +160 -0
@@ -0,0 +1,283 @@
1
+ import * as React from 'react';
2
+ import { c as classNames, C as ConfigConsumer } from './config-provider.js';
3
+ import { t as tuple, o as omit } from './input.js';
4
+ import { p as polyfill } from './menu.js';
5
+ import { I as Icon } from './icon.js';
6
+ import { W as Wave } from './wave.js';
7
+
8
+ var PresetColorTypes = tuple('pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime');
9
+
10
+ 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); }
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
+
18
+ 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); } }
19
+
20
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); return Constructor; }
21
+
22
+ 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); }
23
+
24
+ function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
25
+
26
+ 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); }; }
27
+
28
+ function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
29
+
30
+ function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
31
+
32
+ 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; } }
33
+
34
+ function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
35
+
36
+ var __rest$1 = undefined && undefined.__rest || function (s, e) {
37
+ var t = {};
38
+
39
+ for (var p in s) {
40
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
41
+ }
42
+
43
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
44
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
45
+ }
46
+ return t;
47
+ };
48
+
49
+ var CheckableTag = /*#__PURE__*/function (_React$Component) {
50
+ _inherits$1(CheckableTag, _React$Component);
51
+
52
+ var _super = _createSuper$1(CheckableTag);
53
+
54
+ function CheckableTag() {
55
+ var _this;
56
+
57
+ _classCallCheck$1(this, CheckableTag);
58
+
59
+ _this = _super.apply(this, arguments);
60
+
61
+ _this.handleClick = function () {
62
+ var _this$props = _this.props,
63
+ checked = _this$props.checked,
64
+ onChange = _this$props.onChange;
65
+
66
+ if (onChange) {
67
+ onChange(!checked);
68
+ }
69
+ };
70
+
71
+ _this.renderCheckableTag = function (_ref) {
72
+ var _classNames;
73
+
74
+ var getPrefixCls = _ref.getPrefixCls;
75
+
76
+ var _a = _this.props,
77
+ customizePrefixCls = _a.prefixCls,
78
+ className = _a.className,
79
+ checked = _a.checked,
80
+ restProps = __rest$1(_a, ["prefixCls", "className", "checked"]);
81
+
82
+ var prefixCls = getPrefixCls('tag', customizePrefixCls);
83
+ var cls = classNames(prefixCls, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-checkable"), true), _defineProperty$1(_classNames, "".concat(prefixCls, "-checkable-checked"), checked), _classNames), className);
84
+ delete restProps.onChange; // TypeScript cannot check delete now.
85
+
86
+ return /*#__PURE__*/React.createElement("span", _extends$1({}, restProps, {
87
+ className: cls,
88
+ onClick: _this.handleClick
89
+ }));
90
+ };
91
+
92
+ return _this;
93
+ }
94
+
95
+ _createClass$1(CheckableTag, [{
96
+ key: "render",
97
+ value: function render() {
98
+ return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderCheckableTag);
99
+ }
100
+ }]);
101
+
102
+ return CheckableTag;
103
+ }(React.Component);
104
+
105
+ 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); }
106
+
107
+ 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; }
108
+
109
+ 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); }
110
+
111
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
112
+
113
+ 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); } }
114
+
115
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
116
+
117
+ 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); }
118
+
119
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
120
+
121
+ 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); }; }
122
+
123
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
124
+
125
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
126
+
127
+ 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; } }
128
+
129
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
130
+
131
+ var __rest = undefined && undefined.__rest || function (s, e) {
132
+ var t = {};
133
+
134
+ for (var p in s) {
135
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
136
+ }
137
+
138
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
139
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
140
+ }
141
+ return t;
142
+ };
143
+ var PresetColorRegex = new RegExp("^(".concat(PresetColorTypes.join('|'), ")(-inverse)?$"));
144
+
145
+ var Tag = /*#__PURE__*/function (_React$Component) {
146
+ _inherits(Tag, _React$Component);
147
+
148
+ var _super = _createSuper(Tag);
149
+
150
+ function Tag(props) {
151
+ var _this;
152
+
153
+ _classCallCheck(this, Tag);
154
+
155
+ _this = _super.call(this, props);
156
+ _this.state = {
157
+ visible: true
158
+ };
159
+
160
+ _this.handleIconClick = function (e) {
161
+ e.stopPropagation();
162
+
163
+ _this.setVisible(false, e);
164
+ };
165
+
166
+ _this.renderTag = function (configProps) {
167
+ var _a = _this.props,
168
+ children = _a.children,
169
+ otherProps = __rest(_a, ["children"]);
170
+
171
+ var isNeedWave = 'onClick' in otherProps || children && children.type === 'a';
172
+ var tagProps = omit(otherProps, ['onClose', 'afterClose', 'color', 'visible', 'closable', 'prefixCls']);
173
+ return isNeedWave ? /*#__PURE__*/React.createElement(Wave, null, /*#__PURE__*/React.createElement("span", _extends({}, tagProps, {
174
+ className: _this.getTagClassName(configProps),
175
+ style: _this.getTagStyle()
176
+ }), children, _this.renderCloseIcon())) : /*#__PURE__*/React.createElement("span", _extends({}, tagProps, {
177
+ className: _this.getTagClassName(configProps),
178
+ style: _this.getTagStyle()
179
+ }), children, _this.renderCloseIcon());
180
+ };
181
+ return _this;
182
+ }
183
+
184
+ _createClass(Tag, [{
185
+ key: "getTagStyle",
186
+ value: function getTagStyle() {
187
+ var _this$props = this.props,
188
+ color = _this$props.color,
189
+ style = _this$props.style;
190
+ var isPresetColor = this.isPresetColor();
191
+ return _extends({
192
+ backgroundColor: color && !isPresetColor ? color : undefined
193
+ }, style);
194
+ }
195
+ }, {
196
+ key: "getTagClassName",
197
+ value: function getTagClassName(_ref) {
198
+ var _classNames;
199
+
200
+ var getPrefixCls = _ref.getPrefixCls;
201
+ var _this$props2 = this.props,
202
+ customizePrefixCls = _this$props2.prefixCls,
203
+ className = _this$props2.className,
204
+ color = _this$props2.color;
205
+ var visible = this.state.visible;
206
+ var isPresetColor = this.isPresetColor();
207
+ var prefixCls = getPrefixCls('tag', customizePrefixCls);
208
+ return classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(color), isPresetColor), _defineProperty(_classNames, "".concat(prefixCls, "-has-color"), color && !isPresetColor), _defineProperty(_classNames, "".concat(prefixCls, "-hidden"), !visible), _classNames), className);
209
+ }
210
+ }, {
211
+ key: "setVisible",
212
+ value: function setVisible(visible, e) {
213
+ var _this$props3 = this.props,
214
+ onClose = _this$props3.onClose,
215
+ afterClose = _this$props3.afterClose;
216
+
217
+ if (onClose) {
218
+ onClose(e);
219
+ }
220
+
221
+ if (afterClose && !onClose) {
222
+ // next version remove.
223
+ afterClose();
224
+ }
225
+
226
+ if (e.defaultPrevented) {
227
+ return;
228
+ }
229
+
230
+ if (!('visible' in this.props)) {
231
+ this.setState({
232
+ visible: visible
233
+ });
234
+ }
235
+ }
236
+ }, {
237
+ key: "isPresetColor",
238
+ value: function isPresetColor() {
239
+ var color = this.props.color;
240
+
241
+ if (!color) {
242
+ return false;
243
+ }
244
+
245
+ return PresetColorRegex.test(color);
246
+ }
247
+ }, {
248
+ key: "renderCloseIcon",
249
+ value: function renderCloseIcon() {
250
+ var closable = this.props.closable;
251
+ return closable ? /*#__PURE__*/React.createElement(Icon, {
252
+ type: "close",
253
+ onClick: this.handleIconClick
254
+ }) : null;
255
+ }
256
+ }, {
257
+ key: "render",
258
+ value: function render() {
259
+ return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderTag);
260
+ }
261
+ }], [{
262
+ key: "getDerivedStateFromProps",
263
+ value: function getDerivedStateFromProps(nextProps) {
264
+ if ('visible' in nextProps) {
265
+ return {
266
+ visible: nextProps.visible
267
+ };
268
+ }
269
+
270
+ return null;
271
+ }
272
+ }]);
273
+
274
+ return Tag;
275
+ }(React.Component);
276
+
277
+ Tag.CheckableTag = CheckableTag;
278
+ Tag.defaultProps = {
279
+ closable: false
280
+ };
281
+ polyfill(Tag);
282
+
283
+ export { Tag as T };