Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("react"), require("react-dom"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["react", "react-dom"], factory);
  6. else if(typeof exports === 'object')
  7. exports["ReactAutocomplete"] = factory(require("react"), require("react-dom"));
  8. else
  9. root["ReactAutocomplete"] = factory(root["React"], root["ReactDOM"]);
  10. })(this, function(__WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ([
  43. /* 0 */
  44. /***/ (function(module, exports, __webpack_require__) {
  45. 'use strict';
  46. 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; }; }();
  47. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48. 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; }
  49. 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; }
  50. var PropTypes = __webpack_require__(5);
  51. var React = __webpack_require__(7);
  52. var ReactDOM = __webpack_require__(8);
  53. var classnames = __webpack_require__(1);
  54. var Autocomplete = function (_React$Component) {
  55. _inherits(Autocomplete, _React$Component);
  56. function Autocomplete(props) {
  57. _classCallCheck(this, Autocomplete);
  58. var _this = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, props));
  59. _initialiseProps.call(_this);
  60. var searchTerm = props.searchTerm ? props.searchTerm : props.value ? props.value.title : '';
  61. _this.state = {
  62. results: [],
  63. showResults: false,
  64. showResultsInProgress: false,
  65. searchTerm: searchTerm,
  66. focusedValue: null
  67. };
  68. return _this;
  69. }
  70. _createClass(Autocomplete, [{
  71. key: 'render',
  72. value: function render() {
  73. var className = classnames(this.props.className, 'react-autocomplete-Autocomplete', this.state.showResults ? 'react-autocomplete-Autocomplete--resultsShown' : undefined);
  74. var style = {
  75. position: 'relative',
  76. outline: 'none'
  77. };
  78. return React.createElement(
  79. 'div',
  80. {
  81. tabIndex: '1',
  82. className: className,
  83. onFocus: this.onFocus,
  84. onBlur: this.onBlur,
  85. style: style },
  86. React.createElement('input', {
  87. ref: 'search',
  88. className: 'react-autocomplete-Autocomplete__search',
  89. style: { width: '100%' },
  90. onClick: this.showAllResults,
  91. onChange: this.onQueryChange,
  92. onFocus: this.onSearchInputFocus,
  93. onBlur: this.onQueryBlur,
  94. onKeyDown: this.onQueryKeyDown,
  95. value: this.state.searchTerm
  96. }),
  97. React.createElement(Results, {
  98. className: 'react-autocomplete-Autocomplete__results',
  99. onSelect: this.onValueChange,
  100. onFocus: this.onValueFocus,
  101. results: this.state.results,
  102. focusedValue: this.state.focusedValue,
  103. show: this.state.showResults,
  104. renderer: this.props.resultRenderer,
  105. label: this.props.label,
  106. resultIdentifier: this.props.resultIdentifier
  107. })
  108. );
  109. }
  110. }, {
  111. key: 'componentWillReceiveProps',
  112. value: function componentWillReceiveProps(nextProps) {
  113. var searchTerm = nextProps.searchTerm ? nextProps.searchTerm : nextProps.value ? nextProps.value.title : '';
  114. this.setState({ searchTerm: searchTerm });
  115. }
  116. }, {
  117. key: 'componentWillMount',
  118. value: function componentWillMount() {
  119. this.blurTimer = null;
  120. }
  121. /**
  122. * Show results for a search term value.
  123. *
  124. * This method doesn't update search term value itself.
  125. *
  126. * @param {Search} searchTerm
  127. */
  128. }]);
  129. return Autocomplete;
  130. }(React.Component);
  131. Autocomplete.displayName = 'Autocomplete';
  132. Autocomplete.propTypes = {
  133. options: PropTypes.any,
  134. search: PropTypes.func,
  135. resultRenderer: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
  136. value: PropTypes.object,
  137. onChange: PropTypes.func,
  138. onError: PropTypes.func,
  139. onFocus: PropTypes.func
  140. };
  141. Autocomplete.defaultProps = { search: searchArray };
  142. var _initialiseProps = function _initialiseProps() {
  143. var _this4 = this;
  144. this.getResultIdentifier = function (result) {
  145. if (_this4.props.resultIdentifier === undefined) {
  146. return result.id;
  147. } else {
  148. return result[_this4.props.resultIdentifier];
  149. }
  150. };
  151. this.showResults = function (searchTerm) {
  152. _this4.setState({ showResultsInProgress: true });
  153. _this4.props.search(_this4.props.options, searchTerm.trim(), _this4.onSearchComplete);
  154. };
  155. this.showAllResults = function () {
  156. if (!_this4.state.showResultsInProgress && !_this4.state.showResults) {
  157. _this4.showResults('');
  158. }
  159. };
  160. this.onValueChange = function (value) {
  161. var state = {
  162. value: value,
  163. showResults: false
  164. };
  165. if (value) {
  166. state.searchTerm = value.title;
  167. }
  168. _this4.setState(state);
  169. if (_this4.props.onChange) {
  170. _this4.props.onChange(value);
  171. }
  172. };
  173. this.onSearchComplete = function (err, results) {
  174. if (err) {
  175. if (_this4.props.onError) {
  176. _this4.props.onError(err);
  177. } else {
  178. throw err;
  179. }
  180. }
  181. _this4.setState({
  182. showResultsInProgress: false,
  183. showResults: true,
  184. results: results
  185. });
  186. };
  187. this.onValueFocus = function (value) {
  188. _this4.setState({ focusedValue: value });
  189. };
  190. this.onQueryChange = function (e) {
  191. var searchTerm = e.target.value;
  192. _this4.setState({
  193. searchTerm: searchTerm,
  194. focusedValue: null
  195. });
  196. _this4.showResults(searchTerm);
  197. };
  198. this.onFocus = function () {
  199. if (_this4.blurTimer) {
  200. clearTimeout(_this4.blurTimer);
  201. _this4.blurTimer = null;
  202. }
  203. _this4.refs.search.focus();
  204. };
  205. this.onSearchInputFocus = function () {
  206. if (_this4.props.onFocus) {
  207. _this4.props.onFocus();
  208. }
  209. _this4.showAllResults();
  210. };
  211. this.onBlur = function () {
  212. // wrap in setTimeout so we can catch a click on results
  213. _this4.blurTimer = setTimeout(function () {
  214. _this4.setState({ showResults: false });
  215. }, 100);
  216. };
  217. this.onQueryKeyDown = function (e) {
  218. if (e.key === 'Enter') {
  219. e.preventDefault();
  220. if (_this4.state.focusedValue) {
  221. _this4.onValueChange(_this4.state.focusedValue);
  222. }
  223. } else if (e.key === 'ArrowUp' && _this4.state.showResults) {
  224. e.preventDefault();
  225. var prevIdx = Math.max(_this4.focusedValueIndex() - 1, 0);
  226. _this4.setState({
  227. focusedValue: _this4.state.results[prevIdx]
  228. });
  229. } else if (e.key === 'ArrowDown') {
  230. e.preventDefault();
  231. if (_this4.state.showResults) {
  232. var nextIdx = Math.min(_this4.focusedValueIndex() + (_this4.state.showResults ? 1 : 0), _this4.state.results.length - 1);
  233. _this4.setState({
  234. showResults: true,
  235. focusedValue: _this4.state.results[nextIdx]
  236. });
  237. } else {
  238. _this4.showAllResults();
  239. }
  240. }
  241. };
  242. this.focusedValueIndex = function () {
  243. if (!_this4.state.focusedValue) {
  244. return -1;
  245. }
  246. for (var i = 0, len = _this4.state.results.length; i < len; i++) {
  247. if (_this4.getResultIdentifier(_this4.state.results[i]) === _this4.getResultIdentifier(_this4.state.focusedValue)) {
  248. return i;
  249. }
  250. }
  251. return -1;
  252. };
  253. };
  254. var Results = function (_React$Component2) {
  255. _inherits(Results, _React$Component2);
  256. function Results() {
  257. var _ref;
  258. var _temp, _this2, _ret;
  259. _classCallCheck(this, Results);
  260. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  261. args[_key] = arguments[_key];
  262. }
  263. return _ret = (_temp = (_this2 = _possibleConstructorReturn(this, (_ref = Results.__proto__ || Object.getPrototypeOf(Results)).call.apply(_ref, [this].concat(args))), _this2), _this2.getResultIdentifier = function (result) {
  264. if (_this2.props.resultIdentifier === undefined) {
  265. if (!result.id) {
  266. throw Error("id property not found on result. You must specify a resultIdentifier and pass as props to autocomplete component");
  267. }
  268. return result.id;
  269. } else {
  270. return result[_this2.props.resultIdentifier];
  271. }
  272. }, _this2.renderResult = function (result) {
  273. var focused = _this2.props.focusedValue && _this2.getResultIdentifier(_this2.props.focusedValue) === _this2.getResultIdentifier(result);
  274. var Renderer = _this2.props.renderer || Result;
  275. return React.createElement(Renderer, {
  276. ref: focused ? "focused" : undefined,
  277. key: _this2.getResultIdentifier(result),
  278. result: result,
  279. focused: focused,
  280. onMouseEnter: _this2.onMouseEnterResult,
  281. onClick: _this2.props.onSelect,
  282. label: _this2.props.label });
  283. }, _this2.scrollToFocused = function () {
  284. var focused = _this2.refs && _this2.refs.focused;
  285. if (focused) {
  286. var containerNode = ReactDOM.findDOMNode(_this2);
  287. var scroll = containerNode.scrollTop;
  288. var height = containerNode.offsetHeight;
  289. var node = ReactDOM.findDOMNode(focused);
  290. var top = node.offsetTop;
  291. var bottom = top + node.offsetHeight;
  292. // we update ignoreFocus to true if we change the scroll position so
  293. // the mouseover event triggered because of that won't have an
  294. // effect
  295. if (top < scroll) {
  296. _this2.ignoreFocus = true;
  297. containerNode.scrollTop = top;
  298. } else if (bottom - scroll > height) {
  299. _this2.ignoreFocus = true;
  300. containerNode.scrollTop = bottom - height;
  301. }
  302. }
  303. }, _this2.onMouseEnterResult = function (e, result) {
  304. // check if we need to prevent the next onFocus event because it was
  305. // probably caused by a mouseover due to scroll position change
  306. if (_this2.ignoreFocus) {
  307. _this2.ignoreFocus = false;
  308. } else {
  309. // we need to make sure focused node is visible
  310. // for some reason mouse events fire on visible nodes due to
  311. // box-shadow
  312. var containerNode = ReactDOM.findDOMNode(_this2);
  313. var scroll = containerNode.scrollTop;
  314. var height = containerNode.offsetHeight;
  315. var node = e.target;
  316. var top = node.offsetTop;
  317. var bottom = top + node.offsetHeight;
  318. if (bottom > scroll && top < scroll + height) {
  319. _this2.props.onFocus(result);
  320. }
  321. }
  322. }, _temp), _possibleConstructorReturn(_this2, _ret);
  323. }
  324. _createClass(Results, [{
  325. key: 'render',
  326. value: function render() {
  327. var style = {
  328. display: this.props.show ? 'block' : 'none',
  329. position: 'absolute',
  330. listStyleType: 'none'
  331. };
  332. var className = this.props.className;
  333. return React.createElement(
  334. 'ul',
  335. { style: style, className: className + " react-autocomplete-Results" },
  336. this.props.results.map(this.renderResult)
  337. );
  338. }
  339. }, {
  340. key: 'componentDidUpdate',
  341. value: function componentDidUpdate() {
  342. this.scrollToFocused();
  343. }
  344. }, {
  345. key: 'componentDidMount',
  346. value: function componentDidMount() {
  347. this.scrollToFocused();
  348. }
  349. }, {
  350. key: 'componentWillMount',
  351. value: function componentWillMount() {
  352. this.ignoreFocus = false;
  353. }
  354. }]);
  355. return Results;
  356. }(React.Component);
  357. var Result = function (_React$Component3) {
  358. _inherits(Result, _React$Component3);
  359. function Result() {
  360. var _ref2;
  361. var _temp2, _this3, _ret2;
  362. _classCallCheck(this, Result);
  363. for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  364. args[_key2] = arguments[_key2];
  365. }
  366. return _ret2 = (_temp2 = (_this3 = _possibleConstructorReturn(this, (_ref2 = Result.__proto__ || Object.getPrototypeOf(Result)).call.apply(_ref2, [this].concat(args))), _this3), _this3.getLabel = function (result) {
  367. if (typeof _this3.props.label === 'function') {
  368. return _this3.props.label(result);
  369. } else if (typeof _this3.props.label === 'string') {
  370. return result[_this3.props.label];
  371. }
  372. }, _this3.onClick = function () {
  373. _this3.props.onClick(_this3.props.result);
  374. }, _this3.onMouseEnter = function (e) {
  375. if (_this3.props.onMouseEnter) {
  376. _this3.props.onMouseEnter(e, _this3.props.result);
  377. }
  378. }, _temp2), _possibleConstructorReturn(_this3, _ret2);
  379. }
  380. _createClass(Result, [{
  381. key: 'render',
  382. value: function render() {
  383. var className = classnames({
  384. 'react-autocomplete-Result': true,
  385. 'react-autocomplete-Result--active': this.props.focused
  386. });
  387. return React.createElement(
  388. 'li',
  389. {
  390. style: { listStyleType: 'none' },
  391. className: className,
  392. onClick: this.onClick,
  393. onMouseEnter: this.onMouseEnter },
  394. React.createElement(
  395. 'a',
  396. null,
  397. this.getLabel(this.props.result)
  398. )
  399. );
  400. }
  401. }, {
  402. key: 'shouldComponentUpdate',
  403. value: function shouldComponentUpdate(nextProps) {
  404. return nextProps.result.id !== this.props.result.id || nextProps.focused !== this.props.focused;
  405. }
  406. }]);
  407. return Result;
  408. }(React.Component);
  409. /**
  410. * Search options using specified search term treating options as an array
  411. * of candidates.
  412. *
  413. * @param {Array.<Object>} options
  414. * @param {String} searchTerm
  415. * @param {Callback} cb
  416. */
  417. Result.defaultProps = {
  418. label: function label(result) {
  419. return result.title;
  420. }
  421. };
  422. function searchArray(options, searchTerm, cb) {
  423. if (!options) {
  424. return cb(null, []);
  425. }
  426. searchTerm = new RegExp(searchTerm, 'i');
  427. var results = [];
  428. for (var i = 0, len = options.length; i < len; i++) {
  429. if (searchTerm.exec(options[i].title)) {
  430. results.push(options[i]);
  431. }
  432. }
  433. cb(null, results);
  434. }
  435. module.exports = Autocomplete;
  436. /***/ }),
  437. /* 1 */
  438. /***/ (function(module, exports, __webpack_require__) {
  439. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  440. Copyright (c) 2015 Jed Watson.
  441. Licensed under the MIT License (MIT), see
  442. http://jedwatson.github.io/classnames
  443. */
  444. function classNames() {
  445. var classes = '';
  446. var arg;
  447. for (var i = 0; i < arguments.length; i++) {
  448. arg = arguments[i];
  449. if (!arg) {
  450. continue;
  451. }
  452. if ('string' === typeof arg || 'number' === typeof arg) {
  453. classes += ' ' + arg;
  454. } else if (Object.prototype.toString.call(arg) === '[object Array]') {
  455. classes += ' ' + classNames.apply(null, arg);
  456. } else if ('object' === typeof arg) {
  457. for (var key in arg) {
  458. if (!arg.hasOwnProperty(key) || !arg[key]) {
  459. continue;
  460. }
  461. classes += ' ' + key;
  462. }
  463. }
  464. }
  465. return classes.substr(1);
  466. }
  467. // safely export classNames for node / browserify
  468. if (typeof module !== 'undefined' && module.exports) {
  469. module.exports = classNames;
  470. }
  471. // safely export classNames for RequireJS
  472. if (true) {
  473. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  474. return classNames;
  475. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  476. }
  477. /***/ }),
  478. /* 2 */
  479. /***/ (function(module, exports) {
  480. "use strict";
  481. /**
  482. * Copyright (c) 2013-present, Facebook, Inc.
  483. *
  484. * This source code is licensed under the MIT license found in the
  485. * LICENSE file in the root directory of this source tree.
  486. *
  487. *
  488. */
  489. function makeEmptyFunction(arg) {
  490. return function () {
  491. return arg;
  492. };
  493. }
  494. /**
  495. * This function accepts and discards inputs; it has no side effects. This is
  496. * primarily useful idiomatically for overridable function endpoints which
  497. * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
  498. */
  499. var emptyFunction = function emptyFunction() {};
  500. emptyFunction.thatReturns = makeEmptyFunction;
  501. emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
  502. emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
  503. emptyFunction.thatReturnsNull = makeEmptyFunction(null);
  504. emptyFunction.thatReturnsThis = function () {
  505. return this;
  506. };
  507. emptyFunction.thatReturnsArgument = function (arg) {
  508. return arg;
  509. };
  510. module.exports = emptyFunction;
  511. /***/ }),
  512. /* 3 */
  513. /***/ (function(module, exports, __webpack_require__) {
  514. /**
  515. * Copyright (c) 2013-present, Facebook, Inc.
  516. *
  517. * This source code is licensed under the MIT license found in the
  518. * LICENSE file in the root directory of this source tree.
  519. *
  520. */
  521. 'use strict';
  522. /**
  523. * Use invariant() to assert state which your program assumes to be true.
  524. *
  525. * Provide sprintf-style format (only %s is supported) and arguments
  526. * to provide information about what broke and what you were
  527. * expecting.
  528. *
  529. * The invariant message will be stripped in production, but the invariant
  530. * will remain to ensure logic does not differ in production.
  531. */
  532. var validateFormat = function validateFormat(format) {};
  533. if (false) {
  534. validateFormat = function validateFormat(format) {
  535. if (format === undefined) {
  536. throw new Error('invariant requires an error message argument');
  537. }
  538. };
  539. }
  540. function invariant(condition, format, a, b, c, d, e, f) {
  541. validateFormat(format);
  542. if (!condition) {
  543. var error;
  544. if (format === undefined) {
  545. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  546. } else {
  547. var args = [a, b, c, d, e, f];
  548. var argIndex = 0;
  549. error = new Error(format.replace(/%s/g, function () {
  550. return args[argIndex++];
  551. }));
  552. error.name = 'Invariant Violation';
  553. }
  554. error.framesToPop = 1; // we don't care about invariant's own frame
  555. throw error;
  556. }
  557. }
  558. module.exports = invariant;
  559. /***/ }),
  560. /* 4 */
  561. /***/ (function(module, exports, __webpack_require__) {
  562. /**
  563. * Copyright (c) 2013-present, Facebook, Inc.
  564. *
  565. * This source code is licensed under the MIT license found in the
  566. * LICENSE file in the root directory of this source tree.
  567. */
  568. 'use strict';
  569. var emptyFunction = __webpack_require__(2);
  570. var invariant = __webpack_require__(3);
  571. var ReactPropTypesSecret = __webpack_require__(6);
  572. module.exports = function() {
  573. function shim(props, propName, componentName, location, propFullName, secret) {
  574. if (secret === ReactPropTypesSecret) {
  575. // It is still safe when called from React.
  576. return;
  577. }
  578. invariant(
  579. false,
  580. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  581. 'Use PropTypes.checkPropTypes() to call them. ' +
  582. 'Read more at http://fb.me/use-check-prop-types'
  583. );
  584. };
  585. shim.isRequired = shim;
  586. function getShim() {
  587. return shim;
  588. };
  589. // Important!
  590. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  591. var ReactPropTypes = {
  592. array: shim,
  593. bool: shim,
  594. func: shim,
  595. number: shim,
  596. object: shim,
  597. string: shim,
  598. symbol: shim,
  599. any: shim,
  600. arrayOf: getShim,
  601. element: shim,
  602. instanceOf: getShim,
  603. node: shim,
  604. objectOf: getShim,
  605. oneOf: getShim,
  606. oneOfType: getShim,
  607. shape: getShim,
  608. exact: getShim
  609. };
  610. ReactPropTypes.checkPropTypes = emptyFunction;
  611. ReactPropTypes.PropTypes = ReactPropTypes;
  612. return ReactPropTypes;
  613. };
  614. /***/ }),
  615. /* 5 */
  616. /***/ (function(module, exports, __webpack_require__) {
  617. /**
  618. * Copyright (c) 2013-present, Facebook, Inc.
  619. *
  620. * This source code is licensed under the MIT license found in the
  621. * LICENSE file in the root directory of this source tree.
  622. */
  623. if (false) {
  624. var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
  625. Symbol.for &&
  626. Symbol.for('react.element')) ||
  627. 0xeac7;
  628. var isValidElement = function(object) {
  629. return typeof object === 'object' &&
  630. object !== null &&
  631. object.$$typeof === REACT_ELEMENT_TYPE;
  632. };
  633. // By explicitly using `prop-types` you are opting into new development behavior.
  634. // http://fb.me/prop-types-in-prod
  635. var throwOnDirectAccess = true;
  636. module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
  637. } else {
  638. // By explicitly using `prop-types` you are opting into new production behavior.
  639. // http://fb.me/prop-types-in-prod
  640. module.exports = __webpack_require__(4)();
  641. }
  642. /***/ }),
  643. /* 6 */
  644. /***/ (function(module, exports) {
  645. /**
  646. * Copyright (c) 2013-present, Facebook, Inc.
  647. *
  648. * This source code is licensed under the MIT license found in the
  649. * LICENSE file in the root directory of this source tree.
  650. */
  651. 'use strict';
  652. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  653. module.exports = ReactPropTypesSecret;
  654. /***/ }),
  655. /* 7 */
  656. /***/ (function(module, exports) {
  657. module.exports = __WEBPACK_EXTERNAL_MODULE_7__;
  658. /***/ }),
  659. /* 8 */
  660. /***/ (function(module, exports) {
  661. module.exports = __WEBPACK_EXTERNAL_MODULE_8__;
  662. /***/ })
  663. /******/ ])
  664. });
  665. ;