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,432 @@
1
+ import * as React from 'react';
2
+ import { p as polyfill } from './menu.js';
3
+ import { o as omit, r as resolveOnChange, C as ClearableLabeledInput, f as fixControlledValue } from './input.js';
4
+ import { R as ResizeObserver } from './index2.js';
5
+ import { c as classNames, C as ConfigConsumer } from './config-provider.js';
6
+ import { w as wrapperRaf } from './raf.js';
7
+
8
+ // Thanks to https://github.com/andreypopp/react-textarea-autosize/
9
+
10
+ /**
11
+ * calculateNodeHeight(uiTextNode, useCache = false)
12
+ */
13
+ var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n";
14
+ var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
15
+ var computedStyleCache = {};
16
+ var hiddenTextarea;
17
+ function calculateNodeStyling(node) {
18
+ var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
19
+ var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
20
+
21
+ if (useCache && computedStyleCache[nodeRef]) {
22
+ return computedStyleCache[nodeRef];
23
+ }
24
+
25
+ var style = window.getComputedStyle(node);
26
+ var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
27
+ var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
28
+ var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
29
+ var sizingStyle = SIZING_STYLE.map(function (name) {
30
+ return "".concat(name, ":").concat(style.getPropertyValue(name));
31
+ }).join(';');
32
+ var nodeInfo = {
33
+ sizingStyle: sizingStyle,
34
+ paddingSize: paddingSize,
35
+ borderSize: borderSize,
36
+ boxSizing: boxSizing
37
+ };
38
+
39
+ if (useCache && nodeRef) {
40
+ computedStyleCache[nodeRef] = nodeInfo;
41
+ }
42
+
43
+ return nodeInfo;
44
+ }
45
+ function calculateNodeHeight(uiTextNode) {
46
+ var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
47
+ var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
48
+ var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
49
+
50
+ if (!hiddenTextarea) {
51
+ hiddenTextarea = document.createElement('textarea');
52
+ document.body.appendChild(hiddenTextarea);
53
+ } // Fix wrap="off" issue
54
+ // https://github.com/ant-design/ant-design/issues/6577
55
+
56
+
57
+ if (uiTextNode.getAttribute('wrap')) {
58
+ hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
59
+ } else {
60
+ hiddenTextarea.removeAttribute('wrap');
61
+ } // Copy all CSS properties that have an impact on the height of the content in
62
+ // the textbox
63
+
64
+
65
+ var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
66
+ paddingSize = _calculateNodeStyling.paddingSize,
67
+ borderSize = _calculateNodeStyling.borderSize,
68
+ boxSizing = _calculateNodeStyling.boxSizing,
69
+ sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise
70
+ // text-lines will not calculated properly as the shadow will technically be
71
+ // narrower for content
72
+
73
+
74
+ hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
75
+ hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
76
+ var minHeight = Number.MIN_SAFE_INTEGER;
77
+ var maxHeight = Number.MAX_SAFE_INTEGER;
78
+ var height = hiddenTextarea.scrollHeight;
79
+ var overflowY;
80
+
81
+ if (boxSizing === 'border-box') {
82
+ // border-box: add border, since height = content + padding + border
83
+ height += borderSize;
84
+ } else if (boxSizing === 'content-box') {
85
+ // remove padding, since height = content
86
+ height -= paddingSize;
87
+ }
88
+
89
+ if (minRows !== null || maxRows !== null) {
90
+ // measure height of a textarea with a single row
91
+ hiddenTextarea.value = ' ';
92
+ var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
93
+
94
+ if (minRows !== null) {
95
+ minHeight = singleRowHeight * minRows;
96
+
97
+ if (boxSizing === 'border-box') {
98
+ minHeight = minHeight + paddingSize + borderSize;
99
+ }
100
+
101
+ height = Math.max(minHeight, height);
102
+ }
103
+
104
+ if (maxRows !== null) {
105
+ maxHeight = singleRowHeight * maxRows;
106
+
107
+ if (boxSizing === 'border-box') {
108
+ maxHeight = maxHeight + paddingSize + borderSize;
109
+ }
110
+
111
+ overflowY = height > maxHeight ? '' : 'hidden';
112
+ height = Math.min(maxHeight, height);
113
+ }
114
+ }
115
+
116
+ return {
117
+ height: height,
118
+ minHeight: minHeight,
119
+ maxHeight: maxHeight,
120
+ overflowY: overflowY
121
+ };
122
+ }
123
+
124
+ 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); }
125
+
126
+ 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); }
127
+
128
+ 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; }
129
+
130
+ function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
131
+
132
+ 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); } }
133
+
134
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); return Constructor; }
135
+
136
+ 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); }
137
+
138
+ function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
139
+
140
+ 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); }; }
141
+
142
+ function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
143
+
144
+ function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
145
+
146
+ 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; } }
147
+
148
+ function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
149
+
150
+ var ResizableTextArea = /*#__PURE__*/function (_React$Component) {
151
+ _inherits$1(ResizableTextArea, _React$Component);
152
+
153
+ var _super = _createSuper$1(ResizableTextArea);
154
+
155
+ function ResizableTextArea(props) {
156
+ var _this;
157
+
158
+ _classCallCheck$1(this, ResizableTextArea);
159
+
160
+ _this = _super.call(this, props);
161
+
162
+ _this.saveTextArea = function (textArea) {
163
+ _this.textArea = textArea;
164
+ };
165
+
166
+ _this.resizeOnNextFrame = function () {
167
+ wrapperRaf.cancel(_this.nextFrameActionId);
168
+ _this.nextFrameActionId = wrapperRaf(_this.resizeTextarea);
169
+ };
170
+
171
+ _this.resizeTextarea = function () {
172
+ var autoSize = _this.props.autoSize || _this.props.autosize;
173
+
174
+ if (!autoSize || !_this.textArea) {
175
+ return;
176
+ }
177
+
178
+ var minRows = autoSize.minRows,
179
+ maxRows = autoSize.maxRows;
180
+ var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows);
181
+
182
+ _this.setState({
183
+ textareaStyles: textareaStyles,
184
+ resizing: true
185
+ }, function () {
186
+ wrapperRaf.cancel(_this.resizeFrameId);
187
+ _this.resizeFrameId = wrapperRaf(function () {
188
+ _this.setState({
189
+ resizing: false
190
+ });
191
+
192
+ _this.fixFirefoxAutoScroll();
193
+ });
194
+ });
195
+ };
196
+
197
+ _this.renderTextArea = function () {
198
+ var _this$props = _this.props,
199
+ prefixCls = _this$props.prefixCls,
200
+ autoSize = _this$props.autoSize,
201
+ autosize = _this$props.autosize,
202
+ className = _this$props.className,
203
+ disabled = _this$props.disabled;
204
+ var _this$state = _this.state,
205
+ textareaStyles = _this$state.textareaStyles,
206
+ resizing = _this$state.resizing;
207
+ var otherProps = omit(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'autosize', 'defaultValue', 'allowClear']);
208
+ var cls = classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-disabled"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776
209
+ // Make sure it could be reset when using form.getFieldDecorator
210
+
211
+ if ('value' in otherProps) {
212
+ otherProps.value = otherProps.value || '';
213
+ }
214
+
215
+ var style = _extends$1(_extends$1(_extends$1({}, _this.props.style), textareaStyles), resizing ? {
216
+ overflowX: 'hidden',
217
+ overflowY: 'hidden'
218
+ } : null);
219
+
220
+ return /*#__PURE__*/React.createElement(ResizeObserver, {
221
+ onResize: _this.resizeOnNextFrame,
222
+ disabled: !(autoSize || autosize)
223
+ }, /*#__PURE__*/React.createElement("textarea", _extends$1({}, otherProps, {
224
+ className: cls,
225
+ style: style,
226
+ ref: _this.saveTextArea
227
+ })));
228
+ };
229
+
230
+ _this.state = {
231
+ textareaStyles: {},
232
+ resizing: false
233
+ };
234
+ return _this;
235
+ }
236
+
237
+ _createClass$1(ResizableTextArea, [{
238
+ key: "componentDidMount",
239
+ value: function componentDidMount() {
240
+ this.resizeTextarea();
241
+ }
242
+ }, {
243
+ key: "componentDidUpdate",
244
+ value: function componentDidUpdate(prevProps) {
245
+ // Re-render with the new content then recalculate the height as required.
246
+ if (prevProps.value !== this.props.value) {
247
+ this.resizeTextarea();
248
+ }
249
+ }
250
+ }, {
251
+ key: "componentWillUnmount",
252
+ value: function componentWillUnmount() {
253
+ wrapperRaf.cancel(this.nextFrameActionId);
254
+ wrapperRaf.cancel(this.resizeFrameId);
255
+ } // https://github.com/ant-design/ant-design/issues/21870
256
+
257
+ }, {
258
+ key: "fixFirefoxAutoScroll",
259
+ value: function fixFirefoxAutoScroll() {
260
+ try {
261
+ if (document.activeElement === this.textArea) {
262
+ var currentStart = this.textArea.selectionStart;
263
+ var currentEnd = this.textArea.selectionEnd;
264
+ this.textArea.setSelectionRange(currentStart, currentEnd);
265
+ }
266
+ } catch (e) {// Fix error in Chrome:
267
+ // Failed to read the 'selectionStart' property from 'HTMLInputElement'
268
+ // http://stackoverflow.com/q/21177489/3040605
269
+ }
270
+ }
271
+ }, {
272
+ key: "render",
273
+ value: function render() {
274
+ return this.renderTextArea();
275
+ }
276
+ }]);
277
+
278
+ return ResizableTextArea;
279
+ }(React.Component);
280
+
281
+ polyfill(ResizableTextArea);
282
+
283
+ 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); }
284
+
285
+ 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); }
286
+
287
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
288
+
289
+ 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); } }
290
+
291
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
292
+
293
+ 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); }
294
+
295
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
296
+
297
+ 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); }; }
298
+
299
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
300
+
301
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
302
+
303
+ 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; } }
304
+
305
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
306
+
307
+ var TextArea = /*#__PURE__*/function (_React$Component) {
308
+ _inherits(TextArea, _React$Component);
309
+
310
+ var _super = _createSuper(TextArea);
311
+
312
+ function TextArea(props) {
313
+ var _this;
314
+
315
+ _classCallCheck(this, TextArea);
316
+
317
+ _this = _super.call(this, props);
318
+
319
+ _this.saveTextArea = function (resizableTextArea) {
320
+ _this.resizableTextArea = resizableTextArea;
321
+ };
322
+
323
+ _this.saveClearableInput = function (clearableInput) {
324
+ _this.clearableInput = clearableInput;
325
+ };
326
+
327
+ _this.handleChange = function (e) {
328
+ _this.setValue(e.target.value, function () {
329
+ _this.resizableTextArea.resizeTextarea();
330
+ });
331
+
332
+ resolveOnChange(_this.resizableTextArea.textArea, e, _this.props.onChange);
333
+ };
334
+
335
+ _this.handleKeyDown = function (e) {
336
+ var _this$props = _this.props,
337
+ onPressEnter = _this$props.onPressEnter,
338
+ onKeyDown = _this$props.onKeyDown;
339
+
340
+ if (e.keyCode === 13 && onPressEnter) {
341
+ onPressEnter(e);
342
+ }
343
+
344
+ if (onKeyDown) {
345
+ onKeyDown(e);
346
+ }
347
+ };
348
+
349
+ _this.handleReset = function (e) {
350
+ _this.setValue('', function () {
351
+ _this.resizableTextArea.renderTextArea();
352
+
353
+ _this.focus();
354
+ });
355
+
356
+ resolveOnChange(_this.resizableTextArea.textArea, e, _this.props.onChange);
357
+ };
358
+
359
+ _this.renderTextArea = function (prefixCls) {
360
+ return /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, _this.props, {
361
+ prefixCls: prefixCls,
362
+ onKeyDown: _this.handleKeyDown,
363
+ onChange: _this.handleChange,
364
+ ref: _this.saveTextArea
365
+ }));
366
+ };
367
+
368
+ _this.renderComponent = function (_ref) {
369
+ var getPrefixCls = _ref.getPrefixCls;
370
+ var value = _this.state.value;
371
+ var customizePrefixCls = _this.props.prefixCls;
372
+ var prefixCls = getPrefixCls('input', customizePrefixCls);
373
+ return /*#__PURE__*/React.createElement(ClearableLabeledInput, _extends({}, _this.props, {
374
+ prefixCls: prefixCls,
375
+ inputType: "text",
376
+ value: fixControlledValue(value),
377
+ element: _this.renderTextArea(prefixCls),
378
+ handleReset: _this.handleReset,
379
+ ref: _this.saveClearableInput
380
+ }));
381
+ };
382
+
383
+ var value = typeof props.value === 'undefined' ? props.defaultValue : props.value;
384
+ _this.state = {
385
+ value: value
386
+ };
387
+ return _this;
388
+ }
389
+
390
+ _createClass(TextArea, [{
391
+ key: "setValue",
392
+ value: function setValue(value, callback) {
393
+ if (!('value' in this.props)) {
394
+ this.setState({
395
+ value: value
396
+ }, callback);
397
+ }
398
+ }
399
+ }, {
400
+ key: "focus",
401
+ value: function focus() {
402
+ this.resizableTextArea.textArea.focus();
403
+ }
404
+ }, {
405
+ key: "blur",
406
+ value: function blur() {
407
+ this.resizableTextArea.textArea.blur();
408
+ }
409
+ }, {
410
+ key: "render",
411
+ value: function render() {
412
+ return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderComponent);
413
+ }
414
+ }], [{
415
+ key: "getDerivedStateFromProps",
416
+ value: function getDerivedStateFromProps(nextProps) {
417
+ if ('value' in nextProps) {
418
+ return {
419
+ value: nextProps.value
420
+ };
421
+ }
422
+
423
+ return null;
424
+ }
425
+ }]);
426
+
427
+ return TextArea;
428
+ }(React.Component);
429
+
430
+ polyfill(TextArea);
431
+
432
+ export { TextArea as T };
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Checks if `value` is classified as an `Array` object.
3
+ *
4
+ * @static
5
+ * @memberOf _
6
+ * @since 0.1.0
7
+ * @category Lang
8
+ * @param {*} value The value to check.
9
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
10
+ * @example
11
+ *
12
+ * _.isArray([1, 2, 3]);
13
+ * // => true
14
+ *
15
+ * _.isArray(document.body.children);
16
+ * // => false
17
+ *
18
+ * _.isArray('abc');
19
+ * // => false
20
+ *
21
+ * _.isArray(_.noop);
22
+ * // => false
23
+ */
24
+
25
+ var isArray_1;
26
+ var hasRequiredIsArray;
27
+
28
+ function requireIsArray () {
29
+ if (hasRequiredIsArray) return isArray_1;
30
+ hasRequiredIsArray = 1;
31
+ var isArray = Array.isArray;
32
+
33
+ isArray_1 = isArray;
34
+ return isArray_1;
35
+ }
36
+
37
+ /**
38
+ * A specialized version of `_.map` for arrays without support for iteratee
39
+ * shorthands.
40
+ *
41
+ * @private
42
+ * @param {Array} [array] The array to iterate over.
43
+ * @param {Function} iteratee The function invoked per iteration.
44
+ * @returns {Array} Returns the new mapped array.
45
+ */
46
+
47
+ var _arrayMap;
48
+ var hasRequired_arrayMap;
49
+
50
+ function require_arrayMap () {
51
+ if (hasRequired_arrayMap) return _arrayMap;
52
+ hasRequired_arrayMap = 1;
53
+ function arrayMap(array, iteratee) {
54
+ var index = -1,
55
+ length = array == null ? 0 : array.length,
56
+ result = Array(length);
57
+
58
+ while (++index < length) {
59
+ result[index] = iteratee(array[index], index, array);
60
+ }
61
+ return result;
62
+ }
63
+
64
+ _arrayMap = arrayMap;
65
+ return _arrayMap;
66
+ }
67
+
68
+ export { require_arrayMap as a, requireIsArray as r };
@@ -0,0 +1,95 @@
1
+ import { c as require_getNative } from './isLength.js';
2
+ import { b as requireEq } from './get.js';
3
+
4
+ var _defineProperty;
5
+ var hasRequired_defineProperty;
6
+
7
+ function require_defineProperty () {
8
+ if (hasRequired_defineProperty) return _defineProperty;
9
+ hasRequired_defineProperty = 1;
10
+ var getNative = require_getNative();
11
+
12
+ var defineProperty = (function() {
13
+ try {
14
+ var func = getNative(Object, 'defineProperty');
15
+ func({}, '', {});
16
+ return func;
17
+ } catch (e) {}
18
+ }());
19
+
20
+ _defineProperty = defineProperty;
21
+ return _defineProperty;
22
+ }
23
+
24
+ var _baseAssignValue;
25
+ var hasRequired_baseAssignValue;
26
+
27
+ function require_baseAssignValue () {
28
+ if (hasRequired_baseAssignValue) return _baseAssignValue;
29
+ hasRequired_baseAssignValue = 1;
30
+ var defineProperty = require_defineProperty();
31
+
32
+ /**
33
+ * The base implementation of `assignValue` and `assignMergeValue` without
34
+ * value checks.
35
+ *
36
+ * @private
37
+ * @param {Object} object The object to modify.
38
+ * @param {string} key The key of the property to assign.
39
+ * @param {*} value The value to assign.
40
+ */
41
+ function baseAssignValue(object, key, value) {
42
+ if (key == '__proto__' && defineProperty) {
43
+ defineProperty(object, key, {
44
+ 'configurable': true,
45
+ 'enumerable': true,
46
+ 'value': value,
47
+ 'writable': true
48
+ });
49
+ } else {
50
+ object[key] = value;
51
+ }
52
+ }
53
+
54
+ _baseAssignValue = baseAssignValue;
55
+ return _baseAssignValue;
56
+ }
57
+
58
+ var _assignValue;
59
+ var hasRequired_assignValue;
60
+
61
+ function require_assignValue () {
62
+ if (hasRequired_assignValue) return _assignValue;
63
+ hasRequired_assignValue = 1;
64
+ var baseAssignValue = require_baseAssignValue(),
65
+ eq = requireEq();
66
+
67
+ /** Used for built-in method references. */
68
+ var objectProto = Object.prototype;
69
+
70
+ /** Used to check objects for own properties. */
71
+ var hasOwnProperty = objectProto.hasOwnProperty;
72
+
73
+ /**
74
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
75
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
76
+ * for equality comparisons.
77
+ *
78
+ * @private
79
+ * @param {Object} object The object to modify.
80
+ * @param {string} key The key of the property to assign.
81
+ * @param {*} value The value to assign.
82
+ */
83
+ function assignValue(object, key, value) {
84
+ var objValue = object[key];
85
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
86
+ (value === undefined && !(key in object))) {
87
+ baseAssignValue(object, key, value);
88
+ }
89
+ }
90
+
91
+ _assignValue = assignValue;
92
+ return _assignValue;
93
+ }
94
+
95
+ export { require_assignValue as a, require_defineProperty as b, require_baseAssignValue as r };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copies the values of `source` to `array`.
3
+ *
4
+ * @private
5
+ * @param {Array} source The array to copy values from.
6
+ * @param {Array} [array=[]] The array to copy values to.
7
+ * @returns {Array} Returns `array`.
8
+ */
9
+
10
+ var _copyArray;
11
+ var hasRequired_copyArray;
12
+
13
+ function require_copyArray () {
14
+ if (hasRequired_copyArray) return _copyArray;
15
+ hasRequired_copyArray = 1;
16
+ function copyArray(source, array) {
17
+ var index = -1,
18
+ length = source.length;
19
+
20
+ array || (array = Array(length));
21
+ while (++index < length) {
22
+ array[index] = source[index];
23
+ }
24
+ return array;
25
+ }
26
+
27
+ _copyArray = copyArray;
28
+ return _copyArray;
29
+ }
30
+
31
+ export { require_copyArray as r };
@@ -0,0 +1,53 @@
1
+ import { r as require_castPath, a as require_toKey } from './get.js';
2
+ import { r as requireIsArguments, a as requireIsLength, b as require_isIndex } from './isLength.js';
3
+ import { r as requireIsArray } from './_arrayMap.js';
4
+
5
+ var _hasPath;
6
+ var hasRequired_hasPath;
7
+
8
+ function require_hasPath () {
9
+ if (hasRequired_hasPath) return _hasPath;
10
+ hasRequired_hasPath = 1;
11
+ var castPath = require_castPath(),
12
+ isArguments = requireIsArguments(),
13
+ isArray = requireIsArray(),
14
+ isIndex = require_isIndex(),
15
+ isLength = requireIsLength(),
16
+ toKey = require_toKey();
17
+
18
+ /**
19
+ * Checks if `path` exists on `object`.
20
+ *
21
+ * @private
22
+ * @param {Object} object The object to query.
23
+ * @param {Array|string} path The path to check.
24
+ * @param {Function} hasFunc The function to check properties.
25
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
26
+ */
27
+ function hasPath(object, path, hasFunc) {
28
+ path = castPath(path, object);
29
+
30
+ var index = -1,
31
+ length = path.length,
32
+ result = false;
33
+
34
+ while (++index < length) {
35
+ var key = toKey(path[index]);
36
+ if (!(result = object != null && hasFunc(object, key))) {
37
+ break;
38
+ }
39
+ object = object[key];
40
+ }
41
+ if (result || ++index != length) {
42
+ return result;
43
+ }
44
+ length = object == null ? 0 : object.length;
45
+ return !!length && isLength(length) && isIndex(key, length) &&
46
+ (isArray(object) || isArguments(object));
47
+ }
48
+
49
+ _hasPath = hasPath;
50
+ return _hasPath;
51
+ }
52
+
53
+ export { require_hasPath as r };