react-select-input-v2 1.0.6

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.
@@ -0,0 +1,2144 @@
1
+ /*!
2
+ * react-select-input v1.0.6 - https://samrith-s.github.io/react-select-input
3
+ * MIT Licensed
4
+ */
5
+ (function webpackUniversalModuleDefinition(root, factory) {
6
+ if(typeof exports === 'object' && typeof module === 'object')
7
+ module.exports = factory(require("react"));
8
+ else if(typeof define === 'function' && define.amd)
9
+ define(["react"], factory);
10
+ else if(typeof exports === 'object')
11
+ exports["inputSelect"] = factory(require("react"));
12
+ else
13
+ root["inputSelect"] = factory(root["React"]);
14
+ })(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
15
+ return /******/ (function(modules) { // webpackBootstrap
16
+ /******/ // The module cache
17
+ /******/ var installedModules = {};
18
+ /******/
19
+ /******/ // The require function
20
+ /******/ function __webpack_require__(moduleId) {
21
+ /******/
22
+ /******/ // Check if module is in cache
23
+ /******/ if(installedModules[moduleId]) {
24
+ /******/ return installedModules[moduleId].exports;
25
+ /******/ }
26
+ /******/ // Create a new module (and put it into the cache)
27
+ /******/ var module = installedModules[moduleId] = {
28
+ /******/ i: moduleId,
29
+ /******/ l: false,
30
+ /******/ exports: {}
31
+ /******/ };
32
+ /******/
33
+ /******/ // Execute the module function
34
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
35
+ /******/
36
+ /******/ // Flag the module as loaded
37
+ /******/ module.l = true;
38
+ /******/
39
+ /******/ // Return the exports of the module
40
+ /******/ return module.exports;
41
+ /******/ }
42
+ /******/
43
+ /******/
44
+ /******/ // expose the modules object (__webpack_modules__)
45
+ /******/ __webpack_require__.m = modules;
46
+ /******/
47
+ /******/ // expose the module cache
48
+ /******/ __webpack_require__.c = installedModules;
49
+ /******/
50
+ /******/ // define getter function for harmony exports
51
+ /******/ __webpack_require__.d = function(exports, name, getter) {
52
+ /******/ if(!__webpack_require__.o(exports, name)) {
53
+ /******/ Object.defineProperty(exports, name, {
54
+ /******/ configurable: false,
55
+ /******/ enumerable: true,
56
+ /******/ get: getter
57
+ /******/ });
58
+ /******/ }
59
+ /******/ };
60
+ /******/
61
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
62
+ /******/ __webpack_require__.n = function(module) {
63
+ /******/ var getter = module && module.__esModule ?
64
+ /******/ function getDefault() { return module['default']; } :
65
+ /******/ function getModuleExports() { return module; };
66
+ /******/ __webpack_require__.d(getter, 'a', getter);
67
+ /******/ return getter;
68
+ /******/ };
69
+ /******/
70
+ /******/ // Object.prototype.hasOwnProperty.call
71
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
72
+ /******/
73
+ /******/ // __webpack_public_path__
74
+ /******/ __webpack_require__.p = "";
75
+ /******/
76
+ /******/ // Load entry module and return exports
77
+ /******/ return __webpack_require__(__webpack_require__.s = 4);
78
+ /******/ })
79
+ /************************************************************************/
80
+ /******/ ([
81
+ /* 0 */
82
+ /***/ (function(module, exports) {
83
+
84
+ module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
85
+
86
+ /***/ }),
87
+ /* 1 */
88
+ /***/ (function(module, exports, __webpack_require__) {
89
+
90
+ "use strict";
91
+
92
+
93
+ if (false) {
94
+ module.exports = require('./cjs/react-is.production.min.js');
95
+ } else {
96
+ module.exports = __webpack_require__(9);
97
+ }
98
+
99
+
100
+ /***/ }),
101
+ /* 2 */
102
+ /***/ (function(module, exports, __webpack_require__) {
103
+
104
+ "use strict";
105
+ /**
106
+ * Copyright (c) 2013-present, Facebook, Inc.
107
+ *
108
+ * This source code is licensed under the MIT license found in the
109
+ * LICENSE file in the root directory of this source tree.
110
+ */
111
+
112
+
113
+
114
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
115
+
116
+ module.exports = ReactPropTypesSecret;
117
+
118
+
119
+ /***/ }),
120
+ /* 3 */
121
+ /***/ (function(module, exports) {
122
+
123
+ module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
124
+
125
+
126
+ /***/ }),
127
+ /* 4 */
128
+ /***/ (function(module, exports, __webpack_require__) {
129
+
130
+ module.exports = __webpack_require__(5);
131
+
132
+
133
+ /***/ }),
134
+ /* 5 */
135
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
136
+
137
+ "use strict";
138
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
139
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectInput; });
140
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
141
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
142
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_autosize_textarea__ = __webpack_require__(6);
143
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_autosize_textarea___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_autosize_textarea__);
144
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
145
+
146
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
147
+
148
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
149
+
150
+
151
+
152
+
153
+
154
+ function escapeRegExp(string) {
155
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
156
+ var reHasRegExpChar = RegExp(reRegExpChar.source);
157
+ return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string || '';
158
+ }
159
+
160
+ var SelectInput = function (_Component) {
161
+ _inherits(SelectInput, _Component);
162
+
163
+ function SelectInput() {
164
+ _classCallCheck(this, SelectInput);
165
+
166
+ var _this = _possibleConstructorReturn(this, _Component.call(this));
167
+
168
+ _this.renderOptions = function (options) {
169
+ return options && options.length > 0 ? options.map(function (option, index) {
170
+ return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
171
+ 'div',
172
+ {
173
+ className: 'ris-option' + (_this.state.selectedOption === option[_this.props.valueKey] ? ' selected' : '') + (_this.state.currentOption === index ? ' current' : ''),
174
+ key: _this.props.uniqueKey + '-option-' + index,
175
+ onClick: _this.handleClick.bind(_this, index),
176
+ ref: function ref(_ref) {
177
+ return _this['option-' + option[_this.props.valueKey]] = _ref;
178
+ }
179
+ },
180
+ option[_this.props.labelKey]
181
+ );
182
+ }) : null;
183
+ };
184
+
185
+ _this.handleSelect = function (option, index) {
186
+ var state = _this.manipState(_this.state, 'value', option[_this.props.labelKey]);
187
+ state = _this.manipState(state, 'selectedOption', option[_this.props.valueKey]);
188
+ state = _this.manipState(state, 'currentOption', -1);
189
+ if (_this.props.collapseOnSelect) state = _this.setIsOpen(state, false);
190
+ state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, state.value));
191
+ _this.setState(state);
192
+
193
+ if (_this.isFunction(_this.props.onSelect)) _this.props.onSelect(option);
194
+ };
195
+
196
+ _this.handleClick = function (index, event) {
197
+ var option = _this.pickOption(index);
198
+ _this.handleSelect(option, index);
199
+ };
200
+
201
+ _this.handleChange = function (event) {
202
+ var state = _this.manipState(_this.state, 'value', event.target.value);
203
+ state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, event.target.value));
204
+ state = _this.setIsOpen(state, true);
205
+
206
+ if (!state.value) {
207
+ state = _this.manipState(state, 'currentOption', -1);
208
+ state = _this.manipState(state, 'selectedOption', null);
209
+ }
210
+
211
+ if (_this.isFunction(_this.props.onChange)) _this.props.onChange(event);
212
+
213
+ _this.setState(state);
214
+ };
215
+
216
+ _this.handleFocus = function (event) {
217
+ var state = _this.setIsOpen(_this.state, true);
218
+ state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, event.target.value));
219
+ _this.setState(state);
220
+
221
+ if (_this.isFunction(_this.props.onFocus)) _this.props.onFocus(event);
222
+ };
223
+
224
+ _this.handleClear = function () {
225
+ var value = '';
226
+ var state = _this.manipState(_this.state, 'value', value);
227
+ state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, state.value));
228
+ state = _this.manipState(state, 'currentOption', -1);
229
+ state = _this.manipState(state, 'selectedOption', null);
230
+ _this.setState(state);
231
+
232
+ if (_this.isFunction(_this.props.onClear)) _this.props.onClear();
233
+ };
234
+
235
+ _this.handleBlur = function (event) {
236
+ if (_this.props.collapseOnBlur) {
237
+ var state = _this.setIsOpen(_this.state, false);
238
+ _this.setState(state);
239
+ }
240
+
241
+ if (_this.isFunction(_this.props.onBlur)) _this.props.onBlur(event);
242
+ };
243
+
244
+ _this.handleKeyUp = function (event) {
245
+ if (event.key === 'Enter' && _this.state.currentOption > -1) {
246
+ _this.handleSelect(_this.pickOption());
247
+ } else if (event.key === 'Enter' && _this.state.currentOption === -1) {
248
+ _this.handleSelect(_this.pickOption());
249
+ }
250
+
251
+ if (event.key === 'Escape' && _this.props.collapseOnEscape) {
252
+ _this.setState(_this.setIsOpen(_this.state, false));
253
+ }
254
+
255
+ if (_this.isFunction(_this.props.onKeyUp)) _this.props.onKeyUp(event);
256
+ };
257
+
258
+ _this.handleKeyDown = function (event) {
259
+ if (event.key === 'Enter' && _this.props.disableEnter) event.preventDefault();
260
+
261
+ if (event.key === 'Escape' && _this.props.collapseOnEscape) {
262
+ var state = _this.setIsOpen(_this.state, false);
263
+ _this.setState(state);
264
+ }
265
+
266
+ _this.handleOptionNavigation(event);
267
+
268
+ if (_this.isFunction(_this.props.onKeyDown)) _this.props.onKeyDown(event);
269
+ };
270
+
271
+ _this.handleOptionNavigation = function (event) {
272
+ var state = {};
273
+ var currentOption = _this.state.currentOption;
274
+
275
+ if (event.key === 'ArrowUp' || event.key === 'ArrowDown' && _this.disableEnter) event.preventDefault();
276
+
277
+ if (event.key === 'ArrowUp' && currentOption === -1 && _this.props.openUp) currentOption = _this.state.searchMatchOptions.length;
278
+
279
+ if (_this.props.openUp) {
280
+ if (event.key === 'ArrowDown') {
281
+ if (currentOption > -1) currentOption++;else currentOption = -1;
282
+ } else if (event.key === 'ArrowUp') currentOption--;
283
+ } else {
284
+ if (event.key === 'ArrowDown') currentOption++;else if (event.key === 'ArrowUp') currentOption--;
285
+ }
286
+
287
+ if (currentOption < -1) currentOption = -1;else if (currentOption > _this.state.searchMatchOptions.length - 1 && !_this.props.openUp) currentOption = _this.state.searchMatchOptions.length - 1;else if (currentOption > _this.state.searchMatchOptions.length - 1 && _this.props.openUp) currentOption = -1;
288
+
289
+ state = _this.manipState(_this.state, 'currentOption', currentOption);
290
+ var optionRef = currentOption > -1 ? _this['option-' + _this.state.searchMatchOptions[currentOption][_this.props.valueKey]] : null;
291
+ if (optionRef) optionRef.scrollIntoViewIfNeeded(false);
292
+
293
+ _this.setState(state);
294
+ };
295
+
296
+ _this.matchingOptions = function (options, value) {
297
+ value = escapeRegExp(value);
298
+ var searchValue = value.replace(/\s/g, '');
299
+ var searchOptions = [];
300
+
301
+ if (options && options.length > 0 && value) searchOptions = options.filter(function (option, index) {
302
+ var regexp = new RegExp(searchValue, 'gi');
303
+ var value = option[_this.props.valueKey] || '';
304
+ var label = option[_this.props.labelKey] || '';
305
+ return regexp.test(label.replace(/\s/g, '')) || regexp.test(value.replace(/\s/g, ''));
306
+ });else searchOptions = options.slice(0, options.length);
307
+
308
+ if (_this.props.openUp) searchOptions.reverse();
309
+
310
+ return searchOptions;
311
+ };
312
+
313
+ _this.pickOption = function (index) {
314
+ var _ref2;
315
+
316
+ index = index !== null && index !== undefined ? index : _this.state.currentOption;
317
+ if (index > -1) return _this.state.searchMatchOptions[index];else return _ref2 = {}, _ref2[_this.props.labelKey] = _this.input.value.trim(), _ref2[_this.props.valueKey] = _this.input.value.trim(), _ref2;
318
+ };
319
+
320
+ _this.setIsOpen = function (state, show) {
321
+ return Object.assign({}, state, {
322
+ isOpen: show || false
323
+ });
324
+ };
325
+
326
+ _this.manipState = function (state, key, value) {
327
+ var _Object$assign;
328
+
329
+ return Object.assign({}, state, (_Object$assign = {}, _Object$assign[key] = value, _Object$assign));
330
+ };
331
+
332
+ _this.isFunction = function (obj) {
333
+ return typeof obj === 'function';
334
+ };
335
+
336
+ _this.handleOutsideClick = function (event) {
337
+ if (!_this.ris.contains(event.target) && _this.props.collapseOnBlur) _this.setState(_this.setIsOpen(_this.state, false));
338
+ };
339
+
340
+ _this.state = {
341
+ isOpen: false,
342
+ value: null,
343
+ currentOption: -1,
344
+ selectedOption: null,
345
+ searchMatchOptions: []
346
+ };
347
+ return _this;
348
+ }
349
+
350
+ SelectInput.prototype.componentDidMount = function componentDidMount() {
351
+ document.addEventListener('click', this.handleOutsideClick);
352
+ };
353
+
354
+ SelectInput.prototype.componentDidUpdate = function componentDidUpdate() {
355
+ if (this.props.openUp && this.state.currentOption === -1 && this.state.isOpen && !this.state.selectedOption) {
356
+ this.options.scrollTop = this.options.scrollHeight;
357
+ } else if (this.props.openUp && this.state.selectedOption && this.state.isOpen) {
358
+ this['option-' + this.state.selectedOption].scrollIntoViewIfNeeded(true);
359
+ }
360
+ };
361
+
362
+ SelectInput.prototype.componentWillUnmount = function componentWillUnmount() {
363
+ document.removeEventListener('click', this.handleOutsideClick);
364
+ };
365
+
366
+ /*
367
+ Various renderers
368
+ */
369
+
370
+ /*
371
+ Handle different events
372
+ */
373
+
374
+ /*
375
+ Searching function
376
+ */
377
+
378
+ /*
379
+ Various helpers
380
+ */
381
+
382
+ SelectInput.prototype.render = function render() {
383
+ var _this2 = this;
384
+
385
+ return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
386
+ 'div',
387
+ {
388
+ className: 'ris' + (this.props.openUp ? ' ris-open-up' : '') + (this.props.clearable ? ' ris-is-clearable' : '') + (this.props.className ? ' ' + this.props.className : ''),
389
+ key: 'ris-' + this.props.uniqueKey,
390
+ ref: function ref(_ref4) {
391
+ return _this2.ris = _ref4;
392
+ },
393
+ style: this.props.style
394
+ },
395
+ __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_react_autosize_textarea___default.a, {
396
+ className: 'ris-input',
397
+ value: this.state.value !== null ? this.state.value : this.props.value,
398
+ placeholder: this.props.placeholder,
399
+ onChange: this.handleChange,
400
+ onFocus: this.handleFocus,
401
+ onBlur: this.props.onBlur,
402
+ onKeyUp: this.handleKeyUp,
403
+ onKeyDown: this.handleKeyDown,
404
+ autoFocus: this.props.autoFocus,
405
+ innerRef: function innerRef(ref) {
406
+ return _this2.input = ref;
407
+ }
408
+ }),
409
+ this.props.clearable ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
410
+ 'div',
411
+ { className: 'ris-clearable', onClick: this.handleClear },
412
+ 'x'
413
+ ) : null,
414
+ this.state.isOpen ? this.state.searchMatchOptions.length > 0 ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
415
+ 'div',
416
+ { className: 'ris-options', ref: function ref(_ref3) {
417
+ return _this2.options = _ref3;
418
+ } },
419
+ this.renderOptions(this.state.searchMatchOptions)
420
+ ) : this.props.noOptions ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
421
+ 'div',
422
+ { className: 'ris-options ris-no-options' },
423
+ this.props.noOptions
424
+ ) : null : null
425
+ );
426
+ };
427
+
428
+ return SelectInput;
429
+ }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
430
+
431
+
432
+
433
+
434
+ SelectInput.defaultProps = {
435
+ uniqueKey: 'react-select-input', //String
436
+ style: null, //Object
437
+ ref: null, //Function
438
+ value: '', //String
439
+ valueKey: 'value', //String
440
+ labelKey: 'label', //String
441
+ placeholder: 'Enter text', //String
442
+ className: '', //String
443
+ openUp: false, //Boolean
444
+ disableEnter: true, //Boolean
445
+ collapseOnBlur: true, //Boolean
446
+ collapseOnEscape: true, //Boolean
447
+ collapseOnSelect: true, //Boolean
448
+ autoFocus: true, //Boolean
449
+ clearable: true, //Boolean
450
+ options: [], //Array
451
+ onChange: undefined, //Function
452
+ onSelect: undefined, //Function
453
+ onFocus: undefined, //Function
454
+ onBlur: undefined, //Function
455
+ onKeyUp: undefined, //Function
456
+ onKeyDown: undefined, //Function
457
+ onClear: undefined, //Function
458
+ noOptions: undefined //JSX
459
+ };
460
+
461
+ /***/ }),
462
+ /* 6 */
463
+ /***/ (function(module, exports, __webpack_require__) {
464
+
465
+ "use strict";
466
+
467
+
468
+ Object.defineProperty(exports, "__esModule", {
469
+ value: true
470
+ });
471
+ exports.default = undefined;
472
+
473
+ var _TextareaAutosize = __webpack_require__(7);
474
+
475
+ var _TextareaAutosize2 = _interopRequireDefault(_TextareaAutosize);
476
+
477
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
478
+
479
+ exports.default = _TextareaAutosize2.default;
480
+
481
+ /***/ }),
482
+ /* 7 */
483
+ /***/ (function(module, exports, __webpack_require__) {
484
+
485
+ "use strict";
486
+
487
+
488
+ Object.defineProperty(exports, "__esModule", {
489
+ value: true
490
+ });
491
+ exports.default = undefined;
492
+
493
+ var _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; };
494
+
495
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
496
+
497
+ var _class, _temp2;
498
+
499
+ var _react = __webpack_require__(0);
500
+
501
+ var _react2 = _interopRequireDefault(_react);
502
+
503
+ var _propTypes = __webpack_require__(8);
504
+
505
+ var _propTypes2 = _interopRequireDefault(_propTypes);
506
+
507
+ var _autosize = __webpack_require__(13);
508
+
509
+ var _autosize2 = _interopRequireDefault(_autosize);
510
+
511
+ var _lineHeight = __webpack_require__(14);
512
+
513
+ var _lineHeight2 = _interopRequireDefault(_lineHeight);
514
+
515
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
516
+
517
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
518
+
519
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
520
+
521
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
522
+
523
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
524
+
525
+ var UPDATE = 'autosize:update',
526
+ DESTROY = 'autosize:destroy',
527
+ RESIZED = 'autosize:resized';
528
+
529
+ /** A light replacement for built-in textarea component
530
+ * which automaticaly adjusts its height to match the content
531
+ * @param onResize - called whenever the textarea resizes
532
+ * @param rows - minimum number of visible rows
533
+ * @param maxRows - maximum number of visible rows
534
+ * @param innerRef - called with the ref to the DOM node
535
+ */
536
+ var TextareaAutosize = (_temp2 = _class = function (_React$Component) {
537
+ _inherits(TextareaAutosize, _React$Component);
538
+
539
+ function TextareaAutosize() {
540
+ var _ref;
541
+
542
+ var _temp, _this, _ret;
543
+
544
+ _classCallCheck(this, TextareaAutosize);
545
+
546
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
547
+ args[_key] = arguments[_key];
548
+ }
549
+
550
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TextareaAutosize.__proto__ || Object.getPrototypeOf(TextareaAutosize)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
551
+ lineHeight: null
552
+ }, _this.dispatchEvent = function (EVENT_TYPE) {
553
+ var event = document.createEvent('Event');
554
+ event.initEvent(EVENT_TYPE, true, false);
555
+
556
+ _this.textarea.dispatchEvent(event);
557
+ }, _this.getValue = function (_ref2) {
558
+ var valueLink = _ref2.valueLink,
559
+ value = _ref2.value;
560
+ return valueLink ? valueLink.value : value;
561
+ }, _this.updateLineHeight = function () {
562
+ _this.setState({
563
+ lineHeight: (0, _lineHeight2.default)(_this.textarea)
564
+ });
565
+ }, _this.onChange = function (e) {
566
+ _this.currentValue = e.target.value;
567
+ _this.props.onChange && _this.props.onChange(e);
568
+ }, _this.saveDOMNodeRef = function (ref) {
569
+ var innerRef = _this.props.innerRef;
570
+
571
+
572
+ if (innerRef) {
573
+ innerRef(ref);
574
+ }
575
+
576
+ _this.textarea = ref;
577
+ }, _this.getLocals = function () {
578
+ var _this2 = _this,
579
+ _this2$props = _this2.props,
580
+ onResize = _this2$props.onResize,
581
+ maxRows = _this2$props.maxRows,
582
+ onChange = _this2$props.onChange,
583
+ style = _this2$props.style,
584
+ innerRef = _this2$props.innerRef,
585
+ props = _objectWithoutProperties(_this2$props, ['onResize', 'maxRows', 'onChange', 'style', 'innerRef']),
586
+ lineHeight = _this2.state.lineHeight,
587
+ saveDOMNodeRef = _this2.saveDOMNodeRef;
588
+
589
+ var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
590
+
591
+ return _extends({}, props, {
592
+ saveDOMNodeRef: saveDOMNodeRef,
593
+ style: maxHeight ? _extends({}, style, { maxHeight: maxHeight }) : style,
594
+ onChange: _this.onChange
595
+ });
596
+ }, _temp), _possibleConstructorReturn(_this, _ret);
597
+ }
598
+
599
+ _createClass(TextareaAutosize, [{
600
+ key: 'componentDidMount',
601
+ value: function componentDidMount() {
602
+ var _this3 = this;
603
+
604
+ var _props = this.props,
605
+ onResize = _props.onResize,
606
+ maxRows = _props.maxRows;
607
+
608
+
609
+ if (typeof maxRows === 'number') {
610
+ this.updateLineHeight();
611
+
612
+ // this trick is needed to force "autosize" to activate the scrollbar
613
+ setTimeout(function () {
614
+ return (0, _autosize2.default)(_this3.textarea);
615
+ });
616
+ } else {
617
+ (0, _autosize2.default)(this.textarea);
618
+ }
619
+
620
+ if (onResize) {
621
+ this.textarea.addEventListener(RESIZED, this.props.onResize);
622
+ }
623
+ }
624
+ }, {
625
+ key: 'componentWillUnmount',
626
+ value: function componentWillUnmount() {
627
+ if (this.props.onResize) {
628
+ this.textarea.removeEventListener(RESIZED, this.props.onResize);
629
+ }
630
+ this.dispatchEvent(DESTROY);
631
+ }
632
+ }, {
633
+ key: 'render',
634
+ value: function render() {
635
+ var _getLocals = this.getLocals(),
636
+ children = _getLocals.children,
637
+ saveDOMNodeRef = _getLocals.saveDOMNodeRef,
638
+ locals = _objectWithoutProperties(_getLocals, ['children', 'saveDOMNodeRef']);
639
+
640
+ return _react2.default.createElement(
641
+ 'textarea',
642
+ _extends({}, locals, { ref: saveDOMNodeRef }),
643
+ children
644
+ );
645
+ }
646
+ }, {
647
+ key: 'componentDidUpdate',
648
+ value: function componentDidUpdate() {
649
+ if (this.getValue(this.props) !== this.currentValue) {
650
+ this.dispatchEvent(UPDATE);
651
+ }
652
+ }
653
+ }]);
654
+
655
+ return TextareaAutosize;
656
+ }(_react2.default.Component), _class.defaultProps = {
657
+ rows: 1
658
+ }, _temp2);
659
+ exports.default = TextareaAutosize;
660
+
661
+
662
+ TextareaAutosize.propTypes = {
663
+ rows: _propTypes2.default.number,
664
+ maxRows: _propTypes2.default.number,
665
+ onResize: _propTypes2.default.func,
666
+ innerRef: _propTypes2.default.func
667
+ };
668
+
669
+ /***/ }),
670
+ /* 8 */
671
+ /***/ (function(module, exports, __webpack_require__) {
672
+
673
+ /**
674
+ * Copyright (c) 2013-present, Facebook, Inc.
675
+ *
676
+ * This source code is licensed under the MIT license found in the
677
+ * LICENSE file in the root directory of this source tree.
678
+ */
679
+
680
+ if (true) {
681
+ var ReactIs = __webpack_require__(1);
682
+
683
+ // By explicitly using `prop-types` you are opting into new development behavior.
684
+ // http://fb.me/prop-types-in-prod
685
+ var throwOnDirectAccess = true;
686
+ module.exports = __webpack_require__(10)(ReactIs.isElement, throwOnDirectAccess);
687
+ } else {
688
+ // By explicitly using `prop-types` you are opting into new production behavior.
689
+ // http://fb.me/prop-types-in-prod
690
+ module.exports = require('./factoryWithThrowingShims')();
691
+ }
692
+
693
+
694
+ /***/ }),
695
+ /* 9 */
696
+ /***/ (function(module, exports, __webpack_require__) {
697
+
698
+ "use strict";
699
+ /** @license React v16.13.1
700
+ * react-is.development.js
701
+ *
702
+ * Copyright (c) Facebook, Inc. and its affiliates.
703
+ *
704
+ * This source code is licensed under the MIT license found in the
705
+ * LICENSE file in the root directory of this source tree.
706
+ */
707
+
708
+
709
+
710
+
711
+
712
+ if (true) {
713
+ (function() {
714
+ 'use strict';
715
+
716
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
717
+ // nor polyfill, then a plain number is used for performance.
718
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
719
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
720
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
721
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
722
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
723
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
724
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
725
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
726
+ // (unstable) APIs that have been removed. Can we remove the symbols?
727
+
728
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
729
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
730
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
731
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
732
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
733
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
734
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
735
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
736
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
737
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
738
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
739
+
740
+ function isValidElementType(type) {
741
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
742
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
743
+ }
744
+
745
+ function typeOf(object) {
746
+ if (typeof object === 'object' && object !== null) {
747
+ var $$typeof = object.$$typeof;
748
+
749
+ switch ($$typeof) {
750
+ case REACT_ELEMENT_TYPE:
751
+ var type = object.type;
752
+
753
+ switch (type) {
754
+ case REACT_ASYNC_MODE_TYPE:
755
+ case REACT_CONCURRENT_MODE_TYPE:
756
+ case REACT_FRAGMENT_TYPE:
757
+ case REACT_PROFILER_TYPE:
758
+ case REACT_STRICT_MODE_TYPE:
759
+ case REACT_SUSPENSE_TYPE:
760
+ return type;
761
+
762
+ default:
763
+ var $$typeofType = type && type.$$typeof;
764
+
765
+ switch ($$typeofType) {
766
+ case REACT_CONTEXT_TYPE:
767
+ case REACT_FORWARD_REF_TYPE:
768
+ case REACT_LAZY_TYPE:
769
+ case REACT_MEMO_TYPE:
770
+ case REACT_PROVIDER_TYPE:
771
+ return $$typeofType;
772
+
773
+ default:
774
+ return $$typeof;
775
+ }
776
+
777
+ }
778
+
779
+ case REACT_PORTAL_TYPE:
780
+ return $$typeof;
781
+ }
782
+ }
783
+
784
+ return undefined;
785
+ } // AsyncMode is deprecated along with isAsyncMode
786
+
787
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
788
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
789
+ var ContextConsumer = REACT_CONTEXT_TYPE;
790
+ var ContextProvider = REACT_PROVIDER_TYPE;
791
+ var Element = REACT_ELEMENT_TYPE;
792
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
793
+ var Fragment = REACT_FRAGMENT_TYPE;
794
+ var Lazy = REACT_LAZY_TYPE;
795
+ var Memo = REACT_MEMO_TYPE;
796
+ var Portal = REACT_PORTAL_TYPE;
797
+ var Profiler = REACT_PROFILER_TYPE;
798
+ var StrictMode = REACT_STRICT_MODE_TYPE;
799
+ var Suspense = REACT_SUSPENSE_TYPE;
800
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
801
+
802
+ function isAsyncMode(object) {
803
+ {
804
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
805
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
806
+
807
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
808
+ }
809
+ }
810
+
811
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
812
+ }
813
+ function isConcurrentMode(object) {
814
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
815
+ }
816
+ function isContextConsumer(object) {
817
+ return typeOf(object) === REACT_CONTEXT_TYPE;
818
+ }
819
+ function isContextProvider(object) {
820
+ return typeOf(object) === REACT_PROVIDER_TYPE;
821
+ }
822
+ function isElement(object) {
823
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
824
+ }
825
+ function isForwardRef(object) {
826
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
827
+ }
828
+ function isFragment(object) {
829
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
830
+ }
831
+ function isLazy(object) {
832
+ return typeOf(object) === REACT_LAZY_TYPE;
833
+ }
834
+ function isMemo(object) {
835
+ return typeOf(object) === REACT_MEMO_TYPE;
836
+ }
837
+ function isPortal(object) {
838
+ return typeOf(object) === REACT_PORTAL_TYPE;
839
+ }
840
+ function isProfiler(object) {
841
+ return typeOf(object) === REACT_PROFILER_TYPE;
842
+ }
843
+ function isStrictMode(object) {
844
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
845
+ }
846
+ function isSuspense(object) {
847
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
848
+ }
849
+
850
+ exports.AsyncMode = AsyncMode;
851
+ exports.ConcurrentMode = ConcurrentMode;
852
+ exports.ContextConsumer = ContextConsumer;
853
+ exports.ContextProvider = ContextProvider;
854
+ exports.Element = Element;
855
+ exports.ForwardRef = ForwardRef;
856
+ exports.Fragment = Fragment;
857
+ exports.Lazy = Lazy;
858
+ exports.Memo = Memo;
859
+ exports.Portal = Portal;
860
+ exports.Profiler = Profiler;
861
+ exports.StrictMode = StrictMode;
862
+ exports.Suspense = Suspense;
863
+ exports.isAsyncMode = isAsyncMode;
864
+ exports.isConcurrentMode = isConcurrentMode;
865
+ exports.isContextConsumer = isContextConsumer;
866
+ exports.isContextProvider = isContextProvider;
867
+ exports.isElement = isElement;
868
+ exports.isForwardRef = isForwardRef;
869
+ exports.isFragment = isFragment;
870
+ exports.isLazy = isLazy;
871
+ exports.isMemo = isMemo;
872
+ exports.isPortal = isPortal;
873
+ exports.isProfiler = isProfiler;
874
+ exports.isStrictMode = isStrictMode;
875
+ exports.isSuspense = isSuspense;
876
+ exports.isValidElementType = isValidElementType;
877
+ exports.typeOf = typeOf;
878
+ })();
879
+ }
880
+
881
+
882
+ /***/ }),
883
+ /* 10 */
884
+ /***/ (function(module, exports, __webpack_require__) {
885
+
886
+ "use strict";
887
+ /**
888
+ * Copyright (c) 2013-present, Facebook, Inc.
889
+ *
890
+ * This source code is licensed under the MIT license found in the
891
+ * LICENSE file in the root directory of this source tree.
892
+ */
893
+
894
+
895
+
896
+ var ReactIs = __webpack_require__(1);
897
+ var assign = __webpack_require__(11);
898
+
899
+ var ReactPropTypesSecret = __webpack_require__(2);
900
+ var has = __webpack_require__(3);
901
+ var checkPropTypes = __webpack_require__(12);
902
+
903
+ var printWarning = function() {};
904
+
905
+ if (true) {
906
+ printWarning = function(text) {
907
+ var message = 'Warning: ' + text;
908
+ if (typeof console !== 'undefined') {
909
+ console.error(message);
910
+ }
911
+ try {
912
+ // --- Welcome to debugging React ---
913
+ // This error was thrown as a convenience so that you can use this stack
914
+ // to find the callsite that caused this warning to fire.
915
+ throw new Error(message);
916
+ } catch (x) {}
917
+ };
918
+ }
919
+
920
+ function emptyFunctionThatReturnsNull() {
921
+ return null;
922
+ }
923
+
924
+ module.exports = function(isValidElement, throwOnDirectAccess) {
925
+ /* global Symbol */
926
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
927
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
928
+
929
+ /**
930
+ * Returns the iterator method function contained on the iterable object.
931
+ *
932
+ * Be sure to invoke the function with the iterable as context:
933
+ *
934
+ * var iteratorFn = getIteratorFn(myIterable);
935
+ * if (iteratorFn) {
936
+ * var iterator = iteratorFn.call(myIterable);
937
+ * ...
938
+ * }
939
+ *
940
+ * @param {?object} maybeIterable
941
+ * @return {?function}
942
+ */
943
+ function getIteratorFn(maybeIterable) {
944
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
945
+ if (typeof iteratorFn === 'function') {
946
+ return iteratorFn;
947
+ }
948
+ }
949
+
950
+ /**
951
+ * Collection of methods that allow declaration and validation of props that are
952
+ * supplied to React components. Example usage:
953
+ *
954
+ * var Props = require('ReactPropTypes');
955
+ * var MyArticle = React.createClass({
956
+ * propTypes: {
957
+ * // An optional string prop named "description".
958
+ * description: Props.string,
959
+ *
960
+ * // A required enum prop named "category".
961
+ * category: Props.oneOf(['News','Photos']).isRequired,
962
+ *
963
+ * // A prop named "dialog" that requires an instance of Dialog.
964
+ * dialog: Props.instanceOf(Dialog).isRequired
965
+ * },
966
+ * render: function() { ... }
967
+ * });
968
+ *
969
+ * A more formal specification of how these methods are used:
970
+ *
971
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
972
+ * decl := ReactPropTypes.{type}(.isRequired)?
973
+ *
974
+ * Each and every declaration produces a function with the same signature. This
975
+ * allows the creation of custom validation functions. For example:
976
+ *
977
+ * var MyLink = React.createClass({
978
+ * propTypes: {
979
+ * // An optional string or URI prop named "href".
980
+ * href: function(props, propName, componentName) {
981
+ * var propValue = props[propName];
982
+ * if (propValue != null && typeof propValue !== 'string' &&
983
+ * !(propValue instanceof URI)) {
984
+ * return new Error(
985
+ * 'Expected a string or an URI for ' + propName + ' in ' +
986
+ * componentName
987
+ * );
988
+ * }
989
+ * }
990
+ * },
991
+ * render: function() {...}
992
+ * });
993
+ *
994
+ * @internal
995
+ */
996
+
997
+ var ANONYMOUS = '<<anonymous>>';
998
+
999
+ // Important!
1000
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1001
+ var ReactPropTypes = {
1002
+ array: createPrimitiveTypeChecker('array'),
1003
+ bigint: createPrimitiveTypeChecker('bigint'),
1004
+ bool: createPrimitiveTypeChecker('boolean'),
1005
+ func: createPrimitiveTypeChecker('function'),
1006
+ number: createPrimitiveTypeChecker('number'),
1007
+ object: createPrimitiveTypeChecker('object'),
1008
+ string: createPrimitiveTypeChecker('string'),
1009
+ symbol: createPrimitiveTypeChecker('symbol'),
1010
+
1011
+ any: createAnyTypeChecker(),
1012
+ arrayOf: createArrayOfTypeChecker,
1013
+ element: createElementTypeChecker(),
1014
+ elementType: createElementTypeTypeChecker(),
1015
+ instanceOf: createInstanceTypeChecker,
1016
+ node: createNodeChecker(),
1017
+ objectOf: createObjectOfTypeChecker,
1018
+ oneOf: createEnumTypeChecker,
1019
+ oneOfType: createUnionTypeChecker,
1020
+ shape: createShapeTypeChecker,
1021
+ exact: createStrictShapeTypeChecker,
1022
+ };
1023
+
1024
+ /**
1025
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
1026
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1027
+ */
1028
+ /*eslint-disable no-self-compare*/
1029
+ function is(x, y) {
1030
+ // SameValue algorithm
1031
+ if (x === y) {
1032
+ // Steps 1-5, 7-10
1033
+ // Steps 6.b-6.e: +0 != -0
1034
+ return x !== 0 || 1 / x === 1 / y;
1035
+ } else {
1036
+ // Step 6.a: NaN == NaN
1037
+ return x !== x && y !== y;
1038
+ }
1039
+ }
1040
+ /*eslint-enable no-self-compare*/
1041
+
1042
+ /**
1043
+ * We use an Error-like object for backward compatibility as people may call
1044
+ * PropTypes directly and inspect their output. However, we don't use real
1045
+ * Errors anymore. We don't inspect their stack anyway, and creating them
1046
+ * is prohibitively expensive if they are created too often, such as what
1047
+ * happens in oneOfType() for any type before the one that matched.
1048
+ */
1049
+ function PropTypeError(message, data) {
1050
+ this.message = message;
1051
+ this.data = data && typeof data === 'object' ? data: {};
1052
+ this.stack = '';
1053
+ }
1054
+ // Make `instanceof Error` still work for returned errors.
1055
+ PropTypeError.prototype = Error.prototype;
1056
+
1057
+ function createChainableTypeChecker(validate) {
1058
+ if (true) {
1059
+ var manualPropTypeCallCache = {};
1060
+ var manualPropTypeWarningCount = 0;
1061
+ }
1062
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1063
+ componentName = componentName || ANONYMOUS;
1064
+ propFullName = propFullName || propName;
1065
+
1066
+ if (secret !== ReactPropTypesSecret) {
1067
+ if (throwOnDirectAccess) {
1068
+ // New behavior only for users of `prop-types` package
1069
+ var err = new Error(
1070
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1071
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
1072
+ 'Read more at http://fb.me/use-check-prop-types'
1073
+ );
1074
+ err.name = 'Invariant Violation';
1075
+ throw err;
1076
+ } else if ("development" !== 'production' && typeof console !== 'undefined') {
1077
+ // Old behavior for people using React.PropTypes
1078
+ var cacheKey = componentName + ':' + propName;
1079
+ if (
1080
+ !manualPropTypeCallCache[cacheKey] &&
1081
+ // Avoid spamming the console because they are often not actionable except for lib authors
1082
+ manualPropTypeWarningCount < 3
1083
+ ) {
1084
+ printWarning(
1085
+ 'You are manually calling a React.PropTypes validation ' +
1086
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1087
+ 'and will throw in the standalone `prop-types` package. ' +
1088
+ 'You may be seeing this warning due to a third-party PropTypes ' +
1089
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1090
+ );
1091
+ manualPropTypeCallCache[cacheKey] = true;
1092
+ manualPropTypeWarningCount++;
1093
+ }
1094
+ }
1095
+ }
1096
+ if (props[propName] == null) {
1097
+ if (isRequired) {
1098
+ if (props[propName] === null) {
1099
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1100
+ }
1101
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1102
+ }
1103
+ return null;
1104
+ } else {
1105
+ return validate(props, propName, componentName, location, propFullName);
1106
+ }
1107
+ }
1108
+
1109
+ var chainedCheckType = checkType.bind(null, false);
1110
+ chainedCheckType.isRequired = checkType.bind(null, true);
1111
+
1112
+ return chainedCheckType;
1113
+ }
1114
+
1115
+ function createPrimitiveTypeChecker(expectedType) {
1116
+ function validate(props, propName, componentName, location, propFullName, secret) {
1117
+ var propValue = props[propName];
1118
+ var propType = getPropType(propValue);
1119
+ if (propType !== expectedType) {
1120
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
1121
+ // check, but we can offer a more precise error message here rather than
1122
+ // 'of type `object`'.
1123
+ var preciseType = getPreciseType(propValue);
1124
+
1125
+ return new PropTypeError(
1126
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
1127
+ {expectedType: expectedType}
1128
+ );
1129
+ }
1130
+ return null;
1131
+ }
1132
+ return createChainableTypeChecker(validate);
1133
+ }
1134
+
1135
+ function createAnyTypeChecker() {
1136
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1137
+ }
1138
+
1139
+ function createArrayOfTypeChecker(typeChecker) {
1140
+ function validate(props, propName, componentName, location, propFullName) {
1141
+ if (typeof typeChecker !== 'function') {
1142
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1143
+ }
1144
+ var propValue = props[propName];
1145
+ if (!Array.isArray(propValue)) {
1146
+ var propType = getPropType(propValue);
1147
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1148
+ }
1149
+ for (var i = 0; i < propValue.length; i++) {
1150
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1151
+ if (error instanceof Error) {
1152
+ return error;
1153
+ }
1154
+ }
1155
+ return null;
1156
+ }
1157
+ return createChainableTypeChecker(validate);
1158
+ }
1159
+
1160
+ function createElementTypeChecker() {
1161
+ function validate(props, propName, componentName, location, propFullName) {
1162
+ var propValue = props[propName];
1163
+ if (!isValidElement(propValue)) {
1164
+ var propType = getPropType(propValue);
1165
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1166
+ }
1167
+ return null;
1168
+ }
1169
+ return createChainableTypeChecker(validate);
1170
+ }
1171
+
1172
+ function createElementTypeTypeChecker() {
1173
+ function validate(props, propName, componentName, location, propFullName) {
1174
+ var propValue = props[propName];
1175
+ if (!ReactIs.isValidElementType(propValue)) {
1176
+ var propType = getPropType(propValue);
1177
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1178
+ }
1179
+ return null;
1180
+ }
1181
+ return createChainableTypeChecker(validate);
1182
+ }
1183
+
1184
+ function createInstanceTypeChecker(expectedClass) {
1185
+ function validate(props, propName, componentName, location, propFullName) {
1186
+ if (!(props[propName] instanceof expectedClass)) {
1187
+ var expectedClassName = expectedClass.name || ANONYMOUS;
1188
+ var actualClassName = getClassName(props[propName]);
1189
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1190
+ }
1191
+ return null;
1192
+ }
1193
+ return createChainableTypeChecker(validate);
1194
+ }
1195
+
1196
+ function createEnumTypeChecker(expectedValues) {
1197
+ if (!Array.isArray(expectedValues)) {
1198
+ if (true) {
1199
+ if (arguments.length > 1) {
1200
+ printWarning(
1201
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1202
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1203
+ );
1204
+ } else {
1205
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
1206
+ }
1207
+ }
1208
+ return emptyFunctionThatReturnsNull;
1209
+ }
1210
+
1211
+ function validate(props, propName, componentName, location, propFullName) {
1212
+ var propValue = props[propName];
1213
+ for (var i = 0; i < expectedValues.length; i++) {
1214
+ if (is(propValue, expectedValues[i])) {
1215
+ return null;
1216
+ }
1217
+ }
1218
+
1219
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1220
+ var type = getPreciseType(value);
1221
+ if (type === 'symbol') {
1222
+ return String(value);
1223
+ }
1224
+ return value;
1225
+ });
1226
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1227
+ }
1228
+ return createChainableTypeChecker(validate);
1229
+ }
1230
+
1231
+ function createObjectOfTypeChecker(typeChecker) {
1232
+ function validate(props, propName, componentName, location, propFullName) {
1233
+ if (typeof typeChecker !== 'function') {
1234
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1235
+ }
1236
+ var propValue = props[propName];
1237
+ var propType = getPropType(propValue);
1238
+ if (propType !== 'object') {
1239
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1240
+ }
1241
+ for (var key in propValue) {
1242
+ if (has(propValue, key)) {
1243
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1244
+ if (error instanceof Error) {
1245
+ return error;
1246
+ }
1247
+ }
1248
+ }
1249
+ return null;
1250
+ }
1251
+ return createChainableTypeChecker(validate);
1252
+ }
1253
+
1254
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
1255
+ if (!Array.isArray(arrayOfTypeCheckers)) {
1256
+ true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1257
+ return emptyFunctionThatReturnsNull;
1258
+ }
1259
+
1260
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1261
+ var checker = arrayOfTypeCheckers[i];
1262
+ if (typeof checker !== 'function') {
1263
+ printWarning(
1264
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1265
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1266
+ );
1267
+ return emptyFunctionThatReturnsNull;
1268
+ }
1269
+ }
1270
+
1271
+ function validate(props, propName, componentName, location, propFullName) {
1272
+ var expectedTypes = [];
1273
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1274
+ var checker = arrayOfTypeCheckers[i];
1275
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1276
+ if (checkerResult == null) {
1277
+ return null;
1278
+ }
1279
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1280
+ expectedTypes.push(checkerResult.data.expectedType);
1281
+ }
1282
+ }
1283
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1284
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1285
+ }
1286
+ return createChainableTypeChecker(validate);
1287
+ }
1288
+
1289
+ function createNodeChecker() {
1290
+ function validate(props, propName, componentName, location, propFullName) {
1291
+ if (!isNode(props[propName])) {
1292
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1293
+ }
1294
+ return null;
1295
+ }
1296
+ return createChainableTypeChecker(validate);
1297
+ }
1298
+
1299
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1300
+ return new PropTypeError(
1301
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1302
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1303
+ );
1304
+ }
1305
+
1306
+ function createShapeTypeChecker(shapeTypes) {
1307
+ function validate(props, propName, componentName, location, propFullName) {
1308
+ var propValue = props[propName];
1309
+ var propType = getPropType(propValue);
1310
+ if (propType !== 'object') {
1311
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1312
+ }
1313
+ for (var key in shapeTypes) {
1314
+ var checker = shapeTypes[key];
1315
+ if (typeof checker !== 'function') {
1316
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1317
+ }
1318
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1319
+ if (error) {
1320
+ return error;
1321
+ }
1322
+ }
1323
+ return null;
1324
+ }
1325
+ return createChainableTypeChecker(validate);
1326
+ }
1327
+
1328
+ function createStrictShapeTypeChecker(shapeTypes) {
1329
+ function validate(props, propName, componentName, location, propFullName) {
1330
+ var propValue = props[propName];
1331
+ var propType = getPropType(propValue);
1332
+ if (propType !== 'object') {
1333
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1334
+ }
1335
+ // We need to check all keys in case some are required but missing from props.
1336
+ var allKeys = assign({}, props[propName], shapeTypes);
1337
+ for (var key in allKeys) {
1338
+ var checker = shapeTypes[key];
1339
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1340
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1341
+ }
1342
+ if (!checker) {
1343
+ return new PropTypeError(
1344
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1345
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1346
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1347
+ );
1348
+ }
1349
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1350
+ if (error) {
1351
+ return error;
1352
+ }
1353
+ }
1354
+ return null;
1355
+ }
1356
+
1357
+ return createChainableTypeChecker(validate);
1358
+ }
1359
+
1360
+ function isNode(propValue) {
1361
+ switch (typeof propValue) {
1362
+ case 'number':
1363
+ case 'string':
1364
+ case 'undefined':
1365
+ return true;
1366
+ case 'boolean':
1367
+ return !propValue;
1368
+ case 'object':
1369
+ if (Array.isArray(propValue)) {
1370
+ return propValue.every(isNode);
1371
+ }
1372
+ if (propValue === null || isValidElement(propValue)) {
1373
+ return true;
1374
+ }
1375
+
1376
+ var iteratorFn = getIteratorFn(propValue);
1377
+ if (iteratorFn) {
1378
+ var iterator = iteratorFn.call(propValue);
1379
+ var step;
1380
+ if (iteratorFn !== propValue.entries) {
1381
+ while (!(step = iterator.next()).done) {
1382
+ if (!isNode(step.value)) {
1383
+ return false;
1384
+ }
1385
+ }
1386
+ } else {
1387
+ // Iterator will provide entry [k,v] tuples rather than values.
1388
+ while (!(step = iterator.next()).done) {
1389
+ var entry = step.value;
1390
+ if (entry) {
1391
+ if (!isNode(entry[1])) {
1392
+ return false;
1393
+ }
1394
+ }
1395
+ }
1396
+ }
1397
+ } else {
1398
+ return false;
1399
+ }
1400
+
1401
+ return true;
1402
+ default:
1403
+ return false;
1404
+ }
1405
+ }
1406
+
1407
+ function isSymbol(propType, propValue) {
1408
+ // Native Symbol.
1409
+ if (propType === 'symbol') {
1410
+ return true;
1411
+ }
1412
+
1413
+ // falsy value can't be a Symbol
1414
+ if (!propValue) {
1415
+ return false;
1416
+ }
1417
+
1418
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1419
+ if (propValue['@@toStringTag'] === 'Symbol') {
1420
+ return true;
1421
+ }
1422
+
1423
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1424
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1425
+ return true;
1426
+ }
1427
+
1428
+ return false;
1429
+ }
1430
+
1431
+ // Equivalent of `typeof` but with special handling for array and regexp.
1432
+ function getPropType(propValue) {
1433
+ var propType = typeof propValue;
1434
+ if (Array.isArray(propValue)) {
1435
+ return 'array';
1436
+ }
1437
+ if (propValue instanceof RegExp) {
1438
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1439
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1440
+ // passes PropTypes.object.
1441
+ return 'object';
1442
+ }
1443
+ if (isSymbol(propType, propValue)) {
1444
+ return 'symbol';
1445
+ }
1446
+ return propType;
1447
+ }
1448
+
1449
+ // This handles more types than `getPropType`. Only used for error messages.
1450
+ // See `createPrimitiveTypeChecker`.
1451
+ function getPreciseType(propValue) {
1452
+ if (typeof propValue === 'undefined' || propValue === null) {
1453
+ return '' + propValue;
1454
+ }
1455
+ var propType = getPropType(propValue);
1456
+ if (propType === 'object') {
1457
+ if (propValue instanceof Date) {
1458
+ return 'date';
1459
+ } else if (propValue instanceof RegExp) {
1460
+ return 'regexp';
1461
+ }
1462
+ }
1463
+ return propType;
1464
+ }
1465
+
1466
+ // Returns a string that is postfixed to a warning about an invalid type.
1467
+ // For example, "undefined" or "of type array"
1468
+ function getPostfixForTypeWarning(value) {
1469
+ var type = getPreciseType(value);
1470
+ switch (type) {
1471
+ case 'array':
1472
+ case 'object':
1473
+ return 'an ' + type;
1474
+ case 'boolean':
1475
+ case 'date':
1476
+ case 'regexp':
1477
+ return 'a ' + type;
1478
+ default:
1479
+ return type;
1480
+ }
1481
+ }
1482
+
1483
+ // Returns class name of the object, if any.
1484
+ function getClassName(propValue) {
1485
+ if (!propValue.constructor || !propValue.constructor.name) {
1486
+ return ANONYMOUS;
1487
+ }
1488
+ return propValue.constructor.name;
1489
+ }
1490
+
1491
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1492
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1493
+ ReactPropTypes.PropTypes = ReactPropTypes;
1494
+
1495
+ return ReactPropTypes;
1496
+ };
1497
+
1498
+
1499
+ /***/ }),
1500
+ /* 11 */
1501
+ /***/ (function(module, exports, __webpack_require__) {
1502
+
1503
+ "use strict";
1504
+ /*
1505
+ object-assign
1506
+ (c) Sindre Sorhus
1507
+ @license MIT
1508
+ */
1509
+
1510
+
1511
+ /* eslint-disable no-unused-vars */
1512
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1513
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1514
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1515
+
1516
+ function toObject(val) {
1517
+ if (val === null || val === undefined) {
1518
+ throw new TypeError('Object.assign cannot be called with null or undefined');
1519
+ }
1520
+
1521
+ return Object(val);
1522
+ }
1523
+
1524
+ function shouldUseNative() {
1525
+ try {
1526
+ if (!Object.assign) {
1527
+ return false;
1528
+ }
1529
+
1530
+ // Detect buggy property enumeration order in older V8 versions.
1531
+
1532
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1533
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1534
+ test1[5] = 'de';
1535
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
1536
+ return false;
1537
+ }
1538
+
1539
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1540
+ var test2 = {};
1541
+ for (var i = 0; i < 10; i++) {
1542
+ test2['_' + String.fromCharCode(i)] = i;
1543
+ }
1544
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1545
+ return test2[n];
1546
+ });
1547
+ if (order2.join('') !== '0123456789') {
1548
+ return false;
1549
+ }
1550
+
1551
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1552
+ var test3 = {};
1553
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1554
+ test3[letter] = letter;
1555
+ });
1556
+ if (Object.keys(Object.assign({}, test3)).join('') !==
1557
+ 'abcdefghijklmnopqrst') {
1558
+ return false;
1559
+ }
1560
+
1561
+ return true;
1562
+ } catch (err) {
1563
+ // We don't expect any of the above to throw, but better to be safe.
1564
+ return false;
1565
+ }
1566
+ }
1567
+
1568
+ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
1569
+ var from;
1570
+ var to = toObject(target);
1571
+ var symbols;
1572
+
1573
+ for (var s = 1; s < arguments.length; s++) {
1574
+ from = Object(arguments[s]);
1575
+
1576
+ for (var key in from) {
1577
+ if (hasOwnProperty.call(from, key)) {
1578
+ to[key] = from[key];
1579
+ }
1580
+ }
1581
+
1582
+ if (getOwnPropertySymbols) {
1583
+ symbols = getOwnPropertySymbols(from);
1584
+ for (var i = 0; i < symbols.length; i++) {
1585
+ if (propIsEnumerable.call(from, symbols[i])) {
1586
+ to[symbols[i]] = from[symbols[i]];
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+
1592
+ return to;
1593
+ };
1594
+
1595
+
1596
+ /***/ }),
1597
+ /* 12 */
1598
+ /***/ (function(module, exports, __webpack_require__) {
1599
+
1600
+ "use strict";
1601
+ /**
1602
+ * Copyright (c) 2013-present, Facebook, Inc.
1603
+ *
1604
+ * This source code is licensed under the MIT license found in the
1605
+ * LICENSE file in the root directory of this source tree.
1606
+ */
1607
+
1608
+
1609
+
1610
+ var printWarning = function() {};
1611
+
1612
+ if (true) {
1613
+ var ReactPropTypesSecret = __webpack_require__(2);
1614
+ var loggedTypeFailures = {};
1615
+ var has = __webpack_require__(3);
1616
+
1617
+ printWarning = function(text) {
1618
+ var message = 'Warning: ' + text;
1619
+ if (typeof console !== 'undefined') {
1620
+ console.error(message);
1621
+ }
1622
+ try {
1623
+ // --- Welcome to debugging React ---
1624
+ // This error was thrown as a convenience so that you can use this stack
1625
+ // to find the callsite that caused this warning to fire.
1626
+ throw new Error(message);
1627
+ } catch (x) { /**/ }
1628
+ };
1629
+ }
1630
+
1631
+ /**
1632
+ * Assert that the values match with the type specs.
1633
+ * Error messages are memorized and will only be shown once.
1634
+ *
1635
+ * @param {object} typeSpecs Map of name to a ReactPropType
1636
+ * @param {object} values Runtime values that need to be type-checked
1637
+ * @param {string} location e.g. "prop", "context", "child context"
1638
+ * @param {string} componentName Name of the component for error messages.
1639
+ * @param {?Function} getStack Returns the component stack.
1640
+ * @private
1641
+ */
1642
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1643
+ if (true) {
1644
+ for (var typeSpecName in typeSpecs) {
1645
+ if (has(typeSpecs, typeSpecName)) {
1646
+ var error;
1647
+ // Prop type validation may throw. In case they do, we don't want to
1648
+ // fail the render phase where it didn't fail before. So we log it.
1649
+ // After these have been cleaned up, we'll let them throw.
1650
+ try {
1651
+ // This is intentionally an invariant that gets caught. It's the same
1652
+ // behavior as without this statement except with a better message.
1653
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
1654
+ var err = Error(
1655
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
1656
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
1657
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
1658
+ );
1659
+ err.name = 'Invariant Violation';
1660
+ throw err;
1661
+ }
1662
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1663
+ } catch (ex) {
1664
+ error = ex;
1665
+ }
1666
+ if (error && !(error instanceof Error)) {
1667
+ printWarning(
1668
+ (componentName || 'React class') + ': type specification of ' +
1669
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
1670
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
1671
+ 'You may have forgotten to pass an argument to the type checker ' +
1672
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
1673
+ 'shape all require an argument).'
1674
+ );
1675
+ }
1676
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1677
+ // Only monitor this failure once because there tends to be a lot of the
1678
+ // same error.
1679
+ loggedTypeFailures[error.message] = true;
1680
+
1681
+ var stack = getStack ? getStack() : '';
1682
+
1683
+ printWarning(
1684
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
1685
+ );
1686
+ }
1687
+ }
1688
+ }
1689
+ }
1690
+ }
1691
+
1692
+ /**
1693
+ * Resets warning cache when testing.
1694
+ *
1695
+ * @private
1696
+ */
1697
+ checkPropTypes.resetWarningCache = function() {
1698
+ if (true) {
1699
+ loggedTypeFailures = {};
1700
+ }
1701
+ }
1702
+
1703
+ module.exports = checkPropTypes;
1704
+
1705
+
1706
+ /***/ }),
1707
+ /* 13 */
1708
+ /***/ (function(module, exports, __webpack_require__) {
1709
+
1710
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
1711
+ Autosize 3.0.21
1712
+ license: MIT
1713
+ http://www.jacklmoore.com/autosize
1714
+ */
1715
+ (function (global, factory) {
1716
+ if (true) {
1717
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1718
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1719
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1720
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1721
+ } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
1722
+ factory(exports, module);
1723
+ } else {
1724
+ var mod = {
1725
+ exports: {}
1726
+ };
1727
+ factory(mod.exports, mod);
1728
+ global.autosize = mod.exports;
1729
+ }
1730
+ })(this, function (exports, module) {
1731
+ 'use strict';
1732
+
1733
+ var map = typeof Map === "function" ? new Map() : (function () {
1734
+ var keys = [];
1735
+ var values = [];
1736
+
1737
+ return {
1738
+ has: function has(key) {
1739
+ return keys.indexOf(key) > -1;
1740
+ },
1741
+ get: function get(key) {
1742
+ return values[keys.indexOf(key)];
1743
+ },
1744
+ set: function set(key, value) {
1745
+ if (keys.indexOf(key) === -1) {
1746
+ keys.push(key);
1747
+ values.push(value);
1748
+ }
1749
+ },
1750
+ 'delete': function _delete(key) {
1751
+ var index = keys.indexOf(key);
1752
+ if (index > -1) {
1753
+ keys.splice(index, 1);
1754
+ values.splice(index, 1);
1755
+ }
1756
+ }
1757
+ };
1758
+ })();
1759
+
1760
+ var createEvent = function createEvent(name) {
1761
+ return new Event(name, { bubbles: true });
1762
+ };
1763
+ try {
1764
+ new Event('test');
1765
+ } catch (e) {
1766
+ // IE does not support `new Event()`
1767
+ createEvent = function (name) {
1768
+ var evt = document.createEvent('Event');
1769
+ evt.initEvent(name, true, false);
1770
+ return evt;
1771
+ };
1772
+ }
1773
+
1774
+ function assign(ta) {
1775
+ if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
1776
+
1777
+ var heightOffset = null;
1778
+ var clientWidth = ta.clientWidth;
1779
+ var cachedHeight = null;
1780
+
1781
+ function init() {
1782
+ var style = window.getComputedStyle(ta, null);
1783
+
1784
+ if (style.resize === 'vertical') {
1785
+ ta.style.resize = 'none';
1786
+ } else if (style.resize === 'both') {
1787
+ ta.style.resize = 'horizontal';
1788
+ }
1789
+
1790
+ if (style.boxSizing === 'content-box') {
1791
+ heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
1792
+ } else {
1793
+ heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
1794
+ }
1795
+ // Fix when a textarea is not on document body and heightOffset is Not a Number
1796
+ if (isNaN(heightOffset)) {
1797
+ heightOffset = 0;
1798
+ }
1799
+
1800
+ update();
1801
+ }
1802
+
1803
+ function changeOverflow(value) {
1804
+ {
1805
+ // Chrome/Safari-specific fix:
1806
+ // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
1807
+ // made available by removing the scrollbar. The following forces the necessary text reflow.
1808
+ var width = ta.style.width;
1809
+ ta.style.width = '0px';
1810
+ // Force reflow:
1811
+ /* jshint ignore:start */
1812
+ ta.offsetWidth;
1813
+ /* jshint ignore:end */
1814
+ ta.style.width = width;
1815
+ }
1816
+
1817
+ ta.style.overflowY = value;
1818
+ }
1819
+
1820
+ function getParentOverflows(el) {
1821
+ var arr = [];
1822
+
1823
+ while (el && el.parentNode && el.parentNode instanceof Element) {
1824
+ if (el.parentNode.scrollTop) {
1825
+ arr.push({
1826
+ node: el.parentNode,
1827
+ scrollTop: el.parentNode.scrollTop
1828
+ });
1829
+ }
1830
+ el = el.parentNode;
1831
+ }
1832
+
1833
+ return arr;
1834
+ }
1835
+
1836
+ function resize() {
1837
+ var originalHeight = ta.style.height;
1838
+ var overflows = getParentOverflows(ta);
1839
+ var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
1840
+
1841
+ ta.style.height = 'auto';
1842
+
1843
+ var endHeight = ta.scrollHeight + heightOffset;
1844
+
1845
+ if (ta.scrollHeight === 0) {
1846
+ // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
1847
+ ta.style.height = originalHeight;
1848
+ return;
1849
+ }
1850
+
1851
+ ta.style.height = endHeight + 'px';
1852
+
1853
+ // used to check if an update is actually necessary on window.resize
1854
+ clientWidth = ta.clientWidth;
1855
+
1856
+ // prevents scroll-position jumping
1857
+ overflows.forEach(function (el) {
1858
+ el.node.scrollTop = el.scrollTop;
1859
+ });
1860
+
1861
+ if (docTop) {
1862
+ document.documentElement.scrollTop = docTop;
1863
+ }
1864
+ }
1865
+
1866
+ function update() {
1867
+ resize();
1868
+
1869
+ var styleHeight = Math.round(parseFloat(ta.style.height));
1870
+ var computed = window.getComputedStyle(ta, null);
1871
+
1872
+ // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
1873
+ var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
1874
+
1875
+ // The actual height not matching the style height (set via the resize method) indicates that
1876
+ // the max-height has been exceeded, in which case the overflow should be allowed.
1877
+ if (actualHeight !== styleHeight) {
1878
+ if (computed.overflowY === 'hidden') {
1879
+ changeOverflow('scroll');
1880
+ resize();
1881
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
1882
+ }
1883
+ } else {
1884
+ // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
1885
+ if (computed.overflowY !== 'hidden') {
1886
+ changeOverflow('hidden');
1887
+ resize();
1888
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
1889
+ }
1890
+ }
1891
+
1892
+ if (cachedHeight !== actualHeight) {
1893
+ cachedHeight = actualHeight;
1894
+ var evt = createEvent('autosize:resized');
1895
+ try {
1896
+ ta.dispatchEvent(evt);
1897
+ } catch (err) {
1898
+ // Firefox will throw an error on dispatchEvent for a detached element
1899
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
1900
+ }
1901
+ }
1902
+ }
1903
+
1904
+ var pageResize = function pageResize() {
1905
+ if (ta.clientWidth !== clientWidth) {
1906
+ update();
1907
+ }
1908
+ };
1909
+
1910
+ var destroy = (function (style) {
1911
+ window.removeEventListener('resize', pageResize, false);
1912
+ ta.removeEventListener('input', update, false);
1913
+ ta.removeEventListener('keyup', update, false);
1914
+ ta.removeEventListener('autosize:destroy', destroy, false);
1915
+ ta.removeEventListener('autosize:update', update, false);
1916
+
1917
+ Object.keys(style).forEach(function (key) {
1918
+ ta.style[key] = style[key];
1919
+ });
1920
+
1921
+ map['delete'](ta);
1922
+ }).bind(ta, {
1923
+ height: ta.style.height,
1924
+ resize: ta.style.resize,
1925
+ overflowY: ta.style.overflowY,
1926
+ overflowX: ta.style.overflowX,
1927
+ wordWrap: ta.style.wordWrap
1928
+ });
1929
+
1930
+ ta.addEventListener('autosize:destroy', destroy, false);
1931
+
1932
+ // IE9 does not fire onpropertychange or oninput for deletions,
1933
+ // so binding to onkeyup to catch most of those events.
1934
+ // There is no way that I know of to detect something like 'cut' in IE9.
1935
+ if ('onpropertychange' in ta && 'oninput' in ta) {
1936
+ ta.addEventListener('keyup', update, false);
1937
+ }
1938
+
1939
+ window.addEventListener('resize', pageResize, false);
1940
+ ta.addEventListener('input', update, false);
1941
+ ta.addEventListener('autosize:update', update, false);
1942
+ ta.style.overflowX = 'hidden';
1943
+ ta.style.wordWrap = 'break-word';
1944
+
1945
+ map.set(ta, {
1946
+ destroy: destroy,
1947
+ update: update
1948
+ });
1949
+
1950
+ init();
1951
+ }
1952
+
1953
+ function destroy(ta) {
1954
+ var methods = map.get(ta);
1955
+ if (methods) {
1956
+ methods.destroy();
1957
+ }
1958
+ }
1959
+
1960
+ function update(ta) {
1961
+ var methods = map.get(ta);
1962
+ if (methods) {
1963
+ methods.update();
1964
+ }
1965
+ }
1966
+
1967
+ var autosize = null;
1968
+
1969
+ // Do nothing in Node.js environment and IE8 (or lower)
1970
+ if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
1971
+ autosize = function (el) {
1972
+ return el;
1973
+ };
1974
+ autosize.destroy = function (el) {
1975
+ return el;
1976
+ };
1977
+ autosize.update = function (el) {
1978
+ return el;
1979
+ };
1980
+ } else {
1981
+ autosize = function (el, options) {
1982
+ if (el) {
1983
+ Array.prototype.forEach.call(el.length ? el : [el], function (x) {
1984
+ return assign(x, options);
1985
+ });
1986
+ }
1987
+ return el;
1988
+ };
1989
+ autosize.destroy = function (el) {
1990
+ if (el) {
1991
+ Array.prototype.forEach.call(el.length ? el : [el], destroy);
1992
+ }
1993
+ return el;
1994
+ };
1995
+ autosize.update = function (el) {
1996
+ if (el) {
1997
+ Array.prototype.forEach.call(el.length ? el : [el], update);
1998
+ }
1999
+ return el;
2000
+ };
2001
+ }
2002
+
2003
+ module.exports = autosize;
2004
+ });
2005
+
2006
+ /***/ }),
2007
+ /* 14 */
2008
+ /***/ (function(module, exports, __webpack_require__) {
2009
+
2010
+ // Load in dependencies
2011
+ var computedStyle = __webpack_require__(15);
2012
+
2013
+ /**
2014
+ * Calculate the `line-height` of a given node
2015
+ * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
2016
+ * @returns {Number} `line-height` of the element in pixels
2017
+ */
2018
+ function lineHeight(node) {
2019
+ // Grab the line-height via style
2020
+ var lnHeightStr = computedStyle(node, 'line-height');
2021
+ var lnHeight = parseFloat(lnHeightStr, 10);
2022
+
2023
+ // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
2024
+ if (lnHeightStr === lnHeight + '') {
2025
+ // Save the old lineHeight style and update the em unit to the element
2026
+ var _lnHeightStyle = node.style.lineHeight;
2027
+ node.style.lineHeight = lnHeightStr + 'em';
2028
+
2029
+ // Calculate the em based height
2030
+ lnHeightStr = computedStyle(node, 'line-height');
2031
+ lnHeight = parseFloat(lnHeightStr, 10);
2032
+
2033
+ // Revert the lineHeight style
2034
+ if (_lnHeightStyle) {
2035
+ node.style.lineHeight = _lnHeightStyle;
2036
+ } else {
2037
+ delete node.style.lineHeight;
2038
+ }
2039
+ }
2040
+
2041
+ // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
2042
+ // DEV: `em` units are converted to `pt` in IE6
2043
+ // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
2044
+ if (lnHeightStr.indexOf('pt') !== -1) {
2045
+ lnHeight *= 4;
2046
+ lnHeight /= 3;
2047
+ // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
2048
+ } else if (lnHeightStr.indexOf('mm') !== -1) {
2049
+ lnHeight *= 96;
2050
+ lnHeight /= 25.4;
2051
+ // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
2052
+ } else if (lnHeightStr.indexOf('cm') !== -1) {
2053
+ lnHeight *= 96;
2054
+ lnHeight /= 2.54;
2055
+ // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
2056
+ } else if (lnHeightStr.indexOf('in') !== -1) {
2057
+ lnHeight *= 96;
2058
+ // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
2059
+ } else if (lnHeightStr.indexOf('pc') !== -1) {
2060
+ lnHeight *= 16;
2061
+ }
2062
+
2063
+ // Continue our computation
2064
+ lnHeight = Math.round(lnHeight);
2065
+
2066
+ // If the line-height is "normal", calculate by font-size
2067
+ if (lnHeightStr === 'normal') {
2068
+ // Create a temporary node
2069
+ var nodeName = node.nodeName;
2070
+ var _node = document.createElement(nodeName);
2071
+ _node.innerHTML = '&nbsp;';
2072
+
2073
+ // If we have a text area, reset it to only 1 row
2074
+ // https://github.com/twolfson/line-height/issues/4
2075
+ if (nodeName.toUpperCase() === 'TEXTAREA') {
2076
+ _node.setAttribute('rows', '1');
2077
+ }
2078
+
2079
+ // Set the font-size of the element
2080
+ var fontSizeStr = computedStyle(node, 'font-size');
2081
+ _node.style.fontSize = fontSizeStr;
2082
+
2083
+ // Remove default padding/border which can affect offset height
2084
+ // https://github.com/twolfson/line-height/issues/4
2085
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
2086
+ _node.style.padding = '0px';
2087
+ _node.style.border = '0px';
2088
+
2089
+ // Append it to the body
2090
+ var body = document.body;
2091
+ body.appendChild(_node);
2092
+
2093
+ // Assume the line height of the element is the height
2094
+ var height = _node.offsetHeight;
2095
+ lnHeight = height;
2096
+
2097
+ // Remove our child from the DOM
2098
+ body.removeChild(_node);
2099
+ }
2100
+
2101
+ // Return the calculated height
2102
+ return lnHeight;
2103
+ }
2104
+
2105
+ // Export lineHeight
2106
+ module.exports = lineHeight;
2107
+
2108
+
2109
+ /***/ }),
2110
+ /* 15 */
2111
+ /***/ (function(module, exports) {
2112
+
2113
+ // This code has been refactored for 140 bytes
2114
+ // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
2115
+ var computedStyle = function (el, prop, getComputedStyle) {
2116
+ getComputedStyle = window.getComputedStyle;
2117
+
2118
+ // In one fell swoop
2119
+ return (
2120
+ // If we have getComputedStyle
2121
+ getComputedStyle ?
2122
+ // Query it
2123
+ // TODO: From CSS-Query notes, we might need (node, null) for FF
2124
+ getComputedStyle(el) :
2125
+
2126
+ // Otherwise, we are in IE and use currentStyle
2127
+ el.currentStyle
2128
+ )[
2129
+ // Switch to camelCase for CSSOM
2130
+ // DEV: Grabbed from jQuery
2131
+ // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
2132
+ // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
2133
+ prop.replace(/-(\w)/gi, function (word, letter) {
2134
+ return letter.toUpperCase();
2135
+ })
2136
+ ];
2137
+ };
2138
+
2139
+ module.exports = computedStyle;
2140
+
2141
+
2142
+ /***/ })
2143
+ /******/ ]);
2144
+ });